diff options
author | Anton Luka Šijanec <sijanecantonluka@gmail.com> | 2020-03-10 16:25:29 +0100 |
---|---|---|
committer | Anton Luka Šijanec <sijanecantonluka@gmail.com> | 2020-03-10 16:25:29 +0100 |
commit | 190f3aaf31fdfba96b0f5ff91dcbe4aba58dac71 (patch) | |
tree | 6cb41125b119687b725c05ddc318837fa72930a6 /js | |
parent | 1.0.11.7 (diff) | |
download | beziapp-190f3aaf31fdfba96b0f5ff91dcbe4aba58dac71.tar beziapp-190f3aaf31fdfba96b0f5ff91dcbe4aba58dac71.tar.gz beziapp-190f3aaf31fdfba96b0f5ff91dcbe4aba58dac71.tar.bz2 beziapp-190f3aaf31fdfba96b0f5ff91dcbe4aba58dac71.tar.lz beziapp-190f3aaf31fdfba96b0f5ff91dcbe4aba58dac71.tar.xz beziapp-190f3aaf31fdfba96b0f5ff91dcbe4aba58dac71.tar.zst beziapp-190f3aaf31fdfba96b0f5ff91dcbe4aba58dac71.zip |
Diffstat (limited to 'js')
-rw-r--r-- | js/lang/bundle.js | 8 | ||||
-rw-r--r-- | js/settings.js | 17 |
2 files changed, 22 insertions, 3 deletions
diff --git a/js/lang/bundle.js b/js/lang/bundle.js index 84698bc..c4c3a0b 100644 --- a/js/lang/bundle.js +++ b/js/lang/bundle.js @@ -260,7 +260,8 @@ var langstrings = { privacyAcceptWithUse: "your continued use of our website will be regarded as acceptance of our practices around privacy and personal information. If you have any questions about how we handle user data and personal information, feel free to contact us.", privacyEffectiveAsOf: "this policy is effective as of", // settings - language: "language" + language: "language", + languageSet: "language set, open another page for the changes to take effect" }, sl: { miscTranslationLanguage: "slovenščina", @@ -418,6 +419,7 @@ var langstrings = { privacyRefuse: "you are free to refuse our request for your personal information, with the understanding that we may be unable to provide you with some of your desired services.", privacyAcceptWithUse: "your continued use of our website will be regarded as acceptance of our practices around privacy and personal information. If you have any questions about how we handle user data and personal information, feel free to contact us.", privacyEffectiveAsOf: "this policy is effective as of", - language: "jezik" - }, + language: "jezik", + languageSet: "jezik nastavljen, odprite neko drugo stran da se pokažejo spremembe" + } } diff --git a/js/settings.js b/js/settings.js new file mode 100644 index 0000000..41c9df1 --- /dev/null +++ b/js/settings.js @@ -0,0 +1,17 @@ +// settings.js -- TODO + +async function setLanguage(langCode) { + localforage.setItem("chosenLang", langCode).then( () => { + UIAlert(D("languageSet"), "setLanguage(): languageSet"); + }); +} + +document.addEventListener("DOMContentLoaded", async () => { + $(document).on("click",".settings-language-selector", function () { + let languageToSet = $(this).attr('data-language'); + setLanguage(languageToSet); + }); + // Setup side menu + const menus = document.querySelectorAll(".side-menu"); + M.Sidenav.init(menus, { edge: "right", draggable: true }); +}); |