diff --git a/src/components/Post.vue b/src/components/Post.vue index eae4c03..7127f21 100644 --- a/src/components/Post.vue +++ b/src/components/Post.vue @@ -1,8 +1,10 @@ @@ -24,6 +42,7 @@ import { computed, onMounted, onUnmounted } from 'vue'; import PhotoSwipeLightbox from 'photoswipe/lightbox'; import 'photoswipe/style.css'; +import { getUiTranslations } from '../i18n/ui/ui-i18n-helper'; const props = defineProps({ post: { @@ -35,10 +54,16 @@ const props = defineProps({ default: 'en', }, }); +const t = getUiTranslations(props.locale); const dateOptions = { year: 'numeric', month: 'long', day: 'numeric' }; const imageAttachments = computed(() => props.post.media_attachments.filter((a) => a.type === 'image')); +// Mastodon uses "gifv" for short looping animations (converted GIFs) +const videoAttachments = computed(() => + props.post.media_attachments.filter((a) => a.type === 'video' || a.type === 'gifv'), +); + const galleryId = computed(() => `gallery-${props.post.id}`); const gridClass = computed(() => { @@ -70,36 +95,57 @@ onUnmounted(() => {