diff options
| author | Hazelnoot <acomputerdog@gmail.com> | 2025-05-16 20:00:48 -0400 |
|---|---|---|
| committer | Hazelnoot <acomputerdog@gmail.com> | 2025-05-16 20:00:48 -0400 |
| commit | 2fdec0ce29c5b61f61640123db16d89a72e97de2 (patch) | |
| tree | dbe2ecf2cfdf1a1dbe777a280bfe391b138039a8 /packages/frontend/src/components/MkSubNoteContent.vue | |
| parent | merge: await `reverseConcat` (!1029) (diff) | |
| download | sharkey-2fdec0ce29c5b61f61640123db16d89a72e97de2.tar.gz sharkey-2fdec0ce29c5b61f61640123db16d89a72e97de2.tar.bz2 sharkey-2fdec0ce29c5b61f61640123db16d89a72e97de2.zip | |
add option to put Translate button in the note toolbar
Diffstat (limited to 'packages/frontend/src/components/MkSubNoteContent.vue')
| -rw-r--r-- | packages/frontend/src/components/MkSubNoteContent.vue | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/frontend/src/components/MkSubNoteContent.vue b/packages/frontend/src/components/MkSubNoteContent.vue index 8ac07c012a..e2a8ee4fe6 100644 --- a/packages/frontend/src/components/MkSubNoteContent.vue +++ b/packages/frontend/src/components/MkSubNoteContent.vue @@ -12,12 +12,13 @@ SPDX-License-Identifier: AGPL-3.0-only <Mfm v-if="note.text" :text="note.text" :isBlock="true" :author="note.user" :nyaize="'respect'" :isAnim="allowAnim" :emojiUrls="note.emojis"/> <MkButton v-if="!allowAnim && animated && !hideFiles" :class="$style.playMFMButton" :small="true" @click="animatedMFM()" @click.stop><i class="ph-play ph-bold ph-lg "></i> {{ i18n.ts._animatedMFM.play }}</MkButton> <MkButton v-else-if="!prefer.s.animatedMfm && allowAnim && animated && !hideFiles" :class="$style.playMFMButton" :small="true" @click="animatedMFM()" @click.stop><i class="ph-stop ph-bold ph-lg "></i> {{ i18n.ts._animatedMFM.stop }}</MkButton> - <div v-if="note.text && translating || note.text && translation" :class="$style.translation"> + <div v-if="note.text && translating || note.text && translation != null" :class="$style.translation"> <MkLoading v-if="translating" mini/> - <div v-else> + <div v-else-if="translation && translation.text != null"> <b>{{ i18n.tsx.translatedFrom({ x: translation.sourceLang }) }}: </b> <Mfm :text="translation.text" :isBlock="true" :author="note.user" :nyaize="'respect'" :emojiUrls="note.emojis"/> </div> + <div v-else>{{ i18n.ts.translationFailed }}</div> </div> <MkA v-if="note.renoteId" :class="$style.rp" :to="`/notes/${note.renoteId}`" @click.stop>RN: ...</MkA> </div> @@ -55,7 +56,7 @@ import { prefer } from '@/preferences.js'; const props = defineProps<{ note: Misskey.entities.Note; translating?: boolean; - translation?: any; + translation?: Misskey.entities.NotesTranslateResponse | false | null; hideFiles?: boolean; expandAllCws?: boolean; }>(); |