support icu messageformat for translations
This commit is contained in:
parent
b5c514e1d1
commit
6d56f8b8aa
35 changed files with 839 additions and 104 deletions
|
@ -9,6 +9,7 @@ export type { LocalizerType } from './Util';
|
|||
|
||||
type SmartlingConfigType = {
|
||||
placeholder_format_custom: string;
|
||||
string_format_paths?: string;
|
||||
translate_paths: Array<{
|
||||
key: string;
|
||||
path: string;
|
||||
|
@ -16,15 +17,10 @@ type SmartlingConfigType = {
|
|||
}>;
|
||||
};
|
||||
|
||||
type LocaleMessageType = {
|
||||
message: string;
|
||||
export type LocaleMessageType = {
|
||||
message?: string;
|
||||
messageformat?: string;
|
||||
description?: string;
|
||||
placeholders?: {
|
||||
[name: string]: {
|
||||
content: string;
|
||||
example: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
export type LocaleMessagesType = {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// Copyright 2018-2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { IntlShape } from 'react-intl';
|
||||
import type { UUIDStringType } from './UUID';
|
||||
|
||||
export type BodyRangeType = {
|
||||
|
@ -31,6 +32,8 @@ export type ReplacementValuesType =
|
|||
|
||||
export type LocalizerType = {
|
||||
(key: string, values?: ReplacementValuesType): string;
|
||||
getIntl(): IntlShape;
|
||||
isLegacyFormat(key: string): boolean;
|
||||
getLocale(): string;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue