Skip to content

Commit 296d6e7

Browse files
github-actions[bot]create-or-update-pull-requestbjohansebas
authored
i18n: new crowdin translations (#2433)
Co-authored-by: Create or Update Pull Request Action <create-or-update-pull-request@users.noreply.github.com> Co-authored-by: Sebastian Beltran <bjohansebas@gmail.com>
1 parent e253310 commit 296d6e7

551 files changed

Lines changed: 36093 additions & 8484 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/update-external-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,5 +132,5 @@ jobs:
132132
title: 'i18n: new crowdin translations'
133133
body: >
134134
New Crowdin translations from the [express.js crowdin project](https://express.crowdin.com/u/projects/1). cc: @expressjs/docs-wg
135-
labels: docs
135+
labels: i18n
136136
branch: crowdin/translations

src/content/docs/de/4x/advanced/developing-template-engines.md

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/content/docs/ko/4x/advanced/developing-template-engines.md renamed to src/content/docs/de/4x/advanced/developing-template-engines.mdx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,31 @@ app.set('views', './views'); // specify the views directory
2525
app.set('view engine', 'ntl'); // register the template engine
2626
```
2727

28+
```ts
29+
import fs from 'fs'; // this engine requires the fs module
30+
app.engine(
31+
'ntl',
32+
(
33+
filePath: string,
34+
options: Record<string, any>,
35+
callback: (e: any, rendered?: string) => void
36+
) => {
37+
// define the template engine
38+
fs.readFile(filePath, (err, content) => {
39+
if (err) return callback(err);
40+
// this is an extremely simple template engine
41+
const rendered = content
42+
.toString()
43+
.replace('#title#', `<title>${options.title}</title>`)
44+
.replace('#message#', `<h1>${options.message}</h1>`);
45+
return callback(null, rendered);
46+
});
47+
}
48+
);
49+
app.set('views', './views'); // specify the views directory
50+
app.set('view engine', 'ntl'); // register the template engine
51+
```
52+
2853
Your app will now be able to render `.ntl` files. Create a file named `index.ntl` in the `views` directory with the following content.
2954

3055
```pug

src/content/docs/de/4x/guide/behind-proxies.mdx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ app.set('trust proxy', (ip) => {
7777
});
7878
```
7979

80+
```ts
81+
app.set('trust proxy', (ip: string) => {
82+
if (ip === '127.0.0.1' || ip === '123.123.123.123')
83+
return true; // trusted IPs
84+
else return false;
85+
});
86+
```
87+
8088
</td>
8189
</tr>
8290
</tbody>
@@ -91,8 +99,8 @@ Das Aktivieren von `trust proxy` hat folgende Auswirkungen:
9199
</li>
92100
<li markdown="1">
93101
`X-Forwarded-Proto` kann vom Reverse Proxy gesetzt werden, um der App mitzuteilen, ob es `https`
94-
oder `http` oder sogar ein ungültiger Name ist. Dieser Wert wird von [req.protocol]reflektiert
95-
(/en/api#req.protocol).
102+
oder `http` oder sogar ein ungültiger Name ist. This value is reflected by
103+
[req.protocol](/api/request/#reqprotocol).
96104
</li>
97105
<li markdown="1">
98106
Die Werte [req.ip](/api#req.ip) und [req.ips](/api#req.ips) werden auf der Basis der

0 commit comments

Comments
 (0)