Show current selected language (#3429)

This commit is contained in:
MeiMei 2018-11-29 21:56:53 +09:00 committed by syuilo
parent 91f624c900
commit 55a57db958
2 changed files with 19 additions and 1 deletions

View File

@ -182,6 +182,7 @@
</optgroup>
</ui-select>
<div class="none ui info">
<div>Current: <i>{{ this.currentLanguage }}</i></div>
<p><fa icon="info-circle"/>{{ $t('language-desc') }}</p>
</div>
</section>
@ -350,6 +351,7 @@ export default Vue.extend({
meta: null,
version,
langs,
currentLanguage: 'Unknown',
latestVersion: undefined,
checkingForUpdate: false
};
@ -554,6 +556,12 @@ export default Vue.extend({
this.$root.getMeta().then(meta => {
this.meta = meta;
});
try {
const locale = JSON.parse(localStorage.getItem('locale') || "{}");
const localeKey = localStorage.getItem('localeKey');
this.currentLanguage = `${locale.meta.lang} (${localeKey})`;
} catch { }
},
methods: {
readAllUnreadNotes() {

View File

@ -118,7 +118,8 @@
<option v-for="x in langs" :value="x[0]" :key="x[0]">{{ x[1] }}</option>
</optgroup>
</ui-select>
<span><fa icon="info-circle"/> {{ $t('lang-tip') }}</span>
<div>Current: <i>{{ this.currentLanguage }}</i></div>
<p><fa icon="info-circle"/> {{ $t('lang-tip') }}</p>
</section>
</ui-card>
@ -225,6 +226,7 @@ export default Vue.extend({
version,
codename,
langs,
currentLanguage: 'Unknown',
latestVersion: undefined,
checkingForUpdate: false
};
@ -377,6 +379,14 @@ export default Vue.extend({
},
},
created() {
try {
const locale = JSON.parse(localStorage.getItem('locale') || "{}");
const localeKey = localStorage.getItem('localeKey');
this.currentLanguage = `${locale.meta.lang} (${localeKey})`;
} catch { }
},
mounted() {
document.title = this.$t('settings');
},