mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-12 16:56:02 +00:00
feat(i18n): add Russian (ru-RU) language support
This commit is contained in:
@@ -28,6 +28,7 @@ export const extractI18nObject = (i18nObject: I18nObject): string => {
|
||||
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;
|
||||
if (language === 'ru_RU' && i18nObject.ru_RU) return i18nObject.ru_RU;
|
||||
return (
|
||||
i18nObject.en_US ||
|
||||
i18nObject.zh_Hans ||
|
||||
@@ -56,6 +57,8 @@ export const getAPILanguageCode = (): string => {
|
||||
if (language === 'vi-VN') return 'vi_VN';
|
||||
// es-ES -> es_ES
|
||||
if (language === 'es-ES') return 'es_ES';
|
||||
// ru-RU -> ru_RU
|
||||
if (language === 'ru-RU') return 'ru_RU';
|
||||
// 默认返回 en
|
||||
return 'en';
|
||||
};
|
||||
|
||||
@@ -9,6 +9,7 @@ import jaJP from './locales/ja-JP';
|
||||
import thTH from './locales/th-TH';
|
||||
import viVN from './locales/vi-VN';
|
||||
import esES from './locales/es-ES';
|
||||
import ruRU from './locales/ru-RU';
|
||||
|
||||
i18n
|
||||
.use(LanguageDetector)
|
||||
@@ -36,6 +37,31 @@ i18n
|
||||
'es-ES': {
|
||||
translation: esES,
|
||||
},
|
||||
'ru-RU': {
|
||||
translation: ruRU,
|
||||
},
|
||||
},
|
||||
'zh-Hans': {
|
||||
translation: zhHans,
|
||||
},
|
||||
'zh-Hant': {
|
||||
translation: zhHant,
|
||||
},
|
||||
'ja-JP': {
|
||||
translation: jaJP,
|
||||
},
|
||||
'th-TH': {
|
||||
translation: thTH,
|
||||
},
|
||||
'vi-VN': {
|
||||
translation: viVN,
|
||||
},
|
||||
'es-ES': {
|
||||
translation: esES,
|
||||
},
|
||||
'ru-RU': {
|
||||
translation: ruRU,
|
||||
},
|
||||
},
|
||||
fallbackLng: 'zh-Hans',
|
||||
debug: process.env.NODE_ENV === 'development',
|
||||
|
||||
1272
web/src/i18n/locales/ru-RU.ts
Normal file
1272
web/src/i18n/locales/ru-RU.ts
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user