fmt
This commit is contained in:
@@ -73,11 +73,15 @@ i18n
|
||||
.use(initReactI18next)
|
||||
.init({
|
||||
resources,
|
||||
fallbackLng: 'en',
|
||||
fallbackLng: {
|
||||
zh: ['zh-Hans'], // Map generic Chinese to Simplified Chinese
|
||||
default: ['en'],
|
||||
},
|
||||
defaultNS: 'common',
|
||||
debug: import.meta.env.DEV,
|
||||
supportedLngs: SUPPORTED_I18N_CODES,
|
||||
load: 'languageOnly', // Load 'en' instead of 'en-US' etc.
|
||||
supportedLngs: [...SUPPORTED_I18N_CODES, 'zh'], // Include 'zh' for browser detection
|
||||
nonExplicitSupportedLngs: true, // Accept zh -> zh-Hans mapping
|
||||
load: 'currentOnly', // Load exact language code
|
||||
|
||||
interpolation: {
|
||||
escapeValue: false, // React already escapes
|
||||
|
||||
@@ -14,7 +14,14 @@ export const UI_TO_I18N = {
|
||||
ZH_HANS: 'zh-Hans',
|
||||
} as const;
|
||||
|
||||
const SUPPORTED_UI_LANGUAGES = ['BROWSER', 'EN', 'JA', 'ES', 'KO', 'ZH_HANS'] as const;
|
||||
const SUPPORTED_UI_LANGUAGES = [
|
||||
'BROWSER',
|
||||
'EN',
|
||||
'JA',
|
||||
'ES',
|
||||
'KO',
|
||||
'ZH_HANS',
|
||||
] as const;
|
||||
export const SUPPORTED_I18N_CODES = Object.values(UI_TO_I18N);
|
||||
|
||||
const FALLBACK_ENDONYMS = {
|
||||
|
||||
@@ -85,4 +85,4 @@
|
||||
"errorDescription": "验证您的账户时出现问题",
|
||||
"tryAgain": "重试"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,4 +48,4 @@
|
||||
"openInIDE": "在 IDE 中打开",
|
||||
"createdDate": "创建于 {{date}}",
|
||||
"copyFilesPlaceholderWithSearch": "文件路径或 glob 模式(例如:.env、config/*.json)"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -384,4 +384,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -428,4 +428,4 @@
|
||||
"discardChanges": "放弃更改"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user