I should have commited sooner...

This commit is contained in:
Pieter Vander Vennet 2020-11-17 02:22:48 +01:00
parent 2685b6e734
commit 16612b10ef
35 changed files with 570 additions and 177 deletions

View file

@ -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[] {