Minor tweak

This commit is contained in:
Rainer Simon 2020-05-19 18:18:16 +02:00
parent ad67be30f8
commit d1354ec489
1 changed files with 8 additions and 6 deletions

View File

@ -78,6 +78,7 @@ export const addPolyfills = () => {
* Helper to init the i18n class with a pre-defined or auto-detected locale.
*/
export const setLocale = locale => {
if (locale) {
try {
const l = locale === 'auto' ?
window.navigator.userLanguage || window.navigator.language : locale;
@ -87,3 +88,4 @@ export const setLocale = locale => {
console.warn(`Unsupported locale '${locale}'. Falling back to default en.`);
}
}
}