Allow configuration of default post language
This commit is contained in:
parent
eef9314bcf
commit
571df1fb1f
6 changed files with 36 additions and 7 deletions
|
@ -138,7 +138,12 @@ const PostStatusForm = {
|
|||
statusText = buildMentionsString({ user: this.repliedUser, attentions: this.attentions }, currentUser)
|
||||
}
|
||||
|
||||
const { postContentType: contentType, sensitiveByDefault, sensitiveIfSubject, interfaceLanguage } = this.$store.getters.mergedConfig
|
||||
const {
|
||||
postContentType: contentType,
|
||||
postLanguage: language,
|
||||
sensitiveByDefault,
|
||||
sensitiveIfSubject,
|
||||
} = this.$store.getters.mergedConfig
|
||||
|
||||
let statusParams = {
|
||||
spoilerText: this.subject || '',
|
||||
|
@ -149,12 +154,13 @@ const PostStatusForm = {
|
|||
poll: {},
|
||||
mediaDescriptions: {},
|
||||
visibility: this.suggestedVisibility(),
|
||||
language: interfaceLanguage,
|
||||
contentType
|
||||
contentType,
|
||||
language
|
||||
}
|
||||
|
||||
if (this.statusId || this.isRedraft) {
|
||||
const statusContentType = this.statusContentType || contentType
|
||||
const statusLanguage = this.statusLanguage || language
|
||||
statusParams = {
|
||||
spoilerText: this.subject || '',
|
||||
status: this.statusText || '',
|
||||
|
@ -164,8 +170,8 @@ const PostStatusForm = {
|
|||
poll: this.statusPoll || {},
|
||||
mediaDescriptions: this.statusMediaDescriptions || {},
|
||||
visibility: this.statusScope || this.suggestedVisibility(),
|
||||
language: this.statusLanguage || interfaceLanguage,
|
||||
contentType: statusContentType
|
||||
contentType: statusContentType,
|
||||
language: statusLanguage
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -189,8 +195,8 @@ const PostStatusForm = {
|
|||
poll: draft.data.poll,
|
||||
mediaDescriptions: draft.data.mediaDescriptions,
|
||||
visibility: draft.data.visibility,
|
||||
language: draft.data.language,
|
||||
contentType: draft.data.contentType
|
||||
contentType: draft.data.contentType,
|
||||
language: draft.data.language
|
||||
}
|
||||
|
||||
if (draft.data.poll) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import { library } from '@fortawesome/fontawesome-svg-core'
|
|||
import {
|
||||
faGlobe, faSync
|
||||
} from '@fortawesome/free-solid-svg-icons'
|
||||
import iso6391 from 'iso-639-1'
|
||||
|
||||
library.add(
|
||||
faGlobe,
|
||||
|
@ -80,6 +81,15 @@ const GeneralTab = {
|
|||
label: this.$t(`post_status.content_type["${format}"]`)
|
||||
}))
|
||||
},
|
||||
postLanguages () {
|
||||
return iso6391.getLanguages(iso6391.getAllCodes())
|
||||
.map(lang => ({
|
||||
key: lang.code,
|
||||
value: lang.code,
|
||||
label: lang.nativeName,
|
||||
}))
|
||||
.sort((a, b) => a.label.localeCompare(b.label));
|
||||
},
|
||||
instanceSpecificPanelPresent () { return this.$store.state.instance.showInstanceSpecificPanel },
|
||||
instanceWallpaperUsed () {
|
||||
return this.$store.state.instance.background &&
|
||||
|
|
|
@ -587,6 +587,15 @@
|
|||
{{ $t('settings.subject_line_behavior') }}
|
||||
</ChoiceSetting>
|
||||
</li>
|
||||
<li>
|
||||
<ChoiceSetting
|
||||
id="postLanguage"
|
||||
path="postLanguage"
|
||||
:options="postLanguages"
|
||||
>
|
||||
{{ $t('settings.post_status_language') }}
|
||||
</ChoiceSetting>
|
||||
</li>
|
||||
<li v-if="postFormats.length > 0">
|
||||
<ChoiceSetting
|
||||
id="postContentType"
|
||||
|
|
|
@ -682,6 +682,7 @@
|
|||
"play_videos_in_modal": "Play videos in a popup frame",
|
||||
"post_look_feel": "Posts Look & Feel",
|
||||
"post_status_content_type": "Default post content type",
|
||||
"post_status_language": "Default post language",
|
||||
"posts": "Posts",
|
||||
"preload_images": "Preload images",
|
||||
"presets": "Presets",
|
||||
|
|
|
@ -681,6 +681,7 @@
|
|||
"play_videos_in_modal": "ビデオをメディアビューアーで見る",
|
||||
"post_look_feel": "投稿の見た目",
|
||||
"post_status_content_type": "投稿のコンテントタイプ",
|
||||
"post_status_language": "投稿の言語",
|
||||
"posts": "投稿",
|
||||
"preload_images": "画像を先読みする",
|
||||
"presets": "プリセット",
|
||||
|
|
|
@ -14,6 +14,7 @@ const browserLocale = (window.navigator.language || 'en').split('-')[0]
|
|||
*/
|
||||
export const multiChoiceProperties = [
|
||||
'postContentType',
|
||||
'postLanguage',
|
||||
'subjectLineBehavior',
|
||||
'conversationDisplay', // tree | linear
|
||||
'conversationOtherRepliesButton', // below | inside
|
||||
|
@ -79,6 +80,7 @@ export const defaultState = {
|
|||
subjectLineBehavior: undefined, // instance default
|
||||
alwaysShowSubjectInput: undefined, // instance default
|
||||
postContentType: undefined, // instance default
|
||||
postLanguage: browserLocale,
|
||||
// This hides statuses filtered via a word filter
|
||||
hideFilteredStatuses: undefined, // instance default
|
||||
modalOnRepeat: undefined, // instance default
|
||||
|
|
Loading…
Reference in a new issue