Bug 1259024 - Fix developer toolbox close and toolbar toggle button tooltips. r=jwalker
authorAlexandre Poirot <poirot.alex@gmail.com>
Fri, 01 Apr 2016 05:49:00 -0700
changeset 291392 21be9fc9356d9ee4f396a5263b0aa1b47266eb8a
parent 291391 97e1c3fdf6f22c4a643b378eec2b775d9d95bb3d
child 291393 02e0770a169643107e35465f690c46f160fca670
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
Bug 1259024 - Fix developer toolbox close and toolbar toggle button tooltips. r=jwalker
--- a/browser/locales/en-US/chrome/browser/browser.dtd
+++ b/browser/locales/en-US/chrome/browser/browser.dtd
@@ -252,22 +252,16 @@ These should match what Safari and other
 <!ENTITY addons.commandkey            "A">
 <!ENTITY webDeveloperMenu.label       "Web Developer">
 <!ENTITY webDeveloperMenu.accesskey   "W">
 <!ENTITY inspectContextMenu.label     "Inspect Element">
 <!ENTITY inspectContextMenu.accesskey "Q">
-<!ENTITY devToolbarCloseButton.tooltiptext "Close Developer Toolbar">
-<!ENTITY devToolbarToolsButton.tooltip     "Toggle developer tools">
-<!ENTITY devToolbarOtherToolsButton.label  "More Tools">
 <!ENTITY fileMenu.label         "File"> 
 <!ENTITY fileMenu.accesskey       "F">
 <!ENTITY newUserContext.label             "New Container Tab">
 <!ENTITY newUserContext.accesskey         "C">
 <!ENTITY userContextPersonal.label        "Personal">
 <!ENTITY userContextPersonal.accesskey    "P">
 <!ENTITY userContextWork.label            "Work">
 <!ENTITY userContextWork.accesskey        "W">
--- a/devtools/client/locales/en-US/toolbox.properties
+++ b/devtools/client/locales/en-US/toolbox.properties
@@ -34,16 +34,26 @@ toolboxToggleButton.warnings=#1 warning;
 # LOCALIZATION NOTE (toolboxToggleButton.tooltip): This string is shown
 # as tooltip in the developer toolbar to open/close the developer tools.
 # It's using toolboxToggleButton.errors as first and
 # toolboxToggleButton.warnings as second argument to show the number of errors
 # and warnings.
 toolboxToggleButton.tooltip=%1$S, %2$S\nClick to toggle the developer tools.
+# LOCALIZATION NOTE (toolbar.closeButton.tooltip)
+# Used as a message in tooltip when overing the close button of the Developer
+# Toolbar.
+toolbar.closeButton.tooltip=Close Developer Toolbar
+# LOCALIZATION NOTE (toolbar.toolsButton.tooltip)
+# Used as a message in tooltip when overing the wrench icon of the Developer
+# Toolbar, which toggle the developer toolbox.
+toolbar.toolsButton.tooltip=Toggle developer tools
 # LOCALIZATION NOTE (toolbox.titleTemplate): This is the template
 # used to format the title of the toolbox.
 # The name of the selected tool: %1$S.
 # The url of the page being tooled: %2$S.
 toolbox.titleTemplate=%1$S - %2$S
 # LOCALIZATION NOTE (toolbox.defaultTitle): This is used as the tool
 # name when no tool is selected.
@@ -110,9 +120,9 @@ toolbox.noContentProcess.message=No cont
 toolbox.viewCssSourceInStyleEditor.label=Open File in Style-Editor
 # LOCALIZATION NOTE (toolbox.viewJsSourceInDebugger.label)
 # Used as a message in either tooltips or contextual menu items to open the
 # corresponding URL as a js file in the Debugger tool.
 # DEV NOTE: Mostly used wherever toolbox.viewSourceInDebugger is used.
 toolbox.viewJsSourceInDebugger.label=Open File in Debugger
-toolbox.resumeOrderWarning=Page did not resume after the debugger was attached. To fix this, please close and re-open the toolbox.
\ No newline at end of file
+toolbox.resumeOrderWarning=Page did not resume after the debugger was attached. To fix this, please close and re-open the toolbox.
--- a/devtools/client/shared/developer-toolbar.js
+++ b/devtools/client/shared/developer-toolbar.js
@@ -297,38 +297,42 @@ DeveloperToolbar.prototype.createToolbar
   let toolbar = this._doc.createElement("toolbar");
   toolbar.setAttribute("id", "developer-toolbar");
   toolbar.setAttribute("hidden", "true");
   let close = this._doc.createElement("toolbarbutton");
   close.setAttribute("id", "developer-toolbar-closebutton");
   close.setAttribute("class", "close-icon");
   close.setAttribute("oncommand", "DeveloperToolbar.hide();");
-  close.setAttribute("tooltiptext", "developerToolbarCloseButton.tooltiptext");
+  let closeTooltip = toolboxStrings.GetStringFromName("toolbar.closeButton.tooltip");
+  close.setAttribute("tooltiptext", closeTooltip);
   let stack = this._doc.createElement("stack");
   stack.setAttribute("flex", "1");
   let input = this._doc.createElement("textbox");
   input.setAttribute("class", "gclitoolbar-input-node");
   input.setAttribute("rows", "1");
   let hbox = this._doc.createElement("hbox");
   hbox.setAttribute("class", "gclitoolbar-complete-node");
   let toolboxBtn = this._doc.createElement("toolbarbutton");
   toolboxBtn.setAttribute("id", "developer-toolbar-toolbox-button");
   toolboxBtn.setAttribute("class", "developer-toolbar-button");
-  toolboxBtn.setAttribute("tooltiptext", "devToolbarToolsButton.tooltip");
+  let toolboxTooltip = toolboxStrings.GetStringFromName("toolbar.toolsButton.tooltip");
+  toolboxBtn.setAttribute("tooltiptext", toolboxTooltip);
   toolboxBtn.addEventListener("command", function (event) {
     let window = event.target.ownerDocument.defaultView;
+  this._errorCounterButton = toolboxBtn;
+  this._errorCounterButton._defaultTooltipText = toolboxTooltip;
   // On Mac, the close button is on the left,
   // while it is on the right on every other platforms.
   if (isMac) {
   } else {
@@ -341,19 +345,16 @@ DeveloperToolbar.prototype.createToolbar
   let bottomBox = this._doc.getElementById("browser-bottombox");
   if (bottomBox) {
   } else { // SeaMonkey does not have a "browser-bottombox".
     let statusBar = this._doc.getElementById("status-bar");
     if (statusBar)
       statusBar.parentNode.insertBefore(this._element, statusBar);
-  this._errorCounterButton = toolboxBtn
-  this._errorCounterButton._defaultTooltipText =
-      this._errorCounterButton.getAttribute("tooltiptext");
  * Called from browser.xul in response to menu-click or keyboard shortcut to
  * toggle the toolbar
 DeveloperToolbar.prototype.toggle = function() {
   if (this.visible) {