Fix #896: improve placeholder dynamism, add more tests for UI code

This commit is contained in:
Pieter Vander Vennet 2022-06-30 03:07:54 +02:00
parent 94475e4d4d
commit 972d702315
7 changed files with 148 additions and 66 deletions

View file

@ -117,11 +117,12 @@ export default class TagRenderingConfig {
let placeholder: Translation = Translations.T(json.freeform.placeholder)
if (placeholder === undefined) {
const typeDescription = Translations.t.validation[type]?.description
const typeDescription = <Translation> Translations.t.validation[type]?.description
const key = json.freeform.key;
if(typeDescription !== undefined){
placeholder = Translations.T(json.freeform.key+" ({"+type+"})").Subs({[type]: typeDescription})
placeholder = typeDescription.OnEveryLanguage(l => key+" ("+l+")")
}else{
placeholder = Translations.T(json.freeform.key+" ("+type+")")
placeholder = Translations.T(key+" ("+type+")")
}
}