diff --git a/src/components/status_body/status_body.js b/src/components/status_body/status_body.js
index 91d795f1..f2f0fa2d 100644
--- a/src/components/status_body/status_body.js
+++ b/src/components/status_body/status_body.js
@@ -9,6 +9,7 @@ import {
faLink,
faPollH
} from '@fortawesome/free-solid-svg-icons'
+import Select from 'src/components/select/select.vue'
library.add(
faFile,
@@ -39,7 +40,8 @@ const StatusContent = {
return {
postLength: this.status.text.length,
parseReadyDone: false,
- renderMisskeyMarkdown
+ renderMisskeyMarkdown,
+ translateFrom: null
}
},
computed: {
@@ -80,10 +82,14 @@ const StatusContent = {
attachmentTypes () {
return this.status.attachments.map(file => fileType.fileType(file.mimetype))
},
+ translationLanguages () {
+ return (this.$store.getters.mergedConfig.supportedTranslationLanguages || []).map(lang => ({ key: lang.code, value: lang.code, label: lang.name }))
+ },
...mapGetters(['mergedConfig'])
},
components: {
- RichContent
+ RichContent,
+ Select
},
mounted () {
this.status.attentions && this.status.attentions.forEach(attn => {
@@ -126,6 +132,10 @@ const StatusContent = {
},
generateTagLink (tag) {
return `/tag/${tag}`
+ },
+ translateStatus () {
+ const translateTo = this.$store.getters.mergedConfig.translationLanguage || this.$store.state.instance.interfaceLanguage
+ this.$store.dispatch('translateStatus', { id: this.status.id, language: translateTo, from: this.translateFrom })
}
}
}
diff --git a/src/components/status_body/status_body.vue b/src/components/status_body/status_body.vue
index c1a3d9e7..ed19261d 100644
--- a/src/components/status_body/status_body.vue
+++ b/src/components/status_body/status_body.vue
@@ -72,6 +72,27 @@
:attentions="status.attentions"
@parseReady="onParseReady"
/>
+
+
+ {{ ' ' }}
+
+ {{ ' ' }}
+
+