refs #1106 Add some empty language translation
This commit is contained in:
parent
bf234a423c
commit
fd544560cf
|
@ -0,0 +1 @@
|
|||
{}
|
|
@ -0,0 +1 @@
|
|||
{}
|
|
@ -0,0 +1 @@
|
|||
{}
|
|
@ -0,0 +1 @@
|
|||
{}
|
|
@ -0,0 +1 @@
|
|||
{}
|
|
@ -0,0 +1 @@
|
|||
{}
|
|
@ -30,5 +30,29 @@ export default {
|
|||
zh_cn: {
|
||||
name: '简体中文',
|
||||
key: 'zh_cn'
|
||||
},
|
||||
cs: {
|
||||
name: 'čeština',
|
||||
key: 'cs'
|
||||
},
|
||||
es_es: {
|
||||
name: 'Español',
|
||||
key: 'es_es'
|
||||
},
|
||||
no: {
|
||||
name: 'norsk',
|
||||
key: 'no'
|
||||
},
|
||||
pt_pt: {
|
||||
name: 'Português',
|
||||
key: 'pt_pt'
|
||||
},
|
||||
ru: {
|
||||
name: 'русский',
|
||||
key: 'ru'
|
||||
},
|
||||
sv_se: {
|
||||
name: 'svenska',
|
||||
key: 'sv_se'
|
||||
}
|
||||
}
|
||||
|
|
|
@ -189,6 +189,7 @@ async function getLanguage() {
|
|||
const conf = await preferences.load()
|
||||
return conf.language.language
|
||||
} catch (err) {
|
||||
log.warn(err)
|
||||
return Language.en.key
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,20 +1,15 @@
|
|||
<template>
|
||||
<div id="language">
|
||||
<h2>{{ $t('preferences.language.title') }}</h2>
|
||||
<el-form class="display-language section" label-position="top" size="small">
|
||||
<el-form-item for="language" :label="$t('preferences.language.language_description')">
|
||||
<el-select id="language" v-model="displayLanguage" placeholder="style">
|
||||
<el-option
|
||||
v-for="lang in languages"
|
||||
:key="lang.key"
|
||||
:label="lang.name"
|
||||
:value="lang.key">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<p class="notice">{{ $t('preferences.language.notice') }}</p>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div id="language">
|
||||
<h2>{{ $t('preferences.language.title') }}</h2>
|
||||
<el-form class="display-language section" label-position="top" size="small">
|
||||
<el-form-item for="language" :label="$t('preferences.language.language_description')">
|
||||
<el-select id="language" v-model="displayLanguage" placeholder="style">
|
||||
<el-option v-for="lang in languages" :key="lang.key" :label="lang.name" :value="lang.key"> </el-option>
|
||||
</el-select>
|
||||
<p class="notice">{{ $t('preferences.language.notice') }}</p>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
@ -22,52 +17,52 @@ import Language from '~/src/constants/language'
|
|||
|
||||
export default {
|
||||
name: 'language',
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
languages: [
|
||||
Language.cs,
|
||||
Language.de,
|
||||
Language.en,
|
||||
Language.es_es,
|
||||
Language.fr,
|
||||
Language.it,
|
||||
Language.ja,
|
||||
Language.ko,
|
||||
Language.no,
|
||||
Language.pl,
|
||||
Language.it,
|
||||
Language.pt_pt,
|
||||
Language.ru,
|
||||
Language.sv_se,
|
||||
Language.zh_cn
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
displayLanguage: {
|
||||
get () {
|
||||
get() {
|
||||
return this.$store.state.Preferences.Language.language.language
|
||||
},
|
||||
set (value) {
|
||||
this.$store.dispatch('Preferences/Language/changeLanguage', value)
|
||||
.then(() => {
|
||||
this.confirm()
|
||||
})
|
||||
set(value) {
|
||||
this.$store.dispatch('Preferences/Language/changeLanguage', value).then(() => {
|
||||
this.confirm()
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
created () {
|
||||
created() {
|
||||
this.$store.dispatch('Preferences/Language/loadLanguage')
|
||||
},
|
||||
methods: {
|
||||
confirm () {
|
||||
this.$confirm(
|
||||
this.$t('preferences.language.confirm.message'),
|
||||
this.$t('preferences.language.confirm.title'),
|
||||
{
|
||||
confirmButtonText: this.$t('preferences.language.confirm.ok'),
|
||||
cancelButtonText: this.$t('preferences.language.confirm.cancel'),
|
||||
type: 'warning'
|
||||
}
|
||||
)
|
||||
confirm() {
|
||||
this.$confirm(this.$t('preferences.language.confirm.message'), this.$t('preferences.language.confirm.title'), {
|
||||
confirmButtonText: this.$t('preferences.language.confirm.ok'),
|
||||
cancelButtonText: this.$t('preferences.language.confirm.cancel'),
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
this.$store.dispatch('Preferences/Language/relaunch')
|
||||
})
|
||||
.cancel(() => {
|
||||
})
|
||||
.cancel(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue