From 55a57db958bb302400fa37e4bc3b58335dcf8f27 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Thu, 29 Nov 2018 21:56:53 +0900 Subject: [PATCH] Show current selected language (#3429) --- src/client/app/desktop/views/components/settings.vue | 8 ++++++++ src/client/app/mobile/views/pages/settings.vue | 12 +++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/client/app/desktop/views/components/settings.vue b/src/client/app/desktop/views/components/settings.vue index a474a5015..6b209641a 100644 --- a/src/client/app/desktop/views/components/settings.vue +++ b/src/client/app/desktop/views/components/settings.vue @@ -182,6 +182,7 @@
+
Current: {{ this.currentLanguage }}

{{ $t('language-desc') }}

@@ -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() { diff --git a/src/client/app/mobile/views/pages/settings.vue b/src/client/app/mobile/views/pages/settings.vue index 8b6d0e79d..a48729c70 100644 --- a/src/client/app/mobile/views/pages/settings.vue +++ b/src/client/app/mobile/views/pages/settings.vue @@ -118,7 +118,8 @@ - {{ $t('lang-tip') }} +
Current: {{ this.currentLanguage }}
+

{{ $t('lang-tip') }}

@@ -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'); },