Skip to content

Commit

Permalink
i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
yushih committed Oct 31, 2024
1 parent f50fa93 commit 25265e0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 10 deletions.
37 changes: 27 additions & 10 deletions packages/yoroi-extension/app/containers/cashback/CashbackPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,26 @@ import { IncorrectWalletPasswordError } from '../../api/common/errors';
import { convertToLocalizableError } from '../../domain/LedgerLocalizedError';
import LocalizableError from '../../i18n/LocalizableError';
import type { $npm$ReactIntl$IntlShape } from 'react-intl';
import { injectIntl } from 'react-intl';
import { injectIntl, defineMessages, } from 'react-intl';

const messages = defineMessages({
claim: {
id: 'cashback.claim.dialog.title',
defaultMessage: '!!!CLAIM CASHBACK',
},
passwordClaimInstruction: {
id: 'cashback.claim.dialog.instruction.password',
defaultMessage: '!!!Enter your password to claim cashback rewards.',
},
hardwardClaimInstruction: {
id: 'cashback.claim.dialog.instruction.hardware',
defaultMessage: '!!!Confirm on your hardware wallet to claim cashback rewards.',
},
message: {
id: 'cashback.claim.dialog.message.label',
defaultMessage: '!!!Message',
},
});

type Props = StoresAndActionsProps;

Expand Down Expand Up @@ -212,35 +231,33 @@ const CashbackPageContainer: React$ComponentType<Props> = observer((props: AllPr
<NavBarContainerRevamp
actions={actions}
stores={stores}
title={<NavBarTitle title={'Cashback'} />}
// title={<NavBarTitle title={intl.formatMessage(globalMessages.sidebarCashback)} />}
title={<NavBarTitle title={intl.formatMessage(globalMessages.sidebarCashback)} />}
/>
}
>
<FullscreenLayout bottomPadding={0}>
<Suspense fallback={null}>
{signaturePopup ?
<Dialog
title='CLAIM CASHBACK'
title={intl.formatMessage(messages.claim)}
closeOnOverlayClick
closeButton={<DialogCloseButton />}
onClose={abortClaim}
actions={[{
label: 'CONFIRM',
label: intl.formatMessage(globalMessages.confirm),
primary: true,
disabled: wallet.type === 'mnemonic' && !password,
onClick: () => signMessage(message, password)
}]}
>
<Box>
<Typography sx={{ marginBottom: "16px", color: theme.name === 'light-theme' ? '#242838' : '#E1E6F5' }}>
{wallet.type === 'mnemonic' ?
'Enter your password to claim cashback rewards.' :
'Confirm on your hardware wallet to claim cashback rewards.'
}
{intl.formatMessage(wallet.type === 'mnemonic' ?
messages.passwordClaimInstruction : messages. hardwardClaimInstruction
)}
</Typography>
<Typography sx={{ color: theme.name === 'light-theme' ? '#6B7384' : '#7C85A3' }}>
Message
{intl.formatMessage(messages.message)}
</Typography>
<DialogContentText sx={{
whiteSpace: 'pre-wrap', wordBreak: 'break-word', color: theme.name === 'light-theme' ? '#242838' : '#E1E6F5'
Expand Down
4 changes: 4 additions & 0 deletions packages/yoroi-extension/app/i18n/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@
"buysell.dialog.providerFee": "Provider fee",
"buysell.dialog.title": "Exchange ADA",
"buysell.end.text": "Congrats! 🎉 Your transaction is now in progress. You should be receiving the funds soon.",
"cashback.claim.dialog.instruction.hardware": "Confirm on your hardware wallet to claim cashback rewards.",
"cashback.claim.dialog.instruction.password": "Enter your password to claim cashback rewards.",
"cashback.claim.dialog.message.label": "Message",
"cashback.claim.dialog.title": "CLAIM CASHBACK",
"connector.appName": "Dapp Connector",
"connector.appNameShort": "Connector",
"connector.assetReceived": "{assetName} received",
Expand Down

0 comments on commit 25265e0

Please sign in to comment.