Bug 1316855 - Tooltip of "Toolbox Buttons" should show their shortcut. r=jryans
authorMichael Brennan <brennan.brisad@gmail.com>
Tue, 29 Nov 2016 13:21:00 -0500
changeset 324885 d582b93a37856a8a1893d46a30f9551d75dfbe4a
parent 324884 ae67a98411be9923d1abed36209271f598356729
child 324886 24af599c0e9b4f438cf728355af25547cc33b2d1
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersjryans
bugs1316855
milestone53.0a1
Bug 1316855 - Tooltip of "Toolbox Buttons" should show their shortcut. r=jryans
devtools/client/responsivedesign/resize-commands.js
devtools/client/webconsole/console-commands.js
devtools/shared/locales/en-US/gclicommands.properties
--- a/devtools/client/responsivedesign/resize-commands.js
+++ b/devtools/client/responsivedesign/resize-commands.js
@@ -8,16 +8,18 @@ const { Cc, Ci, Cu } = require("chrome")
 
 loader.lazyImporter(this, "ResponsiveUIManager", "resource://devtools/client/responsivedesign/responsivedesign.jsm");
 
 const BRAND_SHORT_NAME = Cc["@mozilla.org/intl/stringbundle;1"].
                          getService(Ci.nsIStringBundleService).
                          createBundle("chrome://branding/locale/brand.properties").
                          GetStringFromName("brandShortName");
 
+const Services = require("Services");
+const osString = Services.appinfo.OS;
 const l10n = require("gcli/l10n");
 
 exports.items = [
   {
     name: "resize",
     description: l10n.lookup("resizeModeDesc")
   },
   {
@@ -37,17 +39,18 @@ exports.items = [
     exec: gcli_cmd_resize
   },
   {
     item: "command",
     runAt: "client",
     name: "resize toggle",
     buttonId: "command-button-responsive",
     buttonClass: "command-button command-button-invertable",
-    tooltipText: l10n.lookup("resizeModeToggleTooltip"),
+    tooltipText: l10n.lookupFormat("resizeModeToggleTooltip2",
+                                   [(osString == "Darwin" ? "Cmd+Opt+M" : "Ctrl+Shift+M")]),
     description: l10n.lookup("resizeModeToggleDesc"),
     manual: l10n.lookupFormat("resizeModeManual2", [BRAND_SHORT_NAME]),
     state: {
       isChecked: function (aTarget) {
         if (!aTarget.tab) {
           return false;
         }
         return ResponsiveUIManager.isActiveForTab(aTarget.tab);
--- a/devtools/client/webconsole/console-commands.js
+++ b/devtools/client/webconsole/console-commands.js
@@ -13,17 +13,17 @@ loader.lazyRequireGetter(this, "gDevTool
 exports.items = [
   {
     item: "command",
     runAt: "client",
     name: "splitconsole",
     hidden: true,
     buttonId: "command-button-splitconsole",
     buttonClass: "command-button command-button-invertable",
-    tooltipText: l10n.lookup("splitconsoleTooltip"),
+    tooltipText: l10n.lookupFormat("splitconsoleTooltip2", ["Esc"]),
     isRemoteSafe: true,
     state: {
       isChecked: function (target) {
         let toolbox = gDevTools.getToolbox(target);
         return !!(toolbox && toolbox.splitConsole);
       },
       onChange: function (target, changeHandler) {
         // Register handlers for when a change event should be fired
--- a/devtools/shared/locales/en-US/gclicommands.properties
+++ b/devtools/shared/locales/en-US/gclicommands.properties
@@ -541,17 +541,18 @@ resizeModeOffDesc=Exit Responsive Design
 
 # LOCALIZATION NOTE (resizeModeToggleDesc) A very short string to describe the
 # 'resize toggle' command. This string is designed to be shown in a menu
 # alongside the command name, which is why it should be as short as possible.
 resizeModeToggleDesc=Toggle Responsive Design Mode
 
 # LOCALIZATION NOTE (resizeModeToggleTooltip) A string displayed as the
 # tooltip of button in devtools toolbox which toggles Responsive Design Mode.
-resizeModeToggleTooltip=Responsive Design Mode
+# Keyboard shortcut will be shown inside brackets.
+resizeModeToggleTooltip2=Responsive Design Mode (%S)
 
 # LOCALIZATION NOTE (resizeModeToDesc) A very short string to describe the
 # 'resize to' command. This string is designed to be shown in a menu
 # alongside the command name, which is why it should be as short as possible.
 resizeModeToDesc=Alter page size
 
 # LOCALIZATION NOTE (resizeModeDesc) A very short string to describe the
 # 'resize' command. This string is designed to be shown in a menu
@@ -1225,17 +1226,18 @@ paintflashingManual=Draw repainted areas
 paintflashingTooltip=Highlight painted area
 
 # LOCALIZATION NOTE (paintflashingToggleDesc) A very short string used to describe the
 # function of the "paintflashing toggle" command.
 paintflashingToggleDesc=Toggle paint flashing
 
 # LOCALIZATION NOTE (splitconsoleTooltip) A string displayed as the
 # tooltip of button in devtools toolbox which toggles the split webconsole.
-splitconsoleTooltip=Toggle split console
+# Keyboard shortcut will be shown inside brackets.
+splitconsoleTooltip2=Toggle split console (%S)
 
 # LOCALIZATION NOTE (appCacheDesc) A very short string used to describe the
 # function of the "appcache" command
 appCacheDesc=Application cache utilities
 
 # LOCALIZATION NOTE (appCacheValidateDesc) A very short string used to describe
 # the function of the "appcache validate" command.
 appCacheValidateDesc=Validate cache manifest