新增首次运行时自动根据当前系统使用的语言设置软件显示的语言
This commit is contained in:
@@ -105,8 +105,8 @@ export default {
|
||||
},
|
||||
},
|
||||
created() {
|
||||
rendererOn(NAMES.winLyric.set_lyric_config, (event, config) => this.lrcConfig = config)
|
||||
rendererInvoke(NAMES.winLyric.get_lyric_config).then(config => this.lrcConfig = config)
|
||||
rendererOn(NAMES.winLyric.set_lyric_config, (event, config) => this.handleUpdateConfig(config))
|
||||
rendererInvoke(NAMES.winLyric.get_lyric_config).then(config => this.handleUpdateConfig(config))
|
||||
},
|
||||
mounted() {
|
||||
document.addEventListener('mousemove', this.handleMouseMove)
|
||||
@@ -117,6 +117,10 @@ export default {
|
||||
document.removeEventListener('mouseup', this.handleMouseUp)
|
||||
},
|
||||
methods: {
|
||||
handleUpdateConfig({ config, languageId }) {
|
||||
this.lrcConfig = config
|
||||
if (this.$i18n.locale !== languageId && languageId != null) this.$i18n.locale = languageId
|
||||
},
|
||||
handleMouseDown(origin, event) {
|
||||
this.handleMouseUp()
|
||||
this.resize.origin = origin
|
||||
|
||||
@@ -14,8 +14,8 @@ import messages from '../../renderer/lang'
|
||||
Vue.use(VueI18n)
|
||||
|
||||
const i18n = window.i18n = new VueI18n({
|
||||
locale: 'cns',
|
||||
fallbackLocale: 'cns',
|
||||
locale: 'zh-cn',
|
||||
fallbackLocale: 'zh-cn',
|
||||
messages,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user