mirror of
https://github.com/expressjs/expressjs.com.git
synced 2026-02-21 19:41:33 +00:00
i18n: new crowdin translations (#1923)
New Crowdin translations by GitHub Action Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: Sebastian Beltran <bjohansebas@gmail.com>
This commit is contained in:
committed by
GitHub
parent
00a676dc8c
commit
c530d43275
@@ -93,13 +93,13 @@ nom pour app.param(name, fn)</a></li>
|
||||
<li><a href="#brotli-support">Brotli encoding support</a></li>
|
||||
</ul>
|
||||
|
||||
### Méthodes et propriétés supprimées
|
||||
## Méthodes et propriétés supprimées
|
||||
|
||||
Si vous utilisez une de ces méthodes ou propriétés dans votre
|
||||
application, elle tombera en panne. Vous devrez donc modifier votre
|
||||
application après la mise à jour vers la version 5.
|
||||
|
||||
<h4 id="app.del">app.del()</h4>
|
||||
<h3 id="app.del">app.del()</h3>
|
||||
|
||||
Express 5 ne prend plus en charge la fonction
|
||||
`app.del()`. Si vous utilisez cette fonction, une
|
||||
@@ -135,14 +135,14 @@ app.delete('/user/:id', (req, res) => {
|
||||
})
|
||||
```
|
||||
|
||||
<h4 id="app.param">app.param(fn)</h4>
|
||||
<h3 id="app.param">app.param(fn)</h3>
|
||||
|
||||
La signature `app.param(fn)` servait à
|
||||
modifier le comportement de la fonction
|
||||
`app.param(name, fn)`. Elle est obsolète depuis la
|
||||
version 4.11.0 et Express 5 ne la prend plus en charge.
|
||||
|
||||
<h4 id="plural">Noms de méthodes au pluriel</h4>
|
||||
<h3 id="plural">Noms de méthodes au pluriel</h3>
|
||||
|
||||
Les noms de méthode suivants ont été mis au pluriel. Dans Express 4, l'utilisation des anciennes méthodes ont généré un avertissement
|
||||
d'obsolescence. Express 5 ne les prend plus du tout en charge :
|
||||
@@ -187,8 +187,8 @@ app.all('/', (req, res) => {
|
||||
})
|
||||
```
|
||||
|
||||
<h4 id="leading">Signe deux-points (:) de tête dans le nom de la
|
||||
fonction app.param(name, fn)</h4>
|
||||
<h3 id="leading">Signe deux-points (:) de tête dans le nom de la
|
||||
fonction app.param(name, fn)</h3>
|
||||
|
||||
Le signe deux-points (:) de tête dans le nom de la fonction
|
||||
`app.param(name, fn)` est une subsistance d'Express 3 et, pour des raisons de
|
||||
@@ -200,7 +200,7 @@ signe deux-points.
|
||||
Cela n'affectera normalement pas votre code si vous lisez la documentation Express 4
|
||||
d'[app.param](/{{ page.lang }}/4x/api.html#app.param) car cela ne mentionne pas le signe deux-points de tête.
|
||||
|
||||
<h4 id="req.param">req.param(name)</h4>
|
||||
<h3 id="req.param">req.param(name)</h3>
|
||||
|
||||
Cette méthode potentiellement déroutante et dangereuse
|
||||
d'extraction des données de formulaire a été supprimée. Vous devrez
|
||||
@@ -238,7 +238,7 @@ app.post('/user', (req, res) => {
|
||||
})
|
||||
```
|
||||
|
||||
<h4 id="res.json">res.json(obj, status)</h4>
|
||||
<h3 id="res.json">res.json(obj, status)</h3>
|
||||
|
||||
Express 5 ne prend plus en charge la signature
|
||||
`res.json(obj, status)`. A la place, définissez le
|
||||
@@ -260,7 +260,7 @@ app.post('/user', (req, res) => {
|
||||
})
|
||||
```
|
||||
|
||||
<h4 id="res.jsonp">res.jsonp(obj, status)</h4>
|
||||
<h3 id="res.jsonp">res.jsonp(obj, status)</h3>
|
||||
|
||||
Express 5 ne prend plus en charge la signature
|
||||
`res.jsonp(obj, status)`. A la place, définissez le
|
||||
@@ -281,7 +281,7 @@ app.post('/user', (req, res) => {
|
||||
})
|
||||
```
|
||||
|
||||
<h4 id="res.redirect">res.redirect(url, status)</h4>
|
||||
<h3 id="res.redirect">res.redirect(url, status)</h3>
|
||||
|
||||
Express 5 ne prend plus en charge la signature
|
||||
`res.send(obj, status)`. A la place, définissez le
|
||||
@@ -302,7 +302,7 @@ app.get('/user', (req, res) => {
|
||||
})
|
||||
```
|
||||
|
||||
<h4 id="magic-redirect">res.redirect('back') and res.location('back')</h4>
|
||||
<h3 id="magic-redirect">res.redirect('back') and res.location('back')</h3>
|
||||
|
||||
Express 5 no longer supports the magic string `back` in the `res.redirect()` and `res.location()` methods. Instead, use the `req.get('Referrer') || '/'` value to redirect back to the previous page. In Express 4, the res.`redirect('back')` and `res.location('back')` methods were deprecated.
|
||||
|
||||
@@ -329,7 +329,7 @@ app.get('/user', (req, res) => {
|
||||
})
|
||||
```
|
||||
|
||||
<h4 id="res.send.body">res.send(body, status)</h4>
|
||||
<h3 id="res.send.body">res.send(body, status)</h3>
|
||||
|
||||
Express 5 no longer supports the signature `res.send(obj, status)`. Instead, set the status and then chain it to the `res.send()` method like this: `res.status(status).send(obj)`.
|
||||
|
||||
@@ -347,7 +347,7 @@ app.get('/user', (req, res) => {
|
||||
})
|
||||
```
|
||||
|
||||
<h4 id="res.send.status">res.send(status)</h4>
|
||||
<h3 id="res.send.status">res.send(status)</h3>
|
||||
|
||||
Express 5 ne prend plus en charge la signature <code>res.send(<em>statut</em>)</code>, où _`statut`_
|
||||
est un nombre. A la place, utilisez la fonction
|
||||
@@ -372,7 +372,7 @@ app.get('/user', (req, res) => {
|
||||
})
|
||||
```
|
||||
|
||||
<h4 id="res.sendfile">res.sendfile()</h4>
|
||||
<h3 id="res.sendfile">res.sendfile()</h3>
|
||||
|
||||
La fonction `res.sendfile()` a été remplacée
|
||||
par une
|
||||
@@ -392,12 +392,12 @@ app.get('/user', (req, res) => {
|
||||
})
|
||||
```
|
||||
|
||||
<h4 id="router.param">router.param(fn)</h4>
|
||||
<h3 id="router.param">router.param(fn)</h3>
|
||||
|
||||
The `router.param(fn)` signature was used for modifying the behavior of the `router.param(name, fn)` function. Elle est obsolète depuis la
|
||||
version 4.11.0 et Express 5 ne la prend plus en charge.
|
||||
|
||||
<h4 id="express.static.mime">express.static.mime</h4>
|
||||
<h3 id="express.static.mime">express.static.mime</h3>
|
||||
|
||||
In Express 5, `mime` is no longer an exported property of the `static` field.
|
||||
Use the [`mime-types` package](https://github.com/jshttp/mime-types) to work with MIME type values.
|
||||
@@ -411,7 +411,7 @@ const mime = require('mime-types')
|
||||
mime.lookup('json')
|
||||
```
|
||||
|
||||
<h4 id="express:router-debug-logs">express:router debug logs</h4>
|
||||
<h3 id="express:router-debug-logs">express:router debug logs</h3>
|
||||
|
||||
In Express 5, router handling logic is performed by a dependency. Therefore, the
|
||||
debug logs for the router are no longer available under the `express:` namespace.
|
||||
@@ -430,9 +430,9 @@ DEBUG=express:* node index.js
|
||||
DEBUG=express:*,router,router:* node index.js
|
||||
```
|
||||
|
||||
<h3>Modifié</h3>
|
||||
## Modifié
|
||||
|
||||
<h4 id="path-syntax">Path route matching syntax</h4>
|
||||
<h3 id="path-syntax">Path route matching syntax</h3>
|
||||
|
||||
Path route matching syntax is when a string is supplied as the first parameter to the `app.all()`, `app.use()`, `app.METHOD()`, `router.all()`, `router.METHOD()`, and `router.use()` APIs. The following changes have been made to how the path string is matched to an incoming request:
|
||||
|
||||
@@ -496,17 +496,17 @@ app.get(['/discussion/:slug', '/page/:slug'], async (req, res) => {
|
||||
- Some characters have been reserved to avoid confusion during upgrade (`()[]?+!`), use `\` to escape them.
|
||||
- Parameter names now support valid JavaScript identifiers, or quoted like `:"this"`.
|
||||
|
||||
<h4 id="rejected-promises">Rejected promises handled from middleware and handlers</h4>
|
||||
<h3 id="rejected-promises">Rejected promises handled from middleware and handlers</h3>
|
||||
|
||||
Request middleware and handlers that return rejected promises are now handled by forwarding the rejected value as an `Error` to the error handling middleware. This means that using `async` functions as middleware and handlers are easier than ever. When an error is thrown in an `async` function or a rejected promise is `await`ed inside an async function, those errors will be passed to the error handler as if calling `next(err)`.
|
||||
|
||||
Details of how Express handles errors is covered in the [error handling documentation](/en/guide/error-handling.html).
|
||||
|
||||
<h4 id="express.urlencoded">express.urlencoded</h4>
|
||||
<h3 id="express.urlencoded">express.urlencoded</h3>
|
||||
|
||||
The `express.urlencoded` method makes the `extended` option `false` by default.
|
||||
|
||||
<h4 id="app.listen">app.listen</h4>
|
||||
<h3 id="app.listen">app.listen</h3>
|
||||
|
||||
In Express 5, the `app.listen` method will invoke the user-provided callback function (if provided) when the server receives an error event. In Express 4, such errors would be thrown. This change shifts error-handling responsibility to the callback function in Express 5. If there is an error, it will be passed to the callback as an argument.
|
||||
Par exemple :
|
||||
@@ -520,45 +520,45 @@ const server = app.listen(8080, '0.0.0.0', (error) => {
|
||||
})
|
||||
```
|
||||
|
||||
<h4 id="app.router">app.router</h4>
|
||||
<h3 id="app.router">app.router</h3>
|
||||
|
||||
L'objet `app.router`, qui a été supprimé dans Express 4, est revenu dans Express 5. Dans la version, cet objet
|
||||
n'est qu'une référence dans le routeur Express de base, contrairement à Express 3, où une application devait le charger explicitement.
|
||||
|
||||
<h4 id="req.body">req.body</h4>
|
||||
<h3 id="req.body">req.body</h3>
|
||||
|
||||
The `req.body` property returns `undefined` when the body has not been parsed. In Express 4, it returns `{}` by default.
|
||||
|
||||
<h4 id="req.host">req.host</h4>
|
||||
<h3 id="req.host">req.host</h3>
|
||||
|
||||
Dans Express 4, la `req.host` retirait de
|
||||
manière incorrecte le numéro de port s'il était présent. Dans Express 5, ce numéro de port est conservé.
|
||||
|
||||
<h4 id="req.query">req.query</h4>
|
||||
<h3 id="req.query">req.query</h3>
|
||||
|
||||
The `req.query` property is no longer a writable property and is instead a getter. The default query parser has been changed from "extended" to "simple".
|
||||
|
||||
<h4 id="res.clearCookie">res.clearCookie</h4>
|
||||
<h3 id="res.clearCookie">res.clearCookie</h3>
|
||||
|
||||
The `res.clearCookie` method ignores the `maxAge` and `expires` options provided by the user.
|
||||
|
||||
<h4 id="res.status">res.status</h4>
|
||||
<h3 id="res.status">res.status</h3>
|
||||
|
||||
The `res.status` method only accepts integers in the range of `100` to `999`, following the behavior defined by Node.js, and it returns an error when the status code is not an integer.
|
||||
|
||||
<h4 id="res.query">res.vary</h4>
|
||||
<h3 id="res.query">res.vary</h3>
|
||||
|
||||
The `res.vary` throws an error when the `field` argument is missing. In Express 4, if the argument was omitted, it gave a warning in the console
|
||||
|
||||
### Améliorations
|
||||
## Améliorations
|
||||
|
||||
<h4 id="res.render">res.render()</h4>
|
||||
<h3 id="res.render">res.render()</h3>
|
||||
|
||||
Cette méthode impose désormais un comportement asynchrone pour
|
||||
tous les moteurs de vue. Cela évite les bogues générés par les
|
||||
moteurs de vue qui avaient une implémentation synchrone et qui
|
||||
ne prenaient pas en compte l'interface recommandée.
|
||||
|
||||
<h4 id="brotli-support">Brotli encoding support</h4>
|
||||
<h3 id="brotli-support">Brotli encoding support</h3>
|
||||
|
||||
Express 5 supports Brotli encoding for requests received from clients that support it.
|
||||
|
||||
@@ -43,22 +43,20 @@ app.listen(port, () => {
|
||||
{% endif %}
|
||||
|
||||
<section id="intro">
|
||||
|
||||
<div id="boxes" class="clearfix">
|
||||
<div id="web-applications">
|
||||
<h2>Web Applications</h2> Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.
|
||||
</div>
|
||||
<div id="apis">
|
||||
<h2>APIs</h2> With a myriad of HTTP utility methods and middleware at your disposal, creating a robust API is quick and easy.
|
||||
<h2>APIs</h2> With a myriad of HTTP utility methods and middleware at your disposal, creating a robust API is quick and easy.
|
||||
</div>
|
||||
<div id="performance">
|
||||
<h2>Performance</h2> Express provides a thin layer of fundamental web application features, without obscuring Node.js features that you know and love.
|
||||
<h2>Performance</h2> Express provides a thin layer of fundamental web application features, without obscuring Node.js features that you know and love.
|
||||
</div>
|
||||
<div id="middleware">
|
||||
<h2>Middleware</h2>
|
||||
Express is a lightweight and flexible routing framework with minimal core features
|
||||
meant to be augmented through the use of Express <a href="{{ page.lang }}/resources/middleware. html">middleware</a> modules.
|
||||
meant to be augmented through the use of Express <a href="{{ page.lang }}/resources/middleware.html">middleware</a> modules.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
@@ -25,7 +25,7 @@ The Express technical committee consists of active project members, and guides d
|
||||
|
||||
## Community contributing guide
|
||||
|
||||
<!-- SRC: expressjs/express Contributing.md -->
|
||||
<!-- SRC: expressjs/discussions docs/GOVERNANCE.md -->
|
||||
|
||||
The goal of this document is to create a contribution process that:
|
||||
|
||||
@@ -274,7 +274,7 @@ By making a contribution to this project, I certify that:
|
||||
|
||||
## Collaborator's guide
|
||||
|
||||
<!-- SRC: expressjs/express Collaborator-Guide.md -->
|
||||
<!-- SRC: expressjs/.github CONTRIBUTING.md -->
|
||||
|
||||
### Website Issues
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ express.static(root, [options])
|
||||
```
|
||||
|
||||
The `root` argument specifies the root directory from which to serve static assets.
|
||||
For more information on the `options` argument, see [express.static](/{{page.lang}}/4x/api.html#express.static).
|
||||
For more information on the `options` argument, see [express.static](/{{page.lang}}/5x/api.html#express.static).
|
||||
|
||||
Par exemple, utilisez le code suivant pour
|
||||
servir des images, des fichiers CSS et des fichiers JavaScript dans
|
||||
@@ -63,12 +63,7 @@ For best results, [use a reverse proxy](/{{page.lang}}/advanced/best-practice-pe
|
||||
{% endcapture %}
|
||||
{% include admonitions/note.html content=alert_content %}
|
||||
|
||||
Pour créer un préfixe de chemin d'accès virtuel (dans lequel le
|
||||
chemin d'accès n'existe pas vraiment dans le système de fichiers)
|
||||
pour les fichiers qui sont servis par la fonction
|
||||
`express.static`, [indiquez un
|
||||
chemin de montage](/{{ page.lang }}/4x/api.html#app.use) pour le répertoire statique, comme démontré
|
||||
ci-dessous :
|
||||
To create a virtual path prefix (where the path does not actually exist in the file system) for files that are served by the `express.static` function, [specify a mount path](/{{ page.lang }}/5x/api.html#app.use) for the static directory, as shown below:
|
||||
|
||||
```js
|
||||
app.use('/static', express.static('public'))
|
||||
|
||||
Reference in New Issue
Block a user