diff --git a/front/js/pialert_common.js b/front/js/pialert_common.js index d78b6330..152ff569 100755 --- a/front/js/pialert_common.js +++ b/front/js/pialert_common.js @@ -96,6 +96,28 @@ function deleteAllCookies() { } +// ----------------------------------------------------------------------------- +// Get language string +// ----------------------------------------------------------------------------- +function cacheStrings() +{ + $.get('api/table_language_strings.json', function(res) { + + data = res["data"]; + + data.forEach((langString) => { + // console.log(langString) + setCache(`pia_lang_${langString.String_Key}`, langString.String_Value, expirationMinutes='1440') // expire in a day + }); + + + }) +} + +function getString (key) { + return getCache(`pia_lang_${key}`) +} + // ----------------------------------------------------------------------------- // Modal dialog handling // ----------------------------------------------------------------------------- @@ -369,6 +391,9 @@ function navigateToDeviceWithIp (ip) { }); } - +// initialize +cacheStrings() + +console.log("init pialert_common.js") diff --git a/front/settings.php b/front/settings.php index 6a53c9f5..0d75d02d 100755 --- a/front/settings.php +++ b/front/settings.php @@ -51,6 +51,11 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) { ?> + + + + +
@@ -326,7 +331,7 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) { $html = $html.'
'; } - echo $html; + // echo $html; ?> @@ -347,8 +352,143 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) { require 'php/templates/footer.php'; ?> + +