Update the locale when version or language changed (#3263)

This commit is contained in:
MeiMei 2018-11-16 17:13:22 +09:00 committed by syuilo
parent 81312f5a93
commit fa66b79e2d

View file

@ -69,11 +69,14 @@
//#endregion
let locale = localStorage.getItem('locale');
if (locale == null) {
const localeKey = localStorage.getItem('localeKey');
if (locale == null || localeKey != `${ver}.${lang}`) {
const locale = await fetch(`/assets/locales/${lang}.json?ver=${ver}`)
.then(response => response.json());
localStorage.setItem('locale', JSON.stringify(locale));
localStorage.setItem('localeKey', `${ver}.${lang}`);
}
// Detect the user agent