ee01393b5f
- /src/i18n/languages.js - /src/services/locale/locale.service.js
54 lines
714 B
JavaScript
54 lines
714 B
JavaScript
const languages = [
|
|
'ar',
|
|
'ca',
|
|
'cs',
|
|
'de',
|
|
'eo',
|
|
'en',
|
|
'es',
|
|
'et',
|
|
'eu',
|
|
'fi',
|
|
'fr',
|
|
'ga',
|
|
'he',
|
|
'hu',
|
|
'it',
|
|
'ja',
|
|
'ja_easy',
|
|
'ko',
|
|
'nan-TW',
|
|
'nb',
|
|
'nl',
|
|
'oc',
|
|
'pl',
|
|
'pt',
|
|
'ro',
|
|
'ru',
|
|
'sk',
|
|
'te',
|
|
'uk',
|
|
'zh',
|
|
'zh_Hant'
|
|
]
|
|
|
|
const specialJsonName = {
|
|
ja: 'ja_pedantic'
|
|
}
|
|
|
|
const langCodeToJsonName = (code) => specialJsonName[code] || code
|
|
|
|
const langCodeToCldrName = (code) => code
|
|
|
|
const ensureFinalFallback = codes => {
|
|
const codeList = Array.isArray(codes) ? codes : [codes]
|
|
return codeList.includes('en') ? codeList : codeList.concat(['en'])
|
|
}
|
|
|
|
module.exports = {
|
|
languages,
|
|
langCodeToJsonName,
|
|
langCodeToCldrName,
|
|
ensureFinalFallback
|
|
}
|