Skip to content

Commit

Permalink
fix: 🐛 Reset preferences language not restored
Browse files Browse the repository at this point in the history
  • Loading branch information
viarotel committed Nov 2, 2023
1 parent 59b808c commit d691780
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
14 changes: 14 additions & 0 deletions src/components/Preference/LanguageSelect/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ export default {
type: Object,
default: () => ({}),
},
preferenceData: {
type: Object,
default: () => ({}),
},
},
emits: ['update:model-value'],
data() {
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/locales/languages/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/locales/languages/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "视频编码",
Expand Down

0 comments on commit d691780

Please sign in to comment.