From 5dded8752317090f6edfc67610cd6783711c7723 Mon Sep 17 00:00:00 2001 From: KUN1007 Date: Wed, 31 May 2023 23:40:11 +0800 Subject: [PATCH] complete balance page i18n, fix settings panel BUG --- .../setting-panel/components/Loli.vue | 2 +- src/language/en.ts | 14 +++++++++++++- src/language/zh.ts | 12 ++++++++++++ src/views/balance/Balance.vue | 19 ++++++++++++++++--- src/views/balance/components/Form.vue | 7 ++++--- 5 files changed, 46 insertions(+), 8 deletions(-) diff --git a/src/components/setting-panel/components/Loli.vue b/src/components/setting-panel/components/Loli.vue index 56c11a87..d49a8721 100644 --- a/src/components/setting-panel/components/Loli.vue +++ b/src/components/setting-panel/components/Loli.vue @@ -37,7 +37,7 @@ import { /* 定位看板娘,重要 */ position: fixed; z-index: 9999; - top: -250px; + top: -270px; left: 150px; } .lass { diff --git a/src/language/en.ts b/src/language/en.ts index e4863793..d3590c96 100644 --- a/src/language/en.ts +++ b/src/language/en.ts @@ -25,7 +25,7 @@ export default { fold: 'Fold Aside', create: 'CREATE NEW!', update: 'Update', - balance: 'Balance', + balance: 'P & L', ranking: 'Ranking', bylaw: 'Bylaw', contacts: 'Join Us', @@ -52,4 +52,16 @@ export default { time: 'Estimated update time', history: 'History Version', }, + balance: { + pl: 'Income and Expenditure Statement', // Profit and Loss + income: 'INCOME', + totalIncome: 'Total Income', + expenditure: 'EXPENDITURE', + totalExpenditure: 'Total Expenditure', + status: 'Economic Status', + deficitStatus: 'DEFICIT', + deficitAmount: 'Deficit Amount', + surplusStatus: 'Surplus', + surplusAmount: 'Surplus Amount', + }, } diff --git a/src/language/zh.ts b/src/language/zh.ts index ae0cb28d..acd453c5 100644 --- a/src/language/zh.ts +++ b/src/language/zh.ts @@ -52,4 +52,16 @@ export default { time: '预计更新时间', history: '历史版本', }, + balance: { + pl: '收支公示', + income: '收入', + totalIncome: '总收入', + expenditure: '支出', + totalExpenditure: '总支出', + status: '经济状态', + deficitStatus: '亏损', + deficitAmount: '亏损金额', + surplusStatus: '盈余', + surplusAmount: '盈余金额', + }, } diff --git a/src/views/balance/Balance.vue b/src/views/balance/Balance.vue index 0a44c99d..3cbaa202 100644 --- a/src/views/balance/Balance.vue +++ b/src/views/balance/Balance.vue @@ -14,7 +14,7 @@ import { calculateTotalAmount } from './log'
-
收支公示
+
{{ $t('balance.pl') }}
@@ -27,8 +27,21 @@ import { calculateTotalAmount } from './log' class="amount-status-deficit" :class="calculateTotalAmount() >= 0 ? 'amount-status-surplus' : ''" > -
经济状态: 亏损
-
亏损金额: {{ calculateTotalAmount() }} CNY
+
+ {{ $t('balance.status') }}: + {{ + calculateTotalAmount() >= 0 + ? $t('balance.surplusStatus') + : $t('balance.deficitStatus') + }} +
+
+ {{ + calculateTotalAmount() >= 0 + ? $t('balance.surplusAmount') + : $t('balance.deficitAmount') + }}: {{ calculateTotalAmount() }} CNY +
diff --git a/src/views/balance/components/Form.vue b/src/views/balance/components/Form.vue index 73dbd7b1..9d37a440 100644 --- a/src/views/balance/components/Form.vue +++ b/src/views/balance/components/Form.vue @@ -4,21 +4,22 @@ import Log from './Log.vue' import { calculateTotalIncome, calculateTotalExpenditure } from '../log' const props = defineProps(['isIncome']) -const status = props.isIncome ? '收入' : '支出' +const title = props.isIncome ? 'income' : 'expenditure' +const total = props.isIncome ? 'totalIncome' : 'totalExpenditure'