Minor tweak
This commit is contained in:
parent
ad67be30f8
commit
d1354ec489
|
@ -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.`);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue