@intlayer/docs 8.3.0-canary.4 → 8.3.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 (240) hide show
  1. package/docs/ar/compiler.md +84 -49
  2. package/docs/ar/configuration.md +80 -37
  3. package/docs/ar/intlayer_with_nextjs_16.md +174 -1
  4. package/docs/ar/intlayer_with_nextjs_compiler.md +174 -1
  5. package/docs/ar/intlayer_with_react_router_v7.md +224 -1
  6. package/docs/ar/intlayer_with_react_router_v7_fs_routes.md +225 -1
  7. package/docs/ar/intlayer_with_svelte_kit.md +175 -2
  8. package/docs/ar/intlayer_with_tanstack.md +176 -1
  9. package/docs/ar/intlayer_with_vite+preact.md +174 -1
  10. package/docs/ar/intlayer_with_vite+react.md +174 -1
  11. package/docs/ar/intlayer_with_vite+solid.md +174 -1
  12. package/docs/ar/intlayer_with_vite+svelte.md +174 -1
  13. package/docs/ar/intlayer_with_vite+vue.md +174 -1
  14. package/docs/de/compiler.md +83 -48
  15. package/docs/de/configuration.md +434 -212
  16. package/docs/de/intlayer_with_nextjs_16.md +176 -1
  17. package/docs/de/intlayer_with_nextjs_compiler.md +106 -349
  18. package/docs/de/intlayer_with_react_router_v7.md +225 -2
  19. package/docs/de/intlayer_with_react_router_v7_fs_routes.md +221 -79
  20. package/docs/de/intlayer_with_svelte_kit.md +158 -2
  21. package/docs/de/intlayer_with_tanstack.md +159 -1
  22. package/docs/de/intlayer_with_vite+preact.md +157 -1
  23. package/docs/de/intlayer_with_vite+react.md +157 -1
  24. package/docs/de/intlayer_with_vite+solid.md +159 -3
  25. package/docs/de/intlayer_with_vite+svelte.md +157 -1
  26. package/docs/de/intlayer_with_vite+vue.md +157 -1
  27. package/docs/en/compiler.md +60 -33
  28. package/docs/en/configuration.md +80 -57
  29. package/docs/en/intlayer_with_nextjs_16.md +176 -0
  30. package/docs/en/intlayer_with_nextjs_compiler.md +179 -1
  31. package/docs/en/intlayer_with_react_router_v7.md +159 -0
  32. package/docs/en/intlayer_with_react_router_v7_fs_routes.md +159 -0
  33. package/docs/en/intlayer_with_svelte_kit.md +159 -0
  34. package/docs/en/intlayer_with_tanstack.md +160 -1
  35. package/docs/en/intlayer_with_vite+preact.md +159 -0
  36. package/docs/en/intlayer_with_vite+react.md +159 -0
  37. package/docs/en/intlayer_with_vite+solid.md +148 -27
  38. package/docs/en/intlayer_with_vite+svelte.md +159 -0
  39. package/docs/en/intlayer_with_vite+vue.md +142 -41
  40. package/docs/en-GB/compiler.md +66 -34
  41. package/docs/en-GB/configuration.md +78 -36
  42. package/docs/es/compiler.md +83 -48
  43. package/docs/es/configuration.md +429 -206
  44. package/docs/es/intlayer_with_adonisjs.md +1 -1
  45. package/docs/es/intlayer_with_express.md +1 -1
  46. package/docs/es/intlayer_with_fastify.md +1 -1
  47. package/docs/es/intlayer_with_hono.md +1 -1
  48. package/docs/es/intlayer_with_nestjs.md +1 -1
  49. package/docs/es/intlayer_with_nextjs_16.md +176 -3
  50. package/docs/es/intlayer_with_nextjs_compiler.md +175 -2
  51. package/docs/es/intlayer_with_nuxt.md +1 -1
  52. package/docs/es/intlayer_with_react_router_v7.md +227 -4
  53. package/docs/es/intlayer_with_react_router_v7_fs_routes.md +162 -4
  54. package/docs/es/intlayer_with_svelte_kit.md +158 -2
  55. package/docs/es/intlayer_with_tanstack.md +160 -2
  56. package/docs/es/intlayer_with_vite+preact.md +162 -6
  57. package/docs/es/intlayer_with_vite+react.md +160 -4
  58. package/docs/es/intlayer_with_vite+solid.md +163 -7
  59. package/docs/es/intlayer_with_vite+svelte.md +157 -1
  60. package/docs/es/intlayer_with_vite+vue.md +165 -9
  61. package/docs/fr/compiler.md +81 -46
  62. package/docs/fr/configuration.md +355 -134
  63. package/docs/fr/intlayer_with_adonisjs.md +1 -1
  64. package/docs/fr/intlayer_with_express.md +1 -1
  65. package/docs/fr/intlayer_with_fastify.md +1 -1
  66. package/docs/fr/intlayer_with_hono.md +1 -1
  67. package/docs/fr/intlayer_with_nestjs.md +1 -1
  68. package/docs/fr/intlayer_with_nextjs_16.md +183 -7
  69. package/docs/fr/intlayer_with_nextjs_compiler.md +179 -3
  70. package/docs/fr/intlayer_with_react_router_v7.md +229 -3
  71. package/docs/fr/intlayer_with_react_router_v7_fs_routes.md +237 -6
  72. package/docs/fr/intlayer_with_svelte_kit.md +158 -2
  73. package/docs/fr/intlayer_with_tanstack.md +159 -1
  74. package/docs/fr/intlayer_with_vite+preact.md +164 -8
  75. package/docs/fr/intlayer_with_vite+react.md +162 -6
  76. package/docs/fr/intlayer_with_vite+solid.md +163 -7
  77. package/docs/fr/intlayer_with_vite+svelte.md +157 -1
  78. package/docs/fr/intlayer_with_vite+vue.md +164 -8
  79. package/docs/hi/compiler.md +81 -46
  80. package/docs/hi/configuration.md +87 -44
  81. package/docs/hi/intlayer_with_nextjs_16.md +174 -1
  82. package/docs/hi/intlayer_with_nextjs_compiler.md +174 -1
  83. package/docs/hi/intlayer_with_react_router_v7.md +224 -1
  84. package/docs/hi/intlayer_with_react_router_v7_fs_routes.md +225 -1
  85. package/docs/hi/intlayer_with_svelte_kit.md +158 -2
  86. package/docs/hi/intlayer_with_tanstack.md +159 -1
  87. package/docs/hi/intlayer_with_vite+preact.md +157 -1
  88. package/docs/hi/intlayer_with_vite+react.md +157 -1
  89. package/docs/hi/intlayer_with_vite+solid.md +157 -1
  90. package/docs/hi/intlayer_with_vite+svelte.md +157 -1
  91. package/docs/hi/intlayer_with_vite+vue.md +157 -1
  92. package/docs/id/compiler.md +84 -51
  93. package/docs/id/configuration.md +83 -45
  94. package/docs/id/intlayer_with_nextjs_16.md +174 -1
  95. package/docs/id/intlayer_with_nextjs_compiler.md +174 -1
  96. package/docs/id/intlayer_with_react_router_v7.md +224 -1
  97. package/docs/id/intlayer_with_react_router_v7_fs_routes.md +225 -1
  98. package/docs/id/intlayer_with_svelte_kit.md +158 -2
  99. package/docs/id/intlayer_with_tanstack.md +159 -1
  100. package/docs/id/intlayer_with_vite+preact.md +157 -1
  101. package/docs/id/intlayer_with_vite+react.md +157 -1
  102. package/docs/id/intlayer_with_vite+solid.md +157 -1
  103. package/docs/id/intlayer_with_vite+svelte.md +157 -1
  104. package/docs/id/intlayer_with_vite+vue.md +157 -1
  105. package/docs/it/compiler.md +81 -46
  106. package/docs/it/configuration.md +426 -204
  107. package/docs/it/intlayer_with_nextjs_16.md +174 -1
  108. package/docs/it/intlayer_with_nextjs_compiler.md +174 -1
  109. package/docs/it/intlayer_with_react_router_v7.md +225 -2
  110. package/docs/it/intlayer_with_react_router_v7_fs_routes.md +226 -2
  111. package/docs/it/intlayer_with_svelte_kit.md +158 -2
  112. package/docs/it/intlayer_with_tanstack.md +159 -1
  113. package/docs/it/intlayer_with_vite+preact.md +157 -1
  114. package/docs/it/intlayer_with_vite+react.md +157 -1
  115. package/docs/it/intlayer_with_vite+solid.md +159 -3
  116. package/docs/it/intlayer_with_vite+svelte.md +157 -1
  117. package/docs/it/intlayer_with_vite+vue.md +157 -1
  118. package/docs/ja/compiler.md +94 -58
  119. package/docs/ja/configuration.md +88 -45
  120. package/docs/ja/intlayer_with_nextjs_16.md +174 -1
  121. package/docs/ja/intlayer_with_nextjs_compiler.md +174 -1
  122. package/docs/ja/intlayer_with_react_router_v7.md +184 -394
  123. package/docs/ja/intlayer_with_react_router_v7_fs_routes.md +226 -2
  124. package/docs/ja/intlayer_with_svelte_kit.md +119 -595
  125. package/docs/ja/intlayer_with_tanstack.md +131 -642
  126. package/docs/ja/intlayer_with_vite+preact.md +111 -1231
  127. package/docs/ja/intlayer_with_vite+react.md +129 -1304
  128. package/docs/ja/intlayer_with_vite+solid.md +159 -3
  129. package/docs/ja/intlayer_with_vite+svelte.md +157 -1
  130. package/docs/ja/intlayer_with_vite+vue.md +157 -1
  131. package/docs/ko/compiler.md +88 -52
  132. package/docs/ko/configuration.md +87 -44
  133. package/docs/ko/intlayer_with_nextjs_16.md +174 -1
  134. package/docs/ko/intlayer_with_nextjs_compiler.md +174 -1
  135. package/docs/ko/intlayer_with_react_router_v7.md +225 -2
  136. package/docs/ko/intlayer_with_react_router_v7_fs_routes.md +226 -2
  137. package/docs/ko/intlayer_with_svelte_kit.md +158 -2
  138. package/docs/ko/intlayer_with_tanstack.md +159 -1
  139. package/docs/ko/intlayer_with_vite+preact.md +157 -1
  140. package/docs/ko/intlayer_with_vite+react.md +157 -1
  141. package/docs/ko/intlayer_with_vite+solid.md +159 -3
  142. package/docs/ko/intlayer_with_vite+svelte.md +157 -1
  143. package/docs/ko/intlayer_with_vite+vue.md +157 -1
  144. package/docs/pl/compiler.md +84 -51
  145. package/docs/pl/configuration.md +83 -37
  146. package/docs/pl/intlayer_with_nextjs_16.md +174 -1
  147. package/docs/pl/intlayer_with_nextjs_compiler.md +174 -1
  148. package/docs/pl/intlayer_with_react_router_v7.md +224 -1
  149. package/docs/pl/intlayer_with_react_router_v7_fs_routes.md +225 -1
  150. package/docs/pl/intlayer_with_svelte_kit.md +158 -2
  151. package/docs/pl/intlayer_with_tanstack.md +159 -1
  152. package/docs/pl/intlayer_with_vite+preact.md +157 -1
  153. package/docs/pl/intlayer_with_vite+react.md +157 -1
  154. package/docs/pl/intlayer_with_vite+solid.md +157 -1
  155. package/docs/pl/intlayer_with_vite+svelte.md +157 -1
  156. package/docs/pl/intlayer_with_vite+vue.md +157 -1
  157. package/docs/pt/compiler.md +81 -46
  158. package/docs/pt/configuration.md +404 -194
  159. package/docs/pt/intlayer_with_nextjs_16.md +174 -1
  160. package/docs/pt/intlayer_with_nextjs_compiler.md +174 -1
  161. package/docs/pt/intlayer_with_react_router_v7.md +224 -1
  162. package/docs/pt/intlayer_with_react_router_v7_fs_routes.md +225 -1
  163. package/docs/pt/intlayer_with_svelte_kit.md +158 -2
  164. package/docs/pt/intlayer_with_tanstack.md +159 -1
  165. package/docs/pt/intlayer_with_vite+preact.md +157 -1
  166. package/docs/pt/intlayer_with_vite+react.md +157 -1
  167. package/docs/pt/intlayer_with_vite+solid.md +157 -1
  168. package/docs/pt/intlayer_with_vite+svelte.md +157 -1
  169. package/docs/pt/intlayer_with_vite+vue.md +157 -1
  170. package/docs/ru/compiler.md +90 -57
  171. package/docs/ru/configuration.md +76 -46
  172. package/docs/ru/intlayer_with_nextjs_16.md +174 -1
  173. package/docs/ru/intlayer_with_nextjs_compiler.md +174 -1
  174. package/docs/ru/intlayer_with_react_router_v7.md +224 -1
  175. package/docs/ru/intlayer_with_react_router_v7_fs_routes.md +225 -1
  176. package/docs/ru/intlayer_with_svelte_kit.md +158 -2
  177. package/docs/ru/intlayer_with_tanstack.md +159 -1
  178. package/docs/ru/intlayer_with_vite+preact.md +157 -1
  179. package/docs/ru/intlayer_with_vite+react.md +157 -1
  180. package/docs/ru/intlayer_with_vite+solid.md +157 -1
  181. package/docs/ru/intlayer_with_vite+svelte.md +157 -1
  182. package/docs/ru/intlayer_with_vite+vue.md +157 -1
  183. package/docs/tr/compiler.md +85 -52
  184. package/docs/tr/configuration.md +83 -40
  185. package/docs/tr/intlayer_with_nextjs_16.md +174 -1
  186. package/docs/tr/intlayer_with_nextjs_compiler.md +174 -1
  187. package/docs/tr/intlayer_with_react_router_v7.md +224 -1
  188. package/docs/tr/intlayer_with_react_router_v7_fs_routes.md +225 -1
  189. package/docs/tr/intlayer_with_svelte_kit.md +158 -2
  190. package/docs/tr/intlayer_with_tanstack.md +159 -1
  191. package/docs/tr/intlayer_with_vite+preact.md +157 -1
  192. package/docs/tr/intlayer_with_vite+react.md +157 -1
  193. package/docs/tr/intlayer_with_vite+solid.md +157 -1
  194. package/docs/tr/intlayer_with_vite+svelte.md +157 -1
  195. package/docs/tr/intlayer_with_vite+vue.md +157 -1
  196. package/docs/uk/compiler.md +96 -61
  197. package/docs/uk/configuration.md +83 -37
  198. package/docs/uk/intlayer_with_nextjs_16.md +174 -1
  199. package/docs/uk/intlayer_with_nextjs_compiler.md +174 -1
  200. package/docs/uk/intlayer_with_react_router_v7.md +224 -1
  201. package/docs/uk/intlayer_with_react_router_v7_fs_routes.md +225 -1
  202. package/docs/uk/intlayer_with_svelte_kit.md +157 -1
  203. package/docs/uk/intlayer_with_tanstack.md +159 -1
  204. package/docs/uk/intlayer_with_vite+preact.md +157 -1
  205. package/docs/uk/intlayer_with_vite+react.md +157 -1
  206. package/docs/uk/intlayer_with_vite+solid.md +157 -1
  207. package/docs/uk/intlayer_with_vite+svelte.md +157 -1
  208. package/docs/uk/intlayer_with_vite+vue.md +157 -1
  209. package/docs/vi/compiler.md +85 -50
  210. package/docs/vi/configuration.md +85 -39
  211. package/docs/vi/intlayer_with_nextjs_16.md +174 -1
  212. package/docs/vi/intlayer_with_nextjs_compiler.md +174 -1
  213. package/docs/vi/intlayer_with_react_router_v7.md +224 -1
  214. package/docs/vi/intlayer_with_react_router_v7_fs_routes.md +225 -1
  215. package/docs/vi/intlayer_with_svelte_kit.md +158 -2
  216. package/docs/vi/intlayer_with_tanstack.md +159 -1
  217. package/docs/vi/intlayer_with_vite+preact.md +157 -1
  218. package/docs/vi/intlayer_with_vite+react.md +157 -1
  219. package/docs/vi/intlayer_with_vite+solid.md +157 -1
  220. package/docs/vi/intlayer_with_vite+svelte.md +157 -1
  221. package/docs/vi/intlayer_with_vite+vue.md +157 -1
  222. package/docs/zh/compiler.md +84 -49
  223. package/docs/zh/configuration.md +80 -37
  224. package/docs/zh/intlayer_with_adonisjs.md +1 -1
  225. package/docs/zh/intlayer_with_express.md +1 -1
  226. package/docs/zh/intlayer_with_fastify.md +1 -1
  227. package/docs/zh/intlayer_with_hono.md +1 -1
  228. package/docs/zh/intlayer_with_nestjs.md +1 -1
  229. package/docs/zh/intlayer_with_nextjs_16.md +174 -1
  230. package/docs/zh/intlayer_with_nextjs_compiler.md +174 -1
  231. package/docs/zh/intlayer_with_react_router_v7.md +227 -4
  232. package/docs/zh/intlayer_with_react_router_v7_fs_routes.md +228 -4
  233. package/docs/zh/intlayer_with_svelte_kit.md +158 -2
  234. package/docs/zh/intlayer_with_tanstack.md +159 -1
  235. package/docs/zh/intlayer_with_vite+preact.md +159 -3
  236. package/docs/zh/intlayer_with_vite+react.md +157 -1
  237. package/docs/zh/intlayer_with_vite+solid.md +161 -5
  238. package/docs/zh/intlayer_with_vite+svelte.md +157 -1
  239. package/docs/zh/intlayer_with_vite+vue.md +158 -2
  240. package/package.json +6 -6
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2025-04-18
3
- updatedAt: 2025-12-30
3
+ updatedAt: 2026-03-12
4
4
  title: Vite + Svelte i18n - Cara menerjemahkan aplikasi Svelte di 2026
5
5
  description: Temukan cara membuat situs web Vite dan Svelte Anda menjadi multibahasa. Ikuti dokumentasi untuk melakukan internasionalisasi (i18n) dan menerjemahkannya.
6
6
  keywords:
@@ -501,6 +501,162 @@ Untuk detail lebih lanjut tentang cara menggunakan ekstensi ini, lihat [dokument
501
501
 
502
502
  ---
503
503
 
504
+ ### (Opsional) Langkah 1 : Ekstrak konten komponen Anda
505
+
506
+ Jika Anda memiliki basis kode yang ada, mengubah ribuan file bisa memakan waktu lama.
507
+
508
+ Untuk memudahkan proses ini, Intlayer mengusulkan [compiler](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/compiler.md) / [extractor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/cli/extract.md) untuk mengubah komponen Anda dan mengekstrak kontennya.
509
+
510
+ Untuk mengaturnya, Anda dapat menambahkan bagian `compiler` di file `intlayer.config.ts` Anda:
511
+
512
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
513
+ import { type IntlayerConfig } from "intlayer";
514
+
515
+ const config: IntlayerConfig = {
516
+ // ... Sisa konfigurasi Anda
517
+ compiler: {
518
+ /**
519
+ * Menunjukkan apakah compiler harus diaktifkan.
520
+ */
521
+ enabled: true,
522
+
523
+ /**
524
+ * Menentukan jalur file output
525
+ */
526
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
527
+
528
+ /**
529
+ * Menunjukkan apakah komponen harus disimpan setelah diubah. Dengan begitu, compiler dapat dijalankan satu kali saja untuk mengubah aplikasi, lalu dapat dihapus.
530
+ */
531
+ saveComponents: false,
532
+
533
+ /**
534
+ * Prefiks kunci kamus
535
+ */
536
+ dictionaryKeyPrefix: "",
537
+ },
538
+ };
539
+
540
+ export default config;
541
+ ```
542
+
543
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
544
+ /** @type {import('intlayer').IntlayerConfig} */
545
+ const config = {
546
+ // ... Sisa konfigurasi Anda
547
+ compiler: {
548
+ /**
549
+ * Menunjukkan apakah compiler harus diaktifkan.
550
+ */
551
+ enabled: true,
552
+
553
+ /**
554
+ * Menentukan jalur file output
555
+ */
556
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
557
+
558
+ /**
559
+ * Menunjukkan apakah komponen harus disimpan setelah diubah. Dengan begitu, compiler dapat dijalankan satu kali saja untuk mengubah aplikasi, lalu dapat dihapus.
560
+ */
561
+ saveComponents: false,
562
+
563
+ /**
564
+ * Prefiks kunci kamus
565
+ */
566
+ dictionaryKeyPrefix: "",
567
+ },
568
+ };
569
+
570
+ export default config;
571
+ ```
572
+
573
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
574
+ /** @type {import('intlayer').IntlayerConfig} */
575
+ const config = {
576
+ // ... Sisa konfigurasi Anda
577
+ compiler: {
578
+ /**
579
+ * Menunjukkan apakah compiler harus diaktifkan.
580
+ */
581
+ enabled: true,
582
+
583
+ /**
584
+ * Menentukan jalur file output
585
+ */
586
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
587
+
588
+ /**
589
+ * Menunjukkan apakah komponen harus disimpan setelah diubah. Dengan begitu, compiler dapat dijalankan satu kali saja untuk mengubah aplikasi, lalu dapat dihapus.
590
+ */
591
+ saveComponents: false,
592
+
593
+ /**
594
+ * Prefiks kunci kamus
595
+ */
596
+ dictionaryKeyPrefix: "",
597
+ },
598
+ };
599
+
600
+ module.exports = config;
601
+ ```
602
+
603
+ <Tabs>
604
+ <Tab value='Perintah ekstrak'>
605
+
606
+ Jalankan extractor untuk mengubah komponen Anda dan mengekstrak kontennya
607
+
608
+ ```bash packageManager="npm"
609
+ npx intlayer extract
610
+ ```
611
+
612
+ ```bash packageManager="pnpm"
613
+ pnpm intlayer extract
614
+ ```
615
+
616
+ ```bash packageManager="yarn"
617
+ yarn intlayer extract
618
+ ```
619
+
620
+ ```bash packageManager="bun"
621
+ bunx intlayer extract
622
+ ```
623
+
624
+ </Tab>
625
+ <Tab value='Compiler Babel'>
626
+
627
+ Perbarui `vite.config.ts` Anda untuk menyertakan plugin `intlayerCompiler`:
628
+
629
+ ```ts fileName="vite.config.ts"
630
+ import { defineConfig } from "vite";
631
+ import { intlayer, intlayerCompiler } from "vite-intlayer";
632
+
633
+ export default defineConfig({
634
+ plugins: [
635
+ intlayer(),
636
+ intlayerCompiler(), // Menambahkan plugin compiler
637
+ ],
638
+ });
639
+ ```
640
+
641
+ ```bash packageManager="npm"
642
+ npm run build # Atau npm run dev
643
+ ```
644
+
645
+ ```bash packageManager="pnpm"
646
+ pnpm run build # Or pnpm run dev
647
+ ```
648
+
649
+ ```bash packageManager="yarn"
650
+ yarn build # Or yarn dev
651
+ ```
652
+
653
+ ```bash packageManager="bun"
654
+ bun run build # Or bun run dev
655
+ ```
656
+
657
+ </Tab>
658
+ </Tabs>
659
+
504
660
  ### Melangkah Lebih Jauh
505
661
 
506
662
  Untuk melangkah lebih jauh, Anda dapat mengimplementasikan [editor visual](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/intlayer_visual_editor.md) atau mengeksternalisasi konten Anda menggunakan [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/intlayer_CMS.md).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2025-04-18
3
- updatedAt: 2025-12-30
3
+ updatedAt: 2026-03-12
4
4
  title: Vite + Vue i18n - Cara menerjemahkan aplikasi Vue di 2026
5
5
  description: Temukan cara membuat situs web Vite dan Vue Anda menjadi multibahasa. Ikuti dokumentasi untuk melakukan internasionalisasi (i18n) dan menerjemahkannya.
6
6
  keywords:
@@ -1091,6 +1091,162 @@ Untuk informasi lebih lanjut tentang cara menggunakan ekstensi ini, lihat dokume
1091
1091
 
1092
1092
  ---
1093
1093
 
1094
+ ### (Opsional) Langkah 1 : Ekstrak konten komponen Anda
1095
+
1096
+ Jika Anda memiliki basis kode yang ada, mengubah ribuan file bisa memakan waktu lama.
1097
+
1098
+ Untuk memudahkan proses ini, Intlayer mengusulkan [compiler](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/compiler.md) / [extractor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/cli/extract.md) untuk mengubah komponen Anda dan mengekstrak kontennya.
1099
+
1100
+ Untuk mengaturnya, Anda dapat menambahkan bagian `compiler` di file `intlayer.config.ts` Anda:
1101
+
1102
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
1103
+ import { type IntlayerConfig } from "intlayer";
1104
+
1105
+ const config: IntlayerConfig = {
1106
+ // ... Sisa konfigurasi Anda
1107
+ compiler: {
1108
+ /**
1109
+ * Menunjukkan apakah compiler harus diaktifkan.
1110
+ */
1111
+ enabled: true,
1112
+
1113
+ /**
1114
+ * Menentukan jalur file output
1115
+ */
1116
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
1117
+
1118
+ /**
1119
+ * Menunjukkan apakah komponen harus disimpan setelah diubah. Dengan begitu, compiler dapat dijalankan satu kali saja untuk mengubah aplikasi, lalu dapat dihapus.
1120
+ */
1121
+ saveComponents: false,
1122
+
1123
+ /**
1124
+ * Prefiks kunci kamus
1125
+ */
1126
+ dictionaryKeyPrefix: "",
1127
+ },
1128
+ };
1129
+
1130
+ export default config;
1131
+ ```
1132
+
1133
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
1134
+ /** @type {import('intlayer').IntlayerConfig} */
1135
+ const config = {
1136
+ // ... Sisa konfigurasi Anda
1137
+ compiler: {
1138
+ /**
1139
+ * Menunjukkan apakah compiler harus diaktifkan.
1140
+ */
1141
+ enabled: true,
1142
+
1143
+ /**
1144
+ * Menentukan jalur file output
1145
+ */
1146
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
1147
+
1148
+ /**
1149
+ * Menunjukkan apakah komponen harus disimpan setelah diubah. Dengan begitu, compiler dapat dijalankan satu kali saja untuk mengubah aplikasi, lalu dapat dihapus.
1150
+ */
1151
+ saveComponents: false,
1152
+
1153
+ /**
1154
+ * Prefiks kunci kamus
1155
+ */
1156
+ dictionaryKeyPrefix: "",
1157
+ },
1158
+ };
1159
+
1160
+ export default config;
1161
+ ```
1162
+
1163
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
1164
+ /** @type {import('intlayer').IntlayerConfig} */
1165
+ const config = {
1166
+ // ... Sisa konfigurasi Anda
1167
+ compiler: {
1168
+ /**
1169
+ * Menunjukkan apakah compiler harus diaktifkan.
1170
+ */
1171
+ enabled: true,
1172
+
1173
+ /**
1174
+ * Menentukan jalur file output
1175
+ */
1176
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
1177
+
1178
+ /**
1179
+ * Menunjukkan apakah komponen harus disimpan setelah diubah. Dengan begitu, compiler dapat dijalankan satu kali saja untuk mengubah aplikasi, lalu dapat dihapus.
1180
+ */
1181
+ saveComponents: false,
1182
+
1183
+ /**
1184
+ * Prefiks kunci kamus
1185
+ */
1186
+ dictionaryKeyPrefix: "",
1187
+ },
1188
+ };
1189
+
1190
+ module.exports = config;
1191
+ ```
1192
+
1193
+ <Tabs>
1194
+ <Tab value='Perintah ekstrak'>
1195
+
1196
+ Jalankan extractor untuk mengubah komponen Anda dan mengekstrak kontennya
1197
+
1198
+ ```bash packageManager="npm"
1199
+ npx intlayer extract
1200
+ ```
1201
+
1202
+ ```bash packageManager="pnpm"
1203
+ pnpm intlayer extract
1204
+ ```
1205
+
1206
+ ```bash packageManager="yarn"
1207
+ yarn intlayer extract
1208
+ ```
1209
+
1210
+ ```bash packageManager="bun"
1211
+ bunx intlayer extract
1212
+ ```
1213
+
1214
+ </Tab>
1215
+ <Tab value='Compiler Babel'>
1216
+
1217
+ Perbarui `vite.config.ts` Anda untuk menyertakan plugin `intlayerCompiler`:
1218
+
1219
+ ```ts fileName="vite.config.ts"
1220
+ import { defineConfig } from "vite";
1221
+ import { intlayer, intlayerCompiler } from "vite-intlayer";
1222
+
1223
+ export default defineConfig({
1224
+ plugins: [
1225
+ intlayer(),
1226
+ intlayerCompiler(), // Menambahkan plugin compiler
1227
+ ],
1228
+ });
1229
+ ```
1230
+
1231
+ ```bash packageManager="npm"
1232
+ npm run build # Atau npm run dev
1233
+ ```
1234
+
1235
+ ```bash packageManager="pnpm"
1236
+ pnpm run build # Or pnpm run dev
1237
+ ```
1238
+
1239
+ ```bash packageManager="yarn"
1240
+ yarn build # Or yarn dev
1241
+ ```
1242
+
1243
+ ```bash packageManager="bun"
1244
+ bun run build # Or bun run dev
1245
+ ```
1246
+
1247
+ </Tab>
1248
+ </Tabs>
1249
+
1094
1250
  ### Melangkah Lebih Jauh
1095
1251
 
1096
1252
  Untuk melangkah lebih jauh, Anda dapat mengimplementasikan [editor visual](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/intlayer_visual_editor.md) atau mengeksternalisasi konten Anda menggunakan [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/intlayer_CMS.md).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2025-09-09
3
- updatedAt: 2026-03-10
3
+ updatedAt: 2026-03-12
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:
@@ -149,73 +149,85 @@ Questa configurazione garantisce che il contenuto dichiarato nei tuoi componenti
149
149
  See complete tutorial: [Intlayer Compiler with Next.js](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_nextjs_compiler.md)
150
150
 
151
151
  </Tab>
152
+ </Tabs>
152
153
 
153
154
  ### Configurazione personalizzata
154
155
 
155
156
  Per personalizzare il comportamento del compiler, puoi aggiornare il file `intlayer.config.ts` nella radice del tuo progetto.
156
157
 
157
- ```ts fileName="intlayer.config.ts"
158
+ ````ts fileName="intlayer.config.ts"
158
159
  import { type IntlayerConfig, Locales } from "intlayer";
159
160
 
160
161
  const config: IntlayerConfig = {
161
162
  compiler: {
162
163
  /**
164
+ * Indica se il compilatore deve essere abilitato.
163
165
  * Imposta su 'build-only' per saltare il compilatore durante lo sviluppo e accelerare i tempi di avvio.
164
166
  */
165
167
  enabled: true,
166
168
 
167
169
  /**
168
- * Pattern to traverse the code to optimize.
170
+ * Definisce il percorso dei file di output. Sostituisce `outputDir`.
171
+ *
172
+ * - I percorsi `./` sono risolti rispetto alla directory del componente.
173
+ * - I percorsi `/` sono risolti rispetto alla radice del progetto (`baseDir`).
174
+ *
175
+ * - L'inserimento della variabile `{{locale}}` nel percorso attiverà la generazione di dizionari separati per lingua.
176
+ *
177
+ * Esempio:
178
+ * ```ts
179
+ * {
180
+ * // Crea file .content.ts multilingue vicino al componente
181
+ * output: ({ fileName, extension }) => `./${fileName}${extension}`,
182
+ *
183
+ * // output: './{{fileName}}{{extension}}', // Equivalente usando una stringa template
184
+ * }
185
+ * ```
186
+ *
187
+ * ```ts
188
+ * {
189
+ * // Crea file JSON centralizzati per lingua nella radice del progetto
190
+ * output: ({ key, locale }) => `/locales/${locale}/${key}.content.json`,
191
+ *
192
+ * // output: '/locales/{{locale}}/{{key}}.content.json', // Equivalente usando una stringa template
193
+ * }
194
+ * ```
195
+ *
196
+ * Elenco variabili:
197
+ * - `fileName`: Il nome del file.
198
+ * - `key`: La chiave del contenuto.
199
+ * - `locale`: La lingua del contenuto.
200
+ * - `extension`: L'estensione del file.
201
+ * - `componentFileName`: Il nome del file del componente.
202
+ * - `componentExtension`: L'estensione del file del componente.
203
+ * - `format`: Il formato del dizionario.
204
+ * - `componentFormat`: Il formato del dizionario del componente.
205
+ * - `componentDirPath`: Il percorso della directory del componente.
169
206
  */
170
- transformPattern: [
171
- "**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}",
172
- "!**/node_modules/**",
173
- ],
207
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
174
208
 
175
209
  /**
176
- * Pattern to exclude from the optimization.
177
- */
178
- excludePattern: ["**/node_modules/**"],
179
-
180
- /**
181
- * Directory di output per i dizionari ottimizzati.
210
+ * Indica se i componenti devono essere salvati dopo essere stati trasformati.
211
+ * In questo modo, il compilatore può essere eseguito una sola volta per trasformare l'app e poi rimosso.
182
212
  */
183
- output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
213
+ saveComponents: false,
184
214
 
185
215
  /**
186
- * Inserisci solo il contenuto nel file generato, senza chiave.
216
+ * Inserisci solo il contenuto nel file generato. Utile per gli output JSON di i18next o ICU MessageFormat per lingua.
217
+ *
218
+ * - `output: ({ locale, key }) => `./locale/${locale}/${key}.json`,`
187
219
  */
188
220
  noMetadata: false,
189
221
 
190
222
  /**
191
223
  * Prefisso chiave dizionario
192
224
  */
193
- dictionaryKeyPrefix: "", // Remove base prefix
194
-
195
- /**
196
- * Indica se i componenti devono essere salvati dopo essere stati trasformati.
197
- * In questo modo, il compilatore può essere eseguito una sola volta per trasformare l'app e poi rimosso.
198
- */
199
- saveComponents: false,
225
+ dictionaryKeyPrefix: "", // Aggiungi un prefisso opzionale per le chiavi del dizionario estratte
200
226
  },
201
227
  };
202
228
 
203
229
  export default config;
204
- ```
205
-
206
- ### Riempire le traduzioni mancanti
207
-
208
- Intlayer fornisce uno strumento CLI per aiutarti a riempire le traduzioni mancanti. Puoi usare il comando `intlayer` per testare e riempire le traduzioni mancanti dal tuo codice.
209
-
210
- ```bash
211
- npx intlayer test # Testa se ci sono traduzioni mancanti
212
- ```
213
-
214
- ```bash
215
- npx intlayer fill # Riempi le traduzioni mancanti
216
- ```
217
-
218
- > Per maggiori dettagli, fare riferimento alla [documentazione CLI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/cli/ci.md)
230
+ ````
219
231
 
220
232
  ### Riferimento alla configurazione del compilatore
221
233
 
@@ -225,36 +237,37 @@ Le seguenti proprietà possono essere configurate nel blocco `compiler` del file
225
237
  - _Tipo_: `boolean | 'build-only'`
226
238
  - _Predefinito_: `true`
227
239
  - _Descrizione_: Indica se il compilatore deve essere abilitato.
240
+
228
241
  - **dictionaryKeyPrefix**:
229
242
  - _Tipo_: `string`
230
- - _Predefinito_: `'comp-'`
243
+ - _Predefinito_: `''`
231
244
  - _Descrizione_: Prefisso per le chiavi del dizionario estratte.
245
+
232
246
  - **transformPattern**:
233
247
  - _Tipo_: `string | string[]`
234
248
  - _Predefinito_: `['**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}', '!**/node_modules/**']`
235
- - _Descrizione_: Modelli per attraversare il codice da ottimizzare.
249
+ - _Descrizione_: (Deprecato: usa invece `build.traversePattern`) Modelli per attraversare il codice da ottimizzare.
250
+
236
251
  - **excludePattern**:
237
252
  - _Tipo_: `string | string[]`
238
253
  - _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.
254
+ - _Descrizione_: (Deprecato: usa invece `build.traversePattern`) Modelli da escludere dall'ottimizzazione.
244
255
 
245
256
  - **output**:
246
257
  - _Type_: `FilePathPattern`
247
258
  - _Default_: `({ key }) => 'compiler/${key}.content.json'`
248
259
  - _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
260
  - _Nota_: `./**/*` I percorsi sono risolti relativamente al componente. `/**/*` i percorsi sono risolti relativamente al `baseDir` di Intlayer.
261
+ - _Nota_: Se la lingua è impostata nel percorso, i dizionari verranno generati per lingua.
250
262
  - _Esempio_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
251
263
 
252
264
  - **noMetadata**:
253
265
  - _Tipo_: `boolean`
254
266
  - _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).
267
+ - _Descrizione_: Indica se i metadati devono essere salvati nel file. Se vero, il compilatore non salverà i metadatati dei dizionari (chiave, contenitore del contenuto). Utile per output JSON i18next o ICU MessageFormat per lingua.
256
268
  - _Nota_: Utile se utilizzato con il plugin `loadJSON`.
257
- - _Esempio_: Se `true`:
269
+ - _Esempio_:
270
+ Se `true`:
258
271
  ```json
259
272
  {
260
273
  "key": "value"
@@ -274,3 +287,25 @@ Le seguenti proprietà possono essere configurate nel blocco `compiler` del file
274
287
  - _Tipo_: `boolean`
275
288
  - _Predefinito_: `false`
276
289
  - _Descrizione_: Indica se i componenti devono essere salvati dopo essere stati trasformati.
290
+
291
+ ### Riempire le traduzioni mancanti
292
+
293
+ Intlayer fornisce uno strumento CLI per aiutarti a riempire le traduzioni mancanti. Puoi usare il comando `intlayer` per testare e riempire le traduzioni mancanti dal tuo codice.
294
+
295
+ ```bash
296
+ npx intlayer test # Testa se ci sono traduzioni mancanti
297
+ ```
298
+
299
+ ```bash
300
+ npx intlayer fill # Riempi le traduzioni mancanti
301
+ ```
302
+
303
+ ### Estrazione
304
+
305
+ Intlayer fornisce uno strumento CLI per estrarre contenuti dal tuo codice. Puoi usare il comando `intlayer extract` per estrarre i contenuti dal tuo codice.
306
+
307
+ ```bash
308
+ npx intlayer extract
309
+ ```
310
+
311
+ > Per maggiori dettagli, fare riferimento alla [documentazione CLI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/cli/index.md)