Skip to content

Commit

Permalink
[TESTING] Weblate fix script (#4544)
Browse files Browse the repository at this point in the history
One of our biggest time sinks is fixing Weblate snippets (it is mine for sure and I could use my time in better ways). Sometimes, this is needed because a weblate PR is blocking other content PRs. While of course it is not great to throw away snippets, and we should fix them when possible, this PR introduces an environment variable called `fix_for_weblate`, which can be set to revert broken snippets back to English. So if needed this can be used
  • Loading branch information
Felienne committed Sep 27, 2023
1 parent 0bf9276 commit 3feaa9f
Show file tree
Hide file tree
Showing 30 changed files with 170 additions and 144 deletions.
4 changes: 2 additions & 2 deletions content/adventures/ar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ adventures:
```
{print} حقيبة الظهر خاصته أصبحت ثقيلة للغاية.
{print} كان داخلها زجاجة ماء و مصباح و طعام.
المحتويات هي ماء، مصباح، طعام
المحتويات {is} ماء، مصباح، طعام
الزائد {is} {ask} ما الذي عليه التخلص منه؟
{remove} الزائد {from} المحتويات
{remove} الزائد {from} المحتويات
```
start_code: "{print} قصتك"
13:
Expand Down
2 changes: 1 addition & 1 deletion content/adventures/ca.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ adventures:
story_text: "In level 3 you can make your story more fun. You can use randomness for any monster, animal or other obstacle, like this:\n"
example_code: "```\nanimals {is} 🦔, 🐿, 🦉, 🦇\n{print} He now hears the sound of an animals {at} {random}\n```\n"
story_text_2: "The command `{add}` can also come in handy in your story.\n"
example_code_2: "```\n{print} He hears a sound\nanimals {is} 🐿, 🦔, 🦇, 🦉\nanimal {is} {ask} What do you think it is?\n{add} animal {to_list} animals\n{print} it was an animal {at} {random}\n```\n"
example_code_2: "```\n{print} He hears a sound\nanimals {is} 🐿, 🦔, 🦇, 🦉\nanimal {is} {ask} What do you think it is?\n{add} animal {to_list} animals\n{print} it was an animals {at} {random}\n```\n"
story_text_3: "This is an example of the `{remove}` command in your story\n\n### Exercise\nCan you use the 3 new commands `{at} {random}` , `{add} {to}` and `{remove} {from}` in your own story?\n"
start_code: '{print} La teva història'
7:
Expand Down
4 changes: 2 additions & 2 deletions content/adventures/cs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,9 @@ adventures:
example_code_2: |
```
{print} Slyší zvuk
zvirata {is} 🐿, 🦔, 🦇, 🦉
zvířata {is} 🐿, 🦔, 🦇, 🦉
zvire {is} {ask} Co si myslíš, že to je?
{add} zvire {to_list} zvirata
{add} zvire {to_list} zvířata
{print} to byla zvířata {at} {random}
```
story_text_3: |
Expand Down
2 changes: 1 addition & 1 deletion content/adventures/cy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ adventures:
story_text_2: "The command `{add}` can also come in handy in your story.\n"
story_text_3: "This is an example of the `{remove}` command in your story\n\n### Exercise\nCan you use the 3 new commands `{at} {random}` , `{add} {to}` and `{remove} {from}` in your own story?\n"
example_code: "```\nanimals {is} 🦔, 🐿, 🦉, 🦇\n{print} He now hears the sound of an animals {at} {random}\n```\n"
example_code_2: "```\n{print} He hears a sound\nanimals {is} 🐿, 🦔, 🦇, 🦉\nanimal {is} {ask} What do you think it is?\n{add} animal {to_list} animals\n{print} it was an animal {at} {random}\n```\n"
example_code_2: "```\n{print} He hears a sound\nanimals {is} 🐿, 🦔, 🦇, 🦉\nanimal {is} {ask} What do you think it is?\n{add} animal {to_list} animals\n{print} it was an animals {at} {random}\n```\n"
example_code_3: "```\n{print} His backpack got way too heavy.\n{print} Inside were a bottle of water, a flashlight and a brick.\nbag {is} water, flashlight, brick\ndump {is} {ask} Which item should he dump?\n{remove} dump {from} bag\n```\n"
start_code: '{print} Your story'
4:
Expand Down
2 changes: 1 addition & 1 deletion content/adventures/de.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ adventures:
Füge neue Zeilen Code zu deiner Geschichte hinzu, sodass alle neuen Befehle mindestens ein Mal in deiner Geschichte vorkommen.
example_code_3: |
```
{print} Sein Rucksack wurde viel zu schwer.
{print} Sein Ruck sack wurde viel zu schwer.
{print} Drinnen waren eine Flasche Wasser, eine Taschenlampe und ein Ziegelstein.
Rucksack {is} Wasser, Taschenlampe, Ziegelstein
rauswerfen {is} {ask} Welchen Gegenstand soll er rauswerfen?
Expand Down
2 changes: 1 addition & 1 deletion content/adventures/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ adventures:
animals {is} 🐿, 🦔, 🦇, 🦉
animal {is} {ask} What do you think it is?
{add} animal {to_list} animals
{print} it was an animal {at} {random}
{print} it was an animals {at} {random}
```
story_text_3: |
This is an example of the `{remove}` command in your story
Expand Down
2 changes: 1 addition & 1 deletion content/adventures/eo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ adventures:
story_text: "En ĉi tiu nivelo, vi lernos kiel facile peti (per `{ask}`) la mendojn de viaj gastoj en mallonga kodo.\n"
example_code: "```\npladoj = entreo, ĉefplado, deserto\n{for} plado {in} pladoj\n manĝaĵo = {ask} 'Kion vi volas manĝi por via ' plado '?'\n {print} manĝaĵo ' estos via ' plado\n```\n"
story_text_2: "\nKompreneble, vi ankaŭ povus mendi por pluraj homoj!\n"
example_code_2: "```\npladoj = entreo, ĉefplado, deserto\nnomoj = Timoteo, Omaro\n{for} nomo {in} nomoj\n {for} plado {in} pladoj\n manĝaĵo = {ask} nomo ', kion vi volas manĝi por via ' plado '?'\n {print} nomo ' mendas ' food 'n por sia ' plado\n```\n"
example_code_2: "```\npladoj = entreo, ĉefplado, deserto\nnomoj = Timoteo, Omaro\n{for} nomo {in} nomoj\n {for} plado {in} pladoj\n manĝaĵo = {ask} nomo ', kion vi volas manĝi por via ' plado '?'\n {print} nomo ' mendas ' manĝaĵo 'n por sia ' plado\n```\n"
start_code: pladoj = entreo, ĉefplado, deserto
11:
story_text: "Oni povas uzi `{for} i {in} {range} 1 {to} 5` por orde presi (kune kun `{print}`) la mendojn de pluraj klientoj.\n"
Expand Down
2 changes: 1 addition & 1 deletion content/adventures/es.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ adventures:
animales {is} 🐿, 🦔, 🦇, 🦉
animal {is} {ask} ¿Qué piensas qué es?
{add} animal {to_list} animales
{print} fue un animal {at} {random}
{print} fue un animales {at} {random}
```
story_text_3: |
Este es un ejemplo del comando `{remove}` en tu historia
Expand Down
2 changes: 1 addition & 1 deletion content/adventures/fi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ adventures:
story_text: "In level 3 you can make your story more fun. You can use randomness for any monster, animal or other obstacle, like this:\n"
example_code: "```\nanimals {is} 🦔, 🐿, 🦉, 🦇\n{print} He now hears the sound of an animals {at} {random}\n```\n"
story_text_2: "The command `{add}` can also come in handy in your story.\n"
example_code_2: "```\n{print} He hears a sound\nanimals {is} 🐿, 🦔, 🦇, 🦉\nanimal {is} {ask} What do you think it is?\n{add} animal {to_list} animals\n{print} it was an animal {at} {random}\n```\n"
example_code_2: "```\n{print} He hears a sound\nanimals {is} 🐿, 🦔, 🦇, 🦉\nanimal {is} {ask} What do you think it is?\n{add} animal {to_list} animals\n{print} it was an animals {at} {random}\n```\n"
story_text_3: "This is an example of the `{remove}` command in your story\n\n### Exercise\nCan you use the 3 new commands `{at} {random}` , `{add} {to}` and `{remove} {from}` in your own story?\n"
example_code_3: "```\n{print} His backpack got way too heavy.\n{print} Inside were a bottle of water, a flashlight and a brick.\nbag {is} water, flashlight, brick\ndump {is} {ask} Which item should he dump?\n{remove} dump {from} bag\n```\n"
15:
Expand Down
4 changes: 2 additions & 2 deletions content/adventures/fr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ adventures:
```
{print} Son sac à dos est beaucoup trop lourd.
{print} Il y a dedans une bouteille d'eau, une lampe torche et une brique.
sac {is} eau, torche, brique
sac_à_dos {is} eau, torche, brique
jeté {is} {ask} Quel objet devrions-nous jeter ?
{remove} jeté {from} sac
{remove} jeté {from} sac_à_dos
```
start_code: "{print} Ton histoire"
4:
Expand Down
8 changes: 4 additions & 4 deletions content/adventures/hi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -276,16 +276,16 @@ adventures:
example_code_2: |-
```
{print} वह एक आवाज सुनता है
जानवरों {is}🐿, 🦔, 🦇, 🦉
जानवर {is} {ask} आपको क्या लगता है कि यह क्या है?
{add} जानवर {to_list} जानवरों
जानवरों {is} 🐿, 🦔, 🦇, 🦉
जानवर_extra {is} {ask} आपको क्या लगता है कि यह क्या है?
{add} जानवर_extra {to_list} जानवरों
{print} यह एक था जानवरों {at} {random}
```
story_text_3: |-
यह आपकी कहानी में `{remove}` आदेश का एक उदाहरण है
example_code_3: |
```
{print} उनका बैग बहुत भारी हो गया था।
{print} उनका बै ग बहुत भारी हो गया था।
{print} अंदर पानी की एक बोतल, एक टॉर्च और एक ईंट थी।
बैग {is} पानी, टॉर्च, ईंट
डंप {is} {ask} उसे कौन सी वस्तु गिराना चाहिए?
Expand Down
2 changes: 1 addition & 1 deletion content/adventures/kmr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ adventures:
story_text: "In level 3 you can make your story more fun. You can use randomness for any monster, animal or other obstacle, like this:\n"
example_code: "```\nanimals {is} 🦔, 🐿, 🦉, 🦇\n{print} He now hears the sound of an animals {at} {random}\n```\n"
story_text_2: "The command `{add}` can also come in handy in your story.\n"
example_code_2: "```\n{print} He hears a sound\nanimals {is} 🐿, 🦔, 🦇, 🦉\nanimal {is} {ask} What do you think it is?\n{add} animal {to_list} animals\n{print} it was an animal {at} {random}\n```\n"
example_code_2: "```\n{print} He hears a sound\nanimals {is} 🐿, 🦔, 🦇, 🦉\nanimal {is} {ask} What do you think it is?\n{add} animal {to_list} animals\n{print} it was an animals {at} {random}\n```\n"
story_text_3: "This is an example of the `{remove}` command in your story\n\n### Exercise\nCopy your story from the previous levels into this level.\nIn this level you've learned 3 new commands `{at} {random}` , `{add} {to}` and `{remove} {from}`.\nAdd new lines of code to your story, so that all of the new commands are featured at least once in your story.\n"
example_code_3: "```\n{print} His backpack got way too heavy.\n{print} Inside were a bottle of water, a flashlight and a brick.\nbag {is} water, flashlight, brick\ndump {is} {ask} Which item should he dump?\n{remove} dump {from} bag\n```\n"
start_code: '{print} Your story'
Expand Down
4 changes: 2 additions & 2 deletions content/adventures/ko.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ adventures:
story_text_2: "### 연습문제\nThe calculator above will calculate the answer for you, but you can also make a program to test your own maths skills, like this:\nFill in the blanks to make it complete!\n"
example_code_2: "```\ncorrect_answer = 11 * 27\nanswer = {ask} 'How much is 11 times 27?'\n{if} answer {is} _ {print} 'good job!'\n{else} {print} 'Wrong! It was ' _\n```\n"
start_code: "{print} 'Welcome to this calculator!'"
story_text_3: "\n **Extra** You can also let the computer do random sums on its own using random.\n\n This is how you choose a number of tables to practice, and from that you always get a different sum:\n"
story_text_3: "\n**Extra** You can also let the computer do random sums on its own using random.\n\n This is how you choose a number of tables to practice, and from that you always get a different sum:\n"
9:
story_text: "In level 6 you created a calculator, in this level you can expand that code so it asks multiple questions.\n\n### 연습문제 1\nCan you finish line 10 to make to program work?\n\n### 연습문제 2\nGive the player feedback when the enter a right or wrong answer. To achieve that, expand your program with an `{else}`.\n"
example_code: "```\nscore = 0\n{repeat} 10 {times}\n numbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\n number1 = numbers {at} {random}\n number2 = numbers {at} {random}\n correct_answer = number1 * number2\n {print} 'What is ' number1 ' times ' number2 '?'\n answer = {ask} 'Type your answer here...'\n {print} 'Your answer is' answer\n {if} _ {is} _\n score = score + 1\n{print} 'Great job! Your score is... ' score ' out of 10!'\n```\n"
Expand Down Expand Up @@ -621,7 +621,7 @@ adventures:
6:
story_text: "You can also make an Earthworm die again in this, but now you can also calculate how many points have been rolled.\nYou may know that the worm counts 5 points for Earthworms. Now after a roll you can immediately calculate how many points you have thrown.\nThis is the code to calculate points for one die:\n\n### 연습문제\nCan you make the code so that you get the total score for 8 dice? To do that, you have to cut and paste some lines of the code.\n"
example_code: "```\nchoices = 1, 2, 3, 4, 5, earthworm\npoints = 0\nthrow = choices {at} {random}\n{print} 'you threw ' throw\n{if} throw {is} earthworm points = points + 5 {else} points = points + throw\n{print} 'those are ' points ' points'\n```\n"
example_code_2: "\n Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7!\n"
example_code_2: "\nDid you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7!\n"
start_code: "{print} 'What will the die indicate this time?'"
7:
story_text: "You can also make a dice again in this level. With the `{repeat}` code you can easily roll a whole hand of dice.\n\n### 연습문제\nTry to finish the sample code! **Extra** Think of a game you know that involves a dice and program that using a `{repeat}`.\n"
Expand Down
Loading

0 comments on commit 3feaa9f

Please sign in to comment.