From 83432ba8b575703a2832c9dc099aef52eac69ff4 Mon Sep 17 00:00:00 2001 From: Stephen Niedzielski Date: Fri, 10 Jan 2020 15:23:04 -0700 Subject: [PATCH] Fix: user navigation label when AMC is disabled At some point I introduced a bad label aria ID, minerva-user-menu-toggle, for the user navigation. This was the incorrect text and ID to use. Further, the ID is not present in non-AMC mode (which is what search engines use). This patches adds a new string, minerva-user-navigation, and replaces the aria-labelledby attribute with a direct aria-label. Bug: T242281 Change-Id: Ic247eb77609862b62025dc5e6af550c079df26d9 --- i18n/en.json | 1 + i18n/qqq.json | 1 + includes/skins/MinervaTemplate.php | 1 + includes/skins/minerva.mustache | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/i18n/en.json b/i18n/en.json index 41a21a750..b68d9eeeb 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -45,6 +45,7 @@ "mobile-frontend-user-page-member-since": "{{GENDER:$2|Joined}} $1", "mobile-frontend-user-page-talk": "Talk", "minerva-user-menu-button": "User menu", + "minerva-user-navigation": "User navigation", "minerva-page-actions-overflow": "More", "minerva-page-actions-info": "Page information", "minerva-page-actions-permalink": "Permanent link", diff --git a/i18n/qqq.json b/i18n/qqq.json index ae5119429..8a4cc55fc 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -56,6 +56,7 @@ "mobile-frontend-user-page-member-since": "Message below the heading. $1 is the user registration date. $2 is the gender associated with the user account.", "mobile-frontend-user-page-talk": "Text of the link to the user's talk page\n{{Identical|Talk}}", "minerva-user-menu-button": "Text describing the user menu", + "minerva-user-navigation": "Text describing the navigation menus available in the top header.", "minerva-page-actions-overflow": "In the secondary page menu, short text describing the button that triggers the drop-down menu\n{{Identical|More}}", "minerva-page-actions-info": "In the secondary page menu, the page information button label", "minerva-page-actions-permalink": "In the secondary page menu, the permanent link button label\n\nSee also:\n* {{msg-mw|permalink}}", diff --git a/includes/skins/MinervaTemplate.php b/includes/skins/MinervaTemplate.php index 1aba678e0..1058ca2b9 100644 --- a/includes/skins/MinervaTemplate.php +++ b/includes/skins/MinervaTemplate.php @@ -245,6 +245,7 @@ class MinervaTemplate extends BaseTemplate { 'menuButton' => $data['mainMenu']['buttonHTML'], 'siteheading' => $data['footer-site-heading-html'], 'mainPageURL' => Title::newMainPage()->getLocalURL(), + 'userNavigationLabel' => wfMessage( 'minerva-user-navigation' ), // A button when clicked will submit the form // This is used so that on tablet devices with JS disabled the search button // passes the value of input to the search diff --git a/includes/skins/minerva.mustache b/includes/skins/minerva.mustache index 13b37f6af..e6641d4cd 100644 --- a/includes/skins/minerva.mustache +++ b/includes/skins/minerva.mustache @@ -22,7 +22,7 @@ autocomplete="off" placeholder="{{placeholder}}" aria-label="{{placeholder}}" value="{{search}}"> -