support icu messageformat for translations

This commit is contained in:
Jamie Kyle 2022-10-03 14:19:54 -07:00 committed by GitHub
parent b5c514e1d1
commit 6d56f8b8aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 839 additions and 104 deletions

View file

@ -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 = {

View file

@ -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;
};