提交 beb77ebc 编写于 作者: fxy060608's avatar fxy060608

fix(mp): i18n

上级 75e493bc
......@@ -734,7 +734,7 @@ const getLocale = () => {
if (app && app.$vm) {
return app.$vm.$locale;
}
return uni.getSystemInfoSync().language || 'zh-Hans';
return my.getSystemInfoSync().language || 'zh-Hans';
};
const setLocale = (locale) => {
const app = getApp();
......
......@@ -601,7 +601,7 @@ function initCreateApp(parseAppOptions) {
};
}
function initLocale(appVm) {
const locale = ref(uni.getSystemInfoSync().language || 'zh-Hans');
const locale = ref(my.getSystemInfoSync().language || 'zh-Hans');
Object.defineProperty(appVm, '$locale', {
get() {
return locale.value;
......
......@@ -734,7 +734,7 @@ const getLocale = () => {
if (app && app.$vm) {
return app.$vm.$locale;
}
return uni.getSystemInfoSync().language || 'zh-Hans';
return swan.getSystemInfoSync().language || 'zh-Hans';
};
const setLocale = (locale) => {
const app = getApp();
......
......@@ -622,7 +622,7 @@ function initCreateApp(parseAppOptions) {
};
}
function initLocale(appVm) {
const locale = ref(uni.getSystemInfoSync().language || 'zh-Hans');
const locale = ref(swan.getSystemInfoSync().language || 'zh-Hans');
Object.defineProperty(appVm, '$locale', {
get() {
return locale.value;
......
......@@ -4,7 +4,7 @@ export const getLocale: typeof uni.getLocale = () => {
if (app && app.$vm) {
return app.$vm.$locale
}
return uni.getSystemInfoSync().language || 'zh-Hans'
return __GLOBAL__.getSystemInfoSync().language || 'zh-Hans'
}
export const setLocale: typeof uni.setLocale = (locale) => {
......
......@@ -96,7 +96,9 @@ export function initCreateApp(parseAppOptions?: ParseAppOptions) {
}
function initLocale(appVm: ComponentPublicInstance) {
const locale = ref<string>(uni.getSystemInfoSync().language || 'zh-Hans')
const locale = ref<string>(
__GLOBAL__.getSystemInfoSync().language || 'zh-Hans'
)
Object.defineProperty(appVm, '$locale', {
get() {
return locale.value
......
......@@ -734,7 +734,7 @@ const getLocale = () => {
if (app && app.$vm) {
return app.$vm.$locale;
}
return uni.getSystemInfoSync().language || 'zh-Hans';
return ks.getSystemInfoSync().language || 'zh-Hans';
};
const setLocale = (locale) => {
const app = getApp();
......
......@@ -622,7 +622,7 @@ function initCreateApp(parseAppOptions) {
};
}
function initLocale(appVm) {
const locale = ref(uni.getSystemInfoSync().language || 'zh-Hans');
const locale = ref(ks.getSystemInfoSync().language || 'zh-Hans');
Object.defineProperty(appVm, '$locale', {
get() {
return locale.value;
......
......@@ -734,7 +734,7 @@ const getLocale = () => {
if (app && app.$vm) {
return app.$vm.$locale;
}
return uni.getSystemInfoSync().language || 'zh-Hans';
return qq.getSystemInfoSync().language || 'zh-Hans';
};
const setLocale = (locale) => {
const app = getApp();
......
......@@ -622,7 +622,7 @@ function initCreateApp(parseAppOptions) {
};
}
function initLocale(appVm) {
const locale = ref(uni.getSystemInfoSync().language || 'zh-Hans');
const locale = ref(qq.getSystemInfoSync().language || 'zh-Hans');
Object.defineProperty(appVm, '$locale', {
get() {
return locale.value;
......
......@@ -734,7 +734,7 @@ const getLocale = () => {
if (app && app.$vm) {
return app.$vm.$locale;
}
return uni.getSystemInfoSync().language || 'zh-Hans';
return tt.getSystemInfoSync().language || 'zh-Hans';
};
const setLocale = (locale) => {
const app = getApp();
......
......@@ -625,7 +625,7 @@ function initCreateApp(parseAppOptions) {
};
}
function initLocale(appVm) {
const locale = ref(uni.getSystemInfoSync().language || 'zh-Hans');
const locale = ref(tt.getSystemInfoSync().language || 'zh-Hans');
Object.defineProperty(appVm, '$locale', {
get() {
return locale.value;
......
......@@ -698,7 +698,7 @@ const getLocale = () => {
if (app && app.$vm) {
return app.$vm.$locale;
}
return uni.getSystemInfoSync().language || 'zh-Hans';
return wx.getSystemInfoSync().language || 'zh-Hans';
};
const setLocale = (locale) => {
const app = getApp();
......
......@@ -568,7 +568,7 @@ function initCreateApp(parseAppOptions) {
};
}
function initLocale(appVm) {
const locale = ref(uni.getSystemInfoSync().language || 'zh-Hans');
const locale = ref(wx.getSystemInfoSync().language || 'zh-Hans');
Object.defineProperty(appVm, '$locale', {
get() {
return locale.value;
......
......@@ -734,7 +734,7 @@ const getLocale = () => {
if (app && app.$vm) {
return app.$vm.$locale;
}
return uni.getSystemInfoSync().language || 'zh-Hans';
return qa.getSystemInfoSync().language || 'zh-Hans';
};
const setLocale = (locale) => {
const app = getApp();
......
......@@ -553,7 +553,7 @@ function initCreateApp(parseAppOptions) {
};
}
function initLocale(appVm) {
const locale = ref(uni.getSystemInfoSync().language || 'zh-Hans');
const locale = ref(qa.getSystemInfoSync().language || 'zh-Hans');
Object.defineProperty(appVm, '$locale', {
get() {
return locale.value;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册