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

Open
wants to merge 32 commits into
base: main
Choose a base branch
from

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

[UI idea] Localized keywords in the teacher manual
1 participant