diff options
author | Christian Schmidt <github@chsc.dk> | 2023-02-26 20:13:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-26 20:13:27 +0100 |
commit | d3eefead3014175b264cb56f6f4cb552cbaaeac6 (patch) | |
tree | 5a74d33a8995f738870b7c713bf875889f7199de /app/javascript/mastodon/components/media_attachments.jsx | |
parent | 730bb3e211a84a2f30e3e2bbeae3f77149824a68 (diff) |
Add `lang` attribute to media and poll options (#23891)
Diffstat (limited to 'app/javascript/mastodon/components/media_attachments.jsx')
-rw-r--r-- | app/javascript/mastodon/components/media_attachments.jsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/javascript/mastodon/components/media_attachments.jsx b/app/javascript/mastodon/components/media_attachments.jsx index 565a30330..0e25e5973 100644 --- a/app/javascript/mastodon/components/media_attachments.jsx +++ b/app/javascript/mastodon/components/media_attachments.jsx @@ -10,6 +10,7 @@ export default class MediaAttachments extends ImmutablePureComponent { static propTypes = { status: ImmutablePropTypes.map.isRequired, + lang: PropTypes.string, height: PropTypes.number, width: PropTypes.number, }; @@ -48,7 +49,7 @@ export default class MediaAttachments extends ImmutablePureComponent { }; render () { - const { status, width, height } = this.props; + const { status, lang, width, height } = this.props; const mediaAttachments = status.get('media_attachments'); if (mediaAttachments.size === 0) { @@ -64,6 +65,7 @@ export default class MediaAttachments extends ImmutablePureComponent { <Component src={audio.get('url')} alt={audio.get('description')} + lang={lang || status.get('language')} width={width} height={height} poster={audio.get('preview_url') || status.getIn(['account', 'avatar_static'])} @@ -87,6 +89,7 @@ export default class MediaAttachments extends ImmutablePureComponent { blurhash={video.get('blurhash')} src={video.get('url')} alt={video.get('description')} + lang={lang || status.get('language')} width={width} height={height} inline @@ -102,6 +105,7 @@ export default class MediaAttachments extends ImmutablePureComponent { {Component => ( <Component media={mediaAttachments} + lang={lang || status.get('language')} sensitive={status.get('sensitive')} defaultWidth={width} height={height} |