diff --git a/src/multiselect_contextmenu.js b/src/multiselect_contextmenu.js index dfa4cc9..f4b75c9 100644 --- a/src/multiselect_contextmenu.js +++ b/src/multiselect_contextmenu.js @@ -768,7 +768,6 @@ const updateToMultiCopyToBackpack = if (!backpack) { return ''; } - const backpackCount = backpack.getCount(); let workableBlocksLength = 0; const blockSelection = blockSelectionWeakMap.get(ws); if (!blockSelection.size) { @@ -781,8 +780,17 @@ const updateToMultiCopyToBackpack = workableBlocksLength++; } } - return `(${workableBlocksLength}) ` + - `${Blockly.Msg['COPY_TO_BACKPACK']} (${backpackCount})`; + if (workableBlocksLength > 1) { + if (Blockly.Msg['COPY_X_TO_BACKPACK']) { + return Blockly.Msg['COPY_X_TO_BACKPACK'] + .replace('%1', workableBlocksLength.toString()); + } else { + return Blockly.Msg['COPY_TO_BACKPACK'] + + ` (${workableBlocksLength})`; + } + } else { + return Blockly.Msg['COPY_TO_BACKPACK']; + } }, preconditionFn: function(scope) { if (!scope.block) return 'hidden';