@intlayer/docs 8.2.4 → 8.3.0-canary.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) 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 +74 -27
  38. package/docs/ar/intlayer_with_nextjs_compiler.md +13 -5
  39. package/docs/ar/intlayer_with_tanstack.md +22 -1
  40. package/docs/ar/intlayer_with_vite+react_compiler.md +13 -5
  41. package/docs/de/compiler.md +74 -9
  42. package/docs/de/configuration.md +61 -22
  43. package/docs/de/intlayer_with_nextjs_compiler.md +12 -4
  44. package/docs/de/intlayer_with_tanstack.md +22 -1
  45. package/docs/de/intlayer_with_vite+react_compiler.md +12 -4
  46. package/docs/en/compiler.md +79 -1
  47. package/docs/en/configuration.md +50 -9
  48. package/docs/en/intlayer_with_nextjs_compiler.md +9 -1
  49. package/docs/en/intlayer_with_tanstack.md +23 -2
  50. package/docs/en/intlayer_with_vite+react_compiler.md +9 -1
  51. package/docs/en-GB/compiler.md +72 -6
  52. package/docs/en-GB/configuration.md +50 -10
  53. package/docs/en-GB/intlayer_with_nextjs_compiler.md +22 -3
  54. package/docs/en-GB/intlayer_with_tanstack.md +22 -1
  55. package/docs/en-GB/intlayer_with_vite+react_compiler.md +22 -3
  56. package/docs/es/compiler.md +71 -6
  57. package/docs/es/configuration.md +65 -26
  58. package/docs/es/intlayer_with_nextjs_compiler.md +9 -1
  59. package/docs/es/intlayer_with_tanstack.md +22 -1
  60. package/docs/es/intlayer_with_vite+react_compiler.md +9 -1
  61. package/docs/fr/compiler.md +69 -4
  62. package/docs/fr/configuration.md +62 -23
  63. package/docs/fr/intlayer_with_nextjs_compiler.md +9 -1
  64. package/docs/fr/intlayer_with_tanstack.md +22 -1
  65. package/docs/fr/intlayer_with_vite+react_compiler.md +9 -1
  66. package/docs/hi/compiler.md +74 -9
  67. package/docs/hi/configuration.md +70 -23
  68. package/docs/hi/intlayer_with_nextjs_compiler.md +15 -7
  69. package/docs/hi/intlayer_with_tanstack.md +22 -1
  70. package/docs/hi/intlayer_with_vite+react_compiler.md +15 -7
  71. package/docs/id/compiler.md +73 -8
  72. package/docs/id/configuration.md +67 -20
  73. package/docs/id/intlayer_with_nextjs_compiler.md +13 -5
  74. package/docs/id/intlayer_with_tanstack.md +22 -1
  75. package/docs/id/intlayer_with_vite+react_compiler.md +13 -5
  76. package/docs/it/compiler.md +73 -8
  77. package/docs/it/configuration.md +66 -27
  78. package/docs/it/intlayer_with_nextjs_compiler.md +12 -4
  79. package/docs/it/intlayer_with_tanstack.md +22 -1
  80. package/docs/it/intlayer_with_vite+react_compiler.md +12 -4
  81. package/docs/ja/compiler.md +75 -10
  82. package/docs/ja/configuration.md +70 -23
  83. package/docs/ja/intlayer_with_nextjs_compiler.md +13 -5
  84. package/docs/ja/intlayer_with_tanstack.md +22 -1
  85. package/docs/ja/intlayer_with_vite+react_compiler.md +13 -5
  86. package/docs/ko/compiler.md +75 -10
  87. package/docs/ko/configuration.md +70 -23
  88. package/docs/ko/intlayer_with_nextjs_compiler.md +22 -3
  89. package/docs/ko/intlayer_with_tanstack.md +22 -1
  90. package/docs/ko/intlayer_with_vite+react_compiler.md +22 -3
  91. package/docs/pl/compiler.md +73 -8
  92. package/docs/pl/configuration.md +71 -29
  93. package/docs/pl/intlayer_with_nextjs_compiler.md +13 -5
  94. package/docs/pl/intlayer_with_tanstack.md +22 -1
  95. package/docs/pl/intlayer_with_vite+react_compiler.md +13 -5
  96. package/docs/pt/compiler.md +74 -9
  97. package/docs/pt/configuration.md +62 -23
  98. package/docs/pt/intlayer_with_nextjs_compiler.md +12 -4
  99. package/docs/pt/intlayer_with_tanstack.md +22 -1
  100. package/docs/pt/intlayer_with_vite+react_compiler.md +12 -4
  101. package/docs/ru/compiler.md +74 -9
  102. package/docs/ru/configuration.md +61 -22
  103. package/docs/ru/intlayer_with_nextjs_compiler.md +11 -3
  104. package/docs/ru/intlayer_with_tanstack.md +22 -1
  105. package/docs/ru/intlayer_with_vite+react_compiler.md +11 -3
  106. package/docs/tr/compiler.md +73 -8
  107. package/docs/tr/configuration.md +77 -42
  108. package/docs/tr/intlayer_with_nextjs_compiler.md +11 -3
  109. package/docs/tr/intlayer_with_tanstack.md +22 -1
  110. package/docs/tr/intlayer_with_vite+react_compiler.md +11 -3
  111. package/docs/uk/compiler.md +74 -9
  112. package/docs/uk/configuration.md +207 -165
  113. package/docs/uk/intlayer_with_nextjs_compiler.md +13 -5
  114. package/docs/uk/intlayer_with_tanstack.md +22 -1
  115. package/docs/uk/intlayer_with_vite+react_compiler.md +13 -5
  116. package/docs/vi/compiler.md +75 -10
  117. package/docs/vi/configuration.md +97 -21
  118. package/docs/vi/intlayer_with_nextjs_compiler.md +14 -6
  119. package/docs/vi/intlayer_with_tanstack.md +22 -1
  120. package/docs/vi/intlayer_with_vite+react_compiler.md +14 -6
  121. package/docs/zh/compiler.md +75 -10
  122. package/docs/zh/configuration.md +77 -42
  123. package/docs/zh/intlayer_with_nextjs_compiler.md +13 -5
  124. package/docs/zh/intlayer_with_tanstack.md +22 -1
  125. package/docs/zh/intlayer_with_vite+react_compiler.md +13 -5
  126. package/package.json +17 -17
  127. package/src/blog.ts +1 -1
  128. package/src/common.ts +2 -1
  129. package/src/doc.ts +1 -1
  130. package/src/frequentQuestions.ts +1 -1
  131. package/src/generated/blog.entry.ts +1 -1
  132. package/src/generated/docs.entry.ts +1 -1
  133. package/src/generated/frequentQuestions.entry.ts +1 -1
  134. package/src/generated/legal.entry.ts +1 -1
  135. package/src/legal.ts +1 -1
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2024-08-13
3
- updatedAt: 2026-02-25
3
+ updatedAt: 2026-03-11
4
4
  title: Konfigurasi
5
5
  description: Pelajari cara mengonfigurasi Intlayer untuk aplikasi Anda. Pahami berbagai pengaturan dan opsi yang tersedia untuk menyesuaikan Intlayer sesuai kebutuhan Anda.
6
6
  keywords:
@@ -14,18 +14,24 @@ slugs:
14
14
  - concept
15
15
  - configuration
16
16
  history:
17
+ - version: 8.3.0
18
+ data: 2026-03-11
19
+ changes: Pindahkan 'baseDir' dari konfigurasi 'content' ke 'system'
20
+ - version: 8.2.0
21
+ date: 2026-03-09
22
+ changes: Perbarui opsi kompiler, tambahkan dukungan 'output' dan 'noMetadata'
17
23
  - version: 8.1.7
18
24
  date: 2026-02-25
19
25
  changes: Perbarui opsi kompiler
20
26
  - version: 8.0.6
21
27
  date: 2026-02-12
22
- changes: Add support for Open Router, Alibaba, Amazon, Google Vertex Bedrock, Fireworks, Groq, Hugging Face, and Together.ai providers
28
+ changes: Tambahkan dukungan untuk penyedia Open Router, Alibaba, Amazon, Google Vertex Bedrock, Fireworks, Groq, Hugging Face, dan Together.ai
23
29
  - version: 8.0.5
24
30
  date: 2026-02-06
25
31
  changes: Tambahkan `dataSerialization` ke konfigurasi AI
26
32
  - version: 8.0.0
27
33
  date: 2026-01-22
28
- changes: Move `importMode` build configuration to `dictionary` configuration.
34
+ changes: Pindahkan konfigurasi build importMode ke konfigurasi kamus.
29
35
  - version: 8.0.0
30
36
  date: 2026-01-18
31
37
  changes: Pisahkan konfigurasi sistem dari konfigurasi konten. Pindahkan jalur internal ke properti `system`. Tambahkan `codeDir` untuk memisahkan file konten dari transformasi kode.
@@ -437,7 +443,7 @@ const config: IntlayerConfig = {
437
443
  */
438
444
  compiler: {
439
445
  /**
440
- * Indicates if the compiler should be enabled.
446
+ * Menunjukkan apakah kompiler harus diaktifkan.
441
447
  */
442
448
  enabled: true,
443
449
 
@@ -455,18 +461,23 @@ const config: IntlayerConfig = {
455
461
  excludePattern: ["**/node_modules/**"],
456
462
 
457
463
  /**
458
- * Output directory for the optimized dictionaries.
464
+ * Direktori output untuk kamus yang dioptimalkan.
459
465
  */
460
- outputDir: "compiler",
466
+ output: ({ key }) => `compiler/${key}.content.json`,
461
467
 
462
468
  /**
463
- * Dictionary key prefix
469
+ * Masukkan konten saja dalam file yang dihasilkan, tanpa kunci.
470
+ */
471
+ noMetadata: false,
472
+
473
+ /**
474
+ * Awalan kunci kamus
464
475
  */
465
476
  dictionaryKeyPrefix: "", // Remove base prefix
466
477
 
467
478
  /**
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.
479
+ * Menunjukkan apakah komponen harus disimpan setelah ditransformasi.
480
+ * Dengan begitu, kompiler hanya perlu dijalankan sekali untuk mentransformasi aplikasi, lalu dapat dihapus.
470
481
  */
471
482
  saveComponents: false,
472
483
  },
@@ -851,13 +862,6 @@ Pengaturan terkait penanganan konten dalam aplikasi, termasuk nama direktori, ek
851
862
  - _Contoh_: `['.data.ts', '.data.js', '.data.json']`
852
863
  - _Catatan_: Menyesuaikan ekstensi file dapat membantu menghindari konflik.
853
864
 
854
- - **baseDir**:
855
- - _Tipe_: `string`
856
- - _Default_: `process.cwd()`
857
- - _Deskripsi_: Direktori dasar untuk proyek.
858
- - _Contoh_: `'/path/to/project'`
859
- - _Catatan_: Ini digunakan untuk menyelesaikan semua direktori terkait Intlayer.
860
-
861
865
  - **contentDir**:
862
866
  - _Tipe_: `string[]`
863
867
  - _Default_: `['.']`
@@ -914,6 +918,21 @@ Pengaturan terkait penanganan konten dalam aplikasi, termasuk nama direktori, ek
914
918
  - _Deskripsi_: Direktori yang dikecualikan dari pencarian konten.
915
919
  - _Catatan_: Pengaturan ini belum digunakan, tetapi direncanakan untuk implementasi di masa depan.
916
920
 
921
+ ---
922
+
923
+ ### Konfigurasi Sistem
924
+
925
+ Pengaturan terkait jalur internal dan hasil output Intlayer. Pengaturan ini biasanya bersifat internal dan tidak perlu diubah oleh pengguna.
926
+
927
+ #### Properti
928
+
929
+ - **baseDir**:
930
+ - _Tipe_: `string`
931
+ - _Default_: `process.cwd()`
932
+ - _Deskripsi_: Direktori dasar untuk proyek.
933
+ - _Contoh_: `'/path/to/project'`
934
+ - _Catatan_: Ini digunakan untuk menyelesaikan semua direktori terkait Intlayer.
935
+
917
936
  - **formatCommand**:
918
937
  - _Tipe_: `string`
919
938
  - _Default_: `undefined`
@@ -1082,7 +1101,7 @@ Opsi build berlaku untuk plugin `@intlayer/babel` dan `@intlayer/swc`.
1082
1101
  - _Catatan_: Pastikan semua kunci dideklarasikan secara statis dalam panggilan `useIntlayer`. Contoh: `useIntlayer('navbar')`.
1083
1102
 
1084
1103
  - **importMode**:
1085
- - _Note_: **Deprecated**: Use `dictionary.importMode` instead.
1104
+ - _Catatan_: **Deprecated**: Use `dictionary.importMode` instead.
1086
1105
  - _Tipe_: `'static' | 'dynamic' | 'fetch'`
1087
1106
  - _Default_: `'static'`
1088
1107
  - _Deskripsi_: Mengontrol bagaimana kamus diimpor.
@@ -1100,10 +1119,10 @@ Opsi build berlaku untuk plugin `@intlayer/babel` dan `@intlayer/swc`.
1100
1119
  - _Catatan_: Mode live akan menggunakan API sinkronisasi live untuk mengambil kamus. Jika panggilan API gagal, kamus akan diimpor secara dinamis sebagai mode "dynamic".
1101
1120
  - _Catatan_: Opsi ini tidak akan memengaruhi fungsi `getIntlayer`, `getDictionary`, `useDictionary`, `useDictionaryAsync` dan `useDictionaryDynamic`.
1102
1121
  - **checkTypes**:
1103
- - _Type_: `boolean`
1122
+ - _Tipe_: `boolean`
1104
1123
  - _Default_: `false`
1105
- - _Description_: Menunjukkan apakah build harus memeriksa tipe TypeScript dan mencatat kesalahan.
1106
- - _Note_: Hal ini dapat memperlambat proses build.
1124
+ - _Deskripsi_: Menunjukkan apakah build harus memeriksa tipe TypeScript dan mencatat kesalahan.
1125
+ - _Catatan_: Hal ini dapat memperlambat proses build.
1107
1126
 
1108
1127
  - **outputFormat**:
1109
1128
  - _Tipe_: `'esm' | 'cjs'`
@@ -1166,3 +1185,31 @@ Pengaturan yang mengontrol kompiler Intlayer, yang mengekstrak kamus langsung da
1166
1185
  - _Tipe_: `string`
1167
1186
  - _Default_: `'compiler'`
1168
1187
  - _Deskripsi_: Direktori tempat kamus yang diekstrak akan disimpan, relatif terhadap jalur dasar proyek Anda.
1188
+
1189
+ - **output**:
1190
+ - _Tipe_: `FilePathPattern`
1191
+ - _Default_: `({ key }) => 'compiler/${key}.content.json'`
1192
+ - _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.
1193
+ - _Catatan_: Jalur `./**/*` diselesaikan relatif terhadap komponen. Jalur `/**/*` diselesaikan relatif terhadap `baseDir` Intlayer.
1194
+ - _Contoh_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
1195
+
1196
+ - **noMetadata**:
1197
+ - _Tipe_: `boolean`
1198
+ - _Default_: `false`
1199
+ - _Deskripsi_: Menunjukkan apakah metadata harus disimpan dalam file. Jika benar, kompiler tidak akan menyimpan metadata kamus (kunci, pembungkus konten).
1200
+ - _Catatan_: Berguna jika digunakan dengan plugin `loadJSON`.
1201
+ - _Contoh_: Jika `true`:
1202
+ ```json
1203
+ {
1204
+ "key": "value"
1205
+ }
1206
+ ```
1207
+ Jika `false`:
1208
+ ```json
1209
+ {
1210
+ "key": "value",
1211
+ "content": {
1212
+ "key": "value"
1213
+ }
1214
+ }
1215
+ ```
@@ -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
  },
@@ -437,12 +437,33 @@ export const Route = createFileRoute("/{-$locale}/")({
437
437
  component: RouteComponent,
438
438
  head: ({ params }) => {
439
439
  const { locale } = params;
440
+ const path = "/"; // The path for this route
441
+
440
442
  const metaContent = getIntlayer("app", locale);
441
443
 
442
444
  return {
445
+ links: [
446
+ // Canonical link: Points to the current localized page
447
+ { rel: "canonical", href: getLocalizedUrl(path, locale) },
448
+
449
+ // Hreflang: Tell Google about all localized versions
450
+ ...localeMap(({ locale: mapLocale }) => ({
451
+ rel: "alternate",
452
+ hrefLang: mapLocale,
453
+ href: getLocalizedUrl(path, mapLocale),
454
+ })),
455
+
456
+ // x-default: For users in unmatched languages
457
+ // Define the default fallback locale (usually your primary language)
458
+ {
459
+ rel: "alternate",
460
+ hrefLang: "x-default",
461
+ href: getLocalizedUrl(path, defaultLocale),
462
+ },
463
+ ],
443
464
  meta: [
444
465
  { title: metaContent.title },
445
- { content: metaContent.meta.description, name: "description" },
466
+ { name: "description", content: metaContent.meta.description },
446
467
  ],
447
468
  };
448
469
  },
@@ -19,6 +19,9 @@ slugs:
19
19
  applicationTemplate: https://github.com/aymericzip/intlayer-vite-react-template
20
20
  youtubeVideo: https://www.youtube.com/watch?v=dS9L7uJeak4
21
21
  history:
22
+ - version: 8.2.0
23
+ date: 2026-03-09
24
+ changes: Update compiler options, add FilePathPattern support
22
25
  - version: 8.1.6
23
26
  date: 2026-02-23
24
27
  changes: 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-11
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,18 +14,24 @@ slugs:
14
14
  - concept
15
15
  - configuration
16
16
  history:
17
+ - version: 8.3.0
18
+ data: 2026-03-11
19
+ changes: Sposta 'baseDir' dalla configurazione 'content' alla configurazione 'system'
20
+ - version: 8.2.0
21
+ date: 2026-03-10
22
+ changes: Aggiorna le opzioni del compilatore, aggiungi il supporto per 'output' e 'noMetadata'
17
23
  - version: 8.1.7
18
24
  date: 2026-02-25
19
25
  changes: Aggiorna le opzioni del compilatore
20
26
  - version: 8.0.6
21
27
  date: 2026-02-12
22
- changes: Add support for Open Router, Alibaba, Amazon, Google Vertex Bedrock, Fireworks, Groq, Hugging Face, and Together.ai providers
28
+ changes: Aggiungi il supporto per i fornitori Open Router, Alibaba, Amazon, Google Vertex Bedrock, Fireworks, Groq, Hugging Face e Together.ai
23
29
  - version: 8.0.5
24
30
  date: 2026-02-06
25
31
  changes: Aggiungi `dataSerialization` alla configurazione AI
26
32
  - version: 8.0.0
27
33
  date: 2026-01-22
28
- changes: Move `importMode` build configuration to `dictionary` configuration.
34
+ changes: Sposta la configurazione di build importMode nella configurazione del dizionario.
29
35
  - version: 8.0.0
30
36
  date: 2026-01-18
31
37
  changes: Separare la configurazione del sistema dalla configurazione del contenuto. Spostare i percorsi interni alla proprietà `system`. Aggiungere `codeDir` per separare i file di contenuto dalla trasformazione del codice.
@@ -419,7 +425,7 @@ const config: IntlayerConfig = {
419
425
  */
420
426
  compiler: {
421
427
  /**
422
- * Indicates if the compiler should be enabled.
428
+ * Indica se il compilatore deve essere abilitato.
423
429
  */
424
430
  enabled: true,
425
431
 
@@ -437,18 +443,23 @@ const config: IntlayerConfig = {
437
443
  excludePattern: ["**/node_modules/**"],
438
444
 
439
445
  /**
440
- * Output directory for the optimized dictionaries.
446
+ * Directory di output per i dizionari ottimizzati.
441
447
  */
442
- outputDir: "compiler",
448
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
443
449
 
444
450
  /**
445
- * Dictionary key prefix
451
+ * Inserisci solo il contenuto nel file generato, senza chiave.
452
+ */
453
+ noMetadata: false,
454
+
455
+ /**
456
+ * Prefisso chiave dizionario
446
457
  */
447
458
  dictionaryKeyPrefix: "", // Remove base prefix
448
459
 
449
460
  /**
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.
461
+ * Indica se i componenti devono essere salvati dopo essere stati trasformati.
462
+ * In questo modo, il compilatore può essere eseguito una sola volta per trasformare l'app e poi rimosso.
452
463
  */
453
464
  saveComponents: false,
454
465
  },
@@ -704,7 +715,7 @@ Impostazioni relative alla gestione del contenuto all'interno dell'applicazione,
704
715
  #### Proprietà
705
716
 
706
717
  - **autoFill**:
707
- - _Tipo_: `boolean | string | { [key in Locales]?: string }`
718
+ - _Tipo_: `boolean | string | FilePathPattern | { [key in Locales]?: string }`
708
719
  - _Predefinito_: `undefined`
709
720
  - _Descrizione_: Indica come il contenuto dovrebbe essere compilato automaticamente usando l'IA. Può essere dichiarato globalmente nel file `intlayer.config.ts`.
710
721
  - _Esempio_: true
@@ -727,13 +738,6 @@ Impostazioni relative alla gestione del contenuto all'interno dell'applicazione,
727
738
  - _Esempio_: `['.data.ts', '.data.js', '.data.json']`
728
739
  - _Nota_: Personalizzare le estensioni dei file può aiutare a evitare conflitti.
729
740
 
730
- - **baseDir**:
731
- - _Tipo_: `string`
732
- - _Predefinito_: `process.cwd()`
733
- - _Descrizione_: La directory base per il progetto.
734
- - _Esempio_: `'/path/to/project'`
735
- - _Nota_: Viene utilizzata per risolvere tutte le directory relative a Intlayer.
736
-
737
741
  - **contentDir**:
738
742
  - _Tipo_: `string[]`
739
743
  - _Predefinito_: `['.']`
@@ -772,6 +776,13 @@ Impostazioni relative ai percorsi interni e ai risultati di output di Intlayer.
772
776
 
773
777
  #### Proprietà
774
778
 
779
+ - **baseDir**:
780
+ - _Tipo_: `string`
781
+ - _Predefinito_: `process.cwd()`
782
+ - _Descrizione_: La directory base per il progetto.
783
+ - _Esempio_: `'/path/to/project'`
784
+ - _Nota_: Viene utilizzata per risolvere tutte le directory relative a Intlayer.
785
+
775
786
  - **dictionariesDir**:
776
787
  - _Tipo_: `string`
777
788
  - _Predefinito_: `'.intlayer/dictionary'`
@@ -832,11 +843,11 @@ Per ulteriori informazioni sui file di dichiarazione del contenuto e su come ven
832
843
  - **locale**
833
844
  - **location**
834
845
  - **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'`
846
+ - _Nota_: **Deprecated**: Use `dictionary.importMode` instead.
847
+ - _Tipo_: `'static' | 'dynamic' | 'fetch'`
848
+ - _Predefinito_: `'static'`
849
+ - _Descrizione_: Controls how dictionaries are imported.
850
+ - _Esempio_: `'dynamic'`
840
851
  - **priority**
841
852
  - **live**
842
853
  - **schema**
@@ -968,10 +979,10 @@ Le opzioni di build si applicano ai plugin `@intlayer/babel` e `@intlayer/swc`.
968
979
  - _Nota_: Può essere utilizzato per disabilitare la build dei dizionari, ad esempio quando l'esecuzione in un ambiente Node.js dovrebbe essere evitata.
969
980
 
970
981
  - **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.
982
+ - _Tipo_: `boolean`
983
+ - _Predefinito_: `false`
984
+ - _Descrizione_: Indica se la build deve controllare i tipi TypeScript e registrare gli errori.
985
+ - _Nota_: Questo può rallentare la build.
975
986
 
976
987
  - **optimize**:
977
988
  - _Tipo_: `boolean`
@@ -984,7 +995,7 @@ Le opzioni di build si applicano ai plugin `@intlayer/babel` e `@intlayer/swc`.
984
995
  - _Nota_: Assicurarsi che tutte le chiavi siano dichiarate staticamente nelle chiamate a `useIntlayer`. Es. `useIntlayer('navbar')`.
985
996
 
986
997
  - **importMode**:
987
- - _Note_: **Deprecated**: Use `dictionary.importMode` instead.
998
+ - _Nota_: **Deprecated**: Use `dictionary.importMode` instead.
988
999
  - _Tipo_: `'static' | 'dynamic' | 'fetch'`
989
1000
  - _Predefinito_: `'static'`
990
1001
  - _Descrizione_: Controlla come vengono importati i dizionari.
@@ -1063,3 +1074,31 @@ Impostazioni che controllano il compilatore Intlayer, che estrae i dizionari dir
1063
1074
  - _Tipo_: `string`
1064
1075
  - _Predefinito_: `'compiler'`
1065
1076
  - _Descrizione_: La directory in cui verranno memorizzati i dizionari estratti, relativa al percorso di base del progetto.
1077
+
1078
+ - **output**:
1079
+ - _Type_: `FilePathPattern`
1080
+ - _Default_: `({ key }) => 'compiler/${key}.content.json'`
1081
+ - _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.
1082
+ - _Nota_: `./**/*` I percorsi sono risolti relativamente al componente. `/**/*` i percorsi sono risolti relativamente al `baseDir` di Intlayer.
1083
+ - _Esempio_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
1084
+
1085
+ - **noMetadata**:
1086
+ - _Tipo_: `boolean`
1087
+ - _Predefinito_: `false`
1088
+ - _Descrizione_: Indica se i metadati devono essere salvati nel file. Se vero, il compilatore non salverà i metadatati dei dizionari (chiave, contenitore del contenuto).
1089
+ - _Nota_: Utile se utilizzato con il plugin `loadJSON`.
1090
+ - _Esempio_: Se `true`:
1091
+ ```json
1092
+ {
1093
+ "key": "value"
1094
+ }
1095
+ ```
1096
+ Se `false`:
1097
+ ```json
1098
+ {
1099
+ "key": "value",
1100
+ "content": {
1101
+ "key": "value"
1102
+ }
1103
+ }
1104
+ ```
@@ -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
  },
@@ -437,12 +437,33 @@ export const Route = createFileRoute("/{-$locale}/")({
437
437
  component: RouteComponent,
438
438
  head: ({ params }) => {
439
439
  const { locale } = params;
440
+ const path = "/"; // The path for this route
441
+
440
442
  const metaContent = getIntlayer("app", locale);
441
443
 
442
444
  return {
445
+ links: [
446
+ // Canonical link: Points to the current localized page
447
+ { rel: "canonical", href: getLocalizedUrl(path, locale) },
448
+
449
+ // Hreflang: Tell Google about all localized versions
450
+ ...localeMap(({ locale: mapLocale }) => ({
451
+ rel: "alternate",
452
+ hrefLang: mapLocale,
453
+ href: getLocalizedUrl(path, mapLocale),
454
+ })),
455
+
456
+ // x-default: For users in unmatched languages
457
+ // Define the default fallback locale (usually your primary language)
458
+ {
459
+ rel: "alternate",
460
+ hrefLang: "x-default",
461
+ href: getLocalizedUrl(path, defaultLocale),
462
+ },
463
+ ],
443
464
  meta: [
444
465
  { title: metaContent.title },
445
- { content: metaContent.meta.description, name: "description" },
466
+ { name: "description", content: metaContent.meta.description },
446
467
  ],
447
468
  };
448
469
  },