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

use labels instead of numbers in block translations #29

Closed kristiank closed 3 years ago

kristiank commented 4 years ago

I have now changed all numerical block field references to use labels instead. I made a smoke test and it seems to work.

In the same commit is also:

Before merging I would like to ask what the semantics is behind the number_constrain block. I'd like to convey it better in the translation string.

RichoM commented 4 years ago

important for Spanish: I found that the number_between didn't have a translation so I added it but it lacks Spanish translation

Good catch. I seem to have missed the "joystick" blocks as well.

Before merging I would like to ask what the semantics is behind the number_constrain block. I'd like to convey it better in the translation string.

The number_constrain block will generate code that calls the constrain primitive, which constrains a number to be between the specified limits. So, if the number is greater than min and less than max the primitive returns the number, if it's less than min then returns min, and if it's greater than max then it returns max. You can see the implementation here:

https://github.com/GIRA/UziScript/blob/71981f27a106a8a87526c1a28ffabd4fd8e6bf55/c%2B%2B/UziFirmware/VM.cpp#L868-L886

kristiank commented 4 years ago

As far as I know, this can be merged. How is work proceeding for the new release?

RichoM commented 4 years ago

I'm sorry, I was out of town last week with no access to a computer. I'll start working on the release this week. I want to take some time to test before publishing.

RichoM commented 3 years ago

I forgot about this pull request and made a lot of changes to the blocks so now I can't merge this pull request very easily. I'm sorry. Most of the work put in this is already merged, though. I also took the time to review the translations and found a couple labels I missed so I fix those as well. I didn't change all the block translations to use labels, though. I used the labels to disambigüate when the translation needed it, but in other cases I simply left the numbers.

kristiank commented 3 years ago

No problems, I can take another look on my next round of translating (hopefully within a month). Good work, keep it going!