From 9942b595faabb44f0726db94602a2ddb19c9eb64 Mon Sep 17 00:00:00 2001 From: camperbot Date: Sun, 27 Jun 2021 23:51:13 +0530 Subject: [PATCH] chore(i18n,curriculum): update translations (#42649) --- .../react/add-event-listeners.md | 18 ++--- .../react/create-a-controlled-form.md | 41 ++++++++--- .../build-a-personal-portfolio-webpage.md | 4 +- .../build-a-product-landing-page.md | 4 +- .../build-a-survey-form.md | 4 +- .../build-a-technical-documentation-page.md | 4 +- .../build-a-tribute-page.md | 4 +- .../build-a-25-5-clock.md | 68 +++++++++---------- .../build-a-drum-machine.md | 26 +++---- .../build-a-javascript-calculator.md | 50 +++++++------- .../build-a-markdown-previewer.md | 26 +++---- .../build-a-random-quote-machine.md | 36 +++++----- ...sibling-elements-a-unique-key-attribute.md | 22 +++--- .../react/introducing-inline-styles.md | 22 +++--- .../learn-about-self-closing-jsx-tags.md | 20 +++--- ...e-re-renders-with-shouldcomponentupdate.md | 16 ++--- .../react/override-default-props.md | 14 ++-- .../react/pass-a-callback-as-props.md | 18 ++--- .../react/pass-an-array-as-props.md | 22 +++--- ...ops-to-a-stateless-functional-component.md | 22 +++--- ...pass-state-as-props-to-child-components.md | 16 ++--- .../render-a-class-component-to-the-dom.md | 18 ++--- .../react/render-conditionally-from-props.md | 26 +++---- .../react/render-html-elements-to-the-dom.md | 18 ++--- ...react-on-the-server-with-rendertostring.md | 10 +-- ...state-in-the-user-interface-another-way.md | 16 ++--- .../render-state-in-the-user-interface.md | 20 +++--- .../react/render-with-an-if-else-condition.md | 16 ++--- ...ps-with-stateless-functional-components.md | 20 +++--- .../react/set-state-with-this.setstate.md | 18 ++--- .../use--for-a-more-concise-conditional.md | 14 ++-- ...ry-expression-for-conditional-rendering.md | 22 +++--- ...anced-javascript-in-react-render-method.md | 20 +++--- ...y.filter-to-dynamically-filter-an-array.md | 16 ++--- .../add-a-negative-margin-to-an-element.md | 12 ++-- .../add-borders-around-your-elements.md | 20 +++--- ...rent-margins-to-each-side-of-an-element.md | 16 ++--- ...rent-padding-to-each-side-of-an-element.md | 16 ++--- .../add-rounded-corners-with-border-radius.md | 12 ++-- .../adjust-the-margin-of-an-element.md | 12 ++-- .../adjust-the-padding-of-an-element.md | 18 ++--- ...tach-a-fallback-value-to-a-css-variable.md | 16 ++--- .../change-a-variable-for-a-specific-area.md | 14 ++-- .../basic-css/change-the-color-of-text.md | 20 +++--- .../change-the-font-size-of-an-element.md | 8 +-- .../basic-css/create-a-custom-css-variable.md | 10 +-- ...ive-a-background-color-to-a-div-element.md | 14 ++-- .../basic-css/import-a-google-font.md | 26 +++---- ...ve-compatibility-with-browser-fallbacks.md | 12 ++-- .../basic-css/inherit-css-variables.md | 12 ++-- .../inherit-styles-from-the-body-element.md | 26 +++---- ...ke-circular-images-with-a-border-radius.md | 10 +-- ...ide-all-other-styles-by-using-important.md | 26 +++---- ...s-declarations-by-styling-id-attributes.md | 30 ++++---- ...e-class-declarations-with-inline-styles.md | 20 +++--- .../override-styles-in-subsequent-css.md | 24 +++---- .../prioritize-one-style-over-another.md | 18 ++--- .../set-the-font-family-of-an-element.md | 16 ++--- .../basic-css/set-the-id-of-an-element.md | 20 +++--- .../basic-css/size-your-images.md | 18 ++--- .../basic-css/use-abbreviated-hex-code.md | 28 ++++---- ...use-an-id-attribute-to-style-an-element.md | 26 +++---- .../use-css-selectors-to-style-elements.md | 26 +++---- .../use-hex-code-for-specific-colors.md | 14 ++-- .../basic-css/use-rgb-to-mix-colors.md | 24 +++---- 65 files changed, 637 insertions(+), 618 deletions(-) diff --git a/curriculum/challenges/espanol/03-front-end-libraries/react/add-event-listeners.md b/curriculum/challenges/espanol/03-front-end-libraries/react/add-event-listeners.md index b1f8942c41..cf816bf8c6 100644 --- a/curriculum/challenges/espanol/03-front-end-libraries/react/add-event-listeners.md +++ b/curriculum/challenges/espanol/03-front-end-libraries/react/add-event-listeners.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d403617e -title: Add Event Listeners +title: Agrega detector de eventos (Event Listeners) challengeType: 6 forumTopicId: 301377 dashedName: add-event-listeners @@ -8,19 +8,19 @@ dashedName: add-event-listeners # --description-- -The `componentDidMount()` method is also the best place to attach any event listeners you need to add for specific functionality. React provides a synthetic event system which wraps the native event system present in browsers. This means that the synthetic event system behaves exactly the same regardless of the user's browser - even if the native events may behave differently between different browsers. +El método `componentDidMount()` es también el mejor lugar para adjuntar cualquier detector de eventos que necesites agregar para una funcionalidad específica. React proporciona un sistema de eventos sintético que envuelve el sistema de eventos nativo presente en los navegadores. Esto significa que el sistema de eventos sintético se comporta exactamente igual independientemente del navegador del usuario, incluso si los eventos nativos se comportan diferentes entre diferentes navegadores. -You've already been using some of these synthetic event handlers such as `onClick()`. React's synthetic event system is great to use for most interactions you'll manage on DOM elements. However, if you want to attach an event handler to the document or window objects, you have to do this directly. +Ya has estado usando algunos de estos controladores de eventos sintéticos como `onClick()`. El sistema de eventos sintéticos de React es excelente para usar en la mayoría de las interacciones que administrarás en elementos DOM. Sin embargo, si quieres adjuntar un controlador de eventos al documento o objetos de la ventana, debes hacerlo directamente. # --instructions-- -Attach an event listener in the `componentDidMount()` method for `keydown` events and have these events trigger the callback `handleKeyPress()`. You can use `document.addEventListener()` which takes the event (in quotes) as the first argument and the callback as the second argument. +Agrega un detector de eventos en el método `componentDidMount()` para los eventos `keydown` y haz que estos eventos ejecuten el callback `handleKeyPress()`. Puedes usar `document.addEventListener()` el cual toma el evento (en comillas) como primer argumento y el callback como segundo argumento. -Then, in `componentWillUnmount()`, remove this same event listener. You can pass the same arguments to `document.removeEventListener()`. It's good practice to use this lifecycle method to do any clean up on React components before they are unmounted and destroyed. Removing event listeners is an example of one such clean up action. +Posteriormente, en `componentWillUnmount()`, remueve este mismo detector de eventos. Puedes pasar los mismos argumentos al `document.removeEventListener()`. Es buena práctica usar este método del ciclo de vida para hacer cualquier limpieza en un componente de React antes de que estos sean desmontados y destruidos. Removiendo los detectores de eventos es un ejemplo de una limpieza de este tipo. # --hints-- -`MyComponent` should render a `div` element which wraps an `h1` tag. +`MyComponent` debe mostrar un elemento `div` el cual envuelva una etiqueta `h1`. ```js assert( @@ -31,7 +31,7 @@ assert( ); ``` -A keydown listener should be attached to the document in `componentDidMount`. +Un detector `keydown` debe ser agregado al documento en `componentDidMount`. ```js assert( @@ -47,7 +47,7 @@ assert( ); ``` -The keydown listener should be removed from the document in `componentWillUnmount`. +Un detector `keydown` debe ser removido del documento en `componentWillUnmount`. ```js assert( @@ -63,7 +63,7 @@ assert( ); ``` -Once the component has mounted, pressing `enter` should update its state and the rendered `h1` tag. +Una vez que el componente se ha montado, pulsando `enter` debe actualizar el estado y renderizar la etiqueta `h1`. ```js async () => { diff --git a/curriculum/challenges/espanol/03-front-end-libraries/react/create-a-controlled-form.md b/curriculum/challenges/espanol/03-front-end-libraries/react/create-a-controlled-form.md index e488d2d26b..e89c966297 100644 --- a/curriculum/challenges/espanol/03-front-end-libraries/react/create-a-controlled-form.md +++ b/curriculum/challenges/espanol/03-front-end-libraries/react/create-a-controlled-form.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d4036179 -title: Create a Controlled Form +title: Crea un formulario controlado challengeType: 6 forumTopicId: 301384 dashedName: create-a-controlled-form @@ -8,21 +8,21 @@ dashedName: create-a-controlled-form # --description-- -The last challenge showed that React can control the internal state for certain elements like `input` and `textarea`, which makes them controlled components. This applies to other form elements as well, including the regular HTML `form` element. +El último desafío mostró que React puede controlar el estado interno de ciertos elementos como `input` y `textarea`, lo que los hace componentes controlados. Esto también se aplica a otros elementos del formulario, incluyendo el elemento regular HTML `form`. # --instructions-- -The `MyForm` component is set up with an empty `form` with a submit handler. The submit handler will be called when the form is submitted. +El componente `MyForm` está configurado con un `form` vacío, con un manejador de envío. El manejador de envío será llamado cuando se envíe el formulario. -We've added a button which submits the form. You can see it has the `type` set to `submit` indicating it is the button controlling the form. Add the `input` element in the `form` and set its `value` and `onChange()` attributes like the last challenge. You should then complete the `handleSubmit` method so that it sets the component state property `submit` to the current input value in the local `state`. +Hemos añadido un botón que envía el formulario. Puedes ver que tiene el `type` establecido en `submit` indicando que es el botón que controla el formulario. Añade el elemento `input` en el formulario `form` y establece sus atributos `value` y `onChange()` como el último desafío. A continuación, debes completar el método `handleSubmit` para que establezca la propiedad de estado del componente `submit` al valor de entrada actual en el `state` local. -**Note:** You also must call `event.preventDefault()` in the submit handler, to prevent the default form submit behavior which will refresh the web page. +**Nota:** También debes llamar a `event.preventDefault()` en el controlador de envío, para evitar el comportamiento predeterminado de envío de formulario que actualizará la página web. Para la comodidad de los campistas, el comportamiento predeterminado se ha desactivado aquí para evitar que las actualizaciones restablezcan el código de desafío. -Finally, create an `h1` tag after the `form` which renders the `submit` value from the component's `state`. You can then type in the form and click the button (or press enter), and you should see your input rendered to the page. +Por último, crea una etiqueta `h1` después del `form` que renderiza el valor de `submit` del `state` del componente. A continuación, puedes escribir en el formulario y hacer clic en el botón (o pulsar intro), y deberías ver tu entrada renderizada en la página. # --hints-- -`MyForm` should return a `div` element which contains a `form` and an `h1` tag. The form should include an `input` and a `button`. +`MyForm` debe retornar un elemento `div` que contiene un `form` y una etiqueta `h1`. El formulario debe incluir un `input` y un `button`. ```js assert( @@ -38,7 +38,7 @@ assert( ); ``` -The state of `MyForm` should initialize with `input` and `submit` properties, both set to empty strings. +El estado de `MyForm` debe inicializar con propiedades `input` y `submit`, ambos establecidos a cadenas vacías. ```js assert( @@ -47,7 +47,7 @@ assert( ); ``` -Typing in the `input` element should update the `input` property of the component's state. +Escribir en el elemento `input` debe actualizar la propiedad `input` del estado del componente. ```js (() => { @@ -75,7 +75,7 @@ Typing in the `input` element should update the `input` property of the componen })(); ``` -Submitting the form should run `handleSubmit` which should set the `submit` property in state equal to the current input. +El envío del formulario debe ejecutar `handleSubmit`, el cual debe establecer la propiedad `submit` en estado igual a la entrada actual. ```js (() => { @@ -98,7 +98,26 @@ Submitting the form should run `handleSubmit` which should set the `submit` prop })(); ``` -The `h1` header should render the value of the `submit` field from the component's state. +`handleSubmit` debe llamar a `event.preventDefault` + +```js +const handleSubmit = MyForm.prototype.handleSubmit.toString(); +const allMatches = handleSubmit.match(/\bevent\.preventDefault\(\s*?\)/g) ?? []; +const blockCommented = handleSubmit.match( + /\/\*.*?\bevent\.preventDefault\(\s*?\).*?\*\//gs +); +const lineCommented = handleSubmit.match( + /\/\/.*?\bevent\.preventDefault\(\s*?\)/g +); +const commentedMatches = [...(blockCommented ?? []), ...(lineCommented ?? [])]; + +assert( + // At least one event.preventDefault() call exists and is not commented out + allMatches.length > commentedMatches.length +); +``` + +El encabezado `h1` debe renderizar el valor del campo `submit` del estado del componente. ```js (() => { diff --git a/curriculum/challenges/italian/01-responsive-web-design/responsive-web-design-projects/build-a-personal-portfolio-webpage.md b/curriculum/challenges/italian/01-responsive-web-design/responsive-web-design-projects/build-a-personal-portfolio-webpage.md index d70b79144b..ef918d8136 100644 --- a/curriculum/challenges/italian/01-responsive-web-design/responsive-web-design-projects/build-a-personal-portfolio-webpage.md +++ b/curriculum/challenges/italian/01-responsive-web-design/responsive-web-design-projects/build-a-personal-portfolio-webpage.md @@ -10,7 +10,7 @@ dashedName: build-a-personal-portfolio-webpage **Obiettivo:** Costruire un'app [CodePen.io](https://codepen.io) funzionalmente simile a questa: . -Compila le [user stories](https://en.wikipedia.org/wiki/User_story) e ottieni tutti i test da passare. Dalle il tuo stile personale. +Compila le [user stories](https://en.wikipedia.org/wiki/User_story) qui sotto e fai passare tutti i test. Dalle il tuo stile personale. Puoi utilizzare HTML, JavaScript, e CSS per completare questo progetto. CSS è raccomandato perché è l'argomento delle lezioni viste finora e dovresti fare pratica con il CSS di base. Se lo desideri puoi anche utilizzare Bootstrap o SASS. Ulteriori tecnologie (solo per esempio jQuery, React, Angular, o Vue) non sono raccomandate per questo progetto, e usarle è a tuo rischio. Altri progetti ti daranno la possibilità di lavorare con diversi stack tecnologici come React. Accetteremo e cercheremo di risolvere tutte le segnalazioni di problemi che utilizzano lo stack tecnologico suggerito per questo progetto. Happy coding! @@ -38,7 +38,7 @@ Puoi utilizzare HTML, JavaScript, e CSS per completare questo progetto. CSS è r Puoi costruire il tuo progetto usando questo modello CodePen e facendo clic su `Save` per creare il tuo pen. Oppure puoi usare questo link CDN per eseguire i test in qualsiasi ambiente tu voglia: `https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js` -Una volta fatto, invia l'URL al tuo progetto di lavoro con tutti i suoi test superati. +Una volta fatto, invia l'URL del tuo progetto di lavoro con tutti i suoi test superati. # --solutions-- diff --git a/curriculum/challenges/italian/01-responsive-web-design/responsive-web-design-projects/build-a-product-landing-page.md b/curriculum/challenges/italian/01-responsive-web-design/responsive-web-design-projects/build-a-product-landing-page.md index 254ed30b81..9f4a27499c 100644 --- a/curriculum/challenges/italian/01-responsive-web-design/responsive-web-design-projects/build-a-product-landing-page.md +++ b/curriculum/challenges/italian/01-responsive-web-design/responsive-web-design-projects/build-a-product-landing-page.md @@ -10,7 +10,7 @@ dashedName: build-a-product-landing-page **Obiettivo:** Costruire un'app [CodePen.io](https://codepen.io) funzionalmente simile a questa: . -Compila le [user stories](https://en.wikipedia.org/wiki/User_story) qui sotto e ottieni tutti i test da passare. Dalle il tuo stile personale. +Compila le [user stories](https://en.wikipedia.org/wiki/User_story) qui sotto e fai passare tutti i test. Dalle il tuo stile personale. Puoi utilizzare HTML, JavaScript, e CSS per completare questo progetto. Il CSS è raccomandato perché è stato l'argomento delle lezioni viste finora e dovresti fare pratica con il CSS di base. Se lo desideri puoi anche utilizzare Bootstrap o SASS. Ulteriori tecnologie (solo per fare un esempio jQuery, React, Angular, o Vue) non sono raccomandate per questo progetto, e usarle è a tuo rischio. Altri progetti ti daranno la possibilità di lavorare con differenti stack tecnologici come React. Accetteremo e cercheremo di risolvere tutte le segnalazioni di problemi che utilizzano lo stack tecnologico suggerito per questo progetto. Happy coding! @@ -46,7 +46,7 @@ Puoi utilizzare HTML, JavaScript, e CSS per completare questo progetto. Il CSS Puoi costruire il tuo progetto usando questo modello CodePen e cliccando `Save` per creare il tuo pen. Oppure puoi usare questo link CDN per eseguire i test in qualsiasi ambiente tu voglia: `https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js` -Una volta fatto, invia l'URL al tuo progetto di lavoro con tutti i suoi test passati. +Una volta fatto, invia l'URL del tuo progetto di lavoro con tutti i suoi test passati. # --solutions-- diff --git a/curriculum/challenges/italian/01-responsive-web-design/responsive-web-design-projects/build-a-survey-form.md b/curriculum/challenges/italian/01-responsive-web-design/responsive-web-design-projects/build-a-survey-form.md index af0591d7c5..88654e8151 100644 --- a/curriculum/challenges/italian/01-responsive-web-design/responsive-web-design-projects/build-a-survey-form.md +++ b/curriculum/challenges/italian/01-responsive-web-design/responsive-web-design-projects/build-a-survey-form.md @@ -10,7 +10,7 @@ dashedName: build-a-survey-form **Obiettivo:** Costruisci un'app [CodePen.io](https://codepen.io) funzionalmente simile a questa: . -Compila le [user stories qui sotto](https://en.wikipedia.org/wiki/User_story) e ottieni tutti i test da passare. Dalle il tuo stile personale. +Compila le [user stories](https://en.wikipedia.org/wiki/User_story) qui sotto e fai passare tutti i test. Dalle il tuo stile personale. Puoi utilizzare HTML, JavaScript, e CSS per completare questo progetto. CSS è raccomandato perché è l'argomento delle lezioni viste finora e dovresti fare pratica con il CSS di base. Se lo desideri puoi anche utilizzare Bootstrap o SASS. Ulteriori tecnologie (solo per esempio jQuery, React, Angular, o Vue) non sono raccomandate per questo progetto, e usarle è a tuo rischio. Altri progetti ti daranno la possibilità di lavorare con diversi stack tecnologici come React. Accetteremo e cercheremo di risolvere tutte le segnalazioni di problemi che utilizzano lo stack tecnologico suggerito per questo progetto. Happy coding! @@ -48,7 +48,7 @@ Puoi utilizzare HTML, JavaScript, e CSS per completare questo progetto. CSS è r Puoi costruire il tuo progetto usando questo modello CodePen e facendo clic su `Save` per creare il tuo pen. Oppure puoi usare questo link CDN per eseguire i test in qualsiasi ambiente tu voglia: `https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js` -Una volta fatto, invia l'URL al tuo progetto di lavoro con tutti i suoi test passati. +Una volta fatto, invia l'URL del tuo progetto di lavoro con tutti i suoi test passati. # --solutions-- diff --git a/curriculum/challenges/italian/01-responsive-web-design/responsive-web-design-projects/build-a-technical-documentation-page.md b/curriculum/challenges/italian/01-responsive-web-design/responsive-web-design-projects/build-a-technical-documentation-page.md index 7b072234f4..34ac0d78a1 100644 --- a/curriculum/challenges/italian/01-responsive-web-design/responsive-web-design-projects/build-a-technical-documentation-page.md +++ b/curriculum/challenges/italian/01-responsive-web-design/responsive-web-design-projects/build-a-technical-documentation-page.md @@ -10,7 +10,7 @@ dashedName: build-a-technical-documentation-page **Obiettivo:** Costuire un'app [CodePen.io](https://codepen.io) funzionalmente simile a questa: . -Compila le [user stories qui sotto](https://en.wikipedia.org/wiki/User_story) e ottieni tutti i test da passare. Dalle il tuo stile personale. +Compila le [user stories](https://en.wikipedia.org/wiki/User_story) qui sotto e fai passare tutti i test. Dalle il tuo stile personale. Puoi utilizzare HTML, JavaScript, e CSS per completare questo progetto. CSS è raccomandato perché è l'argomento delle lezioni viste finora, e dovresti fare pratica con il CSS di base. Se lo desideri puoi anche utilizzare Bootstrap o SASS. Ulteriori tecnologie (solo per esempio jQuery, React, Angular, o Vue) non sono raccomandate per questo progetto, e usarle è a tuo rischio. Altri progetti ti daranno la possibilità di lavorare con differenti stack tecnologici come React. Accetteremo e cercheremo di risolvere tutte le segnalazioni di problemi che utilizzano lo stack tecnologico suggerito per questo progetto. Happy coding! @@ -46,7 +46,7 @@ Puoi utilizzare HTML, JavaScript, e CSS per completare questo progetto. CSS è r Puoi costruire il tuo progetto usando questo modello CodePen e cliccando `Save` per creare il tuo pen. Oppure puoi usare questo link CDN per eseguire i test in qualsiasi ambiente tu voglia: `https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js` -Una volta fatto, invia l'URL al tuo progetto di lavoro con tutti i suoi test passati. +Una volta fatto, invia l'URL del tuo progetto di lavoro con tutti i suoi test passati. # --solutions-- diff --git a/curriculum/challenges/italian/01-responsive-web-design/responsive-web-design-projects/build-a-tribute-page.md b/curriculum/challenges/italian/01-responsive-web-design/responsive-web-design-projects/build-a-tribute-page.md index 3966acf668..66445f272f 100644 --- a/curriculum/challenges/italian/01-responsive-web-design/responsive-web-design-projects/build-a-tribute-page.md +++ b/curriculum/challenges/italian/01-responsive-web-design/responsive-web-design-projects/build-a-tribute-page.md @@ -10,7 +10,7 @@ dashedName: build-a-tribute-page **Obiettivo:** Costruisci un'app [CodePen.io](https://codepen.io) funzionalmente simile a questa: . -Compila le [user stories qui sotto](https://en.wikipedia.org/wiki/User_story) e ottieni tutti i test da passare. Dalle il tuo stile personale. +Compila le [user stories](https://en.wikipedia.org/wiki/User_story) qui sotto e fai passare tutti i test. Dalle il tuo stile personale. Puoi utilizzare HTML, JavaScript, e CSS per completare questo progetto. CSS è raccomandato perché è l'argomento delle lezioni viste finora e dovresti fare pratica con il CSS di base. Se lo desideri puoi anche utilizzare Bootstrap o SASS. Ulteriori tecnologie (solo per esempio jQuery, React, Angular, o Vue) non sono raccomandate per questo progetto, e usarle è a tuo rischio. Altri progetti ti daranno la possibilità di lavorare con differenti stack tecnologici come React. Accetteremo e cercheremo di risolvere tutte le segnalazioni di problemi che utilizzano lo stack tecnologico suggerito per questo progetto. Happy coding! @@ -34,7 +34,7 @@ Puoi utilizzare HTML, JavaScript, e CSS per completare questo progetto. CSS è r Puoi costruire il tuo progetto usando questo modello CodePen e facendo clic su `Save` per creare il tuo pen. Oppure puoi usare questo link CDN per eseguire i test in qualsiasi ambiente tu voglia: `https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js`. -Una volta fatto, invia l'URL al tuo progetto di lavoro con tutti i suoi test passati. +Una volta fatto, invia l'URL del tuo progetto di lavoro con tutti i suoi test passati. # --solutions-- diff --git a/curriculum/challenges/italian/03-front-end-libraries/front-end-libraries-projects/build-a-25-5-clock.md b/curriculum/challenges/italian/03-front-end-libraries/front-end-libraries-projects/build-a-25-5-clock.md index cbb6d71c11..bd66dcf3d7 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/front-end-libraries-projects/build-a-25-5-clock.md +++ b/curriculum/challenges/italian/03-front-end-libraries/front-end-libraries-projects/build-a-25-5-clock.md @@ -1,6 +1,6 @@ --- id: bd7158d8c442eddfaeb5bd0f -title: Build a 25 + 5 Clock +title: Costruisci un Orologio 25 + 5 challengeType: 3 forumTopicId: 301373 dashedName: build-a-25--5-clock @@ -8,71 +8,71 @@ dashedName: build-a-25--5-clock # --description-- -**Objective:** Build a [CodePen.io](https://codepen.io) app that is functionally similar to this: . +**Obiettivo:** Costruisci un'app [CodePen.io](https://codepen.io) funzionalmente simile a questa: . -Fulfill the below [user stories](https://en.wikipedia.org/wiki/User_story) and get all of the tests to pass. Give it your own personal style. +Compila le [user stories](https://en.wikipedia.org/wiki/User_story) qui sotto e fai passare tutti i test. Dalle il tuo stile personale. -You can use any mix of HTML, JavaScript, CSS, Bootstrap, SASS, React, Redux, and jQuery to complete this project. You should use a frontend framework (like React for example) because this section is about learning frontend frameworks. Additional technologies not listed above are not recommended and using them is at your own risk. We are looking at supporting other frontend frameworks like Angular and Vue, but they are not currently supported. We will accept and try to fix all issue reports that use the suggested technology stack for this project. Happy coding! +Puoi utilizzare qualsiasi mix di HTML, JavaScript, CSS, Bootstrap, SASS, React, Redux e jQuery per completare questo progetto. Dovresti usare un framework frontend (come React per esempio) perché questa sezione riguarda l'apprendimento dei framework per il frontend. Ulteriori tecnologie non elencate sopra non sono raccomandate e usarle è a tuo rischio. Stiamo cercando di supportare altri framework per il frontend come Angular e Vue, ma attualmente non sono supportati. Accetteremo e cercheremo di risolvere tutte le segnalazioni di problemi che utilizzano lo stack tecnologico suggerito per questo progetto. Happy coding! -**User Story #1:** I can see an element with `id="break-label"` that contains a string (e.g. "Break Length"). +**User Story #1:** Posso vedere un elemento con `id="break-label"` che contiene una stringa (ad esempio "Break Length"). -**User Story #2:** I can see an element with `id="session-label"` that contains a string (e.g. "Session Length"). +**User Story #2:** Posso vedere un elemento con `id="session-label"` che contiene una stringa (ad esempio "Session Length"). -**User Story #3:** I can see two clickable elements with corresponding IDs: `id="break-decrement"` and `id="session-decrement"`. +**User Story #3:** Posso vedere due elementi cliccabili con gli id rispettivamente: `id="break-decrement"` e `id="session-decrement"`. -**User Story #4:** I can see two clickable elements with corresponding IDs: `id="break-increment"` and `id="session-increment"`. +**User Story #4:** Posso vedere due elementi cliccabili con gli id rispettivamente: `id="break-increment"` e `id="session-increment"`. -**User Story #5:** I can see an element with a corresponding `id="break-length"`, which by default (on load) displays a value of 5. +**User Story #5:** Posso vedere un elemento con un corrispondente `id="break-length"`, che per impostazione predefinita (al caricamento) visualizza un valore di 5. -**User Story #6:** I can see an element with a corresponding `id="session-length"`, which by default displays a value of 25. +**User Story #6:** Posso vedere un elemento con un corrispondente `id="session-length"`, che per impostazione predefinita visualizza un valore di 25. -**User Story #7:** I can see an element with a corresponding `id="timer-label"`, that contains a string indicating a session is initialized (e.g. "Session"). +**User Story #7:** Posso vedere un elemento con un corrispondente `id="timer-label"`, che contiene una stringa che indica che una sessione è inizializzata (es. "Session"). -**User Story #8:** I can see an element with corresponding `id="time-left"`. NOTE: Paused or running, the value in this field should always be displayed in `mm:ss` format (i.e. 25:00). +**User Story #8:** Posso vedere un elemento con corrispondente `id="time-left"`. NOTA: In pausa o in esecuzione, il valore in questo campo deve essere sempre visualizzato in formato `mm:ss` (cioè 25:00). -**User Story #9:** I can see a clickable element with a corresponding `id="start_stop"`. +**User Story #9:** Posso vedere un elemento cliccabile con un corrispondente `id="start_stop"`. -**User Story #10:** I can see a clickable element with a corresponding `id="reset"`. +**User Story #10:** Posso vedere un elemento cliccabile con un corrispondente `id="reset"`. -**User Story #11:** When I click the element with the id of `reset`, any running timer should be stopped, the value within `id="break-length"` should return to `5`, the value within `id="session-length"` should return to 25, and the element with `id="time-left"` should reset to its default state. +**User Story #11:** Quando clicco sull'elemento con l'id di `reset`, qualsiasi timer in esecuzione deve essere fermato, il valore in `id="break-length"` dovrebbe tornare a `5`, il valore in `id="session-length"` dovrebbe ritornare a 25, e l'elemento con `id="time-left"` dovrebbe tornare al suo stato predefinito. -**User Story #12:** When I click the element with the id of `break-decrement`, the value within `id="break-length"` decrements by a value of 1, and I can see the updated value. +**User Story #12:** Quando clicco sull'elemento con l'id `break-decrement`, il valore all'interno di `id="break-length"` diminuisce di 1, e posso vedere il valore aggiornato. -**User Story #13:** When I click the element with the id of `break-increment`, the value within `id="break-length"` increments by a value of 1, and I can see the updated value. +**User Story #13:** Quando clicco sull'elemento con l'id di `break-increment`, il valore all'interno di `id="break-length"` aumenta di 1, e posso vedere il valore aggiornato. -**User Story #14:** When I click the element with the id of `session-decrement`, the value within `id="session-length"` decrements by a value of 1, and I can see the updated value. +**User Story #14:** Quando clicco sull'elemento con l'id di `session-decrement`, il valore in `id="session-length"` diminuisce di 1, e riesco a vedere il valore aggiornato. -**User Story #15:** When I click the element with the id of `session-increment`, the value within `id="session-length"` increments by a value of 1, and I can see the updated value. +**User Story #15:** Quando clicco sull'elemento con l'id di `session-increment`, il valore all'interno di `id="session-length"` aumenta di 1, e posso vedere il valore aggiornato. -**User Story #16:** I should not be able to set a session or break length to <= 0. +**User Story #16:** Non dovrei essere in grado di impostare la lunghezza di una sessione o di una pausa <= 0. -**User Story #17:** I should not be able to set a session or break length to > 60. +**User Story #17:** Non dovrei essere in grado di impostare la lunghezza di una sessione o di una pausa > 60. -**User Story #18:** When I first click the element with `id="start_stop"`, the timer should begin running from the value currently displayed in `id="session-length"`, even if the value has been incremented or decremented from the original value of 25. +**User Story #18:** Quando faccio click per la prima volta sull'elemento con `id="start_stop"`, il timer dovrebbe iniziare dal valore attualmente visualizzato in `id="session-length"`, anche se il valore è stato incrementato o diminuito rispetto al valore originario di 25. -**User Story #19:** If the timer is running, the element with the id of `time-left` should display the remaining time in `mm:ss` format (decrementing by a value of 1 and updating the display every 1000ms). +**User Story #19:** Se il timer è in esecuzione, l'elemento con l'id di `time-left` dovrebbe visualizzare il tempo rimanente nel formato `mm:ss` (decrementando di un valore di 1 e aggiornando il display ogni 1000ms). -**User Story #20:** If the timer is running and I click the element with `id="start_stop"`, the countdown should pause. +**User Story #20:** Se il timer è in esecuzione e clicco sull'elemento con `id="start_stop"`, il conto alla rovescia dovrebbe andare in pausa. -**User Story #21:** If the timer is paused and I click the element with `id="start_stop"`, the countdown should resume running from the point at which it was paused. +**User Story #21:** Se il timer è in pausa e clicco sull'elemento con `id="start_stop"`, il conto alla rovescia dovrebbe riprendere dal punto in cui è stato messo in pausa. -**User Story #22:** When a session countdown reaches zero (NOTE: timer MUST reach 00:00), and a new countdown begins, the element with the id of `timer-label` should display a string indicating a break has begun. +**User Story #22:** Quando un conto alla rovescia di una sessione raggiunge lo zero (NOTA: il timer DEVE raggiungere le 00:00), e inizia un nuovo conto alla rovescia, l'elemento con l'id di `timer-label` dovrebbe mostrare una stringa che indica che è iniziata una pausa. -**User Story #23:** When a session countdown reaches zero (NOTE: timer MUST reach 00:00), a new break countdown should begin, counting down from the value currently displayed in the `id="break-length"` element. +**User Story #23:** Quando il conto alla rovescia di una sessione raggiunge lo zero (NOTA: il timer DEVE raggiungere le 00:00), dovrebbe iniziare un nuovo conto alla rovescia, contando alla rovescia dal valore attualmente visualizzato nell'elemento `id="break-length"`. -**User Story #24:** When a break countdown reaches zero (NOTE: timer MUST reach 00:00), and a new countdown begins, the element with the id of `timer-label` should display a string indicating a session has begun. +**User Story #24:** Quando un conto alla rovescia raggiunge lo zero (NOTA: il timer DEVE raggiungere le 00:00), e inizia un nuovo conto alla rovescia, l'elemento con l'id di `timer-label` dovrebbe mostrare una stringa che indica che è iniziata una sessione. -**User Story #25:** When a break countdown reaches zero (NOTE: timer MUST reach 00:00), a new session countdown should begin, counting down from the value currently displayed in the `id="session-length"` element. +**User Story #25:** Quando il conto alla rovescia della pausa raggiunge lo zero (NOTA: il timer DEVE raggiungere le 00:00), dovrebbe iniziare un nuovo conto alla rovescia, contando alla rovescia dal valore attualmente visualizzato nell'elemento `id="session-length"`. -**User Story #26:** When a countdown reaches zero (NOTE: timer MUST reach 00:00), a sound indicating that time is up should play. This should utilize an HTML5 `audio` tag and have a corresponding `id="beep"`. +**User Story #26:** Quando un conto alla rovescia raggiunge lo zero (NOTA: il timer DEVE raggiungere le 00:00), dovrebbe essere riprodotto un suono che indica che il tempo è scaduto. Questo dovrebbe utilizzare un tag HTML5 `audio` e avere un corrispondente `id="beep"`. -**User Story #27:** The audio element with `id="beep"` must be 1 second or longer. +**User Story #27:** L'elemento audio con `id="beep"` deve essere lungo un secondo o più. -**User Story #28:** The audio element with id of `beep` must stop playing and be rewound to the beginning when the element with the id of `reset` is clicked. +**User Story #28:** L'elemento audio con id di `beep` deve terminare la riproduzione e tornare all'inizio quando viene cliccato l'elemento con l'id `reset`. -You can build your project by using this CodePen template and clicking `Save` to create your own pen. Or you can use this CDN link to run the tests in any environment you like: `https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js` +Puoi costruire il tuo progetto usando questo modello CodePen e facendo clic su `Save` per creare il tuo pen. Oppure puoi usare questo link CDN per eseguire i test in qualsiasi ambiente tu voglia: `https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js` -Once you're done, submit the URL to your working project with all its tests passing. +Una volta fatto, invia l'URL del tuo progetto di lavoro con tutti i suoi test passati. # --solutions-- diff --git a/curriculum/challenges/italian/03-front-end-libraries/front-end-libraries-projects/build-a-drum-machine.md b/curriculum/challenges/italian/03-front-end-libraries/front-end-libraries-projects/build-a-drum-machine.md index 4cf667cf9e..7eee28e0f4 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/front-end-libraries-projects/build-a-drum-machine.md +++ b/curriculum/challenges/italian/03-front-end-libraries/front-end-libraries-projects/build-a-drum-machine.md @@ -1,6 +1,6 @@ --- id: 587d7dbc367417b2b2512bae -title: Build a Drum Machine +title: Costruisci una batteria challengeType: 3 forumTopicId: 301370 dashedName: build-a-drum-machine @@ -8,29 +8,29 @@ dashedName: build-a-drum-machine # --description-- -**Objective:** Build a [CodePen.io](https://codepen.io) app that is functionally similar to this: . +**Obiettivo:** Costruisci un'app [CodePen.io](https://codepen.io) funzionalmente simile a questa: . -Fulfill the below [user stories](https://en.wikipedia.org/wiki/User_story) and get all of the tests to pass. Give it your own personal style. +Compila le [user stories](https://en.wikipedia.org/wiki/User_story) qui sotto e fai passare tutti i test. Dalle il tuo stile personale. -You can use any mix of HTML, JavaScript, CSS, Bootstrap, SASS, React, Redux, and jQuery to complete this project. You should use a frontend framework (like React for example) because this section is about learning frontend frameworks. Additional technologies not listed above are not recommended and using them is at your own risk. We are looking at supporting other frontend frameworks like Angular and Vue, but they are not currently supported. We will accept and try to fix all issue reports that use the suggested technology stack for this project. Happy coding! +Puoi utilizzare qualsiasi mix di HTML, JavaScript, CSS, Bootstrap, SASS, React, Redux e jQuery per completare questo progetto. Dovresti usare un framework frontend (come React per esempio) perché questa sezione riguarda l'apprendimento dei framework per il frontend. Ulteriori tecnologie non elencate sopra non sono raccomandate e usarle è a tuo rischio. Stiamo cercando di supportare altri framework per il frontend come Angular e Vue, ma attualmente non sono supportati. Accetteremo e cercheremo di risolvere tutte le segnalazioni di problemi che utilizzano lo stack tecnologico suggerito per questo progetto. Happy coding! -**User Story #1:** I should be able to see an outer container with a corresponding `id="drum-machine"` that contains all other elements. +**User Story #1:** Dovrei essere in grado di vedere un contenitore esterno con un corrispondente `id="drum-machine"` che contiene tutti gli altri elementi. -**User Story #2:** Within `#drum-machine` I can see an element with a corresponding `id="display"`. +**User Story #2:** All'interno di `#drum-machine` posso vedere un elemento con un corrispondente `id="display"`. -**User Story #3:** Within `#drum-machine` I can see 9 clickable drum pad elements, each with a class name of `drum-pad`, a unique id that describes the audio clip the drum pad will be set up to trigger, and an inner text that corresponds to one of the following keys on the keyboard: `Q`, `W`, `E`, `A`, `S`, `D`, `Z`, `X`, `C`. The drum pads MUST be in this order. +**User Story #3:** Dentro a `#drum-machine` posso vedere 9 elementi tamburo cliccabili, ognuno di classe `drum-pad`, con un id univoco che descrive la clip audio che l'elemento dovrà avviare, e un testo interno che corrisponde a uno dei seguenti tasti sulla tastiera: `Q` `W`, `E`, `A`, `S`, `D`, `Z`, `X`, `C`. I tamburi DEVONO essere in questo ordine. -**User Story #4:** Within each `.drum-pad`, there should be an HTML5 `audio` element which has a `src` attribute pointing to an audio clip, a class name of `clip`, and an id corresponding to the inner text of its parent `.drum-pad` (e.g. `id="Q"`, `id="W"`, `id="E"` etc.). +**User Story #4:** All'interno di ogni `.drum-pad`, ci dovrebbe essere un elemento HTML5 `audio` che ha un attributo `src` che indica una clip audio, un nome di classe `clip` e un id corrispondente al testo interno del `.drum-pad` genitore (ad es. `id="Q"`, `id="W"`, `id="E"` ecc.). -**User Story #5:** When I click on a `.drum-pad` element, the audio clip contained in its child `audio` element should be triggered. +**User Story #5:** Quando clicco su un elemento `.drum-pad`, la clip audio contenuta nell'elemento figlio `audio` dovrebbe essere attivata. -**User Story #6:** When I press the trigger key associated with each `.drum-pad`, the audio clip contained in its child `audio` element should be triggered (e.g. pressing the `Q` key should trigger the drum pad which contains the string `Q`, pressing the `W` key should trigger the drum pad which contains the string `W`, etc.). +**User Story #6:** Quando premo il tasto di attivazione associato a ogni `.drum-pad`, la clip audio contenuta nell'elemento figlio `audio` dovrebbe essere attivata (ad es. premendo il tasto `Q` si dovrebbe attivare il tamburo che contiene la stringa `Q`, premendo il tasto `W` si dovrebbe attivare il tamburo che contiene la stringa `W`, ecc.). -**User Story #7:** When a `.drum-pad` is triggered, a string describing the associated audio clip is displayed as the inner text of the `#display` element (each string must be unique). +**User Story #7:** Quando un `.drum-pad` viene attivato, viene visualizzata una stringa che descrive la clip audio associata come testo interno dell'elemento `#display` (ogni stringa deve essere unica). -You can build your project by using this CodePen template and clicking `Save` to create your own pen. Or you can use this CDN link to run the tests in any environment you like: `https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js` +Puoi costruire il tuo progetto usando questo modello CodePen e facendo clic su `Save` per creare il tuo pen. Oppure puoi usare questo link CDN per eseguire i test in qualsiasi ambiente tu voglia: `https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js` -Once you're done, submit the URL to your working project with all its tests passing. +Una volta fatto, invia l'URL del tuo progetto di lavoro con tutti i suoi test passati. # --solutions-- diff --git a/curriculum/challenges/italian/03-front-end-libraries/front-end-libraries-projects/build-a-javascript-calculator.md b/curriculum/challenges/italian/03-front-end-libraries/front-end-libraries-projects/build-a-javascript-calculator.md index cb20e900bb..13750e40c7 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/front-end-libraries-projects/build-a-javascript-calculator.md +++ b/curriculum/challenges/italian/03-front-end-libraries/front-end-libraries-projects/build-a-javascript-calculator.md @@ -1,6 +1,6 @@ --- id: bd7158d8c442eddfaeb5bd17 -title: Build a JavaScript Calculator +title: Costruisci una Calcolatrice JavaScript challengeType: 3 forumTopicId: 301371 dashedName: build-a-javascript-calculator @@ -8,52 +8,52 @@ dashedName: build-a-javascript-calculator # --description-- -**Objective:** Build a [CodePen.io](https://codepen.io) app that is functionally similar to this: . +**Obiettivo:** Costruisci un'app [CodePen.io](https://codepen.io) funzionalmente simile a questa: . -Fulfill the below [user stories](https://en.wikipedia.org/wiki/User_story) and get all of the tests to pass. Give it your own personal style. +Compila le [user stories](https://en.wikipedia.org/wiki/User_story) qui sotto e fai passare tutti i test. Dalle il tuo stile personale. -You can use any mix of HTML, JavaScript, CSS, Bootstrap, SASS, React, Redux, and jQuery to complete this project. You should use a frontend framework (like React for example) because this section is about learning frontend frameworks. Additional technologies not listed above are not recommended and using them is at your own risk. We are looking at supporting other frontend frameworks like Angular and Vue, but they are not currently supported. We will accept and try to fix all issue reports that use the suggested technology stack for this project. Happy coding! +Puoi utilizzare qualsiasi mix di HTML, JavaScript, CSS, Bootstrap, SASS, React, Redux e jQuery per completare questo progetto. Dovresti usare un framework frontend (come React per esempio) perché questa sezione riguarda l'apprendimento dei framework per il frontend. Ulteriori tecnologie non elencate sopra non sono raccomandate e usarle è a tuo rischio. Stiamo cercando di supportare altri framework per il frontend come Angular e Vue, ma attualmente non sono supportati. Accetteremo e cercheremo di risolvere tutte le segnalazioni di problemi che utilizzano lo stack tecnologico suggerito per questo progetto. Happy coding! -**User Story #1:** My calculator should contain a clickable element containing an `=` (equal sign) with a corresponding `id="equals"`. +**User Story #1:** La mia calcolatrice dovrebbe contenere un elemento cliccabile contenente un `=` (segno uguale) con un corrispondente `id="equals"`. -**User Story #2:** My calculator should contain 10 clickable elements containing one number each from 0-9, with the following corresponding IDs: `id="zero"`, `id="one"`, `id="two"`, `id="three"`, `id="four"`, `id="five"`, `id="six"`, `id="seven"`, `id="eight"`, and `id="nine"`. +**User Story #2:** La mia calcolatrice dovrebbe contenere 10 elementi cliccabili contenenti ciascuno un numero da 0-9, con i seguenti ID corrispondenti: `id="zero"`, `id="one"`, `id="two"`, `id="three"`, `id="four"`, `id="five"`, `id="six"` `id="seven"`, `id="eight"` e `id="nine"`. -**User Story #3:** My calculator should contain 4 clickable elements each containing one of the 4 primary mathematical operators with the following corresponding IDs: `id="add"`, `id="subtract"`, `id="multiply"`, `id="divide"`. +**User Story #3:** La mia calcolatrice dovrebbe contenere 4 elementi cliccabili contenenti ognuno uno degli operatori matematici primari con i seguenti ID corrispondenti: `id="add"`, `id="subtract"`, `id="multiply"`, `id="divide"`. -**User Story #4:** My calculator should contain a clickable element containing a `.` (decimal point) symbol with a corresponding `id="decimal"`. +**User Story #4:** La mia calcolatrice dovrebbe contenere un elemento cliccabile contenente un simbolo `.` (punto decimale) con un corrispondente `id="decimal"`. -**User Story #5:** My calculator should contain a clickable element with an `id="clear"`. +**User Story #5:** La mia calcolatrice dovrebbe contenere un elemento cliccabile con un `id="clear"`. -**User Story #6:** My calculator should contain an element to display values with a corresponding `id="display"`. +**User Story #6:** La mia calcolatrice dovrebbe contenere un elemento per visualizzare i valori con un corrispondente `id="display"`. -**User Story #7:** At any time, pressing the `clear` button clears the input and output values, and returns the calculator to its initialized state; 0 should be shown in the element with the id of `display`. +**User Story #7:** In qualsiasi momento, premendo il pulsante `clear` dovrebbero essere cancellati i valori di input e output, e la calcolatrice dovrebbe tornare suo stato iniziale; nell'elemento con l'id `display` dovrebbe essere mostrato 0. -**User Story #8:** As I input numbers, I should be able to see my input in the element with the id of `display`. +**User Story #8:** Quando inserisco dei numeri, dovrei essere in grado di vedere il mio input nell'elemento con l'id `display`. -**User Story #9:** In any order, I should be able to add, subtract, multiply and divide a chain of numbers of any length, and when I hit `=`, the correct result should be shown in the element with the id of `display`. +**User Story #9:** Dovrei essere in grado di aggiungere, sottrarre, moltiplicare e dividere una catena di numeri di qualsiasi lunghezza e in qualsiasi ordine, e quando premo `=`, il risultato corretto dovrebbe essere mostrato nell'elemento con l'id `display`. -**User Story #10:** When inputting numbers, my calculator should not allow a number to begin with multiple zeros. +**User Story #10:** La mia calcolatrice non dovrebbe consentire a un numero di iniziare con zeri multipli. -**User Story #11:** When the decimal element is clicked, a `.` should append to the currently displayed value; two `.` in one number should not be accepted. +**User Story #11:** Quando l'elemento decimale viene cliccato, un `.` dovrebbe essere accodato al valore attualmente visualizzato; non dovrebbero essere accettati due `.` in un numero. -**User Story #12:** I should be able to perform any operation (`+`, `-`, `*`, `/`) on numbers containing decimal points. +**User Story #12:** Dovrei essere in grado di eseguire qualsiasi operazione (`+`, `-`, `*`, `/`) sui numeri contenenti punti decimali. -**User Story #13:** If 2 or more operators are entered consecutively, the operation performed should be the last operator entered (excluding the negative (`-`) sign). For example, if `5 + * 7 =` is entered, the result should be `35` (i.e. `5 * 7`); if `5 * - 5 =` is entered, the result should be `-25` (i.e. `5 * (-5)`). +**User Story #13:** Se 2 o più operatori sono inseriti consecutivamente, l'operazione effettuata dovrebbe essere l'ultimo operatore inserito (escluso il segno meno (`-`). Ad esempio, se viene inserito `5 + * 7 =`, il risultato dovrebbe essere `35` (cioè `5 * 7`); se viene inserito `5 * - 5 =`, il risultato dovrebbe essere `-25` (cioè `5 * (-5)`). -**User Story #14:** Pressing an operator immediately following `=` should start a new calculation that operates on the result of the previous evaluation. +**User Story #14:** Premere un operatore immediatamente dopo `=` dovrebbe avviare un nuovo calcolo che funzioni sul risultato dell'elaborazione precedente. -**User Story #15:** My calculator should have several decimal places of precision when it comes to rounding (note that there is no exact standard, but you should be able to handle calculations like `2 / 7` with reasonable precision to at least 4 decimal places). +**User Story #15:** La mia calcolatrice dovrebbe avere diversi decimali di precisione quando si tratta di arrotondamento (nota che non c'è uno standard esatto, ma si dovrebbe essere in grado di gestire calcoli come `2 / 7` con ragionevole precisione ad almeno 4 decimali). -**Note On Calculator Logic:** It should be noted that there are two main schools of thought on calculator input logic: immediate execution logic and formula logic. Our example utilizes formula logic and observes order of operation precedence, immediate execution does not. Either is acceptable, but please note that depending on which you choose, your calculator may yield different results than ours for certain equations (see below example). As long as your math can be verified by another production calculator, please do not consider this a bug. +**Nota sulla logica della calcolatrice:** Va notato che ci sono due principali scuole di pensiero sulla logica dell'input della calcolatrice: logica a esecuzione immediata e logica della formula. Il nostro esempio utilizza la logica della formula e osserva l'ordine di precedenza degli operatori, mentre l'esecuzione immediata non lo fa. Entrambe sono accettabili, ma nota che a seconda di quale sceglierai, la calcolatrice potrà produrre risultati diversi rispetto ai nostri per alcune equazioni (vedi l'esempio in basso). Finché la matematica può essere verificata da un altro calcolatore di produzione, non considerarlo un bug. -**EXAMPLE:** `3 + 5 x 6 - 2 / 4 =` +**ESEMPIO:** `3 + 5 x 6 - 2 / 4 =` -- **Immediate Execution Logic:** `11.5` -- **Formula/Expression Logic:** `32.5` +- **Logica a esecuzione immediata:** `11.5` +- **Logica della formula:** `32.5` -You can build your project by using this CodePen template and clicking `Save` to create your own pen. Or you can use this CDN link to run the tests in any environment you like: `https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js` +Puoi costruire il tuo progetto usando questo modello CodePen e facendo clic su `Save` per creare il tuo pen. Oppure puoi usare questo link CDN per eseguire i test in qualsiasi ambiente tu voglia: `https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js` -Once you're done, submit the URL to your working project with all its tests passing. +Una volta fatto, invia l'URL del tuo progetto di lavoro con tutti i suoi test passati. # --solutions-- diff --git a/curriculum/challenges/italian/03-front-end-libraries/front-end-libraries-projects/build-a-markdown-previewer.md b/curriculum/challenges/italian/03-front-end-libraries/front-end-libraries-projects/build-a-markdown-previewer.md index 2be74eba1c..d30c5f1bcb 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/front-end-libraries-projects/build-a-markdown-previewer.md +++ b/curriculum/challenges/italian/03-front-end-libraries/front-end-libraries-projects/build-a-markdown-previewer.md @@ -1,6 +1,6 @@ --- id: bd7157d8c242eddfaeb5bd13 -title: Build a Markdown Previewer +title: Costruisci un visualizzatore di anteprima per il Markdown challengeType: 3 forumTopicId: 301372 dashedName: build-a-markdown-previewer @@ -8,29 +8,29 @@ dashedName: build-a-markdown-previewer # --description-- -**Objective:** Build a [CodePen.io](https://codepen.io) app that is functionally similar to this: . +**Obiettivo:** Costruisci un'app [CodePen.io](https://codepen.io) funzionalmente simile a questa: . -Fulfill the below [user stories](https://en.wikipedia.org/wiki/User_story) and get all of the tests to pass. Give it your own personal style. +Compila le [user stories](https://en.wikipedia.org/wiki/User_story) qui sotto e fai passare tutti i test. Dalle il tuo stile personale. -You can use any mix of HTML, JavaScript, CSS, Bootstrap, SASS, React, Redux, and jQuery to complete this project. You should use a frontend framework (like React for example) because this section is about learning frontend frameworks. Additional technologies not listed above are not recommended and using them is at your own risk. We are looking at supporting other frontend frameworks like Angular and Vue, but they are not currently supported. We will accept and try to fix all issue reports that use the suggested technology stack for this project. Happy coding! +Puoi utilizzare qualsiasi mix di HTML, JavaScript, CSS, Bootstrap, SASS, React, Redux e jQuery per completare questo progetto. Dovresti usare un framework frontend (come React per esempio) perché questa sezione riguarda l'apprendimento dei framework per il frontend. Ulteriori tecnologie non elencate sopra non sono raccomandate e usarle è a tuo rischio. Stiamo cercando di supportare altri framework per il frontend come Angular e Vue, ma attualmente non sono supportati. Accetteremo e cercheremo di risolvere tutte le segnalazioni di problemi che utilizzano lo stack tecnologico suggerito per questo progetto. Happy coding! -**User Story #1:** I can see a `textarea` element with a corresponding `id="editor"`. +**User Story #1:** Posso vedere un elemento `textarea` con un corrispondente `id="editor"`. -**User Story #2:** I can see an element with a corresponding `id="preview"`. +**User Story #2:** Posso vedere un elemento con un corrispondente `id="preview"`. -**User Story #3:** When I enter text into the `#editor` element, the `#preview` element is updated as I type to display the content of the textarea. +**User Story #3:** Quando inserisco del testo nell'elemento `#editor`, l'elemento `#preview` viene aggiornato mentre scrivo per visualizzare il contenuto della textarea. -**User Story #4:** When I enter GitHub flavored markdown into the `#editor` element, the text is rendered as HTML in the `#preview` element as I type (HINT: You don't need to parse Markdown yourself - you can import the Marked library for this: ). +**User Story #4:** Quando inserisco markdown in stile GitHub nell'elemento `#editor`, il testo viene presentato come HTML nell'elemento `#preview` mentre digito (SUGGERIMENTO: Non è necessario che analizzi tu stesso il Markdown - puoi importare la libreria Marked per questo: [https://cdnjs. om/libraries/marked](https://cdnjs.com/libraries/marked)). -**User Story #5:** When my markdown previewer first loads, the default text in the `#editor` field should contain valid markdown that represents at least one of each of the following elements: a header (H1 size), a sub header (H2 size), a link, inline code, a code block, a list item, a blockquote, an image, and bolded text. +**User Story #5:** Quando il mio visualizzatore di markdown viene caricato inizialmente, il testo predefinito nel campo `#editor` dovrebbe contenere markdown valido che rappresenti almeno uno dei seguenti elementi: un'intestazione (dimensione H1), una sotto-intestazione (formato H2), un collegamento, del codice in linea, un blocco di codice, un elemento lista, un blockquote, un'immagine e un testo in grassetto. -**User Story #6:** When my markdown previewer first loads, the default markdown in the `#editor` field should be rendered as HTML in the `#preview` element. +**User Story #6:** Quando il mio visualizzatore di markdown viene caricato inizialmente, il markdown predefinito nel campo `#editor` dovrebbe essere presentato come HTML nell'elemento `#preview`. -**Optional Bonus (you do not need to make this test pass):** My markdown previewer interprets carriage returns and renders them as `br` (line break) elements. +**Bonus opzionale (non è necessario superare questo test):** Il mio visualizzatore di markdown interpreta i ritorni a capo e li presenta come elementi `br` (interruzione di riga). -You can build your project by using this CodePen template and clicking `Save` to create your own pen. Or you can use this CDN link to run the tests in any environment you like: `https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js` +Puoi costruire il tuo progetto usando questo modello CodePen e facendo clic su `Save` per creare il tuo pen. Oppure puoi usare questo link CDN per eseguire i test in qualsiasi ambiente tu voglia: `https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js` -Once you're done, submit the URL to your working project with all its tests passing. +Una volta fatto, invia l'URL del tuo progetto di lavoro con tutti i suoi test passati. # --solutions-- diff --git a/curriculum/challenges/italian/03-front-end-libraries/front-end-libraries-projects/build-a-random-quote-machine.md b/curriculum/challenges/italian/03-front-end-libraries/front-end-libraries-projects/build-a-random-quote-machine.md index f70f8dab0f..5c6ec200a8 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/front-end-libraries-projects/build-a-random-quote-machine.md +++ b/curriculum/challenges/italian/03-front-end-libraries/front-end-libraries-projects/build-a-random-quote-machine.md @@ -1,6 +1,6 @@ --- id: bd7158d8c442eddfaeb5bd13 -title: Build a Random Quote Machine +title: Costruisci una Macchina per le citazioni casuali challengeType: 3 forumTopicId: 301374 dashedName: build-a-random-quote-machine @@ -8,39 +8,39 @@ dashedName: build-a-random-quote-machine # --description-- -**Objective:** Build a [CodePen.io](https://codepen.io) app that is functionally similar to this: . +**Obiettivo:** Costruisci un'app [CodePen.io](https://codepen.io) funzionalmente simile a questa: . -Fulfill the below [user stories](https://en.wikipedia.org/wiki/User_story) and get all of the tests to pass. Give it your own personal style. +Compila le [user stories](https://en.wikipedia.org/wiki/User_story) qui sotto e fai passare tutti i test. Dalle il tuo stile personale. -You can use any mix of HTML, JavaScript, CSS, Bootstrap, SASS, React, Redux, and jQuery to complete this project. You should use a frontend framework (like React for example) because this section is about learning frontend frameworks. Additional technologies not listed above are not recommended and using them is at your own risk. We are looking at supporting other frontend frameworks like Angular and Vue, but they are not currently supported. We will accept and try to fix all issue reports that use the suggested technology stack for this project. Happy coding! +Puoi utilizzare qualsiasi mix di HTML, JavaScript, CSS, Bootstrap, SASS, React, Redux e jQuery per completare questo progetto. Dovresti usare un framework frontend (come React per esempio) perché questa sezione riguarda l'apprendimento dei framework per il frontend. Ulteriori tecnologie non elencate sopra non sono raccomandate e usarle è a tuo rischio. Stiamo cercando di supportare altri framework per il frontend come Angular e Vue, ma attualmente non sono supportati. Accetteremo e cercheremo di risolvere tutte le segnalazioni di problemi che utilizzano lo stack tecnologico suggerito per questo progetto. Happy coding! -**User Story #1:** I can see a wrapper element with a corresponding `id="quote-box"`. +**User Story #1:** Posso vedere un elemento wrapper con un corrispondente `id="quote-box"`. -**User Story #2:** Within `#quote-box`, I can see an element with a corresponding `id="text"`. +**User Story #2:** Dentro a `#quote-box` posso vedere un elemento con un corrispondente `id="text"`. -**User Story #3:** Within `#quote-box`, I can see an element with a corresponding `id="author"`. +**User Story #3:** Dentro a `#quote-box` posso vedere un elemento con un corrispondente `id="author"`. -**User Story #4:** Within `#quote-box`, I can see a clickable element with a corresponding `id="new-quote"`. +**User Story #4:** Dentro a `#quote-box`, posso vedere un elemento cliccabile con un corrispondente `id="new-quote"`. -**User Story #5:** Within `#quote-box`, I can see a clickable `a` element with a corresponding `id="tweet-quote"`. +**User Story #5:** Dentro a `#quote-box`, posso vedere un elemento cliccabile `a` con un corrispondente `id="tweet-quote"`. -**User Story #6:** On first load, my quote machine displays a random quote in the element with `id="text"`. +**User Story #6:** Al caricamento iniziale, la mia macchina per le citazioni visualizza una citazione casuale nell'elemento con `id="text"`. -**User Story #7:** On first load, my quote machine displays the random quote's author in the element with `id="author"`. +**User Story #7:** Al caricamento iniziale, la mia macchina per le citazioni visualizza l'autore della citazione casuale nell'elemento con `id="author"`. -**User Story #8:** When the `#new-quote` button is clicked, my quote machine should fetch a new quote and display it in the `#text` element. +**User Story #8:** Quando si clicca sul pulsante `#new-quote`, la mia macchina per le citazioni dovrebbe andare a prendere una nuova citazione e visualizzarla nell'elemento `#text`. -**User Story #9:** My quote machine should fetch the new quote's author when the `#new-quote` button is clicked and display it in the `#author` element. +**User Story #9:** La mia macchina per le citazioni dovrebbe andare a prendere l'autore della nuova citazione quando viene cliccato il pulsante `#new-quote` e visualizzarlo nell'elemento `#author`. -**User Story #10:** I can tweet the current quote by clicking on the `#tweet-quote` `a` element. This `a` element should include the `"twitter.com/intent/tweet"` path in its `href` attribute to tweet the current quote. +**User Story #10:** Posso twittare la citazione corrente cliccando sull'elemento `a` `#tweet-quote`. Questo elemento `a` dovrebbe includere il percorso `"twitter.com/intent/tweet"` nel suo attributo `href` per twittare la citazione corrente. -**User Story #11:** The `#quote-box` wrapper element should be horizontally centered. Please run tests with browser's zoom level at 100% and page maximized. +**User Story #11:** L'elemento contenitore `#quote-box` dovrebbe essere centrato orizzontalmente. Ti preghiamo di eseguire i test con un livello di zoom del browser al 100% e la pagina massimizzata. -You can build your project by using this CodePen template and clicking `Save` to create your own pen. Or you can use this CDN link to run the tests in any environment you like: `https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js` +Puoi costruire il tuo progetto usando questo modello CodePen e facendo clic su `Save` per creare il tuo pen. Oppure puoi usare questo link CDN per eseguire i test in qualsiasi ambiente tu voglia: `https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js` -Once you're done, submit the URL to your working project with all its tests passing. +Una volta fatto, invia l'URL del tuo progetto di lavoro con tutti i suoi test superati. -**Note:** Twitter does not allow links to be loaded in an iframe. Try using the `target="_blank"` or `target="_top"` attribute on the `#tweet-quote` element if your tweet won't load. `target="_top"` will replace the current tab so make sure your work is saved. +**Nota:** Twitter non consente di caricare i link in un iframe. Prova a usare l'attributo `target="_blank"` o `target="_top"` nell'elemento `#tweet-quote` se il tuo tweet non viene caricato. `target="_top"` sostituirà la scheda corrente quindi assicurati che il tuo lavoro sia stato salvato. # --solutions-- diff --git a/curriculum/challenges/italian/03-front-end-libraries/react/give-sibling-elements-a-unique-key-attribute.md b/curriculum/challenges/italian/03-front-end-libraries/react/give-sibling-elements-a-unique-key-attribute.md index 23751b823b..bba4f91fe6 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/react/give-sibling-elements-a-unique-key-attribute.md +++ b/curriculum/challenges/italian/03-front-end-libraries/react/give-sibling-elements-a-unique-key-attribute.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d403618b -title: Give Sibling Elements a Unique Key Attribute +title: Dare agli elementi fratelli un attributo chiave univoco challengeType: 6 forumTopicId: 301394 dashedName: give-sibling-elements-a-unique-key-attribute @@ -8,19 +8,19 @@ dashedName: give-sibling-elements-a-unique-key-attribute # --description-- -The last challenge showed how the `map` method is used to dynamically render a number of elements based on user input. However, there was an important piece missing from that example. When you create an array of elements, each one needs a `key` attribute set to a unique value. React uses these keys to keep track of which items are added, changed, or removed. This helps make the re-rendering process more efficient when the list is modified in any way. +L'ultima sfida ha mostrato come viene utilizzato il metodo `map` per rendere dinamicamente un certo numero di elementi basati sull'input dell'utente. Tuttavia in quell'esempio mancava una parte importante. Quando crei un array di elementi, ognuno ha bisogno di un attributo `key` impostato su un valore univoco. React utilizza queste chiavi per tenere traccia degli elementi aggiunti, modificati o rimossi. Questo aiuta a rendere il processo di ri-rendering più efficiente quando l'elenco viene modificato in qualsiasi modo. -**Note:** Keys only need to be unique between sibling elements, they don't need to be globally unique in your application. +**Nota:** Le chiavi devono essere uniche solo tra gli elementi fratelli: non c'è bisogno che siano uniche a livello globale nella tua applicazione. # --instructions-- -The code editor has an array with some front end frameworks and a stateless functional component named `Frameworks()`. `Frameworks()` needs to map the array to an unordered list, much like in the last challenge. Finish writing the `map` callback to return an `li` element for each framework in the `frontEndFrameworks` array. This time, make sure to give each `li` a `key` attribute, set to a unique value. The `li` elements should also contain text from `frontEndFrameworks`. +L'editor di codice ha un array con alcuni framework di front-end e un componente funzionale senza stato chiamato `Frameworks()`. `Frameworks()` ha bisogno di mappare l'array in una lista non ordinata, molto simile a quella dell'ultima sfida. Termina la scrittura della callback di `map` per restituire un elemento `li` per ogni framework nell'array `frontEndFrameworks`. Questa volta, assicurati di dare ad ogni attributo `li` un attributo `key` impostato su un valore univoco. Gli elementi `li` dovrebbero contenere anche del testo preso da `frontEndFrameworks`. -Normally, you want to make the key something that uniquely identifies the element being rendered. As a last resort the array index may be used, but typically you should try to use a unique identification. +Normalmente, si desidera costruire la chiave con qualcosa che identifica univocamente l'elemento che viene presentato. Come ultima risorsa può essere utilizzato l'indice dell'array, ma in generale dovresti provare a usare un'identificazione univoca. # --hints-- -The `Frameworks` component should exist and render to the page. +Il componente `Frameworks` dovrebbe esistere ed essere presentato nella pagina. ```js assert( @@ -28,19 +28,19 @@ assert( ); ``` -`Frameworks` should render an `h1` element. +`Frameworks` dovrebbe effetturare il rendering di un elemento `h1`. ```js assert(Enzyme.mount(React.createElement(Frameworks)).find('h1').length === 1); ``` -`Frameworks` should render a `ul` element. +`Frameworks` dovrebbe effetturare il rendering di un elemento `ul`. ```js assert(Enzyme.mount(React.createElement(Frameworks)).find('ul').length === 1); ``` -The `ul` tag should render 6 child `li` elements. +Il tag `ul` dovrebbe fare il rendering di 6 elementi figli `li`. ```js assert( @@ -54,7 +54,7 @@ assert( ); ``` -Each list item element should have a unique `key` attribute. +Ogni elemento della lista dovrebbe avere un attributo `key` univoco. ```js assert( @@ -73,7 +73,7 @@ assert( ); ``` -Each list item element should contain text from `frontEndFrameworks`. +Ogni elemento della lista dovrebbe contenere del testo preso da `frontEndFrameworks`. ```js assert( diff --git a/curriculum/challenges/italian/03-front-end-libraries/react/introducing-inline-styles.md b/curriculum/challenges/italian/03-front-end-libraries/react/introducing-inline-styles.md index 1266a6cea2..19a5a3bd9f 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/react/introducing-inline-styles.md +++ b/curriculum/challenges/italian/03-front-end-libraries/react/introducing-inline-styles.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d4036181 -title: Introducing Inline Styles +title: Gli stili inline challengeType: 6 forumTopicId: 301395 dashedName: introducing-inline-styles @@ -8,33 +8,33 @@ dashedName: introducing-inline-styles # --description-- -There are other complex concepts that add powerful capabilities to your React code. But you may be wondering about the more simple problem of how to style those JSX elements you create in React. You likely know that it won't be exactly the same as working with HTML because of [the way you apply classes to JSX elements](/learn/front-end-libraries/react/define-an-html-class-in-jsx). +Ci sono altri concetti complessi che aggiungono potenti funzionalità al tuo codice React. Ma forse ti stai chiedendo come stilizzare quegli elementi JSX che crei in React. Probabilmente sai che non sarà esattamente come lavorare con HTML a causa del [modo in cui applichi le classi agli elementi JSX](/learn/front-end-libraries/react/define-an-html-class-in-jsx). -If you import styles from a stylesheet, it isn't much different at all. You apply a class to your JSX element using the `className` attribute, and apply styles to the class in your stylesheet. Another option is to apply inline styles, which are very common in ReactJS development. +Se importi degli stili da un foglio di stile, non poi è così diverso. Applichi una classe al tuo elemento JSX usando l'attributo `className` e applichi gli stili alla classe nel tuo foglio di stile. Un'altra opzione è quella di applicare degli stili in linea, che sono molto comuni nello sviluppo di ReactJS. -You apply inline styles to JSX elements similar to how you do it in HTML, but with a few JSX differences. Here's an example of an inline style in HTML: +Puoi applicare degli stili in linea a elementi JSX in modo simile a come faresti in HTML, ma con alcune differenze JSX. Ecco un esempio di uno stile in linea in HTML: ```jsx
Mellow Yellow
``` -JSX elements use the `style` attribute, but because of the way JSX is transpiled, you can't set the value to a `string`. Instead, you set it equal to a JavaScript `object`. Here's an example: +Gli elementi JSX usano l'attributo `style`, ma a causa del modo in cui JSX è transcodificato, non puoi impostare il valore su una `string`. Invece, gli assegnerai un `object` JavaScript. Ecco un esempio: ```jsx
Mellow Yellow
``` -Notice how we camelCase the `fontSize` property? This is because React will not accept kebab-case keys in the style object. React will apply the correct property name for us in the HTML. +Vedi come abbiamo usato camelCase nella proprietà `fontSize`? Questo perché React non accetterà le chiavi kebab-case nell'oggetto style. React applicherà per noi il nome di proprietà corretto in HTML. # --instructions-- -Add a `style` attribute to the `div` in the code editor to give the text a color of red and font size of `72px`. +Aggiungi un attributo `style` al `div`nell'editor di codice per dare al testo un colore rosso e una dimensione del carattere di `72px`. -Note that you can optionally set the font size to be a number, omitting the units `px`, or write it as `72px`. +Nota che è possibile impostare facoltativamente la dimensione del carattere come un numero, omettendo le unità `px` o scrivendole come `72px`. # --hints-- -The component should render a `div` element. +Il componente dovrebbe mostrare un elemento `div`. ```js assert( @@ -45,7 +45,7 @@ assert( ); ``` -The `div` element should have a color of `red`. +L'elemento `div` dovrebbe avere un colore `red`. ```js assert( @@ -56,7 +56,7 @@ assert( ); ``` -The `div` element should have a font size of `72px`. +L'elemento `div` dovrebbe avere una dimensione del carattere di `72px`. ```js assert( diff --git a/curriculum/challenges/italian/03-front-end-libraries/react/learn-about-self-closing-jsx-tags.md b/curriculum/challenges/italian/03-front-end-libraries/react/learn-about-self-closing-jsx-tags.md index 31edb73183..10b87774f6 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/react/learn-about-self-closing-jsx-tags.md +++ b/curriculum/challenges/italian/03-front-end-libraries/react/learn-about-self-closing-jsx-tags.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d4036161 -title: Learn About Self-Closing JSX Tags +title: Tag JSX a chiusura automatica challengeType: 6 forumTopicId: 301396 dashedName: learn-about-self-closing-jsx-tags @@ -8,35 +8,35 @@ dashedName: learn-about-self-closing-jsx-tags # --description-- -So far, you’ve seen how JSX differs from HTML in a key way with the use of `className` vs. `class` for defining HTML classes. +Finora, hai visto come JSX si differenzia dall'HTML in modo essenziale con l'uso di `className` al posto di `class` per la definizione delle classi HTML. -Another important way in which JSX differs from HTML is in the idea of the self-closing tag. +Un altro aspetto importante in cui JSX differisce da HTML è quello che riguarda i tag a chiusura automatica (self-closing). -In HTML, almost all tags have both an opening and closing tag: `
`; the closing tag always has a forward slash before the tag name that you are closing. However, there are special instances in HTML called “self-closing tags”, or tags that don’t require both an opening and closing tag before another tag can start. +In HTML, quasi tutti i tag hanno sia un tag di apertura che di chiusura: `
`; il tag di chiusura ha sempre una barra in avanti prima del nome del tag che si sta chiudendo. Tuttavia, ci sono dei casi speciali in HTML chiamati “tag a chiusura automatica”, cioè dei tag che non richiedono sia un tag di apertura che di chiusura prima che un altro tag possa iniziare. -For example the line-break tag can be written as `
` or as `
`, but should never be written as `

`, since it doesn't contain any content. +Ad esempio, il tag line-break può essere scritto come `
` o come `
`, ma non dovrebbe mai essere scritto come `

`, poiché non contiene alcun contenuto. -In JSX, the rules are a little different. Any JSX element can be written with a self-closing tag, and every element must be closed. The line-break tag, for example, must always be written as `
` in order to be valid JSX that can be transpiled. A `
`, on the other hand, can be written as `
` or `
`. The difference is that in the first syntax version there is no way to include anything in the `
`. You will see in later challenges that this syntax is useful when rendering React components. +In JSX, le regole sono un po 'diverse. Qualsiasi elemento JSX può essere scritto con un tag a chiusura automatica, e ogni elemento deve essere chiuso. Il tag line-break, ad esempio, deve essere sempre scritto come `
` per essere codice JSX valido che possa essere transcodificato. Un `
`, invece, può essere scritto come `
` o `
`. La differenza è che nella prima versione della sintassi non c'è modo di includere nulla nel `
`. Vedrai nelle sfide successive che questa sintassi è utile durante il rendering dei componenti React. # --instructions-- -Fix the errors in the code editor so that it is valid JSX and successfully transpiles. Make sure you don't change any of the content - you only need to close tags where they are needed. +Correggi gli errori nell'editor di codice in modo che sia JSX valido e venga transcodificato con successo. Assicurati di non modificare nessuno dei contenuti - devi solo chiudere i tag dove necessario. # --hints-- -The constant `JSX` should return a `div` element. +La costante `JSX` dovrebbe restituire un elemento `div`. ```js assert.strictEqual(JSX.type, 'div'); ``` -The `div` should contain a `br` tag. +Il `div` dovrebbe contenere un tag `br`. ```js assert(Enzyme.shallow(JSX).find('br').length === 1); ``` -The `div` should contain an `hr` tag. +Il `div` dovrebbe contenere un tag `hr`. ```js assert(Enzyme.shallow(JSX).find('hr').length === 1); diff --git a/curriculum/challenges/italian/03-front-end-libraries/react/optimize-re-renders-with-shouldcomponentupdate.md b/curriculum/challenges/italian/03-front-end-libraries/react/optimize-re-renders-with-shouldcomponentupdate.md index 661ea8e6dd..aa0ad363a1 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/react/optimize-re-renders-with-shouldcomponentupdate.md +++ b/curriculum/challenges/italian/03-front-end-libraries/react/optimize-re-renders-with-shouldcomponentupdate.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d4036180 -title: Optimize Re-Renders with shouldComponentUpdate +title: Ottimizzare il re-rendering con shouldComponentUpdate challengeType: 6 forumTopicId: 301398 dashedName: optimize-re-renders-with-shouldcomponentupdate @@ -8,17 +8,17 @@ dashedName: optimize-re-renders-with-shouldcomponentupdate # --description-- -So far, if any component receives new `state` or new `props`, it re-renders itself and all its children. This is usually okay. But React provides a lifecycle method you can call when child components receive new `state` or `props`, and declare specifically if the components should update or not. The method is `shouldComponentUpdate()`, and it takes `nextProps` and `nextState` as parameters. +Finora, se un componente riceve un nuovo `state` o nuove `props`, avvia un re-rendering di sé stesso e di tutti i suoi figli. Questo normalmente va bene. Ma React fornisce un metodo per il ciclo di vita che puoi chiamare quando i componenti figli ricevono un nuovo `state` o `props`, e dichiarare specificamente se i componenti devono essere aggiornati o meno. Il metodo è `shouldComponentUpdate()`, e richiede `nextProps` e `nextState` come parametri. -This method is a useful way to optimize performance. For example, the default behavior is that your component re-renders when it receives new `props`, even if the `props` haven't changed. You can use `shouldComponentUpdate()` to prevent this by comparing the `props`. The method must return a `boolean` value that tells React whether or not to update the component. You can compare the current props (`this.props`) to the next props (`nextProps`) to determine if you need to update or not, and return `true` or `false` accordingly. +Questo metodo è un modo utile per ottimizzare le prestazioni. Ad esempio, il comportamento predefinito è che il tuo componente rifà il render quando riceve nuove `props`, anche se le `props` non sono cambiate. È possibile utilizzare `shouldComponentUpdate()` per evitarlo confrontando le `props`. Il metodo deve restituire un valore `boolean` che dice a React se aggiornare o meno il componente. Puoi confrontare gli elementi attuali (`this.props`) con le nuove props (`nextProps`) per determinare se è necessario aggiornare o meno, e restituire `true` o `false` di conseguenza. # --instructions-- -The `shouldComponentUpdate()` method is added in a component called `OnlyEvens`. Currently, this method returns `true` so `OnlyEvens` re-renders every time it receives new `props`. Modify the method so `OnlyEvens` updates only if the `value` of its new props is even. Click the `Add` button and watch the order of events in your browser's console as the lifecycle hooks are triggered. +Il metodo `shouldComponentUpdate()` viene aggiunto in un componente chiamato `OnlyEvens`. Attualmente, questo metodo restituisce `true` così `OnlyEvens` rifà il render ogni volta che riceve nuove `props`. Modifica il metodo in modo che `OnlyEvens` aggiorni solo se il `value` delle sue nuove props è pari. Fai clic sul pulsante `Add` e guarda l'ordine degli eventi nella console del browser mano a mano che vengono attivati durante il ciclo di vita. # --hints-- -The `Controller` component should render the `OnlyEvens` component as a child. +Il componente `Controller` dovrebbe fare il rendering del componente figlio `OnlyEvens`. ```js assert( @@ -32,7 +32,7 @@ assert( ); ``` -The `shouldComponentUpdate` method should be defined on the `OnlyEvens` component. +Il metodo `shouldComponentUpdate` dovrebbe essere definito sul componente `OnlyEvens`. ```js assert( @@ -45,7 +45,7 @@ assert( ); ``` -The `OnlyEvens` component should return an `h1` tag which renders the value of `this.props.value`. +Il componente `OnlyEvens` dovrebbe restituire un tag `h1` che presenta il valore di `this.props.value`. ```js (() => { @@ -64,7 +64,7 @@ The `OnlyEvens` component should return an `h1` tag which renders the value of ` })(); ``` -`OnlyEvens` should re-render only when `nextProps.value` is even. +`OnlyEvens` dovrebbe rifare il render solo quando `nextProps.value` è pari. ```js (() => { diff --git a/curriculum/challenges/italian/03-front-end-libraries/react/override-default-props.md b/curriculum/challenges/italian/03-front-end-libraries/react/override-default-props.md index 9a6afa9795..a29da5e0ba 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/react/override-default-props.md +++ b/curriculum/challenges/italian/03-front-end-libraries/react/override-default-props.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d403616c -title: Override Default Props +title: Sovrascrivere le proprietà predefinite challengeType: 6 forumTopicId: 301399 dashedName: override-default-props @@ -8,17 +8,17 @@ dashedName: override-default-props # --description-- -The ability to set default props is a useful feature in React. The way to override the default props is to explicitly set the prop values for a component. +La possibilità di impostare delle proprietà predefinite è una caratteristica utile in React. Per sovrascrivere gli elementi predefiniti si devono impostare esplicitamente i valori delle proprietà per un componente. # --instructions-- -The `ShoppingCart` component now renders a child component `Items`. This `Items` component has a default prop `quantity` set to the integer `0`. Override the default prop by passing in a value of `10` for `quantity`. +Il componente `ShoppingCart` ora presenta un componente figlio `Items`. Questo componente `Items` ha una proprietà di default `quantity` impostata all'intero `0`. Sovrascrivi la proprietà predefinita passando un valore di `10` per `quantity`. -**Note:** Remember that the syntax to add a prop to a component looks similar to how you add HTML attributes. However, since the value for `quantity` is an integer, it won't go in quotes but it should be wrapped in curly braces. For example, `{100}`. This syntax tells JSX to interpret the value within the braces directly as JavaScript. +**Nota:** Ricorda che la sintassi per aggiungere una proprietà a un componente è simile a quella degli attributi HTML. Tuttavia, poiché il valore per la `quantity` è un numero intero, non andrà tra virgolette ma dovrebbe essere racchiusa tra parentesi graffe. Ad esempio, `{100}`. Questa sintassi dice a JSX di interpretare il valore all'interno delle parentesi graffe direttamente come JavaScript. # --hints-- -The component `ShoppingCart` should render. +Il componente `ShoppingCart` dovrebbe effettuare il render. ```js assert( @@ -29,7 +29,7 @@ assert( ); ``` -The component `Items` should render. +Il componente `Items` dovrebbe effettuare il render. ```js assert( @@ -40,7 +40,7 @@ assert( ); ``` -The `Items` component should have a prop of `{ quantity: 10 }` passed from the `ShoppingCart` component. +Il componente `Items` dovrebbe avere una proprietà di `{ quantity: 10 }` passata dal componente `ShoppingCart`. ```js (getUserInput) => diff --git a/curriculum/challenges/italian/03-front-end-libraries/react/pass-a-callback-as-props.md b/curriculum/challenges/italian/03-front-end-libraries/react/pass-a-callback-as-props.md index e542314e5f..c51eb0a7c8 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/react/pass-a-callback-as-props.md +++ b/curriculum/challenges/italian/03-front-end-libraries/react/pass-a-callback-as-props.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d403617b -title: Pass a Callback as Props +title: Passare una Callback come proprietà challengeType: 6 forumTopicId: 301400 dashedName: pass-a-callback-as-props @@ -8,17 +8,17 @@ dashedName: pass-a-callback-as-props # --description-- -You can pass `state` as props to child components, but you're not limited to passing data. You can also pass handler functions or any method that's defined on a React component to a child component. This is how you allow child components to interact with their parent components. You pass methods to a child just like a regular prop. It's assigned a name and you have access to that method name under `this.props` in the child component. +Puoi passare lo `state` come proprietà ai componenti figli, ma non sei limitato al passaggio dei dati. Puoi anche passare a un componente figlio delle funzioni di gestione o qualsiasi metodo definito su un componente React. In questo modo permetti ai componenti figli di interagire con i loro componenti genitori. Passi dei metodi a un figlio proprio come delle normali proprietà. Verrà assegnato un nome e potrai accedere a quel nome di metodo da `this.props` nel componente figlio. # --instructions-- -There are three components outlined in the code editor. The `MyApp` component is the parent that will render the `GetInput` and `RenderInput` child components. Add the `GetInput` component to the render method in `MyApp`, then pass it a prop called `input` assigned to `inputValue` from `MyApp`'s `state`. Also create a prop called `handleChange` and pass the input handler `handleChange` to it. +Ci sono tre componenti delineati nell'editor di codice. Il componente `MyApp` è il genitore che presenterà i componenti figli `GetInput` e `RenderInput`. Aggiungi il componente `GetInput` al metodo render in `MyApp`, poi passagli una proprietà chiamata `input` assegnata a `inputValue` dallo `state` di `MyApp`. Crea anche una proprietà chiamata `handleChange` e passale il gestore di input `handleChange`. -Next, add `RenderInput` to the render method in `MyApp`, then create a prop called `input` and pass the `inputValue` from `state` to it. Once you are finished you will be able to type in the `input` field in the `GetInput` component, which then calls the handler method in its parent via props. This updates the input in the `state` of the parent, which is passed as props to both children. Observe how the data flows between the components and how the single source of truth remains the `state` of the parent component. Admittedly, this example is a bit contrived, but should serve to illustrate how data and callbacks can be passed between React components. +Successivamente, aggiungi `RenderInput` al metodo render in `MyApp`, quindi crea una proprietà chiamata `input` e passale l'`inputValue` dallo `state`. Una volta terminato, potrai digitare nel campo `input` nel componente `GetInput`, che poi chiamerà il metodo di gestione nel suo genitore tramite le props. Questo aggiorna l'input nello `state` del genitore, che viene passato come proprietà ad entrambi i figli. Osserva come i dati scorrono tra i componenti e come l'unica fonte di verità rimane lo `state` del componente genitore. Certamente questo esempio è un po' limitato, ma dovrebbe bastare a illustrare come i dati e le callback possono essere passati tra i componenti di React. # --hints-- -The `MyApp` component should render. +Il componente `MyApp` dovrebbe effettuare il render. ```js assert( @@ -29,7 +29,7 @@ assert( ); ``` -The `GetInput` component should render. +Il componente `GetInput` dovrebbe effettuare il render. ```js assert( @@ -40,7 +40,7 @@ assert( ); ``` -The `RenderInput` component should render. +Il componente `RenderInput` dovrebbe effettuare il render. ```js assert( @@ -51,7 +51,7 @@ assert( ); ``` -The `GetInput` component should receive the `MyApp` state property `inputValue` as props and contain an `input` element which modifies `MyApp` state. +Il componente `GetInput` dovrebbe ricevere la proprietà `inputValue` dello stato di `MyApp` e contenere un elemento `input` che modifica lo stato di `MyApp`. ```js async () => { @@ -74,7 +74,7 @@ async () => { }; ``` -The `RenderInput` component should receive the `MyApp` state property `inputValue` as props. +Il componente `RenderInput` dovrebbe ricevere la proprietà `inputValue` dello stato di `MyApp`. ```js async () => { diff --git a/curriculum/challenges/italian/03-front-end-libraries/react/pass-an-array-as-props.md b/curriculum/challenges/italian/03-front-end-libraries/react/pass-an-array-as-props.md index a5b7170b30..851b437c05 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/react/pass-an-array-as-props.md +++ b/curriculum/challenges/italian/03-front-end-libraries/react/pass-an-array-as-props.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d403616a -title: Pass an Array as Props +title: Passare un Array come proprietà challengeType: 6 forumTopicId: 301401 dashedName: pass-an-array-as-props @@ -8,7 +8,7 @@ dashedName: pass-an-array-as-props # --description-- -The last challenge demonstrated how to pass information from a parent component to a child component as `props` or properties. This challenge looks at how arrays can be passed as `props`. To pass an array to a JSX element, it must be treated as JavaScript and wrapped in curly braces. +L'ultima sfida ha mostrato come trasferire le informazioni da un componente genitore a un componente figlio come `props` o proprietà. Questa sfida mostra come gli array possono essere passati come `props`. Per passare un array a un elemento JSX, esso deve essere trattato come JavaScript e avvolto in parentesi graffe. ```jsx @@ -16,15 +16,15 @@ The last challenge demonstrated how to pass information from a parent component ``` -The child component then has access to the array property `colors`. Array methods such as `join()` can be used when accessing the property. `const ChildComponent = (props) =>

{props.colors.join(', ')}

` This will join all `colors` array items into a comma separated string and produce: `

green, blue, red

` Later, we will learn about other common methods to render arrays of data in React. +Il componente figlio ha quindi accesso alla proprietà array `colors`. I metodi sugli array come `join()` possono essere utilizzati quando si accede alla proprietà. `const ChildComponent = (props) =>

{props.colors.join(', ')}

` Questo unirà tutti gli elementi `colors` dell'array in una stringa separata da virgole e produrrà: `

green, blue, red

` Più avanti vedremo altri metodi comuni per fare il rendering di array di dati in React. # --instructions-- -There are `List` and `ToDo` components in the code editor. When rendering each `List` from the `ToDo` component, pass in a `tasks` property assigned to an array of to-do tasks, for example `["walk dog", "workout"]`. Then access this `tasks` array in the `List` component, showing its value within the `p` element. Use `join(", ")` to display the `props.tasks`array in the `p` element as a comma separated list. Today's list should have at least 2 tasks and tomorrow's should have at least 3 tasks. +Nell'editor di codice ci sono i componenti `List` e `ToDo`. Quando si esegue il rendering di ogni `List` dal componente `ToDo`, deve essere passata una proprietà `tasks` assegnata a un array di attività da fare, ad esempio `["walk dog", "workout"]`. Quindi accedi a questo array `tasks` nel componente `List`, mostrandone il valore all'interno dell'elemento `p`. Usa `join(", ")` per visualizzare l'array `props.tasks` nell'elemento `p` come lista separata da virgole. L'elenco di oggi (Today) dovrebbe avere almeno 2 task e quella di domani (Tomorrow) dovrebbe avere almeno 3 task. # --hints-- -The `ToDo` component should return a single outer `div`. +Il componente `ToDo` dovrebbe restituire un singolo `div` esterno. ```js assert( @@ -35,7 +35,7 @@ assert( ); ``` -The third child of the `ToDo` component should be an instance of the `List` component. +Il terzo figlio del componente `ToDo` dovrebbe essere un'istanza del componente `List`. ```js assert( @@ -46,7 +46,7 @@ assert( ); ``` -The fifth child of the `ToDo` component should be an instance of the `List` component. +Il quinto figlio del componente `ToDo` dovrebbe essere un'istanza del componente `List`. ```js assert( @@ -57,7 +57,7 @@ assert( ); ``` -Both instances of the `List` component should have a property called `tasks` and `tasks` should be of type array. +Entrambe le istanze del componente `List` dovrebbero avere una proprietà chiamata `tasks` e `tasks` dovrebbe essere di tipo array. ```js assert( @@ -71,7 +71,7 @@ assert( ); ``` -The first `List` component representing the tasks for today should have 2 or more items. +Il primo componente `List`, che rappresenta le attività per oggi, dovrebbe avere 2 o più elementi. ```js assert( @@ -82,7 +82,7 @@ assert( ); ``` -The second `List` component representing the tasks for tomorrow should have 3 or more items. +Il secondo componente `List`, che rappresenta le attività per domani, dovrebbe avere 3 o più elementi. ```js assert( @@ -93,7 +93,7 @@ assert( ); ``` -The `List` component should render the value from the `tasks` prop in the `p` tag. +Il componente `List` dovrebbe presentare nel tag `p` il valore dalla proprietà `tasks`. ```js assert( diff --git a/curriculum/challenges/italian/03-front-end-libraries/react/pass-props-to-a-stateless-functional-component.md b/curriculum/challenges/italian/03-front-end-libraries/react/pass-props-to-a-stateless-functional-component.md index b8f6117708..a2e090fd89 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/react/pass-props-to-a-stateless-functional-component.md +++ b/curriculum/challenges/italian/03-front-end-libraries/react/pass-props-to-a-stateless-functional-component.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d4036169 -title: Pass Props to a Stateless Functional Component +title: Passare proprietà a un componente funzionale senza stato challengeType: 6 forumTopicId: 301402 dashedName: pass-props-to-a-stateless-functional-component @@ -8,7 +8,7 @@ dashedName: pass-props-to-a-stateless-functional-component # --description-- -The previous challenges covered a lot about creating and composing JSX elements, functional components, and ES6 style class components in React. With this foundation, it's time to look at another feature very common in React: **props**. In React, you can pass props, or properties, to child components. Say you have an `App` component which renders a child component called `Welcome` which is a stateless functional component. You can pass `Welcome` a `user` property by writing: +Le sfide precedenti riguardavano la creazione e la composizione di elementi JSX, componenti funzionali e componenti ES6 di classe style in React. Con queste fondamenta, è il momento di guardare un'altra caratteristica molto comune in React: le **props**. In React, puoi passare props, o proprietà, a componenti figli. Diciamo che tu abbia un componente `App` che presenta un componente figlio chiamato `Welcome` che è un componente funzionale senza stato. Puoi passare a `Welcome` una proprietà `user` scrivendo: ```jsx @@ -16,21 +16,21 @@ The previous challenges covered a lot about creating and composing JSX elements, ``` -You use **custom HTML attributes** created by you and supported by React to be passed to the component. In this case, the created property `user` is passed to the component `Welcome`. Since `Welcome` is a stateless functional component, it has access to this value like so: +Utilizzi degli **attributi HTML personalizzati** creati da te e passati da React al componente. In questo caso, la proprietà `user` che hai creato viene passata al componente `Welcome`. Dal momento che `Welcome` è un componente funzionale senza stato, ha accesso a questo valore in questo modo: ```jsx const Welcome = (props) =>

Hello, {props.user}!

``` -It is standard to call this value `props` and when dealing with stateless functional components, you basically consider it as an argument to a function which returns JSX. You can access the value of the argument in the function body. With class components, you will see this is a little different. +È comune chiamare questo valore `props` e quando si tratta di componenti funzionali senza stato, lo consideri fondamentalmente come un argomento per una funzione che restituisce JSX. Puoi accedere al valore dell'argomento nel corpo della funzione. Con i componenti di classe, vedrai che questo è un po' diverso. # --instructions-- -There are `Calendar` and `CurrentDate` components in the code editor. When rendering `CurrentDate` from the `Calendar` component, pass in a property of `date` assigned to the current date from JavaScript's `Date` object. Then access this `prop` in the `CurrentDate` component, showing its value within the `p` tags. Note that for `prop` values to be evaluated as JavaScript, they must be enclosed in curly brackets, for instance `date={Date()}`. +Nell'editor di codice ci sono i componenti `Calendar` e `CurrentDate`. Quando fai il rendering di `CurrentDate` dal componente `Calendar`, passagli una proprietà `date` assegnata alla data corrente dall'oggetto `Date` di JavaScript. Quindi accedi a questa `prop` nel componente `CurrentDate`, mostrandone il valore all'interno dei tag `p`. Nota che affinché i valori `prop` siano valutati come JavaScript, devono essere racchiusi tra parentesi graffe, ad esempio `date={Date()}`. # --hints-- -The `Calendar` component should return a single `div` element. +Il componente `Calendar` dovrebbe restituire un singolo elemento `div`. ```js assert( @@ -41,7 +41,7 @@ assert( ); ``` -The second child of the `Calendar` component should be the `CurrentDate` component. +Il secondo figlio del componente `Calendar` dovrebbe essere il componente `CurrentDate`. ```js assert( @@ -52,7 +52,7 @@ assert( ); ``` -The `CurrentDate` component should have a prop called `date`. +Il componente `CurrentDate` dovrebbe avere una prop chiamata `date`. ```js assert( @@ -63,7 +63,7 @@ assert( ); ``` -The `date` prop of the `CurrentDate` should contain a string of text. +La proprietà `date` di `CurrentDate` dovrebbe contenere una stringa di testo. ```js assert( @@ -75,13 +75,13 @@ assert( ); ``` -The `date` prop should be generated by calling `Date()` +La proprietà `date` dovrebbe essere generata chiamando `Date()` ```js assert(//.test(__helpers.removeWhiteSpace(code))); ``` -The `CurrentDate` component should render the value from the `date` prop in the `p` tag. +Il componente `CurrentDate` dovrebbe presentare nel tag `p` il valore della proprietà `date`. ```js let date = 'dummy date'; diff --git a/curriculum/challenges/italian/03-front-end-libraries/react/pass-state-as-props-to-child-components.md b/curriculum/challenges/italian/03-front-end-libraries/react/pass-state-as-props-to-child-components.md index e0554a5a98..cd2d8dd2f7 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/react/pass-state-as-props-to-child-components.md +++ b/curriculum/challenges/italian/03-front-end-libraries/react/pass-state-as-props-to-child-components.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d403617a -title: Pass State as Props to Child Components +title: Passare State come Props ai componenti figli challengeType: 6 forumTopicId: 301403 dashedName: pass-state-as-props-to-child-components @@ -8,19 +8,19 @@ dashedName: pass-state-as-props-to-child-components # --description-- -You saw a lot of examples that passed props to child JSX elements and child React components in previous challenges. You may be wondering where those props come from. A common pattern is to have a stateful component containing the `state` important to your app, that then renders child components. You want these components to have access to some pieces of that `state`, which are passed in as props. +Hai visto un sacco di esempi che hanno passato le proprietà a elementi JSX figli e a componenti React figli nelle sfide precedenti. Potresti chiederti da dove provengono quelle proprietà. Un modello comune è quello di avere un componente stateful contenente lo `state` importante per la tua app, che poi presenta i componenti figli. Vuoi che questi componenti abbiano accesso ad alcune parti di quello `state`che viene passato come props (proprietà). -For example, maybe you have an `App` component that renders a `Navbar`, among other components. In your `App`, you have `state` that contains a lot of user information, but the `Navbar` only needs access to the user's username so it can display it. You pass that piece of `state` to the `Navbar` component as a prop. +Ad esempio, forse hai un componente `App` che presenta una `Navbar`, tra gli altri componenti. Nella tua `App` hai `state` che contiene molte informazioni dell'utente, ma la `Navbar` ha solo bisogno di accedere al nome utente dell'utente in modo da visualizzarlo. Passa quel pezzo di `state` al componente `Navbar` come una prop. -This pattern illustrates some important paradigms in React. The first is *unidirectional data flow*. State flows in one direction down the tree of your application's components, from the stateful parent component to child components. The child components only receive the state data they need. The second is that complex stateful apps can be broken down into just a few, or maybe a single, stateful component. The rest of your components simply receive state from the parent as props, and render a UI from that state. It begins to create a separation where state management is handled in one part of code and UI rendering in another. This principle of separating state logic from UI logic is one of React's key principles. When it's used correctly, it makes the design of complex, stateful applications much easier to manage. +Questo modello illustra alcuni paradigmi importanti in React. Il primo è il *flusso di dati unidirezionale*. Lo stato scorre in una direzione lungo l'albero dei componenti della tua applicazione, dal componente genitore stateful ai componenti figli. I componenti figlio ricevono solo i dati di stato di cui hanno bisogno. Il secondo è che complesse app stateful possono essere suddivise in alcuni, o anche un singolo componente stateful. Il resto dei tuoi componenti semplicemente riceve lo stato dal genitore come props, e presenta un'interfaccia utente da quello stato. Si comincia col creare una separazione in cui la gestione dello stato viene gestita in una parte del codice e il rendering dell'interfaccia utente in un'altra. Questo principio di separazione della logica dello stato dalla logica dell'interfaccia utente è uno dei principi chiave di React. Quando viene utilizzato correttamente, rende la progettazione di applicazioni stateful complesse molto più facile da gestire. # --instructions-- -The `MyApp` component is stateful and renders a `Navbar` component as a child. Pass the `name` property in its `state` down to the child component, then show the `name` in the `h1` tag that's part of the `Navbar` render method. `name` should appear after the text `Hello, my name is:`. +Il componente `MyApp` è stateful e presenta un componente `Navbar` come figlio. Passa la proprietà `name` del suo `state` al componente figlio, poi mostra il `name` nel tag `h1` che fa parte del metodo render di `Navbar`. `name` dovrebbe apparire dopo il testo `Hello, my name is:`. # --hints-- -The `MyApp` component should render with a `Navbar` component inside. +Il componente `MyApp` dovrebbe eseguire il render con un componente `Navbar` al suo interno. ```js assert( @@ -34,7 +34,7 @@ assert( ); ``` -The `Navbar` component should receive the `MyApp` state property `name` as props. +Il componente `Navbar` dovrebbe ricevere la proprietà `name` dello stato di `MyApp` come proprietà. ```js async () => { @@ -50,7 +50,7 @@ async () => { }; ``` -The `h1` element in `Navbar` should render the `name` prop. +L'elemento `h1` in `Navbar` dovrebbe presentare la proprietà `name`. ```js async () => { diff --git a/curriculum/challenges/italian/03-front-end-libraries/react/render-a-class-component-to-the-dom.md b/curriculum/challenges/italian/03-front-end-libraries/react/render-a-class-component-to-the-dom.md index 2e3a9a7a56..99ed2f0f5f 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/react/render-a-class-component-to-the-dom.md +++ b/curriculum/challenges/italian/03-front-end-libraries/react/render-a-class-component-to-the-dom.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d4036167 -title: Render a Class Component to the DOM +title: Presentare un componente di classe nel DOM challengeType: 6 forumTopicId: 301404 dashedName: render-a-class-component-to-the-dom @@ -8,19 +8,19 @@ dashedName: render-a-class-component-to-the-dom # --description-- -You may remember using the ReactDOM API in an earlier challenge to render JSX elements to the DOM. The process for rendering React components will look very similar. The past few challenges focused on components and composition, so the rendering was done for you behind the scenes. However, none of the React code you write will render to the DOM without making a call to the ReactDOM API. +Potresti ricordare l'uso dell'API ReactDOM in una sfida precedente, usata per fare il render degli elementi JSX nel DOM. Il processo di rendering dei componenti di React sarà molto simile. Le poche sfide viste finora si sono concentrate su componenti e composizione, e il rendering è stato fatto per te dietro le quinte. Tuttavia, niente del codice React che scrivi sarà presentato nel DOM senza effettuare una chiamata all'API ReactDOM. -Here's a refresher on the syntax: `ReactDOM.render(componentToRender, targetNode)`. The first argument is the React component that you want to render. The second argument is the DOM node that you want to render that component within. +Ecco un ripasso della sintassi: `ReactDOM.render(componentToRender, targetNode)`. Il primo argomento è il componente React che si desidera presentare. Il secondo argomento è il nodo del DOM all'interno del quale si desidera fare il render di quel componente. -React components are passed into `ReactDOM.render()` a little differently than JSX elements. For JSX elements, you pass in the name of the element that you want to render. However, for React components, you need to use the same syntax as if you were rendering a nested component, for example `ReactDOM.render(, targetNode)`. You use this syntax for both ES6 class components and functional components. +I componenti React sono passati in `ReactDOM.render()` in modo un po' diverso dagli elementi JSX. Per gli elementi JSX, passi il nome dell'elemento che desideri presentare. Tuttavia, per i componenti React, è necessario utilizzare la stessa sintassi come se si stesse presentando un componente nidificato, ad esempio `ReactDOM.render(, targetNode)`. Si utilizza questa sintassi sia per i componenti di classe ES6 che per i componenti funzionali. # --instructions-- -Both the `Fruits` and `Vegetables` components are defined for you behind the scenes. Render both components as children of the `TypesOfFood` component, then render `TypesOfFood` to the DOM. There is a `div` with `id='challenge-node'` available for you to use. +I componenti `Fruits` e `Vegetables` sono definiti per te dietro le quinte. Presenta entrambi i componenti come figli del componente `TypesOfFood`, quindi presenta `TypesOfFood` nel DOM. C'è un `div` con `id='challenge-node'` pronto all'uso per te. # --hints-- -The `TypesOfFood` component should return a single `div` element. +Il componente `TypesOfFood` dovrebbe restituire un singolo elemento `div`. ```js assert( @@ -31,7 +31,7 @@ assert( ); ``` -The `TypesOfFood` component should render the `Fruits` component after the `h1` element. +Il componente `TypesOfFood` dovrebbe presentare il componente `Fruits` dopo l'elemento `h1`. ```js assert( @@ -42,7 +42,7 @@ assert( ); ``` -The `TypesOfFood` component should render the `Vegetables` component after `Fruits`. +Il componente `TypesOfFood` dovrebbe presentare il componente `Vegetables` dopo `Fruits`. ```js assert( @@ -53,7 +53,7 @@ assert( ); ``` -The `TypesOfFood` component should render to the DOM within the `div` with the id `challenge-node`. +Il componente `TypesOfFood` dovrebbe essere presentato nel DOM all'interno del `div` con l'id `challenge-node`. ```js assert( diff --git a/curriculum/challenges/italian/03-front-end-libraries/react/render-conditionally-from-props.md b/curriculum/challenges/italian/03-front-end-libraries/react/render-conditionally-from-props.md index e69e98305a..2d30baa034 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/react/render-conditionally-from-props.md +++ b/curriculum/challenges/italian/03-front-end-libraries/react/render-conditionally-from-props.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d4036188 -title: Render Conditionally from Props +title: Presentare condizionalmente dalle Props challengeType: 6 forumTopicId: 301405 dashedName: render-conditionally-from-props @@ -8,21 +8,21 @@ dashedName: render-conditionally-from-props # --description-- -So far, you've seen how to use `if/else`, `&&`, and the ternary operator (`condition ? expressionIfTrue : expressionIfFalse`) to make conditional decisions about what to render and when. However, there's one important topic left to discuss that lets you combine any or all of these concepts with another powerful React feature: props. Using props to conditionally render code is very common with React developers — that is, they use the value of a given prop to automatically make decisions about what to render. +Finora, hai visto come usare `if/else`, `&&`, e l'operatore ternario (`condition ? expressionIfTrue : expressionIfFalse`) per prendere decisioni condizionali su cosa presentare e quando. Tuttavia, c'è ancora un argomento importante da discutere che consente di combinare uno o tutti questi concetti con un'altra potente funzionalità di React: le props. Usare le proprietà (props) per presentare il codice condizionalmente è molto comune tra gli sviluppatori di React — cioè essi usano il valore di una determinata proprietà per prendere automaticamente delle decisioni su cosa presentare. -In this challenge, you'll set up a child component to make rendering decisions based on props. You'll also use the ternary operator, but you can see how several of the other concepts that were covered in the last few challenges might be just as useful in this context. +In questa sfida, configurerai un componente figlio per prendere decisioni di rendering basate sulle props. Utilizzerai anche l'operatore ternario, ma puoi vedere come molti degli altri concetti che sono stati trattati nelle ultime sfide potrebbero essere altrettanto utili in questo contesto. # --instructions-- -The code editor has two components that are partially defined for you: a parent called `GameOfChance`, and a child called `Results`. They are used to create a simple game where the user presses a button to see if they win or lose. +L'editor di codice ha due componenti che sono parzialmente definiti per te: un genitore chiamato `GameOfChance`, e un figlio chiamato `Results`. Essi sono utilizzati per creare un semplice gioco in cui l'utente preme un bottone per vedere se vince o perde. -First, you'll need a simple expression that randomly returns a different value every time it is run. You can use `Math.random()`. This method returns a value between `0` (inclusive) and `1` (exclusive) each time it is called. So for 50/50 odds, use `Math.random() >= .5` in your expression. Statistically speaking, this expression will return `true` 50% of the time, and `false` the other 50%. In the render method, replace `null` with the above expression to complete the variable declaration. +In primo luogo, avrai bisogno di una semplice espressione che restituisca casualmente un valore diverso ogni volta che viene eseguita. Puoi usare `Math.random()`. Questo metodo restituisce un valore compreso tra `0` (incluso) e `1` (escluso) ogni volta che viene chiamato. Quindi, per avere delle quote 50/50, usa `Math.random() >= .5` nella tua espressione. Statisticamente parlando, questa espressione restituirà `true` il 50% delle volte, e `false` l'altro 50%. Nel metodo render, sostituisci `null` con l'espressione vista sopra per completare la dichiarazione della variabile. -Now you have an expression that you can use to make a randomized decision in the code. Next you need to implement this. Render the `Results` component as a child of `GameOfChance`, and pass in `expression` as a prop called `fiftyFifty`. In the `Results` component, write a ternary expression to render the `h1` element with the text `You Win!` or `You Lose!` based on the `fiftyFifty` prop that's being passed in from `GameOfChance`. Finally, make sure the `handleClick()` method is correctly counting each turn so the user knows how many times they've played. This also serves to let the user know the component has actually updated in case they win or lose twice in a row. +Ora hai un'espressione che puoi usare per prendere una decisione casuale nel codice. Successivamente dovrai implementarla. Presenta il componente `Results` come figlio di `GameOfChance`, e passagli `expression` come una proprietà chiamata `fiftyFifty`. Nel componente `Results`, scrivi un'espressione ternaria per presentare l'elemento `h1` con il testo `You Win!` o `You Lose!` basato sulla proprietà `fiftyFifty` che viene passata da `GameOfChance`. Infine, assicurati che il metodo `handleClick()` stia contando correttamente ogni turno in modo che l'utente sappia quante volte ha giocato. Questo serve anche a far sapere all'utente che il componente è stato effettivamente aggiornato nel caso in cui vinca o perda due volte di fila. # --hints-- -The `GameOfChance` component should exist and render to the page. +Il componente `GameOfChance` dovrebbe esistere e essere presentato nella pagina. ```js assert.strictEqual( @@ -31,7 +31,7 @@ assert.strictEqual( ); ``` -`GameOfChance` should return a single `button` element. +`GameOfChance` dovrebbe restituire un singolo elemento `button`. ```js assert.strictEqual( @@ -40,7 +40,7 @@ assert.strictEqual( ); ``` -`GameOfChance` should return a single instance of the `Results` component, which has a prop called `fiftyFifty`. +`GameOfChance` dovrebbe restituire una singola istanza del componente `Results`, che ha una proprietà chiamata `fiftyFifty`. ```js assert( @@ -53,7 +53,7 @@ assert( ); ``` -`GameOfChance` state should be initialized with a property of `counter` set to a value of `1`. +Lo stato di `GameOfChance` dovrebbe essere inizializzato con una proprietà `counter` impostata su un valore di `1`. ```js assert.strictEqual( @@ -62,7 +62,7 @@ assert.strictEqual( ); ``` -When the `GameOfChance` component is first rendered to the DOM, a `p` element should be returned with the inner text of `Turn: 1`. +Quando il componente `GameOfChance` viene presentato per la prima volta nel DOM, dovrebbe essere restituito un elemento `p` con il testo interno di `Turn: 1`. ```js assert.strictEqual( @@ -71,7 +71,7 @@ assert.strictEqual( ); ``` -Each time the button is clicked, the counter state should be incremented by a value of 1, and a single `p` element should be rendered to the DOM that contains the text `Turn: N`, where `N` is the value of the counter state. +Ogni volta che viene fatto click sul pulsante, lo stato del contatore deve essere incrementato di un valore di 1, e nel DOM dovrebbe essere presentato un singolo elemento `p` che contiene il testo `Turn: N`, dove `N` è il valore dello stato del contatore. ```js (() => { @@ -123,7 +123,7 @@ Each time the button is clicked, the counter state should be incremented by a va })(); ``` -When the `GameOfChance` component is first mounted to the DOM and each time the button is clicked thereafter, a single `h1` element should be returned that randomly renders either `You Win!` or `You Lose!`. +Quando il componente `GameOfChance` viene montato per la prima volta nel DOM e ogni volta che il bottone viene cliccato successivamente, dovrebbe essere restituito un singolo elemento `h1` che scrive casualmente `You Win!` o `You Lose!`. ```js (() => { diff --git a/curriculum/challenges/italian/03-front-end-libraries/react/render-html-elements-to-the-dom.md b/curriculum/challenges/italian/03-front-end-libraries/react/render-html-elements-to-the-dom.md index d5167e4e13..087b68d746 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/react/render-html-elements-to-the-dom.md +++ b/curriculum/challenges/italian/03-front-end-libraries/react/render-html-elements-to-the-dom.md @@ -1,6 +1,6 @@ --- id: 5a24bbe0dba28a8d3cbd4c5f -title: Render HTML Elements to the DOM +title: Presentare gli elementi HTML nel DOM challengeType: 6 forumTopicId: 301406 dashedName: render-html-elements-to-the-dom @@ -8,37 +8,37 @@ dashedName: render-html-elements-to-the-dom # --description-- -So far, you've learned that JSX is a convenient tool to write readable HTML within JavaScript. With React, we can render this JSX directly to the HTML DOM using React's rendering API known as ReactDOM. +Finora, hai imparato che JSX è uno strumento utile per scrivere HTML leggibile all'interno di JavaScript. Con React, possiamo presentare questo JSX direttamente nel DOM HTML utilizzando l'API di rendering di React conosciuta come ReactDOM. -ReactDOM offers a simple method to render React elements to the DOM which looks like this: `ReactDOM.render(componentToRender, targetNode)`, where the first argument is the React element or component that you want to render, and the second argument is the DOM node that you want to render the component to. +ReactDOM offre un metodo semplice per presentare gli elementi React nel DOM che appare così: `ReactDOM.render(componentToRender, targetNode)`, dove il primo argomento è l'elemento React o il componente che si desidera presentare, e il secondo argomento è il nodo DOM nel quale si desidera visualizzare il componente. -As you would expect, `ReactDOM.render()` must be called after the JSX element declarations, just like how you must declare variables before using them. +Come ci si aspetterebbe, `ReactDOM.render()` deve essere chiamato dopo le dichiarazioni degli elementi JSX, proprio come è necessario dichiarare le variabili prima di usarle. # --instructions-- -The code editor has a simple JSX component. Use the `ReactDOM.render()` method to render this component to the page. You can pass defined JSX elements directly in as the first argument and use `document.getElementById()` to select the DOM node to render them to. There is a `div` with `id='challenge-node'` available for you to use. Make sure you don't change the `JSX` constant. +L'editor di codice contiene un semplice componente JSX. Usa il metodo `ReactDOM.render()` per presentare questo componente nella pagina. Puoi passare gli elementi JSX che hai definito direttamente come primo argomento e utilizzare `document.getElementById()` per selezionare il nodo DOM nel quale fare il render. C'è un `div` con `id='challenge-node'` pronto all'uso per te. Assicurati di non modificare la costante `JSX`. # --hints-- -The constant `JSX` should return a `div` element. +La costante `JSX` dovrebbe restituire un elemento `div`. ```js assert(JSX.type === 'div'); ``` -The `div` should contain an `h1` tag as the first element. +Il `div` dovrebbe contenere un tag `h1` come primo elemento. ```js assert(JSX.props.children[0].type === 'h1'); ``` -The `div` should contain a `p` tag as the second element. +Il `div` dovrebbe contenere un tag `p` come secondo elemento. ```js assert(JSX.props.children[1].type === 'p'); ``` -The provided JSX element should render to the DOM node with id `challenge-node`. +L'elemento JSX fornito dovrebbe essere presentato nel nodo DOM con id `challenge-node`. ```js assert( diff --git a/curriculum/challenges/italian/03-front-end-libraries/react/render-react-on-the-server-with-rendertostring.md b/curriculum/challenges/italian/03-front-end-libraries/react/render-react-on-the-server-with-rendertostring.md index bfced52d4b..954cf944ec 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/react/render-react-on-the-server-with-rendertostring.md +++ b/curriculum/challenges/italian/03-front-end-libraries/react/render-react-on-the-server-with-rendertostring.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d403618d -title: Render React on the Server with renderToString +title: Presentare React nel server con renderToString challengeType: 6 forumTopicId: 301407 dashedName: render-react-on-the-server-with-rendertostring @@ -8,17 +8,17 @@ dashedName: render-react-on-the-server-with-rendertostring # --description-- -So far, you have been rendering React components on the client. Normally, this is what you will always do. However, there are some use cases where it makes sense to render a React component on the server. Since React is a JavaScript view library and you can run JavaScript on the server with Node, this is possible. In fact, React provides a `renderToString()` method you can use for this purpose. +Finora, hai presentato i componenti React sul client. Questo è quello che farai normalmente. Tuttavia, ci sono alcuni casi di utilizzo in cui ha senso presentare un componente React sul server. Dato che React è una libreria di visualizzazione JavaScript ed è possibile eseguire JavaScript sul server con Node, questo è possibile. Infatti, React fornisce un metodo `renderToString()` che puoi usare a questo scopo. -There are two key reasons why rendering on the server may be used in a real world app. First, without doing this, your React apps would consist of a relatively empty HTML file and a large bundle of JavaScript when it's initially loaded to the browser. This may not be ideal for search engines that are trying to index the content of your pages so people can find you. If you render the initial HTML markup on the server and send this to the client, the initial page load contains all of the page's markup which can be crawled by search engines. Second, this creates a faster initial page load experience because the rendered HTML is smaller than the JavaScript code of the entire app. React will still be able to recognize your app and manage it after the initial load. +Ci sono due ragioni chiave per cui il rendering sul server può essere utilizzato in un'app del mondo reale. In primo luogo, senza fare questo, le tue applicazioni React consisterebbero in un file HTML relativamente vuoto e in un grande pacchetto di JavaScript da caricare inizialmente sul browser. Questo potrebbe non essere ideale per i motori di ricerca che stanno cercando di indicizzare il contenuto delle tue pagine in modo che le persone possano trovarti. Se si esegue il rendering del markup HTML iniziale sul server e lo si invia al client, il caricamento iniziale della pagina conterrà tutti i markup della pagina che possono essere letti dai motori di ricerca. In secondo luogo, questo crea un'esperienza di caricamento iniziale della pagina più veloce perché l'HTML presentato è più piccolo del codice JavaScript dell'intera app. React sarà comunque in grado di riconoscere la tua app e gestirla dopo il caricamento iniziale. # --instructions-- -The `renderToString()` method is provided on `ReactDOMServer`, which is available here as a global object. The method takes one argument which is a React element. Use this to render `App` to a string. +Il metodo `renderToString()` è fornito su `ReactDOMServer`, disponibile qui come oggetto globale. Il metodo richiede un argomento che è un elemento di React. Usa questo per presentare `App` in una stringa. # --hints-- -The `App` component should render to a string using `ReactDOMServer.renderToString`. +Il componente `App` dovrebbe fare il rendering in una stringa usando `ReactDOMServer.renderToString`. ```js (getUserInput) => diff --git a/curriculum/challenges/italian/03-front-end-libraries/react/render-state-in-the-user-interface-another-way.md b/curriculum/challenges/italian/03-front-end-libraries/react/render-state-in-the-user-interface-another-way.md index e1dd33ed04..3d62a72414 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/react/render-state-in-the-user-interface-another-way.md +++ b/curriculum/challenges/italian/03-front-end-libraries/react/render-state-in-the-user-interface-another-way.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d4036172 -title: Render State in the User Interface Another Way +title: Presentare lo stato nell'interfaccia utente in un altro modo challengeType: 6 forumTopicId: 301408 dashedName: render-state-in-the-user-interface-another-way @@ -8,17 +8,17 @@ dashedName: render-state-in-the-user-interface-another-way # --description-- -There is another way to access `state` in a component. In the `render()` method, before the `return` statement, you can write JavaScript directly. For example, you could declare functions, access data from `state` or `props`, perform computations on this data, and so on. Then, you can assign any data to variables, which you have access to in the `return` statement. +C'è un altro modo per accedere allo `state` in un componente. Nel metodo `render()`, prima dell'istruzione `return`, è possibile scrivere direttamente del JavaScript. Ad esempio, è possibile dichiarare funzioni, accedere ai dati da `state` o `props`, eseguire calcoli su questi dati, e così via. Poi, puoi assegnare qualsiasi dato alle variabili a cui hai accesso nell'istruzione `return`. # --instructions-- -In the `MyComponent` render method, define a `const` called `name` and set it equal to the name value in the component's `state`. Because you can write JavaScript directly in this part of the code, you don't have to enclose this reference in curly braces. +Nel metodo di rendering `MyComponent`, definisci una `const` chiamata `name` e impostala al valore di name nello `state` del componente. Poiché in questa parte del codice è possibile scrivere direttamente in JavaScript, non è necessario racchiudere questo riferimento tra parentesi graffe. -Next, in the return statement, render this value in an `h1` tag using the variable `name`. Remember, you need to use the JSX syntax (curly braces for JavaScript) in the return statement. +Successivamente, nell'istruzione return, presenta questo valore in un tag `h1` utilizzando la variabile `name`. Ricorda però che nell'istruzione return dovrai utilizzare la sintassi JSX (parentesi graffe per il JavaScript). # --hints-- -`MyComponent` should have a key `name` with value `freeCodeCamp` stored in its state. +`MyComponent` dovrebbe avere una chiave `name` con valore `freeCodeCamp` memorizzato nel suo stato. ```js assert( @@ -27,7 +27,7 @@ assert( ); ``` -`MyComponent` should render an `h1` header enclosed in a single `div`. +`MyComponent` dovrebbe presentare un'intestazione `h1` racchiusa in un singolo `div`. ```js assert( @@ -37,14 +37,14 @@ assert( ); ``` -The rendered `h1` tag should include a reference to `{name}`. +Il tag `h1` presentato dovrebbe includere un riferimento a `{name}`. ```js (getUserInput) => assert(/

\n*\s*\{\s*name\s*\}\s*\n*<\/h1>/.test(getUserInput('index'))); ``` -The rendered `h1` header should contain text rendered from the component's state. +L'intestazione `h1` dovrebbe contenere testo presentato dallo stato del componente. ```js async () => { diff --git a/curriculum/challenges/italian/03-front-end-libraries/react/render-state-in-the-user-interface.md b/curriculum/challenges/italian/03-front-end-libraries/react/render-state-in-the-user-interface.md index 766b22bd9a..9ff712bae4 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/react/render-state-in-the-user-interface.md +++ b/curriculum/challenges/italian/03-front-end-libraries/react/render-state-in-the-user-interface.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d4036171 -title: Render State in the User Interface +title: Presentare lo stato nell'interfaccia utente challengeType: 6 forumTopicId: 301409 dashedName: render-state-in-the-user-interface @@ -8,23 +8,23 @@ dashedName: render-state-in-the-user-interface # --description-- -Once you define a component's initial state, you can display any part of it in the UI that is rendered. If a component is stateful, it will always have access to the data in `state` in its `render()` method. You can access the data with `this.state`. +Una volta definito lo stato iniziale di un componente, è possibile visualizzarne qualsiasi parte nell'interfaccia utente che viene presentata. Se un componente è stateful, avrà sempre accesso ai dati dello `state` nel suo metodo `render()`. È possibile accedere ai dati con `this.state`. -If you want to access a state value within the `return` of the render method, you have to enclose the value in curly braces. +Se desideri accedere a un valore di stato all'interno del `return` del metodo render, devi racchiudere il valore in parentesi graffe. -`state` is one of the most powerful features of components in React. It allows you to track important data in your app and render a UI in response to changes in this data. If your data changes, your UI will change. React uses what is called a virtual DOM, to keep track of changes behind the scenes. When state data updates, it triggers a re-render of the components using that data - including child components that received the data as a prop. React updates the actual DOM, but only where necessary. This means you don't have to worry about changing the DOM. You simply declare what the UI should look like. +`state` è una delle caratteristiche più potenti dei componenti di React. Ti permette di tracciare dati importanti nella tua app e presentare un'interfaccia utente in risposta alle modifiche di questi dati. Se i tuoi dati cambiano, la tua interfaccia utente cambierà. React utilizza quello che viene chiamato un DOM (Document Object Model) virtuale, per tenere traccia dei cambiamenti dietro le quinte. Quando lo stato dei dati si aggiorna, si attiva un re-render dei componenti che utilizzano tali dati - compresi i componenti figli che hanno ricevuto i dati come proprietà. React aggiorna il DOM, ma solo se necessario. Questo significa che non devi preoccuparti di cambiare il DOM. Semplicemente dichiari come dovrebbe apparire l'interfaccia utente. -Note that if you make a component stateful, no other components are aware of its `state`. Its `state` is completely encapsulated, or local to that component, unless you pass state data to a child component as `props`. This notion of encapsulated `state` is very important because it allows you to write certain logic, then have that logic contained and isolated in one place in your code. +Nota che se fai un componente stateful, nessun altro componente è a conoscenza del suo `state`. Il suo `state` è completamente incapsulato, o locale a quel componente, a meno che non passi i dati di stato a un componente figlio come `props`. Questa nozione di `state` incapsulato è molto importante perché permette di scrivere una certa logica, e poi di avere quella logica contenuta e isolata in un unico punto del tuo codice. # --instructions-- -In the code editor, `MyComponent` is already stateful. Define an `h1` tag in the component's render method which renders the value of `name` from the component's state. +Nell'editor di codice, `MyComponent` è già stateful. Definisci un tag `h1` nel metodo render del componente che presenta il valore di `name` prendendolo dallo stato del componente. -**Note:** The `h1` should only render the value from `state` and nothing else. In JSX, any code you write with curly braces `{ }` will be treated as JavaScript. So to access the value from `state` just enclose the reference in curly braces. +**Nota:** L'elemento `h1` dovrebbe presentare solo il valore dallo `state` e nient'altro. In JSX, qualsiasi codice che scrivi tra parentesi graffe `{ }` sarà trattato come JavaScript. Quindi, per accedere al valore dallo `state` basta racchiudere il riferimento nelle parentesi graffe. # --hints-- -`MyComponent` should have a key `name` with value `freeCodeCamp` stored in its state. +`MyComponent` dovrebbe avere una chiave `name` con valore `freeCodeCamp` memorizzato nel suo stato. ```js assert( @@ -33,7 +33,7 @@ assert( ); ``` -`MyComponent` should render an `h1` header enclosed in a single `div`. +`MyComponent` dovrebbe presentare un'intestazione `h1` racchiusa in un singolo `div`. ```js assert( @@ -43,7 +43,7 @@ assert( ); ``` -The rendered `h1` header should contain text rendered from the component's state. +L'intestazione `h1` dovrebbe contenere solo testo presentato dallo stato del componente. ```js async () => { diff --git a/curriculum/challenges/italian/03-front-end-libraries/react/render-with-an-if-else-condition.md b/curriculum/challenges/italian/03-front-end-libraries/react/render-with-an-if-else-condition.md index b56c814074..310da9ad69 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/react/render-with-an-if-else-condition.md +++ b/curriculum/challenges/italian/03-front-end-libraries/react/render-with-an-if-else-condition.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d4036184 -title: Render with an If-Else Condition +title: Presentare con una condizione If-Else challengeType: 6 forumTopicId: 301410 dashedName: render-with-an-if-else-condition @@ -8,17 +8,17 @@ dashedName: render-with-an-if-else-condition # --description-- -Another application of using JavaScript to control your rendered view is to tie the elements that are rendered to a condition. When the condition is true, one view renders. When it's false, it's a different view. You can do this with a standard `if/else` statement in the `render()` method of a React component. +Un'altra applicazione dell'uso di JavaScript per controllare la vista presentata è quella di legare gli elementi che sono presentati ad una condizione. Quando la condizione è vera, una vista viene presentata. Quando è falsa, viene presentata una vista diversa. Puoi farlo con un comando `if/else` standard nel metodo `render()` di un componente React. # --instructions-- -MyComponent contains a `boolean` in its state which tracks whether you want to display some element in the UI or not. The `button` toggles the state of this value. Currently, it renders the same UI every time. Rewrite the `render()` method with an `if/else` statement so that if `display` is `true`, you return the current markup. Otherwise, return the markup without the `h1` element. +MyComponent contiene un `boolean` nel suo stato che traccia se si desidera o meno visualizzare qualche elemento nell'interfaccia utente. Il `button` commuta lo stato di questo valore. Attualmente, esso presenta la stessa interfaccia utente ogni volta. Riscrivi il metodo `render()` con un'istruzione `if/else` in modo che se `display` è `true`, restituisca il markup corrente. Altrimenti, restituisci il markup senza l'elemento `h1`. -**Note:** You must write an `if/else` to pass the tests. Use of the ternary operator will not pass here. +**Nota:** Devi scrivere un `if/else` per superare i test. L'uso dell'operatore ternario non supererà i test qui, anche se sarebbe corretto. # --hints-- -`MyComponent` should exist and render. +`MyComponent` dovrebbe esistere ed effettuare il render. ```js assert( @@ -29,7 +29,7 @@ assert( ); ``` -When `display` is set to `true`, a `div`, `button`, and `h1` should render. +Quando `display` è impostato a `true`, dovrebbero essere presentati un `div`, un `button` e un `h1`. ```js async () => { @@ -50,7 +50,7 @@ async () => { }; ``` -When `display` is set to `false`, only a `div` and `button` should render. +Quando `display` è impostato su `false`, dovrebbero essere presentati solo un `div` e un `button`. ```js async () => { @@ -71,7 +71,7 @@ async () => { }; ``` -The render method should use an `if/else` statement to check the condition of `this.state.display`. +Il metodo render dovrebbe utilizzare un'istruzione `if/else` per controllare la condizione di `this.state.display`. ```js (getUserInput) => diff --git a/curriculum/challenges/italian/03-front-end-libraries/react/review-using-props-with-stateless-functional-components.md b/curriculum/challenges/italian/03-front-end-libraries/react/review-using-props-with-stateless-functional-components.md index c9d751ce8d..2df86d7970 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/react/review-using-props-with-stateless-functional-components.md +++ b/curriculum/challenges/italian/03-front-end-libraries/react/review-using-props-with-stateless-functional-components.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d403616f -title: Review Using Props with Stateless Functional Components +title: Ripasso dell'uso delle Props con componenti funzionali senza stato challengeType: 6 forumTopicId: 301411 dashedName: review-using-props-with-stateless-functional-components @@ -8,19 +8,19 @@ dashedName: review-using-props-with-stateless-functional-components # --description-- -Except for the last challenge, you've been passing props to stateless functional components. These components act like pure functions. They accept props as input and return the same view every time they are passed the same props. You may be wondering what state is, and the next challenge will cover it in more detail. Before that, here's a review of the terminology for components. +Fatta eccezione per l'ultima sfida, hai sempre passato le props a componenti funzionali senza stato. Questi componenti agiscono come funzioni pure. Accettano le props come input e restituiscono la stessa vista ogni volta che vengono passate le stesse proprietà. Potresti chiederti cosa sia lo stato e la prossima sfida lo spiegherà con maggiore dettaglio. Prima però, ecco un ripasso della terminologia per i componenti. -A *stateless functional component* is any function you write which accepts props and returns JSX. A *stateless component*, on the other hand, is a class that extends `React.Component`, but does not use internal state (covered in the next challenge). Finally, a *stateful component* is a class component that does maintain its own internal state. You may see stateful components referred to simply as components or React components. +Un *componente funzionale senza stato* è una qualsiasi funzione che accetta props e restituisce JSX. Un *componente senza stato*, d'altra parte, è una classe che estende `React.Component`, ma non utilizza lo stato interno (coperto nella prossima sfida). Infine, un *componente stateful* è un componente di classe che mantiene il proprio stato interno. Spesso si fa riferimento ai componenti stateful chiamandoli semplicemente componenti o componenti React. -A common pattern is to try to minimize statefulness and to create stateless functional components wherever possible. This helps contain your state management to a specific area of your application. In turn, this improves development and maintenance of your app by making it easier to follow how changes to state affect its behavior. +Un modello comune è quello di cercare di minimizzare l'estensione dello stato e di creare componenti funzionali senza stato, laddove possibile. Questo aiuta a contenere la gestione dello stato in un'area specifica della tua applicazione. A sua volta, questo migliora lo sviluppo e la manutenzione della tua app rendendo più facile seguire come le modifiche allo stato influenzano il suo comportamento. # --instructions-- -The code editor has a `CampSite` component that renders a `Camper` component as a child. Define the `Camper` component and assign it default props of `{ name: 'CamperBot' }`. Inside the `Camper` component, render any code that you want, but make sure to have one `p` element that includes only the `name` value that is passed in as a `prop`. Finally, define `propTypes` on the `Camper` component to require `name` to be provided as a prop and verify that it is of type `string`. +L'editor di codice ha un componente `CampSite` che presenta un componente `Camper` come figlio. Definisci il componente `Camper` e assegnagli la proprietà di default `{ name: 'CamperBot' }`. All'interno del componente `Camper`, presenta il codice che vuoi, ma assicurati di avere un elemento `p` che include solo il valore del `name` che viene passato come `prop`. Infine, definisci `propTypes` nel componente `Camper` in modo che richieda che `name` venga fornito come prop verificando che sia di tipo `string`. # --hints-- -The `CampSite` component should render. +Il componente `CampSite` dovrebbe effettuare il render. ```js assert( @@ -31,7 +31,7 @@ assert( ); ``` -The `Camper` component should render. +Il componente `Camper` dovrebbe effettuare il render. ```js assert( @@ -42,7 +42,7 @@ assert( ); ``` -The `Camper` component should include default props which assign the string `CamperBot` to the key `name`. +Il componente `Camper` dovrebbe includere delle props predefinite che assegnano la stringa `CamperBot` alla chiave `name`. ```js assert( @@ -52,7 +52,7 @@ assert( ); ``` -The `Camper` component should include prop types which require the `name` prop to be of type `string`. +Il componente `Camper` dovrebbe includere tipi di prop che richiedono che la proprietà `name` sia di tipo `string`. ```js assert( @@ -62,7 +62,7 @@ assert( ); ``` -The `Camper` component should contain a `p` element with only the text from the `name` prop. +Il componente `Camper` dovrebbe contenere un elemento `p` che abbia come unico testo la proprietà `name`. ```js assert( diff --git a/curriculum/challenges/italian/03-front-end-libraries/react/set-state-with-this.setstate.md b/curriculum/challenges/italian/03-front-end-libraries/react/set-state-with-this.setstate.md index 93b387efc9..b0e2bcc2d0 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/react/set-state-with-this.setstate.md +++ b/curriculum/challenges/italian/03-front-end-libraries/react/set-state-with-this.setstate.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d4036173 -title: Set State with this.setState +title: Impostare lo stato con this.setState challengeType: 6 forumTopicId: 301412 dashedName: set-state-with-this-setstate @@ -8,7 +8,7 @@ dashedName: set-state-with-this-setstate # --description-- -The previous challenges covered component `state` and how to initialize state in the `constructor`. There is also a way to change the component's `state`. React provides a method for updating component `state` called `setState`. You call the `setState` method within your component class like so: `this.setState()`, passing in an object with key-value pairs. The keys are your state properties and the values are the updated state data. For instance, if we were storing a `username` in state and wanted to update it, it would look like this: +Le sfide precedenti riguardavano il componente `state` e come inizializzare lo stato nel `constructor`. C'è anche un modo per cambiare lo `state` del componente. React fornisce un metodo per l'aggiornamento dello `state` del componente chiamato `setState`. Chiamerai il metodo `setState` all'interno della classe component in questo modo: `this.setState()`, passandogli un oggetto con coppie chiave-valore. Le chiavi sono le proprietà dello stato e i valori sono i dati dello stato aggiornato. Per esempio, se stessimo memorizzando uno `username` nello stato e volessimo aggiornarlo, potremmo fare così: ```jsx this.setState({ @@ -16,17 +16,17 @@ this.setState({ }); ``` -React expects you to never modify `state` directly, instead always use `this.setState()` when state changes occur. Also, you should note that React may batch multiple state updates in order to improve performance. What this means is that state updates through the `setState` method can be asynchronous. There is an alternative syntax for the `setState` method which provides a way around this problem. This is rarely needed but it's good to keep it in mind! Please consult the [React documentation](https://facebook.github.io/react/docs/state-and-lifecycle.html) for further details. +React si aspetta che tu non modifichi mai lo `state` direttamente: usa sempre `this.setState()` quando si verificano cambiamenti di stato. Inoltre, dovresti notare che React può raggruppare più aggiornamenti di stato al fine di migliorare le prestazioni. Ciò significa che gli aggiornamenti di stato attraverso il metodo `setState` possono essere asincroni. C'è una sintassi alternativa per il metodo `setState` che fornisce un modo per aggirare questo problema. Questo raramente è necessario, ma è bene tenerlo in mente! Consulta la [Documentazione di React](https://facebook.github.io/react/docs/state-and-lifecycle.html) per ulteriori dettagli. # --instructions-- -There is a `button` element in the code editor which has an `onClick()` handler. This handler is triggered when the `button` receives a click event in the browser, and runs the `handleClick` method defined on `MyComponent`. Within the `handleClick` method, update the component `state` using `this.setState()`. Set the `name` property in `state` to equal the string `React Rocks!`. +C'è un elemento `button` nell'editor di codice che ha un gestore `onClick()`. Questo gestore viene attivato quando il `button` riceve un evento click nel browser, ed esegue il metodo `handleClick` definito in `MyComponent`. All'interno del metodo `handleClick`, aggiorna lo `state` del componente usando `this.setState()`. Imposta la proprietà `name` in `state` in modo che sia uguale alla stringa `React Rocks!`. -Click the button and watch the rendered state update. Don't worry if you don't fully understand how the click handler code works at this point. It's covered in upcoming challenges. +Fai clic sul bottone e guarda l'aggiornamento della presentazione dello stato. Non preoccuparti se ancora non capisci completamente come funziona il codice di gestione del click. Lo vedremo nelle prossime sfide. # --hints-- -The state of `MyComponent` should initialize with the key value pair `{ name: Initial State }`. +Lo stato di `MyComponent` dovrebbe essere inizializzato con la coppia chiave/valore `{ name: Initial State }`. ```js assert( @@ -35,13 +35,13 @@ assert( ); ``` -`MyComponent` should render an `h1` header. +`MyComponent` dovrebbe presentare un'intestazione `h1`. ```js assert(Enzyme.mount(React.createElement(MyComponent)).find('h1').length === 1); ``` -The rendered `h1` header should contain text rendered from the component's state. +L'intestazione `h1` dovrebbe contenere testo presentato dallo stato del componente. ```js async () => { @@ -57,7 +57,7 @@ async () => { }; ``` -Calling the `handleClick` method on `MyComponent` should set the name property in state to equal `React Rocks!`. +Chiamando il metodo `handleClick` su `MyComponent` si dovrebbe impostare la proprietà name nello stato sulla stringa `React Rocks!`. ```js async () => { diff --git a/curriculum/challenges/italian/03-front-end-libraries/react/use--for-a-more-concise-conditional.md b/curriculum/challenges/italian/03-front-end-libraries/react/use--for-a-more-concise-conditional.md index 0f13747bc3..9f939453d3 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/react/use--for-a-more-concise-conditional.md +++ b/curriculum/challenges/italian/03-front-end-libraries/react/use--for-a-more-concise-conditional.md @@ -8,21 +8,21 @@ dashedName: use--for-a-more-concise-conditional # --description-- -The `if/else` statements worked in the last challenge, but there's a more concise way to achieve the same result. Imagine that you are tracking several conditions in a component and you want different elements to render depending on each of these conditions. If you write a lot of `else if` statements to return slightly different UIs, you may repeat code which leaves room for error. Instead, you can use the `&&` logical operator to perform conditional logic in a more concise way. This is possible because you want to check if a condition is `true`, and if it is, return some markup. Here's an example: +Le istruzioni `if/else` hanno funzionato nell'ultima sfida, ma c'è un modo più conciso per raggiungere lo stesso risultato. Immagina di dover tracciare diverse condizioni in un componente e di volere che elementi differenti siano presentati a seconda di ciascuna di queste condizioni. Se scrivi un sacco di istruzioni `else if` per restituire interfacce utente leggermente diverse, puoi dover ripetere il codice lasciando spazio a degli errori. Puoi invece utilizzare l'operatore logico `&&` per eseguire la logica condizionale in modo più conciso. Questo è possibile perché si desidera controllare se una condizione è `true`, e se è così, restituire qualche markup. Ecco un esempio: ```jsx {condition &&

markup

} ``` -If the `condition` is `true`, the markup will be returned. If the condition is `false`, the operation will immediately return `false` after evaluating the `condition` and return nothing. You can include these statements directly in your JSX and string multiple conditions together by writing `&&` after each one. This allows you to handle more complex conditional logic in your `render()` method without repeating a lot of code. +Se la `condition` è `true`, il markup verrà restituito. Se la condizione è `false`, l'operazione restituirà immediatamente `false` dopo aver valutato la `condition` e non restituirà nulla. Puoi includere queste istruzioni direttamente nel tuo JSX e legando più condizioni insieme scrivendo `&&` dopo ognuna. Questo ti permette di gestire una logica condizionale più complessa nel tuo metodo `render()` senza ripetere un sacco di codice. # --instructions-- -Solve the previous example again, so the `h1` only renders if `display` is `true`, but use the `&&` logical operator instead of an `if/else` statement. +Risolvi nuovamente l'esempio precedente, in modo che `h1` venga presentato solo se `display` è `true`, ma usa l'operatore logico `&&` invece di un'istruzione `if/else`. # --hints-- -`MyComponent` should exist and render. +`MyComponent` dovrebbe esistere ed effettuare il render. ```js assert( @@ -33,7 +33,7 @@ assert( ); ``` -When `display` is set to `true`, a `div`, `button`, and `h1` should render. +Quando `display` è impostato a `true`, dovrebbero essere presentati un `div`, un `button` e un `h1`. ```js async () => { @@ -54,7 +54,7 @@ async () => { }; ``` -When `display` is set to `false`, only a `div` and `button` should render. +Quando `display` è impostato su `false`, dovrebbero essere presentati solo un `div` e un `button`. ```js async () => { @@ -75,7 +75,7 @@ async () => { }; ``` -The render method should use the `&&` logical operator to check the condition of `this.state.display`. +Il metodo render dovrebbe utilizzare l'operatore logico `&&` per controllare la condizione di `this.state.display`. ```js (getUserInput) => assert(getUserInput('index').includes('&&')); diff --git a/curriculum/challenges/italian/03-front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering.md b/curriculum/challenges/italian/03-front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering.md index 3329290523..46310b2bd8 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering.md +++ b/curriculum/challenges/italian/03-front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d4036187 -title: Use a Ternary Expression for Conditional Rendering +title: Usare un'espressione ternaria per il rendering condizionale challengeType: 6 forumTopicId: 301414 dashedName: use-a-ternary-expression-for-conditional-rendering @@ -8,7 +8,7 @@ dashedName: use-a-ternary-expression-for-conditional-rendering # --description-- -Before moving on to dynamic rendering techniques, there's one last way to use built-in JavaScript conditionals to render what you want: the ternary operator. The ternary operator is often utilized as a shortcut for `if/else` statements in JavaScript. They're not quite as robust as traditional `if/else` statements, but they are very popular among React developers. One reason for this is because of how JSX is compiled, `if/else` statements can't be inserted directly into JSX code. You might have noticed this a couple challenges ago — when an `if/else` statement was required, it was always *outside* the `return` statement. Ternary expressions can be an excellent alternative if you want to implement conditional logic within your JSX. Recall that a ternary operator has three parts, but you can combine several ternary expressions together. Here's the basic syntax: +Prima di passare alle tecniche di rendering dinamiche, c'è un ultimo modo per utilizzare le condizionali JavaScript integrate per presentare quello che vuoi: l'operatore ternario. L'operatore ternario è spesso utilizzato come scorciatoia per le istruzioni `if/else` in JavaScript. Non è robusto come le tradizionali istruzioni `if/else`, ma è molto popolare tra gli sviluppatori React. Uno dei motivi è che per come JSX è compilato, le istruzioni `if/else` non possono essere inserite direttamente nel codice JSX. Potresti averlo notato un paio di sfide fa — quando era richiesta un'istruzione `if/else`, era sempre inserita *fuori* dall'istruzione `return`. Le espressioni ternarie possono essere un'ottima alternativa se vuoi implementare una logica condizionale all'interno del tuo JSX. Ricordiamo che un operatore ternario ha tre parti, ma è possibile combinare diverse espressioni ternarie insieme. Ecco la sintassi di base: ```jsx condition ? expressionIfTrue : expressionIfFalse; @@ -16,13 +16,13 @@ condition ? expressionIfTrue : expressionIfFalse; # --instructions-- -The code editor has three constants defined within the `CheckUserAge` component's `render()` method. They are called `buttonOne`, `buttonTwo`, and `buttonThree`. Each of these is assigned a simple JSX expression representing a button element. First, initialize the state of `CheckUserAge` with `input` and `userAge` both set to values of an empty string. +L'editor di codice ha tre costanti definite nel metodo `render()` del componente `CheckUserAge`. Si chiamano `buttonOne`, `buttonTwo`e `buttonThree`. Ad ognuno di questi viene assegnata una semplice espressione JSX che rappresenta un elemento button. Innanzitutto, inizializza lo stato di `CheckUserAge` con `input` e `userAge` entrambi impostati su una stringa vuota. -Once the component is rendering information to the page, users should have a way to interact with it. Within the component's `return` statement, set up a ternary expression that implements the following logic: when the page first loads, render the submit button, `buttonOne`, to the page. Then, when a user enters their age and clicks the button, render a different button based on the age. If a user enters a number less than `18`, render `buttonThree`. If a user enters a number greater than or equal to `18`, render `buttonTwo`. +Una volta che il componente sta presentando delle informazioni sulla pagina, gli utenti dovrebbero avere un modo per interagire con esso. All'interno dell'istruzione `return` del componente, imposta un'espressione ternaria che implementa la seguente logica: quando la pagina viene caricata inizialmente, presenta il pulsante di invio, `buttonOne`, sulla pagina. Poi, quando un utente inserisce la sua età e fa click sul bottone, presenta un pulsante diverso in base all'età. Se un utente inserisce un numero inferiore a `18`, presenta `buttonThree`. Se un utente inserisce un numero maggiore o uguale a `18`, presenta `buttonTwo`. # --hints-- -The `CheckUserAge` component should render with a single `input` element and a single `button` element. +Il componente `CheckUserAge` dovrebbe presentare un singolo elemento `input` e un singolo elemento `button`. ```js assert( @@ -33,7 +33,7 @@ assert( ); ``` -The `CheckUserAge` component's state should be initialized with a property of `userAge` and a property of `input`, both set to a value of an empty string. +Lo stato del componente `CheckUserAge` dovrebbe essere inizializzato con una proprietà di `userAge` e una proprietà `input`, entrambe impostate sul valore di una stringa vuota. ```js assert( @@ -42,7 +42,7 @@ assert( ); ``` -When the `CheckUserAge` component is first rendered to the DOM, the `button`'s inner text should be Submit. +Quando il componente `CheckUserAge` viene presentato per la prima volta nel DOM, il testo interno del `button` dovrebbe essere Submit. ```js assert( @@ -51,7 +51,7 @@ assert( ); ``` -When a number of less than 18 is entered into the `input` element and the `button` is clicked, the `button`'s inner text should read `You Shall Not Pass`. +Quando viene inserito un numero inferiore a 18 nell'elemento `input` e viene cliccato il `button`, il testo all'interno del `button` dovrebbe essere `You Shall Not Pass`. ```js (() => { @@ -83,7 +83,7 @@ When a number of less than 18 is entered into the `input` element and the `butto })(); ``` -When a number greater than or equal to 18 is entered into the `input` element and the `button` is clicked, the `button`'s inner text should read `You May Enter`. +Quando un numero maggiore o uguale a 18 viene inserito nell'elemento `input` e il `button` viene cliccato, il testo interno del `button` dovrebbe essere `You May Enter`. ```js (() => { @@ -115,7 +115,7 @@ When a number greater than or equal to 18 is entered into the `input` element an })(); ``` -Once a number has been submitted, and the value of the `input` is once again changed, the `button` should return to reading `Submit`. +Una volta che un numero è stato inviato, e il valore dell'`input` è cambiato ancora una volta, il `button` dovrebbe tornare al testo `Submit`. ```js (() => { @@ -156,7 +156,7 @@ Once a number has been submitted, and the value of the `input` is once again cha })(); ``` -Your code should not contain any `if/else` statements. +Il tuo codice non dovrebbe contenere alcuna istruzione `if/else`. ```js assert( diff --git a/curriculum/challenges/italian/03-front-end-libraries/react/use-advanced-javascript-in-react-render-method.md b/curriculum/challenges/italian/03-front-end-libraries/react/use-advanced-javascript-in-react-render-method.md index d9bccebbf2..dade27c23d 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/react/use-advanced-javascript-in-react-render-method.md +++ b/curriculum/challenges/italian/03-front-end-libraries/react/use-advanced-javascript-in-react-render-method.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d4036183 -title: Use Advanced JavaScript in React Render Method +title: Usare JavaScript avanzato nel metodo Render di React challengeType: 6 forumTopicId: 301415 dashedName: use-advanced-javascript-in-react-render-method @@ -8,17 +8,17 @@ dashedName: use-advanced-javascript-in-react-render-method # --description-- -In previous challenges, you learned how to inject JavaScript code into JSX code using curly braces, `{ }`, for tasks like accessing props, passing props, accessing state, inserting comments into your code, and most recently, styling your components. These are all common use cases to put JavaScript in JSX, but they aren't the only way that you can utilize JavaScript code in your React components. +Nelle sfide precedenti, hai imparato come iniettare il codice JavaScript nel codice JSX utilizzando le parentesi graffe, `{ }`, per attività come accedere alle props, passare props, accedere allo stato, inserire commenti nel codice e, più recentemente, stilizzare i componenti. Questi sono tutti casi in cui normalmente si inserisce del JavaScript in JSX, ma non sono l'unico modo in cui è possibile utilizzare il codice JavaScript nei componenti React. -You can also write JavaScript directly in your `render` methods, before the `return` statement, ***without*** inserting it inside of curly braces. This is because it is not yet within the JSX code. When you want to use a variable later in the JSX code *inside* the `return` statement, you place the variable name inside curly braces. +Puoi anche scrivere JavaScript direttamente nei tuoi metodi `render`, prima dell'istruzione `return`, ***senza*** inserirlo all'interno delle parentesi graffe. Questo perché non è ancora all'interno del codice JSX. Quando successivamente vorrai utilizzare una variabile nel codice JSX *all'interno* dell'istruzione `return`, posizionerai il nome della variabile all'interno delle parentesi graffe. # --instructions-- -In the code provided, the `render` method has an array that contains 20 phrases to represent the answers found in the classic 1980's Magic Eight Ball toy. The button click event is bound to the `ask` method, so each time the button is clicked a random number will be generated and stored as the `randomIndex` in state. On line 52, delete the string `change me!` and reassign the `answer` const so your code randomly accesses a different index of the `possibleAnswers` array each time the component updates. Finally, insert the `answer` const inside the `p` tags. +Nel codice fornito, il metodo `render` ha un array che contiene 20 frasi per rappresentare le risposte trovate nel classico giocattolo degli anni '80 Magica Palla Otto. L'evento click del bottone è associato al metodo `ask`, così ogni volta che il pulsante viene cliccato un numero casuale verrà generato e memorizzato come `randomIndex` nello stato. Alla riga 52, elimina la stringa `change me!` e riassegna la costante `answer` in modo che il tuo codice acceda casualmente ad un diverso indice dell'array `possibleAnswers` ogni volta che il componente si aggiorna. Infine, inserisci la costante `answer` all'interno dei tag `p`. # --hints-- -The `MagicEightBall` component should exist and should render to the page. +Il componente `MagicEightBall` dovrebbe esistere ed essere presentato nella pagina. ```js assert.strictEqual( @@ -28,7 +28,7 @@ assert.strictEqual( ); ``` -`MagicEightBall`'s first child should be an `input` element. +Il primo figlio di `MagicEightBall` dovrebbe essere un elemento `input`. ```js assert.strictEqual( @@ -40,7 +40,7 @@ assert.strictEqual( ); ``` -`MagicEightBall`'s third child should be a `button` element. +Il terzo figlio di `MagicEightBall` dovrebbe essere un elemento `button`. ```js assert.strictEqual( @@ -52,7 +52,7 @@ assert.strictEqual( ); ``` -`MagicEightBall`'s state should be initialized with a property of `userInput` and a property of `randomIndex` both set to a value of an empty string. +Lo stato di `MagicEightBall` dovrebbe essere inizializzato con una proprietà `userInput` e una proprietà `randomIndex` entrambe impostate su un valore di una stringa vuota. ```js assert( @@ -62,7 +62,7 @@ assert( ); ``` -When `MagicEightBall` is first mounted to the DOM, it should return an empty `p` element. +Quando `MagicEightBall` viene montato per la prima volta sul DOM, dovrebbe restituire un elemento `p` vuoto. ```js assert( @@ -71,7 +71,7 @@ assert( ); ``` -When text is entered into the `input` element and the button is clicked, the `MagicEightBall` component should return a `p` element that contains a random element from the `possibleAnswers` array. +Quando il testo viene inserito nell'elemento `input` e il pulsante viene cliccato, il componente `MagicEightBall` dovrebbe restituire un elemento `p` che contiene un elemento casuale prendendolo dall'array `possibleAnswers`. ```js (() => { diff --git a/curriculum/challenges/italian/03-front-end-libraries/react/use-array.filter-to-dynamically-filter-an-array.md b/curriculum/challenges/italian/03-front-end-libraries/react/use-array.filter-to-dynamically-filter-an-array.md index 9aa54c9672..0272cee3e3 100644 --- a/curriculum/challenges/italian/03-front-end-libraries/react/use-array.filter-to-dynamically-filter-an-array.md +++ b/curriculum/challenges/italian/03-front-end-libraries/react/use-array.filter-to-dynamically-filter-an-array.md @@ -1,6 +1,6 @@ --- id: 5a24c314108439a4d403618c -title: Use Array.filter() to Dynamically Filter an Array +title: Usare Array.filter() per filtrare dinamicamente un array challengeType: 6 forumTopicId: 301416 dashedName: use-array-filter-to-dynamically-filter-an-array @@ -8,7 +8,7 @@ dashedName: use-array-filter-to-dynamically-filter-an-array # --description-- -The `map` array method is a powerful tool that you will use often when working with React. Another method related to `map` is `filter`, which filters the contents of an array based on a condition, then returns a new array. For example, if you have an array of users that all have a property `online` which can be set to `true` or `false`, you can filter only those users that are online by writing: +Il metodo degli array `map` è un potente strumento che userai spesso lavorando con React. Un altro metodo collegato a `map` è `filter`, che filtra il contenuto di un array in base a una condizione, restituendo un nuovo array. Ad esempio, se hai un array di utenti che hanno tutti una proprietà `online` che può essere impostata a `true` o `false`, puoi filtrare solo gli utenti che sono online scrivendo: ```js let onlineUsers = users.filter(user => user.online); @@ -16,11 +16,11 @@ let onlineUsers = users.filter(user => user.online); # --instructions-- -In the code editor, `MyComponent`'s `state` is initialized with an array of users. Some users are online and some aren't. Filter the array so you see only the users who are online. To do this, first use `filter` to return a new array containing only the users whose `online` property is `true`. Then, in the `renderOnline` variable, map over the filtered array, and return a `li` element for each user that contains the text of their `username`. Be sure to include a unique `key` as well, like in the last challenges. +Nell'editor di codice, lo `state` di `MyComponent` è inizializzato con un array di utenti. Alcuni utenti sono online e altri no. Filtra l'array in modo da vedere solo gli utenti che sono online. Per fare questo, prima usa `filter` per restituire un nuovo array contenente solo gli utenti la cui proprietà `online` è `true`. Poi, nella variabile `renderOnline`, mappa l'array filtrato, e restituisci un elemento `li` contenente il testo dello `username` di ogni utente. Assicurati di includere anche una `key` unica, come nelle ultime sfide. # --hints-- -`MyComponent` should exist and render to the page. +`MyComponent` dovrebbe esistere e essere presentato nellla pagina. ```js assert.strictEqual( @@ -29,7 +29,7 @@ assert.strictEqual( ); ``` -`MyComponent`'s state should be initialized to an array of six users. +Lo stato di `MyComponent` dovrebbe essere inizializzato ad un array di sei utenti. ```js assert( @@ -40,7 +40,7 @@ assert( ); ``` -`MyComponent` should return a `div`, an `h1`, and then an unordered list containing `li` elements for every user whose online status is set to `true`. +`MyComponent` dovrebbe restituire un `div`, un `h1`, e poi una lista non ordinata contenente degli elementi `li` per ogni utente il cui stato online è impostato a `true`. ```js (() => { @@ -83,7 +83,7 @@ assert( })(); ``` -`MyComponent` should render `li` elements that contain the `username` of each online user. +`MyComponent` dovrebbe restituire gli elementi `li` che contengono lo `username` di ogni utente online. ```js (() => { @@ -109,7 +109,7 @@ assert( })(); ``` -Each list item element should have a unique `key` attribute. +Ogni elemento della lista dovrebbe avere un attributo `key` univoco. ```js assert( diff --git a/curriculum/challenges/portuguese/01-responsive-web-design/basic-css/add-a-negative-margin-to-an-element.md b/curriculum/challenges/portuguese/01-responsive-web-design/basic-css/add-a-negative-margin-to-an-element.md index 200db3a443..2852033449 100644 --- a/curriculum/challenges/portuguese/01-responsive-web-design/basic-css/add-a-negative-margin-to-an-element.md +++ b/curriculum/challenges/portuguese/01-responsive-web-design/basic-css/add-a-negative-margin-to-an-element.md @@ -1,6 +1,6 @@ --- id: bad87fee1348bd9aedf08823 -title: Add a Negative Margin to an Element +title: Adicionar margem negativa a um elemento challengeType: 0 videoUrl: 'https://scrimba.com/c/cnpyGs3' forumTopicId: 16166 @@ -9,19 +9,19 @@ dashedName: add-a-negative-margin-to-an-element # --description-- -An element's `margin` controls the amount of space between an element's `border` and surrounding elements. +A propriedade `margin` de um elemento controla a quantidade de espaço entre a borda (`border`) de um elemento e os elementos ao redor. -If you set an element's `margin` to a negative value, the element will grow larger. +Se você definir a propriedade `margin` de um elemento com um valor negativo, o elemento ficará maior. # --instructions-- -Try to set the `margin` to a negative value like the one for the red box. +Tente definir a propriedade `margin` com um valor negativo como o da caixa vermelha. -Change the `margin` of the blue box to `-15px`, so it fills the entire horizontal width of the yellow box around it. +Altere a propriedade `margin` da caixa azul para `-15px`, de modo a preencher toda a largura horizontal da caixa amarela ao redor. # --hints-- -Your `blue-box` class should give elements `-15px` of `margin`. +O elemento de classe `blue-box` deve possuir a propriedade `margin` com o valor de `-15px`. ```js assert($('.blue-box').css('margin-top') === '-15px'); diff --git a/curriculum/challenges/portuguese/01-responsive-web-design/basic-css/add-borders-around-your-elements.md b/curriculum/challenges/portuguese/01-responsive-web-design/basic-css/add-borders-around-your-elements.md index d8cd9ce2f3..b87136da0e 100644 --- a/curriculum/challenges/portuguese/01-responsive-web-design/basic-css/add-borders-around-your-elements.md +++ b/curriculum/challenges/portuguese/01-responsive-web-design/basic-css/add-borders-around-your-elements.md @@ -1,6 +1,6 @@ --- id: bad87fee1348bd9bedf08813 -title: Add Borders Around Your Elements +title: Adicionar bordas ao redor dos elementos challengeType: 0 videoUrl: 'https://scrimba.com/c/c2MvnHZ' forumTopicId: 16630 @@ -9,9 +9,9 @@ dashedName: add-borders-around-your-elements # --description-- -CSS borders have properties like `style`, `color` and `width`. +Bordas CSS têm propriedades como `style`, `color` e `width`. -For example, if we wanted to create a red, 5 pixel border around an HTML element, we could use this class: +Por exemplo, se quiséssemos criar uma borda vermelha de 5 pixels ao redor de um elemento HTML, poderíamos usar esta classe: ```html ``` -Inside that style block, you can create a CSS selector for all `h2` elements. For example, if you wanted all `h2` elements to be red, you would add a style rule that looks like this: +Dentro desse bloco de estilo, você pode criar um seletor CSS para todos os elementos de `h2`. Por exemplo, se quisesse que todos os elementos `h2` fossem vermelhos, você adicionaria uma regra de estilo semelhante a esta: ```html ``` -Note that it's important to have both opening and closing curly braces (`{` and `}`) around each element's style rule(s). You also need to make sure that your element's style definition is between the opening and closing style tags. Finally, be sure to add a semicolon to the end of each of your element's style rules. +Observe que é importante ter abertura e fechamento de chaves (`{` e `}`) em torno das regras de estilo de cada elemento. Você também precisa se certificar de que a definição de estilo do seu elemento está entre a abertura e o fechamento das tags. Finalmente, certifique-se de adicionar um ponto e vírgula ao final das regras de estilo de cada um dos seus elementos. # --instructions-- -Delete your `h2` element's style attribute, and instead create a CSS `style` block. Add the necessary CSS to turn all `h2` elements blue. +Exclua o atributo de estilo `h2` e, em vez disso, crie uma tag `style`. Adicione o CSS necessário para transformar a cor de todos os elementos `h2` em azul. # --hints-- -The `style` attribute should be removed from your `h2` element. +O atributo `style` deve ser removido do elemento `h2`. ```js assert(!$('h2').attr('style')); ``` -You should create a `style` element. +Você deve criar um elemento `style`. ```js assert($('style') && $('style').length >= 1); ``` -Your `h2` element should be blue. +O elemento `h2` deve ser azul. ```js assert($('h2').css('color') === 'rgb(0, 0, 255)'); ``` -Your stylesheet `h2` declaration should be valid with a semicolon and closing brace. +O código referente ao `h2` deve ter abertura e fechamento com chaves e cada propriedade deve terminar com ponto e vírgula. ```js assert(code.match(/h2\s*\{\s*color\s*:.*;\s*\}/g)); ``` -All your `style` elements should be valid and have closing tags. +Os elementos `style` devem ser válidos e ter tags de fechamento. ```js assert( diff --git a/curriculum/challenges/portuguese/01-responsive-web-design/basic-css/use-hex-code-for-specific-colors.md b/curriculum/challenges/portuguese/01-responsive-web-design/basic-css/use-hex-code-for-specific-colors.md index dba4e9ded8..05d4300644 100644 --- a/curriculum/challenges/portuguese/01-responsive-web-design/basic-css/use-hex-code-for-specific-colors.md +++ b/curriculum/challenges/portuguese/01-responsive-web-design/basic-css/use-hex-code-for-specific-colors.md @@ -1,6 +1,6 @@ --- id: bad87fee1348bd9aedf08726 -title: Use Hex Code for Specific Colors +title: Usar códigos hexadecimais para selecionar cores específicas challengeType: 0 videoUrl: 'https://scrimba.com/c/c8W9mHM' forumTopicId: 18350 @@ -9,11 +9,11 @@ dashedName: use-hex-code-for-specific-colors # --description-- -Did you know there are other ways to represent colors in CSS? One of these ways is called hexadecimal code, or hex code for short. +Você sabia que existem outras maneiras de representar cores no CSS? Uma dessas formas é chamada de código hexadecimal ou, abreviadamente, hex code (em inglês). -We usually use decimals, or base 10 numbers, which use the symbols 0 to 9 for each digit. Hexadecimals (or hex) are base 16 numbers. This means it uses sixteen distinct symbols. Like decimals, the symbols 0-9 represent the values zero to nine. Then A,B,C,D,E,F represent the values ten to fifteen. Altogether, 0 to F can represent a digit in hexadecimal, giving us 16 total possible values. You can find more information about [hexadecimal numbers here](https://en.wikipedia.org/wiki/Hexadecimal). +Normalmente, usamos decimais, ou números de base 10, que usam os símbolos de 0 a 9 para cada dígito. Hexadecimais (ou hex) são números de base 16. Isso significa que eles usam dezesseis símbolos diferentes. Como os decimais, os símbolos de 0 a 9 representam os valores de zero a nove. Além deles, temos A, B, C, D, E e F, que representam os valores de dez a quinze. Ao todo, números de 0 a F podem representar um dígito em hexadecimal, com 16 valores possíveis. Você pode encontrar mais informações sobre [números hexadecimais aqui](https://pt.wikipedia.org/wiki/Sistema_de_numera%C3%A7%C3%A3o_hexadecimal). -In CSS, we can use 6 hexadecimal digits to represent colors, two each for the red (R), green (G), and blue (B) components. For example, `#000000` is black and is also the lowest possible value. You can find more information about the [RGB color system here](https://en.wikipedia.org/wiki/RGB_color_model). +No CSS, podemos usar 6 dígitos hexadecimais para representar as cores, dois de cada para os componentes vermelho (R), verde (G) e azul (B). Por exemplo, `#000000` é preto e também é o valor mais baixo possível. Você pode encontrar mais informações sobre o [sistema de cores RGB aqui](https://pt.wikipedia.org/wiki/RGB). ```css body { @@ -23,17 +23,17 @@ body { # --instructions-- -Replace the word `black` in our `body` element's background-color with its hex code representation, `#000000`. +Substitua a palavra `black` na cor de fundo do elemento `body` por sua representação em código hexadecimal, `#000000`. # --hints-- -Your `body` element should have the background-color of black. +O elemento `body` deve ter a cor de fundo preta. ```js assert($('body').css('background-color') === 'rgb(0, 0, 0)'); ``` -The `hex code` for the color black should be used instead of the word `black`. +O código hexadecimal (`hex code`) para a cor preta deve ser usado no lugar da palavra `black`. ```js assert( diff --git a/curriculum/challenges/portuguese/01-responsive-web-design/basic-css/use-rgb-to-mix-colors.md b/curriculum/challenges/portuguese/01-responsive-web-design/basic-css/use-rgb-to-mix-colors.md index 65af4b7769..5ad658a0dc 100644 --- a/curriculum/challenges/portuguese/01-responsive-web-design/basic-css/use-rgb-to-mix-colors.md +++ b/curriculum/challenges/portuguese/01-responsive-web-design/basic-css/use-rgb-to-mix-colors.md @@ -1,6 +1,6 @@ --- id: bad82fee1348bd9aedf08721 -title: Use RGB to Mix Colors +title: Usar RGB para Misturar Cores challengeType: 0 videoUrl: 'https://scrimba.com/c/cm24JU6' forumTopicId: 18368 @@ -9,23 +9,23 @@ dashedName: use-rgb-to-mix-colors # --description-- -Just like with hex code, you can mix colors in RGB by using combinations of different values. +Assim como com o código hexadecimal, você pode misturar cores em RGB usando combinações de valores diferentes. # --instructions-- -Replace the hex codes in our `style` element with their correct RGB values. +Substitua os códigos hexadecimais em nosso elemento `style` por seus valores RGB corretos. -
ColorRGB
Bluergb(0, 0, 255)
Redrgb(255, 0, 0)
Orchidrgb(218, 112, 214)
Siennargb(160, 82, 45)
+
CorRGB
Azulrgb(0, 0, 255)
Vermelhorgb(255, 0, 0)
Orquídeargb(218, 112, 214)
Sienargb(160, 82, 45)
# --hints-- -Your `h1` element with the text `I am red!` should have the `color` red. +O elemento `h1` com o texto `I am red!` deve ter a propriedade `color` com um valor red (vermelho). ```js assert($('.red-text').css('color') === 'rgb(255, 0, 0)'); ``` -You should use `rgb` for the color red. +Você deve usar `rgb` para inserir a cor vermelha. ```js assert( @@ -35,13 +35,13 @@ assert( ); ``` -Your `h1` element with the text `I am orchid!` should have the `color` orchid. +O elemento `h1` com o texto `I am orchid!` deve ter a propriedade `color` com um valor orchid (orquídea). ```js assert($('.orchid-text').css('color') === 'rgb(218, 112, 214)'); ``` -You should use `rgb` for the color orchid. +Você deve usar `rgb` para inserir a cor orquídea. ```js assert( @@ -51,13 +51,13 @@ assert( ); ``` -Your `h1` element with the text `I am blue!` should have the `color` blue. +O elemento `h1` com o texto `I am blue!` deve ter a propriedade `color` com um valor blue (azul). ```js assert($('.blue-text').css('color') === 'rgb(0, 0, 255)'); ``` -You should use `rgb` for the color blue. +Você deve usar `rgb` para inserir a cor azul. ```js assert( @@ -67,13 +67,13 @@ assert( ); ``` -Your `h1` element with the text `I am sienna!` should have the `color` sienna. +O elemento `h1` com o texto `I am sienna!` deve ter a propriedade `color` com um valor sienna (siena). ```js assert($('.sienna-text').css('color') === 'rgb(160, 82, 45)'); ``` -You should use `rgb` for the color sienna. +Você deve usar `rgb` para inserir a cor siena. ```js assert(