@intlayer/docs 8.4.6 → 8.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blog/en/next-i18next_vs_next-intl_vs_intlayer.md +1 -3
- package/blog/en-GB/next-i18next_vs_next-intl_vs_intlayer.md +1 -3
- package/blog/es/next-i18next_vs_next-intl_vs_intlayer.md +1 -3
- package/blog/id/next-i18next_vs_next-intl_vs_intlayer.md +1 -3
- package/blog/it/next-i18next_vs_next-intl_vs_intlayer.md +1 -3
- package/blog/ja/next-i18next_vs_next-intl_vs_intlayer.md +1 -3
- package/blog/ko/next-i18next_vs_next-intl_vs_intlayer.md +1 -3
- package/blog/uk/next-i18next_vs_next-intl_vs_intlayer.md +1 -3
- package/blog/vi/next-i18next_vs_next-intl_vs_intlayer.md +1 -3
- package/blog/zh/next-i18next_vs_next-intl_vs_intlayer.md +1 -3
- package/docs/en/configuration.md +115 -137
- package/docs/es/configuration.md +14 -6
- package/docs/fr/configuration.md +14 -6
- package/package.json +6 -6
- package/docs/ar/configuration.md +0 -922
- package/docs/bn/configuration.md +0 -922
- package/docs/de/configuration.md +0 -922
- package/docs/en-GB/configuration.md +0 -922
- package/docs/hi/configuration.md +0 -922
- package/docs/id/configuration.md +0 -922
- package/docs/it/configuration.md +0 -923
- package/docs/ja/configuration.md +0 -922
- package/docs/ko/configuration.md +0 -922
- package/docs/pl/configuration.md +0 -922
- package/docs/pt/configuration.md +0 -922
- package/docs/ru/configuration.md +0 -943
- package/docs/tr/configuration.md +0 -922
- package/docs/uk/configuration.md +0 -922
- package/docs/ur/configuration.md +0 -922
- package/docs/vi/configuration.md +0 -922
- package/docs/zh/configuration.md +0 -922
package/docs/de/configuration.md
DELETED
|
@@ -1,922 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
createdAt: 2024-08-13
|
|
3
|
-
updatedAt: 2026-03-20
|
|
4
|
-
title: Konfiguration (Configuration)
|
|
5
|
-
description: Erfahren Sie, wie Sie Intlayer für Ihre Anwendung konfigurieren. Verstehen Sie die verschiedenen Einstellungen und Optionen, die zur Anpassung von Intlayer an Ihre Bedürfnisse zur Verfügung stehen.
|
|
6
|
-
keywords:
|
|
7
|
-
- Konfiguration
|
|
8
|
-
- Einstellungen
|
|
9
|
-
- Anpassung
|
|
10
|
-
- Intlayer
|
|
11
|
-
- Optionen
|
|
12
|
-
slugs:
|
|
13
|
-
- doc
|
|
14
|
-
- concept
|
|
15
|
-
- configuration
|
|
16
|
-
history:
|
|
17
|
-
- version: 8.4.0
|
|
18
|
-
date: 2026-03-20
|
|
19
|
-
changes: Pro-Locale Objektnotation für 'compiler.output' und 'dictionary.fill' hinzugefügt
|
|
20
|
-
- version: 8.3.0
|
|
21
|
-
date: 2026-03-11
|
|
22
|
-
changes: 'baseDir' von Content-Konfiguration in System-Konfiguration verschoben
|
|
23
|
-
- version: 8.2.0
|
|
24
|
-
date: 2026-03-09
|
|
25
|
-
changes: Compiler-Optionen aktualisiert, Unterstützung für 'output' und 'noMetadata' hinzugefügt
|
|
26
|
-
- version: 8.1.7
|
|
27
|
-
date: 2026-02-25
|
|
28
|
-
changes: Compiler-Optionen aktualisiert
|
|
29
|
-
- version: 8.1.5
|
|
30
|
-
date: 2026-02-23
|
|
31
|
-
changes: Compiler-Option 'build-only' und Wörterbuch-Präfix hinzugefügt
|
|
32
|
-
- version: 8.0.6
|
|
33
|
-
date: 2026-02-12
|
|
34
|
-
changes: Unterstützung für Open Router, Alibaba, Amazon, Google Vertex Bedrock, Fireworks, Groq, Hugging Face und Together.ai Anbieter hinzugefügt
|
|
35
|
-
- version: 8.0.5
|
|
36
|
-
date: 2026-02-06
|
|
37
|
-
changes: `dataSerialization` zur AI-Konfiguration hinzugefügt
|
|
38
|
-
- version: 8.0.0
|
|
39
|
-
date: 2026-01-24
|
|
40
|
-
changes: Import-Modus `live` in `fetch` umbenannt, um den zugrunde liegenden Mechanismus besser zu beschreiben.
|
|
41
|
-
- version: 8.0.0
|
|
42
|
-
date: 2026-01-22
|
|
43
|
-
changes: Build-Konfiguration `importMode` in die Dictionary-Konfiguration verschoben.
|
|
44
|
-
- version: 8.0.0
|
|
45
|
-
date: 2026-01-22
|
|
46
|
-
changes: Option `rewrite` zur Routing-Konfiguration hinzugefügt
|
|
47
|
-
- version: 8.0.0
|
|
48
|
-
date: 2026-01-18
|
|
49
|
-
changes: Systemkonfiguration von Content-Konfiguration getrennt. Interne Pfade in die Eigenschaft `system` verschoben. `codeDir` hinzugefügt, um Content-Dateien und Code-Transformation zu trennen.
|
|
50
|
-
- version: 8.0.0
|
|
51
|
-
date: 2026-01-18
|
|
52
|
-
changes: Dictionary-Optionen `location` und `schema` hinzugefügt
|
|
53
|
-
- version: 7.5.1
|
|
54
|
-
date: 2026-01-10
|
|
55
|
-
changes: Unterstützung für JSON5- und JSONC-Dateiformate hinzugefügt
|
|
56
|
-
- version: 7.5.0
|
|
57
|
-
date: 2025-12-17
|
|
58
|
-
changes: Option `buildMode` hinzugefügt
|
|
59
|
-
- version: 7.0.0
|
|
60
|
-
date: 2025-10-25
|
|
61
|
-
changes: Konfiguration `dictionary` hinzugefügt
|
|
62
|
-
- version: 7.0.0
|
|
63
|
-
date: 2025-10-21
|
|
64
|
-
changes: `middleware` durch Routing-Konfiguration `routing` ersetzt
|
|
65
|
-
- version: 7.0.0
|
|
66
|
-
date: 2025-10-12
|
|
67
|
-
changes: Option `formatCommand` hinzugefügt
|
|
68
|
-
- version: 6.2.0
|
|
69
|
-
date: 2025-10-12
|
|
70
|
-
changes: Option `excludedPath` aktualisiert
|
|
71
|
-
- version: 6.0.2
|
|
72
|
-
date: 2025-09-23
|
|
73
|
-
changes: Option `outputFormat` hinzugefügt
|
|
74
|
-
- version: 6.0.0
|
|
75
|
-
date: 2025-09-21
|
|
76
|
-
changes: Feld `dictionaryOutput` und Feld `i18nextResourcesDir` entfernt
|
|
77
|
-
- version: 6.0.0
|
|
78
|
-
date: 2025-09-16
|
|
79
|
-
changes: Import-Modus `live` hinzugefügt
|
|
80
|
-
- version: 6.0.0
|
|
81
|
-
date: 2025-09-04
|
|
82
|
-
changes: Feld `hotReload` durch `liveSync` ersetzt, und Felder `liveSyncPort` und `liveSyncURL` hinzugefügt
|
|
83
|
-
- version: 5.6.1
|
|
84
|
-
date: 2025-07-25
|
|
85
|
-
changes: `activateDynamicImport` durch die Option `importMode` ersetzt
|
|
86
|
-
- version: 5.6.0
|
|
87
|
-
date: 2025-07-13
|
|
88
|
-
changes: Standardmäßiges Verbzeichnis `contentDir` von `['src']` auf `['.']` geändert
|
|
89
|
-
- version: 5.5.11
|
|
90
|
-
date: 2025-06-29
|
|
91
|
-
changes: `docs` Befehle hinzugefügt
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
# Intlayer Konfigurations-Dokumentation
|
|
95
|
-
|
|
96
|
-
## Überblick
|
|
97
|
-
|
|
98
|
-
Die Intlayer-Konfigurationsdateien ermöglichen es Ihnen, verschiedene Aspekte des Plugins anzupassen, wie z. B. die Internationalisierung (internationalization), die Middleware und die Inhaltsverarbeitung. Diese Dokumentation enthält eine detaillierte Beschreibung jeder Eigenschaft in der Konfiguration.
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
|
-
## Inhaltsverzeichnis
|
|
103
|
-
|
|
104
|
-
<TOC/>
|
|
105
|
-
|
|
106
|
-
---
|
|
107
|
-
|
|
108
|
-
## Unterstützte Dateiformate für die Konfiguration
|
|
109
|
-
|
|
110
|
-
Intlayer akzeptiert die Konfigurations-Dateiformate JSON, JS, MJS und TS:
|
|
111
|
-
|
|
112
|
-
- `intlayer.config.ts`
|
|
113
|
-
- `intlayer.config.js`
|
|
114
|
-
- `intlayer.config.json`
|
|
115
|
-
- `intlayer.config.json5`
|
|
116
|
-
- `intlayer.config.jsonc`
|
|
117
|
-
- `intlayer.config.cjs`
|
|
118
|
-
- `intlayer.config.mjs`
|
|
119
|
-
- `.intlayerrc`
|
|
120
|
-
|
|
121
|
-
---
|
|
122
|
-
|
|
123
|
-
## Beispiel einer Konfigurationsdatei
|
|
124
|
-
|
|
125
|
-
````typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
126
|
-
import { Locales, type IntlayerConfig } from "intlayer";
|
|
127
|
-
import { nextjsRewrite } from "intlayer/routing";
|
|
128
|
-
import { z } from "zod";
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Beispiel für eine Intlayer-Konfigurationsdatei mit allen verfügbaren Optionen.
|
|
132
|
-
*/
|
|
133
|
-
const config: IntlayerConfig = {
|
|
134
|
-
/**
|
|
135
|
-
* Konfiguration für Internationalisierungseinstellungen.
|
|
136
|
-
*/
|
|
137
|
-
internationalization: {
|
|
138
|
-
/**
|
|
139
|
-
* Liste der in der Anwendung unterstützten Gebietsschemata (locales).
|
|
140
|
-
* Standard: [Locales.ENGLISH]
|
|
141
|
-
*/
|
|
142
|
-
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Liste der obligatorischen Gebietsschemata, die in jedem Wörterbuch definiert sein müssen.
|
|
146
|
-
* Wenn leer, sind im `strict`-Modus alle Gebietsschemata obligatorisch.
|
|
147
|
-
* Standard: []
|
|
148
|
-
*/
|
|
149
|
-
requiredLocales: [Locales.ENGLISH],
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Die Strenge-Ebene für internationalisierte Inhalte.
|
|
153
|
-
* - "strict": Fehler, wenn ein deklariertes Gebietsschema fehlt oder nicht deklariert ist.
|
|
154
|
-
* - "inclusive": Warnung, wenn ein deklariertes Gebietsschema fehlt.
|
|
155
|
-
* - "loose": Akzeptiert jedes vorhandene Gebietsschema.
|
|
156
|
-
* Standard: "inclusive"
|
|
157
|
-
*/
|
|
158
|
-
strictMode: "inclusive",
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Das Standard-Gebietsschema, das als Fallback verwendet wird, wenn das angeforderte Gebietsschema nicht gefunden wird.
|
|
162
|
-
* Standard: Locales.ENGLISH
|
|
163
|
-
*/
|
|
164
|
-
defaultLocale: Locales.ENGLISH,
|
|
165
|
-
},
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Einstellungen zur Steuerung der Wörterbuchoperationen und des Fallback-Verhaltens.
|
|
169
|
-
*/
|
|
170
|
-
dictionary: {
|
|
171
|
-
/**
|
|
172
|
-
* Steuert, wie Wörterbücher importiert werden.
|
|
173
|
-
* - "static": Statisch zur Build-Zeit importiert.
|
|
174
|
-
* - "dynamic": Dynamisch importiert unter Verwendung von Suspense.
|
|
175
|
-
* - "fetch": Dynamisch abgerufen über die Live Sync API.
|
|
176
|
-
* Standard: "static"
|
|
177
|
-
*/
|
|
178
|
-
importMode: "static",
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Strategie zum automatischen Ausfüllen fehlender Übersetzungen mittels KI.
|
|
182
|
-
* Kann ein boolescher Wert oder ein Pfadmuster zum Speichern der ausgefüllten Inhalte sein.
|
|
183
|
-
* Standard: true
|
|
184
|
-
*/
|
|
185
|
-
fill: true,
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Der physische Speicherort der Wörterbuchdateien.
|
|
189
|
-
* - "local": Im lokalen Dateisystem gespeichert.
|
|
190
|
-
* - "remote": Im Intlayer CMS gespeichert.
|
|
191
|
-
* - "hybrid": Sowohl lokal als auch im Intlayer CMS gespeichert.
|
|
192
|
-
* - "plugin" (oder ein beliebiger benutzerdefinierter String): Von einem Plugin oder einer benutzerdefinierten Quelle bereitgestellt.
|
|
193
|
-
* Standard: "local"
|
|
194
|
-
*/
|
|
195
|
-
location: "local",
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* Ob Inhalte automatisch transformiert werden sollen (z. B. Markdown zu HTML).
|
|
199
|
-
* Standard: false
|
|
200
|
-
*/
|
|
201
|
-
contentAutoTransformation: false,
|
|
202
|
-
},
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Routing- und Middleware-Konfiguration.
|
|
206
|
-
*/
|
|
207
|
-
routing: {
|
|
208
|
-
/**
|
|
209
|
-
* Strategie für das Locale-Routing.
|
|
210
|
-
* - "prefix-no-default": Stellt allen Locales außer der Standard-Locale ein Präfix voran (z. B. /dashboard, /fr/dashboard).
|
|
211
|
-
* - "prefix-all": Stellt allen Locales ein Präfix voran (z. B. /en/dashboard, /fr/dashboard).
|
|
212
|
-
* - "no-prefix": Keine Locale in der URL.
|
|
213
|
-
* - "search-params": Verwendet ?locale=...
|
|
214
|
-
* Standard: "prefix-no-default"
|
|
215
|
-
*/
|
|
216
|
-
mode: "prefix-no-default",
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Wo die vom Benutzer gewählte Locale gespeichert werden soll.
|
|
220
|
-
* Optionen: 'cookie', 'localStorage', 'sessionStorage', 'header' oder ein Array davon.
|
|
221
|
-
* Standard: ['cookie', 'header']
|
|
222
|
-
*/
|
|
223
|
-
storage: ["cookie", "header"],
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* Der Basispfad für die URLs der Anwendung.
|
|
227
|
-
* Standard: ""
|
|
228
|
-
*/
|
|
229
|
-
basePath: "",
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* Benutzerdefinierte URL-Rewrite-Regeln für bestimmte Pfade pro Gebietsschema.
|
|
233
|
-
*/
|
|
234
|
-
rewrite: nextjsRewrite({
|
|
235
|
-
"/[locale]/about": {
|
|
236
|
-
en: "/[locale]/about",
|
|
237
|
-
fr: "/[locale]/a-propos",
|
|
238
|
-
},
|
|
239
|
-
}),
|
|
240
|
-
},
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* Einstellungen in Bezug auf die Suche und Verarbeitung von Inhaltsdateien.
|
|
244
|
-
*/
|
|
245
|
-
content: {
|
|
246
|
-
/**
|
|
247
|
-
* Dateierweiterungen zum Scannen von Wörterbüchern.
|
|
248
|
-
* Standard: ['.content.ts', '.content.js', '.content.json', usw.]
|
|
249
|
-
*/
|
|
250
|
-
fileExtensions: [".content.ts", ".content.js", ".content.json"],
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* Verzeichnisse, in denen sich die .content-Dateien befinden.
|
|
254
|
-
* Standard: ["."]
|
|
255
|
-
*/
|
|
256
|
-
contentDir: ["src"],
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Wo sich der Quellcode befindet.
|
|
260
|
-
* Wird für die Build-Optimierung und Code-Transformation verwendet.
|
|
261
|
-
* Standard: ["."]
|
|
262
|
-
*/
|
|
263
|
-
codeDir: ["src"],
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
* Muster, die vom Scan ausgeschlossen sind.
|
|
267
|
-
* Standard: ['node_modules', '.intlayer', usw.]
|
|
268
|
-
*/
|
|
269
|
-
excludedPath: ["node_modules"],
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* Ob Änderungen überwacht und Wörterbücher während der Entwicklung neu erstellt werden sollen.
|
|
273
|
-
* Standard: true im Entwicklungsmodus
|
|
274
|
-
*/
|
|
275
|
-
watch: true,
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* Befehl zum Formatieren neu erstellter / aktualisierter .content-Dateien.
|
|
279
|
-
*/
|
|
280
|
-
formatCommand: 'npx prettier --write "{{file}}"',
|
|
281
|
-
},
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* Konfiguration für den Visuellen Editor (Visual Editor).
|
|
285
|
-
*/
|
|
286
|
-
editor: {
|
|
287
|
-
/**
|
|
288
|
-
* Ob der visuelle Editor aktiviert ist.
|
|
289
|
-
* Standard: false
|
|
290
|
-
*/
|
|
291
|
-
enabled: true,
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Die URL Ihrer Anwendung für die Origin-Validierung.
|
|
295
|
-
* Standard: ""
|
|
296
|
-
*/
|
|
297
|
-
applicationURL: "http://localhost:3000",
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* Port für den lokalen Editor-Server.
|
|
301
|
-
* Standard: 8000
|
|
302
|
-
*/
|
|
303
|
-
port: 8000,
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* Die öffentliche URL für den Editor.
|
|
307
|
-
* Standard: "http://localhost:8000"
|
|
308
|
-
*/
|
|
309
|
-
editorURL: "http://localhost:8000",
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
* URL des Intlayer CMS.
|
|
313
|
-
* Standard: "https://app.intlayer.org"
|
|
314
|
-
*/
|
|
315
|
-
cmsURL: "https://app.intlayer.org",
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* Backend-API-URL.
|
|
319
|
-
* Standard: "https://back.intlayer.org"
|
|
320
|
-
*/
|
|
321
|
-
backendURL: "https://back.intlayer.org",
|
|
322
|
-
|
|
323
|
-
/**
|
|
324
|
-
* Ob die Inhalts-Synchronisierung in Echtzeit aktiviert werden soll.
|
|
325
|
-
* Standard: false
|
|
326
|
-
*/
|
|
327
|
-
liveSync: true,
|
|
328
|
-
},
|
|
329
|
-
|
|
330
|
-
/**
|
|
331
|
-
* AI-basierte Einstellungen für Übersetzung und Erstellung.
|
|
332
|
-
*/
|
|
333
|
-
ai: {
|
|
334
|
-
/**
|
|
335
|
-
* Der zu verwendende AI-Anbieter.
|
|
336
|
-
* Optionen: 'openai', 'anthropic', 'mistral', 'deepseek', 'gemini', 'ollama', 'openrouter', 'alibaba', 'fireworks', 'groq', 'huggingface', 'bedrock', 'googlevertex', 'togetherai'
|
|
337
|
-
* Standard: 'openai'
|
|
338
|
-
*/
|
|
339
|
-
provider: "openai",
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
* Modell des gewählten Anbieters zur Verwendung.
|
|
343
|
-
*/
|
|
344
|
-
model: "gpt-4o",
|
|
345
|
-
|
|
346
|
-
/**
|
|
347
|
-
* API-Key des Anbieters.
|
|
348
|
-
*/
|
|
349
|
-
apiKey: process.env.OPENAI_API_KEY,
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* Globaler Kontext zur Anleitung der KI beim Erstellen von Übersetzungen.
|
|
353
|
-
*/
|
|
354
|
-
applicationContext: "Dies ist eine Reisebuchungsanwendung.",
|
|
355
|
-
|
|
356
|
-
/**
|
|
357
|
-
* Basis-URL für die AI-API.
|
|
358
|
-
*/
|
|
359
|
-
baseURL: "http://localhost:3000",
|
|
360
|
-
|
|
361
|
-
/**
|
|
362
|
-
* Datenserialisierung (Data Serialization)
|
|
363
|
-
*
|
|
364
|
-
* Optionen:
|
|
365
|
-
* - "json": Standard, robust; verbraucht mehr Token.
|
|
366
|
-
* - "toon": Verbraucht weniger Token, ist möglicherweise nicht so konsistent wie JSON.
|
|
367
|
-
*
|
|
368
|
-
* Standard: "json"
|
|
369
|
-
*/
|
|
370
|
-
dataSerialization: "json",
|
|
371
|
-
},
|
|
372
|
-
|
|
373
|
-
/**
|
|
374
|
-
* Build- und Optimierungseinstellungen.
|
|
375
|
-
*/
|
|
376
|
-
build: {
|
|
377
|
-
/**
|
|
378
|
-
* Modus für die Build-Ausführung.
|
|
379
|
-
* - "auto": Wird automatisch während des Builds der Anwendung erstellt.
|
|
380
|
-
* - "manual": Erfordert einen expliziten Build-Befehl.
|
|
381
|
-
* Standard: "auto"
|
|
382
|
-
*/
|
|
383
|
-
mode: "auto",
|
|
384
|
-
|
|
385
|
-
/**
|
|
386
|
-
* Ob das finale Bundle durch Entfernen ungenutzter Wörterbücher optimiert werden soll.
|
|
387
|
-
* Standard: true in Produktion
|
|
388
|
-
*/
|
|
389
|
-
optimize: true,
|
|
390
|
-
|
|
391
|
-
/**
|
|
392
|
-
* Ausgabeformat für die generierten Wörterbuchdateien.
|
|
393
|
-
* Standard: ['cjs', 'esm']
|
|
394
|
-
*/
|
|
395
|
-
outputFormat: ["cjs", "esm"],
|
|
396
|
-
|
|
397
|
-
/**
|
|
398
|
-
* Gibt an, ob der Build TypeScript-Typen prüfen soll.
|
|
399
|
-
* Standard: false
|
|
400
|
-
*/
|
|
401
|
-
checkTypes: false,
|
|
402
|
-
},
|
|
403
|
-
|
|
404
|
-
/**
|
|
405
|
-
* Logger-Konfiguration.
|
|
406
|
-
*/
|
|
407
|
-
log: {
|
|
408
|
-
/**
|
|
409
|
-
* Logging-Ebene.
|
|
410
|
-
* - "default": Standardmäßiges Logging.
|
|
411
|
-
* - "verbose": Detailliertes Debug-Logging.
|
|
412
|
-
* - "disabled": Deaktiviert das Logging.
|
|
413
|
-
* Standard: "default"
|
|
414
|
-
*/
|
|
415
|
-
mode: "default",
|
|
416
|
-
|
|
417
|
-
/**
|
|
418
|
-
* Präfix für alle Log-Nachrichten.
|
|
419
|
-
* Standard: "[intlayer]"
|
|
420
|
-
*/
|
|
421
|
-
prefix: "[intlayer]",
|
|
422
|
-
},
|
|
423
|
-
|
|
424
|
-
/**
|
|
425
|
-
* Systemkonfiguration (Für fortgeschrittene Nutzung)
|
|
426
|
-
*/
|
|
427
|
-
system: {
|
|
428
|
-
/**
|
|
429
|
-
* Verzeichnis zum Speichern lokalisierter Wörterbücher.
|
|
430
|
-
*/
|
|
431
|
-
dictionariesDir: ".intlayer/dictionary",
|
|
432
|
-
|
|
433
|
-
/**
|
|
434
|
-
* Verzeichnis für TypeScript Module Augmentation.
|
|
435
|
-
*/
|
|
436
|
-
moduleAugmentationDir: ".intlayer/types",
|
|
437
|
-
|
|
438
|
-
/**
|
|
439
|
-
* Verzeichnis zum Speichern nicht zusammengeführter (unmerged) Wörterbücher.
|
|
440
|
-
*/
|
|
441
|
-
unmergedDictionariesDir: ".intlayer/unmerged_dictionary",
|
|
442
|
-
|
|
443
|
-
/**
|
|
444
|
-
* Verzeichnis zum Speichern von Wörterbuchtypen.
|
|
445
|
-
*/
|
|
446
|
-
typesDir: ".intlayer/types",
|
|
447
|
-
|
|
448
|
-
/**
|
|
449
|
-
* Verzeichnis, in dem die Hauptanwendungsdateien gespeichert sind.
|
|
450
|
-
*/
|
|
451
|
-
mainDir: ".intlayer/main",
|
|
452
|
-
|
|
453
|
-
/**
|
|
454
|
-
* Verzeichnis, in dem die Konfigurationsdateien gespeichert sind.
|
|
455
|
-
*/
|
|
456
|
-
configDir: ".intlayer/config",
|
|
457
|
-
|
|
458
|
-
/**
|
|
459
|
-
* Verzeichnis, in dem Cache-Dateien gespeichert sind.
|
|
460
|
-
*/
|
|
461
|
-
cacheDir: ".intlayer/cache",
|
|
462
|
-
},
|
|
463
|
-
|
|
464
|
-
/**
|
|
465
|
-
* Compiler-Konfiguration (Für fortgeschrittene Nutzung)
|
|
466
|
-
*/
|
|
467
|
-
compiler: {
|
|
468
|
-
/**
|
|
469
|
-
* Gibt an, ob der Compiler aktiviert sein soll.
|
|
470
|
-
*
|
|
471
|
-
* - false: Deaktiviert den Compiler.
|
|
472
|
-
* - true: Aktiviert den Compiler.
|
|
473
|
-
* - "build-only": Überspringt den Compiler während der Entwicklung und beschleunigt die Startzeit.
|
|
474
|
-
*
|
|
475
|
-
* Standard: false
|
|
476
|
-
*/
|
|
477
|
-
enabled: true,
|
|
478
|
-
|
|
479
|
-
/**
|
|
480
|
-
* Definiert den Pfad für Ausgabedateien. Ersetzt `outputDir`.
|
|
481
|
-
*
|
|
482
|
-
* - Pfade mit `./` werden relativ zum Komponentenverzeichnis aufgelöst.
|
|
483
|
-
* - Pfade mit `/` werden relativ zum Projektstamm (`baseDir`) aufgelöst.
|
|
484
|
-
*
|
|
485
|
-
* - Die Einbeziehung der Variable `{{locale}}` im Pfad löst die Erstellung separater Wörterbücher pro Sprache aus.
|
|
486
|
-
*
|
|
487
|
-
* Beispiel:
|
|
488
|
-
* ```ts
|
|
489
|
-
* {
|
|
490
|
-
* // Erstelle mehrsprachige .content.ts-Dateien neben der Komponente
|
|
491
|
-
* output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
492
|
-
*
|
|
493
|
-
* // output: './{{fileName}}{{extension}}', // Entspricht der Verwendung eines Template-Strings
|
|
494
|
-
* }
|
|
495
|
-
* ```
|
|
496
|
-
*
|
|
497
|
-
* ```ts
|
|
498
|
-
* {
|
|
499
|
-
* // Erstelle zentralisierte JSON-Dateien pro Sprache im Projektstamm
|
|
500
|
-
* output: ({ key, locale }) => `/locales/${locale}/${key}.content.json`,
|
|
501
|
-
*
|
|
502
|
-
* // output: '/locales/{{locale}}/{{key}}.content.json', // Entspricht der Verwendung eines Template-Strings
|
|
503
|
-
* }
|
|
504
|
-
* ```
|
|
505
|
-
*
|
|
506
|
-
* Liste der Variablen:
|
|
507
|
-
* - `fileName`: Dateiname.
|
|
508
|
-
* - `key`: Content-Key.
|
|
509
|
-
* - `locale`: Content-Locale.
|
|
510
|
-
* - `extension`: Dateierweiterung.
|
|
511
|
-
* - `componentFileName`: Dateiname der Komponente.
|
|
512
|
-
* - `componentExtension`: Dateierweiterung der Komponente.
|
|
513
|
-
* - `format`: Wörterbuchformat.
|
|
514
|
-
* - `componentFormat`: Wörterbuchformat der Komponente.
|
|
515
|
-
* - `componentDirPath`: Pfad zum Komponentenverzeichnis.
|
|
516
|
-
*/
|
|
517
|
-
output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
|
|
518
|
-
|
|
519
|
-
/**
|
|
520
|
-
* Gibt an, ob Komponenten nach der Transformation gespeichert werden sollen.
|
|
521
|
-
* Auf diese Weise kann der Compiler nur einmal ausgeführt werden, um die Anwendung zu transformieren, und kann dann entfernt werden.
|
|
522
|
-
*/
|
|
523
|
-
saveComponents: false,
|
|
524
|
-
|
|
525
|
-
/**
|
|
526
|
-
* Fügt nur den Inhalt in die generierte Datei ein. Nützlich für die JSON-Ausgabe pro Sprache für i18next oder ICU MessageFormat.
|
|
527
|
-
*/
|
|
528
|
-
noMetadata: false,
|
|
529
|
-
|
|
530
|
-
/**
|
|
531
|
-
* Dictionary-Key-Präfix
|
|
532
|
-
*/
|
|
533
|
-
dictionaryKeyPrefix: "", // Fügen Sie den extrahierten Dictionary-Keys ein optionales Präfix hinzu
|
|
534
|
-
},
|
|
535
|
-
|
|
536
|
-
/**
|
|
537
|
-
* Benutzerdefinierte Schemas (Schemas) zur Validierung der Wörterbuchinhalte.
|
|
538
|
-
*/
|
|
539
|
-
schemas: {
|
|
540
|
-
"my-schema": z.object({
|
|
541
|
-
title: z.string(),
|
|
542
|
-
}),
|
|
543
|
-
},
|
|
544
|
-
|
|
545
|
-
/**
|
|
546
|
-
* Plugin-Konfiguration (Plugins).
|
|
547
|
-
*/
|
|
548
|
-
plugins: [],
|
|
549
|
-
};
|
|
550
|
-
|
|
551
|
-
export default config;
|
|
552
|
-
````
|
|
553
|
-
|
|
554
|
-
---
|
|
555
|
-
|
|
556
|
-
## Referenz zur Konfiguration (Configuration Reference)
|
|
557
|
-
|
|
558
|
-
In den folgenden Abschnitten werden die verschiedenen in Intlayer verfügbaren Konfigurationsoptionen beschrieben.
|
|
559
|
-
|
|
560
|
-
---
|
|
561
|
-
|
|
562
|
-
### Konfiguration für Internationalisierung (Internationalization Configuration)
|
|
563
|
-
|
|
564
|
-
Definiert Einstellungen in Bezug auf die Internationalisierung, einschließlich der verfügbaren Locales und der Standard-Locale für die Anwendung.
|
|
565
|
-
|
|
566
|
-
| Feld | Typ | Beschreibung | Beispiel | Hinweis |
|
|
567
|
-
| ----------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
568
|
-
| `locales` | `string[]` | Liste der in der Anwendung unterstützten Locales. Standard: `[Locales.ENGLISH]` | `['en', 'fr', 'es']` | |
|
|
569
|
-
| `requiredLocales` | `string[]` | Liste der obligatorischen Locales in der Anwendung. Standard: `[]` | `[]` | Wenn leer, sind im `strict`-Modus alle Locales obligatorisch. Stellen Sie sicher, dass obligatorische Locales auch im Feld `locales` definiert sind. |
|
|
570
|
-
| `strictMode` | `string` | Gewährleistet eine robuste Implementierung internationalisierter Inhalte unter Verwendung von TypeScript. Standard: `inclusive` | | Wenn `"strict"`: Die `t`-Funktion erfordert, dass jede deklarierte Locale definiert ist — gibt einen Fehler aus, wenn eine fehlt oder nicht deklariert ist. Wenn `"inclusive"`: Warnt bei fehlenden Locales, akzeptiert aber vorhandene nicht deklarierte. Wenn `"loose"`: Akzeptiert jede vorhandene Locale. |
|
|
571
|
-
| `defaultLocale` | `string` | Standard-Locale, die als Fallback verwendet wird, wenn die angeforderte Locale nicht gefunden wird. Standard: `Locales.ENGLISH` | `'en'` | Wird verwendet, um die Locale zu bestimmen, wenn keine in der URL, im Cookie oder im Header angegeben ist. |
|
|
572
|
-
|
|
573
|
-
---
|
|
574
|
-
|
|
575
|
-
### Konfiguration für den Editor (Editor Configuration)
|
|
576
|
-
|
|
577
|
-
Definiert Einstellungen im Zusammenhang mit dem integrierten Editor, einschließlich Serverport und Aktivitätsstatus.
|
|
578
|
-
|
|
579
|
-
| Feld | Typ | Beschreibung | Beispiel | Hinweis |
|
|
580
|
-
| ---------------------------- | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
581
|
-
| `applicationURL` | `string` | Die URL Ihrer Anwendung. Standard: `''` | `'http://localhost:3000'`, `'https://example.com'`, `process.env.INTLAYER_EDITOR_URL` | Wird verwendet, um die Ursprünge (Origins) des Editors aus Sicherheitsgründen einzuschränken. Wenn auf `'*'` gesetzt, kann von jedem Origin aus auf den Editor zugegriffen werden. |
|
|
582
|
-
| `port` | `number` | Port, der vom Visual Editor-Server verwendet wird. Standard: `8000` | | |
|
|
583
|
-
| `editorURL` | `string` | URL des Editor-Servers. Standard: `'http://localhost:8000'` | `'http://localhost:3000'`, `'https://example.com'`, `process.env.INTLAYER_EDITOR_URL` | Wird verwendet, um die Origins einzuschränken, die mit der Anwendung interagieren können. Wenn auf `'*'` gesetzt, von jedem Origin aus zugänglich. Muss gesetzt werden, wenn der Port geändert wird oder der Editor auf einer anderen Domain gehostet wird. |
|
|
584
|
-
| `cmsURL` | `string` | URL des Intlayer CMS. Standard: `'https://intlayer.org'` | `'https://intlayer.org'` | |
|
|
585
|
-
| `backendURL` | `string` | Backend-Server-URL. Standard: `https://back.intlayer.org` | `http://localhost:4000` | |
|
|
586
|
-
| `enabled` | `boolean` | Gibt an, ob die App mit dem visuellen Editor interagiert. Standard: `true` | `process.env.NODE_ENV !== 'production'` | Wenn `false`, kann der Editor nicht mit der App interagieren. Die Deaktivierung für bestimmte Umgebungen erhöht die Sicherheit. |
|
|
587
|
-
| `clientId` | `string | undefined` | Ermöglicht es Intlayer-Paketen, sich über oAuth2 am Backend zu authentifizieren. Um einen Zugriffstoken zu erhalten, gehen Sie zu [intlayer.org/project](https://app.intlayer.org/project). Standard: `undefined` | | Geheim halten; in Umgebungsvariablen speichern. |
|
|
588
|
-
| `clientSecret` | `string | undefined` | Ermöglicht es Intlayer-Paketen, sich über oAuth2 am Backend zu authentifizieren. Um einen Zugriffstoken zu erhalten, gehen Sie zu [intlayer.org/project](https://app.intlayer.org/project). Standard: `undefined` | | Geheim halten; in Umgebungsvariablen speichern. |
|
|
589
|
-
| `dictionaryPriorityStrategy` | `string` | Strategie zur Priorisierung von Wörterbüchern, wenn sowohl lokale als auch entfernte Wörterbücher vorhanden sind. Standard: `'local_first'` | `'distant_first'` | `'distant_first'`: Priorisiert entfernte (Remote) vor lokalen. `'local_first'`: Priorisiert lokale vor entfernten. |
|
|
590
|
-
| `liveSync` | `boolean` | Gibt an, ob der Anwendungsserver Inhalte neu laden soll, wenn eine Änderung im CMS / Visual Editor / Backend erkannt wird. Standard: `true` | `true` | Wenn ein Wörterbuch hinzugefügt/aktualisiert wird, aktualisiert die App den Seiteninhalt. Live Sync lagert den Inhalt auf einen anderen Server aus, was die Leistung geringfügig beeinträchtigen kann. Es wird empfohlen, beides auf derselben Maschine zu hosten. |
|
|
591
|
-
| `liveSyncPort` | `number` | Port des Live Sync Servers. Standard: `4000` | `4000` | |
|
|
592
|
-
| `liveSyncURL` | `string` | URL des Live Sync Servers. Standard: `'http://localhost:{liveSyncPort}'` | `'https://example.com'` | Zeigt standardmäßig auf localhost; kann auf einen entfernten Live Sync Server geändert werden. |
|
|
593
|
-
|
|
594
|
-
### Konfiguration für Routing (Routing Configuration)
|
|
595
|
-
|
|
596
|
-
Einstellungen, die das Routing-Verhalten steuern, einschließlich URL-Struktur, Locale-Speicherung und Middleware-Handhabung.
|
|
597
|
-
|
|
598
|
-
| Feld | Typ | Beschreibung | Beispiel | Hinweis |
|
|
599
|
-
| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
600
|
-
| `mode` | `'prefix-no-default' | 'prefix-all' | 'no-prefix' | 'search-params'` | URL-Routing-Modus für die Behandlung von Locales. Standard: `'prefix-no-default'` | `'prefix-no-default'`: `/dashboard` (en) oder `/fr/dashboard` (fr). `'prefix-all'`: `/en/dashboard`. `'no-prefix'`: Locale wird auf andere Weise behandelt. `'search-params'`: Verwendet `/dashboard?locale=fr` | Beeinflusst nicht die Verwaltung von Cookies oder Locale Storage. |
|
|
601
|
-
| `storage` | `false | 'cookie' | 'localStorage' | 'sessionStorage' | 'header' | CookiesAttributes | StorageAttributes | Array` | Konfiguration zum Speichern der Locale auf dem Client. Standard: `['cookie', 'header']` | `'localStorage'`, `[{ type: 'cookie', name: 'custom-locale', secure: true }]` | Siehe die Tabelle Speicheroptionen unten. |
|
|
602
|
-
| `basePath` | `string` | Der Basispfad für die URLs der Anwendung. Standard: `''` | `'/my-app'` | Wenn sich die Anwendung unter `https://example.com/my-app` befindet, ist basePath `'/my-app'` und URLs werden zu `https://example.com/my-app/en`. |
|
|
603
|
-
| `rewrite` | `Record<string, StrictModeLocaleMap<string>>` | Benutzerdefinierte URL-Rewrite-Regeln, die den Standard-Routing-Modus für bestimmte Pfade überschreiben. Unterstützt dynamische Parameter `[param]`. Standard: `undefined` | Beispiel siehe unten | Rewrite-Regeln haben Priorität über `mode`. Funktioniert mit Next.js und Vite. `getLocalizedUrl()` wendet passende Regeln automatisch an. Siehe [Benutzerdefinierte URL-Rewrites](https://github.com/aymericzip/intlayer/blob/main/docs/docs/de/custom_url_rewrites.md). |
|
|
604
|
-
|
|
605
|
-
**Beispiel für `rewrite`**:
|
|
606
|
-
|
|
607
|
-
```typescript
|
|
608
|
-
routing: {
|
|
609
|
-
mode: "prefix-no-default", // Fallback-Strategie
|
|
610
|
-
rewrite: nextjsRewrite({
|
|
611
|
-
"/about": {
|
|
612
|
-
en: "/about",
|
|
613
|
-
fr: "/a-propos",
|
|
614
|
-
},
|
|
615
|
-
"/product/[slug]": {
|
|
616
|
-
en: "/product/[slug]",
|
|
617
|
-
fr: "/produit/[slug]",
|
|
618
|
-
},
|
|
619
|
-
"/blog/[category]/[id]": {
|
|
620
|
-
en: "/blog/[category]/[id]",
|
|
621
|
-
fr: "/journal/[category]/[id]",
|
|
622
|
-
},
|
|
623
|
-
}),
|
|
624
|
-
}
|
|
625
|
-
```
|
|
626
|
-
|
|
627
|
-
#### Speicheroptionen (Storage Options)
|
|
628
|
-
|
|
629
|
-
| Wert | Beschreibung | Hinweis |
|
|
630
|
-
| ------------------ | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
631
|
-
| `'cookie'` | Speichert die Locale in Cookies — sowohl client- als auch serverseitig zugänglich. | Stellen Sie für die DSGVO-Konformität sicher, dass die entsprechende Zustimmung des Benutzers eingeholt wurde. Anpassbar über `CookiesAttributes` (`{ type: 'cookie', name: 'custom-locale', secure: true, httpOnly: false }`). |
|
|
632
|
-
| `'localStorage'` | Speichert die Locale im Browser ohne Ablaufdatum — nur clientseitig. | Läuft erst ab, wenn explizit gelöscht. Der Intlayer-Proxy kann darauf nicht zugreifen. Anpassbar über `StorageAttributes` (`{ type: 'localStorage', name: 'custom-locale' }`). |
|
|
633
|
-
| `'sessionStorage'` | Speichert die Locale für die Dauer der Seitensitzung — nur clientseitig. | Wird beim Schließen des Tabs/Fensters gelöscht. Der Intlayer-Proxy kann darauf nicht zugreifen. Anpassbar über `StorageAttributes` (`{ type: 'sessionStorage', name: 'custom-locale' }`). |
|
|
634
|
-
| `'header'` | Speichert oder überträgt die Locale über HTTP-Header — nur serverseitig. | Nützlich für API-Aufrufe. Die Clientseite kann darauf nicht zugreifen. Anpassbar über `StorageAttributes` (`{ type: 'header', name: 'custom-locale' }`). |
|
|
635
|
-
|
|
636
|
-
#### Cookie-Attribute (Cookie Attributes)
|
|
637
|
-
|
|
638
|
-
Bei der Speicherung über Cookies können Sie zusätzliche Cookie-Attribute konfigurieren:
|
|
639
|
-
|
|
640
|
-
| Feld | Typ | Beschreibung |
|
|
641
|
-
| ---------- | ------------------------------------- | ------------------------------------------------------- |
|
|
642
|
-
| `name` | `string` | Cookie-Name. Standard: `'INTLAYER_LOCALE'` |
|
|
643
|
-
| `domain` | `string` | Cookie-Domain. Standard: `undefined` |
|
|
644
|
-
| `path` | `string` | Cookie-Pfad. Standard: `undefined` |
|
|
645
|
-
| `secure` | `boolean` | Benötigt HTTPS. Standard: `undefined` |
|
|
646
|
-
| `httpOnly` | `boolean` | HTTP-only Flag. Standard: `undefined` |
|
|
647
|
-
| `sameSite` | `'strict' | 'lax' | 'none'` | SameSite-Richtlinie. |
|
|
648
|
-
| `expires` | `Date | number` | Ablaufdatum oder Anzahl der Tage. Standard: `undefined` |
|
|
649
|
-
|
|
650
|
-
#### Locale Storage-Attribute (Locale Storage Attributes)
|
|
651
|
-
|
|
652
|
-
Bei Verwendung von localStorage oder sessionStorage:
|
|
653
|
-
|
|
654
|
-
| Feld | Typ | Beschreibung |
|
|
655
|
-
| ------ | ---------------------------------------- | ---------------------------------------------------------- |
|
|
656
|
-
| `type` | `'localStorage' | 'sessionStorage'` | Speichertyp. |
|
|
657
|
-
| `name` | `string` | Name des Speicherschlüssels. Standard: `'INTLAYER_LOCALE'` |
|
|
658
|
-
|
|
659
|
-
#### Konfigurationsbeispiele
|
|
660
|
-
|
|
661
|
-
Hier sind einige gängige Konfigurationsbeispiele für die neue v7-Routing-Struktur:
|
|
662
|
-
|
|
663
|
-
**Basiskonfiguration (Standard)**:
|
|
664
|
-
|
|
665
|
-
```typescript
|
|
666
|
-
import { Locales, type IntlayerConfig } from "intlayer";
|
|
667
|
-
// intlayer.config.ts
|
|
668
|
-
const config: IntlayerConfig = {
|
|
669
|
-
internationalization: {
|
|
670
|
-
locales: ["en", "fr", "es"],
|
|
671
|
-
defaultLocale: "en",
|
|
672
|
-
},
|
|
673
|
-
routing: {
|
|
674
|
-
mode: "prefix-no-default",
|
|
675
|
-
storage: "localStorage",
|
|
676
|
-
basePath: "",
|
|
677
|
-
},
|
|
678
|
-
};
|
|
679
|
-
|
|
680
|
-
export default config;
|
|
681
|
-
```
|
|
682
|
-
|
|
683
|
-
**DSGVO-konforme Konfiguration**:
|
|
684
|
-
|
|
685
|
-
```typescript
|
|
686
|
-
import { Locales, type IntlayerConfig } from "intlayer";
|
|
687
|
-
// intlayer.config.ts
|
|
688
|
-
const config: IntlayerConfig = {
|
|
689
|
-
internationalization: {
|
|
690
|
-
locales: ["en", "fr", "es"],
|
|
691
|
-
defaultLocale: "en",
|
|
692
|
-
},
|
|
693
|
-
routing: {
|
|
694
|
-
mode: "prefix-no-default",
|
|
695
|
-
storage: [
|
|
696
|
-
{
|
|
697
|
-
type: "localStorage",
|
|
698
|
-
name: "user-locale",
|
|
699
|
-
},
|
|
700
|
-
{
|
|
701
|
-
type: "cookie",
|
|
702
|
-
name: "user-locale",
|
|
703
|
-
secure: true,
|
|
704
|
-
sameSite: "strict",
|
|
705
|
-
httpOnly: false,
|
|
706
|
-
},
|
|
707
|
-
],
|
|
708
|
-
basePath: "",
|
|
709
|
-
},
|
|
710
|
-
};
|
|
711
|
-
|
|
712
|
-
export default config;
|
|
713
|
-
```
|
|
714
|
-
|
|
715
|
-
**Suchparameter-Modus (Search Parameters Mode)**:
|
|
716
|
-
|
|
717
|
-
```typescript
|
|
718
|
-
import { Locales, type IntlayerConfig } from "intlayer";
|
|
719
|
-
// intlayer.config.ts
|
|
720
|
-
const config: IntlayerConfig = {
|
|
721
|
-
internationalization: {
|
|
722
|
-
locales: ["en", "fr", "es"],
|
|
723
|
-
defaultLocale: "en",
|
|
724
|
-
},
|
|
725
|
-
routing: {
|
|
726
|
-
mode: "search-params",
|
|
727
|
-
storage: "localStorage",
|
|
728
|
-
basePath: "",
|
|
729
|
-
},
|
|
730
|
-
};
|
|
731
|
-
|
|
732
|
-
export default config;
|
|
733
|
-
```
|
|
734
|
-
|
|
735
|
-
**Präfixfreier Modus (No Prefix Mode) mit benutzerdefiniertem Speicher**:
|
|
736
|
-
|
|
737
|
-
```typescript
|
|
738
|
-
import { Locales, type IntlayerConfig } from "intlayer";
|
|
739
|
-
// intlayer.config.ts
|
|
740
|
-
const config: IntlayerConfig = {
|
|
741
|
-
internationalization: {
|
|
742
|
-
locales: ["en", "fr", "es"],
|
|
743
|
-
defaultLocale: "en",
|
|
744
|
-
},
|
|
745
|
-
routing: {
|
|
746
|
-
mode: "no-prefix",
|
|
747
|
-
storage: {
|
|
748
|
-
type: "sessionStorage",
|
|
749
|
-
name: "app-locale",
|
|
750
|
-
},
|
|
751
|
-
basePath: "/my-app",
|
|
752
|
-
},
|
|
753
|
-
};
|
|
754
|
-
|
|
755
|
-
export default config;
|
|
756
|
-
```
|
|
757
|
-
|
|
758
|
-
**Benutzerdefinierter URL-Rewrite mit dynamischen Pfaden**:
|
|
759
|
-
|
|
760
|
-
```typescript
|
|
761
|
-
// intlayer.config.ts
|
|
762
|
-
import { nextjsRewrite } from "intlayer/routing";
|
|
763
|
-
|
|
764
|
-
const config: IntlayerConfig = {
|
|
765
|
-
internationalization: {
|
|
766
|
-
locales: ["en", "fr"],
|
|
767
|
-
defaultLocale: "en",
|
|
768
|
-
},
|
|
769
|
-
routing: {
|
|
770
|
-
mode: "prefix-no-default", // Fallback für Pfade ohne Rewrite
|
|
771
|
-
storage: "cookie",
|
|
772
|
-
rewrite: nextjsRewrite({
|
|
773
|
-
"/about": {
|
|
774
|
-
en: "/about",
|
|
775
|
-
fr: "/a-propos",
|
|
776
|
-
},
|
|
777
|
-
"/product/[slug]": {
|
|
778
|
-
en: "/product/[slug]",
|
|
779
|
-
fr: "/produit/[slug]",
|
|
780
|
-
},
|
|
781
|
-
"/blog/[category]/[id]": {
|
|
782
|
-
en: "/blog/[category]/[id]",
|
|
783
|
-
fr: "/journal/[category]/[id]",
|
|
784
|
-
},
|
|
785
|
-
}),
|
|
786
|
-
},
|
|
787
|
-
};
|
|
788
|
-
|
|
789
|
-
export default config;
|
|
790
|
-
```
|
|
791
|
-
|
|
792
|
-
---
|
|
793
|
-
|
|
794
|
-
### Konfiguration für Content (Content Configuration)
|
|
795
|
-
|
|
796
|
-
Einstellungen in Bezug auf die Verarbeitung von Inhalten innerhalb der Anwendung (Verzeichnisnamen, Dateierweiterungen und abgeleitete Konfigurationen).
|
|
797
|
-
|
|
798
|
-
| Feld | Typ | Beschreibung | Beispiel | Hinweis |
|
|
799
|
-
| ---------------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
800
|
-
| `watch` | `boolean` | Gibt an, ob Intlayer Änderungen an Inhaltsdeklarationsdateien überwachen soll, um Wörterbücher neu zu erstellen. Standard: `process.env.NODE_ENV === 'development'` | | |
|
|
801
|
-
| `fileExtensions` | `string[]` | Dateierweiterungen, die zum Scannen von Inhaltsdeklarationsdateien verwendet werden. Standard: `['.content.ts', '.content.js', '.content.mjs', '.content.cjs', '.content.json', '.content.json5', '.content.jsonc']` | `['.content.ts', '.content.js']` | |
|
|
802
|
-
| `contentDir` | `string[]` | Pfade zu Verzeichnissen, in denen sich die Inhaltsdeklarationsdateien befinden. Standard: `['.']` | `['src/content']` | |
|
|
803
|
-
| `codeDir` | `string[]` | Pfade zu Verzeichnissen, in denen sich die Quellcodedateien Ihrer Anwendung befinden. Standard: `['.']` | `['src']` | Wird zur Optimierung des Builds verwendet und stellt sicher, dass Code-Transformation und Hot Reload nur auf die erforderlichen Dateien angewendet werden. |
|
|
804
|
-
| `excludedPath` | `string[]` | Pfade, die vom Inhalts-Scan ausgeschlossen sind. Standard: `['node_modules', '.intlayer', '.next', 'dist', 'build']` | `['src/styles']` | |
|
|
805
|
-
| `formatCommand` | `string` | Befehl, der ausgeführt wird, um neu erstellte oder aktualisierte Inhaltsdateien zu formatieren. Standard: `undefined` | `'npx prettier --write "{{file}}"'` | Wird während der Inhalts-Extraktion oder über den visuellen Editor verwendet. |
|
|
806
|
-
|
|
807
|
-
---
|
|
808
|
-
|
|
809
|
-
### Konfiguration für Wörterbücher (Dictionary Configuration)
|
|
810
|
-
|
|
811
|
-
Einstellungen, die den Betrieb von Wörterbüchern steuern, einschließlich des Verhaltens beim automatischen Ausfüllen und der Inhaltsgenerierung.
|
|
812
|
-
|
|
813
|
-
Diese Wörterbuchkonfiguration hat zwei Hauptzwecke:
|
|
814
|
-
|
|
815
|
-
1. **Standardwerte**: Definieren von Standardwerten beim Erstellen von Inhaltsdeklarationsdateien.
|
|
816
|
-
2. **Fallback-Verhalten**: Bereitstellung von Fallback-Werten, wenn bestimmte Felder nicht definiert sind, sodass Sie das Verhalten von Wörterbuchoperationen global definieren können.
|
|
817
|
-
|
|
818
|
-
Weitere Informationen zu Inhaltsdeklarationsdateien und zur Anwendung von Konfigurationswerten finden Sie in der [Dokumentation zu Inhaltsdateien](https://github.com/aymericzip/intlayer/blob/main/docs/docs/de/dictionary/content_file.md).
|
|
819
|
-
|
|
820
|
-
| Feld | Typ | Beschreibung | Beispiel | Hinweis |
|
|
821
|
-
| --------------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
822
|
-
| `fill` | `boolean | FilePathPattern | Partial<Record<Locale, boolean | FilePathPattern>>` | Steuert, wie die Ausgabedateien für das automatische Ausfüllen (KI-Übersetzung) generiert werden. Standard: `true` | Siehe Beispiel unten | `true`: Standardpfad (gleiche Datei wie die Quelle). `false`: Deaktiviert. String-/Funktions-Templates generieren Dateien pro Locale. Pro-Locale-Objekt: Jedes Locale wird einem eigenen Muster zugeordnet; `false` überspringt dieses Locale. Die Einbeziehung von `{{locale}}` löst die Generierung pro Locale aus. Das `fill` auf Wörterbuchebene hat immer Vorrang vor dieser globalen Konfiguration. |
|
|
823
|
-
| `importMode` | `'static' | 'dynamic' | 'fetch'` | Steuert, wie Wörterbücher importiert werden. Standard: `'static'` | `'dynamic'` | `'static'`: Statisch importiert. `'dynamic'`: Dynamisch über Suspense importiert. `'fetch'`: Dynamisch über die Live Sync API abgerufen. Beeinflusst nicht `getIntlayer`, `getDictionary`, `useDictionary` usw. |
|
|
824
|
-
| `location` | `'local' | 'remote' | 'hybrid' | string` | Wo die Wörterbücher gespeichert werden. Standard: `'local'` | `'remote'` | `'local'`: Dateisystem. `'remote'`: Intlayer CMS. `'hybrid'`: Beides. |
|
|
825
|
-
| `contentAutoTransformation` | `boolean` | Ob Inhaltsdateien automatisch transformiert werden sollen (z. B. von Markdown zu HTML). Standard: `false` | `true` | Nützlich für die Verarbeitung von Markdown-Feldern über @intlayer/markdown. |
|
|
826
|
-
|
|
827
|
-
**Beispiel für `fill`**:
|
|
828
|
-
|
|
829
|
-
```ts
|
|
830
|
-
dictionary: {
|
|
831
|
-
fill: {
|
|
832
|
-
en: '/locales/en/{{key}}.content.json',
|
|
833
|
-
fr: ({ key }) => `/locales/fr/${key}.content.json`,
|
|
834
|
-
es: false,
|
|
835
|
-
}
|
|
836
|
-
}
|
|
837
|
-
```
|
|
838
|
-
|
|
839
|
-
---
|
|
840
|
-
|
|
841
|
-
### AI-Konfiguration (AI Configuration)
|
|
842
|
-
|
|
843
|
-
Definiert Einstellungen für die KI-gestützten Funktionen von Intlayer, wie z. B. die Erstellung von Übersetzungen.
|
|
844
|
-
|
|
845
|
-
| Feld | Typ | Beschreibung | Beispiel | Hinweis |
|
|
846
|
-
| -------------------- | ---------------------- | --------------------------------------------------------------------------------------- | ------------------------------------------- | --------------------------------------------------------------------------------------------------- |
|
|
847
|
-
| `provider` | `string` | Der zu verwendende AI-Anbieter. | `'openai'`, `'anthropic'`, `'googlevertex'` | |
|
|
848
|
-
| `model` | `string` | Das zu verwendende AI-Modell. | `'gpt-4o'`, `'claude-3-5-sonnet-20240620'` | |
|
|
849
|
-
| `apiKey` | `string` | API-Key für den gewählten Anbieter. | `process.env.OPENAI_API_KEY` | |
|
|
850
|
-
| `applicationContext` | `string` | Zusätzlicher Kontext über Ihre App zur Verbesserung der Genauigkeit der KI-Übersetzung. | `'Lernplattform für Kinder.'` | |
|
|
851
|
-
| `baseURL` | `string` | Optionale Basis-URL für API-Aufrufe. | | Nützlich, wenn Sie einen Proxy oder ein lokales KI-Deployment verwenden. |
|
|
852
|
-
| `dataSerialization` | `'json' | 'toon'` | Definiert, wie Daten an die KI gesendet werden. Standard: `'json'` | `'json'` | `'json'`: Robuster und präziser. `'toon'`: Verbraucht weniger Token, kann aber weniger stabil sein. |
|
|
853
|
-
|
|
854
|
-
---
|
|
855
|
-
|
|
856
|
-
### Konfiguration für Build (Build Configuration)
|
|
857
|
-
|
|
858
|
-
Einstellungen für den Build-Prozess und die Optimierung von Intlayer.
|
|
859
|
-
|
|
860
|
-
| Feld | Typ | Beschreibung | Beispiel | Hinweis |
|
|
861
|
-
| -------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------ | -------- | ------- |
|
|
862
|
-
| `mode` | `'auto' | 'manual'` | Gibt an, ob Intlayer während der Pre-Build-Schritte der App automatisch ausgeführt werden soll. Standard: `'auto'` | | |
|
|
863
|
-
| `optimize` | `boolean` | Gibt an, ob kompilierte Wörterbücher für die Laufzeit optimiert werden sollen. Standard: `true` in Produktion | | |
|
|
864
|
-
| `outputFormat` | `('cjs' | 'esm')[]` | Ausgabeformat für die generierten Wörterbuchdateien. Standard: `['cjs', 'esm']` | | |
|
|
865
|
-
| `checkTypes` | `boolean` | Gibt an, ob Intlayer die Typen in den generierten Dateien prüfen soll. Standard: `false` | | |
|
|
866
|
-
|
|
867
|
-
---
|
|
868
|
-
|
|
869
|
-
### Systemkonfiguration (System Configuration)
|
|
870
|
-
|
|
871
|
-
Diese Einstellungen sind für fortgeschrittene Anwendungsfälle und die interne Konfiguration von Intlayer gedacht.
|
|
872
|
-
|
|
873
|
-
| Feld | Typ | Beschreibung | Standard |
|
|
874
|
-
| ------------------------- | -------- | ----------------------------------------------------- | --------------------------------- |
|
|
875
|
-
| `dictionariesDir` | `string` | Verzeichnis der kompilierten Wörterbücher. | `'.intlayer/dictionary'` |
|
|
876
|
-
| `moduleAugmentationDir` | `string` | Verzeichnis für TypeScript Module Augmentation. | `'.intlayer/types'` |
|
|
877
|
-
| `unmergedDictionariesDir` | `string` | Verzeichnis der nicht zusammengeführten Wörterbücher. | `'.intlayer/unmerged_dictionary'` |
|
|
878
|
-
| `typesDir` | `string` | Verzeichnis der generierten Typen. | `'.intlayer/types'` |
|
|
879
|
-
| `mainDir` | `string` | Hauptverzeichnis der Intlayer-Dateien. | `'.intlayer/main'` |
|
|
880
|
-
| `configDir` | `string` | Verzeichnis der kompilierten Konfigurationsdateien. | `'.intlayer/config'` |
|
|
881
|
-
| `cacheDir` | `string` | Verzeichnis der Cache-Dateien. | `'.intlayer/cache'` |
|
|
882
|
-
|
|
883
|
-
---
|
|
884
|
-
|
|
885
|
-
### Compiler-Konfiguration (Compiler Configuration)
|
|
886
|
-
|
|
887
|
-
Einstellungen für den Intlayer Compiler (`intlayer compiler`).
|
|
888
|
-
|
|
889
|
-
| Feld | Typ | Beschreibung | Standard |
|
|
890
|
-
| --------------------- | ------------------------ | ---------------------------------------------------------------------------------------------------- | -------- |
|
|
891
|
-
| `enabled` | `boolean` | Gibt an, ob der Compiler aktiv ist. | `false` |
|
|
892
|
-
| `output` | `string | Function` | Ausgabepfad für extrahierte Wörterbücher. | |
|
|
893
|
-
| `saveComponents` | `boolean` | Gibt an, ob die Original-Quelldateien mit den transformierten Versionen überschrieben werden sollen. | `false` |
|
|
894
|
-
| `noMetadata` | `boolean` | Wenn `true`, fügt der Compiler keine Metadaten in die generierten Dateien ein. | `false` |
|
|
895
|
-
| `dictionaryKeyPrefix` | `string` | Optionales Dictionary-Key-Präfix. | `''` |
|
|
896
|
-
|
|
897
|
-
---
|
|
898
|
-
|
|
899
|
-
### Logger-Konfiguration (Logger Configuration)
|
|
900
|
-
|
|
901
|
-
Einstellungen zur Anpassung der Log-Ausgabe von Intlayer.
|
|
902
|
-
|
|
903
|
-
| Feld | Typ | Beschreibung | Standard |
|
|
904
|
-
| -------- | ---------------------------------------------- | --------------------------- | -------------- |
|
|
905
|
-
| `mode` | `'default' | 'verbose' | 'disabled'` | Logging-Modus. | `'default'` |
|
|
906
|
-
| `prefix` | `string` | Präfix für Log-Nachrichten. | `'[intlayer]'` |
|
|
907
|
-
|
|
908
|
-
---
|
|
909
|
-
|
|
910
|
-
### Benutzerdefinierte Schemas (Custom Schemas)
|
|
911
|
-
|
|
912
|
-
| Feld | Typ | Beschreibung |
|
|
913
|
-
| --------- | --------------------------- | -------------------------------------------------------------------------------------------- |
|
|
914
|
-
| `schemas` | `Record<string, ZodSchema>` | Erlaubt es Ihnen, Zod-Schemas zur Validierung der Struktur Ihrer Wörterbücher zu definieren. |
|
|
915
|
-
|
|
916
|
-
---
|
|
917
|
-
|
|
918
|
-
### Plugins
|
|
919
|
-
|
|
920
|
-
| Feld | Typ | Beschreibung |
|
|
921
|
-
| --------- | ------------------ | -------------------------------------------- |
|
|
922
|
-
| `plugins` | `IntlayerPlugin[]` | Liste der zu aktivierenden Intlayer-Plugins. |
|