Adding code removed in #1028 to fix regression #1386. (#1389)

Modifications to avoid matching %{key} notation.
This commit is contained in:
Andrew n marshall
2017-10-25 12:27:11 -07:00
committed by GitHub
parent 187c2c85dc
commit ef14f0f306

View File

@@ -392,8 +392,10 @@ Code.init = function() {
}
}
// Construct the toolbox XML.
// Construct the toolbox XML, replacing translated variable names.
var toolboxText = document.getElementById('toolbox').outerHTML;
toolboxText = toolboxText.replace(/(^|[^%]){(\w+)}/g,
function(m, p1, p2) {return p1 + MSG[p2];});
var toolboxXml = Blockly.Xml.textToDom(toolboxText);
Code.workspace = Blockly.inject('content_blocks',