fix(react): Display doNotTranslate list option values (#358)
When testing with the repository studio, it fixes the issue with Breanna (the only design that uses `doNotTranslate` list options), and I didn't see any regressions with other designs like Hi. Fixes #347 Co-authored-by: Benjamin Fan <ben-git@swinglonga.com> Reviewed-on: https://codeberg.org/freesewing/freesewing/pulls/358 Reviewed-by: Joost De Cock <joostdecock@noreply.codeberg.org> Co-authored-by: Benjamin Fan <benjamesben@noreply.codeberg.org> Co-committed-by: Benjamin Fan <benjamesben@noreply.codeberg.org>
This commit is contained in:
parent
bdf8a40792
commit
5dc1cd98fb
2 changed files with 4 additions and 2 deletions
|
@ -149,7 +149,9 @@ export const MenuListInput = ({
|
||||||
: 'tw:flex-col tw:items-start'
|
: 'tw:flex-col tw:items-start'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<div className="tw:font-semibold">{config.choiceTitles[entry]}</div>
|
<div className="tw:font-semibold">
|
||||||
|
{config.doNotTranslate ? entry : config.choiceTitles[entry]}
|
||||||
|
</div>
|
||||||
{compact || !config.choiceDescriptions ? null : (
|
{compact || !config.choiceDescriptions ? null : (
|
||||||
<div
|
<div
|
||||||
className={`${config.dense ? 'tw:text-sm tw:leading-5 tw:py-1' : 'tw:text-base'} tw:font-normal`}
|
className={`${config.dense ? 'tw:text-sm tw:leading-5 tw:py-1' : 'tw:text-base'} tw:font-normal`}
|
||||||
|
|
|
@ -79,7 +79,7 @@ export const MenuListValue = ({ current, config, changed }) => {
|
||||||
else if (val) key = <BoolYesIcon />
|
else if (val) key = <BoolYesIcon />
|
||||||
else key = <BoolNoIcon />
|
else key = <BoolNoIcon />
|
||||||
|
|
||||||
const translated = config.doNotTranslate || key
|
const translated = config.doNotTranslate ? val : key
|
||||||
|
|
||||||
return <MenuHighlightValue changed={changed}>{translated}</MenuHighlightValue>
|
return <MenuHighlightValue changed={changed}>{translated}</MenuHighlightValue>
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue