Fixed a bug where templates (t:) was loaded after string replacements (s:)
This commit is contained in:
parent
2089c786b3
commit
1a1ff39df0
|
@ -58,6 +58,13 @@ app.template = {
|
||||||
if (k.startsWith('t:'))
|
if (k.startsWith('t:'))
|
||||||
tpl = tpl.replace('{'+k+'}', app.template.get(k.substr(2)));
|
tpl = tpl.replace('{'+k+'}', app.template.get(k.substr(2)));
|
||||||
}
|
}
|
||||||
|
for (var i = 0; i < matches.length; i++) {
|
||||||
|
const k = matches[i];
|
||||||
|
if (!k.match(/^[a-zA-Z0-9\:_\.]+$/))
|
||||||
|
continue;
|
||||||
|
if (k.startsWith('s:'))
|
||||||
|
tpl = tpl.replace('{'+k+'}', eval('app.strings.'+k.substr(2)));
|
||||||
|
}
|
||||||
}; _();
|
}; _();
|
||||||
const res = Array.from(tpl.matchAll(/\{\.[^\{\}]+\}/g));
|
const res = Array.from(tpl.matchAll(/\{\.[^\{\}]+\}/g));
|
||||||
var matches = [];
|
var matches = [];
|
||||||
|
|
Loading…
Reference in New Issue