diff options
author | Anton Luka Šijanec <sijanecantonluka@gmail.com> | 2020-03-06 22:04:10 +0100 |
---|---|---|
committer | Anton Luka Šijanec <sijanecantonluka@gmail.com> | 2020-03-06 22:04:10 +0100 |
commit | 3b288cc59b6528550fb5a818ac98a75ac758078c (patch) | |
tree | 17e558b0e61b40434f67620f51f071238a9fb6b3 /js/lang | |
parent | gitignore update for nano swp and save file (diff) | |
download | beziapp-3b288cc59b6528550fb5a818ac98a75ac758078c.tar beziapp-3b288cc59b6528550fb5a818ac98a75ac758078c.tar.gz beziapp-3b288cc59b6528550fb5a818ac98a75ac758078c.tar.bz2 beziapp-3b288cc59b6528550fb5a818ac98a75ac758078c.tar.lz beziapp-3b288cc59b6528550fb5a818ac98a75ac758078c.tar.xz beziapp-3b288cc59b6528550fb5a818ac98a75ac758078c.tar.zst beziapp-3b288cc59b6528550fb5a818ac98a75ac758078c.zip |
Diffstat (limited to 'js/lang')
-rw-r--r-- | js/lang/bundle.js | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/js/lang/bundle.js b/js/lang/bundle.js index b68c22a..1cd8f95 100644 --- a/js/lang/bundle.js +++ b/js/lang/bundle.js @@ -1,5 +1,15 @@ // there's an DoS backdoor in BežiApp because of this (-:< var chosenLang; +var dateString = { + day: (danv) => { + let dnevitedna = [S("sunday"), S("monday"), S("tuesday"), S("wednesday"), S("thursday"), S("friday"), S("saturday")]; + return dnevitedna[danv]; + }, + month: (mesl) => { + let mesecileta = [S("january"), S("february"), S("march"), S("april"), S("may"), S("june"), S("july"), S("august"), S("september"), S("october"), S("november"), S("december")]; + return mesecileta[mesl]; + } +}; async function refreshLangDOM() { let promises_to_runn = [ localforage.getItem("chosenLang").then( (value) => { @@ -45,13 +55,14 @@ async function setLangConfigAndReload() { window.location.reload(); } window.addEventListener('DOMContentLoaded', (event) => { - refreshLangDOM(); localforage.getItem("chosenLang").then( (value) => { if(value == null) { setLangConfigAndReload(); + } else { + chosenLang = value; } - } - ); + }); + refreshLangDOM(); }); const capitalize = (s) => { if (typeof s !== 'string') return '' |