mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-16 07:57:33 +08:00
code refactor
This commit is contained in:
@@ -70,7 +70,7 @@
|
||||
@click="changeLanguage(locale)"
|
||||
>
|
||||
<template #after>
|
||||
<f7-icon class="list-item-checked-icon" f7="checkmark_alt" v-if="$i18n.locale === locale"></f7-icon>
|
||||
<f7-icon class="list-item-checked-icon" f7="checkmark_alt" v-if="currentLanguageCode === locale"></f7-icon>
|
||||
</template>
|
||||
</f7-list-item>
|
||||
</f7-list>
|
||||
@@ -183,15 +183,11 @@ export default {
|
||||
return 'Use a backup code';
|
||||
}
|
||||
},
|
||||
currentLanguageCode() {
|
||||
return this.$locale.getCurrentLanguageCode();
|
||||
},
|
||||
currentLanguageName() {
|
||||
const currentLocale = this.$i18n.locale;
|
||||
let lang = this.$locale.getLanguageInfo(currentLocale);
|
||||
|
||||
if (!lang) {
|
||||
lang = this.$locale.getLanguageInfo(this.$locale.getDefaultLanguage());
|
||||
}
|
||||
|
||||
return lang.displayName;
|
||||
return this.$locale.getCurrentLanguageDisplayName();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -103,7 +103,7 @@ export default {
|
||||
const self = this;
|
||||
|
||||
return {
|
||||
currentLocale: self.$i18n.locale,
|
||||
currentLocale: self.$locale.getCurrentLanguageCode(),
|
||||
logouting: false
|
||||
};
|
||||
},
|
||||
@@ -196,7 +196,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
onPageAfterIn() {
|
||||
this.currentLocale = this.$i18n.locale;
|
||||
this.currentLocale = this.$locale.getCurrentLanguageCode();
|
||||
},
|
||||
logout() {
|
||||
const self = this;
|
||||
|
||||
@@ -198,7 +198,7 @@ export default {
|
||||
confirmPassword: '',
|
||||
email: '',
|
||||
nickname: '',
|
||||
language: self.$i18n.locale,
|
||||
language: self.$locale.getCurrentLanguageCode(),
|
||||
defaultCurrency: settingsStore.localeDefaultSettings.currency,
|
||||
firstDayOfWeek: settingsStore.localeDefaultSettings.firstDayOfWeek,
|
||||
},
|
||||
@@ -227,7 +227,7 @@ export default {
|
||||
},
|
||||
currentLocale: {
|
||||
get: function () {
|
||||
return this.$i18n.locale;
|
||||
return this.$locale.getCurrentLanguageCode();
|
||||
},
|
||||
set: function (value) {
|
||||
const isCurrencyDefault = this.user.defaultCurrency === this.settingsStore.localeDefaultSettings.currency;
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
@click="changeLanguage(locale)"
|
||||
>
|
||||
<template #after>
|
||||
<f7-icon class="list-item-checked-icon" f7="checkmark_alt" v-if="$i18n.locale === locale"></f7-icon>
|
||||
<f7-icon class="list-item-checked-icon" f7="checkmark_alt" v-if="currentLanguageCode === locale"></f7-icon>
|
||||
</template>
|
||||
</f7-list-item>
|
||||
</f7-list>
|
||||
@@ -94,15 +94,11 @@ export default {
|
||||
&& this.$user.getWebAuthnCredentialId()
|
||||
&& webauthn.isSupported();
|
||||
},
|
||||
currentLanguageCode() {
|
||||
return this.$locale.getCurrentLanguageCode();
|
||||
},
|
||||
currentLanguageName() {
|
||||
const currentLocale = this.$i18n.locale;
|
||||
let lang = this.$locale.getLanguageInfo(currentLocale);
|
||||
|
||||
if (!lang) {
|
||||
lang = this.$locale.getLanguageInfo(this.$locale.getDefaultLanguage());
|
||||
}
|
||||
|
||||
return lang.displayName;
|
||||
return this.$locale.getCurrentLanguageDisplayName();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -71,7 +71,7 @@ export default {
|
||||
|
||||
return {
|
||||
loadingError: null,
|
||||
currentLocale: self.$i18n.locale,
|
||||
currentLocale: self.$locale.getCurrentLanguageCode(),
|
||||
categoryType: 0,
|
||||
allCategories: [],
|
||||
submitting: false,
|
||||
|
||||
Reference in New Issue
Block a user