forked from MapComplete/MapComplete
I should have commited sooner...
This commit is contained in:
parent
2685b6e734
commit
16612b10ef
35 changed files with 570 additions and 177 deletions
|
@ -39,12 +39,16 @@ export class SubstitutedTranslation extends UIElement {
|
|||
return []
|
||||
}
|
||||
const tags = this.tags.data;
|
||||
txt = SubstitutedTranslation.SubstituteKeys(txt, tags);
|
||||
return this.EvaluateSpecialComponents(txt);
|
||||
}
|
||||
|
||||
public static SubstituteKeys(txt: string, tags: any) {
|
||||
for (const key in tags) {
|
||||
// Poor mans replace all
|
||||
txt = txt.split("{" + key + "}").join(tags[key]);
|
||||
}
|
||||
|
||||
return this.EvaluateSpecialComponents(txt);
|
||||
return txt;
|
||||
}
|
||||
|
||||
private EvaluateSpecialComponents(template: string): UIElement[] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue