mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Style, update languageOptions to contain all
- languages we support for translations
This commit is contained in:
parent
40aaa151dd
commit
97e8fa1af8
@ -6,12 +6,20 @@
|
|||||||
<no-ssr>
|
<no-ssr>
|
||||||
<hc-editor :users="users" :value="form.content" @input="updateEditorContent" />
|
<hc-editor :users="users" :value="form.content" @input="updateEditorContent" />
|
||||||
</no-ssr>
|
</no-ssr>
|
||||||
|
<ds-space margin-bottom="xxx-large" />
|
||||||
|
<ds-flex class="contribution-form-footer">
|
||||||
|
<ds-flex-item :width="{ base: '0%', sm: '10%', md: '10%', lg: '15%' }" />
|
||||||
|
<ds-flex-item :width="{ base: '80%', sm: '30%', md: '30%', lg: '20%' }">
|
||||||
|
<ds-space margin-bottom="small" />
|
||||||
<ds-select
|
<ds-select
|
||||||
model="language"
|
model="language"
|
||||||
:options="form.languageOptions"
|
:options="form.languageOptions"
|
||||||
icon="globe"
|
icon="globe"
|
||||||
:placeholder="locale"
|
:placeholder="locale"
|
||||||
|
:label="$t('contribution.languageSelectLabel')"
|
||||||
/>
|
/>
|
||||||
|
</ds-flex-item>
|
||||||
|
</ds-flex>
|
||||||
<div slot="footer" style="text-align: right">
|
<div slot="footer" style="text-align: right">
|
||||||
<ds-button
|
<ds-button
|
||||||
:disabled="loading || disabled"
|
:disabled="loading || disabled"
|
||||||
@ -54,17 +62,7 @@ export default {
|
|||||||
title: '',
|
title: '',
|
||||||
content: '',
|
content: '',
|
||||||
language: null,
|
language: null,
|
||||||
locales: orderBy(process.env.locales, 'name'),
|
languageOptions: [],
|
||||||
languageOptions: [
|
|
||||||
{
|
|
||||||
label: 'Deutsch',
|
|
||||||
value: 'de',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'English',
|
|
||||||
value: 'en',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
formSchema: {
|
formSchema: {
|
||||||
title: { required: true, min: 3, max: 64 },
|
title: { required: true, min: 3, max: 64 },
|
||||||
@ -94,10 +92,13 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
locale() {
|
locale() {
|
||||||
let locale
|
let locale
|
||||||
locale = this.form.locales.find(this.returnLocaleName)
|
locale = process.env.locales.find(this.returnLocaleName)
|
||||||
return locale.name
|
return locale.name
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.availableLocales()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
submit() {
|
submit() {
|
||||||
const postMutations = require('~/graphql/PostMutations.js').default(this)
|
const postMutations = require('~/graphql/PostMutations.js').default(this)
|
||||||
@ -139,6 +140,11 @@ export default {
|
|||||||
return locale
|
return locale
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
availableLocales() {
|
||||||
|
orderBy(process.env.locales, 'name').map(locale => {
|
||||||
|
this.form.languageOptions.push({ label: locale.name, value: locale.code })
|
||||||
|
})
|
||||||
|
},
|
||||||
},
|
},
|
||||||
apollo: {
|
apollo: {
|
||||||
User: {
|
User: {
|
||||||
@ -171,4 +177,8 @@ export default {
|
|||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.contribution-form-footer {
|
||||||
|
border-top: $border-size-base solid $border-color-softest;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -297,6 +297,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"contribution": {
|
"contribution": {
|
||||||
"success": "Gespeichert!"
|
"success": "Gespeichert!",
|
||||||
|
"languageSelectLabel": "Sprache"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -296,6 +296,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"contribution": {
|
"contribution": {
|
||||||
"success": "Saved!"
|
"success": "Saved!",
|
||||||
|
"languageSelectLabel": "Language"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user