@@ -4,7 +4,8 @@ import { useCallback } from 'react'
44
55import { Command } from '@cowprotocol/types'
66
7- import { t } from '@lingui/macro'
7+ import { msg } from "@lingui/core/macro" ;
8+ import { useLingui } from "@lingui/react" ;
89
910import { useCloseModal , useOpenModal } from 'legacy/state/application/hooks'
1011import { ApplicationModal } from 'legacy/state/application/reducer'
@@ -40,7 +41,7 @@ const DEFAULT_CONFIRMATION_MODAL_CONTEXT: ConfirmationModalContext = {
4041 onEnable : ( ) => { } ,
4142 title : 'Confirm Action' ,
4243 callToAction : 'Confirm' ,
43- confirmWord : t ` confirm` ,
44+ confirmWord : ' confirm' ,
4445 action : 'confirm' ,
4546 skipInput : false ,
4647 triggerConfirmation : async ( ) => { } ,
@@ -68,6 +69,7 @@ export function useConfirmationRequest({
6869 const closeModal = useCloseModal ( ApplicationModal . CONFIRMATION )
6970 const setContext = useSetAtom ( updateConfirmationModalContextAtom )
7071 const resetContext = useResetAtom ( confirmationModalContextAtom )
72+ const { i18n } = useLingui ( ) ;
7173
7274 return useCallback (
7375 ( params : TriggerConfirmationParams ) : Promise < boolean > => {
@@ -92,12 +94,13 @@ export function useConfirmationRequest({
9294
9395 setContext ( {
9496 ...params ,
97+ confirmWord : i18n . _ ( msg `confirm` ) ,
9598 onDismiss,
9699 onEnable,
97100 } )
98101 openModal ( )
99102 } )
100103 } ,
101- [ setContext , openModal , closeModal , onDismissParam , resetContext , onEnableParam ]
104+ [ closeModal , i18n , onDismissParam , onEnableParam , openModal , resetContext , setContext ]
102105 )
103106}
0 commit comments