Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🪲 Translate keywords in the teacher manual #5167

Merged
merged 39 commits into from
Aug 5, 2024

Conversation

jpelay
Copy link
Member

@jpelay jpelay commented Feb 20, 2024

In this PR I want to tackle the translation of keywords in the teacher manual. First, we need to allow the keywords to be translated using the curly brace system we use already in the adventures, that is simple enough to do and requires only the call to a function; after that we need to test the programs inside the yamls in the teacher manual, because when they do have curly braces, sometimes they're not correctly. And third, what do we do with the mess we already have?

For example in Spanish there's a mixture of several methods:

  • Sometimes the keywords are directly translated
bebida = preguntar '¿Qué te gustaría beber?'
imprimir bebida
bebida = preguntar '¿Qué te gustaría beber?'
imprimir bebida
bebida = preguntar '¿Qué te gustaría beber?'
imprimir bebida
  • Sometimes they have curly braces:
superhéroes = Spiderman, Batman, Iron Man
superhéroe = superhéroes {at} {random}
{if} superhéroe = Batman
    {print} '¡SOY BATMAN!'
  • Sometimes they have intentional errors.
  • Sometimes they have unintentional errors

Fixes #4134

How to test

@ghost
Copy link

ghost commented Feb 20, 2024

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@jpelay
Copy link
Member Author

jpelay commented Feb 20, 2024

Ok, so here's the sketch of a plan: maybe I can use a script to translate parse the correct programs, translate them to english and add the curly braces, but that leaves the question: what to do with those that have intentional errors? Perhaps first we need to add a flag to the yamls? I figured it out haha

@jpelay
Copy link
Member Author

jpelay commented Feb 24, 2024

Depends on the fix made in #5175

mergify bot pushed a commit that referenced this pull request Feb 27, 2024
While working on #5167 I realized we weren't parsing some examples properly, which let me to realize that I didn't include the equal sign in comparisons for levels 6 through 11. 

**How to test**

I added some tests that should pass!
@jpelay jpelay marked this pull request as ready for review June 20, 2024 21:01
@jpelay
Copy link
Member Author

jpelay commented Jun 20, 2024

Done! All languages done with the exception of zh_Hans. I'm not sure what to do with that one since Chinese speakers don't often use spaces, which makes the parser give up. Not sure about an easy solution here.

@jpelay jpelay requested a review from Felienne June 20, 2024 21:04
Copy link
Collaborator

@boryanagoncharenko boryanagoncharenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for the super delayed review!
Great job! Really! There only a couple of things I noticed that we could improve:

  • The keywords are not "highlighted" if they appear in headings. So, the command echo would appear correctly in a <p> but not if it is a <h4>:
Screenshot 2024-07-22 at 11 16 56
  • I noticed that the word doens't appears in many places. Perhaps we could change it with this PR?
  • There are 2 words which I am sure are not used correctly: 'commando' and 'codes'. They change the meaning of the text. Commando is a military unit and code (programming code) can never be plural by definition. This Codes using the if commando can get very long is a hilarious example, which I think should be changed to something like: Using the if command can make the code lines very long.

@jpelay jpelay added the content issues related to adventure tabs label Jul 31, 2024
@jpelay
Copy link
Member Author

jpelay commented Aug 1, 2024

Apologies for the super delayed review! Great job! Really! There only a couple of things I noticed that we could improve:

Don't worry!

  • The keywords are not "highlighted" if they appear in headings. So, the command echo would appear correctly in a <p> but not if it is a <h4>:
Screenshot 2024-07-22 at 11 16 56

Thanks for noticing that! I fixed it by using a Jinja2 filter (commonmark)

  • I noticed that the word doens't appears in many places. Perhaps we could change it with this PR?

I tried replacing, let me know if that's ok.

  • There are 2 words which I am sure are not used correctly: 'commando' and 'codes'. They change the meaning of the text. Commando is a military unit and code (programming code) can never be plural by definition. This Codes using the if commando can get very long is a hilarious example, which I think should be changed to something like: Using the if command can make the code lines very long.

Omg! For sure, I replaced every mention of codes, and commando.

Copy link
Contributor

mergify bot commented Aug 5, 2024

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 967dbeb into main Aug 5, 2024
12 checks passed
Copy link
Contributor

mergify bot commented Aug 5, 2024

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot deleted the translate_kw_teacher_manual branch August 5, 2024 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content issues related to adventure tabs
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[UI idea] Localized keywords in the teacher manual
2 participants