From c96e307060a390eff8e1e67151d8062f28bcc56b Mon Sep 17 00:00:00 2001 From: caiyuchao Date: Wed, 18 Jun 2025 17:58:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BB=9F=E4=B8=80=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 2 +- index.html | 2 ++ public/langs/en-us.js | 5 +++++ public/langs/zh-cn.js | 5 +++++ src/locales/locale.ts | 11 +++++++---- src/views/_builtin/login/index.vue | 2 +- 6 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 public/langs/en-us.js create mode 100644 public/langs/zh-cn.js diff --git a/.env b/.env index 5823e02..0c3e4e1 100644 --- a/.env +++ b/.env @@ -1,6 +1,6 @@ VITE_BASE_URL=/ -VITE_APP_TITLE="WANFi Platform" +VITE_APP_TITLE="Platform" # the prefix of the icon name VITE_ICON_PREFIX=icon diff --git a/index.html b/index.html index c62bd48..8f6f311 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,8 @@ + + %VITE_APP_TITLE% diff --git a/public/langs/en-us.js b/public/langs/en-us.js new file mode 100644 index 0000000..16009e9 --- /dev/null +++ b/public/langs/en-us.js @@ -0,0 +1,5 @@ +const enUS = { + system: { + title: 'MacroHub' + } +}; diff --git a/public/langs/zh-cn.js b/public/langs/zh-cn.js new file mode 100644 index 0000000..1f81503 --- /dev/null +++ b/public/langs/zh-cn.js @@ -0,0 +1,5 @@ +const zhCN = { + system: { + title: 'MacroHub' + } +}; diff --git a/src/locales/locale.ts b/src/locales/locale.ts index dc38010..85a2d3a 100644 --- a/src/locales/locale.ts +++ b/src/locales/locale.ts @@ -1,9 +1,12 @@ -import zhCN from './langs/zh-cn'; -import enUS from './langs/en-us'; +import localeZhCN from './langs/zh-cn'; +import localeEnUS from './langs/en-us'; + +const fullZhCN = { ...localeZhCN, ...zhCN }; +const fullEnUS = { ...localeEnUS, ...enUS }; const locales: Record = { - 'zh-CN': zhCN, - 'en-US': enUS + 'zh-CN': fullZhCN, + 'en-US': fullEnUS }; export default locales; diff --git a/src/views/_builtin/login/index.vue b/src/views/_builtin/login/index.vue index 84f0502..70ca0bd 100644 --- a/src/views/_builtin/login/index.vue +++ b/src/views/_builtin/login/index.vue @@ -62,7 +62,7 @@ const bgColor = computed(() => {
-

{{ "WANFi" }}

+

{{ $t('system.title') }}