Bug 1582734 - Fix context menu accelerator text r=jlast
authorDavid Walsh <dwalsh@mozilla.com>
Fri, 27 Sep 2019 19:23:26 +0000
changeset 495435 864c928edc5ba92cc0df45cd0482b0bd0956f913
parent 495434 bbd6585e5a80c45a03f2eb8046fb0a53d6a6569a
child 495436 195277db19c51031b4ba4b01bbd6e36fc1b18104
push id36628
push useraciure@mozilla.com
push dateSat, 28 Sep 2019 09:46:05 +0000
treeherdermozilla-central@72a8d8c20180 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlast
bugs1582734
milestone71.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1582734 - Fix context menu accelerator text r=jlast Differential Revision: https://phabricator.services.mozilla.com/D47473
devtools/client/debugger/src/components/Editor/menus/breakpoints.js
devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/BreakpointsContextMenu.js
--- a/devtools/client/debugger/src/components/Editor/menus/breakpoints.js
+++ b/devtools/client/debugger/src/components/Editor/menus/breakpoints.js
@@ -3,62 +3,63 @@
  * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
 
 // @flow
 
 import actions from "../../../actions";
 import { bindActionCreators } from "redux";
 import type { SourceLocation, Breakpoint, Context } from "../../../types";
 import { features } from "../../../utils/prefs";
+import { formatKeyShortcut } from "../../../utils/text";
 
 export const addBreakpointItem = (
   cx: Context,
   location: SourceLocation,
   breakpointActions: BreakpointItemActions
 ) => ({
   id: "node-menu-add-breakpoint",
   label: L10N.getStr("editor.addBreakpoint"),
   accesskey: L10N.getStr("shortcuts.toggleBreakpoint.accesskey"),
   disabled: false,
   click: () => breakpointActions.addBreakpoint(cx, location),
-  accelerator: L10N.getStr("toggleBreakpoint.key"),
+  accelerator: formatKeyShortcut(L10N.getStr("toggleBreakpoint.key")),
 });
 
 export const removeBreakpointItem = (
   cx: Context,
   breakpoint: Breakpoint,
   breakpointActions: BreakpointItemActions
 ) => ({
   id: "node-menu-remove-breakpoint",
   label: L10N.getStr("editor.removeBreakpoint"),
   accesskey: L10N.getStr("shortcuts.toggleBreakpoint.accesskey"),
   disabled: false,
   click: () => breakpointActions.removeBreakpoint(cx, breakpoint),
-  accelerator: L10N.getStr("toggleBreakpoint.key"),
+  accelerator: formatKeyShortcut(L10N.getStr("toggleBreakpoint.key")),
 });
 
 export const addConditionalBreakpointItem = (
   location: SourceLocation,
   breakpointActions: BreakpointItemActions
 ) => ({
   id: "node-menu-add-conditional-breakpoint",
   label: L10N.getStr("editor.addConditionBreakpoint"),
-  accelerator: L10N.getStr("toggleCondPanel.breakpoint.key"),
+  accelerator: formatKeyShortcut(L10N.getStr("toggleCondPanel.breakpoint.key")),
   accesskey: L10N.getStr("editor.addConditionBreakpoint.accesskey"),
   disabled: false,
   click: () => breakpointActions.openConditionalPanel(location),
 });
 
 export const editConditionalBreakpointItem = (
   location: SourceLocation,
   breakpointActions: BreakpointItemActions
 ) => ({
   id: "node-menu-edit-conditional-breakpoint",
   label: L10N.getStr("editor.editConditionBreakpoint"),
-  accelerator: L10N.getStr("toggleCondPanel.breakpoint.key"),
+  accelerator: formatKeyShortcut(L10N.getStr("toggleCondPanel.breakpoint.key")),
   accesskey: L10N.getStr("editor.addConditionBreakpoint.accesskey"),
   disabled: false,
   click: () => breakpointActions.openConditionalPanel(location),
 });
 
 export const conditionalBreakpointItem = (
   breakpoint: Breakpoint,
   location: SourceLocation,
@@ -76,29 +77,29 @@ export const addLogPointItem = (
   location: SourceLocation,
   breakpointActions: BreakpointItemActions
 ) => ({
   id: "node-menu-add-log-point",
   label: L10N.getStr("editor.addLogPoint"),
   accesskey: L10N.getStr("editor.addLogPoint.accesskey"),
   disabled: false,
   click: () => breakpointActions.openConditionalPanel(location, true),
-  accelerator: L10N.getStr("toggleCondPanel.logPoint.key"),
+  accelerator: formatKeyShortcut(L10N.getStr("toggleCondPanel.logPoint.key")),
 });
 
 export const editLogPointItem = (
   location: SourceLocation,
   breakpointActions: BreakpointItemActions
 ) => ({
   id: "node-menu-edit-log-point",
   label: L10N.getStr("editor.editLogPoint"),
   accesskey: L10N.getStr("editor.editLogPoint.accesskey"),
   disabled: false,
   click: () => breakpointActions.openConditionalPanel(location, true),
-  accelerator: L10N.getStr("toggleCondPanel.logPoint.key"),
+  accelerator: formatKeyShortcut(L10N.getStr("toggleCondPanel.logPoint.key")),
 });
 
 export const logPointItem = (
   breakpoint: Breakpoint,
   location: SourceLocation,
   breakpointActions: BreakpointItemActions
 ) => {
   const {
--- a/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/BreakpointsContextMenu.js
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/BreakpointsContextMenu.js
@@ -3,16 +3,17 @@
  * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
 
 // @flow
 
 import { buildMenu, showMenu } from "devtools-contextmenu";
 import { getSelectedLocation } from "../../../utils/selected-location";
 import actions from "../../../actions";
 import { features } from "../../../utils/prefs";
+import { formatKeyShortcut } from "../../../utils/text";
 
 import type { Breakpoint, Source, Context } from "../../../types";
 
 type Props = {
   cx: Context,
   breakpoint: Breakpoint,
   breakpoints: Breakpoint[],
   selectedSource: Source,
@@ -231,46 +232,50 @@ export default function showContextMenu(
   const addConditionItem = {
     id: "node-menu-add-condition",
     label: addConditionLabel,
     accesskey: addConditionKey,
     click: () => {
       selectSpecificLocation(cx, selectedLocation);
       openConditionalPanel(selectedLocation);
     },
-    accelerator: L10N.getStr("toggleCondPanel.breakpoint.key"),
+    accelerator: formatKeyShortcut(
+      L10N.getStr("toggleCondPanel.breakpoint.key")
+    ),
   };
 
   const editConditionItem = {
     id: "node-menu-edit-condition",
     label: editConditionLabel,
     accesskey: editConditionKey,
     click: () => {
       selectSpecificLocation(cx, selectedLocation);
       openConditionalPanel(selectedLocation);
     },
-    accelerator: L10N.getStr("toggleCondPanel.breakpoint.key"),
+    accelerator: formatKeyShortcut(
+      L10N.getStr("toggleCondPanel.breakpoint.key")
+    ),
   };
 
   const addLogPointItem = {
     id: "node-menu-add-log-point",
     label: L10N.getStr("editor.addLogPoint"),
     accesskey: L10N.getStr("editor.addLogPoint.accesskey"),
     disabled: false,
     click: () => openConditionalPanel(selectedLocation, true),
-    accelerator: L10N.getStr("toggleCondPanel.logPoint.key"),
+    accelerator: formatKeyShortcut(L10N.getStr("toggleCondPanel.logPoint.key")),
   };
 
   const editLogPointItem = {
     id: "node-menu-edit-log-point",
     label: L10N.getStr("editor.editLogPoint"),
     accesskey: L10N.getStr("editor.editLogPoint.accesskey"),
     disabled: false,
     click: () => openConditionalPanel(selectedLocation, true),
-    accelerator: L10N.getStr("toggleCondPanel.logPoint.key"),
+    accelerator: formatKeyShortcut(L10N.getStr("toggleCondPanel.logPoint.key")),
   };
 
   const removeLogPointItem = {
     id: "node-menu-remove-log",
     label: L10N.getStr("editor.removeLogPoint.label"),
     accesskey: L10N.getStr("editor.removeLogPoint.accesskey"),
     disabled: false,
     click: () =>