diff options
| author | HJ <30-hj@users.noreply.git.pleroma.social> | 2022-12-23 13:31:18 +0000 |
|---|---|---|
| committer | HJ <30-hj@users.noreply.git.pleroma.social> | 2022-12-23 13:31:18 +0000 |
| commit | 3a507ba9b2fde594950a09c9d7934d54561a187c (patch) | |
| tree | 450f241149cae93c602819db824cef0d39842979 /src/i18n/languages.js | |
| parent | b13d8f7e6339e877a38a28008630dc8ec64abcdf (diff) | |
| parent | 25e628efe265db583797fe1c10fdcab2f0d9cc9d (diff) | |
Merge branch 'develop' into 'master'
Update stable - 2.5.0 release
See merge request pleroma/pleroma-fe!1711
Diffstat (limited to 'src/i18n/languages.js')
| -rw-r--r-- | src/i18n/languages.js | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/i18n/languages.js b/src/i18n/languages.js new file mode 100644 index 00000000..250b3b1a --- /dev/null +++ b/src/i18n/languages.js @@ -0,0 +1,53 @@ + +const languages = [ + 'ar', + 'ca', + 'cs', + 'de', + 'eo', + 'en', + 'es', + 'et', + 'eu', + 'fi', + 'fr', + 'ga', + 'he', + 'hu', + 'it', + 'ja', + 'ja_easy', + 'ko', + '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 +} |
