@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
@@ -1316,6 +1316,165 @@ return (
1316
1316
  );
1317
1317
  ```
1318
1318
 
1319
+ ### (Optional) Step 12: Extract the content of your components
1320
+
1321
+ If you have an existing codebase, transforming thousands of files can be time-consuming.
1322
+
1323
+ 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.
1324
+
1325
+ To set it up, you can add a `compiler` section in your `intlayer.config.ts` file:
1326
+
1327
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
1328
+ import { type IntlayerConfig } from "intlayer";
1329
+
1330
+ const config: IntlayerConfig = {
1331
+ // ... Rest of your config
1332
+ compiler: {
1333
+ /**
1334
+ * Indicates if the compiler should be enabled.
1335
+ */
1336
+ enabled: true,
1337
+
1338
+ /**
1339
+ * Defines the output files path
1340
+ */
1341
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
1342
+
1343
+ /**
1344
+ * Indicates if the components should be saved after being transformed.
1345
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
1346
+ */
1347
+ saveComponents: false,
1348
+
1349
+ /**
1350
+ * Dictionary key prefix
1351
+ */
1352
+ dictionaryKeyPrefix: "",
1353
+ },
1354
+ };
1355
+
1356
+ export default config;
1357
+ ```
1358
+
1359
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
1360
+ /** @type {import('intlayer').IntlayerConfig} */
1361
+ const config = {
1362
+ // ... Rest of your config
1363
+ compiler: {
1364
+ /**
1365
+ * Indicates if the compiler should be enabled.
1366
+ */
1367
+ enabled: true,
1368
+
1369
+ /**
1370
+ * Defines the output files path
1371
+ */
1372
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
1373
+
1374
+ /**
1375
+ * Indicates if the components should be saved after being transformed.
1376
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
1377
+ */
1378
+ saveComponents: false,
1379
+
1380
+ /**
1381
+ * Dictionary key prefix
1382
+ */
1383
+ dictionaryKeyPrefix: "",
1384
+ },
1385
+ };
1386
+
1387
+ export default config;
1388
+ ```
1389
+
1390
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
1391
+ /** @type {import('intlayer').IntlayerConfig} */
1392
+ const config = {
1393
+ // ... Rest of your config
1394
+ compiler: {
1395
+ /**
1396
+ * Indicates if the compiler should be enabled.
1397
+ */
1398
+ enabled: true,
1399
+
1400
+ /**
1401
+ * Defines the output files path
1402
+ */
1403
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
1404
+
1405
+ /**
1406
+ * Indicates if the components should be saved after being transformed.
1407
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
1408
+ */
1409
+ saveComponents: false,
1410
+
1411
+ /**
1412
+ * Dictionary key prefix
1413
+ */
1414
+ dictionaryKeyPrefix: "",
1415
+ },
1416
+ };
1417
+
1418
+ module.exports = config;
1419
+ ```
1420
+
1421
+ <Tabs>
1422
+ <Tab value='Extract command'>
1423
+
1424
+ Run the extractor to transform your components and extract the content
1425
+
1426
+ ```bash packageManager="npm"
1427
+ npx intlayer extract
1428
+ ```
1429
+
1430
+ ```bash packageManager="pnpm"
1431
+ pnpm intlayer extract
1432
+ ```
1433
+
1434
+ ```bash packageManager="yarn"
1435
+ yarn intlayer extract
1436
+ ```
1437
+
1438
+ ```bash packageManager="bun"
1439
+ bunx intlayer extract
1440
+ ```
1441
+
1442
+ </Tab>
1443
+ <Tab value='Babel compiler'>
1444
+
1445
+ Update your `vite.config.ts` to include the `intlayerCompiler` plugin:
1446
+
1447
+ ```ts fileName="vite.config.ts"
1448
+ import { defineConfig } from "vite";
1449
+ import { intlayer, intlayerCompiler } from "vite-intlayer";
1450
+
1451
+ export default defineConfig({
1452
+ plugins: [
1453
+ intlayer(),
1454
+ intlayerCompiler(), // Adds the compiler plugin
1455
+ ],
1456
+ });
1457
+ ```
1458
+
1459
+ ```bash packageManager="npm"
1460
+ npm run build # Or npm run dev
1461
+ ```
1462
+
1463
+ ```bash packageManager="pnpm"
1464
+ pnpm run build # Or pnpm run dev
1465
+ ```
1466
+
1467
+ ```bash packageManager="yarn"
1468
+ yarn build # Or yarn dev
1469
+ ```
1470
+
1471
+ ```bash packageManager="bun"
1472
+ bun run build # Or bun run dev
1473
+ ```
1474
+
1475
+ </Tab>
1476
+ </Tabs>
1477
+
1319
1478
  ### Configure TypeScript
1320
1479
 
1321
1480
  Intlayer use module augmentation to get benefits of TypeScript and make your codebase stronger.
@@ -1357,6 +1357,165 @@ Link.displayName = "Link";
1357
1357
 
1358
1358
  By integrating this `Link` component across your application, you maintain a coherent and language-aware user experience while also benefitting from improved SEO and usability.
1359
1359
 
1360
+ ### (Optional) Step 11: Extract the content of your components
1361
+
1362
+ If you have an existing codebase, transforming thousands of files can be time-consuming.
1363
+
1364
+ 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.
1365
+
1366
+ To set it up, you can add a `compiler` section in your `intlayer.config.ts` file:
1367
+
1368
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
1369
+ import { type IntlayerConfig } from "intlayer";
1370
+
1371
+ const config: IntlayerConfig = {
1372
+ // ... Rest of your config
1373
+ compiler: {
1374
+ /**
1375
+ * Indicates if the compiler should be enabled.
1376
+ */
1377
+ enabled: true,
1378
+
1379
+ /**
1380
+ * Defines the output files path
1381
+ */
1382
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
1383
+
1384
+ /**
1385
+ * Indicates if the components should be saved after being transformed.
1386
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
1387
+ */
1388
+ saveComponents: false,
1389
+
1390
+ /**
1391
+ * Dictionary key prefix
1392
+ */
1393
+ dictionaryKeyPrefix: "",
1394
+ },
1395
+ };
1396
+
1397
+ export default config;
1398
+ ```
1399
+
1400
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
1401
+ /** @type {import('intlayer').IntlayerConfig} */
1402
+ const config = {
1403
+ // ... Rest of your config
1404
+ compiler: {
1405
+ /**
1406
+ * Indicates if the compiler should be enabled.
1407
+ */
1408
+ enabled: true,
1409
+
1410
+ /**
1411
+ * Defines the output files path
1412
+ */
1413
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
1414
+
1415
+ /**
1416
+ * Indicates if the components should be saved after being transformed.
1417
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
1418
+ */
1419
+ saveComponents: false,
1420
+
1421
+ /**
1422
+ * Dictionary key prefix
1423
+ */
1424
+ dictionaryKeyPrefix: "",
1425
+ },
1426
+ };
1427
+
1428
+ export default config;
1429
+ ```
1430
+
1431
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
1432
+ /** @type {import('intlayer').IntlayerConfig} */
1433
+ const config = {
1434
+ // ... Rest of your config
1435
+ compiler: {
1436
+ /**
1437
+ * Indicates if the compiler should be enabled.
1438
+ */
1439
+ enabled: true,
1440
+
1441
+ /**
1442
+ * Defines the output files path
1443
+ */
1444
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
1445
+
1446
+ /**
1447
+ * Indicates if the components should be saved after being transformed.
1448
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
1449
+ */
1450
+ saveComponents: false,
1451
+
1452
+ /**
1453
+ * Dictionary key prefix
1454
+ */
1455
+ dictionaryKeyPrefix: "",
1456
+ },
1457
+ };
1458
+
1459
+ module.exports = config;
1460
+ ```
1461
+
1462
+ <Tabs>
1463
+ <Tab value='Extract command'>
1464
+
1465
+ Run the extractor to transform your components and extract the content
1466
+
1467
+ ```bash packageManager="npm"
1468
+ npx intlayer extract
1469
+ ```
1470
+
1471
+ ```bash packageManager="pnpm"
1472
+ pnpm intlayer extract
1473
+ ```
1474
+
1475
+ ```bash packageManager="yarn"
1476
+ yarn intlayer extract
1477
+ ```
1478
+
1479
+ ```bash packageManager="bun"
1480
+ bunx intlayer extract
1481
+ ```
1482
+
1483
+ </Tab>
1484
+ <Tab value='Babel compiler'>
1485
+
1486
+ Update your `vite.config.ts` to include the `intlayerCompiler` plugin:
1487
+
1488
+ ```ts fileName="vite.config.ts"
1489
+ import { defineConfig } from "vite";
1490
+ import { intlayer, intlayerCompiler } from "vite-intlayer";
1491
+
1492
+ export default defineConfig({
1493
+ plugins: [
1494
+ intlayer(),
1495
+ intlayerCompiler(), // Adds the compiler plugin
1496
+ ],
1497
+ });
1498
+ ```
1499
+
1500
+ ```bash packageManager="npm"
1501
+ npm run build # Or npm run dev
1502
+ ```
1503
+
1504
+ ```bash packageManager="pnpm"
1505
+ pnpm run build # Or pnpm run dev
1506
+ ```
1507
+
1508
+ ```bash packageManager="yarn"
1509
+ yarn build # Or yarn dev
1510
+ ```
1511
+
1512
+ ```bash packageManager="bun"
1513
+ bun run build # Or bun run dev
1514
+ ```
1515
+
1516
+ </Tab>
1517
+ </Tabs>
1518
+
1360
1519
  ### Configure TypeScript
1361
1520
 
1362
1521
  Intlayer use module augmentation to get benefits of TypeScript and make your codebase stronger.
@@ -622,44 +622,165 @@ export const Link: ParentComponent<AnchorProps> = (props) => {
622
622
  };
623
623
  ```
624
624
 
625
- ### (Optional) Step 11: Render Markdown
625
+ ### (Optional) Step 11: Extract the content of your components
626
626
 
627
- Intlayer supports rendering Markdown content directly in your Solid application using its own internal parser. By default, Markdown is treated as plain text. To render it as rich HTML, wrap your application with the `MarkdownProvider`.
627
+ If you have an existing codebase, transforming thousands of files can be time-consuming.
628
628
 
629
- ```tsx fileName="src/index.tsx"
630
- import { render } from "solid-js/web";
631
- import { MarkdownProvider } from "solid-intlayer";
632
- import App from "./App";
629
+ 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.
633
630
 
634
- const root = document.getElementById("root");
631
+ To set it up, you can add a `compiler` section in your `intlayer.config.ts` file:
635
632
 
636
- render(
637
- () => (
638
- <MarkdownProvider>
639
- <App />
640
- </MarkdownProvider>
641
- ),
642
- root!
643
- );
644
- ```
633
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
634
+ import { type IntlayerConfig } from "intlayer";
635
+
636
+ const config: IntlayerConfig = {
637
+ // ... Rest of your config
638
+ compiler: {
639
+ /**
640
+ * Indicates if the compiler should be enabled.
641
+ */
642
+ enabled: true,
643
+
644
+ /**
645
+ * Defines the output files path
646
+ */
647
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
648
+
649
+ /**
650
+ * Indicates if the components should be saved after being transformed.
651
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
652
+ */
653
+ saveComponents: false,
654
+
655
+ /**
656
+ * Dictionary key prefix
657
+ */
658
+ dictionaryKeyPrefix: "",
659
+ },
660
+ };
645
661
 
646
- Then you can use it in your components:
662
+ export default config;
663
+ ```
647
664
 
648
- ```tsx
649
- import { useIntlayer } from "solid-intlayer";
665
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
666
+ /** @type {import('intlayer').IntlayerConfig} */
667
+ const config = {
668
+ // ... Rest of your config
669
+ compiler: {
670
+ /**
671
+ * Indicates if the compiler should be enabled.
672
+ */
673
+ enabled: true,
674
+
675
+ /**
676
+ * Defines the output files path
677
+ */
678
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
679
+
680
+ /**
681
+ * Indicates if the components should be saved after being transformed.
682
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
683
+ */
684
+ saveComponents: false,
685
+
686
+ /**
687
+ * Dictionary key prefix
688
+ */
689
+ dictionaryKeyPrefix: "",
690
+ },
691
+ };
650
692
 
651
- const MyComponent = () => {
652
- const content = useIntlayer("my-content");
693
+ export default config;
694
+ ```
653
695
 
654
- return (
655
- <div>
656
- {/* Renders as HTML via MarkdownProvider */}
657
- {content().markdownContent}
658
- </div>
659
- );
696
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
697
+ /** @type {import('intlayer').IntlayerConfig} */
698
+ const config = {
699
+ // ... Rest of your config
700
+ compiler: {
701
+ /**
702
+ * Indicates if the compiler should be enabled.
703
+ */
704
+ enabled: true,
705
+
706
+ /**
707
+ * Defines the output files path
708
+ */
709
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
710
+
711
+ /**
712
+ * Indicates if the components should be saved after being transformed.
713
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
714
+ */
715
+ saveComponents: false,
716
+
717
+ /**
718
+ * Dictionary key prefix
719
+ */
720
+ dictionaryKeyPrefix: "",
721
+ },
660
722
  };
723
+
724
+ module.exports = config;
725
+ ```
726
+
727
+ <Tabs>
728
+ <Tab value='Extract command'>
729
+
730
+ Run the extractor to transform your components and extract the content
731
+
732
+ ```bash packageManager="npm"
733
+ npx intlayer extract
734
+ ```
735
+
736
+ ```bash packageManager="pnpm"
737
+ pnpm intlayer extract
738
+ ```
739
+
740
+ ```bash packageManager="yarn"
741
+ yarn intlayer extract
742
+ ```
743
+
744
+ ```bash packageManager="bun"
745
+ bunx intlayer extract
746
+ ```
747
+
748
+ </Tab>
749
+ <Tab value='Babel compiler'>
750
+
751
+ Update your `vite.config.ts` to include the `intlayerCompiler` plugin:
752
+
753
+ ```ts fileName="vite.config.ts"
754
+ import { defineConfig } from "vite";
755
+ import { intlayer, intlayerCompiler } from "vite-intlayer";
756
+
757
+ export default defineConfig({
758
+ plugins: [
759
+ intlayer(),
760
+ intlayerCompiler(), // Adds the compiler plugin
761
+ ],
762
+ });
763
+ ```
764
+
765
+ ```bash packageManager="npm"
766
+ npm run build # Or npm run dev
767
+ ```
768
+
769
+ ```bash packageManager="pnpm"
770
+ pnpm run build # Or pnpm run dev
661
771
  ```
662
772
 
773
+ ```bash packageManager="yarn"
774
+ yarn build # Or yarn dev
775
+ ```
776
+
777
+ ```bash packageManager="bun"
778
+ bun run build # Or bun run dev
779
+ ```
780
+
781
+ </Tab>
782
+ </Tabs>
783
+
663
784
  ### Configure TypeScript
664
785
 
665
786
  Ensure your TypeScript configuration includes the autogenerated types.
@@ -504,6 +504,165 @@ For SEO, it is recommended to prefix your routes with the locale (e.g., `/about`
504
504
  </a>
505
505
  ```
506
506
 
507
+ ### (Optional) Step 10: Extract the content of your components
508
+
509
+ If you have an existing codebase, transforming thousands of files can be time-consuming.
510
+
511
+ 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.
512
+
513
+ To set it up, you can add a `compiler` section in your `intlayer.config.ts` file:
514
+
515
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
516
+ import { type IntlayerConfig } from "intlayer";
517
+
518
+ const config: IntlayerConfig = {
519
+ // ... Rest of your config
520
+ compiler: {
521
+ /**
522
+ * Indicates if the compiler should be enabled.
523
+ */
524
+ enabled: true,
525
+
526
+ /**
527
+ * Defines the output files path
528
+ */
529
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
530
+
531
+ /**
532
+ * Indicates if the components should be saved after being transformed.
533
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
534
+ */
535
+ saveComponents: false,
536
+
537
+ /**
538
+ * Dictionary key prefix
539
+ */
540
+ dictionaryKeyPrefix: "",
541
+ },
542
+ };
543
+
544
+ export default config;
545
+ ```
546
+
547
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
548
+ /** @type {import('intlayer').IntlayerConfig} */
549
+ const config = {
550
+ // ... Rest of your config
551
+ compiler: {
552
+ /**
553
+ * Indicates if the compiler should be enabled.
554
+ */
555
+ enabled: true,
556
+
557
+ /**
558
+ * Defines the output files path
559
+ */
560
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
561
+
562
+ /**
563
+ * Indicates if the components should be saved after being transformed.
564
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
565
+ */
566
+ saveComponents: false,
567
+
568
+ /**
569
+ * Dictionary key prefix
570
+ */
571
+ dictionaryKeyPrefix: "",
572
+ },
573
+ };
574
+
575
+ export default config;
576
+ ```
577
+
578
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
579
+ /** @type {import('intlayer').IntlayerConfig} */
580
+ const config = {
581
+ // ... Rest of your config
582
+ compiler: {
583
+ /**
584
+ * Indicates if the compiler should be enabled.
585
+ */
586
+ enabled: true,
587
+
588
+ /**
589
+ * Defines the output files path
590
+ */
591
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
592
+
593
+ /**
594
+ * Indicates if the components should be saved after being transformed.
595
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
596
+ */
597
+ saveComponents: false,
598
+
599
+ /**
600
+ * Dictionary key prefix
601
+ */
602
+ dictionaryKeyPrefix: "",
603
+ },
604
+ };
605
+
606
+ module.exports = config;
607
+ ```
608
+
609
+ <Tabs>
610
+ <Tab value='Extract command'>
611
+
612
+ Run the extractor to transform your components and extract the content
613
+
614
+ ```bash packageManager="npm"
615
+ npx intlayer extract
616
+ ```
617
+
618
+ ```bash packageManager="pnpm"
619
+ pnpm intlayer extract
620
+ ```
621
+
622
+ ```bash packageManager="yarn"
623
+ yarn intlayer extract
624
+ ```
625
+
626
+ ```bash packageManager="bun"
627
+ bunx intlayer extract
628
+ ```
629
+
630
+ </Tab>
631
+ <Tab value='Babel compiler'>
632
+
633
+ Update your `vite.config.ts` to include the `intlayerCompiler` plugin:
634
+
635
+ ```ts fileName="vite.config.ts"
636
+ import { defineConfig } from "vite";
637
+ import { intlayer, intlayerCompiler } from "vite-intlayer";
638
+
639
+ export default defineConfig({
640
+ plugins: [
641
+ intlayer(),
642
+ intlayerCompiler(), // Adds the compiler plugin
643
+ ],
644
+ });
645
+ ```
646
+
647
+ ```bash packageManager="npm"
648
+ npm run build # Or npm run dev
649
+ ```
650
+
651
+ ```bash packageManager="pnpm"
652
+ pnpm run build # Or pnpm run dev
653
+ ```
654
+
655
+ ```bash packageManager="yarn"
656
+ yarn build # Or yarn dev
657
+ ```
658
+
659
+ ```bash packageManager="bun"
660
+ bun run build # Or bun run dev
661
+ ```
662
+
663
+ </Tab>
664
+ </Tabs>
665
+
507
666
  ### Git Configuration
508
667
 
509
668
  It is recommended to ignore the files generated by Intlayer. This allows you to avoid committing them to your Git repository.