@@ -14,7 +14,7 @@ import {
1414} from 'blockly' ;
1515import * as Constants from '../constants' ;
1616import { Navigation } from '../navigation' ;
17- import { getShortActionShortcut } from '../shortcut_formatting' ;
17+ import { getMenuItem } from '../shortcut_formatting' ;
1818import { clearPasteHints , showCopiedHint , showCutHint } from '../hints' ;
1919
2020/**
@@ -104,10 +104,7 @@ export class Clipboard {
104104 private registerCutContextMenuAction ( ) {
105105 const cutAction : ContextMenuRegistry . RegistryItem = {
106106 displayText : ( scope ) =>
107- Msg [ 'CUT_SHORTCUT' ] . replace (
108- '%1' ,
109- getShortActionShortcut ( Constants . SHORTCUT_NAMES . CUT ) ,
110- ) ,
107+ getMenuItem ( Msg [ 'CUT_SHORTCUT' ] , Constants . SHORTCUT_NAMES . CUT ) ,
111108 preconditionFn : ( scope ) => this . cutPrecondition ( scope ) ,
112109 callback : ( scope , menuOpenEvent ) => {
113110 if ( ! isCopyable ( scope . focusedNode ) ) return false ;
@@ -250,10 +247,7 @@ export class Clipboard {
250247 private registerCopyContextMenuAction ( ) {
251248 const copyAction : ContextMenuRegistry . RegistryItem = {
252249 displayText : ( scope ) =>
253- Msg [ 'COPY_SHORTCUT' ] . replace (
254- '%1' ,
255- getShortActionShortcut ( Constants . SHORTCUT_NAMES . COPY ) ,
256- ) ,
250+ getMenuItem ( Msg [ 'COPY_SHORTCUT' ] , Constants . SHORTCUT_NAMES . COPY ) ,
257251 preconditionFn : ( scope ) => this . copyPrecondition ( scope ) ,
258252 callback : ( scope , menuOpenEvent ) => {
259253 if ( ! isCopyable ( scope . focusedNode ) ) return false ;
@@ -331,10 +325,7 @@ export class Clipboard {
331325 private registerPasteContextMenuAction ( ) {
332326 const pasteAction : ContextMenuRegistry . RegistryItem = {
333327 displayText : ( scope ) =>
334- Msg [ 'PASTE_SHORTCUT' ] . replace (
335- '%1' ,
336- getShortActionShortcut ( Constants . SHORTCUT_NAMES . PASTE ) ,
337- ) ,
328+ getMenuItem ( Msg [ 'PASTE_SHORTCUT' ] , Constants . SHORTCUT_NAMES . PASTE ) ,
338329 preconditionFn : ( scope ) => this . pastePrecondition ( scope ) ,
339330 callback : ( scope : ContextMenuRegistry . Scope , menuOpenEvent : Event ) => {
340331 const workspace = this . copyWorkspace ;
0 commit comments