From ac4b9214647d61e70591e41494ce2249890a4b6d Mon Sep 17 00:00:00 2001 From: hejin Date: Sun, 10 Aug 2025 23:53:38 +0800 Subject: [PATCH] =?UTF-8?q?'=E9=85=8D=E7=BD=AE=E5=A4=9A=E8=AF=AD=E8=A8=80?= =?UTF-8?q?=EF=BC=8C=E9=85=8D=E7=BD=AE=E8=BF=90=E8=A1=8C=E5=AE=89=E5=8D=93?= =?UTF-8?q?=E6=A8=A1=E6=8B=9F=E5=99=A8'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .hbuilderx/launch.json | 13 +++++++++++++ src/main.js | 3 ++- src/pages/index/index.vue | 2 +- vite.config.js | 3 +++ 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 .hbuilderx/launch.json diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json new file mode 100644 index 0000000..a81b424 --- /dev/null +++ b/.hbuilderx/launch.json @@ -0,0 +1,13 @@ +{ + "version" : "1.0", + "configurations" : [ + { + "openVueDevtools" : true, + "type" : "uni-app:app-ios" + }, + { + "openVueDevtools" : true, + "type" : "uni-app:app-android" + } + ] +} diff --git a/src/main.js b/src/main.js index 4b78d98..a0a9213 100644 --- a/src/main.js +++ b/src/main.js @@ -23,8 +23,9 @@ uni.$showTost = function (title='加载失败!',duration=1500,mask=false) { const messages = { en, - zh, + 'zh-Hans': zh, } +uni.setLocale('en') let i18nConfig = { locale: uni.getLocale(),// 获取已设置的语言 messages diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 6ae463e..1833532 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -16,7 +16,7 @@ const piniaIndex = index() onLoad(() => { - + uni.setLocale('en') }) diff --git a/vite.config.js b/vite.config.js index 3fa9863..9c2a111 100644 --- a/vite.config.js +++ b/vite.config.js @@ -10,6 +10,9 @@ export default defineConfig(({ command, mode }) => { plugins: [uni()], base: './', define: { + __VUE_I18N_FULL_INSTALL__: true, + __VUE_I18N_LEGACY_API__: true, + __INTLIFY_PROD_DEVTOOLS__: false, __APP_ENV__: env.APP_ENV, MY_APP_CONFIG: {