diff --git a/src/boot/after_store.js b/src/boot/after_store.js index b2c8d59d..0761792b 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -250,6 +250,7 @@ const getNodeInfo = async ({ store }) => { store.dispatch('setInstanceOption', { name: 'pollsAvailable', value: features.includes('polls') }) store.dispatch('setInstanceOption', { name: 'pollLimits', value: metadata.pollLimits }) store.dispatch('setInstanceOption', { name: 'mailerEnabled', value: metadata.mailerEnabled }) + store.dispatch('setInstanceOption', { name: 'translationEnabled', value: features.includes('akkoma:machine_translation') }) const uploadLimits = metadata.uploadLimits store.dispatch('setInstanceOption', { name: 'uploadlimit', value: parseInt(uploadLimits.general) }) diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js index f801444a..25c4d128 100644 --- a/src/components/extra_buttons/extra_buttons.js +++ b/src/components/extra_buttons/extra_buttons.js @@ -57,6 +57,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')) @@ -112,6 +118,9 @@ const ExtraButtons = { canMute () { return !!this.currentUser }, + canTranslate () { + return this.$store.state.instance.translationEnabled === true + }, statusLink () { if (this.status.is_local) { return `${this.$store.state.instance.server}${this.$router.resolve({ name: 'conversation', params: { id: this.status.id } }).href}` diff --git a/src/components/extra_buttons/extra_buttons.vue b/src/components/extra_buttons/extra_buttons.vue index 43510bec..b43d665b 100644 --- a/src/components/extra_buttons/extra_buttons.vue +++ b/src/components/extra_buttons/extra_buttons.vue @@ -127,6 +127,17 @@ icon="quote-left" />{{ $t("tool_tip.quote") }} +