From d69178013359b7f2499e4a66c4c124dcb425cfe2 Mon Sep 17 00:00:00 2001 From: viarotel Date: Thu, 2 Nov 2023 18:17:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Reset=20preferences=20lan?= =?UTF-8?q?guage=20not=20restored?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Preference/LanguageSelect/index.vue | 14 ++++++++++++++ src/locales/languages/en_US.json | 2 +- src/locales/languages/zh_CN.json | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/components/Preference/LanguageSelect/index.vue b/src/components/Preference/LanguageSelect/index.vue index 95977a6b..d88f266c 100644 --- a/src/components/Preference/LanguageSelect/index.vue +++ b/src/components/Preference/LanguageSelect/index.vue @@ -30,6 +30,10 @@ export default { type: Object, default: () => ({}), }, + preferenceData: { + type: Object, + default: () => ({}), + }, }, emits: ['update:model-value'], data() { @@ -42,6 +46,16 @@ export default { })), } }, + watch: { + 'preferenceData.language': { + handler(value) { + if (!value) { + return + } + this.locale = value + }, + }, + }, methods: { onChange(value) { this.$emit('update:model-value', value) diff --git a/src/locales/languages/en_US.json b/src/locales/languages/en_US.json index d69c4072..46cc89cc 100644 --- a/src/locales/languages/en_US.json +++ b/src/locales/languages/en_US.json @@ -136,7 +136,7 @@ "preferences.video.resolution.name": "Resolution", "preferences.video.resolution.placeholder": "Default is device resolution e.g. 1920", "preferences.video.bit.name": "Video Bit Rate", - "preferences.video.bit.placeholder": "Default 4M, equal to 4000000", + "preferences.video.bit.placeholder": "Default 8000000bps", "preferences.video.video-code.name": "Video Codec", "preferences.video.video-code.placeholder": "Default H.264", "preferences.video.refresh-rate.name": "Frame Rate", diff --git a/src/locales/languages/zh_CN.json b/src/locales/languages/zh_CN.json index 12a05c57..10c8f37e 100644 --- a/src/locales/languages/zh_CN.json +++ b/src/locales/languages/zh_CN.json @@ -136,7 +136,7 @@ "preferences.video.resolution.name": "分辨率", "preferences.video.resolution.placeholder": "默认值为设备分辨率,如 1920", "preferences.video.bit.name": "视频比特率", - "preferences.video.bit.placeholder": "默认值为 8000000", + "preferences.video.bit.placeholder": "默认值为 8000000bps", "preferences.video.refresh-rate.name": "刷新率", "preferences.video.refresh-rate.placeholder": "默认值为 60", "preferences.video.video-code.name": "视频编码",