@intlayer/docs 7.0.0-canary.3 → 7.0.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/docs/ar/configuration.md +0 -24
- package/docs/ar/releases/v7.md +0 -1
- package/docs/de/configuration.md +0 -24
- package/docs/de/releases/v7.md +0 -1
- package/docs/en/autoFill.md +3 -1
- package/docs/en/configuration.md +53 -58
- package/docs/en/releases/v7.md +142 -2
- package/docs/en-GB/configuration.md +9 -30
- package/docs/en-GB/releases/v7.md +0 -1
- package/docs/es/configuration.md +0 -24
- package/docs/es/releases/v7.md +0 -1
- package/docs/fr/configuration.md +0 -24
- package/docs/fr/releases/v7.md +0 -1
- package/docs/hi/configuration.md +0 -24
- package/docs/hi/releases/v7.md +0 -1
- package/docs/id/releases/v7.md +0 -1
- package/docs/it/configuration.md +0 -24
- package/docs/it/releases/v7.md +0 -1
- package/docs/ja/configuration.md +0 -24
- package/docs/ja/releases/v7.md +0 -1
- package/docs/ko/configuration.md +0 -24
- package/docs/ko/releases/v7.md +0 -1
- package/docs/pl/releases/v7.md +0 -1
- package/docs/pt/configuration.md +0 -24
- package/docs/pt/releases/v7.md +0 -1
- package/docs/ru/configuration.md +0 -24
- package/docs/ru/releases/v7.md +0 -1
- package/docs/tr/configuration.md +0 -24
- package/docs/tr/releases/v7.md +0 -1
- package/docs/vi/releases/v7.md +0 -1
- package/docs/zh/configuration.md +0 -24
- package/docs/zh/releases/v7.md +0 -1
- package/package.json +14 -14
package/docs/ar/configuration.md
CHANGED
|
@@ -332,30 +332,6 @@ module.exports = config;
|
|
|
332
332
|
- إذا كانت `noPrefix = false`: سيكون عنوان URL هو `https://example.com/my-app/en`
|
|
333
333
|
- إذا كانت `noPrefix = true`: سيكون عنوان URL هو `https://example.com`
|
|
334
334
|
|
|
335
|
-
- **detectLocaleOnPrefetchNoPrefix**:
|
|
336
|
-
- _النوع_: `boolean`
|
|
337
|
-
- _الافتراضي_: `false`
|
|
338
|
-
- _الوصف_: يتحكم فيما إذا كان يتم اكتشاف اللغة أثناء طلبات التحميل المسبق في Next.js.
|
|
339
|
-
- _مثال_: `true`
|
|
340
|
-
- _ملاحظة_: تؤثر هذه الإعدادات على كيفية تعامل Next.js مع التحميل المسبق للغة:
|
|
341
|
-
- **سيناريو المثال:**
|
|
342
|
-
- لغة متصفح المستخدم هي `'fr'`
|
|
343
|
-
- الصفحة الحالية هي `/fr/about`
|
|
344
|
-
- الرابط يقوم بالتحميل المسبق لـ `/about`
|
|
345
|
-
- **مع `detectLocaleOnPrefetchNoPrefix: true`:**
|
|
346
|
-
- يكتشف التحميل المسبق لغة `'fr'` من المتصفح
|
|
347
|
-
- يعيد توجيه التحميل المسبق إلى `/fr/about`
|
|
348
|
-
- **مع `detectLocaleOnPrefetchNoPrefix: false` (الافتراضي):**
|
|
349
|
-
- يستخدم التحميل المسبق اللغة الافتراضية
|
|
350
|
-
- يعيد توجيه التحميل المسبق إلى `/en/about` (بافتراض أن `'en'` هي اللغة الافتراضية)
|
|
351
|
-
- **متى تستخدم القيمة `true`:**
|
|
352
|
-
- تطبيقك يستخدم روابط داخلية غير مخصصة للغة (مثل `<a href="/about">`)
|
|
353
|
-
- تريد سلوك اكتشاف اللغة متسق بين الطلبات العادية وطلبات التحميل المسبق
|
|
354
|
-
- **متى تستخدم القيمة `false` (الافتراضي):**
|
|
355
|
-
- تطبيقك يستخدم روابط مخصصة للغة (مثل `<a href="/fr/about">`)
|
|
356
|
-
- تريد تحسين أداء التحميل المسبق
|
|
357
|
-
- تريد تجنب حلقات إعادة التوجيه المحتملة
|
|
358
|
-
|
|
359
335
|
---
|
|
360
336
|
|
|
361
337
|
### تكوين المحتوى
|
package/docs/ar/releases/v7.md
CHANGED
package/docs/de/configuration.md
CHANGED
|
@@ -333,30 +333,6 @@ Einstellungen, die das Verhalten der Middleware steuern, einschließlich wie die
|
|
|
333
333
|
- Wenn `noPrefix = false`: URL wird `https://example.com/my-app/en` sein
|
|
334
334
|
- Wenn `noPrefix = true`: URL wird `https://example.com` sein
|
|
335
335
|
|
|
336
|
-
- **detectLocaleOnPrefetchNoPrefix**:
|
|
337
|
-
- _Typ_: `boolean`
|
|
338
|
-
- _Standard_: `false`
|
|
339
|
-
- _Beschreibung_: Steuert, ob die Lokalisierungserkennung während Next.js Prefetch-Anfragen erfolgt.
|
|
340
|
-
- _Beispiel_: `true`
|
|
341
|
-
- _Hinweis_: Diese Einstellung beeinflusst, wie Next.js das Prefetching von Lokalisierungen handhabt:
|
|
342
|
-
- **Beispielszenario:**
|
|
343
|
-
- Die Browsersprache des Benutzers ist `'fr'`
|
|
344
|
-
- Aktuelle Seite ist `/fr/about`
|
|
345
|
-
- Link prefetcht `/about`
|
|
346
|
-
- **Mit `detectLocaleOnPrefetchNoPrefix: true`:**
|
|
347
|
-
- Prefetch erkennt die `'fr'`-Lokalisierung aus dem Browser
|
|
348
|
-
- Prefetch wird zu `/fr/about` umgeleitet
|
|
349
|
-
- **Mit `detectLocaleOnPrefetchNoPrefix: false` (Standard):**
|
|
350
|
-
- Prefetch verwendet die Standard-Lokalisierung
|
|
351
|
-
- Prefetch wird zu `/en/about` umgeleitet (angenommen `'en'` ist Standard)
|
|
352
|
-
- **Wann `true` verwendet werden sollte:**
|
|
353
|
-
- Ihre Anwendung verwendet nicht lokalisierte interne Links (z. B. `<a href="/about">`)
|
|
354
|
-
- Sie möchten ein konsistentes Verhalten bei der Lokalerkennung zwischen regulären und Prefetch-Anfragen
|
|
355
|
-
- **Wann `false` (Standard) verwenden:**
|
|
356
|
-
- Ihre Anwendung verwendet lokalisierte Links mit Präfix (z. B. `<a href="/fr/about">`)
|
|
357
|
-
- Sie möchten die Prefetch-Leistung optimieren
|
|
358
|
-
- Sie möchten potenzielle Redirect-Schleifen vermeiden
|
|
359
|
-
|
|
360
336
|
---
|
|
361
337
|
|
|
362
338
|
### Inhaltskonfiguration
|
package/docs/de/releases/v7.md
CHANGED
package/docs/en/autoFill.md
CHANGED
|
@@ -67,6 +67,8 @@ const config: IntlayerConfig = {
|
|
|
67
67
|
defaultLocale: Locales.ENGLISH,
|
|
68
68
|
requiredLocales: [Locales.ENGLISH], // Recommended to avoid Property 'pl' is missing in type '{ en: string; xxx } on your t function if
|
|
69
69
|
},
|
|
70
|
+
},
|
|
71
|
+
dictionary: {
|
|
70
72
|
fill: {
|
|
71
73
|
en: true, // Fill and edit the current file for English
|
|
72
74
|
fr: "./translations/fr.json", // Create separate file for French
|
|
@@ -133,7 +135,7 @@ const config: IntlayerConfig = {
|
|
|
133
135
|
defaultLocale: Locales.ENGLISH,
|
|
134
136
|
requiredLocales: [Locales.ENGLISH, Locales.FRENCH],
|
|
135
137
|
},
|
|
136
|
-
|
|
138
|
+
dictionary: {
|
|
137
139
|
// Auto-generate missing translations for all dictionaries
|
|
138
140
|
fill: "./{{fileName}}Filled.content.ts",
|
|
139
141
|
//
|
package/docs/en/configuration.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2024-08-13
|
|
3
|
-
updatedAt: 2025-10-
|
|
3
|
+
updatedAt: 2025-10-25
|
|
4
4
|
title: Configuration
|
|
5
5
|
description: Learn how to configure Intlayer for your application. Understand the various settings and options available to customize Intlayer to your needs.
|
|
6
6
|
keywords:
|
|
@@ -14,6 +14,9 @@ slugs:
|
|
|
14
14
|
- concept
|
|
15
15
|
- configuration
|
|
16
16
|
history:
|
|
17
|
+
- version: 7.0.0
|
|
18
|
+
date: 2025-10-25
|
|
19
|
+
changes: Add `dictionary` configuration
|
|
17
20
|
- version: 7.0.0
|
|
18
21
|
date: 2025-10-21
|
|
19
22
|
changes: Replace `middleware` by `routing` configuration
|
|
@@ -77,11 +80,14 @@ const config: IntlayerConfig = {
|
|
|
77
80
|
locales: [Locales.ENGLISH],
|
|
78
81
|
},
|
|
79
82
|
content: {
|
|
80
|
-
autoFill: "./{{fileName}}.content.json",
|
|
81
83
|
contentDir: ["src", "../ui-library"],
|
|
82
84
|
},
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
dictionary: {
|
|
86
|
+
fill: "./{{fileName}}.content.json",
|
|
87
|
+
},
|
|
88
|
+
routing: {
|
|
89
|
+
mode: "prefix-no-default",
|
|
90
|
+
storage: "cookie",
|
|
85
91
|
},
|
|
86
92
|
editor: {
|
|
87
93
|
applicationURL: "https://example.com",
|
|
@@ -109,8 +115,9 @@ const config = {
|
|
|
109
115
|
content: {
|
|
110
116
|
contentDir: ["src", "../ui-library"],
|
|
111
117
|
},
|
|
112
|
-
|
|
113
|
-
|
|
118
|
+
routing: {
|
|
119
|
+
mode: "prefix-no-default",
|
|
120
|
+
storage: "cookie",
|
|
114
121
|
},
|
|
115
122
|
editor: {
|
|
116
123
|
applicationURL: "https://example.com",
|
|
@@ -135,8 +142,12 @@ module.exports = config;
|
|
|
135
142
|
"content": {
|
|
136
143
|
"contentDir": ["src", "../ui-library"],
|
|
137
144
|
},
|
|
138
|
-
"
|
|
139
|
-
"
|
|
145
|
+
"dictionary": {
|
|
146
|
+
"fill": "./{{fileName}}.content.json",
|
|
147
|
+
},
|
|
148
|
+
"routing": {
|
|
149
|
+
"mode": "prefix-no-default",
|
|
150
|
+
"storage": "cookie",
|
|
140
151
|
},
|
|
141
152
|
"editor": {
|
|
142
153
|
"applicationURL": "https://example.com",
|
|
@@ -287,15 +298,6 @@ Defines settings related to the integrated editor, including server port and act
|
|
|
287
298
|
- _Example_: `'https://example.com'`
|
|
288
299
|
- _Note_: Point to localhost by default but can be changed to any URL in the case of a remote live sync server.
|
|
289
300
|
|
|
290
|
-
- **formatCommand**:
|
|
291
|
-
- _Type_: `string`
|
|
292
|
-
- _Default_: `undefined`
|
|
293
|
-
- _Description_: The command to format the content. When intlayer write your .content files locally, this command will be used to format the content.
|
|
294
|
-
- _Example_: `'npx prettier --write "{{file}}" --log-level silent'` Using Prettier
|
|
295
|
-
- _Example_: `'npx biome format "{{file}}" --write --log-level none'` Using Biome
|
|
296
|
-
- _Example_: `'npx eslint --fix "{{file}}" --quiet'` Using ESLint
|
|
297
|
-
- _Note_: Intlayer will replace the {{file}} with the path of the file to format.
|
|
298
|
-
|
|
299
301
|
### Routing Configuration
|
|
300
302
|
|
|
301
303
|
Settings that control routing behavior, including URL structure, locale storage, and middleware handling.
|
|
@@ -371,30 +373,6 @@ Settings that control routing behavior, including URL structure, locale storage,
|
|
|
371
373
|
- The URL will be `https://example.com/my-app/en`
|
|
372
374
|
- If the base path is not set, the URL will be `https://example.com/en`
|
|
373
375
|
|
|
374
|
-
- **detectLocaleOnPrefetchNoPrefix**:
|
|
375
|
-
- _Type_: `boolean`
|
|
376
|
-
- _Default_: `false`
|
|
377
|
-
- _Description_: Controls whether locale detection occurs during Next.js prefetch requests.
|
|
378
|
-
- _Example_: `true`
|
|
379
|
-
- _Note_: This setting affects how Next.js handles locale prefetching:
|
|
380
|
-
- **Example scenario:**
|
|
381
|
-
- User's browser language is `'fr'`
|
|
382
|
-
- Current page is `/fr/about`
|
|
383
|
-
- Link prefetches `/about`
|
|
384
|
-
- **With `detectLocaleOnPrefetchNoPrefix: true`:**
|
|
385
|
-
- Prefetch detects `'fr'` locale from browser
|
|
386
|
-
- Redirects prefetch to `/fr/about`
|
|
387
|
-
- **With `detectLocaleOnPrefetchNoPrefix: false` (default):**
|
|
388
|
-
- Prefetch uses default locale
|
|
389
|
-
- Redirects prefetch to `/en/about` (assuming `'en'` is default)
|
|
390
|
-
- **When to use `true`:**
|
|
391
|
-
- Your app uses non-localized internal links (e.g. `<a href="/about">`)
|
|
392
|
-
- You want consistent locale detection behavior between regular and prefetch requests
|
|
393
|
-
- **When to use `false` (default):**
|
|
394
|
-
- Your app uses locale-prefixed links (e.g. `<a href="/fr/about">`)
|
|
395
|
-
- You want to optimize prefetching performance
|
|
396
|
-
- You want to avoid potential redirect loops
|
|
397
|
-
|
|
398
376
|
#### Cookie Attributes
|
|
399
377
|
|
|
400
378
|
When using cookie storage, you can configure additional cookie attributes:
|
|
@@ -432,7 +410,6 @@ export default defineConfig({
|
|
|
432
410
|
storage: "localStorage",
|
|
433
411
|
headerName: "x-intlayer-locale",
|
|
434
412
|
basePath: "",
|
|
435
|
-
detectLocaleOnPrefetchNoPrefix: false,
|
|
436
413
|
},
|
|
437
414
|
});
|
|
438
415
|
```
|
|
@@ -463,7 +440,6 @@ export default defineConfig({
|
|
|
463
440
|
],
|
|
464
441
|
headerName: "x-intlayer-locale",
|
|
465
442
|
basePath: "",
|
|
466
|
-
detectLocaleOnPrefetchNoPrefix: false,
|
|
467
443
|
},
|
|
468
444
|
});
|
|
469
445
|
```
|
|
@@ -482,7 +458,6 @@ export default defineConfig({
|
|
|
482
458
|
storage: "localStorage",
|
|
483
459
|
headerName: "x-intlayer-locale",
|
|
484
460
|
basePath: "",
|
|
485
|
-
detectLocaleOnPrefetchNoPrefix: false,
|
|
486
461
|
},
|
|
487
462
|
});
|
|
488
463
|
```
|
|
@@ -504,7 +479,6 @@ export default defineConfig({
|
|
|
504
479
|
},
|
|
505
480
|
headerName: "x-custom-locale",
|
|
506
481
|
basePath: "/my-app",
|
|
507
|
-
detectLocaleOnPrefetchNoPrefix: true,
|
|
508
482
|
},
|
|
509
483
|
});
|
|
510
484
|
```
|
|
@@ -517,19 +491,6 @@ Settings related to content handling within the application, including directory
|
|
|
517
491
|
|
|
518
492
|
#### Properties
|
|
519
493
|
|
|
520
|
-
- **fill**:
|
|
521
|
-
- _Type_: `boolean | string | { [key in Locales]?: string }`
|
|
522
|
-
- _Default_: `undefined`
|
|
523
|
-
- _Description_: Indicate how the content should be automatically filled using AI. Can be declared globally in the `intlayer.config.ts` file.
|
|
524
|
-
- _Example_: true
|
|
525
|
-
- _Example_: `'./{{fileName}}.content.json'`
|
|
526
|
-
- _Example_: `{ fr: './{{fileName}}.fr.content.json', es: './{{fileName}}.es.content.json' }`
|
|
527
|
-
- _Note_: The auto fill configuration. It can be:
|
|
528
|
-
- `true`: Rewrites the current file with filled content for all locales
|
|
529
|
-
- `false`: Disables auto-fill completely
|
|
530
|
-
- `string`: Path to a single file or template with variables (fills the specified file without modifying the current one)
|
|
531
|
-
- `object`: Per-locale file paths
|
|
532
|
-
|
|
533
494
|
- **watch**:
|
|
534
495
|
- _Type_: `boolean`
|
|
535
496
|
- _Default_: `process.env.NODE_ENV === 'development'`
|
|
@@ -597,6 +558,40 @@ Settings related to content handling within the application, including directory
|
|
|
597
558
|
- _Description_: Directories excluded from content search.
|
|
598
559
|
- _Note_: This setting is not yet used, but planned for future implementation.
|
|
599
560
|
|
|
561
|
+
- **formatCommand**:
|
|
562
|
+
- _Type_: `string`
|
|
563
|
+
- _Default_: `undefined`
|
|
564
|
+
- _Description_: The command to format the content. When intlayer write your .content files locally, this command will be used to format the content.
|
|
565
|
+
- _Example_: `'npx prettier --write "{{file}}" --log-level silent'` Using Prettier
|
|
566
|
+
- _Example_: `'npx biome format "{{file}}" --write --log-level none'` Using Biome
|
|
567
|
+
- _Example_: `'npx eslint --fix "{{file}}" --quiet'` Using ESLint
|
|
568
|
+
- _Note_: Intlayer will replace the {{file}} with the path of the file to format.
|
|
569
|
+
- _Note_: If not set, Intlayer will try to detect the format command automatically. By trying to resolve the following commands: prettier, biome, eslint.
|
|
570
|
+
|
|
571
|
+
### Dictionary Configuration
|
|
572
|
+
|
|
573
|
+
Settings that control dictionary operations, including auto-fill behavior and content generation.
|
|
574
|
+
|
|
575
|
+
This dictionary configuration serves two main purposes:
|
|
576
|
+
|
|
577
|
+
1. **Default Values**: Define default values when creating content declaration files
|
|
578
|
+
2. **Fallback Behavior**: Provide fallback values when specific fields are not defined, allowing you to define dictionary operation behavior globally
|
|
579
|
+
|
|
580
|
+
For more information about content declaration files and how configuration values are applied, see the [Content File Documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md).
|
|
581
|
+
|
|
582
|
+
#### Properties
|
|
583
|
+
|
|
584
|
+
- **fill**
|
|
585
|
+
- **description**
|
|
586
|
+
- **locale**
|
|
587
|
+
- **priority**
|
|
588
|
+
- **live**
|
|
589
|
+
- **title**
|
|
590
|
+
- **tags**
|
|
591
|
+
- **version**
|
|
592
|
+
|
|
593
|
+
---
|
|
594
|
+
|
|
600
595
|
### Logger Configuration
|
|
601
596
|
|
|
602
597
|
Settings that control the logger, including the prefix to use.
|
package/docs/en/releases/v7.md
CHANGED
|
@@ -26,6 +26,7 @@ Welcome to Intlayer v7! This major release introduces significant improvements i
|
|
|
26
26
|
|
|
27
27
|
## Highlights
|
|
28
28
|
|
|
29
|
+
- Next.js 16 support
|
|
29
30
|
- Caching strategy for faster builds
|
|
30
31
|
- Improved TypeScript type generation with locale-specific types
|
|
31
32
|
- Bundle optimization: Locales as strings instead of enum
|
|
@@ -35,10 +36,12 @@ Welcome to Intlayer v7! This major release introduces significant improvements i
|
|
|
35
36
|
- 30% smaller Visual Editor package size
|
|
36
37
|
- Enhanced middleware configuration options
|
|
37
38
|
- Updated fill command behavior for better content management
|
|
39
|
+
- New dictionary configuration section for better organization
|
|
38
40
|
- Enhanced stability with complete content declaration file updates
|
|
39
41
|
- Intelligent retry management for translation accuracy
|
|
40
42
|
- Parallelization for faster translation processing
|
|
41
43
|
- Smart chunking to handle large files within AI context limits
|
|
44
|
+
- Automatic code formatting with configurable formatCommand
|
|
42
45
|
|
|
43
46
|
---
|
|
44
47
|
|
|
@@ -247,6 +250,127 @@ This results in faster download times and improved runtime performance for your
|
|
|
247
250
|
|
|
248
251
|
---
|
|
249
252
|
|
|
253
|
+
## Automatic Code Formatting: formatCommand configuration
|
|
254
|
+
|
|
255
|
+
v7 introduces the `formatCommand` option in the editor configuration, allowing you to automatically format content files when they are written by Intlayer. This ensures consistent code style and formatting across your content declaration files.
|
|
256
|
+
|
|
257
|
+
If not set, Intlayer will try to detect the format command automatically. By trying to resolve the following commands: prettier, biome, eslint.
|
|
258
|
+
|
|
259
|
+
### Configuration
|
|
260
|
+
|
|
261
|
+
The `formatCommand` option accepts a string template where `{{file}}` will be replaced with the actual file path:
|
|
262
|
+
|
|
263
|
+
```typescript
|
|
264
|
+
// intlayer.config.ts
|
|
265
|
+
export default {
|
|
266
|
+
content: {
|
|
267
|
+
formatCommand: 'bun x biome format "{{file}}" --write --log-level none',
|
|
268
|
+
},
|
|
269
|
+
};
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### Supported formatters
|
|
273
|
+
|
|
274
|
+
You can use any code formatter that accepts file paths as arguments:
|
|
275
|
+
|
|
276
|
+
**Using Biome:**
|
|
277
|
+
|
|
278
|
+
```typescript
|
|
279
|
+
formatCommand: 'bun x biome format "{{file}}" --write --log-level none';
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
**Using Prettier:**
|
|
283
|
+
|
|
284
|
+
```typescript
|
|
285
|
+
formatCommand: 'npx prettier --write "{{file}}" --log-level silent';
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
**Using ESLint:**
|
|
289
|
+
|
|
290
|
+
```typescript
|
|
291
|
+
formatCommand: 'npx eslint --fix "{{file}}" --quiet';
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
**Using Bun's built-in formatter:**
|
|
295
|
+
|
|
296
|
+
```typescript
|
|
297
|
+
formatCommand: 'bun format "{{file}}"';
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### Benefits
|
|
301
|
+
|
|
302
|
+
- **Consistent formatting**: All content files are automatically formatted according to your project's style guidelines
|
|
303
|
+
- **Developer experience**: No need to manually format files after Intlayer writes them
|
|
304
|
+
- **Team consistency**: Ensures all team members have the same formatting applied to content files
|
|
305
|
+
- **CI/CD integration**: Content files maintain consistent formatting in automated workflows
|
|
306
|
+
|
|
307
|
+
### How it works
|
|
308
|
+
|
|
309
|
+
When Intlayer writes or updates a content declaration file (`.content.ts`, `.content.js`, etc.), it automatically runs the specified format command on the file. The `{{file}}` placeholder is replaced with the actual file path, and the command is executed in the project's base directory.
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## Dictionary Configuration: Better organization and structure
|
|
314
|
+
|
|
315
|
+
v7 introduces a new dedicated `dictionary` configuration section that provides better organization for dictionary-related settings and improved content management.
|
|
316
|
+
|
|
317
|
+
### New dictionary configuration structure
|
|
318
|
+
|
|
319
|
+
The `fill` property has been moved from the `content` section to a new `dictionary` section, providing clearer separation of concerns:
|
|
320
|
+
|
|
321
|
+
**v6 configuration:**
|
|
322
|
+
|
|
323
|
+
```typescript
|
|
324
|
+
export default {
|
|
325
|
+
content: {
|
|
326
|
+
autoFill: "./{{fileName}}.content.json",
|
|
327
|
+
contentDir: ["src"],
|
|
328
|
+
},
|
|
329
|
+
};
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
**v7 configuration:**
|
|
333
|
+
|
|
334
|
+
```typescript
|
|
335
|
+
export default {
|
|
336
|
+
content: {
|
|
337
|
+
contentDir: ["src"],
|
|
338
|
+
},
|
|
339
|
+
dictionary: {
|
|
340
|
+
fill: "./{{fileName}}.content.json",
|
|
341
|
+
},
|
|
342
|
+
};
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
### Benefits of the new structure
|
|
346
|
+
|
|
347
|
+
- **Clearer organization**: Dictionary-specific settings are now grouped together
|
|
348
|
+
- **Better separation of concerns**: Content discovery vs. dictionary operations are clearly separated
|
|
349
|
+
- **Enhanced maintainability**: Easier to understand and modify dictionary-related configurations
|
|
350
|
+
- **Future extensibility**: The dictionary section can accommodate additional dictionary-specific settings
|
|
351
|
+
- **Comprehensive dictionary management**: Includes properties like `title`, `live`, `priority`, `tags`, `version`, and `description` for creating and managing new dictionaries
|
|
352
|
+
|
|
353
|
+
### Configuration usage
|
|
354
|
+
|
|
355
|
+
The dictionary configuration serves two main purposes:
|
|
356
|
+
|
|
357
|
+
1. **Default Values**: Define default values when creating content declaration files
|
|
358
|
+
2. **Fallback Behavior**: Provide fallback values when specific fields are not defined, allowing you to define dictionary operation behavior globally
|
|
359
|
+
|
|
360
|
+
The dictionary section includes comprehensive properties for dictionary management:
|
|
361
|
+
|
|
362
|
+
- **`fill`**: Auto-fill behavior for content generation
|
|
363
|
+
- **`title`**: Default title for new dictionaries
|
|
364
|
+
- **`live`**: Live sync configuration for real-time updates
|
|
365
|
+
- **`priority`**: Priority settings for dictionary resolution
|
|
366
|
+
- **`tags`**: Default tags for content organization
|
|
367
|
+
- **`version`**: Version management for dictionary updates
|
|
368
|
+
- **`description`**: Default description for new content
|
|
369
|
+
|
|
370
|
+
For more information about content declaration files and how configuration values are applied, see the [Content File Documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md).
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
|
|
250
374
|
## Fill command: Updated behavior for better content management
|
|
251
375
|
|
|
252
376
|
v7 introduces improved behavior for the `fill` command, providing more predictable and flexible content management:
|
|
@@ -394,13 +518,17 @@ The system automatically:
|
|
|
394
518
|
- **`middleware.prefixDefault`**: Replaced by `routing.mode`
|
|
395
519
|
- **`middleware.noPrefix`**: Replaced by `routing.mode`
|
|
396
520
|
|
|
521
|
+
### New configurations
|
|
522
|
+
|
|
523
|
+
- **`editor.formatCommand`**: New option for automatic code formatting of content files
|
|
524
|
+
|
|
397
525
|
### Migration mapping
|
|
398
526
|
|
|
399
527
|
#### Configuration mapping
|
|
400
528
|
|
|
401
529
|
| v6 Configuration | v7 Configuration |
|
|
402
530
|
| -------------------------- | ---------------------------------------------------- |
|
|
403
|
-
| `autoFill: xxx`
|
|
531
|
+
| `content.autoFill: xxx` | `dictionary.fill: xxx` |
|
|
404
532
|
| `prefixDefault: false` | `mode: 'prefix-no-default'` |
|
|
405
533
|
| `prefixDefault: true` | `mode: 'prefix-all'` |
|
|
406
534
|
| `noPrefix: true` | `mode: 'no-prefix'` |
|
|
@@ -413,6 +541,10 @@ The system automatically:
|
|
|
413
541
|
|
|
414
542
|
```typescript
|
|
415
543
|
export default {
|
|
544
|
+
content: {
|
|
545
|
+
autoFill: "./{{fileName}}.content.json",
|
|
546
|
+
contentDir: ["src"],
|
|
547
|
+
},
|
|
416
548
|
middleware: {
|
|
417
549
|
headerName: "x-intlayer-locale",
|
|
418
550
|
cookieName: "intlayer-locale",
|
|
@@ -428,12 +560,20 @@ export default {
|
|
|
428
560
|
|
|
429
561
|
```typescript
|
|
430
562
|
export default {
|
|
563
|
+
content: {
|
|
564
|
+
contentDir: ["src"],
|
|
565
|
+
},
|
|
566
|
+
dictionary: {
|
|
567
|
+
fill: "./{{fileName}}.content.json",
|
|
568
|
+
},
|
|
431
569
|
routing: {
|
|
432
570
|
mode: "prefix-no-default",
|
|
433
571
|
storage: "localStorage", // or 'cookie' if you need cookie storage
|
|
434
572
|
headerName: "x-intlayer-locale",
|
|
435
573
|
basePath: "",
|
|
436
|
-
|
|
574
|
+
},
|
|
575
|
+
editor: {
|
|
576
|
+
formatCommand: 'bun x biome format "{{file}}" --write --log-level none', // Optional: automatic formatting
|
|
437
577
|
},
|
|
438
578
|
};
|
|
439
579
|
```
|
|
@@ -65,8 +65,9 @@ const config: IntlayerConfig = {
|
|
|
65
65
|
autoFill: "./{{fileName}}.content.json",
|
|
66
66
|
contentDir: ["src", "../ui-library"],
|
|
67
67
|
},
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
routing: {
|
|
69
|
+
mode: "prefix-no-default",
|
|
70
|
+
storage: "cookie",
|
|
70
71
|
},
|
|
71
72
|
editor: {
|
|
72
73
|
applicationURL: "https://example.com",
|
|
@@ -95,8 +96,9 @@ const config = {
|
|
|
95
96
|
content: {
|
|
96
97
|
contentDir: ["src", "../ui-library"],
|
|
97
98
|
},
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
routing: {
|
|
100
|
+
mode: "prefix-no-default",
|
|
101
|
+
storage: "cookie",
|
|
100
102
|
},
|
|
101
103
|
editor: {
|
|
102
104
|
applicationURL: "https://example.com",
|
|
@@ -121,8 +123,9 @@ module.exports = config;
|
|
|
121
123
|
"content": {
|
|
122
124
|
"contentDir": ["src", "../ui-library"],
|
|
123
125
|
},
|
|
124
|
-
"
|
|
125
|
-
"
|
|
126
|
+
"routing": {
|
|
127
|
+
"mode": "prefix-no-default",
|
|
128
|
+
"storage": "cookie",
|
|
126
129
|
},
|
|
127
130
|
"editor": {
|
|
128
131
|
"applicationURL": "https://example.com",
|
|
@@ -333,30 +336,6 @@ Settings that control middleware behaviour, including how the application handle
|
|
|
333
336
|
- If `noPrefix = false`: URL will be `https://example.com/my-app/en`
|
|
334
337
|
- If `noPrefix = true`: URL will be `https://example.com`
|
|
335
338
|
|
|
336
|
-
- **detectLocaleOnPrefetchNoPrefix**:
|
|
337
|
-
- _Type_: `boolean`
|
|
338
|
-
- _Default_: `false`
|
|
339
|
-
- _Description_: Controls whether locale detection occurs during Next.js prefetch requests.
|
|
340
|
-
- _Example_: `true`
|
|
341
|
-
- _Note_: This setting affects how Next.js handles locale prefetching:
|
|
342
|
-
- **Example scenario:**
|
|
343
|
-
- User's browser language is `'fr'`
|
|
344
|
-
- Current page is `/fr/about`
|
|
345
|
-
- Link prefetches `/about`
|
|
346
|
-
- **With `detectLocaleOnPrefetchNoPrefix: true`:**
|
|
347
|
-
- Prefetch detects `'fr'` locale from browser
|
|
348
|
-
- Redirects prefetch to `/fr/about`
|
|
349
|
-
- **With `detectLocaleOnPrefetchNoPrefix: false` (default):**
|
|
350
|
-
- Prefetch uses default locale
|
|
351
|
-
- Redirects prefetch to `/en/about` (assuming `'en'` is default)
|
|
352
|
-
- **When to use `true`:**
|
|
353
|
-
- Your app uses non-localised internal links (e.g. `<a href="/about">`)
|
|
354
|
-
- You want consistent locale detection behaviour between regular and prefetch requests
|
|
355
|
-
- **When to use `false` (default):**
|
|
356
|
-
- Your app uses locale-prefixed links (e.g. `<a href="/fr/about">`)
|
|
357
|
-
- You want to optimise prefetching performance
|
|
358
|
-
- You want to avoid potential redirect loops
|
|
359
|
-
|
|
360
339
|
---
|
|
361
340
|
|
|
362
341
|
### Content Configuration
|
package/docs/es/configuration.md
CHANGED
|
@@ -332,30 +332,6 @@ Configuraciones que controlan el comportamiento del middleware, incluyendo cómo
|
|
|
332
332
|
- Si `noPrefix = false`: La URL será `https://example.com/my-app/en`
|
|
333
333
|
- Si `noPrefix = true`: La URL será `https://example.com`
|
|
334
334
|
|
|
335
|
-
- **detectLocaleOnPrefetchNoPrefix**:
|
|
336
|
-
- _Tipo_: `boolean`
|
|
337
|
-
- _Por defecto_: `false`
|
|
338
|
-
- _Descripción_: Controla si la detección de la configuración regional ocurre durante las solicitudes de prefetch de Next.js.
|
|
339
|
-
- _Ejemplo_: `true`
|
|
340
|
-
- _Nota_: Esta configuración afecta cómo Next.js maneja el prefetch de locales:
|
|
341
|
-
- **Escenario de ejemplo:**
|
|
342
|
-
- El idioma del navegador del usuario es `'fr'`
|
|
343
|
-
- La página actual es `/fr/about`
|
|
344
|
-
- El enlace hace prefetch de `/about`
|
|
345
|
-
- **Con `detectLocaleOnPrefetchNoPrefix: true`:**
|
|
346
|
-
- El prefetch detecta la configuración regional `'fr'` desde el navegador
|
|
347
|
-
- Redirige el prefetch a `/fr/about`
|
|
348
|
-
- **Con `detectLocaleOnPrefetchNoPrefix: false` (por defecto):**
|
|
349
|
-
- El prefetch usa la configuración regional por defecto
|
|
350
|
-
- Redirige el prefetch a `/en/about` (asumiendo que `'en'` es la predeterminada)
|
|
351
|
-
- **Cuándo usar `true`:**
|
|
352
|
-
- Su aplicación utiliza enlaces internos no localizados (por ejemplo, `<a href="/about">`)
|
|
353
|
-
- Desea un comportamiento consistente en la detección de la configuración regional entre solicitudes regulares y de prefetch
|
|
354
|
-
- **Cuándo usar `false` (por defecto):**
|
|
355
|
-
- Su aplicación utiliza enlaces con prefijo de configuración regional (por ejemplo, `<a href="/fr/about">`)
|
|
356
|
-
- Desea optimizar el rendimiento del prefetch
|
|
357
|
-
- Desea evitar posibles bucles de redireccionamiento
|
|
358
|
-
|
|
359
335
|
---
|
|
360
336
|
|
|
361
337
|
### Configuración de Contenido
|
package/docs/es/releases/v7.md
CHANGED
package/docs/fr/configuration.md
CHANGED
|
@@ -336,30 +336,6 @@ Paramètres qui contrôlent le comportement du middleware, y compris la gestion
|
|
|
336
336
|
- Si `noPrefix = false` : l'URL sera `https://example.com/my-app/en`
|
|
337
337
|
- Si `noPrefix = true` : l'URL sera `https://example.com`
|
|
338
338
|
|
|
339
|
-
- **detectLocaleOnPrefetchNoPrefix** :
|
|
340
|
-
- _Type_ : `boolean`
|
|
341
|
-
- _Par défaut_ : `false`
|
|
342
|
-
- _Description_ : Contrôle si la détection de la locale se produit lors des requêtes de préchargement (prefetch) de Next.js.
|
|
343
|
-
- _Exemple_ : `true`
|
|
344
|
-
- _Note_ : Ce paramètre influence la manière dont Next.js gère le préchargement des locales :
|
|
345
|
-
- **Scénario d'exemple :**
|
|
346
|
-
- La langue du navigateur de l'utilisateur est `'fr'`
|
|
347
|
-
- La page actuelle est `/fr/about`
|
|
348
|
-
- Un lien précharge `/about`
|
|
349
|
-
- **Avec `detectLocaleOnPrefetchNoPrefix: true` :**
|
|
350
|
-
- Le préchargement détecte la locale `'fr'` depuis le navigateur
|
|
351
|
-
- Redirige le préchargement vers `/fr/about`
|
|
352
|
-
- **Avec `detectLocaleOnPrefetchNoPrefix: false` (par défaut) :**
|
|
353
|
-
- Le préchargement utilise la locale par défaut
|
|
354
|
-
- Redirige le préchargement vers `/en/about` (en supposant que `'en'` est la locale par défaut)
|
|
355
|
-
- **Quand utiliser `true` :**
|
|
356
|
-
- Votre application utilise des liens internes non localisés (par exemple `<a href="/about">`)
|
|
357
|
-
- Vous souhaitez un comportement cohérent de détection de la langue entre les requêtes normales et les requêtes de préchargement
|
|
358
|
-
- **Quand utiliser `false` (par défaut) :**
|
|
359
|
-
- Votre application utilise des liens préfixés par la langue (par exemple `<a href="/fr/about">`)
|
|
360
|
-
- Vous souhaitez optimiser les performances du préchargement
|
|
361
|
-
- Vous souhaitez éviter les boucles de redirection potentielles
|
|
362
|
-
|
|
363
339
|
---
|
|
364
340
|
|
|
365
341
|
### Configuration du contenu
|
package/docs/fr/releases/v7.md
CHANGED
package/docs/hi/configuration.md
CHANGED
|
@@ -332,30 +332,6 @@ module.exports = config;
|
|
|
332
332
|
- यदि `noPrefix = false`: URL होगा `https://example.com/my-app/en`
|
|
333
333
|
- यदि `noPrefix = true`: URL होगा `https://example.com`
|
|
334
334
|
|
|
335
|
-
- **detectLocaleOnPrefetchNoPrefix**:
|
|
336
|
-
- _प्रकार_: `boolean`
|
|
337
|
-
- _डिफ़ॉल्ट_: `false`
|
|
338
|
-
- _विवरण_: नियंत्रित करता है कि Next.js प्रीफ़ेच अनुरोधों के दौरान लोकल डिटेक्शन होता है या नहीं।
|
|
339
|
-
- _उदाहरण_: `true`
|
|
340
|
-
- _नोट_: यह सेटिंग Next.js के लोकल प्रीफ़ेचिंग को कैसे संभालता है, इसे प्रभावित करती है:
|
|
341
|
-
- **उदाहरण परिदृश्य:**
|
|
342
|
-
- उपयोगकर्ता के ब्राउज़र की भाषा `'fr'` है
|
|
343
|
-
- वर्तमान पृष्ठ `/fr/about` है
|
|
344
|
-
- लिंक `/about` को प्रीफ़ेच करता है
|
|
345
|
-
- **`detectLocaleOnPrefetchNoPrefix: true` के साथ:**
|
|
346
|
-
- प्रीफ़ेच ब्राउज़र से `'fr'` लोकल का पता लगाता है
|
|
347
|
-
- प्रीफ़ेच को `/fr/about` पर पुनर्निर्देशित करता है
|
|
348
|
-
- **`detectLocaleOnPrefetchNoPrefix: false` (डिफ़ॉल्ट) के साथ:**
|
|
349
|
-
- प्रीफ़ेच डिफ़ॉल्ट लोकल का उपयोग करता है
|
|
350
|
-
- प्रीफ़ेच को `/en/about` पर पुनर्निर्देशित करता है (मानते हुए कि `'en'` डिफ़ॉल्ट है)
|
|
351
|
-
- **कब `true` का उपयोग करें:**
|
|
352
|
-
- आपका ऐप गैर-स्थानीयकृत आंतरिक लिंक का उपयोग करता है (जैसे `<a href="/about">`)
|
|
353
|
-
- आप नियमित और प्रीफ़ेच अनुरोधों के बीच सुसंगत स्थानीय पहचान व्यवहार चाहते हैं
|
|
354
|
-
- **`false` (डिफ़ॉल्ट) कब उपयोग करें:**
|
|
355
|
-
- आपका ऐप स्थानीय-उपसर्ग वाले लिंक का उपयोग करता है (जैसे `<a href="/fr/about">`)
|
|
356
|
-
- आप प्रीफ़ेचिंग प्रदर्शन को अनुकूलित करना चाहते हैं
|
|
357
|
-
- आप संभावित रीडायरेक्ट लूप से बचना चाहते हैं
|
|
358
|
-
|
|
359
335
|
---
|
|
360
336
|
|
|
361
337
|
### सामग्री विन्यास
|
package/docs/hi/releases/v7.md
CHANGED
package/docs/id/releases/v7.md
CHANGED
package/docs/it/configuration.md
CHANGED
|
@@ -332,30 +332,6 @@ Impostazioni che controllano il comportamento del middleware, incluso come l'app
|
|
|
332
332
|
- Se `noPrefix = false`: l'URL sarà `https://example.com/my-app/en`
|
|
333
333
|
- Se `noPrefix = true`: l'URL sarà `https://example.com`
|
|
334
334
|
|
|
335
|
-
- **detectLocaleOnPrefetchNoPrefix**:
|
|
336
|
-
- _Tipo_: `boolean`
|
|
337
|
-
- _Predefinito_: `false`
|
|
338
|
-
- _Descrizione_: Controlla se il rilevamento della lingua avviene durante le richieste di prefetch di Next.js.
|
|
339
|
-
- _Esempio_: `true`
|
|
340
|
-
- _Nota_: Questa impostazione influisce su come Next.js gestisce il prefetching delle lingue:
|
|
341
|
-
- **Scenario di esempio:**
|
|
342
|
-
- La lingua del browser dell'utente è `'fr'`
|
|
343
|
-
- La pagina corrente è `/fr/about`
|
|
344
|
-
- Il link fa il prefetch di `/about`
|
|
345
|
-
- **Con `detectLocaleOnPrefetchNoPrefix: true`:**
|
|
346
|
-
- Il prefetch rileva la lingua `'fr'` dal browser
|
|
347
|
-
- Reindirizza il prefetch a `/fr/about`
|
|
348
|
-
- **Con `detectLocaleOnPrefetchNoPrefix: false` (predefinito):**
|
|
349
|
-
- Il prefetch usa la lingua predefinita
|
|
350
|
-
- Reindirizza il prefetch a `/en/about` (assumendo che `'en'` sia la predefinita)
|
|
351
|
-
- **Quando usare `true`:**
|
|
352
|
-
- La tua app utilizza link interni non localizzati (es. `<a href="/about">`)
|
|
353
|
-
- Vuoi un comportamento coerente nel rilevamento della lingua tra richieste normali e di prefetch
|
|
354
|
-
- **Quando usare `false` (default):**
|
|
355
|
-
- La tua app utilizza link con prefisso di lingua (es. `<a href="/fr/about">`)
|
|
356
|
-
- Vuoi ottimizzare le prestazioni del prefetch
|
|
357
|
-
- Vuoi evitare potenziali loop di redirect
|
|
358
|
-
|
|
359
335
|
---
|
|
360
336
|
|
|
361
337
|
### Configurazione del Contenuto
|
package/docs/it/releases/v7.md
CHANGED
package/docs/ja/configuration.md
CHANGED
|
@@ -333,30 +333,6 @@ module.exports = config;
|
|
|
333
333
|
- `noPrefix = false` の場合: URLは `https://example.com/my-app/en`
|
|
334
334
|
- `noPrefix = true` の場合: URLは `https://example.com`
|
|
335
335
|
|
|
336
|
-
- **detectLocaleOnPrefetchNoPrefix**:
|
|
337
|
-
- _タイプ_: `boolean`
|
|
338
|
-
- _デフォルト_: `false`
|
|
339
|
-
- _説明_: Next.jsのプリフェッチリクエスト時にロケール検出を行うかどうかを制御します。
|
|
340
|
-
- _例_: `true`
|
|
341
|
-
- _注意_: この設定はNext.jsのロケールプリフェッチの動作に影響します:
|
|
342
|
-
- **例のシナリオ:**
|
|
343
|
-
- ユーザーのブラウザ言語が `'fr'`
|
|
344
|
-
- 現在のページが `/fr/about`
|
|
345
|
-
- リンクが `/about` をプリフェッチする
|
|
346
|
-
- **`detectLocaleOnPrefetchNoPrefix: true` の場合:**
|
|
347
|
-
- プリフェッチはブラウザから `'fr'` ロケールを検出
|
|
348
|
-
- プリフェッチを `/fr/about` にリダイレクト
|
|
349
|
-
- **`detectLocaleOnPrefetchNoPrefix: false`(デフォルト)の場合:**
|
|
350
|
-
- プリフェッチはデフォルトロケールを使用
|
|
351
|
-
- プリフェッチを `/en/about` にリダイレクト(`'en'` がデフォルトの場合)
|
|
352
|
-
- **`true` を使うべき場合:**
|
|
353
|
-
- アプリがローカライズされていない内部リンクを使用している場合(例:`<a href="/about">`)
|
|
354
|
-
- 通常のリクエストとプリフェッチリクエスト間で一貫したロケール検出動作を望む場合
|
|
355
|
-
- **`false`(デフォルト)を使用する場合:**
|
|
356
|
-
- アプリがロケール接頭辞付きリンクを使用している場合(例:`<a href="/fr/about">`)
|
|
357
|
-
- プリフェッチのパフォーマンスを最適化したい場合
|
|
358
|
-
- リダイレクトループの可能性を回避したい場合
|
|
359
|
-
|
|
360
336
|
---
|
|
361
337
|
|
|
362
338
|
### コンテンツ設定
|
package/docs/ja/releases/v7.md
CHANGED
package/docs/ko/configuration.md
CHANGED
|
@@ -335,30 +335,6 @@ module.exports = config;
|
|
|
335
335
|
- `noPrefix = false`인 경우: URL은 `https://example.com/my-app/en`이 됩니다.
|
|
336
336
|
- `noPrefix = true`인 경우: URL은 `https://example.com`이 됩니다.
|
|
337
337
|
|
|
338
|
-
- **detectLocaleOnPrefetchNoPrefix**:
|
|
339
|
-
- _Type_: `boolean`
|
|
340
|
-
- _Default_: `false`
|
|
341
|
-
- _Description_: Next.js 프리페치 요청 중에 로케일 감지가 발생하는지 여부를 제어합니다.
|
|
342
|
-
- _Example_: `true`
|
|
343
|
-
- _Note_: 이 설정은 Next.js가 로케일 프리페칭을 처리하는 방식에 영향을 미칩니다:
|
|
344
|
-
- **예시 시나리오:**
|
|
345
|
-
- 사용자의 브라우저 언어가 `'fr'`인 경우
|
|
346
|
-
- 현재 페이지가 `/fr/about`인 경우
|
|
347
|
-
- 링크가 `/about`을 프리페치하는 경우
|
|
348
|
-
- **`detectLocaleOnPrefetchNoPrefix: true`인 경우:**
|
|
349
|
-
- 프리페치가 브라우저에서 `'fr'` 로케일을 감지합니다
|
|
350
|
-
- 프리페치를 `/fr/about`으로 리다이렉트합니다
|
|
351
|
-
- **`detectLocaleOnPrefetchNoPrefix: false` (기본값)인 경우:**
|
|
352
|
-
- 프리페치가 기본 로케일을 사용합니다
|
|
353
|
-
- 프리페치를 `/en/about`으로 리다이렉트합니다 (기본 로케일이 `'en'`이라고 가정)
|
|
354
|
-
- **`true`를 사용해야 하는 경우:**
|
|
355
|
-
- 앱에서 비지역화된 내부 링크를 사용하는 경우 (예: `<a href="/about">`)
|
|
356
|
-
- 일반 요청과 프리페치 요청 간에 일관된 로케일 감지 동작을 원할 때
|
|
357
|
-
- **`false` (기본값)를 사용할 때:**
|
|
358
|
-
- 앱에서 로케일 접두사가 있는 링크를 사용하는 경우 (예: `<a href="/fr/about">`)
|
|
359
|
-
- 프리페치 성능을 최적화하려는 경우
|
|
360
|
-
- 잠재적인 리디렉션 루프를 방지하려는 경우
|
|
361
|
-
|
|
362
338
|
---
|
|
363
339
|
|
|
364
340
|
### 콘텐츠 구성
|
package/docs/ko/releases/v7.md
CHANGED
package/docs/pl/releases/v7.md
CHANGED
package/docs/pt/configuration.md
CHANGED
|
@@ -332,30 +332,6 @@ Configurações que controlam o comportamento do middleware, incluindo como a ap
|
|
|
332
332
|
- Se `noPrefix = false`: a URL será `https://example.com/my-app/en`
|
|
333
333
|
- Se `noPrefix = true`: a URL será `https://example.com`
|
|
334
334
|
|
|
335
|
-
- **detectLocaleOnPrefetchNoPrefix**:
|
|
336
|
-
- _Tipo_: `boolean`
|
|
337
|
-
- _Padrão_: `false`
|
|
338
|
-
- _Descrição_: Controla se a detecção de local ocorre durante as requisições de prefetch do Next.js.
|
|
339
|
-
- _Exemplo_: `true`
|
|
340
|
-
- _Nota_: Esta configuração afeta como o Next.js lida com o prefetch de local:
|
|
341
|
-
- **Cenário de exemplo:**
|
|
342
|
-
- O idioma do navegador do usuário é `'fr'`
|
|
343
|
-
- A página atual é `/fr/about`
|
|
344
|
-
- O link faz prefetch de `/about`
|
|
345
|
-
- **Com `detectLocaleOnPrefetchNoPrefix: true`:**
|
|
346
|
-
- O prefetch detecta o local `'fr'` do navegador
|
|
347
|
-
- Redireciona o prefetch para `/fr/about`
|
|
348
|
-
- **Com `detectLocaleOnPrefetchNoPrefix: false` (padrão):**
|
|
349
|
-
- O prefetch usa o local padrão
|
|
350
|
-
- Redireciona o prefetch para `/en/about` (assumindo que `'en'` é o padrão)
|
|
351
|
-
- **Quando usar `true`:**
|
|
352
|
-
- Sua aplicação usa links internos não localizados (ex: `<a href="/about">`)
|
|
353
|
-
- Você deseja um comportamento consistente de detecção de localidade entre requisições normais e prefetch
|
|
354
|
-
- **Quando usar `false` (padrão):**
|
|
355
|
-
- Sua aplicação usa links com prefixo de localidade (ex: `<a href="/fr/about">`)
|
|
356
|
-
- Você deseja otimizar a performance do prefetch
|
|
357
|
-
- Você deseja evitar possíveis loops de redirecionamento
|
|
358
|
-
|
|
359
335
|
---
|
|
360
336
|
|
|
361
337
|
### Configuração de Conteúdo
|
package/docs/pt/releases/v7.md
CHANGED
package/docs/ru/configuration.md
CHANGED
|
@@ -332,30 +332,6 @@ module.exports = config;
|
|
|
332
332
|
- Если `noPrefix = false`: URL будет `https://example.com/my-app/en`
|
|
333
333
|
- Если `noPrefix = true`: URL будет `https://example.com`
|
|
334
334
|
|
|
335
|
-
- **detectLocaleOnPrefetchNoPrefix**:
|
|
336
|
-
- _Тип_: `boolean`
|
|
337
|
-
- _По умолчанию_: `false`
|
|
338
|
-
- _Описание_: Управляет тем, происходит ли определение локали во время запросов предварительной загрузки (prefetch) в Next.js.
|
|
339
|
-
- _Пример_: `true`
|
|
340
|
-
- _Примечание_: Эта настройка влияет на то, как Next.js обрабатывает предварительную загрузку локалей:
|
|
341
|
-
- **Пример сценария:**
|
|
342
|
-
- Язык браузера пользователя — `'fr'`
|
|
343
|
-
- Текущая страница — `/fr/about`
|
|
344
|
-
- Ссылка предварительно загружает `/about`
|
|
345
|
-
- **При `detectLocaleOnPrefetchNoPrefix: true`:**
|
|
346
|
-
- Предварительная загрузка определяет локаль `'fr'` из браузера
|
|
347
|
-
- Перенаправляет предварительную загрузку на `/fr/about`
|
|
348
|
-
- **При `detectLocaleOnPrefetchNoPrefix: false` (по умолчанию):**
|
|
349
|
-
- Предварительная загрузка использует локаль по умолчанию
|
|
350
|
-
- Перенаправляет предварительную загрузку на `/en/about` (предполагается, что `'en'` — локаль по умолчанию)
|
|
351
|
-
- **Когда использовать `true`:**
|
|
352
|
-
- Ваше приложение использует внутренние ссылки без локализации (например, `<a href="/about">`)
|
|
353
|
-
- Вы хотите обеспечить согласованное поведение определения локали между обычными и предварительными запросами
|
|
354
|
-
- **Когда использовать `false` (по умолчанию):**
|
|
355
|
-
- Ваше приложение использует ссылки с префиксом локали (например, `<a href="/fr/about">`)
|
|
356
|
-
- Вы хотите оптимизировать производительность предварительной загрузки
|
|
357
|
-
- Вы хотите избежать потенциальных циклов перенаправления
|
|
358
|
-
|
|
359
335
|
---
|
|
360
336
|
|
|
361
337
|
### Конфигурация контента
|
package/docs/ru/releases/v7.md
CHANGED
package/docs/tr/configuration.md
CHANGED
|
@@ -335,30 +335,6 @@ Uygulamanın çerezleri, başlıkları ve yerel yönetimi için URL öneklerini
|
|
|
335
335
|
- Eğer `noPrefix = false` ise: URL `https://example.com/my-app/en` olur
|
|
336
336
|
- Eğer `noPrefix = true` ise: URL `https://example.com` olur
|
|
337
337
|
|
|
338
|
-
- **detectLocaleOnPrefetchNoPrefix**:
|
|
339
|
-
- _Tür_: `boolean`
|
|
340
|
-
- _Varsayılan_: `false`
|
|
341
|
-
- _Açıklama_: Next.js önceden getirme (prefetch) istekleri sırasında locale tespitinin yapılıp yapılmayacağını kontrol eder.
|
|
342
|
-
- _Örnek_: `true`
|
|
343
|
-
- _Not_: Bu ayar, Next.js'in locale önceden getirme işlemini nasıl yönettiğini etkiler:
|
|
344
|
-
- **Örnek senaryo:**
|
|
345
|
-
- Kullanıcının tarayıcı dili `'fr'`
|
|
346
|
-
- Mevcut sayfa `/fr/about`
|
|
347
|
-
- Bağlantı `/about` sayfasını önceden getiriyor
|
|
348
|
-
- **`detectLocaleOnPrefetchNoPrefix: true` ile:**
|
|
349
|
-
- Önceden getirme, tarayıcıdan `'fr'` locale bilgisini algılar
|
|
350
|
-
- Önceden getirme `/fr/about` sayfasına yönlendirilir
|
|
351
|
-
- **`detectLocaleOnPrefetchNoPrefix: false` (varsayılan) ile:**
|
|
352
|
-
- Önceden getirme varsayılan locale kullanır
|
|
353
|
-
- Önceden getirme `/en/about` sayfasına yönlendirilir (varsayılanın `'en'` olduğu varsayılır)
|
|
354
|
-
- **`true` ne zaman kullanılmalı:**
|
|
355
|
-
- Uygulamanız yerelleştirilmemiş dahili bağlantılar kullanıyorsa (örneğin `<a href="/about">`)
|
|
356
|
-
- Normal ve önceden getirme (prefetch) istekleri arasında tutarlı locale tespit davranışı istiyorsanız
|
|
357
|
-
- **`false` (varsayılan) ne zaman kullanılmalı:**
|
|
358
|
-
- Uygulamanız locale önekli bağlantılar kullanıyorsa (örneğin `<a href="/fr/about">`)
|
|
359
|
-
- Önceden getirme performansını optimize etmek istiyorsanız
|
|
360
|
-
- Olası yönlendirme döngülerinden kaçınmak istiyorsanız
|
|
361
|
-
|
|
362
338
|
---
|
|
363
339
|
|
|
364
340
|
### İçerik Yapılandırması
|
package/docs/tr/releases/v7.md
CHANGED
package/docs/vi/releases/v7.md
CHANGED
package/docs/zh/configuration.md
CHANGED
|
@@ -336,30 +336,6 @@ module.exports = config;
|
|
|
336
336
|
- 如果 `noPrefix = false`:URL 将是 `https://example.com/my-app/en`
|
|
337
337
|
- 如果 `noPrefix = true`:URL 将是 `https://example.com`
|
|
338
338
|
|
|
339
|
-
- **detectLocaleOnPrefetchNoPrefix**:
|
|
340
|
-
- _类型_: `boolean`
|
|
341
|
-
- _默认值_: `false`
|
|
342
|
-
- _描述_: 控制是否在 Next.js 预取请求期间进行语言环境检测。
|
|
343
|
-
- _示例_: `true`
|
|
344
|
-
- _说明_: 此设置影响 Next.js 如何处理语言环境预取:
|
|
345
|
-
- **示例场景:**
|
|
346
|
-
- 用户浏览器语言为 `'fr'`
|
|
347
|
-
- 当前页面为 `/fr/about`
|
|
348
|
-
- 链接预取 `/about`
|
|
349
|
-
- **当 `detectLocaleOnPrefetchNoPrefix: true` 时:**
|
|
350
|
-
- 预取从浏览器检测到 `'fr'` 语言环境
|
|
351
|
-
- 将预取重定向到 `/fr/about`
|
|
352
|
-
- **当 `detectLocaleOnPrefetchNoPrefix: false`(默认)时:**
|
|
353
|
-
- 预取使用默认语言环境
|
|
354
|
-
- 将预取重定向到 `/en/about`(假设 `'en'` 是默认语言)
|
|
355
|
-
- **何时使用 `true`:**
|
|
356
|
-
- 您的应用使用非本地化的内部链接(例如 `<a href="/about">`)
|
|
357
|
-
- 您希望常规请求和预取请求之间的语言检测行为保持一致
|
|
358
|
-
- **何时使用 `false`(默认值):**
|
|
359
|
-
- 您的应用使用带语言前缀的链接(例如 `<a href="/fr/about">`)
|
|
360
|
-
- 您希望优化预取性能
|
|
361
|
-
- 您希望避免潜在的重定向循环
|
|
362
|
-
|
|
363
339
|
---
|
|
364
340
|
|
|
365
341
|
### 内容配置
|
package/docs/zh/releases/v7.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/docs",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Intlayer documentation",
|
|
6
6
|
"keywords": [
|
|
@@ -69,17 +69,17 @@
|
|
|
69
69
|
"watch": "webpack --config ./webpack.config.ts --watch"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@intlayer/config": "7.0.
|
|
73
|
-
"@intlayer/core": "7.0.
|
|
74
|
-
"@intlayer/types": "7.0.
|
|
72
|
+
"@intlayer/config": "7.0.1",
|
|
73
|
+
"@intlayer/core": "7.0.1",
|
|
74
|
+
"@intlayer/types": "7.0.1"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@intlayer/api": "7.0.
|
|
78
|
-
"@intlayer/cli": "7.0.
|
|
77
|
+
"@intlayer/api": "7.0.1",
|
|
78
|
+
"@intlayer/cli": "7.0.1",
|
|
79
79
|
"@types/node": "24.9.1",
|
|
80
|
-
"@utils/ts-config": "7.0.
|
|
81
|
-
"@utils/ts-config-types": "7.0.
|
|
82
|
-
"@utils/tsdown-config": "7.0.
|
|
80
|
+
"@utils/ts-config": "7.0.1",
|
|
81
|
+
"@utils/ts-config-types": "7.0.1",
|
|
82
|
+
"@utils/tsdown-config": "7.0.1",
|
|
83
83
|
"fast-glob": "3.3.3",
|
|
84
84
|
"rimraf": "6.0.1",
|
|
85
85
|
"tsdown": "0.15.9",
|
|
@@ -87,11 +87,11 @@
|
|
|
87
87
|
"vitest": "4.0.3"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
90
|
-
"@intlayer/api": "7.0.
|
|
91
|
-
"@intlayer/cli": "7.0.
|
|
92
|
-
"@intlayer/config": "7.0.
|
|
93
|
-
"@intlayer/core": "7.0.
|
|
94
|
-
"@intlayer/types": "7.0.
|
|
90
|
+
"@intlayer/api": "7.0.1",
|
|
91
|
+
"@intlayer/cli": "7.0.1",
|
|
92
|
+
"@intlayer/config": "7.0.1",
|
|
93
|
+
"@intlayer/core": "7.0.1",
|
|
94
|
+
"@intlayer/types": "7.0.1"
|
|
95
95
|
},
|
|
96
96
|
"engines": {
|
|
97
97
|
"node": ">=14.18"
|