mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
fix(i18n): Fix Chinese language issues and hyphenated locale persistence
- Fix missing Chinese translations in main-zh-CN.json and main-zh-TW.json - Fix language selection not persisting for hyphenated locales (zh-CN, zh-TW, es-US, fr-CA, pt-BR) - Update normalizeCurrentLanguage to check exact match before normalization
This commit is contained in:
@@ -80,7 +80,7 @@ const options: i18next.InitOptions = {
|
||||
interpolation: {
|
||||
escapeValue: false // not needed for react as it escapes by default
|
||||
},
|
||||
load: 'languageOnly',
|
||||
load: 'all',
|
||||
ns: [ 'main', 'languages', 'countries', 'translation-languages' ],
|
||||
react: {
|
||||
// re-render when a new resource bundle is added
|
||||
|
||||
@@ -96,6 +96,11 @@ function normalizeCurrentLanguage(language: string) {
|
||||
return;
|
||||
}
|
||||
|
||||
// First check if the language code exists as-is (e.g., 'zh-CN', 'fr-CA')
|
||||
if (LANGUAGES.includes(language)) {
|
||||
return language;
|
||||
}
|
||||
|
||||
const [ country, lang ] = language.split('-');
|
||||
const jitsiNormalized = `${country}${lang ?? ''}`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user