code-dot-org/blockly — pull request #777 by Bjvanminnen (2014-07-30 16:32:23+00:00)
Title: persist counter variable name for controls_for_counter

controls_for_counter creates a for loop with a variable with the name of msg.loopVariable(). This gets us into trouble when sharing across the languages. The reason is that the block that uses the variable
![image](https://cloud.githubusercontent.com/assets/1767466/3752302/84b76d02-1806-11e4-97bf-184a0f9126ea.png)
ends up persisting that value to xml. Now, if I load that value in a different language, the controls_for_counter will use a variable name from my current language, whereas the caller will use the variable persisted to the xml (contador vs. caller)
![image](https://cloud.githubusercontent.com/assets/1767466/3752324/b7eb6458-1806-11e4-9266-65e4418cb2a0.png)

The fix is to persist the variable name to xml for controls_for_counter as well. Now, when I create my controls_for_counter block from the persisted xml, I know the variable name, and will use the same value regardless of language:
![image](https://cloud.githubusercontent.com/assets/1767466/3752350/097892d2-1807-11e4-85ee-449106cdf119.png)