feat: update locale to be more smart
This commit is contained in:
parent
4dd1cf209b
commit
ff01197ee6
5 changed files with 98 additions and 30 deletions
22
test.html
22
test.html
|
@ -1,22 +1,32 @@
|
|||
<html
|
||||
x0-mods="locale,copy,http"
|
||||
x0-module-root="./modules/"
|
||||
x0-init="false"
|
||||
x1-locale-file="./test.json"
|
||||
x1-locale-watch
|
||||
x0-locale-file="./test.json"
|
||||
x0-locale-watch
|
||||
>
|
||||
<body>
|
||||
<button onclick="window.x0.update()">Update x0</button>
|
||||
<button onclick="window.location.reload()">Reload page</button>
|
||||
<button onclick="window.location.reload()" x-locale-key="debug-tools.reload">Reload page</button>
|
||||
<input type="text" onfocus="this.value = document.querySelector('html').getAttribute('x0-mods')" onchange="document.querySelector('html').setAttribute('x0-mods', this.value); document.querySelector('#status').innerHTML='updated x0-mods'; window.x0.update(); setInterval(() => document.querySelector('#status').innerHTML = '', 500)">
|
||||
<span id="status"></span>
|
||||
|
||||
<h1 x-locale-key="main.greeting"></h1>
|
||||
<h1 x-locale-key="main.greeting">main.greeting</h1>
|
||||
<div>
|
||||
<h2 x-locale-key="copy-section.header"></h2>
|
||||
|
||||
<div id="ex">
|
||||
<span x-locale-key="copy-section.content-span"></span>
|
||||
<span x-locale-key="copy-section.content-span">origin</span>
|
||||
<span x-locale-key="copy-section.content-span">duplicate</span>
|
||||
<span x-locale-key="copy-section.content-span">duplicate</span>
|
||||
<span x-locale-key="copy-section.content-span">duplicate</span>
|
||||
<span x-locale-key="copy-section.content-span">duplicate</span>
|
||||
<span x-locale-key="copy-section.content-span">duplicate</span>
|
||||
<span x-locale-key="copy-section.content-span">duplicate</span>
|
||||
<span x-locale-key="copy-section.content-span">duplicate</span>
|
||||
<span x-locale-key="copy-section.content-span">duplicate</span>
|
||||
<span x-locale-key="copy-section.content-span">duplicate</span>
|
||||
<span x-locale-key="copy-section.content-span">duplicate</span>
|
||||
<span x-locale-key="copy-section.content-span">duplicate</span>
|
||||
</div>
|
||||
<div x-copy-query="#ex"></div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue