From 9c559cabc8d0b92af4189de2c6aae0f14774cb1b Mon Sep 17 00:00:00 2001 From: smb2268 Date: Thu, 21 Nov 2024 14:54:50 -0500 Subject: [PATCH] Capitalize lid status for absorbance reader car --- app/src/assets/localization/en/shared.json | 1 + app/src/organisms/ModuleCard/AbsorbanceReaderData.tsx | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/assets/localization/en/shared.json b/app/src/assets/localization/en/shared.json index 0b580a612e81..f4e542e761b3 100644 --- a/app/src/assets/localization/en/shared.json +++ b/app/src/assets/localization/en/shared.json @@ -11,6 +11,7 @@ "change_robot": "Change robot", "clear_data": "clear data", "close": "close", + "closed": "closed", "close_robot_door": "Close the robot door before starting the run.", "confirm": "Confirm", "confirm_placement": "Confirm placement", diff --git a/app/src/organisms/ModuleCard/AbsorbanceReaderData.tsx b/app/src/organisms/ModuleCard/AbsorbanceReaderData.tsx index e6d23255176b..2283988c48b9 100644 --- a/app/src/organisms/ModuleCard/AbsorbanceReaderData.tsx +++ b/app/src/organisms/ModuleCard/AbsorbanceReaderData.tsx @@ -12,7 +12,7 @@ export const AbsorbanceReaderData = ( props: AbsorbanceReaderProps ): JSX.Element | null => { const { moduleData } = props - const { t } = useTranslation('device_details') + const { t, i18n } = useTranslation(['device_details', 'shared']) const StatusLabelProps = { status: 'Idle', @@ -37,6 +37,10 @@ export const AbsorbanceReaderData = ( break } } + const lidDisplayStatus = + moduleData.lidStatus === 'on' + ? i18n.format(t('shared:closed'), 'capitalize') + : i18n.format(t('shared:open'), 'capitalize') return ( <> @@ -46,7 +50,7 @@ export const AbsorbanceReaderData = ( data-testid="abs_module_data" > {t('abs_reader_lid_status', { - status: moduleData.lidStatus === 'on' ? 'closed' : 'open', + status: lidDisplayStatus, })}