khanning / scratch-arduino-extension

Javascript extension to connect Scratch 2.0 with Arduino using Firmata
83 stars 91 forks source link

fixing some issues with blocks and languages #36

Closed mancusoa74 closed 8 years ago

mancusoa74 commented 8 years ago

hi khanning, it is few days I am using your great Arduino extension for ScratchX.

I am an Italian user but I can read/write English. However I am interested to use your extension with Italian kids which don't speak English. For this reason I have started to use your extension in Italian language (&language=it) However it was not working for me.

For this reason I made some fixes and now it works for me.

if you consider it correct I would appreciate if you can merge with your master branch.

In short the issue I have found (only looked at digitalWrite and digitalLED) is that when checking val == 'on' or val =='off' this is always not executed as the to val variable it is assigned a value in translated language (in my case Italian)

so something like if (val == 'on') would become if ('acceso' == 'on) which is obviously false.

so my solution is to check val again the menus[lang]['outputs'] array and not against hard coded values.

hope this is correct :)

if you are ok with that I will continue to test it in Italian and if something else will not work I will fix it.

thank you so much Antonio

PS: you have done a great job!!! :)