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/features/ui/components/audio_modal.jsx | |
parent | 730bb3e211a84a2f30e3e2bbeae3f77149824a68 (diff) |
Add `lang` attribute to media and poll options (#23891)
Diffstat (limited to 'app/javascript/mastodon/features/ui/components/audio_modal.jsx')
-rw-r--r-- | app/javascript/mastodon/features/ui/components/audio_modal.jsx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/javascript/mastodon/features/ui/components/audio_modal.jsx b/app/javascript/mastodon/features/ui/components/audio_modal.jsx index c46fefce8..a2fa8c49c 100644 --- a/app/javascript/mastodon/features/ui/components/audio_modal.jsx +++ b/app/javascript/mastodon/features/ui/components/audio_modal.jsx @@ -7,15 +7,17 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; import Footer from 'mastodon/features/picture_in_picture/components/footer'; const mapStateToProps = (state, { statusId }) => ({ + language: state.getIn(['statuses', statusId, 'language']), accountStaticAvatar: state.getIn(['accounts', state.getIn(['statuses', statusId, 'account']), 'avatar_static']), }); -export default @connect(mapStateToProps) +export default @connect(mapStateToProps, null, null, { forwardRef: true }) class AudioModal extends ImmutablePureComponent { static propTypes = { media: ImmutablePropTypes.map.isRequired, statusId: PropTypes.string.isRequired, + language: PropTypes.string, accountStaticAvatar: PropTypes.string.isRequired, options: PropTypes.shape({ autoPlay: PropTypes.bool, @@ -25,7 +27,7 @@ class AudioModal extends ImmutablePureComponent { }; render () { - const { media, accountStaticAvatar, statusId, onClose } = this.props; + const { media, language, accountStaticAvatar, statusId, onClose } = this.props; const options = this.props.options || {}; return ( @@ -34,6 +36,7 @@ class AudioModal extends ImmutablePureComponent { <Audio src={media.get('url')} alt={media.get('description')} + lang={language} duration={media.getIn(['meta', 'original', 'duration'], 0)} height={150} poster={media.get('preview_url') || accountStaticAvatar} |