diff --git a/core/variables.js b/core/variables.js index f5d7216c0..ab85adb6e 100644 --- a/core/variables.js +++ b/core/variables.js @@ -283,15 +283,13 @@ Blockly.Variables.createVariableButtonHandler = function( var existing = Blockly.Variables.nameUsedWithAnyType_(text, workspace); if (existing) { - var lowerCase = text.toLowerCase(); if (existing.type == type) { var msg = Blockly.Msg['VARIABLE_ALREADY_EXISTS'].replace( - '%1', lowerCase).replace('%2', existing.name); + '%1', existing.name); } else { var msg = Blockly.Msg['VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE']; - msg = msg.replace('%1', lowerCase).replace('%2', existing.type) - .replace('%3', existing.name); + msg = msg.replace('%1', existing.name).replace('%2', existing.type); } Blockly.alert(msg, function() { @@ -352,9 +350,8 @@ Blockly.Variables.renameVariable = function(workspace, variable, variable.type, workspace); if (existing) { var msg = Blockly.Msg['VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE'] - .replace('%1', newName.toLowerCase()) - .replace('%2', existing.type) - .replace('%3', existing.name); + .replace('%1', existing.name) + .replace('%2', existing.type); Blockly.alert(msg, function() { promptAndCheckWithAlert(newName); // Recurse diff --git a/msg/messages.js b/msg/messages.js index a56e5ae3c..2cb5c3ed8 100644 --- a/msg/messages.js +++ b/msg/messages.js @@ -172,10 +172,10 @@ Blockly.Msg.NEW_VARIABLE_TYPE_TITLE = 'New variable type:'; Blockly.Msg.NEW_VARIABLE_TITLE = 'New variable name:'; /** @type {string} */ /// alert - Tells the user that the name they entered is already in use. -Blockly.Msg.VARIABLE_ALREADY_EXISTS = 'A variable named "%1" already exists (as "%2").'; +Blockly.Msg.VARIABLE_ALREADY_EXISTS = 'A variable named "%1" already exists.'; /** @type {string} */ /// alert - Tells the user that the name they entered is already in use for another type. -Blockly.Msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE = 'A variable named "%1" already exists for another type: "%2" (as "%3").'; +Blockly.Msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE = 'A variable named "%1" already exists for another type: "%2".'; // Variable deletion. /** @type {string} */