summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--js/lang/bundle.js8
-rw-r--r--js/settings.js17
-rw-r--r--pages/changelog.html7
-rw-r--r--pages/settings.html60
-rw-r--r--sw.js4
5 files changed, 63 insertions, 33 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 });
+});
diff --git a/pages/changelog.html b/pages/changelog.html
index ee1c3d7..ad4c9e8 100644
--- a/pages/changelog.html
+++ b/pages/changelog.html
@@ -48,6 +48,13 @@
<h3><x-su>changelog</x-su></h3>
<ul class="collapsible">
<li>
+ <div class="collapsible-header">Version 1.0.12-beta</div>
+ <div class="collapsible-body">
+ <ul class="collection">
+ <li class="collection-item">Added multilanguage support</li>
+ </ul>
+ </div>
+
<div class="collapsible-header">Version 1.0.11-beta</div> <!-- i think -->
<div class="collapsible-body">
<ul class="collection">
diff --git a/pages/settings.html b/pages/settings.html
index 796ea0d..9d8aaa6 100644
--- a/pages/settings.html
+++ b/pages/settings.html
@@ -72,39 +72,41 @@
<li class="collection-header">
<h5><x-su>language</x-su></h5>
</li>
- <li class="collection-item waves-effect">
+ <li data-language="sl" class="settings-language-selector collection-item waves-effect">
<span class="title about-text">Slovenščina</span>
</li>
- <li class="collection-item waves-effect">
- <span class="title about-text">Srpskohrvatski</span>
- </li>
- <li class="collection-item waves-effect">
- <span class="title about-text">Македонски</span>
- </li>
- <li class="collection-item waves-effect">
+ <li date-language="en" class="collection-item waves-effect">
<span class="title about-text">English</span>
</li>
- <li class="collection-item waves-effect">
- <span class="title about-text">Français</span>
- </li>
- <li class="collection-item waves-effect">
- <span class="title about-text">Deutsch</span>
- </li>
- <li class="collection-item waves-effect">
- <span class="title about-text">Español</span>
- </li>
- <li class="collection-item waves-effect">
- <span class="title about-text">Русский</span>
- </li>
- <li class="collection-item waves-effect">
- <span class="title about-text">汉语</span>
- </li>
- <li class="collection-item waves-effect">
- <span class="title about-text">日本語</span>
- </li>
- <li class="collection-item waves-effect">
- <span class="title about-text">Lingua latīna</span>
- </li>
+ <!--
+ <li class="collection-item waves-effect">
+ <span class="title about-text">Srpskohrvatski</span>
+ </li>
+ <li class="collection-item waves-effect">
+ <span class="title about-text">Македонски</span>
+ </li>
+ <li class="collection-item waves-effect">
+ <span class="title about-text">Français</span>
+ </li>
+ <li class="collection-item waves-effect">
+ <span class="title about-text">Deutsch</span>
+ </li>
+ <li class="collection-item waves-effect">
+ <span class="title about-text">Español</span>
+ </li>
+ <li class="collection-item waves-effect">
+ <span class="title about-text">Русский</span>
+ </li>
+ <li class="collection-item waves-effect">
+ <span class="title about-text">汉语</span>
+ </li>
+ <li class="collection-item waves-effect">
+ <span class="title about-text">日本語</span>
+ </li>
+ <li class="collection-item waves-effect">
+ <span class="title about-text">Lingua latīna</span>
+ </li>
+ -->
</ul>
</div>
</div>
diff --git a/sw.js b/sw.js
index f72f589..ca1697e 100644
--- a/sw.js
+++ b/sw.js
@@ -1,5 +1,5 @@
// Change version to cause cache refresh
-const static_cache_name = "site-static-v1.0.11.7";
+const static_cache_name = "site-static-v1.0.12";
// Tukej ne met notr directory namov, samo imena fajlov,
// ker v primeru index.html to prpele do double-cachinga, oz. do velik 404
@@ -46,6 +46,7 @@ const assets = [
"/js/login.js",
"/js/app.js",
"/js/meals.js",
+ "/js/settings.js",
"/js/lang/bundle.js",
"/js/lib/materialize.min.js",
@@ -75,6 +76,7 @@ const assets = [
"/pages/privacypolicy.html",
"/pages/tos.html",
"/pages/meals.html",
+ "/pages/settings.html",
"/manifest.json",
"/index.html",