英/法/德/西/阿/波语言配置

This commit is contained in:
huangjp
2026-01-30 09:35:52 +08:00
parent a46c4d23bf
commit 4c3039ade7
25 changed files with 4181 additions and 1156 deletions

27
App.vue
View File

@ -3,12 +3,27 @@ import VueI18n from '@/common/vue-i18n.min.js'
import Vue from 'vue'
export default {
async onShow() {
const res = await this.$u.api.GetLanguageConfig('zh')
const res2 = await this.$u.api.GetLanguageConfig('en')
const result = JSON.parse(res.data[0].content)
const result2 = JSON.parse(res2.data[0].content)
this.$i18n.mergeLocaleMessage('en_US',result2) //添加英文
this.$i18n.mergeLocaleMessage('zh_CN',result) //添加中文
const res = await this.$u.api.GetLanguageConfig('zh')
const res2 = await this.$u.api.GetLanguageConfig('en')
const res3 = await this.$u.api.GetLanguageConfig('fr')
const res4 = await this.$u.api.GetLanguageConfig('es')
const res5 = await this.$u.api.GetLanguageConfig('ar')
const res6 = await this.$u.api.GetLanguageConfig('de')
const res7 = await this.$u.api.GetLanguageConfig('pl')
const result = JSON.parse(res.data[0].content)
const result2 = JSON.parse(res2.data[0].content)
const result3 = JSON.parse(res3.data[0].content)
const result4 = JSON.parse(res4.data[0].content)
const result5 = JSON.parse(res5.data[0].content)
const result6 = JSON.parse(res6.data[0].content)
const result7 = JSON.parse(res7.data[0].content)
this.$i18n.mergeLocaleMessage('en_US', result2) //添加英文
this.$i18n.mergeLocaleMessage('zh_CN', result) //添加中文
this.$i18n.mergeLocaleMessage('fr_FR', result3) //添加法语
this.$i18n.mergeLocaleMessage('es_ES', result4) //添加西班牙语
this.$i18n.mergeLocaleMessage('ar_EG', result5) //添加阿拉伯语
this.$i18n.mergeLocaleMessage('de_DE', result6) //添加德语
this.$i18n.mergeLocaleMessage('pl_PL', result7) //添加波兰语
},
onLaunch() {
// 国际化,设置当前语言