From b0a950c7b547e96c72371f78671b05bf54ba5f08 Mon Sep 17 00:00:00 2001 From: Akinwale Alagbe Date: Fri, 7 Feb 2020 10:20:33 -0800 Subject: [PATCH] Add ARIA label to `wpTextbox1` Add `aria-label` attribute with explanatory description as value to the `wpTextbox1` to allow screen reader read the purpose of the textbox for visually impaired contributors. Bug: T245863 Change-Id: I0628486e2201975464a77a55053a8d74ddfc57fb --- includes/EditPage.php | 5 ++++- languages/i18n/en.json | 1 + languages/i18n/qqq.json | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index d40d4a5ef5b..8e58a2571ef 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -3637,7 +3637,10 @@ ERROR; $classes[] = 'mw-textarea-oldrev'; } - $attribs = [ 'tabindex' => 1 ]; + $attribs = [ + 'aria-label' => $this->context->msg( 'edit-textarea-aria-label' )->text(), + 'tabindex' => 1 + ]; if ( is_array( $customAttribs ) ) { $attribs += $customAttribs; diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 982f0eed38f..72e9173a0ae 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -714,6 +714,7 @@ "token_suffix_mismatch": "Your edit has been rejected because your client mangled the punctuation characters in the edit token.\nThe edit has been rejected to prevent corruption of the page text.\nThis sometimes happens when you are using a buggy web-based anonymous proxy service.", "edit_form_incomplete": "Some parts of the edit form did not reach the server; double-check that your edits are intact and try again.", "editing": "Editing $1", + "edit-textarea-aria-label": "Wikitext source editor", "creating": "Creating $1", "editingsection": "Editing $1 (section)", "editingcomment": "Editing $1 (new section)", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index d1adc926097..98fabea68ac 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -929,6 +929,7 @@ "token_suffix_mismatch": "Error message in Preview page.\n\nSee also:\n* {{msg-mw|Token suffix mismatch}}\n* {{msg-mw|Session fail preview}}\n* {{msg-mw|Edit form incomplete}}", "edit_form_incomplete": "Error message in Preview page.\n\nSee also:\n* {{msg-mw|Token suffix mismatch}}\n* {{msg-mw|Session fail preview}}\n* {{msg-mw|Edit form incomplete}}", "editing": "Shown as page title when editing a page. Parameters:\n* $1 - the name of the page that is being edited. e.g. \"Editing Main Page\"\n{{Related|Editing}}\n{{Identical|Editing}}", + "edit-textarea-aria-label": "Label for the Wikitext editing textarea for users of assistive technologies .", "creating": "Shown as page title when creating a page. Parameters:\n* $1 - the name of the page that is being created. Example: \"Creating Main Page\".\n{{Related|Editing}}\n{{Identical|Creating}}", "editingsection": "This message displays at the top of the page when a user is editing a page section. Parameters:\n* $1 - page name\n{{Related|Editing}}", "editingcomment": "This message displays at the top of the page when a user is creating a new section. Parameters:\n* $1 - page name\n{{Related|Editing}}",