refs #1106 Add some empty language translation

This commit is contained in:
AkiraFukushima 2019-11-19 22:38:57 +09:00
parent bf234a423c
commit fd544560cf
9 changed files with 63 additions and 37 deletions

View File

@ -0,0 +1 @@
{}

View File

@ -0,0 +1 @@
{}

View File

@ -0,0 +1 @@
{}

View File

@ -0,0 +1 @@
{}

View File

@ -0,0 +1 @@
{}

View File

@ -0,0 +1 @@
{}

View File

@ -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'
}
}

View File

@ -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
}
}

View File

@ -1,20 +1,15 @@
<template>
<div id="language">
<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-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>
</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(() => {
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'),
{
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(() => {})
}
}
}