Skip to content

Commit ef14f0f

Browse files
authored
Adding code removed in google#1028 to fix regression google#1386. (google#1389)
Modifications to avoid matching %{key} notation.
1 parent 187c2c8 commit ef14f0f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

demos/code/code.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,10 @@ Code.init = function() {
392392
}
393393
}
394394

395-
// Construct the toolbox XML.
395+
// Construct the toolbox XML, replacing translated variable names.
396396
var toolboxText = document.getElementById('toolbox').outerHTML;
397+
toolboxText = toolboxText.replace(/(^|[^%]){(\w+)}/g,
398+
function(m, p1, p2) {return p1 + MSG[p2];});
397399
var toolboxXml = Blockly.Xml.textToDom(toolboxText);
398400

399401
Code.workspace = Blockly.inject('content_blocks',

0 commit comments

Comments
 (0)