fix(a11y): add accessible labels to notification grid options (#3520)

This commit is contained in:
David Wheatley 2022-07-14 12:02:00 +01:00 committed by GitHub
parent 0daa24cf4b
commit 952a5891bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -70,7 +70,14 @@ export default class NotificationGrid extends Component {
loading={this.loading[key]} loading={this.loading[key]}
disabled={!(key in preferences)} disabled={!(key in preferences)}
onchange={this.toggle.bind(this, [key])} onchange={this.toggle.bind(this, [key])}
/> >
<span class="sr-only">
{app.translator.trans('core.forum.settings.notification_checkbox_a11y_label_template', {
description: type.label,
method: method.label,
})}
</span>
</Checkbox>
</td> </td>
); );
})} })}

View File

@ -448,6 +448,7 @@ core:
account_heading: Account account_heading: Account
change_email_button: => core.ref.change_email change_email_button: => core.ref.change_email
change_password_button: => core.ref.change_password change_password_button: => core.ref.change_password
notification_checkbox_a11y_label_template: 'Receive "{description}" notifications via {method}'
notifications_heading: => core.ref.notifications notifications_heading: => core.ref.notifications
notify_by_email_heading: => core.ref.email notify_by_email_heading: => core.ref.email
notify_by_web_heading: Web notify_by_web_heading: Web