Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Felienne/hedy into weblate_5187
Browse files Browse the repository at this point in the history
  • Loading branch information
boryanagoncharenko committed Oct 21, 2024
2 parents f01f244 + 8021cc8 commit 2097695
Show file tree
Hide file tree
Showing 15 changed files with 745 additions and 173 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deploy-to-alpha.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Automatically deploy to Alpha
on:
workflow_dispatch: {}

# Run this AFTER the unit test job finishes
workflow_run:
# Must be the same as in unittests.yml, cypresstests.yml
Expand Down
7 changes: 6 additions & 1 deletion .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ queue_rules:
commit_message_template: |-
{{ title }} (#{{number}})
{{ body }}
{# Add co-author information at the end of the squash merge commit message #}
{% for co_author in co_authors | unique %}
Co-Authored-By: {{ co_author.name }} <{{ co_author.email }}>
{% endfor %}
{# `Co-Authored-By` lines must the be last ones for GitHub to recognize them #}
pull_request_rules:
- name: Automatic squash merge on approval
Expand All @@ -21,4 +26,4 @@ pull_request_rules:
comment:
message: 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](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork)).
queue:
name: default_queue
name: default_queue
7 changes: 5 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1882,12 +1882,15 @@ def view_program(user, id):
result['username']) else None

code = result['code']
if result.get("lang") != "en" and result.get("lang") in ALL_KEYWORD_LANGUAGES.keys():
# if the snippet has blanks, it'll fail in the translation process
# so we just dont translate it if it has any
has_blanks = hedy.location_of_first_blank(code) > 0
if not has_blanks and result.get("lang") != "en" and result.get("lang") in ALL_KEYWORD_LANGUAGES.keys():
code = hedy_translation.translate_keywords(code, from_lang=result.get(
'lang'), to_lang="en", level=int(result.get('level', 1)))
# If the keyword language is non-English -> parse again to guarantee
# completely localized keywords
if g.keyword_lang != "en":
if not has_blanks and g.keyword_lang != "en":
code = hedy_translation.translate_keywords(
code,
from_lang="en",
Expand Down
44 changes: 27 additions & 17 deletions content/adventures/ca.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1841,15 +1841,26 @@ adventures:
```
5:
story_text: |
In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller!
By using `{if}` and `{else}` you can make sure that you will always get a good fotune, while other people might not.
Check out this example to find out how.
### Exercici
En aquest codi d'exemple veuràs com fer un programa endeví que et permeti inclinar les possibilitats a favor teu. Aquest programa que fa trames sempre et diu que guanyaràs la loteria, però els teus amics mai guanyaran.
Usa això per fer el teu propi programa, sigues creatiu! Per exemple, pots crear un codi que predigui que:
* el teu equip esportiu preferit guanyarà a tots els seus contrincants!
* s'elegirà la teva pel·lícula preferida com a pel·lícula de la nit!
* guanyaràs entrades pel teu espectacle preferit!
* ets el més bonic/a de tots/es, com el mirall màgic de la Blancaneu.
Deixa que la teva imaginació faci el treball!
El teu programa ha de tenir almenys 10 línies de codi i ha de contenir com a mínim una comanda '{if}' i '{else}'.
example_code: |
```
{print} 'Im Hedy the fortune teller!'
{print} 'I can predict if youll win the lottery tomorrow!'
friends {is} Jordan, Lucy, Dave
{print} 'I can predict if you will win the lottery tomorrow!'
person {is} {ask} 'Who are you?'
{if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone else will win!😭'
good_answer {is} Hurray! You win!, You will definitely win!, We have a winner!
bad_answer {is} Bad luck! Try again!, Another person will win, You lose!
{if} person {in} friends {print} good_answer {at} {random}
{else} {print} bad_answer {at} {random}
```
6:
story_text: |
Expand Down Expand Up @@ -1887,23 +1898,22 @@ adventures:
```
7:
story_text: |
In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once.
### Exercici
Finalitza aquest programa que et diu si el teu enamorat t'estima o no.
example_code: |
```
{print} 'Im Hedy the fortune teller!'
{print} 'You can ask 3 questions!'
{repeat} 3 {times} question = {ask} 'What do you want to know?'
answer = yes, no, maybe
{repeat} 3 {times} {print} 'My crystal ball says... ' answer {at} {random}
{print} 'Tinc una flor amb pètals màgics'
{print} "Si agafes els pètals de la flor, et dirà si el teu amor també t'estima"
quantitat = {ask} 'Quants pètals vols agafar?'
options = t'estima, no t'estima
_ _ _ _ options {at} {random}
```
8:
story_text: |
In the previous levels you've learned how to use `{repeat}` to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions.
Now that problem is solved, because of the new way of using the `{repeat}` command.
In the next example you can have your fortune teller ask 3 questions and also print them!
En el pròxim exemple pots fre que l'endeví et faci diverses preguntes i també que les imprimeixi!
### Exercise
Can you fill in the `{repeat}` command correctly on the blanks?
### Exercici
Pots posar les comandes correctes als forats en blanc?
example_code: |
```
{print} 'I am Hedy the fortune teller!'
Expand Down
Loading

0 comments on commit 2097695

Please sign in to comment.