Show current selected language (#3429)
This commit is contained in:
parent
91f624c900
commit
55a57db958
|
@ -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() {
|
||||
|
|
|
@ -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');
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue