添加页面及部分多语言切换

This commit is contained in:
浅念
2025-03-15 15:46:16 +08:00
parent 36ee43c61b
commit f050f7cd4d
19 changed files with 1126 additions and 302 deletions
+4 -2
View File
@@ -18,6 +18,7 @@ Vue.prototype.$backgroundAudioData = {
// 引入语言包,注意路径
import Chinese from '@/common/locales/zh.js';
import English from '@/common/locales/en.js';
import Eyu from '@/common/locales/ru.js';
// 引入并使用vue-i18n
import VueI18n from 'vue-i18n'
@@ -26,13 +27,14 @@ Vue.use(VueI18n)
// 构造i18n对象
const i18n = new VueI18n({
// 默认语言,这里的local属性,对应message中的cn、en属性
locale: 'cn',
locale: 'zh',
// 引入语言文件
messages: {
// 这里的属性名是任意的,您也可以把zh设置为cn等,只是后续切换语言时
// 要标识这里的语言属性,如:this.$i18n.locale = zh|en|cn|xxx
'cn': Chinese,
'zh': Chinese,
'en': English,
'ru': Eyu,
}
})
App.mpType = 'app'