1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

Token allowance i18n interpolation system (#16347)

* added i18n interpolation system to token-allowance screen

* modified revokeSpendingCap

* Fixed minor type error

* resolved conflicts
This commit is contained in:
Adnan Sahovic 2022-11-25 11:26:29 +01:00 committed by GitHub
parent 51cffa15dd
commit 6f21c4837d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 16 deletions

View File

@ -3000,7 +3000,8 @@
"description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name"
},
"revokeSpendingCap": {
"message": "Revoke spending cap for your"
"message": "Revoke spending cap for your $1",
"description": "$1 is a token symbol"
},
"revokeSpendingCapTooltipText": {
"message": "This contract will be unable to spend any more of your current or future tokens."
@ -3190,7 +3191,8 @@
"description": "The token symbol that is being approved"
},
"setSpendingCap": {
"message": "Set a spending cap for your"
"message": "Set a spending cap for your $1",
"description": "$1 is a token symbol"
},
"settings": {
"message": "Settings"

View File

@ -187,6 +187,17 @@ export default function TokenAllowance({
const isEmpty = customTokenAmount === '';
const renderContractTokenValues = (
<Box marginTop={4} key={tokenAddress}>
<ContractTokenValues
tokenName={tokenSymbol}
address={tokenAddress}
chainId={fullTxData.chainId}
rpcPrefs={rpcPrefs}
/>
</Box>
);
return (
<Box className="token-allowance-container page-container">
<Box
@ -265,27 +276,28 @@ export default function TokenAllowance({
</Typography>
</Box>
</Box>
<Box marginBottom={5} marginLeft={4} marginRight={4}>
<Box marginLeft={4} marginRight={4}>
<Typography
variant={TYPOGRAPHY.H3}
fontWeight={FONT_WEIGHT.BOLD}
align={TEXT_ALIGN.CENTER}
>
{isFirstPage && t('setSpendingCap')}
{!isFirstPage &&
(customTokenAmount === '0' || isEmpty
? t('revokeSpendingCap')
: t('reviewSpendingCap'))}
{isFirstPage ? (
t('setSpendingCap', [renderContractTokenValues])
) : (
<Box>
{customTokenAmount === '0' || isEmpty ? (
t('revokeSpendingCap', [renderContractTokenValues])
) : (
<Box>
{t('reviewSpendingCap')}
{renderContractTokenValues}
</Box>
)}
</Box>
)}
</Typography>
</Box>
<Box>
<ContractTokenValues
tokenName={tokenSymbol}
address={tokenAddress}
chainId={fullTxData.chainId}
rpcPrefs={rpcPrefs}
/>
</Box>
<Box
marginTop={1}
display={DISPLAY.FLEX}