Add lang
attribute to media and poll options (#23891)
This commit is contained in:
committed by
GitHub
parent
730bb3e211
commit
d3eefead30
@@ -2,15 +2,22 @@ import React from 'react';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import PropTypes from 'prop-types';
|
||||
import Video from 'mastodon/features/video';
|
||||
import { connect } from 'react-redux';
|
||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||
import Footer from 'mastodon/features/picture_in_picture/components/footer';
|
||||
import { getAverageFromBlurhash } from 'mastodon/blurhash';
|
||||
|
||||
export default class VideoModal extends ImmutablePureComponent {
|
||||
const mapStateToProps = (state, { statusId }) => ({
|
||||
language: state.getIn(['statuses', statusId, 'language']),
|
||||
});
|
||||
|
||||
export default @connect(mapStateToProps, null, null, { forwardRef: true })
|
||||
class VideoModal extends ImmutablePureComponent {
|
||||
|
||||
static propTypes = {
|
||||
media: ImmutablePropTypes.map.isRequired,
|
||||
statusId: PropTypes.string,
|
||||
language: PropTypes.string,
|
||||
options: PropTypes.shape({
|
||||
startTime: PropTypes.number,
|
||||
autoPlay: PropTypes.bool,
|
||||
@@ -31,7 +38,7 @@ export default class VideoModal extends ImmutablePureComponent {
|
||||
}
|
||||
|
||||
render () {
|
||||
const { media, statusId, onClose } = this.props;
|
||||
const { media, statusId, language, onClose } = this.props;
|
||||
const options = this.props.options || {};
|
||||
|
||||
return (
|
||||
@@ -49,6 +56,7 @@ export default class VideoModal extends ImmutablePureComponent {
|
||||
autoFocus
|
||||
detailed
|
||||
alt={media.get('description')}
|
||||
lang={language}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
Reference in New Issue
Block a user