Skip to content

Commit d16cbaf

Browse files
authored
fix(app): translate close button text for ODD toasts (#17459)
fix RQA-3946
1 parent f0ec5e5 commit d16cbaf

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

app/src/App/hooks.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function useSoftwareUpdatePoll(): void {
3131

3232
export function useProtocolReceiptToast(): void {
3333
const host = useHost()
34-
const { t } = useTranslation('protocol_info')
34+
const { t, i18n } = useTranslation(['protocol_info', 'shared'])
3535
const { makeToast } = useToaster()
3636
const queryClient = useQueryClient()
3737
const protocolIdsQuery = useAllProtocolIdsQuery(
@@ -83,7 +83,7 @@ export function useProtocolReceiptToast(): void {
8383
}) as string,
8484
'success',
8585
{
86-
closeButton: true,
86+
buttonText: i18n.format(t('shared:close'), 'capitalize'),
8787
disableTimeout: true,
8888
displayType: 'odd',
8989
}

app/src/organisms/ErrorRecoveryFlows/hooks/useRecoveryToasts.ts

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export function useRecoveryToasts({
2727
...rest
2828
}: BuildToast): RecoveryToasts {
2929
const { currentStepNumber, hasRunDiverged } = stepCounts
30+
const { i18n, t } = useTranslation('shared')
3031
const { makeToast } = useToaster()
3132
const displayType = isOnDevice ? 'odd' : 'desktop'
3233

@@ -53,6 +54,10 @@ export function useRecoveryToasts({
5354
const makeSuccessToast = (): void => {
5455
if (selectedRecoveryOption !== RECOVERY_MAP.CANCEL_RUN.ROUTE) {
5556
makeToast(bodyText, 'success', {
57+
buttonText:
58+
displayType === 'odd'
59+
? i18n.format(t('shared:close'), 'capitalize')
60+
: undefined,
5661
closeButton: true,
5762
disableTimeout: true,
5863
displayType,

app/src/organisms/ODD/QuickTransferFlow/SelectDestWells.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export function SelectDestWells(props: SelectDestWellsProps): JSX.Element {
123123
}) as string,
124124
'error',
125125
{
126-
closeButton: true,
126+
buttonText: i18n.format(t('shared:close'), 'capitalize'),
127127
disableTimeout: true,
128128
displayType: 'odd',
129129
linkText: t('learn_more'),

0 commit comments

Comments
 (0)