Bug 1559127 - Fix aria-label for back buttons in the appmenu. r=darktrojan
authorPaul Morris <paul@paulwmorris.com>
Fri, 05 Jul 2019 17:21:53 -0400
changeset 36046 56dea140befc70ad166017e5572eff48aa0af57b
parent 36045 1ba917da139c6e707d6d964c5d1de142cab1e666
child 36047 c14bd4ff44b033c9a5531a41f4cee1b82e4178c4
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersdarktrojan
bugs1559127
Bug 1559127 - Fix aria-label for back buttons in the appmenu. r=darktrojan
mail/components/customizableui/PanelMultiView.jsm
mail/locales/en-US/chrome/messenger/messenger.properties
--- a/mail/components/customizableui/PanelMultiView.jsm
+++ b/mail/components/customizableui/PanelMultiView.jsm
@@ -99,28 +99,26 @@
 
 "use strict";
 
 var EXPORTED_SYMBOLS = [
   "PanelMultiView",
   "PanelView",
 ];
 
-// TODO appmenu - Usage is commented out below.  Keep eslint happy.
-// const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 ChromeUtils.defineModuleGetter(this, "CustomizableUI",
   "resource:///modules/CustomizableUI.jsm");
 
-// TODO appmenu - Needs updating for Thunderbird. Usage is commented out below.
-// XPCOMUtils.defineLazyGetter(this, "gBundle", function() {
-//   return Services.strings.createBundle(
-//     "chrome://browser/locale/browser.properties");
-// });
+XPCOMUtils.defineLazyGetter(this, "gBundle", function() {
+  return Services.strings.createBundle(
+    "chrome://messenger/locale/messenger.properties");
+});
 
 /**
  * Safety timeout after which asynchronous events will be canceled if any of the
  * registered blockers does not return.
  */
 const BLOCKERS_TIMEOUT_MS = 10000;
 
 const TRANSITION_PHASES = Object.freeze({
@@ -1277,20 +1275,18 @@ var PanelView = class extends Associated
     header.classList.add("panel-header");
 
     let backButton = this.document.createXULElement("toolbarbutton");
     backButton.className =
       "subviewbutton subviewbutton-iconic subviewbutton-back";
     backButton.setAttribute("closemenu", "none");
     backButton.setAttribute("tabindex", "0");
 
-    // TODO appmenu gBundle.GetStringFromName is undefined call
-    // Possible string addition/change.
-    // backButton.setAttribute("aria-label",
-    //   gBundle.GetStringFromName("panel.back"));
+    backButton.setAttribute("aria-label",
+      gBundle.GetStringFromName("panel.back"));
 
     backButton.addEventListener("command", () => {
       // The panelmultiview element may change if the view is reused.
       this.node.panelMultiView.goBack();
       backButton.blur();
     });
 
     let label = this.document.createXULElement("label");
--- a/mail/locales/en-US/chrome/messenger/messenger.properties
+++ b/mail/locales/en-US/chrome/messenger/messenger.properties
@@ -790,8 +790,13 @@ openSearch.label.truncated=Search %1$S for "%2$S…"
 # The sixtyFourBit and thirtyTwoBit strings describe the architecture of the
 # current Thunderbird build: 32-bit or 64-bit. These strings are used in parentheses
 # after the Thunderbird version in the About dialog,
 # e.g.: "48.0.2 (32-bit)" or "51.0a1 (2016-09-05) (64-bit)".
 aboutDialog.architecture.sixtyFourBit = 64-bit
 aboutDialog.architecture.thirtyTwoBit = 32-bit
 
 errorConsoleTitle = Error Console
+
+# LOCALIZATION NOTE (panel.back):
+# This is used by screen readers to label the "back" button in various browser
+# popup panels, including the sliding subviews of the appmenu.
+panel.back = Back