forked from MapComplete/MapComplete
Add loading of live data
This commit is contained in:
parent
feab5a19b3
commit
0d6412f824
14 changed files with 291 additions and 35 deletions
|
@ -47,23 +47,27 @@ export default class Translation extends UIElement {
|
|||
|
||||
for (const knownSpecial of knownSpecials) {
|
||||
|
||||
do {
|
||||
const matched = template.match(`(.*){${knownSpecial.funcName}\\((.*)\\)}(.*)`);
|
||||
if (matched === null) {
|
||||
break;
|
||||
}
|
||||
const partBefore = matched[1];
|
||||
const argument = matched[2];
|
||||
const partAfter = matched[3];
|
||||
|
||||
const matched = template.match(`(.*){${knownSpecial.funcName}\\((.*)\\)}(.*)`);
|
||||
if (matched === null) {
|
||||
continue;
|
||||
}
|
||||
const partBefore = matched[1];
|
||||
const argument = matched[2];
|
||||
const partAfter = matched[3];
|
||||
try {
|
||||
|
||||
const element = knownSpecial.constr(argument).Render();
|
||||
template = partBefore + element + partAfter;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
template = partBefore + partAfter;
|
||||
}
|
||||
|
||||
} while (true);
|
||||
|
||||
try {
|
||||
|
||||
const element = knownSpecial.constr(argument).Render();
|
||||
template = partBefore + element + partAfter;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
template = partBefore + partAfter;
|
||||
}
|
||||
}
|
||||
newTranslations[lang] = template;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue