Add translation button to inline renderings
This commit is contained in:
parent
e62f71a51d
commit
70e74144ed
1 changed files with 2 additions and 5 deletions
|
@ -17,11 +17,8 @@ export default class InputElementWrapper<T> extends InputElement<T> {
|
||||||
mapping.set(key, 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
|
// 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 = {}
|
translation = translation.OnEveryLanguage((txt) => txt.replace("{" + key + "}", "{" + key + "()}"))
|
||||||
for (const lang in translation.translations) {
|
this._renderElement = new SubstitutedTranslation(translation, tags, state, mapping)
|
||||||
newTranslations[lang] = translation.translations[lang].replace("{" + key + "}", "{" + key + "()}")
|
|
||||||
}
|
|
||||||
this._renderElement = new SubstitutedTranslation(new Translation(newTranslations), tags, state, mapping)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GetValue(): UIEventSource<T> {
|
GetValue(): UIEventSource<T> {
|
||||||
|
|
Loading…
Reference in a new issue