Small fix: restore special components

This commit is contained in:
pietervdvn 2021-04-06 21:10:18 +02:00
parent e1d7b256f9
commit fbdd36b270
2 changed files with 4 additions and 4 deletions

View file

@ -332,7 +332,7 @@ export default class LayerConfig {
function render(tr: TagRenderingConfig, deflt?: string) { function render(tr: TagRenderingConfig, deflt?: string) {
const str = (tr?.GetRenderValue(tags.data)?.txt ?? deflt); const str = (tr?.GetRenderValue(tags.data)?.txt ?? deflt);
return SubstitutedTranslation.SubstituteKeys(str, tags.data); return SubstitutedTranslation.SubstituteKeys(str, tags.data).replace(/{.*}/g, "");
} }
const iconSize = render(this.iconSize, "40,40,center").split(","); const iconSize = render(this.iconSize, "40,40,center").split(",");

View file

@ -54,7 +54,7 @@ export class SubstitutedTranslation extends UIElement {
for (const key in tags) { for (const key in tags) {
txt = txt.replace(new RegExp("{" + key + "}", "g"), tags[key]) txt = txt.replace(new RegExp("{" + key + "}", "g"), tags[key])
} }
return txt.replace(/{.*}/g, ""); return txt;
} }
private static GenerateMap() { private static GenerateMap() {
@ -117,8 +117,8 @@ export class SubstitutedTranslation extends UIElement {
} }
} }
// IF we end up here, no changes have to be made // IF we end up here, no changes have to be made - except to remove any resting {}
return [new FixedUiElement(template)]; return [new FixedUiElement(template.replace(/{.*}/g, ""))];
} }
} }