t-comm
Version:
专业、稳定、纯粹的工具库
98 lines (94 loc) • 2.12 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
/**
* i18n 国际化配置
*/
// ti18n 需要的 key(LANG_CDN_MAP 的 value)
var TI18N_KEYS = ['en', 'ru', 'pt-BR', 'th', 'vi', 'zh', 'zh-HK', 'zh-TW', 'de', 'id', 'fr', 'es', 'tr', 'ar', 'ms', 'uz', 'ur'];
// Excel 首行常见的语言名称 → ti18n key 的映射
// 支持多种可能的写法(忽略大小写匹配)
var LANG_NAME_TO_TI18N_KEY = {
// 中文/key 列
key: 'zh',
zh: 'zh',
中文: 'zh',
chinese: 'zh',
'simplified chinese': 'zh',
简体中文: 'zh',
// 英语
en: 'en',
english: 'en',
英语: 'en',
// 俄语
ru: 'ru',
russian: 'ru',
俄语: 'ru',
// 葡萄牙语(巴西)
pt: 'pt-BR',
'pt-br': 'pt-BR',
portuguese: 'pt-BR',
'portuguese (brazil)': 'pt-BR',
葡萄牙语: 'pt-BR',
// 泰语
th: 'th',
thai: 'th',
泰语: 'th',
// 越南语
vi: 'vi',
vietnamese: 'vi',
越南语: 'vi',
// 繁体中文(香港)
hk: 'zh-HK',
'zh-hk': 'zh-HK',
'chinese(hong kong)': 'zh-HK',
'chinese (hong kong)': 'zh-HK',
'traditional chinese (hong kong)': 'zh-HK',
繁体中文香港: 'zh-HK',
'繁体中文(香港)': 'zh-HK',
// 繁体中文(台湾)
tw: 'zh-TW',
'zh-tw': 'zh-TW',
'chinese(taiwan)': 'zh-TW',
'chinese (taiwan)': 'zh-TW',
'traditional chinese (taiwan)': 'zh-TW',
繁体中文台湾: 'zh-TW',
'繁体中文(台湾)': 'zh-TW',
// 德语
de: 'de',
german: 'de',
德语: 'de',
// 印尼语
id: 'id',
indonesian: 'id',
印尼语: 'id',
// 法语
fr: 'fr',
french: 'fr',
法语: 'fr',
// 西班牙语
es: 'es',
spanish: 'es',
西班牙语: 'es',
// 土耳其语
tr: 'tr',
turkish: 'tr',
土耳其语: 'tr',
// 阿拉伯语
ar: 'ar',
arabic: 'ar',
阿拉伯语: 'ar',
// 马来语
ms: 'ms',
malay: 'ms',
马来语: 'ms',
// 乌兹别克语
uz: 'uz',
uzbek: 'uz',
乌兹别克语: 'uz',
// 乌尔都语
ur: 'ur',
urdu: 'ur',
乌尔都语: 'ur'
};
exports.LANG_NAME_TO_TI18N_KEY = LANG_NAME_TO_TI18N_KEY;
exports.TI18N_KEYS = TI18N_KEYS;