mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-04-14 18:41:04 +08:00
Fix some bugs
Fix some bugs
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
"naive-ui": "^2.34.4",
|
||||
"pinia": "^2.1.3",
|
||||
"vue": "^3.3.4",
|
||||
"vue-i18n": "^9.3.0-beta.19",
|
||||
"vue-i18n": "^9.2.2",
|
||||
"vue-router": "^4.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -68,12 +68,14 @@ onUnmounted(() => {
|
||||
|
||||
function changeLocale(){
|
||||
if(localStorage.getItem('lang') === 'zh-CN'){
|
||||
locale.value = 'en-US';
|
||||
localStorage.setItem('lang', locale.value);
|
||||
let newLang = 'en-US';
|
||||
locale.value = newLang;
|
||||
localStorage.setItem('lang', newLang);
|
||||
location.reload();
|
||||
} else {
|
||||
locale.value = 'zh-CN';
|
||||
localStorage.setItem('lang', locale.value);
|
||||
let newLang = 'zh-CN';
|
||||
locale.value = newLang;
|
||||
localStorage.setItem('lang', newLang);
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import messages from '@intlify/unplugin-vue-i18n/messages'
|
||||
//Default language is the same as last setting (undefined is browser language)
|
||||
let lang = localStorage.getItem('lang');
|
||||
if(lang === null){
|
||||
const navLang = navigator.language || navigator.userLanguage;
|
||||
const navLang = navigator.language;
|
||||
let localLang = navLang || false;
|
||||
lang = localLang || 'en-US';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user