Always fetch locales when initiating client
This commit is contained in:
parent
582a9d510e
commit
c6aad324a0
|
@ -22,13 +22,9 @@
|
||||||
renderError('SOMETHING_HAPPENED_IN_PROMISE', e);
|
renderError('SOMETHING_HAPPENED_IN_PROMISE', e);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//#region Detect language & fetch translations
|
||||||
const v = localStorage.getItem('v') || VERSION;
|
const v = localStorage.getItem('v') || VERSION;
|
||||||
|
|
||||||
//#region Detect language & fetch translations
|
|
||||||
const localeVersion = localStorage.getItem('localeVersion');
|
|
||||||
const localeOutdated = (localeVersion == null || localeVersion !== v);
|
|
||||||
|
|
||||||
if (!localStorage.hasOwnProperty('locale') || localeOutdated) {
|
|
||||||
const supportedLangs = LANGS;
|
const supportedLangs = LANGS;
|
||||||
let lang = localStorage.getItem('lang');
|
let lang = localStorage.getItem('lang');
|
||||||
if (lang == null || !supportedLangs.includes(lang)) {
|
if (lang == null || !supportedLangs.includes(lang)) {
|
||||||
|
@ -52,7 +48,6 @@
|
||||||
renderError('LOCALE_FETCH');
|
renderError('LOCALE_FETCH');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
//#region Script
|
//#region Script
|
||||||
|
|
Loading…
Reference in New Issue