Skip to content

Commit

Permalink
fix(suite): translations network display symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasklim committed Jan 6, 2025
1 parent 8a622eb commit 1a903dd
Show file tree
Hide file tree
Showing 15 changed files with 49 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export const composeStakingTransaction = (
if (tx.type === 'error' && tx.error === 'AMOUNT_NOT_ENOUGH_CURRENCY_FEE') {
tx.errorMessage = {
id: 'AMOUNT_NOT_ENOUGH_CURRENCY_FEE',
values: { networkSymbol: getNetworkDisplaySymbol(network.symbol) },
values: { networkDisplaySymbol: getNetworkDisplaySymbol(network.symbol) },
};
}
});
Expand Down
8 changes: 4 additions & 4 deletions packages/suite/src/components/suite/FormFractionButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const FormFractionButtons = ({
id="TR_STAKE_MIN_AMOUNT_TOOLTIP"
values={{
amount: MIN_ETH_AMOUNT_FOR_STAKING.toString(),
networkSymbol: displaySymbol,
networkDisplaySymbol: displaySymbol,
}}
/>
)
Expand All @@ -80,7 +80,7 @@ export const FormFractionButtons = ({
id="TR_STAKE_MIN_AMOUNT_TOOLTIP"
values={{
amount: MIN_ETH_AMOUNT_FOR_STAKING.toString(),
networkSymbol: displaySymbol,
networkDisplaySymbol: displaySymbol,
}}
/>
)
Expand All @@ -98,7 +98,7 @@ export const FormFractionButtons = ({
id="TR_STAKE_MIN_AMOUNT_TOOLTIP"
values={{
amount: MIN_ETH_AMOUNT_FOR_STAKING.toString(),
networkSymbol: displaySymbol,
networkDisplaySymbol: displaySymbol,
}}
/>
)
Expand All @@ -116,7 +116,7 @@ export const FormFractionButtons = ({
id="TR_STAKE_MIN_AMOUNT_TOOLTIP"
values={{
amount: MIN_ETH_AMOUNT_FOR_STAKING.toString(),
networkSymbol: displaySymbol,
networkDisplaySymbol: displaySymbol,
}}
/>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const UnstakingInfo = ({ isExpanded }: UnstakingInfoProps) => {
subheading: (
<Translation
id="TR_STAKING_CONSOLIDATING_FUNDS"
values={{ networkSymbol: displaySymbol }}
values={{ networkDisplaySymbol: displaySymbol }}
/>
),
content: {
Expand All @@ -61,13 +61,13 @@ export const UnstakingInfo = ({ isExpanded }: UnstakingInfoProps) => {
heading: (
<Translation
id="TR_STAKE_CLAIM_UNSTAKED"
values={{ networkSymbol: displaySymbol }}
values={{ networkDisplaySymbol: displaySymbol }}
/>
),
subheading: (
<Translation
id="TR_STAKING_YOUR_UNSTAKED_FUNDS"
values={{ networkSymbol: displaySymbol }}
values={{ networkDisplaySymbol: displaySymbol }}
/>
),
content: {
Expand All @@ -77,7 +77,10 @@ export const UnstakingInfo = ({ isExpanded }: UnstakingInfoProps) => {
},
{
heading: (
<Translation id="TR_STAKE_IN_ACCOUNT" values={{ networkSymbol: displaySymbol }} />
<Translation
id="TR_STAKE_IN_ACCOUNT"
values={{ networkDisplaySymbol: displaySymbol }}
/>
),
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const ConfirmAddressModal = ({ addressPath, value, ...props }: ConfirmAdd
<Translation
id="TR_ADDRESS_MODAL_TITLE_EXCHANGE"
values={{
networkSymbol: getNetworkDisplaySymbol(symbol),
networkName: getNetworkDisplaySymbol(symbol),
networkCurrencyName: coinSymbol?.toUpperCase(),
}}
/>
Expand All @@ -58,7 +58,7 @@ export const ConfirmAddressModal = ({ addressPath, value, ...props }: ConfirmAdd
<Translation
id="TR_ADDRESS_MODAL_TITLE"
values={{
networkSymbol:
networkName:
coinSymbol && isNetworkSymbol(coinSymbol)
? getNetworkDisplaySymbol(coinSymbol)
: coinSymbol?.toUpperCase(),
Expand All @@ -71,7 +71,7 @@ export const ConfirmAddressModal = ({ addressPath, value, ...props }: ConfirmAdd
<Translation
id="TR_ADDRESS_MODAL_TITLE"
values={{
networkSymbol: getNetworkDisplaySymbol(account.symbol),
networkName: getNetworkDisplaySymbol(account.symbol),
}}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const ConfirmXpubModal = (
<Translation
id="TR_XPUB_MODAL_TITLE"
values={{
networkSymbol: getNetworkDisplaySymbol(account.symbol),
networkName: getNetworkDisplaySymbol(account.symbol),
accountIndex: `#${account.index + 1}`,
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const StakeEthInANutshellModal = ({ onCancel }: StakeEthInANutshellModalP
<Translation
id={translationId}
values={{
networkSymbol: getNetworkDisplaySymbol(account.symbol),
networkDisplaySymbol: getNetworkDisplaySymbol(account.symbol),
count: unstakingPeriod,
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const ConfirmStakeEthModal = ({
{chunks}
</TrezorLink>
),
networkSymbol: getNetworkDisplaySymbol(account.symbol),
networkDisplaySymbol: getNetworkDisplaySymbol(account.symbol),
}}
/>
</Banner>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export const Inputs = () => {
}
values={{
amount: MIN_ETH_FOR_WITHDRAWALS.toString(),
networkSymbol: displaySymbol,
networkDisplaySymbol: displaySymbol,
}}
/>
</Banner>
Expand All @@ -145,7 +145,7 @@ export const Inputs = () => {
id="TR_STAKE_RECOMMENDED_AMOUNT_FOR_WITHDRAWALS"
values={{
amount: MIN_ETH_FOR_WITHDRAWALS.toString(),
networkSymbol: displaySymbol,
networkDisplaySymbol: displaySymbol,
}}
/>
</Banner>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const EverstakeModal = ({ onCancel }: EverstakeModalProps) => {
: 'TR_STAKE_BY_STAKING_YOU_CAN_EARN_REWARDS'
}
values={{
networkSymbol: displaySymbol,
networkDisplaySymbol: displaySymbol,
t: text => <strong>{text}</strong>,
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ export const NotificationRenderer = ({
);
case 'successful-claim':
return success(render, notification, 'TOAST_SUCCESSFUL_CLAIM', 'check', {
networkSymbol: getNetworkDisplaySymbol(notification.symbol),
networkDisplaySymbol: getNetworkDisplaySymbol(notification.symbol),
});
case 'firmware-language-changed':
return success(render, notification, 'TR_FIRMWARE_LANGUAGE_CHANGED');
Expand Down
43 changes: 22 additions & 21 deletions packages/suite/src/support/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1425,19 +1425,19 @@ export default defineMessages({
id: 'TR_COPY_TO_CLIPBOARD',
},
TR_ADDRESS_MODAL_TITLE: {
defaultMessage: '{networkSymbol} receive address',
defaultMessage: '{networkName} receive address',
id: 'TR_ADDRESS_MODAL_TITLE',
},
TR_ADDRESS_MODAL_TITLE_EXCHANGE: {
defaultMessage: '{networkCurrencyName} receive address on {networkSymbol} network',
defaultMessage: '{networkCurrencyName} receive address on {networkName} network',
id: 'TR_ADDRESS_MODAL_TITLE_EXCHANGE',
},
TR_XPUB_MODAL_CLIPBOARD: {
defaultMessage: 'Copy public key',
id: 'TR_XPUB_MODAL_CLIPBOARD',
},
TR_XPUB_MODAL_TITLE: {
defaultMessage: '{networkSymbol} Account {accountIndex} public key (XPUB)',
defaultMessage: '{networkName} Account {accountIndex} public key (XPUB)',
id: 'TR_XPUB_MODAL_TITLE',
},
TR_XPUB_MODAL_TITLE_METADATA: {
Expand Down Expand Up @@ -3031,11 +3031,11 @@ export default defineMessages({
id: 'TR_RECEIVE',
},
TR_RECEIVE_NETWORK: {
defaultMessage: 'Receive {networkSymbol}',
defaultMessage: 'Receive {networkDisplaySymbol}',
id: 'TR_RECEIVE_NETWORK',
},
TR_BUY_NETWORK: {
defaultMessage: 'Buy {networkSymbol}',
defaultMessage: 'Buy {networkDisplaySymbol}',
id: 'TR_BUY_NETWORK',
},
TR_TAPROOT_BANNER_TITLE: {
Expand Down Expand Up @@ -4385,7 +4385,7 @@ export default defineMessages({
},
RECEIVE_TITLE: {
id: 'RECEIVE_TITLE',
defaultMessage: 'Receive {networkSymbol}',
defaultMessage: 'Receive {networkDisplaySymbol}',
},
RECEIVE_DESC_BITCOIN: {
id: 'RECEIVE_DESC_BITCOIN',
Expand Down Expand Up @@ -5486,12 +5486,13 @@ export default defineMessages({
id: 'AMOUNT_IS_LESS_THAN_RESERVE',
},
AMOUNT_NOT_ENOUGH_CURRENCY_FEE: {
defaultMessage: 'Not enough {networkSymbol} to cover transaction fee',
defaultMessage: 'Not enough {networkDisplaySymbol} to cover transaction fee',
id: 'AMOUNT_NOT_ENOUGH_CURRENCY_FEE',
},

AMOUNT_NOT_ENOUGH_CURRENCY_FEE_WITH_ETH_AMOUNT: {
defaultMessage: 'Not enough {symbol} to cover transaction fee ({feeAmount} {symbol})',
defaultMessage:
'Not enough {networkDisplaySymbol} to cover transaction fee ({feeAmount} {networkDisplaySymbol})',
id: 'AMOUNT_NOT_ENOUGH_CURRENCY_FEE_WITH_ETH_AMOUNT',
},
REMAINING_BALANCE_LESS_THAN_RENT: {
Expand Down Expand Up @@ -7536,11 +7537,11 @@ export default defineMessages({
},
TR_STAKING_CONSOLIDATING_FUNDS: {
id: 'TR_STAKING_CONSOLIDATING_FUNDS',
defaultMessage: 'Consolidating your {networkSymbol} for you',
defaultMessage: 'Consolidating your {networkDisplaySymbol} for you',
},
TR_STAKING_YOUR_UNSTAKED_FUNDS: {
id: 'TR_STAKING_YOUR_UNSTAKED_FUNDS',
defaultMessage: 'Your unstaked {networkSymbol} is ready',
defaultMessage: 'Your unstaked {networkDisplaySymbol} is ready',
},
TR_RECEIVING_SYMBOL: {
id: 'TR_RECEIVING_SYMBOL',
Expand Down Expand Up @@ -8773,12 +8774,12 @@ export default defineMessages({
},
TR_STAKE_IN_ACCOUNT: {
id: 'TR_STAKE_IN_ACCOUNT',
defaultMessage: '{networkSymbol} in account',
defaultMessage: '{networkDisplaySymbol} in account',
},
TR_STAKE_STAKED_ETH_AMOUNT_LOCKED: {
id: 'TR_STAKE_STAKED_ETH_AMOUNT_LOCKED',
defaultMessage:
'The staked amount of {networkSymbol} is locked and can’t be traded or sent.',
'The staked amount of {networkDisplaySymbol} is locked and can’t be traded or sent.',
},
TR_STAKE_UNSTAKING_TAKES: {
id: 'TR_STAKE_UNSTAKING_TAKES',
Expand All @@ -8788,7 +8789,7 @@ export default defineMessages({
TR_STAKE_ETH_REWARDS_EARN: {
id: 'TR_STAKE_ETH_REWARDS_EARN',
defaultMessage:
'Your rewards also earn. Keep them staked and watch your {networkSymbol} rewards soar.',
'Your rewards also earn. Keep them staked and watch your {networkDisplaySymbol} rewards soar.',
},
TR_STAKE_AVAILABLE: {
id: 'TR_STAKE_AVAILABLE',
Expand All @@ -8806,17 +8807,17 @@ export default defineMessages({
TR_STAKE_LEFT_AMOUNT_FOR_WITHDRAWAL: {
id: 'TR_STAKE_LEFT_AMOUNT_FOR_WITHDRAWAL',
defaultMessage:
'We’ve left {amount} {networkSymbol} out so you can pay for withdrawal fees.',
'We’ve left {amount} {networkDisplaySymbol} out so you can pay for withdrawal fees.',
},
TR_STAKE_LEFT_SMALL_AMOUNT_FOR_WITHDRAWAL: {
id: 'TR_STAKE_LEFT_SMALL_AMOUNT_FOR_WITHDRAWAL',
defaultMessage:
'We’ve left a small amount of {networkSymbol} out so you can pay for withdrawal fees.',
'We’ve left a small amount of {networkDisplaySymbol} out so you can pay for withdrawal fees.',
},
TR_STAKE_RECOMMENDED_AMOUNT_FOR_WITHDRAWALS: {
id: 'TR_STAKE_RECOMMENDED_AMOUNT_FOR_WITHDRAWALS',
defaultMessage:
"It's recommended to leave {amount} {networkSymbol} so you can pay for withdrawal fees.",
"It's recommended to leave {amount} {networkDisplaySymbol} so you can pay for withdrawal fees.",
},
TR_STAKE_CONFIRM_ENTRY_PERIOD: {
id: 'TR_STAKE_CONFIRM_ENTRY_PERIOD',
Expand All @@ -8838,7 +8839,7 @@ export default defineMessages({
TR_STAKE_ETH_WILL_BE_BLOCKED: {
id: 'TR_STAKE_ETH_WILL_BE_BLOCKED',
defaultMessage:
'Your {networkSymbol} will be blocked during this period, and you can’t cancel this. <a>Learn more</a>',
'Your {networkDisplaySymbol} will be blocked during this period, and you can’t cancel this. <a>Learn more</a>',
},
TR_STAKE_ACKNOWLEDGE_ENTRY_PERIOD: {
id: 'TR_STAKE_ACKNOWLEDGE_ENTRY_PERIOD',
Expand Down Expand Up @@ -8903,7 +8904,7 @@ export default defineMessages({
TR_STAKE_ETH_REWARDS_EARN_APY: {
id: 'TR_STAKE_ETH_REWARDS_EARN_APY',
defaultMessage:
'Your {networkSymbol} rewards also earn the APY rate. Keep your funds staked or add more to increase your rewards.',
'Your {networkDisplaySymbol} rewards also earn the APY rate. Keep your funds staked or add more to increase your rewards.',
},
TR_STAKE_REWARDS: {
id: 'TR_STAKE_REWARDS',
Expand Down Expand Up @@ -8996,7 +8997,7 @@ export default defineMessages({
},
TR_STAKE_MIN_AMOUNT_TOOLTIP: {
id: 'TR_STAKE_MIN_AMOUNT_TOOLTIP',
defaultMessage: 'Minimum amount to stake is {amount} {networkSymbol}',
defaultMessage: 'Minimum amount to stake is {amount} {networkDisplaySymbol}',
},
TOAST_TX_STAKED: {
id: 'TOAST_TX_STAKED',
Expand All @@ -9012,7 +9013,7 @@ export default defineMessages({
},
TOAST_SUCCESSFUL_CLAIM: {
id: 'TOAST_SUCCESSFUL_CLAIM',
defaultMessage: '{networkSymbol} claimed successfully',
defaultMessage: '{networkDisplaySymbol} claimed successfully',
},
TOAST_ESTIMATED_FEE_ERROR: {
id: 'TOAST_ESTIMATED_FEE_ERROR',
Expand Down Expand Up @@ -9050,7 +9051,7 @@ export default defineMessages({
TR_STAKE_EVERSTAKE_MANAGES: {
id: 'TR_STAKE_EVERSTAKE_MANAGES',
defaultMessage:
'Everstake maintains and protects your staked {networkSymbol} <t>with their smart contracts, infrastructure, and technology.</t>',
'Everstake maintains and protects your staked {networkDisplaySymbol} <t>with their smart contracts, infrastructure, and technology.</t>',
},
TR_STAKE_TREZOR_NO_LIABILITY: {
id: 'TR_STAKE_TREZOR_NO_LIABILITY',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const Header = ({ account }: HeaderProps) => {
const title = (
<Translation
id="RECEIVE_TITLE"
values={{ networkSymbol: getNetworkDisplaySymbol(account.symbol) }}
values={{ networkDisplaySymbol: getNetworkDisplaySymbol(account.symbol) }}
/>
);
if (account.networkType === 'bitcoin') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export const StakingCard = ({
<Translation
id="TR_STAKE_ETH_REWARDS_EARN_APY"
values={{
networkSymbol: getNetworkDisplaySymbol(
networkDisplaySymbol: getNetworkDisplaySymbol(
selectedAccount.symbol,
),
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const AccountEmpty = ({ account }: AccountEmptyProps) => {
children: (
<Translation
id="TR_RECEIVE_NETWORK"
values={{ networkSymbol: displaySymbol }}
values={{ displayNetworkSymbol: displaySymbol }}
/>
),
},
Expand All @@ -66,7 +66,7 @@ export const AccountEmpty = ({ account }: AccountEmptyProps) => {
children: (
<Translation
id="TR_BUY_NETWORK"
values={{ networkSymbol: displaySymbol }}
values={{ displayNetworkSymbol: displaySymbol }}
/>
),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ export const composeEthereumTransactionFeeLevelsThunk = createThunk<
) {
tx.errorMessage = {
values: {
symbol: getNetworkDisplaySymbol(network.symbol),
networkDisplaySymbol: getNetworkDisplaySymbol(network.symbol),
feeAmount: tx.errorMessage?.values?.feeAmount || '',
},
id: 'AMOUNT_NOT_ENOUGH_CURRENCY_FEE_WITH_ETH_AMOUNT',
Expand Down

0 comments on commit 1a903dd

Please sign in to comment.