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/poll.jsx | |
parent | 730bb3e211a84a2f30e3e2bbeae3f77149824a68 (diff) |
Add `lang` attribute to media and poll options (#23891)
Diffstat (limited to 'app/javascript/mastodon/components/poll.jsx')
-rw-r--r-- | app/javascript/mastodon/components/poll.jsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/javascript/mastodon/components/poll.jsx b/app/javascript/mastodon/components/poll.jsx index 95a900c49..7efedfe34 100644 --- a/app/javascript/mastodon/components/poll.jsx +++ b/app/javascript/mastodon/components/poll.jsx @@ -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 }} /> |