Skip to content

Commit 18c7d33

Browse files
authored
Merge pull request #200 from Kirwiisp/master
French translation: correct error and add shortcut
2 parents 5b7c475 + 4cfcf86 commit 18c7d33

File tree

3 files changed

+5
-51
lines changed

3 files changed

+5
-51
lines changed

translations/fr/try_ruby_280.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ Desormais, nous allons compter tes critiques. Reste avec moi. Écris :
1919

2020
puts notations
2121

22-
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.
22+
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.
2323

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

26-
Ne t'inquiète pas si tu ne comprends pas tout ce qui se passe ici. Tout sera expliqué plus tard.
26+
Ne t'inquiète pas si tu ne comprends pas tout ce qui se passe ici. Tout sera expliqué plus tard.

translations/fr/try_ruby_390.md

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -7,52 +7,6 @@ error:
77
load: prev
88
---
99

10-
Okay we now have a list of plays from the internet. The list was in the json format.
11-
Fortunately for us Ruby kindly provides a method to convert json data to a Ruby hash.
12-
The _get\_shakey_ method already did that for us.
13-
14-
But since the structure of the json data is retained in the hash, it is still a bit difficult to read.
15-
Let us write a method to display the plays nicely.
16-
17-
If you inspect the list of plays carefully you will see that it has a kind of nested
18-
structure. (This is actually quite common in data you get from the internet.)
19-
Looks like this:
20-
21-
<ul>
22-
<li>"William Shakespeare"
23-
<ul>
24-
<li>"1"
25-
<ul>
26-
<li>"title": "The Two Gentlemen of Verona"</li>
27-
<li>"finished": 1591</li>
28-
</ul>
29-
</li>
30-
<li>"2"
31-
<ul>
32-
<li>"title": "The Taming of the Shrew"</li>
33-
<li>"finished": 1591</li>
34-
</ul>
35-
</li>
36-
<li>...</li>
37-
</ul>
38-
</li>
39-
</ul>
40-
41-
To list the plays we first have to access the top "William Shakespeare" hash element by its name.
42-
Next we have to __iterate__ through each element below it.
43-
44-
Ruby has a method for iterating. It is called __each__. We have seen it before when
45-
creating our book rating system.
46-
47-
Everything that method __each__ returns is passed to a block:
48-
49-
s = get_shakey
50-
51-
s["William Shakespeare"].each { |key, val|
52-
puts val["title"]
53-
}
54-
55-
5610
Bien, maintenant nous avons une liste de pièces de théâtre provenant d'Internet. La liste est au format json.
5711
Heureusement pour nous, Ruby fournit gentiment une méthode pour convertir les données json en un hash Ruby.
5812
La méthode _get\_shakey_ l'a déjà fait pour nous.
@@ -96,4 +50,4 @@ Tout ce que la méthode __each__ retourne est passé à un bloc :
9650

9751
s["William Shakespeare"].each { |key, val|
9852
puts val["title"]
99-
}
53+
}

translations/fr/try_ruby_460.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Tu viens juste d'avoir une idée brillante pour une nouvelle application.
1616
Ce sera __LA__ prochaine plateforme de messagerie instantanée.
1717
Tu veux une application où les gens peuvent s'envoyer des messages courts.
1818
Tu appelles ces messages Blurbs<sup>TM</sup>. Un Blurb<sup>TM</sup> a une longueur maximale de seulement 40 caractères.
19-
Ajoutons également definir son humeur (__mood__).
19+
Ajoutons également la possibilité de définir son humeur (__mood__).
2020

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

3232
class Blurb
33-
end
33+
end

0 commit comments

Comments
 (0)