From c67513002460f56901246c81a9e7b6dbad89be27 Mon Sep 17 00:00:00 2001 From: tusooa Date: Mon, 22 May 2023 22:30:54 -0400 Subject: [PATCH] Make reaction counter accessible --- src/components/emoji_reactions/emoji_reactions.js | 11 +++++++++++ src/components/emoji_reactions/emoji_reactions.vue | 2 +- src/i18n/en.json | 3 ++- 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 index 74cb844c..b4936424 100644 --- 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 index d475d5dc..20a1f4a1 100644 --- a/src/components/emoji_reactions/emoji_reactions.vue +++ b/src/components/emoji_reactions/emoji_reactions.vue @@ -53,7 +53,7 @@ {{ reaction.count }} diff --git a/src/i18n/en.json b/src/i18n/en.json index b051f088..01309d0e 100644 --- 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",