diff --git a/src/providers/lang.ts b/src/providers/lang.ts index a4821245d..363a245cd 100644 --- a/src/providers/lang.ts +++ b/src/providers/lang.ts @@ -173,7 +173,7 @@ export class CoreLangProvider { return language; }).catch(() => { // User hasn't defined a language. If default language is forced, use it. - if (CoreConfigConstants.default_lang && !CoreConfigConstants.forcedefaultlanguage) { + if (CoreConfigConstants.default_lang && CoreConfigConstants.forcedefaultlanguage) { return CoreConfigConstants.default_lang; } @@ -190,6 +190,11 @@ export class CoreLangProvider { } } + if (typeof CoreConfigConstants.languages[language] == 'undefined') { + // Language not supported, use fallback language. + return this.fallbackLanguage; + } + return language; }).catch(() => { // Error getting locale. Use default language.