|
@@ -7,31 +7,32 @@ import uView from "@/uview-ui";
|
|
|
import VueI18n from "vue-i18n";
|
|
|
import messages from "./commont/messages.js";
|
|
|
// import uView from '/uview-ui/uview-ui'
|
|
|
+import { getLanguage } from "./utils/getLanguage";
|
|
|
Vue.use(VueI18n);
|
|
|
Vue.config.productionTip = false;
|
|
|
|
|
|
//获取当前选择语言
|
|
|
let language = "";
|
|
|
+let i18n;
|
|
|
uni.getStorage({
|
|
|
key: "language", // 这里替换成你要获取的数据的key
|
|
|
success: function (res) {
|
|
|
language = res.data; // 输出获取到的数据
|
|
|
Vue.prototype._language = language;
|
|
|
+ // 多国语言包配置
|
|
|
+ i18n = new VueI18n({
|
|
|
+ // locale: language,
|
|
|
+ locale: language,
|
|
|
+ // locale: "en-US",
|
|
|
+ messages,
|
|
|
+ });
|
|
|
+
|
|
|
+ Vue.prototype._i18n = i18n;
|
|
|
},
|
|
|
fail: function () {
|
|
|
// 获取失败的处理逻辑
|
|
|
},
|
|
|
});
|
|
|
-
|
|
|
-// 多国语言包配置
|
|
|
-const i18n = new VueI18n({
|
|
|
- locale: language,
|
|
|
- // locale: "en-US",
|
|
|
- messages,
|
|
|
-});
|
|
|
-
|
|
|
-Vue.prototype._i18n = i18n;
|
|
|
-
|
|
|
Vue.use(uView);
|
|
|
App.mpType = "app";
|
|
|
const app = new Vue({
|