'配置多语言,配置运行安卓模拟器'

This commit is contained in:
hejin 2025-08-10 23:53:38 +08:00
parent 4c8780569f
commit ac4b921464
4 changed files with 19 additions and 2 deletions

13
.hbuilderx/launch.json Normal file
View File

@ -0,0 +1,13 @@
{
"version" : "1.0",
"configurations" : [
{
"openVueDevtools" : true,
"type" : "uni-app:app-ios"
},
{
"openVueDevtools" : true,
"type" : "uni-app:app-android"
}
]
}

View File

@ -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

View File

@ -16,7 +16,7 @@
const piniaIndex = index()
onLoad(() => {
uni.setLocale('en')
})
</script>

View File

@ -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: {