From 179e9b78ca40b2ba078145e2845f648f642f507b Mon Sep 17 00:00:00 2001 From: rosercode Date: Thu, 17 Sep 2026 17:03:49 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=89=8D=E7=AB=AF=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=B8=AD=E8=8B=B1=E6=96=87=E5=A4=9A=E8=AF=AD=E8=A8=80=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 引入 vue-i18n,新增 locales/messages.ts 以中英对照方式维护词条 - 新增 LocaleSwitch 组件,在登录/注册页与主布局顶部栏提供切换入口 - 语言持久化到 localStorage 并同步 ,Naive UI 组件语言联动 - 各视图、表格列、弹窗与提示文案全部接入国际化 - 修复 confirmImport 缺失的 tagIds 类型定义 --- frontend/package.json | 1 + frontend/src/App.vue | 20 +- frontend/src/api/transaction.ts | 1 + frontend/src/components/LocaleSwitch.vue | 30 +++ frontend/src/locales/index.ts | 77 ++++++ frontend/src/locales/messages.ts | 302 +++++++++++++++++++++++ frontend/src/main.ts | 2 + frontend/src/views/BillImportModal.vue | 136 +++++----- frontend/src/views/CategoryManage.vue | 70 +++--- frontend/src/views/Dashboard.vue | 101 ++++---- frontend/src/views/Layout.vue | 26 +- frontend/src/views/Login.vue | 26 +- frontend/src/views/Register.vue | 40 +-- frontend/src/views/TagManage.vue | 56 +++-- frontend/src/views/TransactionList.vue | 269 ++++++++++---------- 15 files changed, 806 insertions(+), 351 deletions(-) create mode 100644 frontend/src/components/LocaleSwitch.vue create mode 100644 frontend/src/locales/index.ts create mode 100644 frontend/src/locales/messages.ts diff --git a/frontend/package.json b/frontend/package.json index 7c770e5..ab1f1cb 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -16,6 +16,7 @@ "pinia": "^4.0.3", "vue": "^3.5.41", "vue-echarts": "^8.1.0", + "vue-i18n": "^11.4.12", "vue-router": "^4.6.4" }, "devDependencies": { diff --git a/frontend/src/App.vue b/frontend/src/App.vue index d5da4da..0ea0c47 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,12 +1,22 @@