fix(shared): translations in workbench test view
This commit is contained in:
parent
e4464beed5
commit
0072ce0bad
3 changed files with 25 additions and 7 deletions
|
@ -24,7 +24,24 @@ export const TestView = ({
|
|||
const renderProps = pattern.getRenderProps()
|
||||
const patternConfig = pattern.getConfig()
|
||||
|
||||
const title = t('testThing', { design, thing: t(settings.sample?.[settings.sample.type]) })
|
||||
/*
|
||||
* Translation of the title needs some work
|
||||
*/
|
||||
let title = t('workbench:testDesignOption', {
|
||||
design,
|
||||
option: t(`${design}:${settings.sample.option}.t`),
|
||||
})
|
||||
if (settings.sample.type === 'measurement')
|
||||
title = t('workbench:testDesignMeasurement', {
|
||||
design,
|
||||
measurement: t(`measurements:${settings.sample.measurement}`),
|
||||
})
|
||||
else if (settings.sample.type === 'sets')
|
||||
title = t('workbench:testDesignSets', {
|
||||
design,
|
||||
thing: 'fixme views/test/index.mjs',
|
||||
})
|
||||
|
||||
return (
|
||||
<PatternWithMenu
|
||||
{...{
|
||||
|
@ -33,7 +50,7 @@ export const TestView = ({
|
|||
update,
|
||||
control: account.control,
|
||||
setSettings,
|
||||
title: <h2 className="px-2 capitalize">{title}</h2>,
|
||||
title: <h2>{title}</h2>,
|
||||
pattern: <PanZoomPattern {...{ renderProps }} />,
|
||||
menu: (
|
||||
<TestMenu
|
||||
|
|
|
@ -69,7 +69,7 @@ export const TestMenu = ({
|
|||
if (value) update.settings(['sample'], { type: 'option', option: value })
|
||||
else update.settings(['sample'])
|
||||
}}
|
||||
current={settings.sample.option}
|
||||
current={settings?.sample?.option}
|
||||
/>,
|
||||
],
|
||||
[
|
||||
|
@ -90,7 +90,7 @@ export const TestMenu = ({
|
|||
if (value) update.settings(['sample'], { type: 'measurement', measurement: value })
|
||||
else update.settings(['sample'])
|
||||
}}
|
||||
current={settings.sample.measurement}
|
||||
current={settings?.sample?.measurement}
|
||||
/>,
|
||||
],
|
||||
[
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue