mirror of
https://github.com/zoriya/flood.git
synced 2026-06-03 19:21:48 +00:00
i18n: properly handle language fallback
This commit is contained in:
@@ -31,11 +31,6 @@
|
||||
"zh-Hant"
|
||||
],
|
||||
"sourceLocale": "en",
|
||||
"fallbackLocales": {
|
||||
"zh-Hans": "zh-Hant",
|
||||
"zh-Hant": "zh-Hans",
|
||||
"default": "en"
|
||||
},
|
||||
"catalogs": [
|
||||
{
|
||||
"path": "client/src/javascript/i18n/strings/{locale}",
|
||||
|
||||
@@ -64,7 +64,7 @@ const AsyncIntlProvider: FC<AsyncIntlProviderProps> = observer(({children}: Asyn
|
||||
} else {
|
||||
i18n.loadLocaleData(validatedLocale.locale, {plurals: plurals[validatedLocale.language]});
|
||||
}
|
||||
i18n.load(validatedLocale.locale, await getMessages(validatedLocale.language));
|
||||
i18n.load(validatedLocale.locale, {...EN, ...(await getMessages(validatedLocale.language))});
|
||||
i18n.activate(validatedLocale.locale);
|
||||
})();
|
||||
}, [language]);
|
||||
|
||||
Reference in New Issue
Block a user