Skip to content

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

A11Y: add aria-labels for flagging textareas (#19938)

Krisa57d6a0f7516
diff --git a/app/assets/javascripts/discourse/app/templates/components/flag-action-type.hbs b/app/assets/javascripts/discourse/app/templates/components/flag-action-type.hbs
index 8907e1caf05..684a7f8bc58 100644
--- a/app/assets/javascripts/discourse/app/templates/components/flag-action-type.hbs
+++ b/app/assets/javascripts/discourse/app/templates/components/flag-action-type.hbs
@@ -16,6 +16,7 @@
name="message"
class="flag-message"
placeholder={{this.customPlaceholder}}
+ aria-label={{i18n "flagging.notify_user_textarea_label"}}
@value={{this.message}}
/>
<div
@@ -48,6 +49,7 @@
name="message"
class="flag-message"
placeholder={{this.customPlaceholder}}
+ aria-label={{i18n "flagging.notify_moderators_textarea_label"}}
@value={{this.message}}
/>
<div
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 661eaf88624..37b561e5a5c 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -3809,7 +3809,9 @@ en:
inappropriate: "It's Inappropriate"
spam: "It's Spam"
custom_placeholder_notify_user: "Be specific, be constructive, and always be kind."
+ notify_user_textarea_label: "Message for the user"
custom_placeholder_notify_moderators: "Let us know specifically what you are concerned about, and provide relevant links and examples where possible."
+ notify_moderators_textarea_label: "Message for the moderators"
custom_message:
at_least:
one: "enter at least %{count} character"