From af7a53069a4ffb8f041b785d89fe0fcb9f4ca63d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Thu, 5 Mar 2020 23:02:04 +0100 Subject: added i18n, converted HTML files, TODO: js UI responses, TODO: translations So basically, multilanguage support from an JavaScript object. - only slovenian and english - no change language UI yet - only HTML strings are actually translated \- all text is translated, but javascript M.toast and other similar stuff does not pass trough s(), d(), S() and D() functions yet - how to i18n: - add a string to js/lang/bundle.js TO ALL LANGUAGES (translation mgmt sys will have to be created) - HTML: create tags, where 1st ? tells wether to just output the string (s) without dot suffix or (d) to try and append a . (for sentences and paragraphs) if it is not there yet. second ? tells wether to leave lowercase strings (l) or (u) to force the first character of the string be uppercase (capitalize()). - put the key of your string as the innerHTML of the x-?? element. - JS: S("key") and D("key") return capitalized, s() and d() do not change case. --- js/meals.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/meals.js') diff --git a/js/meals.js b/js/meals.js index ec810f3..e41756b 100644 --- a/js/meals.js +++ b/js/meals.js @@ -3,7 +3,7 @@ const jsDateDayString = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", const jsDateMonthString = ["January", "February", "March", "April", "May", "June", "July", "August", "October", "November", "December"]; async function checkLogin() { localforage.getItem("logged_in_lopolis").then((value) => { - if (value !== true) { + if (value != true) { document.getElementById("meals-container").hidden = true; document.getElementById("meals-login").hidden = false; } else { -- cgit v1.2.3