Skip to content

Commit

Permalink
refactor: add translation parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjeatt committed Dec 19, 2022
1 parent 2046e26 commit eee2deb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/assets/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,8 @@
"validation": {
"insufficient_funds": "Insufficient balance to transfer",
"balance_lower_minimum": "Transferable balance is lower than the minimum",
"transfer_more_than_minimum": "Must transfer more than the minimum amount of {{ minimumTransferableAmount }}",
"transfer_less_than_maximum": "Must transfer less than the maximum amount of {{ maximumTransferableAmount }}"
"transfer_more_than_minimum": "Must transfer more than the minimum amount of {{ amount }}",
"transfer_less_than_maximum": "Must transfer less than the maximum amount of {{ amount }}"
}
}
}
8 changes: 6 additions & 2 deletions src/pages/Transfer/CrossChainTransferForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,13 @@ const CrossChainTransferForm = (): JSX.Element => {
} else if (minInputToBig.gt(transferableBalance)) {
return t('xcm_transfer.validation.balance_lower_minimum');
} else if (minInputToBig.gt(transferAmount.toBig())) {
return t('xcm_transfer.validation.transfer_more_than_minimum');
return t('xcm_transfer.validation.transfer_more_than_minimum', {
amount: `${inputConfigs.minInput.toString()} ${currency.symbol}`
});
} else if (maxInputToBig.lt(transferAmount.toBig())) {
return t('xcm_transfer.validation.transfer_less_than_maximum');
return t('xcm_transfer.validation.transfer_less_than_maximum', {
amount: `${inputConfigs.maxInput.toString()} ${currency.symbol}`
});
} else {
return undefined;
}
Expand Down

0 comments on commit eee2deb

Please sign in to comment.