From bd354eabd30257887ffd9b1291eb6e2373d133dc Mon Sep 17 00:00:00 2001 From: thib92 Date: Mon, 11 Feb 2019 16:42:57 +0100 Subject: [PATCH 1/4] Translate Lists and Keys page to French --- content/docs/lists-and-keys.md | 96 +++++++++++++++++----------------- 1 file changed, 49 insertions(+), 47 deletions(-) diff --git a/content/docs/lists-and-keys.md b/content/docs/lists-and-keys.md index c82739a6a..8851bf321 100644 --- a/content/docs/lists-and-keys.md +++ b/content/docs/lists-and-keys.md @@ -1,14 +1,14 @@ --- id: lists-and-keys -title: Lists and Keys +title: Listes et Clés permalink: docs/lists-and-keys.html prev: conditional-rendering.html next: forms.html --- -First, let's review how you transform lists in JavaScript. +Tout d'abord, voyons comment transformer des listes en JavaScript. -Given the code below, we use the [`map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) function to take an array of `numbers` and double their values. We assign the new array returned by `map()` to the variable `doubled` and log it: +Avec le code suivant, on utilise la méthode [`map()`](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Array/map) pour prendre un tableau de nombres et doubler leurs valeurs. On assigne le nouveau tableau retourné par `map()` à une variable `doubled` et on l'affiche à la console : ```javascript{2} const numbers = [1, 2, 3, 4, 5]; @@ -16,15 +16,16 @@ const doubled = numbers.map((number) => number * 2); console.log(doubled); ``` -This code logs `[2, 4, 6, 8, 10]` to the console. +Ce code affiche `[2, 4, 6, 8, 10]` à la console. -In React, transforming arrays into lists of [elements](/docs/rendering-elements.html) is nearly identical. +Avec React, transformer un tableau en une liste d'[éléments](/docs/rendering-elements.html) est presque identique. -### Rendering Multiple Components {#rendering-multiple-components} +### Afficher Plusieurs Composants {#rendering-multiple-components} -You can build collections of elements and [include them in JSX](/docs/introducing-jsx.html#embedding-expressions-in-jsx) using curly braces `{}`. +On peut construire des collections d'éléments et [les inclure dans du JSX](/docs/introducing-jsx.html#embedding-expressions-in-jsx) en utilisant les accolades `{}`. -Below, we loop through the `numbers` array using the JavaScript [`map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) function. We return a `
  • ` element for each item. Finally, we assign the resulting array of elements to `listItems`: +Ci-dessous, on itère sur le tableau de nombres en utilisant la méthode JavaScript [`map()`](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Array/map). On retourne un élément `
  • ` pour chaque entrée du tableau. +Enfin, on assigne le tableau d'éléments résultant à `listItems` : ```javascript{2-4} const numbers = [1, 2, 3, 4, 5]; @@ -33,7 +34,7 @@ const listItems = numbers.map((number) => ); ``` -We include the entire `listItems` array inside a `