fix: 🐛 Reset preferences language not restored

This commit is contained in:
viarotel 2023-11-02 18:17:44 +08:00
parent 59b808c70a
commit d691780133
3 changed files with 16 additions and 2 deletions

View File

@ -30,6 +30,10 @@ export default {
type: Object, type: Object,
default: () => ({}), default: () => ({}),
}, },
preferenceData: {
type: Object,
default: () => ({}),
},
}, },
emits: ['update:model-value'], emits: ['update:model-value'],
data() { data() {
@ -42,6 +46,16 @@ export default {
})), })),
} }
}, },
watch: {
'preferenceData.language': {
handler(value) {
if (!value) {
return
}
this.locale = value
},
},
},
methods: { methods: {
onChange(value) { onChange(value) {
this.$emit('update:model-value', value) this.$emit('update:model-value', value)

View File

@ -136,7 +136,7 @@
"preferences.video.resolution.name": "Resolution", "preferences.video.resolution.name": "Resolution",
"preferences.video.resolution.placeholder": "Default is device resolution e.g. 1920", "preferences.video.resolution.placeholder": "Default is device resolution e.g. 1920",
"preferences.video.bit.name": "Video Bit Rate", "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.name": "Video Codec",
"preferences.video.video-code.placeholder": "Default H.264", "preferences.video.video-code.placeholder": "Default H.264",
"preferences.video.refresh-rate.name": "Frame Rate", "preferences.video.refresh-rate.name": "Frame Rate",

View File

@ -136,7 +136,7 @@
"preferences.video.resolution.name": "分辨率", "preferences.video.resolution.name": "分辨率",
"preferences.video.resolution.placeholder": "默认值为设备分辨率,如 1920", "preferences.video.resolution.placeholder": "默认值为设备分辨率,如 1920",
"preferences.video.bit.name": "视频比特率", "preferences.video.bit.name": "视频比特率",
"preferences.video.bit.placeholder": "默认值为 8000000", "preferences.video.bit.placeholder": "默认值为 8000000bps",
"preferences.video.refresh-rate.name": "刷新率", "preferences.video.refresh-rate.name": "刷新率",
"preferences.video.refresh-rate.placeholder": "默认值为 60", "preferences.video.refresh-rate.placeholder": "默认值为 60",
"preferences.video.video-code.name": "视频编码", "preferences.video.video-code.name": "视频编码",