This commit is contained in:
tamaina
2021-01-21 21:17:22 +09:00
parent 3762cdc8c0
commit 08c2086167
9 changed files with 150 additions and 67 deletions

View File

@@ -33,9 +33,8 @@
}
const res = await fetch(`/assets/locales/${lang}.${v}.json`);
const json = await res.json();
localStorage.setItem('lang', lang);
localStorage.setItem('locale', JSON.stringify(json));
localStorage.setItem('locale', await res.text());
}
//#endregion
@@ -73,6 +72,10 @@
head.appendChild(script);
//#endregion
//#region Service Worker
navigator.serviceWorker.register(`/sw.${v}.js`)
//#endregion
//#region Theme
const theme = localStorage.getItem('theme');
if (theme) {