@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.
Files changed (117) 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/de/compiler.md +74 -9
  41. package/docs/de/configuration.md +49 -13
  42. package/docs/de/intlayer_with_nextjs_compiler.md +12 -4
  43. package/docs/de/intlayer_with_vite+react_compiler.md +12 -4
  44. package/docs/en/compiler.md +79 -1
  45. package/docs/en/configuration.md +39 -1
  46. package/docs/en/intlayer_with_nextjs_compiler.md +9 -1
  47. package/docs/en/intlayer_with_vite+react_compiler.md +9 -1
  48. package/docs/en-GB/compiler.md +72 -6
  49. package/docs/en-GB/configuration.md +39 -2
  50. package/docs/en-GB/intlayer_with_nextjs_compiler.md +22 -3
  51. package/docs/en-GB/intlayer_with_vite+react_compiler.md +22 -3
  52. package/docs/es/compiler.md +71 -6
  53. package/docs/es/configuration.md +52 -16
  54. package/docs/es/intlayer_with_nextjs_compiler.md +9 -1
  55. package/docs/es/intlayer_with_vite+react_compiler.md +9 -1
  56. package/docs/fr/compiler.md +69 -4
  57. package/docs/fr/configuration.md +50 -14
  58. package/docs/fr/intlayer_with_nextjs_compiler.md +9 -1
  59. package/docs/fr/intlayer_with_vite+react_compiler.md +9 -1
  60. package/docs/hi/compiler.md +74 -9
  61. package/docs/hi/configuration.md +49 -13
  62. package/docs/hi/intlayer_with_nextjs_compiler.md +15 -7
  63. package/docs/hi/intlayer_with_vite+react_compiler.md +15 -7
  64. package/docs/id/compiler.md +73 -8
  65. package/docs/id/configuration.md +46 -10
  66. package/docs/id/intlayer_with_nextjs_compiler.md +13 -5
  67. package/docs/id/intlayer_with_vite+react_compiler.md +13 -5
  68. package/docs/it/compiler.md +73 -8
  69. package/docs/it/configuration.md +54 -18
  70. package/docs/it/intlayer_with_nextjs_compiler.md +12 -4
  71. package/docs/it/intlayer_with_vite+react_compiler.md +12 -4
  72. package/docs/ja/compiler.md +75 -10
  73. package/docs/ja/configuration.md +50 -14
  74. package/docs/ja/intlayer_with_nextjs_compiler.md +13 -5
  75. package/docs/ja/intlayer_with_vite+react_compiler.md +13 -5
  76. package/docs/ko/compiler.md +75 -10
  77. package/docs/ko/configuration.md +50 -14
  78. package/docs/ko/intlayer_with_nextjs_compiler.md +22 -3
  79. package/docs/ko/intlayer_with_vite+react_compiler.md +22 -3
  80. package/docs/pl/compiler.md +73 -8
  81. package/docs/pl/configuration.md +47 -11
  82. package/docs/pl/intlayer_with_nextjs_compiler.md +13 -5
  83. package/docs/pl/intlayer_with_vite+react_compiler.md +13 -5
  84. package/docs/pt/compiler.md +74 -9
  85. package/docs/pt/configuration.md +50 -14
  86. package/docs/pt/intlayer_with_nextjs_compiler.md +12 -4
  87. package/docs/pt/intlayer_with_vite+react_compiler.md +12 -4
  88. package/docs/ru/compiler.md +74 -9
  89. package/docs/ru/configuration.md +49 -13
  90. package/docs/ru/intlayer_with_nextjs_compiler.md +11 -3
  91. package/docs/ru/intlayer_with_vite+react_compiler.md +11 -3
  92. package/docs/tr/compiler.md +73 -8
  93. package/docs/tr/configuration.md +53 -17
  94. package/docs/tr/intlayer_with_nextjs_compiler.md +11 -3
  95. package/docs/tr/intlayer_with_vite+react_compiler.md +11 -3
  96. package/docs/uk/compiler.md +74 -9
  97. package/docs/uk/configuration.md +183 -147
  98. package/docs/uk/intlayer_with_nextjs_compiler.md +13 -5
  99. package/docs/uk/intlayer_with_vite+react_compiler.md +13 -5
  100. package/docs/vi/compiler.md +75 -10
  101. package/docs/vi/configuration.md +47 -11
  102. package/docs/vi/intlayer_with_nextjs_compiler.md +14 -6
  103. package/docs/vi/intlayer_with_vite+react_compiler.md +14 -6
  104. package/docs/zh/compiler.md +75 -10
  105. package/docs/zh/configuration.md +54 -18
  106. package/docs/zh/intlayer_with_nextjs_compiler.md +13 -5
  107. package/docs/zh/intlayer_with_vite+react_compiler.md +13 -5
  108. package/package.json +16 -16
  109. package/src/blog.ts +1 -1
  110. package/src/common.ts +2 -1
  111. package/src/doc.ts +1 -1
  112. package/src/frequentQuestions.ts +1 -1
  113. package/src/generated/blog.entry.ts +1 -1
  114. package/src/generated/docs.entry.ts +1 -1
  115. package/src/generated/frequentQuestions.entry.ts +1 -1
  116. package/src/generated/legal.entry.ts +1 -1
  117. package/src/legal.ts +1 -1
@@ -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: Perbarui opsi kompiler
@@ -437,7 +440,7 @@ const config: IntlayerConfig = {
437
440
  */
438
441
  compiler: {
439
442
  /**
440
- * Indicates if the compiler should be enabled.
443
+ * Menunjukkan apakah kompiler harus diaktifkan.
441
444
  */
442
445
  enabled: true,
443
446
 
@@ -455,18 +458,23 @@ const config: IntlayerConfig = {
455
458
  excludePattern: ["**/node_modules/**"],
456
459
 
457
460
  /**
458
- * Output directory for the optimized dictionaries.
461
+ * Direktori output untuk kamus yang dioptimalkan.
459
462
  */
460
- outputDir: "compiler",
463
+ output: ({ key }) => `compiler/${key}.content.json`,
461
464
 
462
465
  /**
463
- * Dictionary key prefix
466
+ * Masukkan konten saja dalam file yang dihasilkan, tanpa kunci.
467
+ */
468
+ noMetadata: false,
469
+
470
+ /**
471
+ * Awalan kunci kamus
464
472
  */
465
473
  dictionaryKeyPrefix: "", // Remove base prefix
466
474
 
467
475
  /**
468
- * Indicates if the components should be saved after being transformed.
469
- * That way, the compiler can be run only once to transform the app, and then it can be removed.
476
+ * Menunjukkan apakah komponen harus disimpan setelah ditransformasi.
477
+ * Dengan begitu, kompiler hanya perlu dijalankan sekali untuk mentransformasi aplikasi, lalu dapat dihapus.
470
478
  */
471
479
  saveComponents: false,
472
480
  },
@@ -1082,7 +1090,7 @@ Opsi build berlaku untuk plugin `@intlayer/babel` dan `@intlayer/swc`.
1082
1090
  - _Catatan_: Pastikan semua kunci dideklarasikan secara statis dalam panggilan `useIntlayer`. Contoh: `useIntlayer('navbar')`.
1083
1091
 
1084
1092
  - **importMode**:
1085
- - _Note_: **Deprecated**: Use `dictionary.importMode` instead.
1093
+ - _Catatan_: **Deprecated**: Use `dictionary.importMode` instead.
1086
1094
  - _Tipe_: `'static' | 'dynamic' | 'fetch'`
1087
1095
  - _Default_: `'static'`
1088
1096
  - _Deskripsi_: Mengontrol bagaimana kamus diimpor.
@@ -1100,10 +1108,10 @@ Opsi build berlaku untuk plugin `@intlayer/babel` dan `@intlayer/swc`.
1100
1108
  - _Catatan_: Mode live akan menggunakan API sinkronisasi live untuk mengambil kamus. Jika panggilan API gagal, kamus akan diimpor secara dinamis sebagai mode "dynamic".
1101
1109
  - _Catatan_: Opsi ini tidak akan memengaruhi fungsi `getIntlayer`, `getDictionary`, `useDictionary`, `useDictionaryAsync` dan `useDictionaryDynamic`.
1102
1110
  - **checkTypes**:
1103
- - _Type_: `boolean`
1111
+ - _Tipe_: `boolean`
1104
1112
  - _Default_: `false`
1105
- - _Description_: Menunjukkan apakah build harus memeriksa tipe TypeScript dan mencatat kesalahan.
1106
- - _Note_: Hal ini dapat memperlambat proses build.
1113
+ - _Deskripsi_: Menunjukkan apakah build harus memeriksa tipe TypeScript dan mencatat kesalahan.
1114
+ - _Catatan_: Hal ini dapat memperlambat proses build.
1107
1115
 
1108
1116
  - **outputFormat**:
1109
1117
  - _Tipe_: `'esm' | 'cjs'`
@@ -1166,3 +1174,31 @@ Pengaturan yang mengontrol kompiler Intlayer, yang mengekstrak kamus langsung da
1166
1174
  - _Tipe_: `string`
1167
1175
  - _Default_: `'compiler'`
1168
1176
  - _Deskripsi_: Direktori tempat kamus yang diekstrak akan disimpan, relatif terhadap jalur dasar proyek Anda.
1177
+
1178
+ - **output**:
1179
+ - _Tipe_: `FilePathPattern`
1180
+ - _Default_: `({ key }) => 'compiler/${key}.content.json'`
1181
+ - _Deskripsi_: Mendefinisikan jalur file output. Menggantikan `outputDir`. Menangani variabel dinamis seperti `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, dan `{{componentFormat}}`. Dapat diatur sebagai string menggunakan format `'my/{{var}}/path'`, atau sebagai fungsi.
1182
+ - _Catatan_: Jalur `./**/*` diselesaikan relatif terhadap komponen. Jalur `/**/*` diselesaikan relatif terhadap `baseDir` Intlayer.
1183
+ - _Contoh_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
1184
+
1185
+ - **noMetadata**:
1186
+ - _Tipe_: `boolean`
1187
+ - _Default_: `false`
1188
+ - _Deskripsi_: Menunjukkan apakah metadata harus disimpan dalam file. Jika benar, kompiler tidak akan menyimpan metadata kamus (kunci, pembungkus konten).
1189
+ - _Catatan_: Berguna jika digunakan dengan plugin `loadJSON`.
1190
+ - _Contoh_: Jika `true`:
1191
+ ```json
1192
+ {
1193
+ "key": "value"
1194
+ }
1195
+ ```
1196
+ Jika `false`:
1197
+ ```json
1198
+ {
1199
+ "key": "value",
1200
+ "content": {
1201
+ "key": "value"
1202
+ }
1203
+ }
1204
+ ```
@@ -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: Rilis Awal
@@ -128,23 +131,28 @@ const config: IntlayerConfig = {
128
131
  },
129
132
  compiler: {
130
133
  /**
131
- * Menunjukkan apakah kompilator harus diaktifkan.
134
+ * Menunjukkan apakah kompiler harus diaktifkan.
132
135
  */
133
136
  enabled: true,
134
137
 
135
138
  /**
136
139
  * Direktori output untuk kamus yang dioptimalkan.
137
140
  */
138
- outputDir: "compiler",
141
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
142
+
143
+ /**
144
+ * Masukkan konten saja dalam file yang dihasilkan, tanpa kunci.
145
+ */
146
+ noMetadata: false,
139
147
 
140
148
  /**
141
149
  * Awalan kunci kamus
142
150
  */
143
- dictionaryKeyPrefix: "", // Hapus awalan dasar
151
+ dictionaryKeyPrefix: "", // Remove base prefix
144
152
 
145
153
  /**
146
- * Menunjukkan apakah komponen harus disimpan setelah diubah.
147
- * Dengan begitu, kompilator dapat dijalankan satu kali saja untuk mengubah aplikasi, kemudian dapat dihapus.
154
+ * Menunjukkan apakah komponen harus disimpan setelah ditransformasi.
155
+ * Dengan begitu, kompiler hanya perlu dijalankan sekali untuk mentransformasi aplikasi, lalu dapat dihapus.
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: Rilis awal
@@ -125,23 +128,28 @@ const config: IntlayerConfig = {
125
128
  },
126
129
  compiler: {
127
130
  /**
128
- * Menunjukkan apakah kompilator harus diaktifkan.
131
+ * Menunjukkan apakah kompiler harus diaktifkan.
129
132
  */
130
133
  enabled: true,
131
134
 
132
135
  /**
133
136
  * Direktori output untuk kamus yang dioptimalkan.
134
137
  */
135
- outputDir: "compiler",
138
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
139
+
140
+ /**
141
+ * Masukkan konten saja dalam file yang dihasilkan, tanpa kunci.
142
+ */
143
+ noMetadata: false,
136
144
 
137
145
  /**
138
146
  * Awalan kunci kamus
139
147
  */
140
- dictionaryKeyPrefix: "", // Hapus awalan dasar
148
+ dictionaryKeyPrefix: "", // Remove base prefix
141
149
 
142
150
  /**
143
- * Menunjukkan apakah komponen harus disimpan setelah diubah.
144
- * Dengan begitu, kompilator dapat dijalankan satu kali saja untuk mengubah aplikasi, kemudian dapat dihapus.
151
+ * Menunjukkan apakah komponen harus disimpan setelah ditransformasi.
152
+ * Dengan begitu, kompiler hanya perlu dijalankan sekali untuk mentransformasi aplikasi, lalu dapat dihapus.
145
153
  */
146
154
  saveComponents: false,
147
155
  },
@@ -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: Compiler Intlayer | Estrazione automatica dei contenuti per i18n
5
5
  description: Automatizza il tuo processo di internazionalizzazione con il compilatore Intlayer. Estrai contenuti direttamente dai tuoi componenti per un i18n più veloce ed efficiente in Vite, Next.js e altro.
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: Aggiorna le opzioni del compilatore
@@ -157,13 +160,12 @@ import { type IntlayerConfig, Locales } from "intlayer";
157
160
  const config: IntlayerConfig = {
158
161
  compiler: {
159
162
  /**
160
- * Indica se il compiler deve essere abilitato.
161
- * Imposta su 'build-only' per saltare il compiler durante lo sviluppo e velocizzare i tempi di avvio.
163
+ * Imposta su 'build-only' per saltare il compilatore durante lo sviluppo e accelerare i tempi di avvio.
162
164
  */
163
165
  enabled: true,
164
166
 
165
167
  /**
166
- * Pattern per attraversare il codice da ottimizzare.
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
- * Pattern da escludere dall'ottimizzazione.
176
+ * Pattern to exclude from the optimization.
175
177
  */
176
178
  excludePattern: ["**/node_modules/**"],
177
179
 
178
180
  /**
179
181
  * Directory di output per i dizionari ottimizzati.
180
182
  */
181
- outputDir: "i18n",
183
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
184
+
185
+ /**
186
+ * Inserisci solo il contenuto nel file generato, senza chiave.
187
+ */
188
+ noMetadata: false,
182
189
 
183
190
  /**
184
191
  * Prefisso chiave dizionario
185
192
  */
186
- dictionaryKeyPrefix: "", // Rimuovi prefisso di base
193
+ dictionaryKeyPrefix: "", // Remove base prefix
187
194
 
188
195
  /**
189
196
  * Indica se i componenti devono essere salvati dopo essere stati trasformati.
190
- * In questo modo, il compiler può essere eseguito solo una volta per trasformare l'app, e poi può essere rimosso.
197
+ * In questo modo, il compilatore può essere eseguito una sola volta per trasformare l'app e poi rimosso.
191
198
  */
192
199
  saveComponents: false,
193
200
  },
@@ -209,3 +216,61 @@ npx intlayer fill # Riempi le traduzioni mancanti
209
216
  ```
210
217
 
211
218
  > Per maggiori dettagli, fare riferimento alla [documentazione CLI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/cli/ci.md)
219
+
220
+ ### Riferimento alla configurazione del compilatore
221
+
222
+ Le seguenti proprietà possono essere configurate nel blocco `compiler` del file `intlayer.config.ts`:
223
+
224
+ - **enabled**:
225
+ - _Tipo_: `boolean | 'build-only'`
226
+ - _Predefinito_: `true`
227
+ - _Descrizione_: Indica se il compilatore deve essere abilitato.
228
+ - **dictionaryKeyPrefix**:
229
+ - _Tipo_: `string`
230
+ - _Predefinito_: `'comp-'`
231
+ - _Descrizione_: Prefisso per le chiavi del dizionario estratte.
232
+ - **transformPattern**:
233
+ - _Tipo_: `string | string[]`
234
+ - _Predefinito_: `['**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}', '!**/node_modules/**']`
235
+ - _Descrizione_: Modelli per attraversare il codice da ottimizzare.
236
+ - **excludePattern**:
237
+ - _Tipo_: `string | string[]`
238
+ - _Predefinito_: `['**/node_modules/**']`
239
+ - _Descrizione_: Modelli da escludere dall'ottimizzazione.
240
+ - **outputDir** (Deprecated):
241
+ - _Tipo_: `string`
242
+ - _Predefinito_: `'compiler'`
243
+ - _Descrizione_: La directory in cui verranno memorizzati i dizionari estratti.
244
+
245
+ - **output**:
246
+ - _Type_: `FilePathPattern`
247
+ - _Default_: `({ key }) => 'compiler/${key}.content.json'`
248
+ - _Descrizione_: Definisce il percorso dei file di output. Sostituisce `outputDir`. Gestisce variabili dinamiche come `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{componentFormat}}`. Può essere impostato come stringa utilizzando il formato `'my/{{var}}/path'` o come funzione.
249
+ - _Nota_: `./**/*` I percorsi sono risolti relativamente al componente. `/**/*` i percorsi sono risolti relativamente al `baseDir` di Intlayer.
250
+ - _Esempio_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
251
+
252
+ - **noMetadata**:
253
+ - _Tipo_: `boolean`
254
+ - _Predefinito_: `false`
255
+ - _Descrizione_: Indica se i metadati devono essere salvati nel file. Se vero, il compilatore non salverà i metadatati dei dizionari (chiave, contenitore del contenuto).
256
+ - _Nota_: Utile se utilizzato con il plugin `loadJSON`.
257
+ - _Esempio_: 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
+ - _Predefinito_: `false`
276
+ - _Descrizione_: Indica se i componenti devono essere salvati dopo essere stati trasformati.
@@ -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: Configurazione
5
5
  description: Scopri come configurare Intlayer per la tua applicazione. Comprendi le varie impostazioni e opzioni disponibili per personalizzare Intlayer secondo le tue esigenze.
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: Aggiorna le opzioni del compilatore
@@ -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 il compilatore deve essere abilitato.
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
+ * Directory di output per i dizionari ottimizzati.
441
444
  */
442
- outputDir: "compiler",
445
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
443
446
 
444
447
  /**
445
- * Dictionary key prefix
448
+ * Inserisci solo il contenuto nel file generato, senza chiave.
449
+ */
450
+ noMetadata: false,
451
+
452
+ /**
453
+ * Prefisso chiave dizionario
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 i componenti devono essere salvati dopo essere stati trasformati.
459
+ * In questo modo, il compilatore può essere eseguito una sola volta per trasformare l'app e poi rimosso.
452
460
  */
453
461
  saveComponents: false,
454
462
  },
@@ -704,7 +712,7 @@ Impostazioni relative alla gestione del contenuto all'interno dell'applicazione,
704
712
  #### Proprietà
705
713
 
706
714
  - **autoFill**:
707
- - _Tipo_: `boolean | string | { [key in Locales]?: string }`
715
+ - _Tipo_: `boolean | string | FilePathPattern | { [key in Locales]?: string }`
708
716
  - _Predefinito_: `undefined`
709
717
  - _Descrizione_: Indica come il contenuto dovrebbe essere compilato automaticamente usando l'IA. Può essere dichiarato globalmente nel file `intlayer.config.ts`.
710
718
  - _Esempio_: true
@@ -832,11 +840,11 @@ Per ulteriori informazioni sui file di dichiarazione del contenuto e su come ven
832
840
  - **locale**
833
841
  - **location**
834
842
  - **importMode**:
835
- - _Note_: **Deprecated**: Use `dictionary.importMode` instead.
836
- - _Type_: `'static' | 'dynamic' | 'fetch'`
837
- - _Default_: `'static'`
838
- - _Description_: Controls how dictionaries are imported.
839
- - _Example_: `'dynamic'`
843
+ - _Nota_: **Deprecated**: Use `dictionary.importMode` instead.
844
+ - _Tipo_: `'static' | 'dynamic' | 'fetch'`
845
+ - _Predefinito_: `'static'`
846
+ - _Descrizione_: Controls how dictionaries are imported.
847
+ - _Esempio_: `'dynamic'`
840
848
  - **priority**
841
849
  - **live**
842
850
  - **schema**
@@ -968,10 +976,10 @@ Le opzioni di build si applicano ai plugin `@intlayer/babel` e `@intlayer/swc`.
968
976
  - _Nota_: Può essere utilizzato per disabilitare la build dei dizionari, ad esempio quando l'esecuzione in un ambiente Node.js dovrebbe essere evitata.
969
977
 
970
978
  - **checkTypes**:
971
- - _Type_: `boolean`
972
- - _Default_: `false`
973
- - _Description_: Indica se la build deve controllare i tipi TypeScript e registrare gli errori.
974
- - _Note_: Questo può rallentare la build.
979
+ - _Tipo_: `boolean`
980
+ - _Predefinito_: `false`
981
+ - _Descrizione_: Indica se la build deve controllare i tipi TypeScript e registrare gli errori.
982
+ - _Nota_: Questo può rallentare la build.
975
983
 
976
984
  - **optimize**:
977
985
  - _Tipo_: `boolean`
@@ -984,7 +992,7 @@ Le opzioni di build si applicano ai plugin `@intlayer/babel` e `@intlayer/swc`.
984
992
  - _Nota_: Assicurarsi che tutte le chiavi siano dichiarate staticamente nelle chiamate a `useIntlayer`. Es. `useIntlayer('navbar')`.
985
993
 
986
994
  - **importMode**:
987
- - _Note_: **Deprecated**: Use `dictionary.importMode` instead.
995
+ - _Nota_: **Deprecated**: Use `dictionary.importMode` instead.
988
996
  - _Tipo_: `'static' | 'dynamic' | 'fetch'`
989
997
  - _Predefinito_: `'static'`
990
998
  - _Descrizione_: Controlla come vengono importati i dizionari.
@@ -1063,3 +1071,31 @@ Impostazioni che controllano il compilatore Intlayer, che estrae i dizionari dir
1063
1071
  - _Tipo_: `string`
1064
1072
  - _Predefinito_: `'compiler'`
1065
1073
  - _Descrizione_: La directory in cui verranno memorizzati i dizionari estratti, relativa al percorso di base del progetto.
1074
+
1075
+ - **output**:
1076
+ - _Type_: `FilePathPattern`
1077
+ - _Default_: `({ key }) => 'compiler/${key}.content.json'`
1078
+ - _Descrizione_: Definisce il percorso dei file di output. Sostituisce `outputDir`. Gestisce variabili dinamiche come `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{componentFormat}}`. Può essere impostato come stringa utilizzando il formato `'my/{{var}}/path'` o come funzione.
1079
+ - _Nota_: `./**/*` I percorsi sono risolti relativamente al componente. `/**/*` i percorsi sono risolti relativamente al `baseDir` di Intlayer.
1080
+ - _Esempio_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
1081
+
1082
+ - **noMetadata**:
1083
+ - _Tipo_: `boolean`
1084
+ - _Predefinito_: `false`
1085
+ - _Descrizione_: Indica se i metadati devono essere salvati nel file. Se vero, il compilatore non salverà i metadatati dei dizionari (chiave, contenitore del contenuto).
1086
+ - _Nota_: Utile se utilizzato con il plugin `loadJSON`.
1087
+ - _Esempio_: Se `true`:
1088
+ ```json
1089
+ {
1090
+ "key": "value"
1091
+ }
1092
+ ```
1093
+ Se `false`:
1094
+ ```json
1095
+ {
1096
+ "key": "value",
1097
+ "content": {
1098
+ "key": "value"
1099
+ }
1100
+ }
1101
+ ```
@@ -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: Rilascio iniziale
@@ -135,16 +138,21 @@ const config: IntlayerConfig = {
135
138
  /**
136
139
  * Directory di output per i dizionari ottimizzati.
137
140
  */
138
- outputDir: "compiler",
141
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
139
142
 
140
143
  /**
141
- * Prefisso della chiave del dizionario
144
+ * Inserisci solo il contenuto nel file generato, senza chiave.
142
145
  */
143
- dictionaryKeyPrefix: "", // Rimuovi il prefisso di base
146
+ noMetadata: false,
147
+
148
+ /**
149
+ * Prefisso chiave dizionario
150
+ */
151
+ dictionaryKeyPrefix: "", // Remove base prefix
144
152
 
145
153
  /**
146
154
  * Indica se i componenti devono essere salvati dopo essere stati trasformati.
147
- * In questo modo, il compilatore può essere eseguito una sola volta per trasformare l'app e può quindi essere rimosso.
155
+ * In questo modo, il compilatore può essere eseguito una sola volta per trasformare l'app e poi rimosso.
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: Rilascio iniziale
@@ -137,16 +140,21 @@ const config: IntlayerConfig = {
137
140
  /**
138
141
  * Directory di output per i dizionari ottimizzati.
139
142
  */
140
- outputDir: "compiler",
143
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
141
144
 
142
145
  /**
143
- * Prefisso della chiave del dizionario
146
+ * Inserisci solo il contenuto nel file generato, senza chiave.
144
147
  */
145
- dictionaryKeyPrefix: "", // Rimuovi il prefisso di base
148
+ noMetadata: false,
149
+
150
+ /**
151
+ * Prefisso chiave dizionario
152
+ */
153
+ dictionaryKeyPrefix: "", // Remove base prefix
146
154
 
147
155
  /**
148
156
  * Indica se i componenti devono essere salvati dopo essere stati trasformati.
149
- * In questo modo, il compilatore può essere eseguito una sola volta per trasformare l'app e può quindi essere rimosso.
157
+ * In questo modo, il compilatore può essere eseguito una sola volta per trasformare l'app e poi rimosso.
150
158
  */
151
159
  saveComponents: false,
152
160
  },
@@ -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 コンパイラー | i18n のための自動コンテンツ抽出
5
5
  description: Intlayer コンパイラーで国際化プロセスを自動化しましょう。コンポーネントから直接コンテンツを抽出し、Vite、Next.js などでより高速かつ効率的な i18n を実現します。
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: コンパイラーオプションの更新
@@ -157,13 +160,12 @@ import { type IntlayerConfig, Locales } from "intlayer";
157
160
  const config: IntlayerConfig = {
158
161
  compiler: {
159
162
  /**
160
- * コンパイラを有効にするかどうかを指定します。
161
- * 開発中にコンパイラをスキップして起動時間を短縮するには、'build-only' に設定します。
163
+ * 開発中のコンパイラをスキップして起動時間を短縮するには、'build-only'に設定します。
162
164
  */
163
165
  enabled: true,
164
166
 
165
167
  /**
166
- * 最適化するためにコードを走査するパターン。
168
+ * Pattern to traverse the code to optimize.
167
169
  */
168
170
  transformPattern: [
169
171
  "**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}",
@@ -171,23 +173,28 @@ const config: IntlayerConfig = {
171
173
  ],
172
174
 
173
175
  /**
174
- * 最適化から除外するパターン。
176
+ * Pattern to exclude from the optimization.
175
177
  */
176
178
  excludePattern: ["**/node_modules/**"],
177
179
 
178
180
  /**
179
181
  * 最適化された辞書の出力ディレクトリ。
180
182
  */
181
- outputDir: "i18n",
183
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
182
184
 
183
185
  /**
184
- * 辞書のキープレフィックス
186
+ * キーなしで、生成されたファイルにコンテンツのみを挿入します。
185
187
  */
186
- dictionaryKeyPrefix: "", // ベースプレフィックスを削除
188
+ noMetadata: false,
187
189
 
188
190
  /**
189
- * コンポーネントを変換した後に保存するかどうかを指定します。
190
- * そうすることで、コンパイラを 1 回だけ実行してアプリを変換し、その後削除することができます。
191
+ * 辞書キーのプレフィックス
192
+ */
193
+ dictionaryKeyPrefix: "", // Remove base prefix
194
+
195
+ /**
196
+ * 変換後にコンポーネントを保存するかどうかを示します。
197
+ * これにより、コンパイラを1回だけ実行してアプリを変換し、その後削除することができます。
191
198
  */
192
199
  saveComponents: false,
193
200
  },
@@ -209,3 +216,61 @@ npx intlayer fill # 欠落した翻訳を埋める
209
216
  ```
210
217
 
211
218
  > 詳細については、[CLIドキュメント](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/cli/ci.md)を参照してください。
219
+
220
+ ### コンパイラ設定リファレンス
221
+
222
+ 以下のプロパティは、`intlayer.config.ts`ファイルの`compiler`ブロックで設定できます。
223
+
224
+ - **enabled**:
225
+ - _タイプ_: `boolean | 'build-only'`
226
+ - _デフォルト_: `true`
227
+ - _説明_: コンパイラを有効にするかどうかを示します。
228
+ - **dictionaryKeyPrefix**:
229
+ - _タイプ_: `string`
230
+ - _デフォルト_: `'comp-'`
231
+ - _説明_: 抽出された辞書キーのプレフィックス。
232
+ - **transformPattern**:
233
+ - _タイプ_: `string | string[]`
234
+ - _デフォルト_: `['**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}', '!**/node_modules/**']`
235
+ - _説明_: 最適化のためにコードをトラバースするパターン。
236
+ - **excludePattern**:
237
+ - _タイプ_: `string | string[]`
238
+ - _デフォルト_: `['**/node_modules/**']`
239
+ - _説明_: 最適化から除外するパターン。
240
+ - **outputDir** (Deprecated):
241
+ - _タイプ_: `string`
242
+ - _デフォルト_: `'compiler'`
243
+ - _説明_: 抽出された辞書が保存されるディレクトリ。
244
+
245
+ - **output**:
246
+ - _型_: `FilePathPattern`
247
+ - _デフォルト_: `({ key }) => 'compiler/${key}.content.json'`
248
+ - _説明_: 出力ファイルのパスを定義します。 `outputDir` を置き換えます。 `{{locale}}`、 `{{key}}`、 `{{fileName}}`、 `{{extension}}`、 `{{format}}`、 `{{dirPath}}`、 `{{componentFileName}}`、 `{{componentExtension}}`、 `{{componentFormat}}` などの動的変数を処理します。 `'my/{{var}}/path'` 形式の文字列または関数として設定できます。
249
+ - _注_: `./**/*` パスはコンポーネントを基準に解決されます。 `/**/*` パスは Intlayer の `baseDir` を基準に解決されます。
250
+ - _例_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
251
+
252
+ - **noMetadata**:
253
+ - _タイプ_: `boolean`
254
+ - _デフォルト_: `false`
255
+ - _説明_: メタデータをファイルに保存するかどうかを示します。trueの場合、コンパイラは辞書のメタデータ(キー、コンテンツラッパー)を保存しません。
256
+ - _注_: `loadJSON`プラグインを使用する場合に便利です。
257
+ - _例_: `true`の場合:
258
+ ```json
259
+ {
260
+ "key": "value"
261
+ }
262
+ ```
263
+ `false`の場合:
264
+ ```json
265
+ {
266
+ "key": "value",
267
+ "content": {
268
+ "key": "value"
269
+ }
270
+ }
271
+ ```
272
+
273
+ - **saveComponents**:
274
+ - _タイプ_: `boolean`
275
+ - _デフォルト_: `false`
276
+ - _説明_: 変換後にコンポーネントを保存するかどうかを示します。