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.29k stars 284 forks source link

[BUG] Enable French keywords #1940

Closed Felienne closed 2 years ago

Felienne commented 2 years ago

Since #1925 we have French keywords so I need to do some manual magic to make them work (or get my shit together and write a proper script haha)

omalaspinas commented 2 years ago

Could french keyword contain accents so they are closer to actual french? For example repeat would be répète (instead of the current repete) and to would be à (instead of the current a). Also can variables contain accents?

Felienne commented 2 years ago

Yes absolutely @omalaspinas, we support all character sets for keywords! (I didn't realize we did not have them since I don't speak French myself)

If you want to, you can update the keywords file here: https://github.com/Felienne/hedy/blob/main/coursedata/keywords/fr.yaml and I will take that into account when enabling. Otherwise I am sure @thjazi39 can update them.

omalaspinas commented 2 years ago

Yes! I'll make a quick PR for the keywords and @thjazi39 as he's the original author to see what he thinks.

Also a second question. Is there any preference for keywords that are in two words? I saw that in english "else if" becomes "elif" but "to list" becomes "to_list" (also the variables seem to be snakecase like). Should the keywords made of two words be simply concatenated ot should the words be separated by a ""? My personal taste would be to separate with the underscore but I'll happily follow the "hedy" way.

Your project is really awesome I can't wait to have the complete translation finished to play with my children :)

omalaspinas commented 2 years ago

Should I open an Issue to modify the french keywords and submit a PR? Or should I directly create a PR and connect it to this issue? Also should I make a PR to the add_french branch? or to main?

Felienne commented 2 years ago

Should I open an Issue to modify the french keywords and submit a PR?

PR is fine without an issue, since we have discussed it here

Or should I directly create a PR and connect it to this issue?

Yes please mention this issue with the PR.

Also should I make a PR to the add_french branch? or to main?

Best to make a fresh PR to main

Felienne commented 2 years ago

Yes! I'll make a quick PR for the keywords and @thjazi39 as he's the original author to see what he thinks.

Superb!

Also a second question. Is there any preference for keywords that are in two words? I saw that in english "else if" becomes "elif" but "to list" becomes "to_list" (also the variables seem to be snakecase like). Should the keywords made of two words be simply concatenated ot should the words be separated by a ""? My personal taste would be to separate with the underscore but I'll happily follow the "hedy" way.

I think we always use underscores, but we use elif because that happens to be the Python way. But these are just keys, so you will have to keep them exactly as they are anyway, and only translate (or in your case, change) the right hand side.

Your project is really awesome I can't wait to have the complete translation finished to play with my children :)

Thank you!

omalaspinas commented 2 years ago

OK. Perfect. One last question. I'm doing more translation (finished translating the level_defaults, made some minor modifications to achievements, started adventures, and not yet done parts of quizzes. I'll open a MR for level_defaults and achievements. Should I also only mention this issue for these?

Felienne commented 2 years ago

OK. Perfect. One last question. I'm doing more translation (finished translating the level_defaults, made some minor modifications to achievements, started adventures, and not yet done parts of quizzes. I'll open a MR for level_defaults and achievements. Should I also only mention this issue for these?

Thanks for checking! For content additions we typically don't open issues (or there would be way too many)

thjazi39 commented 2 years ago

Hi, To answer the questions about accents, I didn't put them because I didn't know that accents were supported in keywords.

I don't know if accents are a good thing. On the one hand, it's true that it will be more real, and it will probably avoid conflicts with French teachers, but on the other hand, I think that it's not necessarily a good practice to program with accents (ASCII/UTF8 accounting, programming in languages that are lower level, etc.)

I don't know enough about programming pedagogy, so I don't know what decision to make, but if you want me to put accents, I can do it!

If it helps you to choose, I can also ask about the use of accents between 5 and 15 in France, to know if it is something that is quickly acquired by the students, or if it is a difficulty for them. (indeed, adding the accents could confuse the students, because for example, in the key word 'répète' you have to remember the accents, and I know that it is not always easy for the students)

omalaspinas commented 2 years ago

Hi,

I agree with you that it's a tradeoff between how "real" the language must look like vs relative ease of writing. IMHO since there are only a very limited set of keywords, that they are usually written on screen next to the exercises, etc it seems to me that it makes sense (especially for "a" vs "à" which could be misleading, "a" being the present of avoir, to have, and is giving any insight on the "range" implied). Actually the "a" vs "à" was the main reason I put the accents and then had for consistency to add répète, which I agree is very awkward.

I think French is an awful language to learn how to write and it reflects perfectly on how one would program in it....

Felienne commented 2 years ago

Thanks for the discussion!

I think that it's not necessarily a good practice to program with accents (ASCII/UTF8 accounting, programming in languages that are lower level, etc.)

I don't agree there, our explicit goal is to make programming authentic n any language and to not force "strange" things like avoiding accents if they belong on a word.

it will probably avoid conflicts with French teachers

That is a great reason to put them in, teachers are our main "customers"!

If it helps you to choose, I can also ask about the use of accents between 5 and 15 in France, to know if it is something that is quickly acquired by the students, or if it is a difficulty for them.

That would be helpful if you could figure that out! That something is hard for kids is a good reason not to do it.

And what about supporting both? That is not so hard to do (either in the grammar or with a simple preprocessor)

omalaspinas commented 2 years ago

Probably being fault tolerant in that sense would be great. Having with/without accents would be very helpful.

Felienne commented 2 years ago

Hi @omalaspinas!

I am enabling the keywords and I made it work with both (see #1980) . One open question is what to suggest!

image

We fetch the closest keyword meaning we will suggest either with or without spaces. Which one do you think is best to suggest? I went with the accents to not upset teachers :D

omalaspinas commented 2 years ago

That's very nice!

I'm on the side of accents so it's closer to the actual language, but it's true that french is really difficult to write without errors.

Not sure what you mean with or without spaces. Do you plan to have two versions for "two-words" keywords?

Felienne commented 2 years ago

That's very nice!

I'm on the side of accents so it's closer to the actual language, but it's true that french is really difficult to write without errors.

Not sure what you mean with or without spaces. Do you plan to have two versions for "two-words" keywords?

For now we just have the version with space (f.e. for while we use "tant queue", see #1980)

omalaspinas commented 2 years ago

Sorry I missed that. Looks perfect with "tant que"!