From 8f7e23625636218c8cefcddd04db0ed3777d24cd Mon Sep 17 00:00:00 2001 From: Alessio Minichiello Date: Mon, 25 Feb 2019 09:21:12 +0000 Subject: [PATCH 1/9] Translation of the page "List and Keys" --- GLOSSARY.md | 2 + content/docs/lists-and-keys.md | 252 ++++++++++++++++----------------- content/docs/nav.yml | 2 +- 3 files changed, 129 insertions(+), 127 deletions(-) diff --git a/GLOSSARY.md b/GLOSSARY.md index ca3904903..0fec9d68b 100644 --- a/GLOSSARY.md +++ b/GLOSSARY.md @@ -18,6 +18,8 @@ Glossary of the translations of technical and React-specific terms. - tag - lifecycle - callback +- console +- warning # Common Translations diff --git a/content/docs/lists-and-keys.md b/content/docs/lists-and-keys.md index f34e9e5d6..f3d37734b 100644 --- a/content/docs/lists-and-keys.md +++ b/content/docs/lists-and-keys.md @@ -1,301 +1,301 @@ --- id: lists-and-keys -title: Lists and Keys +title: Liste e Chiavi permalink: docs/lists-and-keys.html prev: conditional-rendering.html next: forms.html --- -First, let's review how you transform lists in JavaScript. +Prima di iniziare, rivediamo come trasformare le liste in 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: +Nel codice qui sotto, usiamo la funzione [`map()`](https://developer.mozilla.org/it/docs/Web/JavaScript/Reference/Global_Objects/Array/map) per prendere un array di `numeri` e raddoppiare i loro valori. Assegniamo il nuovo array restituito da `map()` alla variabile `lista` e lo stampiamo a console: ```javascript{2} -const numbers = [1, 2, 3, 4, 5]; -const doubled = numbers.map((number) => number * 2); -console.log(doubled); +const numeri = [1, 2, 3, 4, 5]; +const lista = numeri.map((numero) => numero * 2); +console.log(lista); ``` -This code logs `[2, 4, 6, 8, 10]` to the console. +Questo codice mostra `[2, 4, 6, 8, 10]` nella console. -In React, transforming arrays into lists of [elements](/docs/rendering-elements.html) is nearly identical. +Trasformare array in liste di [elementi](/docs/rendering-elements.html) con React è quasi identico. -### Rendering Multiple Components {#rendering-multiple-components} +### Renderizzare Liste di Componenti {#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 `{}`. +Puoi creare liste di elementi e [usarle in JSX](/docs/introducing-jsx.html#embedding-expressions-in-jsx) usando le parentesi graffe `{}`. -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`: +Di seguito, eseguiamo un ciclo sull'array `numeri` usando la funzione JavaScript [`map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map). Ritorniamo un elemento `
  • ` per ogni elemento dell'array. Infine, assegniamo l'array risultante a `lista`: ```javascript{2-4} -const numbers = [1, 2, 3, 4, 5]; -const listItems = numbers.map((number) => -
  • {number}
  • +const numeri = [1, 2, 3, 4, 5]; +const lista = numeri.map((numero) => +
  • {numero}
  • ); ``` -We include the entire `listItems` array inside a `