From ef14f0f3063c69821b86e94718405f6333a0d12f Mon Sep 17 00:00:00 2001 From: Andrew n marshall Date: Wed, 25 Oct 2017 12:27:11 -0700 Subject: [PATCH] Adding code removed in #1028 to fix regression #1386. (#1389) Modifications to avoid matching %{key} notation. --- demos/code/code.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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',