hedyorg / hedy

Hedy is a gradual programming language to teach children programming. Gradual languages use different language levels, where each level adds new concepts and syntactic complexity. At the end of the Hedy level sequence, kids master a subset of syntactically valid Python.
https://www.hedy.org
European Union Public License 1.2
1.32k stars 289 forks source link

[UI idea] Explore & languages #2769

Closed Felienne closed 2 years ago

Felienne commented 2 years ago

In the explore page, we currently show erroneous programs with a red bar (good!). However, programs written in keywords languages that are not the one of the user, do not really work either. Firstly, they are not highlighted correctly even though they work in their own lang (Verhaal on row 2, column 1):

image

But also, when selecting them, they won't work:

image

I don't have a clear cut solution here, but some things we can do (maybe? I am not sure what information we have access to easily):

  1. Highlight programs in the language that they are stored in, rather than the one of the user?

  2. (or) clearly indicate the language of a program on the explore page, and then allow filtering on languages?

  3. (or) add the switcher on shared programs for they can be translated to en?

  4. (or) filter programs to only show programs in the language of the user?

  5. That makes a lot of sense because the strings of programs will also be unreadable to kids, but on the other hand, 2. and 3. allow for nice cross-cultural exploration which Hedy stands for!

What is feasible here @TiBiBa?

TiBiBa commented 2 years ago

I thought we implemented a keyword parser on the /explore page a while back. Automatically parsing all non-user language programs to their set keyword language. But does not seem to work as pointed out by the screenshot, will take a look what is wrong because this used to work a while back!

TiBiBa commented 2 years ago

Schermafbeelding 2022-05-18 om 16 04 02

This does seem to work for me! All non-english non-user-language programs are automatically parsed into the set keyword language. In the screenshot the second program, "Nivå 1 - Norsk", is stored with Norsk keywords but parsed to Dutch onces as my profile is set to dutch keyword lang.

Felienne commented 2 years ago

Hmmm on alpha & beta I do not seems to see any of those language tags you have in En:

image

With profile & keywords In Dutch is it a bit of a mix (beta):

image

So there might be something to explore (ha ha!) here?

Felienne commented 2 years ago

And I still think it would be useful to be able to filter on languages for the plain texts?

TiBiBa commented 2 years ago

Hmmm on alpha & beta I do not seems to see any of those language tags you have in En:

image

With profile & keywords In Dutch is it a bit of a mix (beta):

image

So there might be something to explore (ha ha!) here?

I think I can explain the difference: We only parse the keywords if we can guarantee that they are in the set language, otherwise the translator will crash. So we will only translate the keywords if the profile language and keyword language are both set to a non-english language. When either is set in english we don't parse at all. But I'm getting a bit confused myself, wil take look!

TiBiBa commented 2 years ago

And I still think it would be useful to be able to filter on languages for the plain texts?

Will take a look! Issue is that we store program with the set profile language and not the set keyword language, but we can definitely filter on this.

TiBiBa commented 2 years ago

Hmmm on alpha & beta I do not seems to see any of those language tags you have in En: image With profile & keywords In Dutch is it a bit of a mix (beta): image So there might be something to explore (ha ha!) here?

I think I can explain the difference: We only parse the keywords if we can guarantee that they are in the set language, otherwise the translator will crash. So we will only translate the keywords if the profile language and keyword language are both set to a non-english language. When either is set in english we don't parse at all. But I'm getting a bit confused myself, wil take look!

We can fix this with double parsing! Always parse all programs to English (as we are sure this is correct), then to the user keyword language. For example Norsk -> English -> Dutch.

Felienne commented 2 years ago

We can fix this with double parsing! Always parse all programs to English (as we are sure this is correct), then to the user keyword language. For example Norsk -> English -> Dutch.

That makes sense!