Localize custom block used alert

This commit is contained in:
apple502j 2020-05-29 16:17:08 +09:00
parent a35ce79b82
commit bd4d913056
3 changed files with 3 additions and 4 deletions

View file

@ -176,8 +176,7 @@ Blockly.ScratchBlocks.VerticalExtensions.PROCEDURE_DEF_CONTEXTMENU = {
var didDelete = Blockly.Procedures.deleteProcedureDefCallback(
procCode, rootBlock);
if (!didDelete) {
// TODO:(#1151)
alert('To delete a block definition, first remove all uses of the block');
alert(Blockly.Msg.PROCEDURE_USED);
}
};
}

View file

@ -281,8 +281,7 @@ Blockly.BlockDragger.prototype.endBlockDrag = function(e, currentDragDeltaXY) {
var procCode = block.getProcCode();
// Check for call blocks with no associated define block.
if (!Blockly.Procedures.getDefineBlock(procCode, ws)) {
// TODO:(#1151)
alert('To delete a block definition, first remove all uses of the block');
alert(Blockly.Msg.PROCEDURE_USED);
ws.undo();
return; // There can only be one define deletion at a time.
}

View file

@ -331,6 +331,7 @@ Blockly.Msg.DELETE_VARIABLE = 'Delete the "%1" variable';
Blockly.Msg.NEW_PROCEDURE = 'Make a Block';
Blockly.Msg.PROCEDURE_ALREADY_EXISTS = 'A procedure named "%1" already exists.';
Blockly.Msg.PROCEDURE_DEFAULT_NAME = 'block name';
Blockly.Msg.PROCEDURE_USED = 'To delete a block definition, first remove all uses of the block';
// Lists
// @todo Remove these once fully managed by Scratch VM / Scratch GUI