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
|
@ -40,6 +40,7 @@ class Poll extends ImmutablePureComponent {
|
|||
|
||||
static propTypes = {
|
||||
poll: ImmutablePropTypes.map,
|
||||
lang: PropTypes.string,
|
||||
intl: PropTypes.object.isRequired,
|
||||
disabled: PropTypes.bool,
|
||||
refresh: PropTypes.func,
|
||||
|
@ -126,7 +127,7 @@ class Poll extends ImmutablePureComponent {
|
|||
};
|
||||
|
||||
renderOption (option, optionIndex, showResults) {
|
||||
const { poll, disabled, intl } = this.props;
|
||||
const { poll, lang, disabled, intl } = this.props;
|
||||
const pollVotesCount = poll.get('voters_count') || poll.get('votes_count');
|
||||
const percent = pollVotesCount === 0 ? 0 : (option.get('votes_count') / pollVotesCount) * 100;
|
||||
const leading = poll.get('options').filterNot(other => other.get('title') === option.get('title')).every(other => option.get('votes_count') >= other.get('votes_count'));
|
||||
|
@ -159,6 +160,7 @@ class Poll extends ImmutablePureComponent {
|
|||
onKeyPress={this.handleOptionKeyPress}
|
||||
aria-checked={active}
|
||||
aria-label={option.get('title')}
|
||||
lang={lang}
|
||||
data-index={optionIndex}
|
||||
/>
|
||||
)}
|
||||
|
@ -175,6 +177,7 @@ class Poll extends ImmutablePureComponent {
|
|||
|
||||
<span
|
||||
className='poll__option__text translate'
|
||||
lang={lang}
|
||||
dangerouslySetInnerHTML={{ __html: titleEmojified }}
|
||||
/>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue