diff options
Diffstat (limited to 'src/locale/helpers.ts')
-rw-r--r-- | src/locale/helpers.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/locale/helpers.ts b/src/locale/helpers.ts index 433dbaec6..dddd6855c 100644 --- a/src/locale/helpers.ts +++ b/src/locale/helpers.ts @@ -22,6 +22,14 @@ export function code3ToCode2(lang: string): string { return lang } +export function code3ToCode2Strict(lang: string): string | undefined { + if (lang.length === 3) { + return LANGUAGES_MAP_CODE3[lang]?.code2 + } + + return undefined +} + export function codeToLanguageName(lang: string): string { const lang2 = code3ToCode2(lang) return LANGUAGES_MAP_CODE2[lang2]?.name || lang @@ -129,6 +137,8 @@ export function sanitizeAppLanguageSetting(appLanguage: string): AppLanguage { return AppLanguage.pt_BR case 'uk': return AppLanguage.uk + case 'ca': + return AppLanguage.ca default: continue } |