Skip to content

A platform for community discussion. Free, open, simple.

A11Y: Add more information to the "reply to" button label. (#18604)

Roman Rizzi588bb2ccf278
diff --git a/app/assets/javascripts/discourse/app/widgets/post-menu.js b/app/assets/javascripts/discourse/app/widgets/post-menu.js
index 6c0e520ee2b..c3e186caed1 100644
--- a/app/assets/javascripts/discourse/app/widgets/post-menu.js
+++ b/app/assets/javascripts/discourse/app/widgets/post-menu.js
@@ -239,6 +239,10 @@ registerButton("reply-small", (attrs) => {
title: "post.controls.reply",
icon: "reply",
className: "reply",
+ translatedAriaLabel: I18n.t("post.sr_reply_to", {
+ post_number: attrs.post_number,
+ username: attrs.username,
+ }),
};
return args;
@@ -323,6 +327,10 @@ registerButton("reply", (attrs, state, siteSettings, postMenuSettings) => {
title: "post.controls.reply",
icon: "reply",
className: "reply create fade-out",
+ translatedAriaLabel: I18n.t("post.sr_reply_to", {
+ post_number: attrs.post_number,
+ username: attrs.username,
+ }),
};
if (!attrs.canCreatePost) {
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index dd16711acd8..34696fb3c32 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -3210,6 +3210,7 @@ en:
gap:
one: "view %{count} hidden reply"
other: "view %{count} hidden replies"
+ sr_reply_to: "Reply to post #%{post_number} by @%{username}"
notice:
new_user: "This is the first time %{user} has posted — let’s welcome them to our community!"