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

French translation: correct error and add shortcut #200

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions translations/fr/try_ruby_280.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ Desormais, nous allons compter tes critiques. Reste avec moi. Écris :

puts notations

La trait droite dans le code est le caractère pipe (|), probablement situé juste au-dessus de la touche 'T' OU 'Y' d'un clavier Windows Français.
Le trait droit dans le code correspond au caractère "pipe" (|), probablement situé juste au-dessus de la touche 'T' OU 'Y' d'un clavier Windows Français, ou "Option+Maj+L" sur MacOS.

Le _+= 1_ signifie : augmenter la valeur de 1.

Ne t'inquiète pas si tu ne comprends pas tout ce qui se passe ici. Tout sera expliqué plus tard.
Ne t'inquiète pas si tu ne comprends pas tout ce qui se passe ici. Tout sera expliqué plus tard.
48 changes: 1 addition & 47 deletions translations/fr/try_ruby_390.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,6 @@ error:
load: prev
---

Okay we now have a list of plays from the internet. The list was in the json format.
Fortunately for us Ruby kindly provides a method to convert json data to a Ruby hash.
The _get\_shakey_ method already did that for us.

But since the structure of the json data is retained in the hash, it is still a bit difficult to read.
Let us write a method to display the plays nicely.

If you inspect the list of plays carefully you will see that it has a kind of nested
structure. (This is actually quite common in data you get from the internet.)
Looks like this:

<ul>
<li>"William Shakespeare"
<ul>
<li>"1"
<ul>
<li>"title": "The Two Gentlemen of Verona"</li>
<li>"finished": 1591</li>
</ul>
</li>
<li>"2"
<ul>
<li>"title": "The Taming of the Shrew"</li>
<li>"finished": 1591</li>
</ul>
</li>
<li>...</li>
</ul>
</li>
</ul>

To list the plays we first have to access the top "William Shakespeare" hash element by its name.
Next we have to __iterate__ through each element below it.

Ruby has a method for iterating. It is called __each__. We have seen it before when
creating our book rating system.

Everything that method __each__ returns is passed to a block:

s = get_shakey

s["William Shakespeare"].each { |key, val|
puts val["title"]
}


Bien, maintenant nous avons une liste de pièces de théâtre provenant d'Internet. La liste est au format json.
Heureusement pour nous, Ruby fournit gentiment une méthode pour convertir les données json en un hash Ruby.
La méthode _get\_shakey_ l'a déjà fait pour nous.
Expand Down Expand Up @@ -96,4 +50,4 @@ Tout ce que la méthode __each__ retourne est passé à un bloc :

s["William Shakespeare"].each { |key, val|
puts val["title"]
}
}
4 changes: 2 additions & 2 deletions translations/fr/try_ruby_460.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Tu viens juste d'avoir une idée brillante pour une nouvelle application.
Ce sera __LA__ prochaine plateforme de messagerie instantanée.
Tu veux une application où les gens peuvent s'envoyer des messages courts.
Tu appelles ces messages Blurbs<sup>TM</sup>. Un Blurb<sup>TM</sup> a une longueur maximale de seulement 40 caractères.
Ajoutons également definir son humeur (__mood__).
Ajoutons également la possibilité de définir son humeur (__mood__).

### Par où commencer
Eh bien, tu pourrais stocker tes entrées Blurbs<sup>TM</sup> dans un fichier json, n'est-ce pas ?
Expand All @@ -30,4 +30,4 @@ Tu es déjà familier avec de nombreuses classes : Hash, Array, String.
Créons une nouvelle classe (ne renvoie aucune sortie) :

class Blurb
end
end