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
35 changed files with 839 additions and 104 deletions

View File

@@ -89,6 +89,10 @@ function manualReconnect(): NoopActionType {
};
}
const intlNotSetup = () => {
throw new Error('i18n not yet set up');
};
// Reducer
export function getEmptyState(): UserStateType {
@@ -114,16 +118,11 @@ export function getEmptyState(): UserStateType {
platform: 'unknown',
},
theme: ThemeType.light,
i18n: Object.assign(
() => {
throw new Error('i18n not yet set up');
},
{
getLocale() {
throw new Error('i18n not yet set up');
},
}
),
i18n: Object.assign(intlNotSetup, {
getLocale: intlNotSetup,
getIntl: intlNotSetup,
isLegacyFormat: intlNotSetup,
}),
localeMessages: {},
version: '0.0.0',
};