@intlayer/docs 8.2.3 → 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.
Files changed (128) hide show
  1. package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -0
  2. package/dist/cjs/blog.cjs.map +1 -1
  3. package/dist/cjs/common.cjs +1 -1
  4. package/dist/cjs/common.cjs.map +1 -1
  5. package/dist/cjs/doc.cjs.map +1 -1
  6. package/dist/cjs/frequentQuestions.cjs.map +1 -1
  7. package/dist/cjs/generated/blog.entry.cjs +1 -1
  8. package/dist/cjs/generated/blog.entry.cjs.map +1 -1
  9. package/dist/cjs/generated/docs.entry.cjs +1 -1
  10. package/dist/cjs/generated/docs.entry.cjs.map +1 -1
  11. package/dist/cjs/generated/frequentQuestions.entry.cjs +1 -1
  12. package/dist/cjs/generated/frequentQuestions.entry.cjs.map +1 -1
  13. package/dist/cjs/generated/legal.entry.cjs +1 -1
  14. package/dist/cjs/generated/legal.entry.cjs.map +1 -1
  15. package/dist/cjs/legal.cjs.map +1 -1
  16. package/dist/esm/blog.mjs.map +1 -1
  17. package/dist/esm/common.mjs +1 -1
  18. package/dist/esm/common.mjs.map +1 -1
  19. package/dist/esm/doc.mjs.map +1 -1
  20. package/dist/esm/frequentQuestions.mjs.map +1 -1
  21. package/dist/esm/generated/blog.entry.mjs.map +1 -1
  22. package/dist/esm/generated/docs.entry.mjs.map +1 -1
  23. package/dist/esm/generated/frequentQuestions.entry.mjs.map +1 -1
  24. package/dist/esm/generated/legal.entry.mjs.map +1 -1
  25. package/dist/esm/legal.mjs.map +1 -1
  26. package/dist/types/blog.d.ts +1 -1
  27. package/dist/types/common.d.ts +1 -1
  28. package/dist/types/common.d.ts.map +1 -1
  29. package/dist/types/doc.d.ts +1 -1
  30. package/dist/types/frequentQuestions.d.ts +1 -1
  31. package/dist/types/generated/blog.entry.d.ts +1 -1
  32. package/dist/types/generated/docs.entry.d.ts +1 -1
  33. package/dist/types/generated/frequentQuestions.entry.d.ts +1 -1
  34. package/dist/types/generated/legal.entry.d.ts +1 -1
  35. package/dist/types/legal.d.ts +1 -1
  36. package/docs/ar/compiler.md +73 -8
  37. package/docs/ar/configuration.md +53 -17
  38. package/docs/ar/intlayer_with_nextjs_compiler.md +13 -5
  39. package/docs/ar/intlayer_with_vite+react_compiler.md +13 -5
  40. package/docs/ar/per_locale_file.md +1 -1
  41. package/docs/de/compiler.md +74 -9
  42. package/docs/de/configuration.md +49 -13
  43. package/docs/de/intlayer_with_nextjs_compiler.md +12 -4
  44. package/docs/de/intlayer_with_vite+react_compiler.md +12 -4
  45. package/docs/de/per_locale_file.md +1 -1
  46. package/docs/en/compiler.md +79 -1
  47. package/docs/en/configuration.md +39 -1
  48. package/docs/en/intlayer_with_nextjs_compiler.md +9 -1
  49. package/docs/en/intlayer_with_vite+react_compiler.md +9 -1
  50. package/docs/en/per_locale_file.md +1 -1
  51. package/docs/en-GB/compiler.md +72 -6
  52. package/docs/en-GB/configuration.md +39 -2
  53. package/docs/en-GB/intlayer_with_nextjs_compiler.md +22 -3
  54. package/docs/en-GB/intlayer_with_vite+react_compiler.md +22 -3
  55. package/docs/en-GB/per_locale_file.md +1 -1
  56. package/docs/es/compiler.md +71 -6
  57. package/docs/es/configuration.md +52 -16
  58. package/docs/es/intlayer_with_nextjs_compiler.md +9 -1
  59. package/docs/es/intlayer_with_vite+react_compiler.md +9 -1
  60. package/docs/fr/compiler.md +69 -4
  61. package/docs/fr/configuration.md +50 -14
  62. package/docs/fr/intlayer_with_nextjs_compiler.md +9 -1
  63. package/docs/fr/intlayer_with_vite+react_compiler.md +9 -1
  64. package/docs/hi/compiler.md +74 -9
  65. package/docs/hi/configuration.md +49 -13
  66. package/docs/hi/intlayer_with_nextjs_compiler.md +15 -7
  67. package/docs/hi/intlayer_with_vite+react_compiler.md +15 -7
  68. package/docs/hi/per_locale_file.md +1 -1
  69. package/docs/id/compiler.md +73 -8
  70. package/docs/id/configuration.md +46 -10
  71. package/docs/id/intlayer_with_nextjs_compiler.md +13 -5
  72. package/docs/id/intlayer_with_vite+react_compiler.md +13 -5
  73. package/docs/id/per_locale_file.md +1 -1
  74. package/docs/it/compiler.md +73 -8
  75. package/docs/it/configuration.md +54 -18
  76. package/docs/it/intlayer_with_nextjs_compiler.md +12 -4
  77. package/docs/it/intlayer_with_vite+react_compiler.md +12 -4
  78. package/docs/it/per_locale_file.md +1 -1
  79. package/docs/ja/compiler.md +75 -10
  80. package/docs/ja/configuration.md +50 -14
  81. package/docs/ja/intlayer_with_nextjs_compiler.md +13 -5
  82. package/docs/ja/intlayer_with_vite+react_compiler.md +13 -5
  83. package/docs/ko/compiler.md +75 -10
  84. package/docs/ko/configuration.md +50 -14
  85. package/docs/ko/intlayer_with_nextjs_compiler.md +22 -3
  86. package/docs/ko/intlayer_with_vite+react_compiler.md +22 -3
  87. package/docs/pl/compiler.md +73 -8
  88. package/docs/pl/configuration.md +47 -11
  89. package/docs/pl/intlayer_with_nextjs_compiler.md +13 -5
  90. package/docs/pl/intlayer_with_vite+react_compiler.md +13 -5
  91. package/docs/pl/per_locale_file.md +1 -1
  92. package/docs/pt/compiler.md +74 -9
  93. package/docs/pt/configuration.md +50 -14
  94. package/docs/pt/intlayer_with_nextjs_compiler.md +12 -4
  95. package/docs/pt/intlayer_with_vite+react_compiler.md +12 -4
  96. package/docs/pt/per_locale_file.md +1 -1
  97. package/docs/ru/compiler.md +74 -9
  98. package/docs/ru/configuration.md +49 -13
  99. package/docs/ru/intlayer_with_nextjs_compiler.md +11 -3
  100. package/docs/ru/intlayer_with_vite+react_compiler.md +11 -3
  101. package/docs/tr/compiler.md +73 -8
  102. package/docs/tr/configuration.md +53 -17
  103. package/docs/tr/intlayer_with_nextjs_compiler.md +11 -3
  104. package/docs/tr/intlayer_with_vite+react_compiler.md +11 -3
  105. package/docs/tr/per_locale_file.md +1 -1
  106. package/docs/uk/compiler.md +74 -9
  107. package/docs/uk/configuration.md +183 -147
  108. package/docs/uk/intlayer_with_nextjs_compiler.md +13 -5
  109. package/docs/uk/intlayer_with_vite+react_compiler.md +13 -5
  110. package/docs/vi/compiler.md +75 -10
  111. package/docs/vi/configuration.md +47 -11
  112. package/docs/vi/intlayer_with_nextjs_compiler.md +14 -6
  113. package/docs/vi/intlayer_with_vite+react_compiler.md +14 -6
  114. package/docs/vi/per_locale_file.md +1 -1
  115. package/docs/zh/compiler.md +75 -10
  116. package/docs/zh/configuration.md +54 -18
  117. package/docs/zh/intlayer_with_nextjs_compiler.md +13 -5
  118. package/docs/zh/intlayer_with_vite+react_compiler.md +13 -5
  119. package/package.json +16 -16
  120. package/src/blog.ts +1 -1
  121. package/src/common.ts +2 -1
  122. package/src/doc.ts +1 -1
  123. package/src/frequentQuestions.ts +1 -1
  124. package/src/generated/blog.entry.ts +1 -1
  125. package/src/generated/docs.entry.ts +1 -1
  126. package/src/generated/frequentQuestions.entry.ts +1 -1
  127. package/src/generated/legal.entry.ts +1 -1
  128. package/src/legal.ts +1 -1
@@ -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: 초기 릴리스
@@ -124,9 +127,25 @@ const config: IntlayerConfig = {
124
127
  defaultLocale: Locales.ENGLISH,
125
128
  },
126
129
  compiler: {
127
- enabled: true, // 개발 모드에서의 영향을 제한하기 위해 'build-only'로 설정 가능
128
- outputDir: "i18n",
129
- dictionaryKeyPrefix: "", // 접두사 comp- 없음
130
+ /**
131
+ * 개발 중에 컴파일러를 건너뛰고 시작 시간을 단축하려면 'build-only'로 설정하십시오.
132
+ */
133
+ enabled: true,
134
+
135
+ /**
136
+ * 최적화된 사전의 출력 디렉터리.
137
+ */
138
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
139
+
140
+ /**
141
+ * 키 없이 생성된 파일에 콘텐츠만 삽입합니다.
142
+ */
143
+ noMetadata: false,
144
+
145
+ /**
146
+ * 사전 키 접두사
147
+ */
148
+ dictionaryKeyPrefix: "", // Remove base prefix
130
149
  },
131
150
  ai: {
132
151
  provider: "openai",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2025-09-09
3
- updatedAt: 2026-02-25
3
+ updatedAt: 2026-03-10
4
4
  title: Intlayer Compiler | Zautomatyzowane wydobywanie treści dla i18n
5
5
  description: Zautomatyzuj proces internacjonalizacji za pomocą Intlayer Compiler. Wydobywaj treści bezpośrednio z komponentów dla szybszego i bardziej efektywnego i18n w Vite, Next.js i innych.
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: Aktualizacja opcji kompilatora
@@ -157,13 +160,12 @@ import { type IntlayerConfig, Locales } from "intlayer";
157
160
  const config: IntlayerConfig = {
158
161
  compiler: {
159
162
  /**
160
- * Wskazuje, czy kompilator powinien być włączony.
161
163
  * Ustaw na 'build-only', aby pominąć kompilator podczas programowania i przyspieszyć czas uruchamiania.
162
164
  */
163
165
  enabled: true,
164
166
 
165
167
  /**
166
- * Wzór do przeszukiwania kodu w celu optymalizacji.
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
- * Wzór do wykluczenia z optymalizacji.
176
+ * Pattern to exclude from the optimization.
175
177
  */
176
178
  excludePattern: ["**/node_modules/**"],
177
179
 
178
180
  /**
179
181
  * Katalog wyjściowy dla zoptymalizowanych słowników.
180
182
  */
181
- outputDir: "i18n",
183
+ output: ({ key }) => `compiler/${key}.content.json`,
184
+
185
+ /**
186
+ * Wstaw tylko zawartość do wygenerowanego pliku, bez klucza.
187
+ */
188
+ noMetadata: false,
182
189
 
183
190
  /**
184
191
  * Prefiks klucza słownika
185
192
  */
186
- dictionaryKeyPrefix: "", // Usuń podstawowy prefiks
193
+ dictionaryKeyPrefix: "", // Remove base prefix
187
194
 
188
195
  /**
189
- * Wskazuje, czy komponenty powinny zostać zapisane po przekształceniu.
190
- * W ten sposób kompilator może zostać uruchomiony tylko raz w celu przekształcenia aplikacji, a następnie można go usunąć.
196
+ * Wskazuje, czy komponenty powinny być zapisywane po transformacji.
197
+ * W ten sposób kompilator można uruchomić tylko raz, aby przetransformować aplikację, a następnie go usunąć.
191
198
  */
192
199
  saveComponents: false,
193
200
  },
@@ -209,3 +216,61 @@ npx intlayer fill # Uzupełnij brakujące tłumaczenia
209
216
  ```
210
217
 
211
218
  > Więcej szczegółów znajdziesz w [dokumentacji CLI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pl/cli/ci.md)
219
+
220
+ ### Odniesienie do konfiguracji kompilatora
221
+
222
+ Następujące właściwości można skonfigurować w bloku `compiler` pliku `intlayer.config.ts`:
223
+
224
+ - **enabled**:
225
+ - _Typ_: `boolean | 'build-only'`
226
+ - _Domyślny_: `true`
227
+ - _Opis_: Wskazuje, czy kompilator powinien być włączony.
228
+ - **dictionaryKeyPrefix**:
229
+ - _Typ_: `string`
230
+ - _Domyślny_: `'comp-'`
231
+ - _Opis_: Prefiks dla wyekstrahowanych kluczy słownika.
232
+ - **transformPattern**:
233
+ - _Typ_: `string | string[]`
234
+ - _Domyślny_: `['**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}', '!**/node_modules/**']`
235
+ - _Opis_: Wzorce do przeszukiwania kodu w celu optymalizacji.
236
+ - **excludePattern**:
237
+ - _Typ_: `string | string[]`
238
+ - _Domyślny_: `['**/node_modules/**']`
239
+ - _Opis_: Wzorce do wykluczenia z optymalizacji.
240
+ - **outputDir** (Deprecated):
241
+ - _Typ_: `string`
242
+ - _Domyślny_: `'compiler'`
243
+ - _Opis_: Katalog, w którym będą przechowywane wyekstrahowane słowniki.
244
+
245
+ - **output**:
246
+ - _Typ_: `FilePathPattern`
247
+ - _Domyślny_: `({ key }) => 'compiler/${key}.content.json'`
248
+ - _Opis_: Definiuje ścieżkę plików wyjściowych. Zastępuje `outputDir`. Obsługuje zmienne dynamiczne, takie jak `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{componentFormat}}`. Można ustawić jako ciąg znaków w formacie `'my/{{var}}/path'` lub jako funkcję.
249
+ - _Uwaga_: Ścieżki `./**/*` są rozwiązywane względem komponentu. Ścieżki `/**/*` są rozwiązywane względem `baseDir` Intlayer.
250
+ - _Przykład_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
251
+
252
+ - **noMetadata**:
253
+ - _Typ_: `boolean`
254
+ - _Domyślny_: `false`
255
+ - _Opis_: Wskazuje, czy metadane powinny być zapisywane w pliku. Jeśli true, kompilator nie będzie zapisywał metadanych słowników (klucza, otoczki zawartości).
256
+ - _Uwaga_: Przydatne w przypadku korzystania z wtyczki `loadJSON`.
257
+ - _Przykład_: Jeśli `true`:
258
+ ```json
259
+ {
260
+ "key": "value"
261
+ }
262
+ ```
263
+ Jeśli `false`:
264
+ ```json
265
+ {
266
+ "key": "value",
267
+ "content": {
268
+ "key": "value"
269
+ }
270
+ }
271
+ ```
272
+
273
+ - **saveComponents**:
274
+ - _Typ_: `boolean`
275
+ - _Domyślny_: `false`
276
+ - _Opis_: Wskazuje, czy komponenty powinny być zapisywane po transformacji.
@@ -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: Aktualizacja opcji kompilatora
@@ -434,7 +437,7 @@ const config: IntlayerConfig = {
434
437
  */
435
438
  compiler: {
436
439
  /**
437
- * Indicates if the compiler should be enabled.
440
+ * Wskazuje, czy kompilator powinien być włączony.
438
441
  */
439
442
  enabled: true,
440
443
 
@@ -452,18 +455,23 @@ const config: IntlayerConfig = {
452
455
  excludePattern: ["**/node_modules/**"],
453
456
 
454
457
  /**
455
- * Output directory for the optimized dictionaries.
458
+ * Katalog wyjściowy dla zoptymalizowanych słowników.
456
459
  */
457
- outputDir: "compiler",
460
+ output: ({ key }) => `compiler/${key}.content.json`,
458
461
 
459
462
  /**
460
- * Dictionary key prefix
463
+ * Wstaw tylko zawartość do wygenerowanego pliku, bez klucza.
464
+ */
465
+ noMetadata: false,
466
+
467
+ /**
468
+ * Prefiks klucza słownika
461
469
  */
462
470
  dictionaryKeyPrefix: "", // Remove base prefix
463
471
 
464
472
  /**
465
- * Indicates if the components should be saved after being transformed.
466
- * That way, the compiler can be run only once to transform the app, and then it can be removed.
473
+ * Wskazuje, czy komponenty powinny być zapisywane po transformacji.
474
+ * W ten sposób kompilator można uruchomić tylko raz, aby przetransformować aplikację, a następnie go usunąć.
467
475
  */
468
476
  saveComponents: false,
469
477
  },
@@ -1070,7 +1078,7 @@ Opcje budowania dotyczą wtyczek `@intlayer/babel` oraz `@intlayer/swc`.
1070
1078
  - _Uwaga_: Upewnij się, że wszystkie klucze są deklarowane statycznie w wywołaniach `useIntlayer`, np. `useIntlayer('navbar')`.
1071
1079
 
1072
1080
  - **importMode**:
1073
- - _Note_: **Deprecated**: Use `dictionary.importMode` instead.
1081
+ - _Uwaga_: **Deprecated**: Use `dictionary.importMode` instead.
1074
1082
  - _Typ_: `'static' | 'dynamic' | 'fetch'`
1075
1083
  - _Domyślnie_: `'static'`
1076
1084
  - _Opis_: Kontroluje sposób importowania słowników.
@@ -1088,10 +1096,10 @@ Opcje budowania dotyczą wtyczek `@intlayer/babel` oraz `@intlayer/swc`.
1088
1096
  - _Uwaga_: Tryb live będzie korzystał z API synchronizacji na żywo do pobierania słowników. Jeśli wywołanie API się nie powiedzie, słowniki zostaną zaimportowane dynamicznie w trybie "dynamic".
1089
1097
  - _Uwaga_: Ta opcja nie wpłynie na funkcje `getIntlayer`, `getDictionary`, `useDictionary`, `useDictionaryAsync` oraz `useDictionaryDynamic`.
1090
1098
  - **checkTypes**:
1091
- - _Type_: `boolean`
1092
- - _Default_: `false`
1093
- - _Description_: Wskazuje, czy kompilacja powinna sprawdzać typy TypeScript i rejestrować błędy.
1094
- - _Note_: Może to spowolnić proces kompilacji.
1099
+ - _Typ_: `boolean`
1100
+ - _Domyślny_: `false`
1101
+ - _Opis_: Wskazuje, czy kompilacja powinna sprawdzać typy TypeScript i rejestrować błędy.
1102
+ - _Uwaga_: Może to spowolnić proces kompilacji.
1095
1103
 
1096
1104
  - **outputFormat**:
1097
1105
  - _Typ_: `'esm' | 'cjs'`
@@ -1154,3 +1162,31 @@ Ustawienia kontrolujące kompilator Intlayer, który wyodrębnia słowniki bezpo
1154
1162
  - _Typ_: `string`
1155
1163
  - _Domyślnie_: `'compiler'`
1156
1164
  - _Opis_: Katalog, w którym będą przechowywane wyodrębnione słowniki, względem ścieżki bazowej projektu.
1165
+
1166
+ - **output**:
1167
+ - _Typ_: `FilePathPattern`
1168
+ - _Domyślny_: `({ key }) => 'compiler/${key}.content.json'`
1169
+ - _Opis_: Definiuje ścieżkę plików wyjściowych. Zastępuje `outputDir`. Obsługuje zmienne dynamiczne, takie jak `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{componentFormat}}`. Można ustawić jako ciąg znaków w formacie `'my/{{var}}/path'` lub jako funkcję.
1170
+ - _Uwaga_: Ścieżki `./**/*` są rozwiązywane względem komponentu. Ścieżki `/**/*` są rozwiązywane względem `baseDir` Intlayer.
1171
+ - _Przykład_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
1172
+
1173
+ - **noMetadata**:
1174
+ - _Typ_: `boolean`
1175
+ - _Domyślny_: `false`
1176
+ - _Opis_: Wskazuje, czy metadane powinny być zapisywane w pliku. Jeśli true, kompilator nie będzie zapisywał metadanych słowników (klucza, otoczki zawartości).
1177
+ - _Uwaga_: Przydatne w przypadku korzystania z wtyczki `loadJSON`.
1178
+ - _Przykład_: Jeśli `true`:
1179
+ ```json
1180
+ {
1181
+ "key": "value"
1182
+ }
1183
+ ```
1184
+ Jeśli `false`:
1185
+ ```json
1186
+ {
1187
+ "key": "value",
1188
+ "content": {
1189
+ "key": "value"
1190
+ }
1191
+ }
1192
+ ```
@@ -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: Pierwsze wydanie
@@ -128,23 +131,28 @@ const config: IntlayerConfig = {
128
131
  },
129
132
  compiler: {
130
133
  /**
131
- * Określa, czy kompilator powinien być włączony.
134
+ * Wskazuje, czy kompilator powinien być włączony.
132
135
  */
133
136
  enabled: true,
134
137
 
135
138
  /**
136
139
  * Katalog wyjściowy dla zoptymalizowanych słowników.
137
140
  */
138
- outputDir: "compiler",
141
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
142
+
143
+ /**
144
+ * Wstaw tylko zawartość do wygenerowanego pliku, bez klucza.
145
+ */
146
+ noMetadata: false,
139
147
 
140
148
  /**
141
149
  * Prefiks klucza słownika
142
150
  */
143
- dictionaryKeyPrefix: "", // Usuń prefiks bazowy
151
+ dictionaryKeyPrefix: "", // Remove base prefix
144
152
 
145
153
  /**
146
- * Określa, czy komponenty powinny zostać zapisane po transformacji.
147
- * W ten sposób kompilator można uruchomić tylko raz, aby przekształcić aplikację, a następnie można go usunąć.
154
+ * Wskazuje, czy komponenty powinny być zapisywane po transformacji.
155
+ * W ten sposób kompilator można uruchomić tylko raz, aby przetransformować aplikację, a następnie go usunąć.
148
156
  */
149
157
  saveComponents: false,
150
158
  },
@@ -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: Pierwsze wydanie
@@ -125,23 +128,28 @@ const config: IntlayerConfig = {
125
128
  },
126
129
  compiler: {
127
130
  /**
128
- * Określa, czy kompilator powinien być włączony.
131
+ * Wskazuje, czy kompilator powinien być włączony.
129
132
  */
130
133
  enabled: true,
131
134
 
132
135
  /**
133
136
  * Katalog wyjściowy dla zoptymalizowanych słowników.
134
137
  */
135
- outputDir: "compiler",
138
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
139
+
140
+ /**
141
+ * Wstaw tylko zawartość do wygenerowanego pliku, bez klucza.
142
+ */
143
+ noMetadata: false,
136
144
 
137
145
  /**
138
146
  * Prefiks klucza słownika
139
147
  */
140
- dictionaryKeyPrefix: "", // Usuń prefiks bazowy
148
+ dictionaryKeyPrefix: "", // Remove base prefix
141
149
 
142
150
  /**
143
- * Określa, czy komponenty powinny zostać zapisane po transformacji.
144
- * W ten sposób kompilator można uruchomić tylko raz, aby przekształcić aplikację, a następnie można go usunąć.
151
+ * Wskazuje, czy komponenty powinny być zapisywane po transformacji.
152
+ * W ten sposób kompilator można uruchomić tylko raz, aby przetransformować aplikację, a następnie go usunąć.
145
153
  */
146
154
  saveComponents: false,
147
155
  },
@@ -126,7 +126,7 @@ const config: IntlayerConfig = {
126
126
  export default config;
127
127
  ```
128
128
 
129
- Korzystając z tej konfiguracji, wszystkie pliki dla poszczególnych lokali będą generowane z domyślnym lokalem ustawionym na angielski. Obejmuje to również generowanie plików `.content` za pomocą polecenia `extract` oraz kompilatora. (Zobacz [Compiler](https://intlayer.org/doc/compiler) lub [Extract](https://intlayer.org/doc/concept/cli/extract), aby uzyskać więcej informacji.)
129
+ Korzystając z tej konfiguracji, wszystkie pliki dla poszczególnych lokali będą generowane z domyślnym lokalem ustawionym na angielski. Obejmuje to również generowanie plików `.content` za pomocą polecenia `extract` oraz kompilatora. (Zobacz [Compiler](https://intlayer.org/doc/compiler) lub [Extract](https://github.com/aymericzip/intlayer/edit/main/docs/docs/en/cli/extract.md), aby uzyskać więcej informacji.)
130
130
 
131
131
  ## Format per-locale
132
132
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2025-09-09
3
- updatedAt: 2026-02-25
3
+ updatedAt: 2026-03-10
4
4
  title: Intlayer Compiler | Extração Automática de Conteúdo para i18n
5
5
  description: Automatize seu processo de internacionalização com o Intlayer Compiler. Extraia conteúdo diretamente dos seus componentes para uma i18n mais rápida e eficiente em Vite, Next.js e mais.
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: Atualizar opções do compilador
@@ -157,13 +160,12 @@ import { type IntlayerConfig, Locales } from "intlayer";
157
160
  const config: IntlayerConfig = {
158
161
  compiler: {
159
162
  /**
160
- * Indica se o compilador deve ser ativado.
161
- * Defina como 'build-only' para pular o compilador durante o desenvolvimento e acelerar os tempos de inicialização.
163
+ * Defina como 'build-only' para ignorar o compilador durante o desenvolvimento e acelerar os tempos de inicialização.
162
164
  */
163
165
  enabled: true,
164
166
 
165
167
  /**
166
- * Padrão para percorrer o código a ser otimizado.
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
- * Padrão para excluir da otimização.
176
+ * Pattern to exclude from the optimization.
175
177
  */
176
178
  excludePattern: ["**/node_modules/**"],
177
179
 
178
180
  /**
179
- * Diretório de saída para os dicionários otimizados.
181
+ * Diretório de saída para os dicionários optimizados.
180
182
  */
181
- outputDir: "i18n",
183
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
184
+
185
+ /**
186
+ * Inserir apenas o conteúdo no arquivo gerado, sem chave.
187
+ */
188
+ noMetadata: false,
182
189
 
183
190
  /**
184
191
  * Prefixo da chave do dicionário
185
192
  */
186
- dictionaryKeyPrefix: "", // Remover prefixo base
193
+ dictionaryKeyPrefix: "", // Remove base prefix
187
194
 
188
195
  /**
189
196
  * Indica se os componentes devem ser salvos após serem transformados.
190
- * Dessa forma, o compilador pode ser executado apenas uma vez para transformar o app e depois pode ser removido.
197
+ * Dessa forma, o compilador pode ser executado apenas uma vez para transformar o app e depois removido.
191
198
  */
192
199
  saveComponents: false,
193
200
  },
@@ -209,3 +216,61 @@ npx intlayer fill # Preencher traduções ausentes
209
216
  ```
210
217
 
211
218
  > Para mais detalhes, consulte a [documentação da CLI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/cli/ci.md)
219
+
220
+ ### Referência de configuração do compilador
221
+
222
+ As seguintes propriedades podem ser configuradas no bloco `compiler` do seu arquivo `intlayer.config.ts`:
223
+
224
+ - **enabled**:
225
+ - _Tipo_: `boolean | 'build-only'`
226
+ - _Padrão_: `true`
227
+ - _Descrição_: Indica se o compilador deve ser habilitado.
228
+ - **dictionaryKeyPrefix**:
229
+ - _Tipo_: `string`
230
+ - _Padrão_: `'comp-'`
231
+ - _Descrição_: Prefixo para as chaves de dicionário extraídas.
232
+ - **transformPattern**:
233
+ - _Tipo_: `string | string[]`
234
+ - _Padrão_: `['**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}', '!**/node_modules/**']`
235
+ - _Descrição_: Padrões para percorrer o código a ser otimizado.
236
+ - **excludePattern**:
237
+ - _Tipo_: `string | string[]`
238
+ - _Padrão_: `['**/node_modules/**']`
239
+ - _Descrição_: Padrões para excluir da otimização.
240
+ - **outputDir** (Deprecated):
241
+ - _Tipo_: `string`
242
+ - _Padrão_: `'compiler'`
243
+ - _Descrição_: O diretório onde os dicionários extraídos serão armazenados.
244
+
245
+ - **output**:
246
+ - _Tipo_: `FilePathPattern`
247
+ - _Padrão_: `({ key }) => 'compiler/${key}.content.json'`
248
+ - _Descrição_: Define o caminho dos arquivos de saída. Substitui `outputDir`. Manipula variáveis dinâmicas como `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{componentFormat}}`. Pode ser definido como uma string usando o formato `'my/{{var}}/path'` ou como uma função.
249
+ - _Nota_: `./**/*` Os caminhos são resolvidos relativamente ao componente. `/**/*` os caminhos são resolvidos relativamente ao `baseDir` do Intlayer.
250
+ - _Exemplo_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
251
+
252
+ - **noMetadata**:
253
+ - _Tipo_: `boolean`
254
+ - _Padrão_: `false`
255
+ - _Descrição_: Indica se os metadados devem ser salvos no arquivo. Se verdadeiro, o compilador não salvará os metadados dos dicionários (chave, wrapper de conteúdo).
256
+ - _Nota_: Útil se usado com o plugin `loadJSON`.
257
+ - _Exemplo_: Se `true`:
258
+ ```json
259
+ {
260
+ "key": "value"
261
+ }
262
+ ```
263
+ Se `false`:
264
+ ```json
265
+ {
266
+ "key": "value",
267
+ "content": {
268
+ "key": "value"
269
+ }
270
+ }
271
+ ```
272
+
273
+ - **saveComponents**:
274
+ - _Tipo_: `boolean`
275
+ - _Padrão_: `false`
276
+ - _Descrição_: Indica se os componentes devem ser salvos após serem transformados.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2024-08-13
3
- updatedAt: 2026-02-25
3
+ updatedAt: 2026-03-10
4
4
  title: Configuração
5
5
  description: Aprenda como configurar o Intlayer para sua aplicação. Entenda as várias configurações e opções disponíveis para personalizar o Intlayer conforme suas necessidades.
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: Atualizar opções do compilador
@@ -419,7 +422,7 @@ const config: IntlayerConfig = {
419
422
  */
420
423
  compiler: {
421
424
  /**
422
- * Indicates if the compiler should be enabled.
425
+ * Indica se o compilador deve ser habilitado.
423
426
  */
424
427
  enabled: true,
425
428
 
@@ -437,18 +440,23 @@ const config: IntlayerConfig = {
437
440
  excludePattern: ["**/node_modules/**"],
438
441
 
439
442
  /**
440
- * Output directory for the optimized dictionaries.
443
+ * Diretório de saída para os dicionários optimizados.
441
444
  */
442
- outputDir: "compiler",
445
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
443
446
 
444
447
  /**
445
- * Dictionary key prefix
448
+ * Inserir apenas o conteúdo no arquivo gerado, sem chave.
449
+ */
450
+ noMetadata: false,
451
+
452
+ /**
453
+ * Prefixo da chave do dicionário
446
454
  */
447
455
  dictionaryKeyPrefix: "", // Remove base prefix
448
456
 
449
457
  /**
450
- * Indicates if the components should be saved after being transformed.
451
- * That way, the compiler can be run only once to transform the app, and then it can be removed.
458
+ * Indica se os componentes devem ser salvos após serem transformados.
459
+ * Dessa forma, o compilador pode ser executado apenas uma vez para transformar o app e depois removido.
452
460
  */
453
461
  saveComponents: false,
454
462
  },
@@ -704,7 +712,7 @@ Configurações relacionadas ao manuseio de conteúdo dentro da aplicação, inc
704
712
  #### Propriedades
705
713
 
706
714
  - **autoFill**:
707
- - _Tipo_: `boolean | string | { [key in Locales]?: string }`
715
+ - _Tipo_: `boolean | string | FilePathPattern | { [key in Locales]?: string }`
708
716
  - _Padrão_: `undefined`
709
717
  - _Descrição_: Indica como o conteúdo deve ser preenchido automaticamente usando IA. Pode ser declarado globalmente no arquivo `intlayer.config.ts`.
710
718
  - _Exemplo_: true
@@ -722,7 +730,7 @@ Configurações relacionadas ao manuseio de conteúdo dentro da aplicação, inc
722
730
 
723
731
  - **fileExtensions**:
724
732
  - _Tipo_: `string[]`
725
- - _Default_: `['.content.ts', '.content.js', '.content.cjs', '.content.mjs', '.content.json', '.content.tsx', '.content.jsx']`
733
+ - _Padrão_: `['.content.ts', '.content.js', '.content.cjs', '.content.mjs', '.content.json', '.content.tsx', '.content.jsx']`
726
734
  - _Descrição_: Extensões de arquivo a serem procuradas ao construir dicionários.
727
735
  - _Exemplo_: `['.data.ts', '.data.js', '.data.json']`
728
736
  - _Nota_: Personalizar extensões de arquivo pode ajudar a evitar conflitos.
@@ -962,10 +970,10 @@ As opções de build se aplicam aos plugins `@intlayer/babel` e `@intlayer/swc`.
962
970
  - _Nota_: Pode ser usado para desabilitar a build de dicionários, por exemplo quando a execução em um ambiente Node.js deve ser evitada.
963
971
 
964
972
  - **checkTypes**:
965
- - _Type_: `boolean`
966
- - _Default_: `false`
967
- - _Description_: Indica se a compilação deve verificar os tipos do TypeScript e registrar erros.
968
- - _Note_: Isso pode atrasar a compilação.
973
+ - _Tipo_: `boolean`
974
+ - _Padrão_: `false`
975
+ - _Descrição_: Indica se a compilação deve verificar os tipos do TypeScript e registrar erros.
976
+ - _Nota_: Isso pode atrasar a compilação.
969
977
 
970
978
  - **optimize**:
971
979
  - _Tipo_: `boolean`
@@ -978,7 +986,7 @@ As opções de build se aplicam aos plugins `@intlayer/babel` e `@intlayer/swc`.
978
986
  - _Nota_: Certifique-se de que todas as chaves sejam declaradas estaticamente nas chamadas de `useIntlayer`. Exemplo: `useIntlayer('navbar')`.
979
987
 
980
988
  - **importMode**:
981
- - _Note_: **Deprecated**: Use `dictionary.importMode` instead.
989
+ - _Nota_: **Deprecated**: Use `dictionary.importMode` instead.
982
990
  - _Tipo_: `'static' | 'dynamic' | 'fetch'`
983
991
  - _Padrão_: `'static'`
984
992
  - _Descrição_: Controla como os dicionários são importados.
@@ -1057,3 +1065,31 @@ Configurações que controlan o compilador Intlayer, que extrai dicionários dir
1057
1065
  - _Tipo_: `string`
1058
1066
  - _Padrão_: `'compiler'`
1059
1067
  - _Descrição_: O diretório onde os dicionários extraídos serão armazenados, relativo ao caminho base do seu projeto.
1068
+
1069
+ - **output**:
1070
+ - _Tipo_: `FilePathPattern`
1071
+ - _Padrão_: `({ key }) => 'compiler/${key}.content.json'`
1072
+ - _Descrição_: Define o caminho dos arquivos de saída. Substitui `outputDir`. Manipula variáveis dinâmicas como `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{componentFormat}}`. Pode ser definido como uma string usando o formato `'my/{{var}}/path'` ou como uma função.
1073
+ - _Nota_: `./**/*` Os caminhos são resolvidos relativamente ao componente. `/**/*` os caminhos são resolvidos relativamente ao `baseDir` do Intlayer.
1074
+ - _Exemplo_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
1075
+
1076
+ - **noMetadata**:
1077
+ - _Tipo_: `boolean`
1078
+ - _Padrão_: `false`
1079
+ - _Descrição_: Indica se os metadados devem ser salvos no arquivo. Se verdadeiro, o compilador não salvará os metadados dos dicionários (chave, wrapper de conteúdo).
1080
+ - _Nota_: Útil se usado com o plugin `loadJSON`.
1081
+ - _Exemplo_: Se `true`:
1082
+ ```json
1083
+ {
1084
+ "key": "value"
1085
+ }
1086
+ ```
1087
+ Se `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: Lançamento inicial
@@ -133,18 +136,23 @@ const config: IntlayerConfig = {
133
136
  enabled: true,
134
137
 
135
138
  /**
136
- * Diretório de saída para os dicionários otimizados.
139
+ * Diretório de saída para os dicionários optimizados.
137
140
  */
138
- outputDir: "compiler",
141
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
142
+
143
+ /**
144
+ * Inserir apenas o conteúdo no arquivo gerado, sem chave.
145
+ */
146
+ noMetadata: false,
139
147
 
140
148
  /**
141
149
  * Prefixo da chave do dicionário
142
150
  */
143
- dictionaryKeyPrefix: "", // Remover prefixo base
151
+ dictionaryKeyPrefix: "", // Remove base prefix
144
152
 
145
153
  /**
146
154
  * Indica se os componentes devem ser salvos após serem transformados.
147
- * Dessa forma, o compilador pode ser executado apenas uma vez para transformar o aplicativo e depois pode ser removido.
155
+ * Dessa forma, o compilador pode ser executado apenas uma vez para transformar o app e depois removido.
148
156
  */
149
157
  saveComponents: false,
150
158
  },