浏览代码

钱包国际化优化

wdj 2 周之前
父节点
当前提交
665da472c4
共有 2 个文件被更改,包括 11 次插入6 次删除
  1. 6 1
      src/i18n/zhHk/wallet.js
  2. 5 5
      src/views/wallet/transferDetail/index.vue

+ 6 - 1
src/i18n/zhHk/wallet.js

@@ -53,5 +53,10 @@ export default {
     Time:"時間",
     Send:"發送",
     Receive:"接收",
-    TotalAmountOfTheBill:"元寶總額"
+    TotalAmountOfTheBill:"元寶總額",
+    FailedToEstimateMinerFees:"預估礦工費失敗:",
+    PleaseEnterTheCorrectPassword:"請輸入正確的密碼",
+    TransferInProgress:"轉賬中...",
+    TheTransferWasSuccessful:"轉賬成功",
+    TransferFailed:"轉賬失敗"
 };

+ 5 - 5
src/views/wallet/transferDetail/index.vue

@@ -185,7 +185,7 @@ const estimateGasFee = async () => {
     const feeWei = BigInt(gasPrice) * BigInt(gasLimit);
     gasFee.value = Number(web3.utils.fromWei(feeWei.toString(), 'ether')).toFixed(8);
   } catch (err) {
-    console.error('预估矿工费失败:', err);
+    console.error($t('wallet.FailedToEstimateMinerFees'), err);
     gasFee.value = '0.0000';
   }
 };
@@ -219,7 +219,7 @@ const cancel = () => {
 // 密码确认
 const popConfirm = () => {
     if(passWord.value != cryptoDecode(walletStore.accountPassword)){
-        showNotify({ type: 'warning', message: '请输入正确的密码' });
+        showNotify({ type: 'warning', message: $t('wallet.PleaseEnterTheCorrectPassword') });
     }else{
         getData();
     }
@@ -228,7 +228,7 @@ const popConfirm = () => {
 const getData = async () => {
   isDisabledConfirm.value = true;
   showLoadingToast({
-    message: '转账中...',
+    message: $t('wallet.TransferInProgress'),
     forbidClick: true,
     });
   try {
@@ -249,10 +249,10 @@ const getData = async () => {
         unitNum.value
       );
     }
-    showToast('转账成功');
+    showToast($t('wallet.TheTransferWasSuccessful'));
     router.push('/wallet');
   } catch (err) {
-    showToast('转账失败');
+    showToast($t('wallet.TransferFailed'));
   } finally {
     showWallet.value = false;
     isDisabledConfirm.value = false;