chore: add more language supports

This commit is contained in:
Junyan Qin
2026-03-28 20:48:36 +08:00
parent 99e2976826
commit dddfa8ac79
14 changed files with 3758 additions and 0 deletions
+9
View File
@@ -27,6 +27,9 @@ export const extractI18nObject = (i18nObject: I18nObject): string => {
if (language === 'zh_Hans' && i18nObject.zh_Hans) return i18nObject.zh_Hans;
if (language === 'zh_Hant' && i18nObject.zh_Hant) return i18nObject.zh_Hant;
if (language === 'ja_JP' && i18nObject.ja_JP) return i18nObject.ja_JP;
if (language === 'th_TH' && i18nObject.th_TH) return i18nObject.th_TH;
if (language === 'vi_VN' && i18nObject.vi_VN) return i18nObject.vi_VN;
if (language === 'es_ES' && i18nObject.es_ES) return i18nObject.es_ES;
return (
i18nObject.en_US ||
i18nObject.zh_Hans ||
@@ -49,6 +52,12 @@ export const getAPILanguageCode = (): string => {
if (language === 'en-US') return 'en';
// ja-JP -> ja_JP
if (language === 'ja-JP') return 'ja_JP';
// th-TH -> th_TH
if (language === 'th-TH') return 'th_TH';
// vi-VN -> vi_VN
if (language === 'vi-VN') return 'vi_VN';
// es-ES -> es_ES
if (language === 'es-ES') return 'es_ES';
// 默认返回 en
return 'en';
};