Support for keywords in non-English #776
Replies: 2 comments 3 replies
-
Is the last level of Hedy going to be a fully valid subset of Python or will it also support non-English keywords such as used in Hebrew Python or any grammar transpiled into Python such as Enkelt? With full support of custom grammatical structures you could end up with a totally different syntax, maybe this would be too much. A list of examples would help. I found In any case I'd add another point:
There should be a method to translate a program written with keywords (and possibly grammar) in language A to the same program in another language. Strings and variables names might be kept untranlated or suggested translations could be shown based in NLP. |
Beta Was this translation helpful? Give feedback.
-
As we'll probably want to support more and more natural languages (if there are people to contribute corresponding translations), this could problematic, as not all of them might be free of mutual overlaps for different semantics. (Overlaps for the same semantic, of course are unproblematic, as simply several languages would use the same keyword for the same purpose.) A (made up) example to illustrate the problem: Assume that in Foobarish, the most idiomatic way to express what Assume further that meanwhile, in Bazquxish, the most idiomatic way to express what So we'd have
Now this might not be too bad, as
But it's not hard to imagine that it could also affect keywords that can occur in the same level and that cannot be distinguished by context. Given that the number of keywords is quite limited even seen over all Hedy levels combined (currently there are just 28), such collisions might not be a very frequent thing. Still, as there are many "false friends" in many pairs of languages (e.g. "gift", which means "present" in English, but "poison" in German), some might come up even in that limited set of keywords, if keywords for more and more languages shall be offered. |
Beta Was this translation helpful? Give feedback.
-
In discussions with kids (even with Dutch kids at the high school level) kids tell us they would love to have Dutch keywords. It surprised me a lot because
print
andecho
are even Dutch words. But yeah, research shows kids learn better in their own language so it is not that weird maybe!And in non-Latin alphabets, it is even harder than in Dutch I imagine!
So all in all, this feature is truly on the top of our wishlist but it is going to impact all the things so we have to consider it carefully. Some preparation work already was done, by putting the keywords all in the level 1 grammar (#463).
What makes it even harder is that from a discussion I had at PILATE with Mark Guzdial, it became clear to me that having "Dutch Hedy" and "English Hedy" and" Spanish Hedy" is not even a great strategy because there are so many bilingual kids, and even monolingual kids might pick up English examples from the site or from each other, and then mix them with their own language. So we should probably allow mixing of languages also!
It is not clear to me whether allowing this language mixing from the start will make our lives easier, or that it is better to start with the "single language but translated" strategy.
Other fun things to consider are that simply translating the keywords is not even enough for some languages. For example, for truly idiomatic Dutch, we might want to have split infinitive keywords... like
print
hallo allemaaluit
. Of maybe we would like to haveif x 5 is
instead ofif x is 5
because that's how we say it in Dutch. Other languages (as I understand it for example Japanese and Arabic) don't really have anare
verb, so something likename is hedy
would not have an obvious translation. So in addition to translating keywords, we might also want to allow the overriding of grammar rules! But I guess if we want to have flexible grammar, and also also the "à volonté" mixing of languages, parsing would become nearly impossible. Yet it is fun and smart to consider these things before we start on the simpler versions.In short, some things to consider when localizing a programming language (from easier to hard)
if
andis
in other languagesals
(nl) withrepeat
(en)Beta Was this translation helpful? Give feedback.
All reactions