Skip to content

Commit

Permalink
Merge pull request #2129 from oasisprotocol/lw/translations
Browse files Browse the repository at this point in the history
Improve translations
  • Loading branch information
lukaw3d authored Mar 3, 2025
2 parents 42031b2 + fbf01be commit 632c3ba
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 11 deletions.
1 change: 1 addition & 0 deletions .changelog/2129.trivial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve translations
7 changes: 6 additions & 1 deletion src/app/components/AddEscrowForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ export const AddEscrowForm = memo((props: Props) => {
const ticker = useSelector(selectTicker)
const isMobile = useContext(ResponsiveContext) === 'small'
const { onWheel } = usePreventChangeOnNumberInputScroll()
const translateValidatorStatus: { [status in Validator['status']]: string } = {
active: t('validator.statusActive', 'Active'),
inactive: t('validator.statusInactive', 'Inactive'),
unknown: t('validator.statusUnknown', 'Unknown'),
}
const delegate = () => {
dispatch(
transactionActions.addEscrow({
Expand All @@ -59,7 +64,7 @@ export const AddEscrowForm = memo((props: Props) => {
description: t(
'account.addEscrow.confirmDelegatingToInactive.description',
'Status of this validator is {{validatorStatus}}. Your delegation might not generate any rewards.',
{ validatorStatus: props.validatorStatus },
{ validatorStatus: translateValidatorStatus[props.validatorStatus] },
),
handleConfirm: delegate,
isDangerous: true,
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/ErrorFormatter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function ErrorFormatter(props: Props) {
[WalletErrors.NoOpenWallet]: t('errors.noOpenWallet', 'No wallet opened'),
[WalletErrors.USBTransportNotSupported]: t(
'errors.usbTransportNotSupported',
'Current platform does not support WebUSB capability. Try on different platform or browser(preferably Chrome).',
'Current platform does not support WebUSB capability. Try on different platform or browser (preferably Chrome).',
),
[WalletErrors.USBTransportError]: t('errors.usbTransportError', 'USB Transport error: {{message}}.', {
message,
Expand Down
3 changes: 2 additions & 1 deletion src/app/components/ReclaimEscrowForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,10 @@ export const ReclaimEscrowForm = memo((props: Props) => {
</Box>
{shares !== '0' && (
<Text size="small" data-testid="numberOfShares">
{t('account.reclaimEscrow.convertedToShares', 'Corresponding number of gigashares: {{shares}}', {
{t('account.reclaimEscrow.convertedToShares', 'Corresponding number of shares: {{shares}}', {
shares: formatBaseUnitsAsRose(shares),
})}
{t('common.postfixAmountInBillions', 'B')}
</Text>
)}
<TransactionStatus error={error} success={success} />
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/Transaction/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export function Transaction(props: TransactionProps) {
i18nKey="account.transaction.addEscrow.received"
t={t}
components={{ Amount }}
defaults="Received <Amount> delegation in escrow"
defaults="Received <Amount/> delegation in escrow"
/>
),
},
Expand Down
9 changes: 7 additions & 2 deletions src/app/components/TransactionPreview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,13 @@ export const TransactionPreview = memo((props: Props) => {
/>
{preview.transaction.type === 'reclaimEscrow' && (
<PreviewRow
label={t('transaction.preview.shares', 'Gigashares')}
value={<AmountFormatter amount={preview.transaction.shares} hideTicker />}
label={t('transaction.preview.shares', 'Shares')}
value={
<span>
<AmountFormatter amount={preview.transaction.shares} hideTicker />
{t('common.postfixAmountInBillions', 'B')}
</span>
}
/>
)}
<PreviewRow
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/OpenWalletPage/Features/FromLedger/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function FromLedger({ openLedgerAccessPopup }: SelectOpenMethodProps) {
<Text size="small" textAlign="center">
{t(
'errors.usbTransportNotSupported',
'Current platform does not support WebUSB capability. Try on different platform or browser(preferably Chrome).',
'Current platform does not support WebUSB capability. Try on different platform or browser (preferably Chrome).',
)}
</Text>
)}
Expand Down
9 changes: 5 additions & 4 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"loading": "Loading account",
"loadingError": "Couldn't load account.",
"reclaimEscrow": {
"convertedToShares": "Corresponding number of gigashares: {{shares}}",
"convertedToShares": "Corresponding number of shares: {{shares}}",
"reclaim": "Reclaim",
"reclaimAll": "Reclaim all",
"reclaimableAmount": "Available:"
Expand Down Expand Up @@ -58,7 +58,7 @@
},
"transaction": {
"addEscrow": {
"received": "Received <Amount> delegation in escrow",
"received": "Received <Amount/> delegation in escrow",
"sent": "Delegated <Amount/> to validator"
},
"consensusDeposit": {
Expand Down Expand Up @@ -123,6 +123,7 @@
"delegator": "Delegator",
"from": "From",
"hash": "Tx Hash",
"postfixAmountInBillions": "B",
"round": "Round",
"time": "Time",
"to": "To",
Expand Down Expand Up @@ -171,7 +172,7 @@
"unknownLedgerError": "Unknown ledger error: {{message}}",
"unknownParaTimeError": "Unknown ParaTime error: {{message}}",
"usbTransportError": "USB Transport error: {{message}}.",
"usbTransportNotSupported": "Current platform does not support WebUSB capability. Try on different platform or browser(preferably Chrome)."
"usbTransportNotSupported": "Current platform does not support WebUSB capability. Try on different platform or browser (preferably Chrome)."
},
"fatalError": {
"checkStatus": "Check network status",
Expand Down Expand Up @@ -545,7 +546,7 @@
"from": "From",
"gas": "Gas",
"genesisHash": "Genesis hash",
"shares": "Gigashares",
"shares": "Shares",
"to": "To",
"type": "Type",
"validator": "Validator",
Expand Down

0 comments on commit 632c3ba

Please sign in to comment.