commit: c67513002460f56901246c81a9e7b6dbad89be27
parent d3e251665f50c7d289066b0be0fdfa5b227c3b65
Author: tusooa <tusooa@kazv.moe>
Date: Mon, 22 May 2023 22:30:54 -0400
Make reaction counter accessible
Diffstat:
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/components/emoji_reactions/emoji_reactions.js b/src/components/emoji_reactions/emoji_reactions.js
@@ -77,6 +77,17 @@ const EmojiReactions = {
} else {
this.reactWith(emoji)
}
+ },
+ counterTriggerAttrs (reaction) {
+ return {
+ class: [
+ 'btn',
+ 'button-default',
+ 'emoji-reaction-count-button',
+ { '-picked-reaction': this.reactedWith(reaction.name) }
+ ],
+ 'aria-label': this.$tc('status.reaction_count_label', reaction.count, { num: reaction.count })
+ }
}
}
}
diff --git a/src/components/emoji_reactions/emoji_reactions.vue b/src/components/emoji_reactions/emoji_reactions.vue
@@ -53,7 +53,7 @@
<UserListPopover
:users="accountsForEmoji[reaction.name]"
class="emoji-reaction-popover"
- :trigger-attrs="{ class: ['btn', 'button-default', 'emoji-reaction-count-button', { '-picked-reaction': reactedWith(reaction.name) }] }"
+ :trigger-attrs="counterTriggerAttrs(reaction)"
@show="fetchEmojiReactionsByIfMissing()"
>
<span class="emoji-reaction-counts">{{ reaction.count }}</span>
diff --git a/src/i18n/en.json b/src/i18n/en.json
@@ -933,7 +933,8 @@
"show_all_conversation_with_icon": "{icon} {text}",
"show_all_conversation": "Show full conversation ({numStatus} other status) | Show full conversation ({numStatus} other statuses)",
"show_only_conversation_under_this": "Only show replies to this status",
- "status_history": "Status history"
+ "status_history": "Status history",
+ "reaction_count_label": "{num} person reacted | {num} people reacted"
},
"user_card": {
"approve": "Approve",