@intlayer/docs 8.2.4 → 8.3.0-canary.0
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 +53 -17
- package/docs/ar/intlayer_with_nextjs_compiler.md +13 -5
- package/docs/ar/intlayer_with_vite+react_compiler.md +13 -5
- package/docs/de/compiler.md +74 -9
- package/docs/de/configuration.md +49 -13
- package/docs/de/intlayer_with_nextjs_compiler.md +12 -4
- package/docs/de/intlayer_with_vite+react_compiler.md +12 -4
- package/docs/en/compiler.md +79 -1
- package/docs/en/configuration.md +39 -1
- package/docs/en/intlayer_with_nextjs_compiler.md +9 -1
- 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 +39 -2
- package/docs/en-GB/intlayer_with_nextjs_compiler.md +22 -3
- package/docs/en-GB/intlayer_with_vite+react_compiler.md +22 -3
- package/docs/es/compiler.md +71 -6
- package/docs/es/configuration.md +52 -16
- package/docs/es/intlayer_with_nextjs_compiler.md +9 -1
- package/docs/es/intlayer_with_vite+react_compiler.md +9 -1
- package/docs/fr/compiler.md +69 -4
- package/docs/fr/configuration.md +50 -14
- package/docs/fr/intlayer_with_nextjs_compiler.md +9 -1
- package/docs/fr/intlayer_with_vite+react_compiler.md +9 -1
- package/docs/hi/compiler.md +74 -9
- package/docs/hi/configuration.md +49 -13
- package/docs/hi/intlayer_with_nextjs_compiler.md +15 -7
- package/docs/hi/intlayer_with_vite+react_compiler.md +15 -7
- package/docs/id/compiler.md +73 -8
- package/docs/id/configuration.md +46 -10
- package/docs/id/intlayer_with_nextjs_compiler.md +13 -5
- package/docs/id/intlayer_with_vite+react_compiler.md +13 -5
- package/docs/it/compiler.md +73 -8
- package/docs/it/configuration.md +54 -18
- package/docs/it/intlayer_with_nextjs_compiler.md +12 -4
- package/docs/it/intlayer_with_vite+react_compiler.md +12 -4
- package/docs/ja/compiler.md +75 -10
- package/docs/ja/configuration.md +50 -14
- package/docs/ja/intlayer_with_nextjs_compiler.md +13 -5
- package/docs/ja/intlayer_with_vite+react_compiler.md +13 -5
- package/docs/ko/compiler.md +75 -10
- package/docs/ko/configuration.md +50 -14
- package/docs/ko/intlayer_with_nextjs_compiler.md +22 -3
- package/docs/ko/intlayer_with_vite+react_compiler.md +22 -3
- package/docs/pl/compiler.md +73 -8
- package/docs/pl/configuration.md +47 -11
- package/docs/pl/intlayer_with_nextjs_compiler.md +13 -5
- package/docs/pl/intlayer_with_vite+react_compiler.md +13 -5
- package/docs/pt/compiler.md +74 -9
- package/docs/pt/configuration.md +50 -14
- package/docs/pt/intlayer_with_nextjs_compiler.md +12 -4
- package/docs/pt/intlayer_with_vite+react_compiler.md +12 -4
- package/docs/ru/compiler.md +74 -9
- package/docs/ru/configuration.md +49 -13
- package/docs/ru/intlayer_with_nextjs_compiler.md +11 -3
- package/docs/ru/intlayer_with_vite+react_compiler.md +11 -3
- package/docs/tr/compiler.md +73 -8
- package/docs/tr/configuration.md +53 -17
- package/docs/tr/intlayer_with_nextjs_compiler.md +11 -3
- package/docs/tr/intlayer_with_vite+react_compiler.md +11 -3
- package/docs/uk/compiler.md +74 -9
- package/docs/uk/configuration.md +183 -147
- package/docs/uk/intlayer_with_nextjs_compiler.md +13 -5
- package/docs/uk/intlayer_with_vite+react_compiler.md +13 -5
- package/docs/vi/compiler.md +75 -10
- package/docs/vi/configuration.md +47 -11
- package/docs/vi/intlayer_with_nextjs_compiler.md +14 -6
- package/docs/vi/intlayer_with_vite+react_compiler.md +14 -6
- package/docs/zh/compiler.md +75 -10
- package/docs/zh/configuration.md +54 -18
- package/docs/zh/intlayer_with_nextjs_compiler.md +13 -5
- package/docs/zh/intlayer_with_vite+react_compiler.md +13 -5
- package/package.json +16 -16
- 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
package/docs/en-GB/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 | Automated Content Extraction for i18n
|
|
5
5
|
description: Automate your internationalisation process with the Intlayer Compiler. Extract content directly from your components for faster, more efficient i18n in Vite, Next.js, and more.
|
|
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-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
|
|
@@ -157,13 +160,12 @@ import { type IntlayerConfig, Locales } from "intlayer";
|
|
|
157
160
|
const config: IntlayerConfig = {
|
|
158
161
|
compiler: {
|
|
159
162
|
/**
|
|
160
|
-
* Indicates if the compiler should be enabled.
|
|
161
163
|
* Set to 'build-only' to skip the compiler during development and speed up start times.
|
|
162
164
|
*/
|
|
163
165
|
enabled: true,
|
|
164
166
|
|
|
165
167
|
/**
|
|
166
|
-
* Pattern to traverse the code to
|
|
168
|
+
* Pattern to traverse the code to optimize.
|
|
167
169
|
*/
|
|
168
170
|
transformPattern: [
|
|
169
171
|
"**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}",
|
|
@@ -171,14 +173,19 @@ const config: IntlayerConfig = {
|
|
|
171
173
|
],
|
|
172
174
|
|
|
173
175
|
/**
|
|
174
|
-
* Pattern to exclude from the
|
|
176
|
+
* Pattern to exclude from the optimization.
|
|
175
177
|
*/
|
|
176
178
|
excludePattern: ["**/node_modules/**"],
|
|
177
179
|
|
|
178
180
|
/**
|
|
179
|
-
* Output directory for the
|
|
181
|
+
* Output directory for the optimized dictionaries.
|
|
180
182
|
*/
|
|
181
|
-
|
|
183
|
+
output: ({ key }) => `compiler/${key}.content.json`,
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Inset only content in generated file, without key.
|
|
187
|
+
*/
|
|
188
|
+
noMetadata: false,
|
|
182
189
|
|
|
183
190
|
/**
|
|
184
191
|
* Dictionary key prefix
|
|
@@ -196,6 +203,65 @@ const config: IntlayerConfig = {
|
|
|
196
203
|
export default config;
|
|
197
204
|
```
|
|
198
205
|
|
|
206
|
+
### Compiler Configuration Reference
|
|
207
|
+
|
|
208
|
+
The following properties can be configured in the `compiler` block of your `intlayer.config.ts` file:
|
|
209
|
+
|
|
210
|
+
- **enabled**:
|
|
211
|
+
- _Type_: `boolean | 'build-only'`
|
|
212
|
+
- _Default_: `true`
|
|
213
|
+
- _Description_: Indicates if the compiler should be enabled.
|
|
214
|
+
- **dictionaryKeyPrefix**:
|
|
215
|
+
- _Type_: `string`
|
|
216
|
+
- _Default_: `'comp-'`
|
|
217
|
+
- _Description_: Prefix for the extracted dictionary keys.
|
|
218
|
+
- **transformPattern**:
|
|
219
|
+
- _Type_: `string | string[]`
|
|
220
|
+
- _Default_: `['**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}', '!**/node_modules/**']`
|
|
221
|
+
- _Description_: Patterns to traverse the code to optimize.
|
|
222
|
+
- **excludePattern**:
|
|
223
|
+
- _Type_: `string | string[]`
|
|
224
|
+
- _Default_: `['**/node_modules/**']`
|
|
225
|
+
- _Description_: Patterns to exclude from the optimization.
|
|
226
|
+
- **outputDir** (Deprecated):
|
|
227
|
+
- _Type_: `string`
|
|
228
|
+
- _Default_: `'compiler'`
|
|
229
|
+
- _Description_: The directory where the extracted dictionaries will be stored.
|
|
230
|
+
|
|
231
|
+
- **output**:
|
|
232
|
+
- _Type_: `FilePathPattern`
|
|
233
|
+
- _Default_: `({ key }) => 'compiler/${key}.content.json'`
|
|
234
|
+
- _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.
|
|
235
|
+
- _Note_: `./**/*` Path are resolved relatively to the component. `/**/*` path are resolved relatively to the Intlayer `baseDir`.
|
|
236
|
+
- _Example_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
|
|
237
|
+
|
|
238
|
+
- **noMetadata**:
|
|
239
|
+
- _Type_: `boolean`
|
|
240
|
+
- _Default_: `false`
|
|
241
|
+
- _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).
|
|
242
|
+
- _Note_: Useful if used with `loadJSON` plugin.
|
|
243
|
+
- _Example_:
|
|
244
|
+
If `true`:
|
|
245
|
+
```json
|
|
246
|
+
{
|
|
247
|
+
"key": "value"
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
If `false`:
|
|
251
|
+
```json
|
|
252
|
+
{
|
|
253
|
+
"key": "value",
|
|
254
|
+
"content": {
|
|
255
|
+
"key": "value"
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
- **saveComponents**:
|
|
261
|
+
- _Type_: `boolean`
|
|
262
|
+
- _Default_: `false`
|
|
263
|
+
- _Description_: Indicates if the components should be saved after being transformed.
|
|
264
|
+
|
|
199
265
|
### Fill missing translation
|
|
200
266
|
|
|
201
267
|
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.
|
|
@@ -14,6 +14,9 @@ slugs:
|
|
|
14
14
|
- concept
|
|
15
15
|
- configuration
|
|
16
16
|
history:
|
|
17
|
+
- version: 8.2.0
|
|
18
|
+
date: 2026-03-09
|
|
19
|
+
changes: Update compiler options, add 'output' and 'noMetadata' support
|
|
17
20
|
- version: 8.1.7
|
|
18
21
|
date: 2026-02-25
|
|
19
22
|
changes: Update compiler options
|
|
@@ -439,7 +442,12 @@ const config: IntlayerConfig = {
|
|
|
439
442
|
/**
|
|
440
443
|
* Output directory for the optimized dictionaries.
|
|
441
444
|
*/
|
|
442
|
-
|
|
445
|
+
output: ({ key }) => `compiler/${key}.content.json`,
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* Inset only content in generated file, without key.
|
|
449
|
+
*/
|
|
450
|
+
noMetadata: false,
|
|
443
451
|
|
|
444
452
|
/**
|
|
445
453
|
* Dictionary key prefix
|
|
@@ -704,7 +712,7 @@ Settings related to content handling within the application, including directory
|
|
|
704
712
|
#### Properties
|
|
705
713
|
|
|
706
714
|
- **autoFill**:
|
|
707
|
-
- _Type_: `boolean | string | { [key in Locales]?: string }`
|
|
715
|
+
- _Type_: `boolean | string | FilePathPattern | { [key in Locales]?: string }`
|
|
708
716
|
- _Default_: `undefined`
|
|
709
717
|
- _Description_: Indicates how the content should be automatically filled using AI. Can be declared globally in the `intlayer.config.ts` file.
|
|
710
718
|
- _Example_: true
|
|
@@ -1063,3 +1071,32 @@ Settings that control the Intlayer compiler, which extracts dictionaries straigh
|
|
|
1063
1071
|
- _Type_: `string`
|
|
1064
1072
|
- _Default_: `'compiler'`
|
|
1065
1073
|
- _Description_: The directory where the extracted dictionaries will be stored, relative to your project base path.
|
|
1074
|
+
|
|
1075
|
+
- **output**:
|
|
1076
|
+
- _Type_: `FilePathPattern`
|
|
1077
|
+
- _Default_: `({ key }) => 'compiler/${key}.content.json'`
|
|
1078
|
+
- _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.
|
|
1079
|
+
- _Note_: `./**/*` Path are resolved relatively to the component. `/**/*` path are resolved relatively to the Intlayer `baseDir`.
|
|
1080
|
+
- _Example_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
|
|
1081
|
+
|
|
1082
|
+
- **noMetadata**:
|
|
1083
|
+
- _Type_: `boolean`
|
|
1084
|
+
- _Default_: `false`
|
|
1085
|
+
- _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).
|
|
1086
|
+
- _Note_: Useful if used with `loadJSON` plugin.
|
|
1087
|
+
- _Example_:
|
|
1088
|
+
If `true`:
|
|
1089
|
+
```json
|
|
1090
|
+
{
|
|
1091
|
+
"key": "value"
|
|
1092
|
+
}
|
|
1093
|
+
```
|
|
1094
|
+
If `false`:
|
|
1095
|
+
```json
|
|
1096
|
+
{
|
|
1097
|
+
"key": "value",
|
|
1098
|
+
"content": {
|
|
1099
|
+
"key": "value"
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
```
|
|
@@ -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: Initial release
|
|
@@ -127,9 +130,25 @@ const config: IntlayerConfig = {
|
|
|
127
130
|
mode: "search-params",
|
|
128
131
|
},
|
|
129
132
|
compiler: {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
+
/**
|
|
134
|
+
* Set to 'build-only' to skip the compiler during development and speed up start times.
|
|
135
|
+
*/
|
|
136
|
+
enabled: true,
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Output directory for the optimized dictionaries.
|
|
140
|
+
*/
|
|
141
|
+
output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Inset only content in generated file, without key.
|
|
145
|
+
*/
|
|
146
|
+
noMetadata: false,
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Dictionary key prefix
|
|
150
|
+
*/
|
|
151
|
+
dictionaryKeyPrefix: "", // Remove base prefix
|
|
133
152
|
},
|
|
134
153
|
ai: {
|
|
135
154
|
provider: "openai",
|
|
@@ -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: Initial release
|
|
@@ -124,9 +127,25 @@ const config: IntlayerConfig = {
|
|
|
124
127
|
defaultLocale: Locales.ENGLISH,
|
|
125
128
|
},
|
|
126
129
|
compiler: {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
+
/**
|
|
131
|
+
* Set to 'build-only' to skip the compiler during development and speed up start times.
|
|
132
|
+
*/
|
|
133
|
+
enabled: true,
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Output directory for the optimized dictionaries.
|
|
137
|
+
*/
|
|
138
|
+
output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Inset only content in generated file, without key.
|
|
142
|
+
*/
|
|
143
|
+
noMetadata: false,
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Dictionary key prefix
|
|
147
|
+
*/
|
|
148
|
+
dictionaryKeyPrefix: "", // Remove base prefix
|
|
130
149
|
},
|
|
131
150
|
ai: {
|
|
132
151
|
provider: "openai",
|
package/docs/es/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 | Extracción Automática de Contenido para i18n
|
|
5
5
|
description: Automatiza tu proceso de internacionalización con el Intlayer Compiler. Extrae contenido directamente de tus componentes para una i18n más rápida y eficiente en Vite, Next.js y más.
|
|
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: Actualizar opciones del compilador
|
|
@@ -157,7 +160,6 @@ import { type IntlayerConfig, Locales } from "intlayer";
|
|
|
157
160
|
const config: IntlayerConfig = {
|
|
158
161
|
compiler: {
|
|
159
162
|
/**
|
|
160
|
-
* Indica si el compilador debe estar habilitado.
|
|
161
163
|
* Establécelo en 'build-only' para omitir el compilador durante el desarrollo y acelerar los tiempos de inicio.
|
|
162
164
|
*/
|
|
163
165
|
enabled: true,
|
|
@@ -171,23 +173,28 @@ const config: IntlayerConfig = {
|
|
|
171
173
|
],
|
|
172
174
|
|
|
173
175
|
/**
|
|
174
|
-
* Patrón
|
|
176
|
+
* Patrón a excluir de la optimización.
|
|
175
177
|
*/
|
|
176
178
|
excludePattern: ["**/node_modules/**"],
|
|
177
179
|
|
|
178
180
|
/**
|
|
179
181
|
* Directorio de salida para los diccionarios optimizados.
|
|
180
182
|
*/
|
|
181
|
-
|
|
183
|
+
output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Inserta solo el contenido en el archivo generado, sin clave.
|
|
187
|
+
*/
|
|
188
|
+
noMetadata: false,
|
|
182
189
|
|
|
183
190
|
/**
|
|
184
191
|
* Prefijo de clave de diccionario
|
|
185
192
|
*/
|
|
186
|
-
dictionaryKeyPrefix: "", // Eliminar prefijo base
|
|
193
|
+
dictionaryKeyPrefix: "", // Eliminar el prefijo base
|
|
187
194
|
|
|
188
195
|
/**
|
|
189
196
|
* Indica si los componentes deben guardarse después de ser transformados.
|
|
190
|
-
* De esta manera, el compilador puede ejecutarse
|
|
197
|
+
* De esta manera, el compilador puede ejecutarse una sola vez para transformar la aplicación y luego puede eliminarse.
|
|
191
198
|
*/
|
|
192
199
|
saveComponents: false,
|
|
193
200
|
},
|
|
@@ -209,3 +216,61 @@ npx intlayer fill # Rellenar traducciones faltantes
|
|
|
209
216
|
```
|
|
210
217
|
|
|
211
218
|
> Para más detalles, consulta la [documentación de la CLI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/cli/ci.md)
|
|
219
|
+
|
|
220
|
+
### Referencia de configuración del compilador
|
|
221
|
+
|
|
222
|
+
Las siguientes propiedades pueden configurarse en el bloque `compiler` de tu archivo `intlayer.config.ts`:
|
|
223
|
+
|
|
224
|
+
- **enabled**:
|
|
225
|
+
- _Tipo_: `boolean | 'build-only'`
|
|
226
|
+
- _Por defecto_: `true`
|
|
227
|
+
- _Descripción_: Indica si el compilador debe estar habilitado.
|
|
228
|
+
- **dictionaryKeyPrefix**:
|
|
229
|
+
- _Tipo_: `string`
|
|
230
|
+
- _Por defecto_: `'comp-'`
|
|
231
|
+
- _Descripción_: Prefijo para las claves de diccionario extraídas.
|
|
232
|
+
- **transformPattern**:
|
|
233
|
+
- _Tipo_: `string | string[]`
|
|
234
|
+
- _Por defecto_: `['**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}', '!**/node_modules/**']`
|
|
235
|
+
- _Descripción_: Patrones para recorrer el código a optimizar.
|
|
236
|
+
- **excludePattern**:
|
|
237
|
+
- _Tipo_: `string | string[]`
|
|
238
|
+
- _Por defecto_: `['**/node_modules/**']`
|
|
239
|
+
- _Descripción_: Patrones para excluir de la optimización.
|
|
240
|
+
- **outputDir** (Deprecated):
|
|
241
|
+
- _Tipo_: `string`
|
|
242
|
+
- _Por defecto_: `'compiler'`
|
|
243
|
+
- _Descripción_: El directorio donde se almacenarán los diccionarios extraídos.
|
|
244
|
+
|
|
245
|
+
- **output**:
|
|
246
|
+
- _Type_: `FilePathPattern`
|
|
247
|
+
- _Por defecto_: `({ key }) => 'compiler/${key}.content.json'`
|
|
248
|
+
- _Descripción_: Define la ruta de los archivos de salida. Reemplaza `outputDir`. Maneja variables dinámicas como `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{componentFormat}}`. Se puede configurar como una cadena usando el formato `'my/{{var}}/path'` o como una función.
|
|
249
|
+
- _Nota_: `./**/*` Los caminos se resuelven de forma relativa al componente. `/**/*` los caminos se resuelven de forma relativa al `baseDir` de Intlayer.
|
|
250
|
+
- _Ejemplo_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
|
|
251
|
+
|
|
252
|
+
- **noMetadata**:
|
|
253
|
+
- _Tipo_: `boolean`
|
|
254
|
+
- _Por defecto_: `false`
|
|
255
|
+
- _Descripción_: Indica si los metadatos deben guardarse en el archivo. Si es verdadero, el compilador no guardará los metadatos de los diccionarios (clave, contenedor de contenido).
|
|
256
|
+
- _Nota_: Útil si se usa con el plugin `loadJSON`.
|
|
257
|
+
- _Ejemplo_: Si es `true`:
|
|
258
|
+
```json
|
|
259
|
+
{
|
|
260
|
+
"key": "value"
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
Si es `false`:
|
|
264
|
+
```json
|
|
265
|
+
{
|
|
266
|
+
"key": "value",
|
|
267
|
+
"content": {
|
|
268
|
+
"key": "value"
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
- **saveComponents**:
|
|
274
|
+
- _Tipo_: `boolean`
|
|
275
|
+
- _Por defecto_: `false`
|
|
276
|
+
- _Descripción_: Indica si los componentes deben guardarse después de ser transformados.
|
package/docs/es/configuration.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2024-08-13
|
|
3
|
-
updatedAt: 2026-
|
|
3
|
+
updatedAt: 2026-03-10
|
|
4
4
|
title: Configuración
|
|
5
5
|
description: Aprende cómo configurar Intlayer para tu aplicación. Entiende las diversas configuraciones y opciones disponibles para personalizar Intlayer según tus necesidades.
|
|
6
6
|
keywords:
|
|
@@ -14,6 +14,9 @@ slugs:
|
|
|
14
14
|
- concept
|
|
15
15
|
- configuration
|
|
16
16
|
history:
|
|
17
|
+
- version: 8.2.0
|
|
18
|
+
date: 2026-03-10
|
|
19
|
+
changes: Update compiler options, add 'output' and 'noMetadata' support
|
|
17
20
|
- version: 8.1.7
|
|
18
21
|
date: 2026-02-25
|
|
19
22
|
changes: Actualizar opciones del compilador
|
|
@@ -419,12 +422,12 @@ const config: IntlayerConfig = {
|
|
|
419
422
|
*/
|
|
420
423
|
compiler: {
|
|
421
424
|
/**
|
|
422
|
-
*
|
|
425
|
+
* Establécelo en 'build-only' para omitir el compilador durante el desarrollo y acelerar los tiempos de inicio.
|
|
423
426
|
*/
|
|
424
427
|
enabled: true,
|
|
425
428
|
|
|
426
429
|
/**
|
|
427
|
-
*
|
|
430
|
+
* Patrón para recorrer el código a optimizar.
|
|
428
431
|
*/
|
|
429
432
|
transformPattern: [
|
|
430
433
|
"**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}",
|
|
@@ -432,23 +435,28 @@ const config: IntlayerConfig = {
|
|
|
432
435
|
],
|
|
433
436
|
|
|
434
437
|
/**
|
|
435
|
-
*
|
|
438
|
+
* Patrón a excluir de la optimización.
|
|
436
439
|
*/
|
|
437
440
|
excludePattern: ["**/node_modules/**"],
|
|
438
441
|
|
|
439
442
|
/**
|
|
440
|
-
*
|
|
443
|
+
* Directorio de salida para los diccionarios optimizados.
|
|
441
444
|
*/
|
|
442
|
-
|
|
445
|
+
output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
|
|
443
446
|
|
|
444
447
|
/**
|
|
445
|
-
*
|
|
448
|
+
* Inserta solo el contenido en el archivo generado, sin clave.
|
|
446
449
|
*/
|
|
447
|
-
|
|
450
|
+
noMetadata: false,
|
|
448
451
|
|
|
449
452
|
/**
|
|
450
|
-
*
|
|
451
|
-
|
|
453
|
+
* Prefijo de clave de diccionario
|
|
454
|
+
*/
|
|
455
|
+
dictionaryKeyPrefix: "", // Eliminar el prefijo base
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Indica si los componentes deben guardarse después de ser transformados.
|
|
459
|
+
* De esta manera, el compilador puede ejecutarse una sola vez para transformar la aplicación y luego puede eliminarse.
|
|
452
460
|
*/
|
|
453
461
|
saveComponents: false,
|
|
454
462
|
},
|
|
@@ -704,7 +712,7 @@ Configuraciones relacionadas con el manejo de contenido dentro de la aplicación
|
|
|
704
712
|
#### Propiedades
|
|
705
713
|
|
|
706
714
|
- **autoFill**:
|
|
707
|
-
- _Tipo_: `boolean | string | { [key in Locales]?: string }`
|
|
715
|
+
- _Tipo_: `boolean | string | FilePathPattern | { [key in Locales]?: string }`
|
|
708
716
|
- _Por defecto_: `undefined`
|
|
709
717
|
- _Descripción_: Indica cómo debe completarse automáticamente el contenido usando IA. Puede declararse globalmente en el archivo `intlayer.config.ts`.
|
|
710
718
|
- _Ejemplo_: true
|
|
@@ -962,10 +970,10 @@ Las opciones de compilación se aplican a los plugins `@intlayer/babel` y `@intl
|
|
|
962
970
|
- _Nota_: Puede usarse para deshabilitar la compilación de diccionarios, por ejemplo cuando se debe evitar la ejecución en un entorno Node.js.
|
|
963
971
|
|
|
964
972
|
- **checkTypes**:
|
|
965
|
-
-
|
|
966
|
-
-
|
|
967
|
-
-
|
|
968
|
-
-
|
|
973
|
+
- _Tipo_: `boolean`
|
|
974
|
+
- _Por defecto_: `false`
|
|
975
|
+
- _Descripción_: Indica si la compilación debe comprobar los tipos de TypeScript y registrar errores.
|
|
976
|
+
- _Nota_: Esto puede ralentizar la compilación.
|
|
969
977
|
|
|
970
978
|
- **optimize**:
|
|
971
979
|
- _Tipo_: `boolean`
|
|
@@ -978,7 +986,7 @@ Las opciones de compilación se aplican a los plugins `@intlayer/babel` y `@intl
|
|
|
978
986
|
- _Nota_: Asegúrese de que todas las claves estén declaradas estáticamente en las llamadas a `useIntlayer`. Por ejemplo, `useIntlayer('navbar')`.
|
|
979
987
|
|
|
980
988
|
- **importMode**:
|
|
981
|
-
-
|
|
989
|
+
- _Nota_: **Deprecated**: Use `dictionary.importMode` instead.
|
|
982
990
|
- _Tipo_: `'static' | 'dynamic' | 'fetch'`
|
|
983
991
|
- _Por defecto_: `'static'`
|
|
984
992
|
- _Descripción_: Controla cómo se importan los diccionarios.
|
|
@@ -1057,3 +1065,31 @@ Ajustes que controlan el compilador Intlayer, que extrae diccionarios directamen
|
|
|
1057
1065
|
- _Tipo_: `string`
|
|
1058
1066
|
- _Por defecto_: `'compiler'`
|
|
1059
1067
|
- _Descripción_: El directorio donde se almacenarán los diccionarios extraídos, relativo a la ruta base de su proyecto.
|
|
1068
|
+
|
|
1069
|
+
- **output**:
|
|
1070
|
+
- _Type_: `FilePathPattern`
|
|
1071
|
+
- _Por defecto_: `({ key }) => 'compiler/${key}.content.json'`
|
|
1072
|
+
- _Descripción_: Define la ruta de los archivos de salida. Reemplaza `outputDir`. Maneja variables dinámicas como `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{componentFormat}}`. Se puede configurar como una cadena usando el formato `'my/{{var}}/path'` o como una función.
|
|
1073
|
+
- _Nota_: `./**/*` Los caminos se resuelven de forma relativa al componente. `/**/*` los caminos se resuelven de forma relativa al `baseDir` de Intlayer.
|
|
1074
|
+
- _Ejemplo_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
|
|
1075
|
+
|
|
1076
|
+
- **noMetadata**:
|
|
1077
|
+
- _Tipo_: `boolean`
|
|
1078
|
+
- _Por defecto_: `false`
|
|
1079
|
+
- _Descripción_: Indica si los metadatos deben guardarse en el archivo. Si es verdadero, el compilador no guardará los metadatos de los diccionarios (clave, contenedor de contenido).
|
|
1080
|
+
- _Nota_: Útil si se usa con el plugin `loadJSON`.
|
|
1081
|
+
- _Ejemplo_: Si es `true`:
|
|
1082
|
+
```json
|
|
1083
|
+
{
|
|
1084
|
+
"key": "value"
|
|
1085
|
+
}
|
|
1086
|
+
```
|
|
1087
|
+
Si es `false`:
|
|
1088
|
+
```json
|
|
1089
|
+
{
|
|
1090
|
+
"key": "value",
|
|
1091
|
+
"content": {
|
|
1092
|
+
"key": "value"
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
```
|
|
@@ -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: Versión inicial
|
|
@@ -135,7 +138,12 @@ const config: IntlayerConfig = {
|
|
|
135
138
|
/**
|
|
136
139
|
* Directorio de salida para los diccionarios optimizados.
|
|
137
140
|
*/
|
|
138
|
-
|
|
141
|
+
output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Inserta solo el contenido en el archivo generado, sin clave.
|
|
145
|
+
*/
|
|
146
|
+
noMetadata: false,
|
|
139
147
|
|
|
140
148
|
/**
|
|
141
149
|
* Prefijo de clave de diccionario
|
|
@@ -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: Lanzamiento inicial
|
|
@@ -132,7 +135,12 @@ const config: IntlayerConfig = {
|
|
|
132
135
|
/**
|
|
133
136
|
* Directorio de salida para los diccionarios optimizados.
|
|
134
137
|
*/
|
|
135
|
-
|
|
138
|
+
output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Inserta solo el contenido en el archivo generado, sin clave.
|
|
142
|
+
*/
|
|
143
|
+
noMetadata: false,
|
|
136
144
|
|
|
137
145
|
/**
|
|
138
146
|
* Prefijo de clave de diccionario
|
package/docs/fr/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: Compilateur Intlayer | Extraction automatique de contenu pour l'i18n
|
|
5
5
|
description: Automatisez votre processus d'internationalisation avec le compilateur Intlayer. Extrayez le contenu directement de vos composants pour une i18n plus rapide et plus efficace dans Vite, Next.js, et plus encore.
|
|
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: Mise à jour des options du compilateur
|
|
@@ -157,7 +160,6 @@ import { type IntlayerConfig, Locales } from "intlayer";
|
|
|
157
160
|
const config: IntlayerConfig = {
|
|
158
161
|
compiler: {
|
|
159
162
|
/**
|
|
160
|
-
* Indique si le compilateur doit être activé.
|
|
161
163
|
* Réglez sur 'build-only' pour ignorer le compilateur pendant le développement et accélérer les temps de démarrage.
|
|
162
164
|
*/
|
|
163
165
|
enabled: true,
|
|
@@ -178,7 +180,12 @@ const config: IntlayerConfig = {
|
|
|
178
180
|
/**
|
|
179
181
|
* Répertoire de sortie pour les dictionnaires optimisés.
|
|
180
182
|
*/
|
|
181
|
-
|
|
183
|
+
output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Insérer uniquement le contenu dans le fichier généré, sans clé.
|
|
187
|
+
*/
|
|
188
|
+
noMetadata: false,
|
|
182
189
|
|
|
183
190
|
/**
|
|
184
191
|
* Préfixe de clé de dictionnaire
|
|
@@ -186,7 +193,7 @@ const config: IntlayerConfig = {
|
|
|
186
193
|
dictionaryKeyPrefix: "", // Supprimer le préfixe de base
|
|
187
194
|
|
|
188
195
|
/**
|
|
189
|
-
* Indique si les composants doivent être
|
|
196
|
+
* Indique si les composants doivent être sauvegardés après avoir été transformés.
|
|
190
197
|
* De cette façon, le compilateur peut être exécuté une seule fois pour transformer l'application, puis il peut être supprimé.
|
|
191
198
|
*/
|
|
192
199
|
saveComponents: false,
|
|
@@ -209,3 +216,61 @@ npx intlayer fill # Remplir les traductions manquantes
|
|
|
209
216
|
```
|
|
210
217
|
|
|
211
218
|
> Pour plus de détails, consultez la [documentation CLI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/fr/cli/ci.md)
|
|
219
|
+
|
|
220
|
+
### Référence de la configuration du compilateur
|
|
221
|
+
|
|
222
|
+
Les propriétés suivantes peuvent être configurées dans le bloc `compiler` de votre fichier `intlayer.config.ts` :
|
|
223
|
+
|
|
224
|
+
- **enabled**:
|
|
225
|
+
- _Type_: `boolean | 'build-only'`
|
|
226
|
+
- _Par défaut_: `true`
|
|
227
|
+
- _Description_: Indique si le compilateur doit être activé.
|
|
228
|
+
- **dictionaryKeyPrefix**:
|
|
229
|
+
- _Type_: `string`
|
|
230
|
+
- _Par défaut_: `'comp-'`
|
|
231
|
+
- _Description_: Préfixe pour les clés de dictionnaire extraites.
|
|
232
|
+
- **transformPattern**:
|
|
233
|
+
- _Type_: `string | string[]`
|
|
234
|
+
- _Par défaut_: `['**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}', '!**/node_modules/**']`
|
|
235
|
+
- _Description_: Modèles pour parcourir le code à optimiser.
|
|
236
|
+
- **excludePattern**:
|
|
237
|
+
- _Type_: `string | string[]`
|
|
238
|
+
- _Par défaut_: `['**/node_modules/**']`
|
|
239
|
+
- _Description_: Modèles à exclure de l'optimisation.
|
|
240
|
+
- **outputDir** (Deprecated):
|
|
241
|
+
- _Type_: `string`
|
|
242
|
+
- _Par défaut_: `'compiler'`
|
|
243
|
+
- _Description_: Le répertoire où les dictionnaires extraits seront stockés.
|
|
244
|
+
|
|
245
|
+
- **output**:
|
|
246
|
+
- _Type_: `FilePathPattern`
|
|
247
|
+
- _Par défaut_: `({ key }) => 'compiler/${key}.content.json'`
|
|
248
|
+
- _Description_: Définit le chemin des fichiers de sortie. Remplace `outputDir`. Gère les variables dynamiques telles que `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{componentFormat}}`. Peut être configuré sous forme de chaîne à l'aide du format `'my/{{var}}/path'` ou sous forme de fonction.
|
|
249
|
+
- _Note_: `./**/*` Les chemins sont résolus par rapport au composant. `/**/*` les chemins sont résolus par rapport au `baseDir` d'Intlayer.
|
|
250
|
+
- _Exemple_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
|
|
251
|
+
|
|
252
|
+
- **noMetadata**:
|
|
253
|
+
- _Type_: `boolean`
|
|
254
|
+
- _Par défaut_: `false`
|
|
255
|
+
- _Description_: Indique si les métadonnées doivent être enregistrées dans le fichier. Si vrai, le compilateur n'enregistrera pas les métadonnées des dictionnaires (clé, enveloppe de contenu).
|
|
256
|
+
- _Note_: Utile si utilisé avec le plugin `loadJSON`.
|
|
257
|
+
- _Exemple_: Si `true` :
|
|
258
|
+
```json
|
|
259
|
+
{
|
|
260
|
+
"key": "value"
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
Si `false` :
|
|
264
|
+
```json
|
|
265
|
+
{
|
|
266
|
+
"key": "value",
|
|
267
|
+
"content": {
|
|
268
|
+
"key": "value"
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
- **saveComponents**:
|
|
274
|
+
- _Type_: `boolean`
|
|
275
|
+
- _Par défaut_: `false`
|
|
276
|
+
- _Description_: Indique si les composants doivent être sauvegardés après avoir été transformés.
|