@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
@@ -530,6 +530,165 @@ export default defineConfig({
530
530
  });
531
531
  ```
532
532
 
533
+ ### (Optional) Step 12: Extract the content of your components
534
+
535
+ If you have an existing codebase, transforming thousands of files can be time-consuming.
536
+
537
+ To ease this process, Intlayer propose a [compiler](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/compiler.md) / [extractor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/cli/extract.md) to transform your components and extract the content.
538
+
539
+ To set it up, you can add a `compiler` section in your `intlayer.config.ts` file:
540
+
541
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
542
+ import { type IntlayerConfig } from "intlayer";
543
+
544
+ const config: IntlayerConfig = {
545
+ // ... Rest of your config
546
+ compiler: {
547
+ /**
548
+ * Indicates if the compiler should be enabled.
549
+ */
550
+ enabled: true,
551
+
552
+ /**
553
+ * Defines the output files path
554
+ */
555
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
556
+
557
+ /**
558
+ * Indicates if the components should be saved after being transformed.
559
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
560
+ */
561
+ saveComponents: false,
562
+
563
+ /**
564
+ * Dictionary key prefix
565
+ */
566
+ dictionaryKeyPrefix: "",
567
+ },
568
+ };
569
+
570
+ export default config;
571
+ ```
572
+
573
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
574
+ /** @type {import('intlayer').IntlayerConfig} */
575
+ const config = {
576
+ // ... Rest of your config
577
+ compiler: {
578
+ /**
579
+ * Indicates if the compiler should be enabled.
580
+ */
581
+ enabled: true,
582
+
583
+ /**
584
+ * Defines the output files path
585
+ */
586
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
587
+
588
+ /**
589
+ * Indicates if the components should be saved after being transformed.
590
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
591
+ */
592
+ saveComponents: false,
593
+
594
+ /**
595
+ * Dictionary key prefix
596
+ */
597
+ dictionaryKeyPrefix: "",
598
+ },
599
+ };
600
+
601
+ export default config;
602
+ ```
603
+
604
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
605
+ /** @type {import('intlayer').IntlayerConfig} */
606
+ const config = {
607
+ // ... Rest of your config
608
+ compiler: {
609
+ /**
610
+ * Indicates if the compiler should be enabled.
611
+ */
612
+ enabled: true,
613
+
614
+ /**
615
+ * Defines the output files path
616
+ */
617
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
618
+
619
+ /**
620
+ * Indicates if the components should be saved after being transformed.
621
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
622
+ */
623
+ saveComponents: false,
624
+
625
+ /**
626
+ * Dictionary key prefix
627
+ */
628
+ dictionaryKeyPrefix: "",
629
+ },
630
+ };
631
+
632
+ module.exports = config;
633
+ ```
634
+
635
+ <Tabs>
636
+ <Tab value='Extract command'>
637
+
638
+ Run the extractor to transform your components and extract the content
639
+
640
+ ```bash packageManager="npm"
641
+ npx intlayer extract
642
+ ```
643
+
644
+ ```bash packageManager="pnpm"
645
+ pnpm intlayer extract
646
+ ```
647
+
648
+ ```bash packageManager="yarn"
649
+ yarn intlayer extract
650
+ ```
651
+
652
+ ```bash packageManager="bun"
653
+ bunx intlayer extract
654
+ ```
655
+
656
+ </Tab>
657
+ <Tab value='Babel compiler'>
658
+
659
+ Update your `vite.config.ts` to include the `intlayerCompiler` plugin:
660
+
661
+ ```ts fileName="vite.config.ts"
662
+ import { defineConfig } from "vite";
663
+ import { intlayer, intlayerCompiler } from "vite-intlayer";
664
+
665
+ export default defineConfig({
666
+ plugins: [
667
+ intlayer(),
668
+ intlayerCompiler(), // Adds the compiler plugin
669
+ ],
670
+ });
671
+ ```
672
+
673
+ ```bash packageManager="npm"
674
+ npm run build # Or npm run dev
675
+ ```
676
+
677
+ ```bash packageManager="pnpm"
678
+ pnpm run build # Or pnpm run dev
679
+ ```
680
+
681
+ ```bash packageManager="yarn"
682
+ yarn build # Or yarn dev
683
+ ```
684
+
685
+ ```bash packageManager="bun"
686
+ bun run build # Or bun run dev
687
+ ```
688
+
689
+ </Tab>
690
+ </Tabs>
691
+
533
692
  ---
534
693
 
535
694
  ## Configure TypeScript
@@ -593,6 +593,165 @@ export default defineConfig({
593
593
  });
594
594
  ```
595
595
 
596
+ ### (Optional) Step 11: Extract the content of your components
597
+
598
+ If you have an existing codebase, transforming thousands of files can be time-consuming.
599
+
600
+ To ease this process, Intlayer propose a [compiler](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/compiler.md) / [extractor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/cli/extract.md) to transform your components and extract the content.
601
+
602
+ To set it up, you can add a `compiler` section in your `intlayer.config.ts` file:
603
+
604
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
605
+ import { type IntlayerConfig } from "intlayer";
606
+
607
+ const config: IntlayerConfig = {
608
+ // ... Rest of your config
609
+ compiler: {
610
+ /**
611
+ * Indicates if the compiler should be enabled.
612
+ */
613
+ enabled: true,
614
+
615
+ /**
616
+ * Defines the output files path
617
+ */
618
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
619
+
620
+ /**
621
+ * Indicates if the components should be saved after being transformed.
622
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
623
+ */
624
+ saveComponents: false,
625
+
626
+ /**
627
+ * Dictionary key prefix
628
+ */
629
+ dictionaryKeyPrefix: "",
630
+ },
631
+ };
632
+
633
+ export default config;
634
+ ```
635
+
636
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
637
+ /** @type {import('intlayer').IntlayerConfig} */
638
+ const config = {
639
+ // ... Rest of your config
640
+ compiler: {
641
+ /**
642
+ * Indicates if the compiler should be enabled.
643
+ */
644
+ enabled: true,
645
+
646
+ /**
647
+ * Defines the output files path
648
+ */
649
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
650
+
651
+ /**
652
+ * Indicates if the components should be saved after being transformed.
653
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
654
+ */
655
+ saveComponents: false,
656
+
657
+ /**
658
+ * Dictionary key prefix
659
+ */
660
+ dictionaryKeyPrefix: "",
661
+ },
662
+ };
663
+
664
+ export default config;
665
+ ```
666
+
667
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
668
+ /** @type {import('intlayer').IntlayerConfig} */
669
+ const config = {
670
+ // ... Rest of your config
671
+ compiler: {
672
+ /**
673
+ * Indicates if the compiler should be enabled.
674
+ */
675
+ enabled: true,
676
+
677
+ /**
678
+ * Defines the output files path
679
+ */
680
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
681
+
682
+ /**
683
+ * Indicates if the components should be saved after being transformed.
684
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
685
+ */
686
+ saveComponents: false,
687
+
688
+ /**
689
+ * Dictionary key prefix
690
+ */
691
+ dictionaryKeyPrefix: "",
692
+ },
693
+ };
694
+
695
+ module.exports = config;
696
+ ```
697
+
698
+ <Tabs>
699
+ <Tab value='Extract command'>
700
+
701
+ Run the extractor to transform your components and extract the content
702
+
703
+ ```bash packageManager="npm"
704
+ npx intlayer extract
705
+ ```
706
+
707
+ ```bash packageManager="pnpm"
708
+ pnpm intlayer extract
709
+ ```
710
+
711
+ ```bash packageManager="yarn"
712
+ yarn intlayer extract
713
+ ```
714
+
715
+ ```bash packageManager="bun"
716
+ bunx intlayer extract
717
+ ```
718
+
719
+ </Tab>
720
+ <Tab value='Babel compiler'>
721
+
722
+ Update your `vite.config.ts` to include the `intlayerCompiler` plugin:
723
+
724
+ ```ts fileName="vite.config.ts"
725
+ import { defineConfig } from "vite";
726
+ import { intlayer, intlayerCompiler } from "vite-intlayer";
727
+
728
+ export default defineConfig({
729
+ plugins: [
730
+ intlayer(),
731
+ intlayerCompiler(), // Adds the compiler plugin
732
+ ],
733
+ });
734
+ ```
735
+
736
+ ```bash packageManager="npm"
737
+ npm run build # Or npm run dev
738
+ ```
739
+
740
+ ```bash packageManager="pnpm"
741
+ pnpm run build # Or pnpm run dev
742
+ ```
743
+
744
+ ```bash packageManager="yarn"
745
+ yarn build # Or yarn dev
746
+ ```
747
+
748
+ ```bash packageManager="bun"
749
+ bun run build # Or bun run dev
750
+ ```
751
+
752
+ </Tab>
753
+ </Tabs>
754
+
596
755
  ---
597
756
 
598
757
  ## Configure TypeScript
@@ -561,6 +561,165 @@ To be able to visualize the intlayer editor selector, you will have to use the c
561
561
  </div>
562
562
  ```
563
563
 
564
+ ### (Optional) Step 12: Extract the content of your components
565
+
566
+ If you have an existing codebase, transforming thousands of files can be time-consuming.
567
+
568
+ To ease this process, Intlayer propose a [compiler](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/compiler.md) / [extractor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/cli/extract.md) to transform your components and extract the content.
569
+
570
+ To set it up, you can add a `compiler` section in your `intlayer.config.ts` file:
571
+
572
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
573
+ import { type IntlayerConfig } from "intlayer";
574
+
575
+ const config: IntlayerConfig = {
576
+ // ... Rest of your config
577
+ compiler: {
578
+ /**
579
+ * Indicates if the compiler should be enabled.
580
+ */
581
+ enabled: true,
582
+
583
+ /**
584
+ * Defines the output files path
585
+ */
586
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
587
+
588
+ /**
589
+ * Indicates if the components should be saved after being transformed.
590
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
591
+ */
592
+ saveComponents: false,
593
+
594
+ /**
595
+ * Dictionary key prefix
596
+ */
597
+ dictionaryKeyPrefix: "",
598
+ },
599
+ };
600
+
601
+ export default config;
602
+ ```
603
+
604
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
605
+ /** @type {import('intlayer').IntlayerConfig} */
606
+ const config = {
607
+ // ... Rest of your config
608
+ compiler: {
609
+ /**
610
+ * Indicates if the compiler should be enabled.
611
+ */
612
+ enabled: true,
613
+
614
+ /**
615
+ * Defines the output files path
616
+ */
617
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
618
+
619
+ /**
620
+ * Indicates if the components should be saved after being transformed.
621
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
622
+ */
623
+ saveComponents: false,
624
+
625
+ /**
626
+ * Dictionary key prefix
627
+ */
628
+ dictionaryKeyPrefix: "",
629
+ },
630
+ };
631
+
632
+ export default config;
633
+ ```
634
+
635
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
636
+ /** @type {import('intlayer').IntlayerConfig} */
637
+ const config = {
638
+ // ... Rest of your config
639
+ compiler: {
640
+ /**
641
+ * Indicates if the compiler should be enabled.
642
+ */
643
+ enabled: true,
644
+
645
+ /**
646
+ * Defines the output files path
647
+ */
648
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
649
+
650
+ /**
651
+ * Indicates if the components should be saved after being transformed.
652
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
653
+ */
654
+ saveComponents: false,
655
+
656
+ /**
657
+ * Dictionary key prefix
658
+ */
659
+ dictionaryKeyPrefix: "",
660
+ },
661
+ };
662
+
663
+ module.exports = config;
664
+ ```
665
+
666
+ <Tabs>
667
+ <Tab value='Extract command'>
668
+
669
+ Run the extractor to transform your components and extract the content
670
+
671
+ ```bash packageManager="npm"
672
+ npx intlayer extract
673
+ ```
674
+
675
+ ```bash packageManager="pnpm"
676
+ pnpm intlayer extract
677
+ ```
678
+
679
+ ```bash packageManager="yarn"
680
+ yarn intlayer extract
681
+ ```
682
+
683
+ ```bash packageManager="bun"
684
+ bunx intlayer extract
685
+ ```
686
+
687
+ </Tab>
688
+ <Tab value='Babel compiler'>
689
+
690
+ Update your `vite.config.ts` to include the `intlayerCompiler` plugin:
691
+
692
+ ```ts fileName="vite.config.ts"
693
+ import { defineConfig } from "vite";
694
+ import { intlayer, intlayerCompiler } from "vite-intlayer";
695
+
696
+ export default defineConfig({
697
+ plugins: [
698
+ intlayer(),
699
+ intlayerCompiler(), // Adds the compiler plugin
700
+ ],
701
+ });
702
+ ```
703
+
704
+ ```bash packageManager="npm"
705
+ npm run build # Or npm run dev
706
+ ```
707
+
708
+ ```bash packageManager="pnpm"
709
+ pnpm run build # Or pnpm run dev
710
+ ```
711
+
712
+ ```bash packageManager="yarn"
713
+ yarn build # Or yarn dev
714
+ ```
715
+
716
+ ```bash packageManager="bun"
717
+ bun run build # Or bun run dev
718
+ ```
719
+
720
+ </Tab>
721
+ </Tabs>
722
+
564
723
  ### Git Configuration
565
724
 
566
725
  It is recommended to ignore the files generated by Intlayer.
@@ -753,9 +753,168 @@ export const Route = createFileRoute("/{-$locale}/$")({
753
753
  });
754
754
  ```
755
755
 
756
+ ### (Optional) Step 15: Extract the content of your components
757
+
758
+ If you have an existing codebase, transforming thousands of files can be time-consuming.
759
+
760
+ To ease this process, Intlayer propose a [compiler](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/compiler.md) / [extractor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/cli/extract.md) to transform your components and extract the content.
761
+
762
+ To set it up, you can add a `compiler` section in your `intlayer.config.ts` file:
763
+
764
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
765
+ import { type IntlayerConfig } from "intlayer";
766
+
767
+ const config: IntlayerConfig = {
768
+ // ... Rest of your config
769
+ compiler: {
770
+ /**
771
+ * Indicates if the compiler should be enabled.
772
+ */
773
+ enabled: true,
774
+
775
+ /**
776
+ * Defines the output files path
777
+ */
778
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
779
+
780
+ /**
781
+ * Indicates if the components should be saved after being transformed.
782
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
783
+ */
784
+ saveComponents: false,
785
+
786
+ /**
787
+ * Dictionary key prefix
788
+ */
789
+ dictionaryKeyPrefix: "",
790
+ },
791
+ };
792
+
793
+ export default config;
794
+ ```
795
+
796
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
797
+ /** @type {import('intlayer').IntlayerConfig} */
798
+ const config = {
799
+ // ... Rest of your config
800
+ compiler: {
801
+ /**
802
+ * Indicates if the compiler should be enabled.
803
+ */
804
+ enabled: true,
805
+
806
+ /**
807
+ * Defines the output files path
808
+ */
809
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
810
+
811
+ /**
812
+ * Indicates if the components should be saved after being transformed.
813
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
814
+ */
815
+ saveComponents: false,
816
+
817
+ /**
818
+ * Dictionary key prefix
819
+ */
820
+ dictionaryKeyPrefix: "",
821
+ },
822
+ };
823
+
824
+ export default config;
825
+ ```
826
+
827
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
828
+ /** @type {import('intlayer').IntlayerConfig} */
829
+ const config = {
830
+ // ... Rest of your config
831
+ compiler: {
832
+ /**
833
+ * Indicates if the compiler should be enabled.
834
+ */
835
+ enabled: true,
836
+
837
+ /**
838
+ * Defines the output files path
839
+ */
840
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
841
+
842
+ /**
843
+ * Indicates if the components should be saved after being transformed.
844
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
845
+ */
846
+ saveComponents: false,
847
+
848
+ /**
849
+ * Dictionary key prefix
850
+ */
851
+ dictionaryKeyPrefix: "",
852
+ },
853
+ };
854
+
855
+ module.exports = config;
856
+ ```
857
+
858
+ <Tabs>
859
+ <Tab value='Extract command'>
860
+
861
+ Run the extractor to transform your components and extract the content
862
+
863
+ ```bash packageManager="npm"
864
+ npx intlayer extract
865
+ ```
866
+
867
+ ```bash packageManager="pnpm"
868
+ pnpm intlayer extract
869
+ ```
870
+
871
+ ```bash packageManager="yarn"
872
+ yarn intlayer extract
873
+ ```
874
+
875
+ ```bash packageManager="bun"
876
+ bunx intlayer extract
877
+ ```
878
+
879
+ </Tab>
880
+ <Tab value='Babel compiler'>
881
+
882
+ Update your `vite.config.ts` to include the `intlayerCompiler` plugin:
883
+
884
+ ```ts fileName="vite.config.ts"
885
+ import { defineConfig } from "vite";
886
+ import { intlayer, intlayerCompiler } from "vite-intlayer";
887
+
888
+ export default defineConfig({
889
+ plugins: [
890
+ intlayer(),
891
+ intlayerCompiler(), // Adds the compiler plugin
892
+ ],
893
+ });
894
+ ```
895
+
896
+ ```bash packageManager="npm"
897
+ npm run build # Or npm run dev
898
+ ```
899
+
900
+ ```bash packageManager="pnpm"
901
+ pnpm run build # Or pnpm run dev
902
+ ```
903
+
904
+ ```bash packageManager="yarn"
905
+ yarn build # Or yarn dev
906
+ ```
907
+
908
+ ```bash packageManager="bun"
909
+ bun run build # Or bun run dev
910
+ ```
911
+
912
+ </Tab>
913
+ </Tabs>
914
+
756
915
  ---
757
916
 
758
- ### Step 15: Configure TypeScript (Optional)
917
+ ### Step 16: Configure TypeScript (Optional)
759
918
 
760
919
  Intlayer uses module augmentation to get benefits of TypeScript and make your codebase stronger.
761
920