Skip to content
Snippets Groups Projects
Commit bd469420 authored by syuilo's avatar syuilo
Browse files

fix(client): クライアント起動時にも言語ファイルのチェックを行うように

Fix #9005
parent dc4fd3e5
No related branches found
No related tags found
No related merge requests found
......@@ -80,6 +80,19 @@ import { claimAchievement, claimedAchievements } from './scripts/achievements';
});
}
//#region Detect language & fetch translations
const localeVersion = miLocalStorage.getItem('localeVersion');
const localeOutdated = (localeVersion == null || localeVersion !== version);
if (localeOutdated) {
const res = await window.fetch(`/assets/locales/${lang}.${version}.json`);
if (res.status === 200) {
miLocalStorage.setItem('locale', await res.text());
miLocalStorage.setItem('localeVersion', version);
location.reload();
}
}
//#endregion
// タッチデバイスでCSSの:hoverを機能させる
document.addEventListener('touchend', () => {}, { passive: true });
......
......@@ -19,6 +19,7 @@ type Keys =
'fontSize' |
'ui' |
'locale' |
'localeVersion' |
'theme' |
'customCss' |
'message_drafts' |
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment