mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-30 12:13:08 +02:00
parent
dc4fd3e505
commit
bd469420fa
2 changed files with 14 additions and 0 deletions
|
@ -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を機能させる
|
// タッチデバイスでCSSの:hoverを機能させる
|
||||||
document.addEventListener('touchend', () => {}, { passive: true });
|
document.addEventListener('touchend', () => {}, { passive: true });
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ type Keys =
|
||||||
'fontSize' |
|
'fontSize' |
|
||||||
'ui' |
|
'ui' |
|
||||||
'locale' |
|
'locale' |
|
||||||
|
'localeVersion' |
|
||||||
'theme' |
|
'theme' |
|
||||||
'customCss' |
|
'customCss' |
|
||||||
'message_drafts' |
|
'message_drafts' |
|
||||||
|
|
Loading…
Reference in a new issue