annotate language with kiri version to prevent cache corruption
This commit is contained in:
parent
3f5ccf5158
commit
ef2ef3b219
1 changed files with 7 additions and 3 deletions
|
|
@ -2561,6 +2561,7 @@
|
|||
|
||||
// if a language needs to load, the script is injected and loaded
|
||||
// first. once this loads, or doesn't, the initialization begins
|
||||
let lang_load = false;
|
||||
let lang_set = undefined;
|
||||
let lang = SETUP.ln ? SETUP.ln[0] : SDB.getItem('kiri-lang') || KIRI.lang.get();
|
||||
|
||||
|
|
@ -2570,10 +2571,11 @@
|
|||
let map = KIRI.lang.map(lang);
|
||||
let scr = DOC.createElement('script');
|
||||
// scr.setAttribute('defer',true);
|
||||
scr.setAttribute('src',`/kiri/lang/${map}.js`);
|
||||
scr.setAttribute('src',`/kiri/lang/${map}.js?${KIRI.version}`);
|
||||
(DOC.body || DOC.head).appendChild(scr);
|
||||
STATS.set('ll',lang);
|
||||
scr.onload = function() {
|
||||
lang_load = true;
|
||||
KIRI.lang.set(map);
|
||||
UI.lang();
|
||||
init_one();
|
||||
|
|
@ -2586,8 +2588,10 @@
|
|||
|
||||
// set to browser default which will be overridden
|
||||
// by any future script loads (above)
|
||||
KIRI.lang.set();
|
||||
UI.lang();
|
||||
if (!lang_load) {
|
||||
KIRI.lang.set();
|
||||
UI.lang();
|
||||
}
|
||||
|
||||
// schedule init_one to run after all page content is loaded
|
||||
// unless a languge script is loading first, in which case it
|
||||
|
|
|
|||
Loading…
Reference in a new issue