mirror of
https://github.com/expressjs/expressjs.com.git
synced 2026-02-22 03:51:33 +00:00
i18n: new crowdin translations (#2158)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
This commit is contained in:
committed by
GitHub
parent
f31a7d4057
commit
c2106f9470
@@ -36,16 +36,16 @@ To help you migrate your express server, we have created a set of codemods that
|
||||
Run the following command for run all the codemods available:
|
||||
|
||||
```sh
|
||||
npx @expressjs/codemod upgrade
|
||||
npx codemod@latest @expressjs/v5-migration-recipe
|
||||
```
|
||||
|
||||
If you want to run a specific codemod, you can run the following command:
|
||||
|
||||
```sh
|
||||
npx @expressjs/codemod name-of-the-codemod
|
||||
npx codemod@latest @expressjs/name-of-the-codemod
|
||||
```
|
||||
|
||||
You can find the list of available codemods [here](https://github.com/expressjs/codemod?tab=readme-ov-file#available-codemods).
|
||||
You can find the list of available codemods [here](https://codemod.link/express).
|
||||
|
||||
<h2 id="changes">Modifications dans Express 5</h2>
|
||||
|
||||
@@ -114,16 +114,16 @@ clé réservé dans JavaScript. Cependant, à partir d'ECMAScript 6,
|
||||
`delete` et les autres mots clés réservés peuvent
|
||||
être utilisés en toute légalité comme noms de propriété.
|
||||
|
||||
{% capture codemod-deprecated-signatures %}
|
||||
{% capture codemod-route-del-to-delete %}
|
||||
You can replace the deprecated signatures with the following command:
|
||||
|
||||
```plain-text
|
||||
npx @expressjs/codemod v4-deprecated-signatures
|
||||
npx codemod@latest @expressjs/route-del-to-delete
|
||||
```
|
||||
|
||||
{% endcapture %}
|
||||
|
||||
{% include admonitions/note.html content=codemod-deprecated-signatures %}
|
||||
{% include admonitions/note.html content=codemod-route-del-to-delete %}
|
||||
|
||||
```js
|
||||
// v4
|
||||
@@ -162,7 +162,7 @@ d'obsolescence. Express 5 ne les prend plus du tout en charge :
|
||||
You can replace the deprecated signatures with the following command:
|
||||
|
||||
```plain-text
|
||||
npx @expressjs/codemod pluralized-methods
|
||||
npx codemod@latest @expressjs/pluralize-method-names
|
||||
```
|
||||
|
||||
{% endcapture %}
|
||||
@@ -213,7 +213,7 @@ l'objet `req.params`, `req.body` ou `req.query`.
|
||||
You can replace the deprecated signatures with the following command:
|
||||
|
||||
```plain-text
|
||||
npx @expressjs/codemod req-param
|
||||
npx codemod@latest @expressjs/explicit-request-params
|
||||
```
|
||||
|
||||
{% endcapture %}
|
||||
@@ -248,7 +248,16 @@ statut et enchaînez-le à la méthode
|
||||
`res.json()` comme suit :
|
||||
`res.status(status).json(obj)`.
|
||||
|
||||
{% include admonitions/note.html content=codemod-deprecated-signatures %}
|
||||
{% capture codemod-status-send-order %}
|
||||
You can replace the deprecated signatures with the following command:
|
||||
|
||||
```plain-text
|
||||
npx codemod@latest @expressjs/status-send-order
|
||||
```
|
||||
|
||||
{% endcapture %}
|
||||
|
||||
{% include admonitions/note.html content=codemod-status-send-order %}
|
||||
|
||||
```js
|
||||
// v4
|
||||
@@ -269,7 +278,7 @@ Express 5 ne prend plus en charge la signature
|
||||
statut et enchaînez-le à la méthode `res.jsonp()`
|
||||
comme suit : `res.status(status).jsonp(obj)`.
|
||||
|
||||
{% include admonitions/note.html content=codemod-deprecated-signatures %}
|
||||
{% include admonitions/note.html content=codemod-status-send-order %}
|
||||
|
||||
```js
|
||||
// v4
|
||||
@@ -290,7 +299,16 @@ Express 5 ne prend plus en charge la signature
|
||||
statut et enchaînez-le à la méthode `res.send()`
|
||||
comme suit : `res.status(status).send(obj)`.
|
||||
|
||||
{% include admonitions/note.html content=codemod-deprecated-signatures %}
|
||||
{% capture codemod-redirect-arg-order %}
|
||||
You can replace the deprecated signatures with the following command:
|
||||
|
||||
```plain-text
|
||||
npx codemod@latest @expressjs/redirect-arg-order
|
||||
```
|
||||
|
||||
{% endcapture %}
|
||||
|
||||
{% include admonitions/note.html content=codemod-redirect-arg-order %}
|
||||
|
||||
```js
|
||||
// v4
|
||||
@@ -308,16 +326,16 @@ app.get('/user', (req, res) => {
|
||||
|
||||
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.
|
||||
|
||||
{% capture codemod-magic-redirect %}
|
||||
{% capture codemod-back-redirect-deprecated %}
|
||||
You can replace the deprecated signatures with the following command:
|
||||
|
||||
```plain-text
|
||||
npx @expressjs/codemod magic-redirect
|
||||
npx codemod@latest @expressjs/back-redirect-deprecated
|
||||
```
|
||||
|
||||
{% endcapture %}
|
||||
|
||||
{% include admonitions/note.html content=codemod-magic-redirect %}
|
||||
{% include admonitions/note.html content=codemod-back-redirect-deprecated %}
|
||||
|
||||
```js
|
||||
// v4
|
||||
@@ -335,7 +353,7 @@ app.get('/user', (req, res) => {
|
||||
|
||||
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)`.
|
||||
|
||||
{% include admonitions/note.html content=codemod-deprecated-signatures %}
|
||||
{% include admonitions/note.html content=codemod-status-send-order %}
|
||||
|
||||
```js
|
||||
// v4
|
||||
@@ -360,7 +378,7 @@ Si vous devez envoyer un nombre à l'aide de la fonction `res.send()`,
|
||||
mettez ce nombre entre guillemets pour qu'Express ne l'interprète pas
|
||||
comme une tentative d'utilisation de l'ancienne signature non prise en charge.
|
||||
|
||||
{% include admonitions/note.html content=codemod-deprecated-signatures %}
|
||||
{% include admonitions/note.html content=codemod-status-send-order %}
|
||||
|
||||
```js
|
||||
// v4
|
||||
@@ -389,7 +407,16 @@ version CamelCase `res.sendFile()` dans Express 5.
|
||||
- Font files (.woff): now "font/woff" instead of "application/font-woff"
|
||||
- SVG files (.svg): now "image/svg+xml" instead of "application/svg+xml"
|
||||
|
||||
{% include admonitions/note.html content=codemod-deprecated-signatures %}
|
||||
{% capture codemod-camelcase-sendfile %}
|
||||
You can replace the deprecated signatures with the following command:
|
||||
|
||||
```plain-text
|
||||
npx codemod@latest @expressjs/camelcase-sendfile
|
||||
```
|
||||
|
||||
{% endcapture %}
|
||||
|
||||
{% include admonitions/note.html content=codemod-camelcase-sendfile %}
|
||||
|
||||
```js
|
||||
// v4
|
||||
|
||||
Reference in New Issue
Block a user