Refactor fetching header for difference between applet and transaction mode.

Improve locale_strings map by re json.encode.
Add method to put translation jsons into txn var and read with a json_query fetch inside template files not served by a lua view e.g. maintenance page
This commit is contained in:
Thomas Lynch
2023-05-21 15:18:32 +10:00
parent c93ca7f16c
commit 14922d7e2f
11 changed files with 127 additions and 91 deletions

View File

@@ -2,7 +2,7 @@
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Maintenance Mode</title>
<title>%[var(txn.lang_json),json_query($.Maintenance Mode)]</title>
<style type="text/css">
:root{--text-color:#c5c8c6;--bg-color:#1d1f21}
@media (prefers-color-scheme:light){:root{--text-color:#333;--bg-color:#fff}}
@@ -18,11 +18,11 @@ footer{font-size:x-small;margin-top:auto;padding:10px;text-align:center;border-t
<body>
<h3 class="pt">
<img src="/.basedflare/pow-icon" width="64" height="64" alt=" ">
Under maintenance. Please try again soon!
%[var(txn.lang_json),json_query($.Under maintenance\. Please try again soon!)]
</h3>
<footer>
<p>Node: <code>%[env(RAY_ID)]</code></p>
<p>Performance & security by <a href="https://basedflare.com" rel="noreferrer noopener" target="_blank">BasedFlare</a></p>
<p>%[var(txn.lang_json),json_query($.Performance & security by BasedFlare)]</p>
</footer>
</body>
</html>