diff options
author | Claire <claire.github-309c@sitedethib.com> | 2021-10-13 15:50:24 +0200 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2021-10-13 15:50:24 +0200 |
commit | 1665b842856811c16b904c3b99be6b141a0e1c7b (patch) | |
tree | 6fba595782a93008ed3dd6f3ac9e19b7271df6b3 /app/javascript | |
parent | 022006577027ca040f4411489821f2e3311f0db6 (diff) | |
parent | 5159ba26e485daaeded2288c1b02bd1e516e1ca6 (diff) |
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts: - `package.json`: Not really a conflict, just a glitch-soc-only dependency textually too close to an updated upstream one. - `yarn.lock`: Not really a conflict, just a glitch-soc-only dependency textually too close to an updated upstream one.
Diffstat (limited to 'app/javascript')
-rw-r--r-- | app/javascript/mastodon/components/poll.js | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/app/javascript/mastodon/components/poll.js b/app/javascript/mastodon/components/poll.js index 477f56e13..85aa28816 100644 --- a/app/javascript/mastodon/components/poll.js +++ b/app/javascript/mastodon/components/poll.js @@ -12,8 +12,18 @@ import RelativeTimestamp from './relative_timestamp'; import Icon from 'mastodon/components/icon'; const messages = defineMessages({ - closed: { id: 'poll.closed', defaultMessage: 'Closed' }, - voted: { id: 'poll.voted', defaultMessage: 'You voted for this answer', description: 'Tooltip of the "voted" checkmark in polls' }, + closed: { + id: 'poll.closed', + defaultMessage: 'Closed', + }, + voted: { + id: 'poll.voted', + defaultMessage: 'You voted for this answer', + }, + votes: { + id: 'poll.votes', + defaultMessage: '{votes, plural, one {# vote} other {# votes}}', + }, }); const makeEmojiMap = record => record.get('emojis').reduce((obj, emoji) => { @@ -148,9 +158,16 @@ class Poll extends ImmutablePureComponent { data-index={optionIndex} /> )} - {showResults && <span className='poll__number'> - {Math.round(percent)}% - </span>} + {showResults && ( + <span + className='poll__number' + title={intl.formatMessage(messages.votes, { + votes: option.get('votes_count'), + })} + > + {Math.round(percent)}% + </span> + )} <span className='poll__option__text translate' |