GIRA / PhysicalBits

A web-based programming environment for educational robotics that supports live coding and autonomy using a hybrid blocks/text programming language.
https://gira.github.io/PhysicalBits/
MIT License
18 stars 5 forks source link

Localization efforts #6

Closed kristiank closed 4 years ago

kristiank commented 4 years ago

Is there a way for me to help with localization? Is there a "roadmap" or general plan how you will organize the localization of the Physical BITS IDE? I am asking, because I noticed Google Blockly already contains its own locales and use TranslateWiki for their localization.

RichoM commented 4 years ago

I haven't really think this through yet. In fact, the current localization was hacked in a couple of days because I needed the UI to be in spanish for a workshop we did here in Argentina. So, as you've seen, the implementation is very simplistic but it worked well enough for our needs at the time. I guess if we want to move forward we need a more sophisticated approach. I haven't looked at TranslateWiki yet, but if you think it's the way to go and you can a make a strong case for it then I'll support it.

RichoM commented 4 years ago

Also, right now I'm working on building custom blocks for variables, functions, and procedures. The idea is to replace blockly's built-in blocks, which are not very flexible. I almost finished with the variables and I'm about to move to the functions. As soon as I finish with that I'll be able to make those blocks translatable. The next thing would be to translate the output messages (you know, the ones that say "Connection successful!", etc.). The thing is that those messages mostly come from the server so I'll have to rewrite some of the smalltalk code to be able to translate those strings. If you want to help with that, it would be very much appreciated.

kristiank commented 4 years ago

Yes, localization is a major topic that usually starts as a hack. I'll wait for for your work on custom blocks and will in the mean time do some research on localization concerning the specific tools you are using. Here's about localizing custom Blockly blocks.

kristiank commented 4 years ago

Can I find documentation for web/ide/i18n.js somewhere or is this some code you wrote yourself? It's a nice piece of code.

RichoM commented 4 years ago

I wrote it myself so sorry, no documentation. I can answer any questions about it though. Also, if you think an existing tool would be more appropriate than my little script then I'm open to suggestions.

kristiank commented 4 years ago

I first want to try out Blockly's own localization strategy. My plan:

RichoM commented 4 years ago

That's great. Keep in mind that it would be desirable to use the same localization strategy for the entire application, not just the blocks. I wouldn't like having to maintain separate localization code, one for blockly and another for the rest of the UI. Also, I haven't looked deeply into blockly's approach but I would prefer if whatever strategy we use is not tightly coupled with blockly. I mean, blockly is great and all but I don't know if I'll want to replace it with something else in the future.

kristiank commented 4 years ago

I sympathize with you here. Having tried re-writing your coded block definitions into blockly's JSON definitions I started to understood more how they work.

The first localization feature I want to implement is that the translation strings can define the order of the input fields. I made a test and maybe you can help me find out why it doesn't work as expected in the pull request #8 (but don't accept the pull request yet).

RichoM commented 4 years ago

I sympathize with you here. Having tried re-writing your coded block definitions into blockly's JSON definitions I started to understood more how they work.

Actually, I started using the JSON definitions but eventually I rewrote all the blocks to use javascript directly. Some things only work when using javascript and I didn't like having to maintain two separate sources of blocks.

The first localization feature I want to implement is that the translation strings can define the order of the input fields. I made a test and maybe you can help me find out why it doesn't work as expected in the pull request #8 (but don't accept the pull request yet).

Nice, I was thinking of doing that exact same thing the other day. I'm glad you're working on it.

kristiank commented 4 years ago

I consider this issue resolved by #9 and I'll open new and more precise issues for other localization efforts.