语言设置
This commit is contained in:
@@ -23,12 +23,20 @@ import Eyu from '@/common/locales/ru.js';
|
|||||||
// 引入并使用vue-i18n
|
// 引入并使用vue-i18n
|
||||||
import VueI18n from 'vue-i18n'
|
import VueI18n from 'vue-i18n'
|
||||||
Vue.use(VueI18n)
|
Vue.use(VueI18n)
|
||||||
|
let i18nConfig = {
|
||||||
|
locale: uni.getLocale(),// 获取已设置的语言
|
||||||
|
messages: {
|
||||||
|
// 这里的属性名是任意的,您也可以把zh设置为cn等,只是后续切换语言时
|
||||||
|
// 要标识这里的语言属性,如:this.$i18n.locale = zh|en|cn|xxx
|
||||||
|
'zh-Hans': Chinese,
|
||||||
|
'en': English,
|
||||||
|
'ru': Eyu,
|
||||||
|
}
|
||||||
|
}
|
||||||
// 构造i18n对象
|
// 构造i18n对象
|
||||||
const i18n = new VueI18n({
|
const i18n = new VueI18n({
|
||||||
// 默认语言,这里的local属性,对应message中的cn、en属性
|
// 默认语言,这里的local属性,对应message中的cn、en属性
|
||||||
locale: 'zh-Hans',
|
locale:uni.getLocale(),
|
||||||
// 引入语言文件
|
// 引入语言文件
|
||||||
messages: {
|
messages: {
|
||||||
// 这里的属性名是任意的,您也可以把zh设置为cn等,只是后续切换语言时
|
// 这里的属性名是任意的,您也可以把zh设置为cn等,只是后续切换语言时
|
||||||
@@ -38,7 +46,7 @@ const i18n = new VueI18n({
|
|||||||
'ru': Eyu,
|
'ru': Eyu,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
uni.setStorageSync('i18locale', 'zh-Hans');
|
// uni.setStorageSync('i18locale', 'zh-Hans');
|
||||||
App.mpType = 'app'
|
App.mpType = 'app'
|
||||||
Vue.prototype._i18n = i18n
|
Vue.prototype._i18n = i18n
|
||||||
const app = new Vue({
|
const app = new Vue({
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@
|
|||||||
"style" :
|
"style" :
|
||||||
{
|
{
|
||||||
"navigationBarTitleText": "登录",
|
"navigationBarTitleText": "登录",
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": false,
|
||||||
"navigationStyle":"custom",// 去掉微信小程序顶部导航
|
"navigationStyle":"custom",// 去掉微信小程序顶部导航
|
||||||
"app-plus":{
|
"app-plus":{
|
||||||
"titleNView":false //去掉app+h5顶部导航
|
"titleNView":false //去掉app+h5顶部导航
|
||||||
|
|||||||
Reference in New Issue
Block a user