@intlayer/docs 8.2.4 → 8.3.0-canary.1
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/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/cjs/blog.cjs.map +1 -1
- package/dist/cjs/common.cjs +1 -1
- package/dist/cjs/common.cjs.map +1 -1
- package/dist/cjs/doc.cjs.map +1 -1
- package/dist/cjs/frequentQuestions.cjs.map +1 -1
- package/dist/cjs/generated/blog.entry.cjs +1 -1
- package/dist/cjs/generated/blog.entry.cjs.map +1 -1
- package/dist/cjs/generated/docs.entry.cjs +1 -1
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/cjs/generated/frequentQuestions.entry.cjs +1 -1
- package/dist/cjs/generated/frequentQuestions.entry.cjs.map +1 -1
- package/dist/cjs/generated/legal.entry.cjs +1 -1
- package/dist/cjs/generated/legal.entry.cjs.map +1 -1
- package/dist/cjs/legal.cjs.map +1 -1
- package/dist/esm/blog.mjs.map +1 -1
- package/dist/esm/common.mjs +1 -1
- package/dist/esm/common.mjs.map +1 -1
- package/dist/esm/doc.mjs.map +1 -1
- package/dist/esm/frequentQuestions.mjs.map +1 -1
- package/dist/esm/generated/blog.entry.mjs.map +1 -1
- package/dist/esm/generated/docs.entry.mjs.map +1 -1
- package/dist/esm/generated/frequentQuestions.entry.mjs.map +1 -1
- package/dist/esm/generated/legal.entry.mjs.map +1 -1
- package/dist/esm/legal.mjs.map +1 -1
- package/dist/types/blog.d.ts +1 -1
- package/dist/types/common.d.ts +1 -1
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/doc.d.ts +1 -1
- package/dist/types/frequentQuestions.d.ts +1 -1
- package/dist/types/generated/blog.entry.d.ts +1 -1
- package/dist/types/generated/docs.entry.d.ts +1 -1
- package/dist/types/generated/frequentQuestions.entry.d.ts +1 -1
- package/dist/types/generated/legal.entry.d.ts +1 -1
- package/dist/types/legal.d.ts +1 -1
- package/docs/ar/compiler.md +73 -8
- package/docs/ar/configuration.md +74 -27
- package/docs/ar/intlayer_with_nextjs_compiler.md +13 -5
- package/docs/ar/intlayer_with_tanstack.md +22 -1
- package/docs/ar/intlayer_with_vite+react_compiler.md +13 -5
- package/docs/de/compiler.md +74 -9
- package/docs/de/configuration.md +61 -22
- package/docs/de/intlayer_with_nextjs_compiler.md +12 -4
- package/docs/de/intlayer_with_tanstack.md +22 -1
- package/docs/de/intlayer_with_vite+react_compiler.md +12 -4
- package/docs/en/compiler.md +79 -1
- package/docs/en/configuration.md +50 -9
- package/docs/en/intlayer_with_nextjs_compiler.md +9 -1
- package/docs/en/intlayer_with_tanstack.md +23 -2
- package/docs/en/intlayer_with_vite+react_compiler.md +9 -1
- package/docs/en-GB/compiler.md +72 -6
- package/docs/en-GB/configuration.md +50 -10
- package/docs/en-GB/intlayer_with_nextjs_compiler.md +22 -3
- package/docs/en-GB/intlayer_with_tanstack.md +22 -1
- package/docs/en-GB/intlayer_with_vite+react_compiler.md +22 -3
- package/docs/es/compiler.md +71 -6
- package/docs/es/configuration.md +65 -26
- package/docs/es/intlayer_with_nextjs_compiler.md +9 -1
- package/docs/es/intlayer_with_tanstack.md +22 -1
- package/docs/es/intlayer_with_vite+react_compiler.md +9 -1
- package/docs/fr/compiler.md +69 -4
- package/docs/fr/configuration.md +62 -23
- package/docs/fr/intlayer_with_nextjs_compiler.md +9 -1
- package/docs/fr/intlayer_with_tanstack.md +22 -1
- package/docs/fr/intlayer_with_vite+react_compiler.md +9 -1
- package/docs/hi/compiler.md +74 -9
- package/docs/hi/configuration.md +70 -23
- package/docs/hi/intlayer_with_nextjs_compiler.md +15 -7
- package/docs/hi/intlayer_with_tanstack.md +22 -1
- package/docs/hi/intlayer_with_vite+react_compiler.md +15 -7
- package/docs/id/compiler.md +73 -8
- package/docs/id/configuration.md +67 -20
- package/docs/id/intlayer_with_nextjs_compiler.md +13 -5
- package/docs/id/intlayer_with_tanstack.md +22 -1
- package/docs/id/intlayer_with_vite+react_compiler.md +13 -5
- package/docs/it/compiler.md +73 -8
- package/docs/it/configuration.md +66 -27
- package/docs/it/intlayer_with_nextjs_compiler.md +12 -4
- package/docs/it/intlayer_with_tanstack.md +22 -1
- package/docs/it/intlayer_with_vite+react_compiler.md +12 -4
- package/docs/ja/compiler.md +75 -10
- package/docs/ja/configuration.md +70 -23
- package/docs/ja/intlayer_with_nextjs_compiler.md +13 -5
- package/docs/ja/intlayer_with_tanstack.md +22 -1
- package/docs/ja/intlayer_with_vite+react_compiler.md +13 -5
- package/docs/ko/compiler.md +75 -10
- package/docs/ko/configuration.md +70 -23
- package/docs/ko/intlayer_with_nextjs_compiler.md +22 -3
- package/docs/ko/intlayer_with_tanstack.md +22 -1
- package/docs/ko/intlayer_with_vite+react_compiler.md +22 -3
- package/docs/pl/compiler.md +73 -8
- package/docs/pl/configuration.md +71 -29
- package/docs/pl/intlayer_with_nextjs_compiler.md +13 -5
- package/docs/pl/intlayer_with_tanstack.md +22 -1
- package/docs/pl/intlayer_with_vite+react_compiler.md +13 -5
- package/docs/pt/compiler.md +74 -9
- package/docs/pt/configuration.md +62 -23
- package/docs/pt/intlayer_with_nextjs_compiler.md +12 -4
- package/docs/pt/intlayer_with_tanstack.md +22 -1
- package/docs/pt/intlayer_with_vite+react_compiler.md +12 -4
- package/docs/ru/compiler.md +74 -9
- package/docs/ru/configuration.md +61 -22
- package/docs/ru/intlayer_with_nextjs_compiler.md +11 -3
- package/docs/ru/intlayer_with_tanstack.md +22 -1
- package/docs/ru/intlayer_with_vite+react_compiler.md +11 -3
- package/docs/tr/compiler.md +73 -8
- package/docs/tr/configuration.md +77 -42
- package/docs/tr/intlayer_with_nextjs_compiler.md +11 -3
- package/docs/tr/intlayer_with_tanstack.md +22 -1
- package/docs/tr/intlayer_with_vite+react_compiler.md +11 -3
- package/docs/uk/compiler.md +74 -9
- package/docs/uk/configuration.md +207 -165
- package/docs/uk/intlayer_with_nextjs_compiler.md +13 -5
- package/docs/uk/intlayer_with_tanstack.md +22 -1
- package/docs/uk/intlayer_with_vite+react_compiler.md +13 -5
- package/docs/vi/compiler.md +75 -10
- package/docs/vi/configuration.md +97 -21
- package/docs/vi/intlayer_with_nextjs_compiler.md +14 -6
- package/docs/vi/intlayer_with_tanstack.md +22 -1
- package/docs/vi/intlayer_with_vite+react_compiler.md +14 -6
- package/docs/zh/compiler.md +75 -10
- package/docs/zh/configuration.md +77 -42
- package/docs/zh/intlayer_with_nextjs_compiler.md +13 -5
- package/docs/zh/intlayer_with_tanstack.md +22 -1
- package/docs/zh/intlayer_with_vite+react_compiler.md +13 -5
- package/package.json +17 -17
- package/src/blog.ts +1 -1
- package/src/common.ts +2 -1
- package/src/doc.ts +1 -1
- package/src/frequentQuestions.ts +1 -1
- package/src/generated/blog.entry.ts +1 -1
- package/src/generated/docs.entry.ts +1 -1
- package/src/generated/frequentQuestions.entry.ts +1 -1
- package/src/generated/legal.entry.ts +1 -1
- package/src/legal.ts +1 -1
|
@@ -20,6 +20,9 @@ slugs:
|
|
|
20
20
|
applicationTemplate: https://github.com/aymericzip/intlayer-next-no-lolale-path-template
|
|
21
21
|
youtubeVideo: https://www.youtube.com/watch?v=e_PPG7PTqGU
|
|
22
22
|
history:
|
|
23
|
+
- version: 8.2.0
|
|
24
|
+
date: 2026-03-09
|
|
25
|
+
changes: Update compiler options, add FilePathPattern support
|
|
23
26
|
- version: 8.1.6
|
|
24
27
|
date: 2026-02-23
|
|
25
28
|
changes: الإصدار الأولي
|
|
@@ -128,23 +131,28 @@ const config: IntlayerConfig = {
|
|
|
128
131
|
},
|
|
129
132
|
compiler: {
|
|
130
133
|
/**
|
|
131
|
-
*
|
|
134
|
+
* يشير إلى ما إذا كان يجب تمكين المجمّع.
|
|
132
135
|
*/
|
|
133
136
|
enabled: true,
|
|
134
137
|
|
|
135
138
|
/**
|
|
136
139
|
* دليل الإخراج للقواميس المحسنة.
|
|
137
140
|
*/
|
|
138
|
-
|
|
141
|
+
output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* أدخل المحتوى فقط في الملف الذي تم إنشاؤه، بدون مفتاح.
|
|
145
|
+
*/
|
|
146
|
+
noMetadata: false,
|
|
139
147
|
|
|
140
148
|
/**
|
|
141
149
|
* بادئة مفتاح القاموس
|
|
142
150
|
*/
|
|
143
|
-
dictionaryKeyPrefix: "", //
|
|
151
|
+
dictionaryKeyPrefix: "", // Remove base prefix
|
|
144
152
|
|
|
145
153
|
/**
|
|
146
|
-
*
|
|
147
|
-
* بهذه الطريقة، يمكن تشغيل
|
|
154
|
+
* يشير إلى ما إذا كان يجب حفظ المكونات بعد تحويلها.
|
|
155
|
+
* بهذه الطريقة، يمكن تشغيل المجمّع مرة واحدة فقط لتحويل التطبيق، ثم يمكن إزالته.
|
|
148
156
|
*/
|
|
149
157
|
saveComponents: false,
|
|
150
158
|
},
|
|
@@ -437,12 +437,33 @@ export const Route = createFileRoute("/{-$locale}/")({
|
|
|
437
437
|
component: RouteComponent,
|
|
438
438
|
head: ({ params }) => {
|
|
439
439
|
const { locale } = params;
|
|
440
|
+
const path = "/"; // The path for this route
|
|
441
|
+
|
|
440
442
|
const metaContent = getIntlayer("app", locale);
|
|
441
443
|
|
|
442
444
|
return {
|
|
445
|
+
links: [
|
|
446
|
+
// Canonical link: Points to the current localized page
|
|
447
|
+
{ rel: "canonical", href: getLocalizedUrl(path, locale) },
|
|
448
|
+
|
|
449
|
+
// Hreflang: Tell Google about all localized versions
|
|
450
|
+
...localeMap(({ locale: mapLocale }) => ({
|
|
451
|
+
rel: "alternate",
|
|
452
|
+
hrefLang: mapLocale,
|
|
453
|
+
href: getLocalizedUrl(path, mapLocale),
|
|
454
|
+
})),
|
|
455
|
+
|
|
456
|
+
// x-default: For users in unmatched languages
|
|
457
|
+
// Define the default fallback locale (usually your primary language)
|
|
458
|
+
{
|
|
459
|
+
rel: "alternate",
|
|
460
|
+
hrefLang: "x-default",
|
|
461
|
+
href: getLocalizedUrl(path, defaultLocale),
|
|
462
|
+
},
|
|
463
|
+
],
|
|
443
464
|
meta: [
|
|
444
465
|
{ title: metaContent.title },
|
|
445
|
-
{ content: metaContent.meta.description
|
|
466
|
+
{ name: "description", content: metaContent.meta.description },
|
|
446
467
|
],
|
|
447
468
|
};
|
|
448
469
|
},
|
|
@@ -19,6 +19,9 @@ slugs:
|
|
|
19
19
|
applicationTemplate: https://github.com/aymericzip/intlayer-vite-react-template
|
|
20
20
|
youtubeVideo: https://www.youtube.com/watch?v=dS9L7uJeak4
|
|
21
21
|
history:
|
|
22
|
+
- version: 8.2.0
|
|
23
|
+
date: 2026-03-09
|
|
24
|
+
changes: Update compiler options, add FilePathPattern support
|
|
22
25
|
- version: 8.1.6
|
|
23
26
|
date: 2026-02-23
|
|
24
27
|
changes: الإصدار الأولي
|
|
@@ -125,23 +128,28 @@ const config: IntlayerConfig = {
|
|
|
125
128
|
},
|
|
126
129
|
compiler: {
|
|
127
130
|
/**
|
|
128
|
-
*
|
|
131
|
+
* يشير إلى ما إذا كان يجب تمكين المجمّع.
|
|
129
132
|
*/
|
|
130
133
|
enabled: true,
|
|
131
134
|
|
|
132
135
|
/**
|
|
133
136
|
* دليل الإخراج للقواميس المحسنة.
|
|
134
137
|
*/
|
|
135
|
-
|
|
138
|
+
output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* أدخل المحتوى فقط في الملف الذي تم إنشاؤه، بدون مفتاح.
|
|
142
|
+
*/
|
|
143
|
+
noMetadata: false,
|
|
136
144
|
|
|
137
145
|
/**
|
|
138
146
|
* بادئة مفتاح القاموس
|
|
139
147
|
*/
|
|
140
|
-
dictionaryKeyPrefix: "", //
|
|
148
|
+
dictionaryKeyPrefix: "", // Remove base prefix
|
|
141
149
|
|
|
142
150
|
/**
|
|
143
|
-
*
|
|
144
|
-
* بهذه الطريقة، يمكن تشغيل
|
|
151
|
+
* يشير إلى ما إذا كان يجب حفظ المكونات بعد تحويلها.
|
|
152
|
+
* بهذه الطريقة، يمكن تشغيل المجمّع مرة واحدة فقط لتحويل التطبيق، ثم يمكن إزالته.
|
|
145
153
|
*/
|
|
146
154
|
saveComponents: false,
|
|
147
155
|
},
|
package/docs/de/compiler.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-09-09
|
|
3
|
-
updatedAt: 2026-
|
|
3
|
+
updatedAt: 2026-03-10
|
|
4
4
|
title: Intlayer Compiler | Automatisierte Inhaltsextraktion für i18n
|
|
5
5
|
description: Automatisieren Sie Ihren Internationalisierungsprozess mit dem Intlayer Compiler. Extrahieren Sie Inhalte direkt aus Ihren Komponenten für schnellere und effizientere i18n in Vite, Next.js und mehr.
|
|
6
6
|
keywords:
|
|
@@ -20,6 +20,9 @@ slugs:
|
|
|
20
20
|
- doc
|
|
21
21
|
- compiler
|
|
22
22
|
history:
|
|
23
|
+
- version: 8.2.0
|
|
24
|
+
date: 2026-03-10
|
|
25
|
+
changes: Update compiler options, add FilePathPattern support
|
|
23
26
|
- version: 8.1.7
|
|
24
27
|
date: 2026-02-25
|
|
25
28
|
changes: Compiler-Optionen aktualisieren
|
|
@@ -157,13 +160,12 @@ import { type IntlayerConfig, Locales } from "intlayer";
|
|
|
157
160
|
const config: IntlayerConfig = {
|
|
158
161
|
compiler: {
|
|
159
162
|
/**
|
|
160
|
-
*
|
|
161
|
-
* Auf 'build-only' setzen, um den Compiler während der Entwicklung zu überspringen und die Startzeiten zu beschleunigen.
|
|
163
|
+
* Stellen Sie build-only ein, um den Compiler während der Entwicklung zu überspringen und die Startzeiten zu beschleunigen.
|
|
162
164
|
*/
|
|
163
165
|
enabled: true,
|
|
164
166
|
|
|
165
167
|
/**
|
|
166
|
-
*
|
|
168
|
+
* Pattern to traverse the code to optimize.
|
|
167
169
|
*/
|
|
168
170
|
transformPattern: [
|
|
169
171
|
"**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}",
|
|
@@ -171,23 +173,28 @@ const config: IntlayerConfig = {
|
|
|
171
173
|
],
|
|
172
174
|
|
|
173
175
|
/**
|
|
174
|
-
*
|
|
176
|
+
* Pattern to exclude from the optimization.
|
|
175
177
|
*/
|
|
176
178
|
excludePattern: ["**/node_modules/**"],
|
|
177
179
|
|
|
178
180
|
/**
|
|
179
181
|
* Ausgabeverzeichnis für die optimierten Wörterbücher.
|
|
180
182
|
*/
|
|
181
|
-
|
|
183
|
+
output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
|
|
182
184
|
|
|
183
185
|
/**
|
|
184
|
-
*
|
|
186
|
+
* Fügen Sie nur den Inhalt in die generierte Datei ein, ohne Schlüssel.
|
|
185
187
|
*/
|
|
186
|
-
|
|
188
|
+
noMetadata: false,
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Wörterbuch-Präfix
|
|
192
|
+
*/
|
|
193
|
+
dictionaryKeyPrefix: "", // Remove base prefix
|
|
187
194
|
|
|
188
195
|
/**
|
|
189
196
|
* Gibt an, ob die Komponenten nach der Transformation gespeichert werden sollen.
|
|
190
|
-
* Auf diese Weise kann der Compiler nur einmal ausgeführt werden, um die App zu transformieren, und
|
|
197
|
+
* Auf diese Weise kann der Compiler nur einmal ausgeführt werden, um die App zu transformieren, und dann entfernt werden.
|
|
191
198
|
*/
|
|
192
199
|
saveComponents: false,
|
|
193
200
|
},
|
|
@@ -209,3 +216,61 @@ npx intlayer fill # Fehlende Übersetzungen ausfüllen
|
|
|
209
216
|
```
|
|
210
217
|
|
|
211
218
|
> Weitere Informationen finden Sie in der [CLI-Dokumentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/de/cli/ci.md)
|
|
219
|
+
|
|
220
|
+
### Compiler-Konfigurationsreferenz
|
|
221
|
+
|
|
222
|
+
Die folgenden Eigenschaften können im Block `compiler` Ihrer Datei `intlayer.config.ts` konfiguriert werden:
|
|
223
|
+
|
|
224
|
+
- **enabled**:
|
|
225
|
+
- _Typ_: `boolean | 'build-only'`
|
|
226
|
+
- _Standard_: `true`
|
|
227
|
+
- _Beschreibung_: Gibt an, ob der Compiler aktiviert werden soll.
|
|
228
|
+
- **dictionaryKeyPrefix**:
|
|
229
|
+
- _Typ_: `string`
|
|
230
|
+
- _Standard_: `'comp-'`
|
|
231
|
+
- _Beschreibung_: Präfix für die extrahierten Wörterbuchschlüssel.
|
|
232
|
+
- **transformPattern**:
|
|
233
|
+
- _Typ_: `string | string[]`
|
|
234
|
+
- _Standard_: `['**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}', '!**/node_modules/**']`
|
|
235
|
+
- _Beschreibung_: Muster zum Durchlaufen des zu optimierenden Codes.
|
|
236
|
+
- **excludePattern**:
|
|
237
|
+
- _Typ_: `string | string[]`
|
|
238
|
+
- _Standard_: `['**/node_modules/**']`
|
|
239
|
+
- _Beschreibung_: Muster, die von der Optimierung ausgeschlossen werden sollen.
|
|
240
|
+
- **outputDir** (Deprecated):
|
|
241
|
+
- _Typ_: `string`
|
|
242
|
+
- _Standard_: `'compiler'`
|
|
243
|
+
- _Beschreibung_: Das Verzeichnis, in dem die extrahierten Wörterbücher gespeichert werden.
|
|
244
|
+
|
|
245
|
+
- **output**:
|
|
246
|
+
- _Typ_: `FilePathPattern`
|
|
247
|
+
- _Standard_: `({ key }) => 'compiler/${key}.content.json'`
|
|
248
|
+
- _Beschreibung_: Definiert den Pfad der Ausgabedateien. Ersetzt `outputDir`. Verarbeitet dynamische Variablen wie `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{componentFormat}}`. Kann als String im Format `'my/{{var}}/path'` oder als Funktion festgelegt werden.
|
|
249
|
+
- _Hinweis_: `./**/*` Pfade werden relativ zur Komponente aufgelöst. `/**/*` Pfade werden relativ zum Intlayer `baseDir` aufgelöst.
|
|
250
|
+
- _Beispiel_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
|
|
251
|
+
|
|
252
|
+
- **noMetadata**:
|
|
253
|
+
- _Typ_: `boolean`
|
|
254
|
+
- _Standard_: `false`
|
|
255
|
+
- _Beschreibung_: Gibt an, ob die Metadaten in der Datei gespeichert werden sollen. Wenn true, speichert der Compiler nicht die Metadaten der Wörterbücher (Schlüssel, Content-Wrapper).
|
|
256
|
+
- _Hinweis_: Nützlich bei Verwendung mit dem `loadJSON`-Plugin.
|
|
257
|
+
- _Beispiel_: Wenn `true`:
|
|
258
|
+
```json
|
|
259
|
+
{
|
|
260
|
+
"key": "value"
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
Wenn `false`:
|
|
264
|
+
```json
|
|
265
|
+
{
|
|
266
|
+
"key": "value",
|
|
267
|
+
"content": {
|
|
268
|
+
"key": "value"
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
- **saveComponents**:
|
|
274
|
+
- _Typ_: `boolean`
|
|
275
|
+
- _Standard_: `false`
|
|
276
|
+
- _Beschreibung_: Gibt an, ob die Komponenten nach der Transformation gespeichert werden sollen.
|
package/docs/de/configuration.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2024-08-13
|
|
3
|
-
updatedAt: 2026-
|
|
3
|
+
updatedAt: 2026-03-11
|
|
4
4
|
title: Konfiguration
|
|
5
5
|
description: Erfahren Sie, wie Sie Intlayer für Ihre Anwendung konfigurieren. Verstehen Sie die verschiedenen Einstellungen und Optionen, um Intlayer an Ihre Bedürfnisse anzupassen.
|
|
6
6
|
keywords:
|
|
@@ -14,18 +14,24 @@ slugs:
|
|
|
14
14
|
- concept
|
|
15
15
|
- configuration
|
|
16
16
|
history:
|
|
17
|
+
- version: 8.3.0
|
|
18
|
+
data: 2026-03-11
|
|
19
|
+
changes: Verschiebe 'baseDir' von 'content' nach 'system' Konfiguration
|
|
20
|
+
- version: 8.2.0
|
|
21
|
+
date: 2026-03-10
|
|
22
|
+
changes: Compiler-Optionen aktualisieren, Unterstützung für 'output' und 'noMetadata' hinzufügen
|
|
17
23
|
- version: 8.1.7
|
|
18
24
|
date: 2026-02-25
|
|
19
25
|
changes: Compiler-Optionen aktualisieren
|
|
20
26
|
- version: 8.0.6
|
|
21
27
|
date: 2026-02-12
|
|
22
|
-
changes:
|
|
28
|
+
changes: Unterstützung für Open Router, Alibaba, Amazon, Google Vertex Bedrock, Fireworks, Groq, Hugging Face und Together.ai Provider hinzufügen
|
|
23
29
|
- version: 8.0.5
|
|
24
30
|
date: 2026-02-06
|
|
25
31
|
changes: Hinzufügen von `dataSerialization` zur KI-Konfiguration
|
|
26
32
|
- version: 8.0.0
|
|
27
33
|
date: 2026-01-22
|
|
28
|
-
changes:
|
|
34
|
+
changes: Build-Konfiguration für importMode in die Wörterbuch-Konfiguration verschoben.
|
|
29
35
|
- version: 8.0.0
|
|
30
36
|
date: 2026-01-18
|
|
31
37
|
changes: Systemkonfiguration von der Inhaltskonfiguration trennen. Interne Pfade zur Eigenschaft `system` verschieben. `codeDir` hinzufügen, um Inhaltsdateien von der Codetransformation zu trennen.
|
|
@@ -419,7 +425,7 @@ const config: IntlayerConfig = {
|
|
|
419
425
|
*/
|
|
420
426
|
compiler: {
|
|
421
427
|
/**
|
|
422
|
-
*
|
|
428
|
+
* Gibt an, ob der Compiler aktiviert werden soll.
|
|
423
429
|
*/
|
|
424
430
|
enabled: true,
|
|
425
431
|
|
|
@@ -437,18 +443,23 @@ const config: IntlayerConfig = {
|
|
|
437
443
|
excludePattern: ["**/node_modules/**"],
|
|
438
444
|
|
|
439
445
|
/**
|
|
440
|
-
*
|
|
446
|
+
* Ausgabeverzeichnis für die optimierten Wörterbücher.
|
|
441
447
|
*/
|
|
442
|
-
|
|
448
|
+
output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
|
|
443
449
|
|
|
444
450
|
/**
|
|
445
|
-
*
|
|
451
|
+
* Fügen Sie nur den Inhalt in die generierte Datei ein, ohne Schlüssel.
|
|
452
|
+
*/
|
|
453
|
+
noMetadata: false,
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Wörterbuch-Präfix
|
|
446
457
|
*/
|
|
447
458
|
dictionaryKeyPrefix: "", // Remove base prefix
|
|
448
459
|
|
|
449
460
|
/**
|
|
450
|
-
*
|
|
451
|
-
*
|
|
461
|
+
* Gibt an, ob die Komponenten nach der Transformation gespeichert werden sollen.
|
|
462
|
+
* Auf diese Weise kann der Compiler nur einmal ausgeführt werden, um die App zu transformieren, und dann entfernt werden.
|
|
452
463
|
*/
|
|
453
464
|
saveComponents: false,
|
|
454
465
|
},
|
|
@@ -704,7 +715,7 @@ Einstellungen im Zusammenhang mit der Inhaltsverwaltung innerhalb der Anwendung,
|
|
|
704
715
|
#### Eigenschaften
|
|
705
716
|
|
|
706
717
|
- **autoFill**:
|
|
707
|
-
- _Typ_: `boolean | string | { [key in Locales]?: string }`
|
|
718
|
+
- _Typ_: `boolean | string | FilePathPattern | { [key in Locales]?: string }`
|
|
708
719
|
- _Standard_: `undefined`
|
|
709
720
|
- _Beschreibung_: Gibt an, wie der Inhalt automatisch mit KI ausgefüllt werden soll. Kann global in der Datei `intlayer.config.ts` deklariert werden.
|
|
710
721
|
- _Beispiel_: true
|
|
@@ -727,13 +738,6 @@ Einstellungen im Zusammenhang mit der Inhaltsverwaltung innerhalb der Anwendung,
|
|
|
727
738
|
- _Beispiel_: `['.data.ts', '.data.js', '.data.json']`
|
|
728
739
|
- _Hinweis_: Die Anpassung der Dateierweiterungen kann helfen, Konflikte zu vermeiden.
|
|
729
740
|
|
|
730
|
-
- **baseDir**:
|
|
731
|
-
- _Typ_: `string`
|
|
732
|
-
- _Standard_: `process.cwd()`
|
|
733
|
-
- _Beschreibung_: Das Basisverzeichnis für das Projekt.
|
|
734
|
-
- _Beispiel_: `'/path/to/project'`
|
|
735
|
-
- _Hinweis_: Dies wird verwendet, um alle Intlayer-bezogenen Verzeichnisse aufzulösen.
|
|
736
|
-
|
|
737
741
|
- **contentDir**:
|
|
738
742
|
- _Typ_: `string[]`
|
|
739
743
|
- _Standard_: `['.']`
|
|
@@ -772,6 +776,13 @@ Einstellungen im Zusammenhang mit internen Pfaden und Ausgabeergebnissen von Int
|
|
|
772
776
|
|
|
773
777
|
#### Eigenschaften
|
|
774
778
|
|
|
779
|
+
- **baseDir**:
|
|
780
|
+
- _Typ_: `string`
|
|
781
|
+
- _Standard_: `process.cwd()`
|
|
782
|
+
- _Beschreibung_: Das Basisverzeichnis für das Projekt.
|
|
783
|
+
- _Beispiel_: `'/path/to/project'`
|
|
784
|
+
- _Hinweis_: Dies wird verwendet, um alle Intlayer-bezogenen Verzeichnisse aufzulösen.
|
|
785
|
+
|
|
775
786
|
- **dictionariesDir**:
|
|
776
787
|
- _Typ_: `string`
|
|
777
788
|
- _Standard_: `'.intlayer/dictionary'`
|
|
@@ -962,10 +973,10 @@ Build-Optionen gelten für die Plugins `@intlayer/babel` und `@intlayer/swc`.
|
|
|
962
973
|
- _Hinweis_: Kann verwendet werden, um die Erstellung von Wörterbüchern zu deaktivieren, z.B. wenn die Ausführung in einer Node.js-Umgebung vermieden werden sollte.
|
|
963
974
|
|
|
964
975
|
- **checkTypes**:
|
|
965
|
-
-
|
|
966
|
-
-
|
|
967
|
-
-
|
|
968
|
-
-
|
|
976
|
+
- _Typ_: `boolean`
|
|
977
|
+
- _Standard_: `false`
|
|
978
|
+
- _Beschreibung_: Gibt an, ob der Build TypeScript-Typen überprüfen und Fehler protokollieren soll.
|
|
979
|
+
- _Hinweis_: Dies kann den Build-Vorgang verlangsamen.
|
|
969
980
|
|
|
970
981
|
- **optimize**:
|
|
971
982
|
- _Typ_: `boolean`
|
|
@@ -978,7 +989,7 @@ Build-Optionen gelten für die Plugins `@intlayer/babel` und `@intlayer/swc`.
|
|
|
978
989
|
- _Hinweis_: Stellen Sie sicher, dass alle Schlüssel statisch in den `useIntlayer`-Aufrufen deklariert sind, z.B. `useIntlayer('navbar')`.
|
|
979
990
|
|
|
980
991
|
- **importMode**:
|
|
981
|
-
-
|
|
992
|
+
- _Hinweis_: **Deprecated**: Use `dictionary.importMode` instead.
|
|
982
993
|
- _Typ_: `'static' | 'dynamic' | 'fetch'`
|
|
983
994
|
- _Standard_: `'static'`
|
|
984
995
|
- _Beschreibung_: Steuert, wie Wörterbücher importiert werden.
|
|
@@ -1057,3 +1068,31 @@ Einstellungen zur Steuerung des Intlayer-Compilers, der Wörterbücher direkt au
|
|
|
1057
1068
|
- _Typ_: `string`
|
|
1058
1069
|
- _Standard_: `'compiler'`
|
|
1059
1070
|
- _Beschreibung_: Das Verzeichnis, in dem die extrahierten Wörterbücher gespeichert werden, relativ zum Basispfad Ihres Projekts.
|
|
1071
|
+
|
|
1072
|
+
- **output**:
|
|
1073
|
+
- _Typ_: `FilePathPattern`
|
|
1074
|
+
- _Standard_: `({ key }) => 'compiler/${key}.content.json'`
|
|
1075
|
+
- _Beschreibung_: Definiert den Pfad der Ausgabedateien. Ersetzt `outputDir`. Verarbeitet dynamische Variablen wie `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{componentFormat}}`. Kann als String im Format `'my/{{var}}/path'` oder als Funktion festgelegt werden.
|
|
1076
|
+
- _Hinweis_: `./**/*` Pfade werden relativ zur Komponente aufgelöst. `/**/*` Pfade werden relativ zum Intlayer `baseDir` aufgelöst.
|
|
1077
|
+
- _Beispiel_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
|
|
1078
|
+
|
|
1079
|
+
- **noMetadata**:
|
|
1080
|
+
- _Typ_: `boolean`
|
|
1081
|
+
- _Standard_: `false`
|
|
1082
|
+
- _Beschreibung_: Gibt an, ob die Metadaten in der Datei gespeichert werden sollen. Wenn true, speichert der Compiler nicht die Metadaten der Wörterbücher (Schlüssel, Content-Wrapper).
|
|
1083
|
+
- _Hinweis_: Nützlich bei Verwendung mit dem `loadJSON`-Plugin.
|
|
1084
|
+
- _Beispiel_: Wenn `true`:
|
|
1085
|
+
```json
|
|
1086
|
+
{
|
|
1087
|
+
"key": "value"
|
|
1088
|
+
}
|
|
1089
|
+
```
|
|
1090
|
+
Wenn `false`:
|
|
1091
|
+
```json
|
|
1092
|
+
{
|
|
1093
|
+
"key": "value",
|
|
1094
|
+
"content": {
|
|
1095
|
+
"key": "value"
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
```
|
|
@@ -20,6 +20,9 @@ slugs:
|
|
|
20
20
|
applicationTemplate: https://github.com/aymericzip/intlayer-next-no-lolale-path-template
|
|
21
21
|
youtubeVideo: https://www.youtube.com/watch?v=e_PPG7PTqGU
|
|
22
22
|
history:
|
|
23
|
+
- version: 8.2.0
|
|
24
|
+
date: 2026-03-09
|
|
25
|
+
changes: Update compiler options, add FilePathPattern support
|
|
23
26
|
- version: 8.1.6
|
|
24
27
|
date: 2026-02-23
|
|
25
28
|
changes: Erstveröffentlichung
|
|
@@ -135,16 +138,21 @@ const config: IntlayerConfig = {
|
|
|
135
138
|
/**
|
|
136
139
|
* Ausgabeverzeichnis für die optimierten Wörterbücher.
|
|
137
140
|
*/
|
|
138
|
-
|
|
141
|
+
output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
|
|
139
142
|
|
|
140
143
|
/**
|
|
141
|
-
*
|
|
144
|
+
* Fügen Sie nur den Inhalt in die generierte Datei ein, ohne Schlüssel.
|
|
142
145
|
*/
|
|
143
|
-
|
|
146
|
+
noMetadata: false,
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Wörterbuch-Präfix
|
|
150
|
+
*/
|
|
151
|
+
dictionaryKeyPrefix: "", // Remove base prefix
|
|
144
152
|
|
|
145
153
|
/**
|
|
146
154
|
* Gibt an, ob die Komponenten nach der Transformation gespeichert werden sollen.
|
|
147
|
-
* Auf diese Weise kann der Compiler nur einmal ausgeführt werden, um die App zu transformieren, und
|
|
155
|
+
* Auf diese Weise kann der Compiler nur einmal ausgeführt werden, um die App zu transformieren, und dann entfernt werden.
|
|
148
156
|
*/
|
|
149
157
|
saveComponents: false,
|
|
150
158
|
},
|
|
@@ -437,12 +437,33 @@ export const Route = createFileRoute("/{-$locale}/")({
|
|
|
437
437
|
component: RouteComponent,
|
|
438
438
|
head: ({ params }) => {
|
|
439
439
|
const { locale } = params;
|
|
440
|
+
const path = "/"; // The path for this route
|
|
441
|
+
|
|
440
442
|
const metaContent = getIntlayer("app", locale);
|
|
441
443
|
|
|
442
444
|
return {
|
|
445
|
+
links: [
|
|
446
|
+
// Canonical link: Points to the current localized page
|
|
447
|
+
{ rel: "canonical", href: getLocalizedUrl(path, locale) },
|
|
448
|
+
|
|
449
|
+
// Hreflang: Tell Google about all localized versions
|
|
450
|
+
...localeMap(({ locale: mapLocale }) => ({
|
|
451
|
+
rel: "alternate",
|
|
452
|
+
hrefLang: mapLocale,
|
|
453
|
+
href: getLocalizedUrl(path, mapLocale),
|
|
454
|
+
})),
|
|
455
|
+
|
|
456
|
+
// x-default: For users in unmatched languages
|
|
457
|
+
// Define the default fallback locale (usually your primary language)
|
|
458
|
+
{
|
|
459
|
+
rel: "alternate",
|
|
460
|
+
hrefLang: "x-default",
|
|
461
|
+
href: getLocalizedUrl(path, defaultLocale),
|
|
462
|
+
},
|
|
463
|
+
],
|
|
443
464
|
meta: [
|
|
444
465
|
{ title: metaContent.title },
|
|
445
|
-
{ content: metaContent.meta.description
|
|
466
|
+
{ name: "description", content: metaContent.meta.description },
|
|
446
467
|
],
|
|
447
468
|
};
|
|
448
469
|
},
|
|
@@ -19,6 +19,9 @@ slugs:
|
|
|
19
19
|
applicationTemplate: https://github.com/aymericzip/intlayer-vite-react-template
|
|
20
20
|
youtubeVideo: https://www.youtube.com/watch?v=dS9L7uJeak4
|
|
21
21
|
history:
|
|
22
|
+
- version: 8.2.0
|
|
23
|
+
date: 2026-03-09
|
|
24
|
+
changes: Update compiler options, add FilePathPattern support
|
|
22
25
|
- version: 8.1.6
|
|
23
26
|
date: 2026-02-23
|
|
24
27
|
changes: Erstveröffentlichung
|
|
@@ -132,16 +135,21 @@ const config: IntlayerConfig = {
|
|
|
132
135
|
/**
|
|
133
136
|
* Ausgabeverzeichnis für die optimierten Wörterbücher.
|
|
134
137
|
*/
|
|
135
|
-
|
|
138
|
+
output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
|
|
136
139
|
|
|
137
140
|
/**
|
|
138
|
-
*
|
|
141
|
+
* Fügen Sie nur den Inhalt in die generierte Datei ein, ohne Schlüssel.
|
|
139
142
|
*/
|
|
140
|
-
|
|
143
|
+
noMetadata: false,
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Wörterbuch-Präfix
|
|
147
|
+
*/
|
|
148
|
+
dictionaryKeyPrefix: "", // Remove base prefix
|
|
141
149
|
|
|
142
150
|
/**
|
|
143
151
|
* Gibt an, ob die Komponenten nach der Transformation gespeichert werden sollen.
|
|
144
|
-
* Auf diese Weise kann der Compiler nur einmal ausgeführt werden, um die App zu transformieren, und
|
|
152
|
+
* Auf diese Weise kann der Compiler nur einmal ausgeführt werden, um die App zu transformieren, und dann entfernt werden.
|
|
145
153
|
*/
|
|
146
154
|
saveComponents: false,
|
|
147
155
|
},
|
package/docs/en/compiler.md
CHANGED
|
@@ -20,6 +20,9 @@ slugs:
|
|
|
20
20
|
- doc
|
|
21
21
|
- compiler
|
|
22
22
|
history:
|
|
23
|
+
- version: 8.2.0
|
|
24
|
+
date: 2026-03-09
|
|
25
|
+
changes: Update compiler options, add FilePathPattern support
|
|
23
26
|
- version: 8.1.7
|
|
24
27
|
date: 2026-02-25
|
|
25
28
|
changes: Update compiler options
|
|
@@ -37,8 +40,11 @@ The **Intlayer Compiler** is a powerful tool designed to automate the process of
|
|
|
37
40
|
## Why Use the Intlayer Compiler?
|
|
38
41
|
|
|
39
42
|
- **Automation**: Eliminates manual copy-pasting of content into dictionaries.
|
|
43
|
+
|
|
40
44
|
- **Speed**: Optimized content extraction ensuring your build process remains fast.
|
|
45
|
+
|
|
41
46
|
- **Developer Experience**: Keep content declarations right where they are used, improving maintainability.
|
|
47
|
+
|
|
42
48
|
- **Live Updates**: Supports Hot Module Replacement (HMR) for instant feedback during development.
|
|
43
49
|
|
|
44
50
|
See the [Compiler vs. Declarative i18n](https://github.com/aymericzip/intlayer/blob/main/docs/blog/en/compiler_vs_declarative_i18n.md) blog post for a deeper comparison.
|
|
@@ -48,6 +54,7 @@ See the [Compiler vs. Declarative i18n](https://github.com/aymericzip/intlayer/b
|
|
|
48
54
|
While the compiler offers an excellent "just works" experience, it also introduces some trade-offs you should be aware of:
|
|
49
55
|
|
|
50
56
|
- **Heuristic ambiguity**: The compiler must guess what is user-facing content vs. application logic (e.g., `className="active"`, status codes, product IDs). In complex codebases, this can lead to false positives or missed strings that require manual annotations and exceptions.
|
|
57
|
+
|
|
51
58
|
- **Static-only extraction**: Compiler-based extraction relies on static analysis. Strings that only exist at runtime (API error codes, CMS fields, etc.) cannot be discovered or translated by the compiler alone, so you still need a complementary runtime i18n strategy.
|
|
52
59
|
|
|
53
60
|
For a deeper architectural comparison, see the blog post [Compiler vs. Declarative i18n](https://github.com/aymericzip/intlayer/blob/main/docs/blog/en/compiler_vs_declarative_i18n.md).
|
|
@@ -92,7 +99,9 @@ See complete tutorial: [Intlayer Compiler with Vite+React](https://github.com/ay
|
|
|
92
99
|
The Vite plugin automatically detects and handles different file types:
|
|
93
100
|
|
|
94
101
|
- **React / JSX / TSX**: Handled natively.
|
|
102
|
+
|
|
95
103
|
- **Vue**: Requires `@intlayer/vue-compiler`.
|
|
104
|
+
|
|
96
105
|
- **Svelte**: Requires `@intlayer/svelte-compiler`.
|
|
97
106
|
|
|
98
107
|
Make sure to install the appropriate compiler package for your framework:
|
|
@@ -179,7 +188,12 @@ const config: IntlayerConfig = {
|
|
|
179
188
|
/**
|
|
180
189
|
* Output directory for the optimized dictionaries.
|
|
181
190
|
*/
|
|
182
|
-
|
|
191
|
+
output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Inset only content in generated file, without key.
|
|
195
|
+
*/
|
|
196
|
+
noMetadata: false,
|
|
183
197
|
|
|
184
198
|
/**
|
|
185
199
|
* Dictionary key prefix
|
|
@@ -197,6 +211,70 @@ const config: IntlayerConfig = {
|
|
|
197
211
|
export default config;
|
|
198
212
|
```
|
|
199
213
|
|
|
214
|
+
### Compiler Configuration Reference
|
|
215
|
+
|
|
216
|
+
The following properties can be configured in the `compiler` block of your `intlayer.config.ts` file:
|
|
217
|
+
|
|
218
|
+
- **enabled**:
|
|
219
|
+
- _Type_: `boolean | 'build-only'`
|
|
220
|
+
- _Default_: `true`
|
|
221
|
+
- _Description_: Indicates if the compiler should be enabled.
|
|
222
|
+
|
|
223
|
+
- **dictionaryKeyPrefix**:
|
|
224
|
+
- _Type_: `string`
|
|
225
|
+
- _Default_: `'comp-'`
|
|
226
|
+
- _Description_: Prefix for the extracted dictionary keys.
|
|
227
|
+
|
|
228
|
+
- **transformPattern**:
|
|
229
|
+
- _Type_: `string | string[]`
|
|
230
|
+
- _Default_: `['**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}', '!**/node_modules/**']`
|
|
231
|
+
- _Description_: Patterns to traverse the code to optimize.
|
|
232
|
+
|
|
233
|
+
- **excludePattern**:
|
|
234
|
+
- _Type_: `string | string[]`
|
|
235
|
+
- _Default_: `['**/node_modules/**']`
|
|
236
|
+
- _Description_: Patterns to exclude from the optimization.
|
|
237
|
+
|
|
238
|
+
- **outputDir** (Deprecated):
|
|
239
|
+
- _Type_: `string`
|
|
240
|
+
- _Default_: `'compiler'`
|
|
241
|
+
- _Description_: The directory where the extracted dictionaries will be stored.
|
|
242
|
+
|
|
243
|
+
- **output**:
|
|
244
|
+
- _Type_: `FilePathPattern`
|
|
245
|
+
- _Default_: `({ key }) => 'compiler/${key}.content.json'`
|
|
246
|
+
- _Description_: Defines the output files path. Replaces `outputDir`. Handles dynamic variables like `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{componentFormat}}`. Can be set as a string using `'my/{{var}}/path'` format, or as a function.
|
|
247
|
+
- _Note_: `./**/*` Path are resolved relatively to the component. `/**/*` path are resolved relatively to the Intlayer `baseDir`.
|
|
248
|
+
- _Note_: If locale is set in the path, it will generate per-locale dictionaries.
|
|
249
|
+
- _Example_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
|
|
250
|
+
|
|
251
|
+
- **noMetadata**:
|
|
252
|
+
- _Type_: `boolean`
|
|
253
|
+
- _Default_: `false`
|
|
254
|
+
- _Description_: Indicates if the metadata should be saved in the file. If true, the compiler will not save the metadata of the dictionaries (key, content wrapper).
|
|
255
|
+
- _Note_: Useful if used with `loadJSON` plugin.
|
|
256
|
+
- _Example_:
|
|
257
|
+
If `true`:
|
|
258
|
+
```json
|
|
259
|
+
{
|
|
260
|
+
"key": "value"
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
If `false`:
|
|
264
|
+
```json
|
|
265
|
+
{
|
|
266
|
+
"key": "value",
|
|
267
|
+
"content": {
|
|
268
|
+
"key": "value"
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
- **saveComponents**:
|
|
274
|
+
- _Type_: `boolean`
|
|
275
|
+
- _Default_: `false`
|
|
276
|
+
- _Description_: Indicates if the components should be saved after being transformed.
|
|
277
|
+
|
|
200
278
|
### Fill missing translation
|
|
201
279
|
|
|
202
280
|
Intlayer provide a CLI tool to help you fill missing translations. You can use the `intlayer` command to test and fill missing translations from your code.
|