diff --git a/src/components/media-alt-modal.jsx b/src/components/media-alt-modal.jsx index 95745764..09f94db4 100644 --- a/src/components/media-alt-modal.jsx +++ b/src/components/media-alt-modal.jsx @@ -4,7 +4,7 @@ import { useState } from 'preact/hooks'; import Icon from './icon'; import TranslationBlock from './translation-block'; -export default function MediaAltModal({ alt, onClose }) { +export default function MediaAltModal({ alt, lang, onClose }) { const [forceTranslate, setForceTranslate] = useState(false); return (
@@ -36,7 +36,7 @@ export default function MediaAltModal({ alt, onClose }) {
-
+

{}, }) { @@ -138,14 +139,19 @@ function MediaModal({ class="media-alt" hidden={!showControls} onClick={() => { - setShowMediaAlt(media.description); + setShowMediaAlt({ + alt: media.description, + lang, + }); }} > ALT - {media.description} + + {media.description} + )} - + ); })} @@ -279,7 +285,8 @@ function MediaModal({ }} > setShowMediaAlt(false)} /> diff --git a/src/components/media.jsx b/src/components/media.jsx index 37c4b7fc..2ba4985c 100644 --- a/src/components/media.jsx +++ b/src/components/media.jsx @@ -29,7 +29,7 @@ audio = Audio track const dataAltLabel = 'ALT'; const AltBadge = (props) => { - const { alt, ...rest } = props; + const { alt, lang, ...rest } = props; if (!alt || !alt.trim()) return null; return (