chore(i18n,curriculum): update translations (#42918)

This commit is contained in:
camperbot
2021-07-19 16:05:37 +05:30
committed by GitHub
parent 69a4980696
commit f3da789fa4
169 changed files with 1365 additions and 1367 deletions

View File

@@ -1,6 +1,6 @@
---
id: 5895f700f9fc0f352b528e63
title: Set up a Template Engine
title: Imposta un template engine
challengeType: 2
forumTopicId: 301564
dashedName: set-up-a-template-engine
@@ -8,31 +8,31 @@ dashedName: set-up-a-template-engine
# --description--
Working on these challenges will involve you writing your code using one of the following methods:
Lavorare su queste sfide ti porterà a scrivere il tuo codice utilizzando uno dei seguenti metodi:
- Clone [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-advancednode/) and complete these challenges locally.
- Use [our Replit starter project](https://replit.com/github/freeCodeCamp/boilerplate-advancednode) to complete these challenges.
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
- Clonare [questo repository GitHub](https://github.com/freeCodeCamp/boilerplate-advancednode/) e completare queste sfide localmente.
- Usare [la nostra bozza di progetto su Replit](https://replit.com/github/freeCodeCamp/boilerplate-advancednode) per completare queste sfide.
- Usare un costruttore di siti di tua scelta per completare il progetto. Assicurati di incorporare tutti i file della nostra repository GitHub.
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the `Solution Link` field.
Quando hai finito, assicurati che una demo funzionante del tuo progetto sia ospitata da qualche parte di pubblico. Quindi invia l'URL nel campo `Solution Link`.
A template engine enables you to use static template files (such as those written in *Pug*) in your app. At runtime, the template engine replaces variables in a template file with actual values which can be supplied by your server. Then it transforms the template into a static HTML file that is sent to the client. This approach makes it easier to design an HTML page and allows for displaying variables on the page without needing to make an API call from the client.
Un modello di motore ti permette di utilizzare file di template statici (come quelli scritti in *Pug*) nella tua app. Al runtime, il template engine sostituisce le variabili in un file modello con valori effettivi che possono essere forniti dal tuo server. Quindi trasforma il template in un file HTML statico che viene inviato al client. Questo approccio facilita la progettazione di una pagina HTML e permette di visualizzare le variabili sulla pagina senza dover effettuare una chiamata API dal client.
Add `pug@~3.0.0` as a dependency in your `package.json` file.
Aggiungi `pug@~3.0.0` come dipendenza nel tuo file `package.json`.
Express needs to know which template engine you are using. We will use the `set` method to assign `pug` as the `view engine` property's value: `app.set('view engine', 'pug')`
Express deve sapere quale templare engine si sta utilizzando. Utilizzeremo il metodo `set` per assegnare `pug` come valore di `view engine` della proprietà: `app.set('view engine', 'pug')`
Your page will not load until you correctly render the index file in the `views/pug` directory.
La tua pagina non verrà caricata finché non esegui correttamente il rendering del file index nella directory `views/pug`.
Change the argument of the `res.render()` declaration in the `/` route to be the file path to the `views/pug` directory. The path can be a relative path (relative to views), or an absolute path, and does not require a file extension.
Modifica largomento della dichiarazione `res.render()` nella rotta `/` in modo che sia il percorso di file per la directory `views/pug`. Il percorso può essere un percorso relativo (relativo alle viste), o un percorso assoluto, e non richiede un'estensione del file.
If all went as planned, your app home page will stop showing the message "`Pug template is not defined.`" and will now display a message indicating you've successfully rendered the Pug template!
Se tutto è andato come previsto, la tua home page dell'app smetterà di mostrare il messaggio "`Pug template is not defined.`" e ora mostrerà un messaggio che indica che hai reso con successo il modello Pug!
Submit your page when you think you've got it right. If you're running into errors, you can check out the project completed up to this point [here](https://gist.github.com/camperbot/3515cd676ea4dfceab4e322f59a37791).
Invia la tua pagina quando pensi che sia corretto. Se incontri degli errori, puoi controllare il progetto completato fino a questo punto [qui](https://gist.github.com/camperbot/3515cd676ea4dfceab4e322f59a37791).
# --hints--
Pug should be a dependency.
Pug dovrebbe essere una dipendenza.
```js
(getUserInput) =>
@@ -51,7 +51,7 @@ Pug should be a dependency.
);
```
View engine should be Pug.
Il motore di visualizzazione dovrebbe essere Pug.
```js
(getUserInput) =>
@@ -69,7 +69,7 @@ View engine should be Pug.
);
```
Use the correct ExpressJS method to render the index page from the response.
Utilizza il metodo ExpressJS corretto per visualizzare la pagina index dalla risposta.
```js
(getUserInput) =>
@@ -87,7 +87,7 @@ Use the correct ExpressJS method to render the index page from the response.
);
```
Pug should be working.
Pug dovrebbe funzionare.
```js
(getUserInput) =>

View File

@@ -111,7 +111,7 @@ La sessione e il segreto di sessione dovrebbero essere impostate correttamente.
(data) => {
assert.match(
data,
/secret:( |)process.env.SESSION_SECRET/gi,
/secret:( |)process\.env(\.SESSION_SECRET|\[(?<q>"|')SESSION_SECRET\k<q>\])/g,
'Your express app should have express-session set up with your secret as process.env.SESSION_SECRET'
);
},