Merge pull request #1414 from dpalou/MOBILE-2510
MOBILE-2510 lang: Fix forcing default lang when wasn't neededmain
commit
72162667b5
|
@ -173,7 +173,7 @@ export class CoreLangProvider {
|
||||||
return language;
|
return language;
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
// User hasn't defined a language. If default language is forced, use it.
|
// 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;
|
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;
|
return language;
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
// Error getting locale. Use default language.
|
// Error getting locale. Use default language.
|
||||||
|
|
Loading…
Reference in New Issue