add localization for left menu and dialogs

This commit is contained in:
Stewart Allen 2021-02-23 00:08:45 -05:00
commit 7cf18ef9ce
3 changed files with 136 additions and 62 deletions

View file

@ -2535,6 +2535,17 @@
// by any future script loads (above)
KIRI.lang.set();
// update static html elements with language overrides
for (let el of [...DOC.querySelectorAll("[lk]")]) {
let key = el.getAttribute('lk');
let val = LANG[key];
if (val) {
el.innerText = val;
} else {
console.log({missing_ln: key});
}
}
// schedule init_one to run after all page content is loaded
// unless a languge script is loading first, in which case it
// will call init once it's done (or failed)