@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
@@ -957,64 +957,165 @@ import RouterLink from "@components/RouterLink.vue";
957
957
  </template>
958
958
  ```
959
959
 
960
- ### (Optional) Step 11: Render Markdown
960
+ ### (Optional) Step 11: Extract the content of your components
961
961
 
962
- Intlayer supports rendering Markdown content directly in your Vue application. By default, Markdown is treated as plain text. To convert Markdown into rich HTML, you can integrate [markdown-it](https://github.com/markdown-it/markdown-it), a Markdown parser.
962
+ If you have an existing codebase, transforming thousands of files can be time-consuming.
963
963
 
964
- This is particularly useful when your translations include formatted content like lists, links, or emphasis.
964
+ 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.
965
965
 
966
- By default Intlayer render markdown as string. But Intlayer also provides a way to render markdown into HTML using the `installIntlayerMarkdown` function.
966
+ To set it up, you can add a `compiler` section in your `intlayer.config.ts` file:
967
967
 
968
- > To see how to declare markdown content using the `intlayer` package, see the [markdown doc](https://github.com/aymericzip/intlayer/tree/main/docs/en/dictionary/markdown.md).
968
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
969
+ import { type IntlayerConfig } from "intlayer";
969
970
 
970
- ```ts fileName="main.ts"
971
- import MarkdownIt from "markdown-it";
972
- import { createApp, h } from "vue";
973
- import { installIntlayer, installIntlayerMarkdown } from "vue-intlayer";
971
+ const config: IntlayerConfig = {
972
+ // ... Rest of your config
973
+ compiler: {
974
+ /**
975
+ * Indicates if the compiler should be enabled.
976
+ */
977
+ enabled: true,
978
+
979
+ /**
980
+ * Defines the output files path
981
+ */
982
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
983
+
984
+ /**
985
+ * Indicates if the components should be saved after being transformed.
986
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
987
+ */
988
+ saveComponents: false,
989
+
990
+ /**
991
+ * Dictionary key prefix
992
+ */
993
+ dictionaryKeyPrefix: "",
994
+ },
995
+ };
974
996
 
975
- const app = createApp(App);
997
+ export default config;
998
+ ```
976
999
 
977
- installIntlayer(app);
1000
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
1001
+ /** @type {import('intlayer').IntlayerConfig} */
1002
+ const config = {
1003
+ // ... Rest of your config
1004
+ compiler: {
1005
+ /**
1006
+ * Indicates if the compiler should be enabled.
1007
+ */
1008
+ enabled: true,
1009
+
1010
+ /**
1011
+ * Defines the output files path
1012
+ */
1013
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
1014
+
1015
+ /**
1016
+ * Indicates if the components should be saved after being transformed.
1017
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
1018
+ */
1019
+ saveComponents: false,
1020
+
1021
+ /**
1022
+ * Dictionary key prefix
1023
+ */
1024
+ dictionaryKeyPrefix: "",
1025
+ },
1026
+ };
978
1027
 
979
- const md = new MarkdownIt({
980
- html: true, // allow HTML tags
981
- linkify: true, // auto-link URLs
982
- typographer: true, // enable smart quotes, dashes, etc.
983
- });
1028
+ export default config;
1029
+ ```
984
1030
 
985
- // Tell Intlayer to use md.render() whenever it needs to turn markdown into HTML
986
- installIntlayerMarkdown(app, (markdown) => {
987
- const html = md.render(markdown);
988
- return h("div", { innerHTML: html });
1031
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
1032
+ /** @type {import('intlayer').IntlayerConfig} */
1033
+ const config = {
1034
+ // ... Rest of your config
1035
+ compiler: {
1036
+ /**
1037
+ * Indicates if the compiler should be enabled.
1038
+ */
1039
+ enabled: true,
1040
+
1041
+ /**
1042
+ * Defines the output files path
1043
+ */
1044
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
1045
+
1046
+ /**
1047
+ * Indicates if the components should be saved after being transformed.
1048
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
1049
+ */
1050
+ saveComponents: false,
1051
+
1052
+ /**
1053
+ * Dictionary key prefix
1054
+ */
1055
+ dictionaryKeyPrefix: "",
1056
+ },
1057
+ };
1058
+
1059
+ module.exports = config;
1060
+ ```
1061
+
1062
+ <Tabs>
1063
+ <Tab value='Extract command'>
1064
+
1065
+ Run the extractor to transform your components and extract the content
1066
+
1067
+ ```bash packageManager="npm"
1068
+ npx intlayer extract
1069
+ ```
1070
+
1071
+ ```bash packageManager="pnpm"
1072
+ pnpm intlayer extract
1073
+ ```
1074
+
1075
+ ```bash packageManager="yarn"
1076
+ yarn intlayer extract
1077
+ ```
1078
+
1079
+ ```bash packageManager="bun"
1080
+ bunx intlayer extract
1081
+ ```
1082
+
1083
+ </Tab>
1084
+ <Tab value='Babel compiler'>
1085
+
1086
+ Update your `vite.config.ts` to include the `intlayerCompiler` plugin:
1087
+
1088
+ ```ts fileName="vite.config.ts"
1089
+ import { defineConfig } from "vite";
1090
+ import { intlayer, intlayerCompiler } from "vite-intlayer";
1091
+
1092
+ export default defineConfig({
1093
+ plugins: [
1094
+ intlayer(),
1095
+ intlayerCompiler(), // Adds the compiler plugin
1096
+ ],
989
1097
  });
990
1098
  ```
991
1099
 
992
- Once registered, you can use the component-based syntax to display the Markdown content directly:
1100
+ ```bash packageManager="npm"
1101
+ npm run build # Or npm run dev
1102
+ ```
993
1103
 
994
- ```vue
995
- <script setup lang="ts">
996
- import { useIntlayer } from "vue-intlayer";
1104
+ ```bash packageManager="pnpm"
1105
+ pnpm run build # Or pnpm run dev
1106
+ ```
997
1107
 
998
- const { myMarkdownContent } = useIntlayer("my-component");
999
- </script>
1108
+ ```bash packageManager="yarn"
1109
+ yarn build # Or yarn dev
1110
+ ```
1000
1111
 
1001
- <template>
1002
- <div>
1003
- <!-- Basic syntax -->
1004
- <myMarkdownContent />
1005
-
1006
- <!-- Or with custom components -->
1007
- <component
1008
- :is="
1009
- myMarkdownContent.use({
1010
- h1: (props) => h('h1', { style: { color: 'red' } }, props.children),
1011
- })
1012
- "
1013
- />
1014
- </div>
1015
- </template>
1112
+ ```bash packageManager="bun"
1113
+ bun run build # Or bun run dev
1016
1114
  ```
1017
1115
 
1116
+ </Tab>
1117
+ </Tabs>
1118
+
1018
1119
  ### Configure TypeScript
1019
1120
 
1020
1121
  Intlayer uses module augmentation to get benefits of TypeScript and make your codebase stronger.
@@ -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: Intlayer Compiler | Automated Content Extraction for i18n
5
5
  description: Automate your internationalisation process with the Intlayer Compiler. Extract content directly from your components for faster, more efficient i18n in Vite, Next.js, and more.
6
6
  keywords:
@@ -149,59 +149,83 @@ This configuration ensures that content declared in your components is automatic
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
  ### Custom config
154
155
 
155
156
  To customise the compiler behaviour, you can update the `intlayer.config.ts` file in the root of your project.
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
+ * Indicates if the compiler should be enabled.
163
165
  * Set to 'build-only' to skip the compiler during development and speed up start times.
164
166
  */
165
167
  enabled: true,
166
168
 
167
169
  /**
168
- * Pattern to traverse the code to optimize.
170
+ * Defines the output files path. Replaces `outputDir`.
171
+ *
172
+ * - Paths starting with `./` are resolved relatively to the component directory.
173
+ * - Paths starting with `/` are resolved relatively to the project root (`baseDir`).
174
+ *
175
+ * - Including the `{{locale}}` variable in the path will enable the generation of dictionaries separated by locale.
176
+ *
177
+ * Examples:
178
+ * ```ts
179
+ * {
180
+ * // Create multi-locale .content.ts files next to the component
181
+ * output: ({ fileName, extension }) => `./${fileName}${extension}`,
182
+ *
183
+ * // output: './{{fileName}}{{extension}}', // Equivalent using string template
184
+ * }
185
+ * ```
186
+ *
187
+ * ```ts
188
+ * {
189
+ * // Create centralized JSON files by locale in the project root
190
+ * output: ({ key, locale }) => `/locales/${locale}/${key}.content.json`,
191
+ *
192
+ * // output: '/locales/{{locale}}/{{key}}.content.json', // Equivalent using string template
193
+ * }
194
+ * ```
195
+ *
196
+ * List of variables:
197
+ * - `fileName`: The file name.
198
+ * - `key`: The content key.
199
+ * - `locale`: The content locale.
200
+ * - `extension`: The file extension.
201
+ * - `componentFileName`: The component file name.
202
+ * - `componentExtension`: The component file extension.
203
+ * - `format`: The dictionary format.
204
+ * - `componentFormat`: The component dictionary format.
205
+ * - `componentDirPath`: The component directory path.
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
- * Output directory for the optimized dictionaries.
210
+ * Indicates if the components should be saved after being transformed.
211
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
182
212
  */
183
- output: ({ key }) => `compiler/${key}.content.json`,
213
+ saveComponents: false,
184
214
 
185
215
  /**
186
- * Inset only content in generated file, without key.
216
+ * Inset only content in generated file. Useful for i18next or ICU MessageFormat JSON output per locale.
217
+ *
218
+ * - `output: ({ locale, key }) => `./locale/${locale}/${key}.json`,`
187
219
  */
188
220
  noMetadata: false,
189
221
 
190
222
  /**
191
223
  * Dictionary key prefix
192
224
  */
193
- dictionaryKeyPrefix: "", // Remove base prefix
194
-
195
- /**
196
- * Indicates if the components should be saved after being transformed.
197
- * That way, the compiler can be run only once to transform the app, and then it can be removed.
198
- */
199
- saveComponents: false,
225
+ dictionaryKeyPrefix: "", // Add an optional prefix for the extracted dictionary keys
200
226
  },
201
227
  };
202
-
203
- export default config;
204
- ```
228
+ ````
205
229
 
206
230
  ### Compiler Configuration Reference
207
231
 
@@ -211,34 +235,34 @@ The following properties can be configured in the `compiler` block of your `intl
211
235
  - _Type_: `boolean | 'build-only'`
212
236
  - _Default_: `true`
213
237
  - _Description_: Indicates if the compiler should be enabled.
238
+
214
239
  - **dictionaryKeyPrefix**:
215
240
  - _Type_: `string`
216
- - _Default_: `'comp-'`
241
+ - _Default_: `''`
217
242
  - _Description_: Prefix for the extracted dictionary keys.
243
+
218
244
  - **transformPattern**:
219
245
  - _Type_: `string | string[]`
220
246
  - _Default_: `['**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}', '!**/node_modules/**']`
221
- - _Description_: Patterns to traverse the code to optimize.
247
+ - _Description_: (Deprecated: use `build.traversePattern` instead) Patterns to traverse the code to optimise.
248
+
222
249
  - **excludePattern**:
223
250
  - _Type_: `string | string[]`
224
251
  - _Default_: `['**/node_modules/**']`
225
- - _Description_: Patterns to exclude from the optimization.
226
- - **outputDir** (Deprecated):
227
- - _Type_: `string`
228
- - _Default_: `'compiler'`
229
- - _Description_: The directory where the extracted dictionaries will be stored.
252
+ - _Description_: (Deprecated: use `build.traversePattern` instead) Patterns to exclude from the optimisation.
230
253
 
231
254
  - **output**:
232
255
  - _Type_: `FilePathPattern`
233
256
  - _Default_: `({ key }) => 'compiler/${key}.content.json'`
234
257
  - _Description_: Defines the output files path. Replaces `outputDir`. Handles dynamic variables like `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{componentFormat}}`. Can be set as a string using `'my/{{var}}/path'` format, or as a function.
235
258
  - _Note_: `./**/*` Path are resolved relatively to the component. `/**/*` path are resolved relatively to the Intlayer `baseDir`.
259
+ - _Note_: If the locale is defined in the path, the dictionaries will be generated by locale.
236
260
  - _Example_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
237
261
 
238
262
  - **noMetadata**:
239
263
  - _Type_: `boolean`
240
264
  - _Default_: `false`
241
- - _Description_: Indicates if the metadata should be saved in the file. If true, the compiler will not save the metadata of the dictionaries (key, content wrapper).
265
+ - _Description_: Indicates if the metadata should be saved in the file. If true, the compiler will not save the metadata of the dictionaries (key, content wrapper). Useful for per-locale i18next or ICU MessageFormat JSON outputs.
242
266
  - _Note_: Useful if used with `loadJSON` plugin.
243
267
  - _Example_:
244
268
  If `true`:
@@ -274,4 +298,12 @@ npx intlayer test # Test if there is missing translations
274
298
  npx intlayer fill # Fill missing translations
275
299
  ```
276
300
 
277
- > For more details, refer to the [CLI documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/cli/ci.md)
301
+ ### Extraction
302
+
303
+ Intlayer provides a CLI tool to extract content from your code. You can use the `intlayer extract` command to extract the content from your code.
304
+
305
+ ```bash
306
+ npx intlayer extract
307
+ ```
308
+
309
+ > For more details, refer to the [CLI documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/cli/index.md)
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2024-08-13
3
- updatedAt: 2026-03-11
3
+ updatedAt: 2026-03-12
4
4
  title: Configuration
5
5
  description: Learn how to configure Intlayer for your application. Understand the various settings and options available to customise Intlayer to your needs.
6
6
  keywords:
@@ -15,7 +15,7 @@ slugs:
15
15
  - configuration
16
16
  history:
17
17
  - version: 8.3.0
18
- data: 2026-03-11
18
+ date: 2026-03-11
19
19
  changes: Move 'baseDir' from 'content' to 'system' config
20
20
  - version: 8.2.0
21
21
  date: 2026-03-09
@@ -92,7 +92,7 @@ Intlayer accepts JSON, JS, MJS, and TS configuration file formats:
92
92
 
93
93
  ## Example config file
94
94
 
95
- ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
95
+ ````typescript fileName="intlayer.config.ts" codeFormat="typescript"
96
96
  import { Locales, type IntlayerConfig } from "intlayer";
97
97
  import { nextjsRewrite } from "intlayer/routing";
98
98
  import { z } from "zod";
@@ -190,7 +190,7 @@ const config: IntlayerConfig = {
190
190
  * Options: 'cookie', 'localStorage', 'sessionStorage', 'header', or an array of these.
191
191
  * Default: ['cookie', 'header']
192
192
  */
193
- storage: "cookie",
193
+ storage: ["cookie", "header"],
194
194
 
195
195
  /**
196
196
  * Base path for the application URLs.
@@ -327,6 +327,17 @@ const config: IntlayerConfig = {
327
327
  * Base URL for the AI API.
328
328
  */
329
329
  baseURL: "http://localhost:3000",
330
+
331
+ /**
332
+ * Data serialisation
333
+ *
334
+ * Options:
335
+ * - "json": Standard, reliable; uses more tokens.
336
+ * - "toon": Fewer tokens, less consistent than JSON.
337
+ *
338
+ * Default: "json"
339
+ */
340
+ dataSerialization: "json",
330
341
  },
331
342
 
332
343
  /**
@@ -426,42 +437,70 @@ const config: IntlayerConfig = {
426
437
  compiler: {
427
438
  /**
428
439
  * Indicates if the compiler should be enabled.
440
+ *
441
+ * - false : Disables the compiler.
442
+ * - true : Enables the compiler.
443
+ * - "build-only" : Skips the compiler during development to speed up start times.
444
+ *
445
+ * Default: false
429
446
  */
430
447
  enabled: true,
431
448
 
432
449
  /**
433
- * Pattern to traverse the code to optimize.
450
+ * Defines the output files path. Replaces `outputDir`.
451
+ *
452
+ * - Paths starting with `./` are resolved relatively to the component directory.
453
+ * - Paths starting with `/` are resolved relatively to the project root (`baseDir`).
454
+ *
455
+ * - Including the `{{locale}}` variable in the path will trigger the generation of separate dictionaries per locale.
456
+ *
457
+ * Examples:
458
+ * ```ts
459
+ * {
460
+ * // Create multi-locale .content.ts files next to the component
461
+ * output: ({ fileName, extension }) => `./${fileName}${extension}`,
462
+ *
463
+ * // output: './{{fileName}}{{extension}}', // Equivalent using a string template
464
+ * }
465
+ * ```
466
+ *
467
+ * ```ts
468
+ * {
469
+ * // Create centralised JSON files by locale in the project root
470
+ * output: ({ key, locale }) => `/locales/${locale}/${key}.content.json`,
471
+ *
472
+ * // output: '/locales/{{locale}}/{{key}}.content.json', // Equivalent using a string template
473
+ * }
474
+ * ```
475
+ *
476
+ * List of variables:
477
+ * - `fileName`: The file name.
478
+ * - `key`: The content key.
479
+ * - `locale`: The content locale.
480
+ * - `extension`: The file extension.
481
+ * - `componentFileName`: The component file name.
482
+ * - `componentExtension`: The component file extension.
483
+ * - `format`: The dictionary format.
484
+ * - `componentFormat`: The component dictionary format.
485
+ * - `componentDirPath`: The component directory path.
434
486
  */
435
- transformPattern: [
436
- "**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}",
437
- "!**/node_modules/**",
438
- ],
487
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
439
488
 
440
489
  /**
441
- * Pattern to exclude from the optimization.
442
- */
443
- excludePattern: ["**/node_modules/**"],
444
-
445
- /**
446
- * Output directory for the optimized dictionaries.
490
+ * Indicates if the components should be saved after being transformed.
491
+ * That way, the compiler can be run only once to transform the app, and then it can be removed.
447
492
  */
448
- output: ({ key }) => `compiler/${key}.content.json`,
493
+ saveComponents: false,
449
494
 
450
495
  /**
451
- * Inset only content in generated file, without key.
496
+ * Insert only content into the generated file. Useful for per-locale i18next or ICU MessageFormat JSON outputs.
452
497
  */
453
498
  noMetadata: false,
454
499
 
455
500
  /**
456
501
  * Dictionary key prefix
457
502
  */
458
- dictionaryKeyPrefix: "", // Remove base prefix
459
-
460
- /**
461
- * Indicates if the components should be saved after being transformed.
462
- * That way, the compiler can be run only once to transform the app, and then it can be removed.
463
- */
464
- saveComponents: false,
503
+ dictionaryKeyPrefix: "", // Add optional prefix for the extracted dictionary keys
465
504
  },
466
505
 
467
506
  /**
@@ -480,7 +519,7 @@ const config: IntlayerConfig = {
480
519
  };
481
520
 
482
521
  export default config;
483
- ```
522
+ ````
484
523
 
485
524
  ## Configuration Reference
486
525
 
@@ -1046,7 +1085,7 @@ Settings that control the Intlayer compiler, which extracts dictionaries straigh
1046
1085
 
1047
1086
  - **dictionaryKeyPrefix**:
1048
1087
  - _Type_: `string`
1049
- - _Default_: `'comp-'`
1088
+ - _Default_: `''`
1050
1089
  - _Description_: Prefix for the extracted dictionary keys.
1051
1090
  - _Example_: `'my-key-'`
1052
1091
  - _Note_: When dictionaries are extracted, the key is generated based on the file name. This prefix is added to the generated key to prevent conflicts.
@@ -1070,22 +1109,25 @@ Settings that control the Intlayer compiler, which extracts dictionaries straigh
1070
1109
  - _Description_: Patterns that define which files should be excluded during optimisation.
1071
1110
  - _Example_: `['**/node_modules/**', '!**/node_modules/react/**']`
1072
1111
 
1073
- - **outputDir**:
1074
- - _Type_: `string`
1075
- - _Default_: `'compiler'`
1076
- - _Description_: The directory where the extracted dictionaries will be stored, relative to your project base path.
1077
-
1078
1112
  - **output**:
1079
1113
  - _Type_: `FilePathPattern`
1080
- - _Default_: `({ key }) => 'compiler/${key}.content.json'`
1081
- - _Description_: Defines the output files path. Replaces `outputDir`. Handles dynamic variables like `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{componentFormat}}`. Can be set as a string using `'my/{{var}}/path'` format, or as a function.
1082
- - _Note_: `./**/*` Path are resolved relatively to the component. `/**/*` path are resolved relatively to the Intlayer `baseDir`.
1083
- - _Example_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
1114
+ - _Default_: `undefined`
1115
+ - _Description_: Defines the output files path. Replaces `outputDir`. Supports dynamic variables via a template string or a function. Supported variables: `{{fileName}}`, `{{key}}`, `{{locale}}`, `{{extension}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{format}}`, `{{componentFormat}}`, `{{componentDirPath}}`.
1116
+ - _Note_: Paths starting with `./` are resolved relatively to the component directory. Paths starting with `/` are resolved relatively to the project root (`baseDir`).
1117
+ - _Note_: Including the `{{locale}}` variable in the path will enable the generation of separate dictionaries per locale.
1118
+ - _Example_:
1119
+ - **Create multi-locale files next to the component**:
1120
+ - String: `'./{{fileName}}{{extension}}'`
1121
+ - Function: `({ fileName, extension }) => \`./${fileName}${extension}\``
1122
+
1123
+ - **Output centralised JSON files per locale**:
1124
+ - String: `'/locales/{{locale}}/{{key}}.content.json'`
1125
+ - Function: `({ key, locale }) => \`/locales/${locale}/${key}.content.json\``
1084
1126
 
1085
1127
  - **noMetadata**:
1086
1128
  - _Type_: `boolean`
1087
1129
  - _Default_: `false`
1088
- - _Description_: Indicates if the metadata should be saved in the file. If true, the compiler will not save the metadata of the dictionaries (key, content wrapper).
1130
+ - _Description_: Indicates if the metadata should be saved in the file. If true, the compiler will not save the metadata of the dictionaries (key, content wrapper). Useful for per-locale i18next or ICU MessageFormat JSON outputs.
1089
1131
  - _Note_: Useful if used with `loadJSON` plugin.
1090
1132
  - _Example_:
1091
1133
  If `true`: