From e7c21ffbd7e51341c6c1098cdf8b6d4ffa0a848a Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Mon, 29 Aug 2022 22:16:59 +0100 Subject: [PATCH] allow selecting languages for translation --- src/components/extra_buttons/extra_buttons.js | 3 ++- .../interface_language_switcher.vue | 10 +++++++++- src/components/settings_modal/tabs/general_tab.js | 10 ++++++++++ src/components/settings_modal/tabs/general_tab.vue | 10 ++++++++++ src/i18n/en.json | 1 + src/modules/config.js | 3 ++- 6 files changed, 34 insertions(+), 3 deletions(-) diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js index 97fb7d6e..16841539 100644 --- a/src/components/extra_buttons/extra_buttons.js +++ b/src/components/extra_buttons/extra_buttons.js @@ -57,7 +57,8 @@ const ExtraButtons = { }, translateStatus () { - this.$store.dispatch('translateStatus', { id: this.status.id, language: this.$store.state.instance.interfaceLanguage }) + const translateTo = this.$store.getters.mergedConfig.translationLanguage || this.$store.state.instance.interfaceLanguage + this.$store.dispatch('translateStatus', { id: this.status.id, language: translateTo }) .then(() => this.$emit('onSuccess')) .catch(err => this.$emit('onError', err.error.error)) }, diff --git a/src/components/interface_language_switcher/interface_language_switcher.vue b/src/components/interface_language_switcher/interface_language_switcher.vue index e46bcf71..e9ebb97a 100644 --- a/src/components/interface_language_switcher/interface_language_switcher.vue +++ b/src/components/interface_language_switcher/interface_language_switcher.vue @@ -1,6 +1,10 @@