jmoenig / Snap

a visual programming language inspired by Scratch
http://snap.berkeley.edu
GNU Affero General Public License v3.0
1.52k stars 749 forks source link

translated variable names #1729

Open UnnamedMinecrafter opened 7 years ago

UnnamedMinecrafter commented 7 years ago

I added a variable named timer but in the selector it shows its german translation bug translate

I think this is caused by the renaming of the actual timer to its german translation it just seems kinda weird

towerofnix commented 7 years ago

The cause of the issue is in MenuMorph.prototype.addItem:

this.items.push([
    localize(labelString || 'close'),
    // ...

Menu items are always localized. In order to keep variable names the same, there'd need to either be no automatic localization inside of addItem, or there'd need to be a flag that disables localization in addItem (defaulting to having it enabled). Additionally, there'd need to be a way of marking which menu items should be localized and which shouldn't be through the choiceDict passed to TextSlotMorph.prototype.init. We usually want to localize menu items, but not for variable names.

Note that sprite names get translated, as well, as likely do costumes and sounds (though not tested):

Translated "timer" sprite