1
0
Fork 0

fix: Allow suppresion of translation in list options

Fixes #2604

It's not so easy to handle this frontend side, so I feel it's better to
be explicit and add a `doNotTranslate` attribute to the option.

Added the frontend code to take that into account, as well as a note in
the docs.
This commit is contained in:
Joost De Cock 2022-08-19 09:49:46 +02:00
parent 90483b155f
commit f0761cecf9
4 changed files with 56 additions and 5 deletions

View file

@ -49,9 +49,12 @@ export const values = {
const dflt = props.design.config.options[props.option].dflt
const current = props.gist?.options?.[props.option]
const prefix = `${props.option}.o.`
const translate = props.design.config.options[props.option]?.doNotTranslate
? (input) => input
: (input) => props.t(prefix+input)
return (dflt==current || typeof current === 'undefined')
? (<span className="text-secondary-focus">{props.t(prefix+dflt)}</span>)
: (<span className="text-accent">{props.t(prefix+current)}</span>)
? (<span className="text-secondary-focus">{translate(dflt)}</span>)
: (<span className="text-accent">{translate(current)}</span>)
},
deg: props => {
const dflt = props.design.config.options[props.option].deg