Add lang
attribute to media and poll options (#23891)
This commit is contained in:
parent
730bb3e211
commit
d3eefead30
16 changed files with 79 additions and 24 deletions
|
@ -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}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue