diff --git a/demos/code/code.js b/demos/code/code.js index aaa514dd8..7ba1f25a1 100644 --- a/demos/code/code.js +++ b/demos/code/code.js @@ -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',