diff --git a/UI/Input/InputElementWrapper.ts b/UI/Input/InputElementWrapper.ts index a671a0027..9006956c5 100644 --- a/UI/Input/InputElementWrapper.ts +++ b/UI/Input/InputElementWrapper.ts @@ -17,11 +17,8 @@ export default class InputElementWrapper extends InputElement { mapping.set(key, inputElement) // Bit of a hack: the SubstitutedTranslation expects a special rendering, but those are formatted '{key()}' instead of '{key}', so we substitute it first - const newTranslations = {} - for (const lang in translation.translations) { - newTranslations[lang] = translation.translations[lang].replace("{" + key + "}", "{" + key + "()}") - } - this._renderElement = new SubstitutedTranslation(new Translation(newTranslations), tags, state, mapping) + translation = translation.OnEveryLanguage((txt) => txt.replace("{" + key + "}", "{" + key + "()}")) + this._renderElement = new SubstitutedTranslation(translation, tags, state, mapping) } GetValue(): UIEventSource {