add translation options

This commit is contained in:
FloatingGhost 2022-08-29 20:02:34 +01:00
parent b39143413c
commit 48a11cb9d1
11 changed files with 67 additions and 2 deletions

View file

@ -55,6 +55,12 @@ const ExtraButtons = {
hideDeleteStatusConfirmDialog () {
this.showingDeleteDialog = false
},
translateStatus () {
this.$store.dispatch('translateStatus', { id: this.status.id, language: this.$store.state.instance.interfaceLanguage })
.then(() => this.$emit('onSuccess'))
.catch(err => this.$emit('onError', err.error.error))
},
pinStatus () {
this.$store.dispatch('pinStatus', this.status.id)
.then(() => this.$emit('onSuccess'))
@ -110,6 +116,9 @@ const ExtraButtons = {
canMute () {
return !!this.currentUser
},
canTranslate () {
return this.$store.state.instance.translationEnabled === true
},
statusLink () {
return `${this.$store.state.instance.server}${this.$router.resolve({ name: 'conversation', params: { id: this.status.id } }).href}`
},

View file

@ -116,6 +116,17 @@
:icon="['far', 'flag']"
/><span>{{ $t("user_card.report") }}</span>
</button>
<button
v-if="canTranslate"
class="button-default dropdown-item dropdown-item-icon"
@click.prevent="translateStatus"
@click="close"
>
<FAIcon
fixed-width
icon="globe"
/><span>{{ $t("status.translate") }}</span>
</button>
</div>
</template>
<template v-slot:trigger>