多语言切换优化

master
gongfuxiang 2024-02-02 17:16:09 +08:00
parent c587a95f14
commit 625e63cf1f
2 changed files with 4 additions and 30 deletions

View File

@ -389,7 +389,6 @@
//
system_locale: '',
application_locale: '',
is_android: '',
//
popup_language_status: false,
@ -469,7 +468,6 @@
let system_info = uni.getSystemInfoSync();
this.system_locale = system_info.language;
this.application_locale = app.globalData.get_language_value();
this.is_android = system_info.platform.toLowerCase() === 'android';
uni.onLocaleChange((e) => {
this.application_locale = e.locale;
});
@ -1611,19 +1609,8 @@
//
language_change(key) {
if (this.is_android) {
uni.showModal({
content: this.$t('login.login.d9d11z'),
success: (res) => {
if (res.confirm) {
uni.setLocale(key);
}
},
});
} else {
uni.setLocale(key);
this.$i18n.locale = key;
}
uni.setLocale(key);
this.$i18n.locale = key;
},
//

View File

@ -95,7 +95,6 @@
//
system_locale: '',
application_locale: '',
is_android: '',
home_use_multilingual_status: 0,
//
popup_language_status: false,
@ -118,7 +117,6 @@
let system_info = uni.getSystemInfoSync();
this.system_locale = system_info.language;
this.application_locale = app.globalData.get_language_value();
this.is_android = system_info.platform.toLowerCase() === 'android';
uni.onLocaleChange((e) => {
this.application_locale = e.locale;
});
@ -246,19 +244,8 @@
//
language_change(key) {
if (this.is_android) {
uni.showModal({
content: this.$t('login.login.d9d11z'),
success: (res) => {
if (res.confirm) {
uni.setLocale(key);
}
},
});
} else {
uni.setLocale(key);
this.$i18n.locale = key;
}
uni.setLocale(key);
this.$i18n.locale = key;
},
},
};