mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-22 01:15:25 +03:00
feat: use configured writing/post language of user from mastodon (#2282)
This commit is contained in:
parent
0a9f2d99d5
commit
675f5184a0
4 changed files with 23 additions and 7 deletions
|
@ -15,7 +15,7 @@ export function usePublish(options: {
|
||||||
const { client } = $(useMasto())
|
const { client } = $(useMasto())
|
||||||
const settings = useUserSettings()
|
const settings = useUserSettings()
|
||||||
|
|
||||||
const preferredLanguage = $computed(() => (settings.value?.language || 'en').split('-')[0])
|
const preferredLanguage = $computed(() => (currentUser.value?.account.source.language || settings.value?.language || 'en').split('-')[0])
|
||||||
|
|
||||||
let isSending = $ref(false)
|
let isSending = $ref(false)
|
||||||
const isExpanded = $ref(false)
|
const isExpanded = $ref(false)
|
||||||
|
|
|
@ -426,6 +426,7 @@
|
||||||
"language": {
|
"language": {
|
||||||
"display_language": "Anzeigesprache",
|
"display_language": "Anzeigesprache",
|
||||||
"label": "Sprache",
|
"label": "Sprache",
|
||||||
|
"post_language": "Beitragssprache",
|
||||||
"status": "Übersetzungsstatus: {0}/{1} ({2}%)",
|
"status": "Übersetzungsstatus: {0}/{1} ({2}%)",
|
||||||
"translations": {
|
"translations": {
|
||||||
"add": "Hinzufügen",
|
"add": "Hinzufügen",
|
||||||
|
|
|
@ -427,6 +427,7 @@
|
||||||
"language": {
|
"language": {
|
||||||
"display_language": "Display Language",
|
"display_language": "Display Language",
|
||||||
"label": "Language",
|
"label": "Language",
|
||||||
|
"post_language": "Posting Language",
|
||||||
"status": "Translation status: {0}/{1} ({2}%)",
|
"status": "Translation status: {0}/{1} ({2}%)",
|
||||||
"translations": {
|
"translations": {
|
||||||
"add": "Add",
|
"add": "Add",
|
||||||
|
|
|
@ -22,13 +22,27 @@ const status = computed(() => {
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<div p6>
|
<div p6>
|
||||||
<label space-y-2>
|
<div space-y-2>
|
||||||
<span block font-medium>{{ $t('settings.language.display_language') }}</span>
|
<h2 py2 font-bold text-xl flex="~ gap-1" items-center>
|
||||||
<span block>
|
{{ $t('settings.language.display_language') }}
|
||||||
{{ status }}
|
</h2>
|
||||||
</span>
|
<div>{{ status }}</div>
|
||||||
<SettingsLanguage select-settings />
|
<SettingsLanguage select-settings />
|
||||||
</label>
|
</div>
|
||||||
|
<div mt4>
|
||||||
|
<h2 font-bold text-xl flex="~ gap-1" items-center>
|
||||||
|
{{ $t('settings.language.post_language') }}
|
||||||
|
</h2>
|
||||||
|
<SettingsItem
|
||||||
|
v-if="currentUser"
|
||||||
|
command large
|
||||||
|
icon="i-ri:quill-pen-line"
|
||||||
|
:text="$t('settings.language.post_language')"
|
||||||
|
:description="$t('settings.account_settings.description')"
|
||||||
|
:to="`https://${currentUser!.server}/settings/preferences/other`"
|
||||||
|
external target="_blank"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<h2 py4 mt2 font-bold text-xl flex="~ gap-1" items-center>
|
<h2 py4 mt2 font-bold text-xl flex="~ gap-1" items-center>
|
||||||
{{ $t('settings.language.translations.heading') }}
|
{{ $t('settings.language.translations.heading') }}
|
||||||
</h2>
|
</h2>
|
||||||
|
|
Loading…
Reference in a new issue