@intlayer/docs 6.1.5 → 6.1.6

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 (284) hide show
  1. package/blog/ar/next-i18next_vs_next-intl_vs_intlayer.md +404 -173
  2. package/blog/de/next-i18next_vs_next-intl_vs_intlayer.md +262 -113
  3. package/blog/en/intlayer_with_next-i18next.mdx +431 -0
  4. package/blog/en/intlayer_with_next-intl.mdx +335 -0
  5. package/blog/en/next-i18next_vs_next-intl_vs_intlayer.md +463 -209
  6. package/blog/en-GB/next-i18next_vs_next-intl_vs_intlayer.md +38 -28
  7. package/blog/es/next-i18next_vs_next-intl_vs_intlayer.md +185 -71
  8. package/blog/fr/next-i18next_vs_next-intl_vs_intlayer.md +38 -28
  9. package/blog/it/next-i18next_vs_next-intl_vs_intlayer.md +38 -28
  10. package/blog/ja/next-i18next_vs_next-intl_vs_intlayer.md +38 -28
  11. package/blog/ko/next-i18next_vs_next-intl_vs_intlayer.md +38 -28
  12. package/blog/pt/next-i18next_vs_next-intl_vs_intlayer.md +38 -28
  13. package/blog/ru/next-i18next_vs_next-intl_vs_intlayer.md +36 -28
  14. package/blog/tr/next-i18next_vs_next-intl_vs_intlayer.md +2 -0
  15. package/blog/zh/next-i18next_vs_next-intl_vs_intlayer.md +38 -28
  16. package/dist/cjs/generated/docs.entry.cjs +32 -0
  17. package/dist/cjs/generated/docs.entry.cjs.map +1 -1
  18. package/dist/esm/generated/docs.entry.mjs +32 -0
  19. package/dist/esm/generated/docs.entry.mjs.map +1 -1
  20. package/dist/types/generated/docs.entry.d.ts +2 -0
  21. package/dist/types/generated/docs.entry.d.ts.map +1 -1
  22. package/docs/ar/component_i18n.md +186 -0
  23. package/docs/ar/intlayer_with_angular.md +2 -2
  24. package/docs/ar/intlayer_with_astro.md +246 -0
  25. package/docs/ar/intlayer_with_create_react_app.md +3 -2
  26. package/docs/ar/intlayer_with_express.md +2 -2
  27. package/docs/ar/intlayer_with_nestjs.md +2 -2
  28. package/docs/ar/intlayer_with_nextjs_14.md +2 -2
  29. package/docs/ar/intlayer_with_nextjs_15.md +2 -2
  30. package/docs/ar/intlayer_with_nextjs_page_router.md +2 -2
  31. package/docs/ar/intlayer_with_nuxt.md +2 -2
  32. package/docs/ar/intlayer_with_react_native+expo.md +11 -20
  33. package/docs/ar/intlayer_with_react_router_v7.md +195 -241
  34. package/docs/ar/intlayer_with_tanstack.md +198 -272
  35. package/docs/ar/intlayer_with_vite+preact.md +9 -9
  36. package/docs/ar/intlayer_with_vite+react.md +7 -7
  37. package/docs/ar/intlayer_with_vite+vue.md +9 -9
  38. package/docs/ar/vs_code_extension.md +48 -109
  39. package/docs/de/component_i18n.md +186 -0
  40. package/docs/de/intlayer_with_angular.md +2 -2
  41. package/docs/de/intlayer_with_astro.md +246 -0
  42. package/docs/de/intlayer_with_create_react_app.md +2 -2
  43. package/docs/de/intlayer_with_express.md +2 -2
  44. package/docs/de/intlayer_with_nestjs.md +2 -2
  45. package/docs/de/intlayer_with_nextjs_14.md +2 -2
  46. package/docs/de/intlayer_with_nextjs_15.md +2 -2
  47. package/docs/de/intlayer_with_nextjs_page_router.md +2 -2
  48. package/docs/de/intlayer_with_nuxt.md +2 -2
  49. package/docs/de/intlayer_with_react_native+expo.md +11 -20
  50. package/docs/de/intlayer_with_react_router_v7.md +193 -242
  51. package/docs/de/intlayer_with_tanstack.md +194 -266
  52. package/docs/de/intlayer_with_vite+preact.md +9 -9
  53. package/docs/de/intlayer_with_vite+react.md +9 -9
  54. package/docs/de/intlayer_with_vite+vue.md +11 -11
  55. package/docs/de/packages/vite-intlayer/index.md +3 -3
  56. package/docs/de/vs_code_extension.md +46 -107
  57. package/docs/en/component_i18n.md +186 -0
  58. package/docs/en/how_works_intlayer.md +1 -1
  59. package/docs/en/index.md +1 -1
  60. package/docs/en/intlayer_cli.md +1 -1
  61. package/docs/en/intlayer_with_angular.md +4 -4
  62. package/docs/en/intlayer_with_astro.md +246 -0
  63. package/docs/en/intlayer_with_create_react_app.md +4 -4
  64. package/docs/en/intlayer_with_express.md +3 -3
  65. package/docs/en/intlayer_with_lynx+react.md +1 -1
  66. package/docs/en/intlayer_with_nestjs.md +2 -2
  67. package/docs/en/intlayer_with_nextjs_14.md +31 -5
  68. package/docs/en/intlayer_with_nextjs_15.md +31 -5
  69. package/docs/en/intlayer_with_nextjs_page_router.md +5 -5
  70. package/docs/en/intlayer_with_nuxt.md +4 -4
  71. package/docs/en/intlayer_with_react_native+expo.md +46 -24
  72. package/docs/en/intlayer_with_react_router_v7.md +164 -211
  73. package/docs/en/intlayer_with_tanstack.md +166 -241
  74. package/docs/en/intlayer_with_vite+preact.md +12 -12
  75. package/docs/en/intlayer_with_vite+react.md +12 -12
  76. package/docs/en/intlayer_with_vite+solid.md +2 -2
  77. package/docs/en/intlayer_with_vite+svelte.md +2 -2
  78. package/docs/en/intlayer_with_vite+vue.md +12 -12
  79. package/docs/en/introduction.md +1 -1
  80. package/docs/en/packages/next-intlayer/useDictionary.md +1 -1
  81. package/docs/en/packages/next-intlayer/useIntlayer.md +1 -1
  82. package/docs/en/packages/react-intlayer/useDictionary.md +1 -1
  83. package/docs/en/packages/react-intlayer/useI18n.md +1 -1
  84. package/docs/en/packages/react-intlayer/useIntlayer.md +1 -1
  85. package/docs/en/releases/v6.md +1 -0
  86. package/docs/en/roadmap.md +1 -1
  87. package/docs/en/vs_code_extension.md +24 -114
  88. package/docs/en-GB/component_i18n.md +186 -0
  89. package/docs/en-GB/intlayer_with_angular.md +3 -3
  90. package/docs/en-GB/intlayer_with_astro.md +246 -0
  91. package/docs/en-GB/intlayer_with_create_react_app.md +5 -4
  92. package/docs/en-GB/intlayer_with_express.md +2 -2
  93. package/docs/en-GB/intlayer_with_nestjs.md +2 -2
  94. package/docs/en-GB/intlayer_with_nextjs_14.md +4 -4
  95. package/docs/en-GB/intlayer_with_nextjs_15.md +2 -2
  96. package/docs/en-GB/intlayer_with_nextjs_page_router.md +2 -2
  97. package/docs/en-GB/intlayer_with_nuxt.md +2 -2
  98. package/docs/en-GB/intlayer_with_react_native+expo.md +11 -20
  99. package/docs/en-GB/intlayer_with_react_router_v7.md +171 -220
  100. package/docs/en-GB/intlayer_with_tanstack.md +174 -248
  101. package/docs/en-GB/intlayer_with_vite+preact.md +9 -9
  102. package/docs/en-GB/intlayer_with_vite+react.md +9 -9
  103. package/docs/en-GB/intlayer_with_vite+vue.md +11 -11
  104. package/docs/en-GB/packages/next-intlayer/useIntlayer.md +1 -1
  105. package/docs/en-GB/packages/react-intlayer/useIntlayer.md +1 -1
  106. package/docs/en-GB/vs_code_extension.md +42 -103
  107. package/docs/es/component_i18n.md +182 -0
  108. package/docs/es/intlayer_with_angular.md +2 -2
  109. package/docs/es/intlayer_with_astro.md +246 -0
  110. package/docs/es/intlayer_with_create_react_app.md +3 -2
  111. package/docs/es/intlayer_with_express.md +2 -2
  112. package/docs/es/intlayer_with_nextjs_14.md +2 -2
  113. package/docs/es/intlayer_with_nextjs_15.md +2 -2
  114. package/docs/es/intlayer_with_react_native+expo.md +11 -20
  115. package/docs/es/intlayer_with_react_router_v7.md +188 -232
  116. package/docs/es/intlayer_with_tanstack.md +203 -273
  117. package/docs/es/intlayer_with_vite+preact.md +7 -7
  118. package/docs/es/intlayer_with_vite+react.md +7 -7
  119. package/docs/es/intlayer_with_vite+vue.md +9 -9
  120. package/docs/es/vs_code_extension.md +53 -114
  121. package/docs/fr/component_i18n.md +186 -0
  122. package/docs/fr/intlayer_with_angular.md +2 -2
  123. package/docs/fr/intlayer_with_astro.md +246 -0
  124. package/docs/fr/intlayer_with_create_react_app.md +3 -2
  125. package/docs/fr/intlayer_with_express.md +2 -2
  126. package/docs/fr/intlayer_with_nestjs.md +2 -2
  127. package/docs/fr/intlayer_with_nextjs_14.md +2 -2
  128. package/docs/fr/intlayer_with_react_native+expo.md +11 -20
  129. package/docs/fr/intlayer_with_react_router_v7.md +188 -248
  130. package/docs/fr/intlayer_with_tanstack.md +192 -265
  131. package/docs/fr/intlayer_with_vite+preact.md +7 -7
  132. package/docs/fr/intlayer_with_vite+react.md +7 -7
  133. package/docs/fr/intlayer_with_vite+vue.md +9 -9
  134. package/docs/fr/vs_code_extension.md +50 -111
  135. package/docs/hi/component_i18n.md +186 -0
  136. package/docs/hi/intlayer_cli.md +1 -4
  137. package/docs/hi/intlayer_with_angular.md +2 -2
  138. package/docs/hi/intlayer_with_astro.md +246 -0
  139. package/docs/hi/intlayer_with_create_react_app.md +2 -2
  140. package/docs/hi/intlayer_with_express.md +2 -2
  141. package/docs/hi/intlayer_with_nestjs.md +2 -2
  142. package/docs/hi/intlayer_with_nextjs_14.md +2 -2
  143. package/docs/hi/intlayer_with_nextjs_15.md +2 -2
  144. package/docs/hi/intlayer_with_nextjs_page_router.md +2 -2
  145. package/docs/hi/intlayer_with_nuxt.md +2 -2
  146. package/docs/hi/intlayer_with_react_native+expo.md +11 -20
  147. package/docs/hi/intlayer_with_react_router_v7.md +199 -243
  148. package/docs/hi/intlayer_with_tanstack.md +210 -285
  149. package/docs/hi/intlayer_with_vite+preact.md +9 -9
  150. package/docs/hi/intlayer_with_vite+react.md +9 -9
  151. package/docs/hi/intlayer_with_vite+solid.md +1 -1
  152. package/docs/hi/intlayer_with_vite+vue.md +11 -11
  153. package/docs/hi/vs_code_extension.md +49 -110
  154. package/docs/it/component_i18n.md +186 -0
  155. package/docs/it/intlayer_with_angular.md +2 -2
  156. package/docs/it/intlayer_with_astro.md +246 -0
  157. package/docs/it/intlayer_with_create_react_app.md +3 -2
  158. package/docs/it/intlayer_with_express.md +2 -2
  159. package/docs/it/intlayer_with_nestjs.md +2 -2
  160. package/docs/it/intlayer_with_nextjs_14.md +2 -2
  161. package/docs/it/intlayer_with_nextjs_15.md +2 -2
  162. package/docs/it/intlayer_with_nextjs_page_router.md +2 -2
  163. package/docs/it/intlayer_with_nuxt.md +2 -2
  164. package/docs/it/intlayer_with_react_native+expo.md +11 -21
  165. package/docs/it/intlayer_with_react_router_v7.md +195 -242
  166. package/docs/it/intlayer_with_tanstack.md +203 -267
  167. package/docs/it/intlayer_with_vite+preact.md +9 -9
  168. package/docs/it/intlayer_with_vite+react.md +13 -11
  169. package/docs/it/intlayer_with_vite+vue.md +11 -11
  170. package/docs/it/vs_code_extension.md +50 -111
  171. package/docs/ja/component_i18n.md +186 -0
  172. package/docs/ja/intlayer_with_angular.md +2 -2
  173. package/docs/ja/intlayer_with_astro.md +246 -0
  174. package/docs/ja/intlayer_with_create_react_app.md +3 -2
  175. package/docs/ja/intlayer_with_express.md +2 -2
  176. package/docs/ja/intlayer_with_nestjs.md +2 -2
  177. package/docs/ja/intlayer_with_nextjs_14.md +2 -2
  178. package/docs/ja/intlayer_with_nextjs_15.md +2 -2
  179. package/docs/ja/intlayer_with_nextjs_page_router.md +2 -2
  180. package/docs/ja/intlayer_with_nuxt.md +2 -2
  181. package/docs/ja/intlayer_with_react_native+expo.md +18 -29
  182. package/docs/ja/intlayer_with_react_router_v7.md +204 -250
  183. package/docs/ja/intlayer_with_tanstack.md +218 -286
  184. package/docs/ja/intlayer_with_vite+preact.md +9 -9
  185. package/docs/ja/intlayer_with_vite+react.md +11 -11
  186. package/docs/ja/intlayer_with_vite+vue.md +11 -11
  187. package/docs/ja/vs_code_extension.md +50 -111
  188. package/docs/ko/component_i18n.md +186 -0
  189. package/docs/ko/intlayer_with_angular.md +2 -2
  190. package/docs/ko/intlayer_with_astro.md +246 -0
  191. package/docs/ko/intlayer_with_create_react_app.md +3 -2
  192. package/docs/ko/intlayer_with_express.md +2 -2
  193. package/docs/ko/intlayer_with_nestjs.md +2 -2
  194. package/docs/ko/intlayer_with_nextjs_14.md +2 -2
  195. package/docs/ko/intlayer_with_nextjs_15.md +2 -2
  196. package/docs/ko/intlayer_with_nextjs_page_router.md +2 -2
  197. package/docs/ko/intlayer_with_nuxt.md +2 -2
  198. package/docs/ko/intlayer_with_react_native+expo.md +19 -28
  199. package/docs/ko/intlayer_with_react_router_v7.md +190 -244
  200. package/docs/ko/intlayer_with_tanstack.md +200 -270
  201. package/docs/ko/intlayer_with_vite+preact.md +9 -9
  202. package/docs/ko/intlayer_with_vite+react.md +9 -9
  203. package/docs/ko/intlayer_with_vite+vue.md +11 -11
  204. package/docs/ko/vs_code_extension.md +48 -109
  205. package/docs/pt/component_i18n.md +186 -0
  206. package/docs/pt/intlayer_with_angular.md +2 -2
  207. package/docs/pt/intlayer_with_astro.md +246 -0
  208. package/docs/pt/intlayer_with_create_react_app.md +3 -2
  209. package/docs/pt/intlayer_with_express.md +2 -2
  210. package/docs/pt/intlayer_with_nestjs.md +2 -2
  211. package/docs/pt/intlayer_with_nextjs_14.md +2 -2
  212. package/docs/pt/intlayer_with_nextjs_15.md +2 -2
  213. package/docs/pt/intlayer_with_nextjs_page_router.md +2 -2
  214. package/docs/pt/intlayer_with_nuxt.md +2 -2
  215. package/docs/pt/intlayer_with_react_native+expo.md +11 -20
  216. package/docs/pt/intlayer_with_react_router_v7.md +7 -13
  217. package/docs/pt/intlayer_with_tanstack.md +183 -258
  218. package/docs/pt/intlayer_with_vite+preact.md +9 -9
  219. package/docs/pt/intlayer_with_vite+react.md +9 -9
  220. package/docs/pt/intlayer_with_vite+vue.md +9 -9
  221. package/docs/pt/vs_code_extension.md +46 -107
  222. package/docs/ru/component_i18n.md +186 -0
  223. package/docs/ru/intlayer_with_angular.md +2 -2
  224. package/docs/ru/intlayer_with_astro.md +246 -0
  225. package/docs/ru/intlayer_with_create_react_app.md +3 -2
  226. package/docs/ru/intlayer_with_express.md +2 -2
  227. package/docs/ru/intlayer_with_nestjs.md +2 -2
  228. package/docs/ru/intlayer_with_nextjs_14.md +2 -2
  229. package/docs/ru/intlayer_with_nextjs_15.md +2 -2
  230. package/docs/ru/intlayer_with_nextjs_page_router.md +2 -2
  231. package/docs/ru/intlayer_with_nuxt.md +2 -2
  232. package/docs/ru/intlayer_with_react_native+expo.md +11 -20
  233. package/docs/ru/intlayer_with_react_router_v7.md +192 -238
  234. package/docs/ru/intlayer_with_tanstack.md +197 -269
  235. package/docs/ru/intlayer_with_vite+preact.md +9 -9
  236. package/docs/ru/intlayer_with_vite+react.md +9 -9
  237. package/docs/ru/intlayer_with_vite+vue.md +11 -11
  238. package/docs/ru/vs_code_extension.md +48 -109
  239. package/docs/tr/component_i18n.md +186 -0
  240. package/docs/tr/how_works_intlayer.md +1 -1
  241. package/docs/tr/index.md +1 -1
  242. package/docs/tr/intlayer_cli.md +1 -1
  243. package/docs/tr/intlayer_with_angular.md +4 -4
  244. package/docs/tr/intlayer_with_astro.md +246 -0
  245. package/docs/tr/intlayer_with_create_react_app.md +4 -4
  246. package/docs/tr/intlayer_with_express.md +3 -3
  247. package/docs/tr/intlayer_with_lynx+react.md +1 -1
  248. package/docs/tr/intlayer_with_nestjs.md +2 -2
  249. package/docs/tr/intlayer_with_nextjs_14.md +2 -2
  250. package/docs/tr/intlayer_with_nextjs_15.md +4 -4
  251. package/docs/tr/intlayer_with_nextjs_page_router.md +5 -5
  252. package/docs/tr/intlayer_with_nuxt.md +4 -4
  253. package/docs/tr/intlayer_with_react_native+expo.md +12 -21
  254. package/docs/tr/intlayer_with_react_router_v7.md +222 -267
  255. package/docs/tr/intlayer_with_tanstack.md +400 -303
  256. package/docs/tr/intlayer_with_vite+preact.md +12 -12
  257. package/docs/tr/intlayer_with_vite+react.md +12 -12
  258. package/docs/tr/intlayer_with_vite+solid.md +2 -2
  259. package/docs/tr/intlayer_with_vite+svelte.md +2 -2
  260. package/docs/tr/intlayer_with_vite+vue.md +12 -12
  261. package/docs/tr/introduction.md +1 -1
  262. package/docs/tr/packages/react-intlayer/useDictionary.md +1 -1
  263. package/docs/tr/packages/react-intlayer/useI18n.md +1 -1
  264. package/docs/tr/roadmap.md +1 -1
  265. package/docs/tr/vs_code_extension.md +54 -115
  266. package/docs/zh/component_i18n.md +186 -0
  267. package/docs/zh/intlayer_with_angular.md +2 -2
  268. package/docs/zh/intlayer_with_astro.md +246 -0
  269. package/docs/zh/intlayer_with_create_react_app.md +3 -2
  270. package/docs/zh/intlayer_with_express.md +2 -2
  271. package/docs/zh/intlayer_with_nestjs.md +2 -2
  272. package/docs/zh/intlayer_with_nextjs_14.md +2 -2
  273. package/docs/zh/intlayer_with_nextjs_15.md +2 -2
  274. package/docs/zh/intlayer_with_nextjs_page_router.md +2 -2
  275. package/docs/zh/intlayer_with_nuxt.md +2 -2
  276. package/docs/zh/intlayer_with_react_native+expo.md +19 -28
  277. package/docs/zh/intlayer_with_react_router_v7.md +200 -248
  278. package/docs/zh/intlayer_with_tanstack.md +208 -283
  279. package/docs/zh/intlayer_with_vite+preact.md +9 -9
  280. package/docs/zh/intlayer_with_vite+react.md +9 -9
  281. package/docs/zh/intlayer_with_vite+vue.md +9 -9
  282. package/docs/zh/vs_code_extension.md +51 -105
  283. package/package.json +10 -10
  284. package/src/generated/docs.entry.ts +32 -0
@@ -1048,38 +1048,38 @@ const App = () => (
1048
1048
  module.exports = App;
1049
1049
  ```
1050
1050
 
1051
- In parallel, you can also use the `intlayerMiddlewarePlugin` to add server-side routing to your application. This plugin will automatically detect the current locale based on the URL and set the appropriate locale cookie. If no locale is specified, the plugin will determine the most appropriate locale based on the user's browser language preferences. If no locale is detected, it will redirect to the default locale.
1051
+ In parallel, you can also use the `intlayerMiddleware` to add server-side routing to your application. This plugin will automatically detect the current locale based on the URL and set the appropriate locale cookie. If no locale is specified, the plugin will determine the most appropriate locale based on the user's browser language preferences. If no locale is detected, it will redirect to the default locale.
1052
1052
 
1053
1053
  ```typescript {3,7} fileName="vite.config.ts" codeFormat="typescript"
1054
1054
  import { defineConfig } from "vite";
1055
1055
  import preact from "@preact/preset-vite";
1056
- import { intlayer, intlayerMiddlewarePlugin } from "vite-intlayer";
1056
+ import { intlayer, intlayerMiddleware } from "vite-intlayer";
1057
1057
 
1058
1058
  // https://vitejs.dev/config/
1059
1059
  export default defineConfig({
1060
- plugins: [preact(), intlayer(), intlayerMiddlewarePlugin()],
1060
+ plugins: [preact(), intlayer(), intlayerMiddleware()],
1061
1061
  });
1062
1062
  ```
1063
1063
 
1064
1064
  ```javascript {3,7} fileName="vite.config.mjs" codeFormat="esm"
1065
1065
  import { defineConfig } from "vite";
1066
1066
  import preact from "@preact/preset-vite";
1067
- import { intlayer, intlayerMiddlewarePlugin } from "vite-intlayer";
1067
+ import { intlayer, intlayerMiddleware } from "vite-intlayer";
1068
1068
 
1069
1069
  // https://vitejs.dev/config/
1070
1070
  export default defineConfig({
1071
- plugins: [preact(), intlayer(), intlayerMiddlewarePlugin()],
1071
+ plugins: [preact(), intlayer(), intlayerMiddleware()],
1072
1072
  });
1073
1073
  ```
1074
1074
 
1075
1075
  ```javascript {3,7} fileName="vite.config.cjs" codeFormat="commonjs"
1076
1076
  const { defineConfig } = require("vite");
1077
1077
  const preact = require("@preact/preset-vite");
1078
- const { intlayer, intlayerMiddlewarePlugin } = require("vite-intlayer");
1078
+ const { intlayer, intlayerMiddleware } = require("vite-intlayer");
1079
1079
 
1080
1080
  // https://vitejs.dev/config/
1081
1081
  module.exports = defineConfig({
1082
- plugins: [preact(), intlayer(), intlayerMiddlewarePlugin()],
1082
+ plugins: [preact(), intlayer(), intlayerMiddleware()],
1083
1083
  });
1084
1084
  ```
1085
1085
 
@@ -1614,9 +1614,9 @@ module.exports = { LocalizedLink, checkIsExternalLink };
1614
1614
 
1615
1615
  Intlayer uses module augmentation to gain the benefits of TypeScript and strengthen your codebase.
1616
1616
 
1617
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png)
1617
+ ![Autocompletion](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true)
1618
1618
 
1619
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png)
1619
+ ![Translation error](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png?raw=true)
1620
1620
 
1621
1621
  Ensure your TypeScript configuration includes the autogenerated types.
1622
1622
 
@@ -1037,38 +1037,38 @@ const App = () => (
1037
1037
  );
1038
1038
  ```
1039
1039
 
1040
- In parallel, you can also use the `intlayerMiddlewarePlugin` to add server-side routing to your application. This plugin will automatically detect the current locale based on the URL and set the appropriate locale cookie. If no locale is specified, the plugin will determine the most appropriate locale based on the user's browser language preferences. If no locale is detected, it will redirect to the default locale.
1040
+ In parallel, you can also use the `intlayerMiddleware` to add server-side routing to your application. This plugin will automatically detect the current locale based on the URL and set the appropriate locale cookie. If no locale is specified, the plugin will determine the most appropriate locale based on the user's browser language preferences. If no locale is detected, it will redirect to the default locale.
1041
1041
 
1042
1042
  ```typescript {3,7} fileName="vite.config.ts" codeFormat="typescript"
1043
1043
  import { defineConfig } from "vite";
1044
1044
  import react from "@vitejs/plugin-react-swc";
1045
- import { intlayer, intlayerMiddlewarePlugin } from "vite-intlayer";
1045
+ import { intlayer, intlayerMiddleware } from "vite-intlayer";
1046
1046
 
1047
1047
  // https://vitejs.dev/config/
1048
1048
  export default defineConfig({
1049
- plugins: [react(), intlayer(), intlayerMiddlewarePlugin()],
1049
+ plugins: [react(), intlayer(), intlayerMiddleware()],
1050
1050
  });
1051
1051
  ```
1052
1052
 
1053
1053
  ```javascript {3,7} fileName="vite.config.mjs" codeFormat="esm"
1054
1054
  import { defineConfig } from "vite";
1055
1055
  import react from "@vitejs/plugin-react-swc";
1056
- import { intlayer, intlayerMiddlewarePlugin } from "vite-intlayer";
1056
+ import { intlayer, intlayerMiddleware } from "vite-intlayer";
1057
1057
 
1058
1058
  // https://vitejs.dev/config/
1059
1059
  export default defineConfig({
1060
- plugins: [react(), intlayer(), intlayerMiddlewarePlugin()],
1060
+ plugins: [react(), intlayer(), intlayerMiddleware()],
1061
1061
  });
1062
1062
  ```
1063
1063
 
1064
1064
  ```javascript {3,7} fileName="vite.config.cjs" codeFormat="commonjs"
1065
1065
  const { defineConfig } = require("vite");
1066
1066
  const react = require("@vitejs/plugin-react-swc");
1067
- const { intlayer, intlayerMiddlewarePlugin } = require("vite-intlayer");
1067
+ const { intlayer, intlayerMiddleware } = require("vite-intlayer");
1068
1068
 
1069
1069
  // https://vitejs.dev/config/
1070
1070
  module.exports = defineConfig({
1071
- plugins: [react(), intlayer(), intlayerMiddlewarePlugin()],
1071
+ plugins: [react(), intlayer(), intlayerMiddleware()],
1072
1072
  });
1073
1073
  ```
1074
1074
 
@@ -1632,9 +1632,9 @@ By integrating this `Link` component across your application, you maintain a coh
1632
1632
 
1633
1633
  Intlayer uses module augmentation to take advantage of TypeScript and make your codebase stronger.
1634
1634
 
1635
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png)
1635
+ ![Autocompletion](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true)
1636
1636
 
1637
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png)
1637
+ ![Translation error](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png?raw=true)
1638
1638
 
1639
1639
  Ensure your TypeScript configuration includes the autogenerated types.
1640
1640
 
@@ -672,38 +672,38 @@ import LocaleSwitcher from "@components/LocaleSwitcher.vue";
672
672
  </template>
673
673
  ```
674
674
 
675
- In parallel, you can also use the `intlayerMiddlewarePlugin` to add server-side routing to your application. This plugin will automatically detect the current locale based on the URL and set the appropriate locale cookie. If no locale is specified, the plugin will determine the most appropriate locale based on the user's browser language preferences. If no locale is detected, it will redirect to the default locale.
675
+ In parallel, you can also use the `intlayerMiddleware` to add server-side routing to your application. This plugin will automatically detect the current locale based on the URL and set the appropriate locale cookie. If no locale is specified, the plugin will determine the most appropriate locale based on the user's browser language preferences. If no locale is detected, it will redirect to the default locale.
676
676
 
677
677
  ```typescript {3,7} fileName="vite.config.ts" codeFormat="typescript"
678
678
  import { defineConfig } from "vite";
679
679
  import vue from "@vitejs/plugin-vue";
680
- import { intlayer, intlayerMiddlewarePlugin } from "vite-intlayer";
680
+ import { intlayer, intlayerMiddleware } from "vite-intlayer";
681
681
 
682
682
  // https://vitejs.dev/config/
683
683
  export default defineConfig({
684
- plugins: [vue(), intlayer(), intlayerMiddlewarePlugin()],
684
+ plugins: [vue(), intlayer(), intlayerMiddleware()],
685
685
  });
686
686
  ```
687
687
 
688
688
  ```javascript {3,7} fileName="vite.config.mjs" codeFormat="esm"
689
689
  import { defineConfig } from "vite";
690
690
  import vue from "@vitejs/plugin-vue";
691
- import { intlayer, intlayerMiddlewarePlugin } from "vite-intlayer";
691
+ import { intlayer, intlayerMiddleware } from "vite-intlayer";
692
692
 
693
693
  // https://vitejs.dev/config/
694
694
  export default defineConfig({
695
- plugins: [vue(), intlayer(), intlayerMiddlewarePlugin()],
695
+ plugins: [vue(), intlayer(), intlayerMiddleware()],
696
696
  });
697
697
  ```
698
698
 
699
699
  ```javascript {3,7} fileName="vite.config.cjs" codeFormat="commonjs"
700
700
  const { defineConfig } = require("vite");
701
701
  const vue = require("@vitejs/plugin-vue");
702
- const { intlayer, intlayerMiddlewarePlugin } = require("vite-intlayer");
702
+ const { intlayer, intlayerMiddleware } = require("vite-intlayer");
703
703
 
704
704
  // https://vitejs.dev/config/
705
705
  module.exports = defineConfig({
706
- plugins: [vue(), intlayer(), intlayerMiddlewarePlugin()],
706
+ plugins: [vue(), intlayer(), intlayerMiddleware()],
707
707
  });
708
708
  ```
709
709
 
@@ -721,9 +721,9 @@ To automatically update the URL when the user changes the language, you can modi
721
721
  </select>
722
722
  </div>
723
723
  const { defineConfig } = require("vite"); const vue =
724
- require("@vitejs/plugin-vue"); const { intlayer, intlayerMiddlewarePlugin } =
724
+ require("@vitejs/plugin-vue"); const { intlayer, intlayerMiddleware } =
725
725
  require("vite-intlayer"); // https://vitejs.dev/config/ module.exports =
726
- defineConfig({ plugins: [vue(), intlayer(), intlayerMiddlewarePlugin()], });
726
+ defineConfig({ plugins: [vue(), intlayer(), intlayerMiddleware()], });
727
727
  </template>
728
728
  ```
729
729
 
@@ -1062,9 +1062,9 @@ const { myMarkdownContent } = useIntlayer("my-component");
1062
1062
 
1063
1063
  Intlayer uses module augmentation to leverage the benefits of TypeScript and strengthen your codebase.
1064
1064
 
1065
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png)
1065
+ ![Autocompletion](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true)
1066
1066
 
1067
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png)
1067
+ ![Translation error](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png?raw=true)
1068
1068
 
1069
1069
  Ensure your TypeScript configuration includes the auto-generated types.
1070
1070
 
@@ -65,7 +65,7 @@ Depending on whether you're working on client-side or server-side components in
65
65
 
66
66
  It is crucial that all content keys are defined within content declaration files to prevent runtime errors and ensure type safety. This approach also facilitates TypeScript integration for compile-time validation.
67
67
 
68
- Instructions for setting up content declaration files are available [here](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/get_started.md).
68
+ Instructions for setting up content declaration files are available [here](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md).
69
69
 
70
70
  It's crucial that all content keys are defined within content declaration files to prevent runtime errors and ensure type safety. This approach also facilitates TypeScript integration for compile-time validation.
71
71
 
@@ -65,7 +65,7 @@ The hook accepts two parameters:
65
65
 
66
66
  ## Dictionary
67
67
 
68
- All dictionary keys must be declared within content declaration files to enhance type safety and avoid errors. You can find the [setup instructions here](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/get_started.md).
68
+ All dictionary keys must be declared within content declaration files to enhance type safety and avoid errors. You can find the [setup instructions here](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md).
69
69
 
70
70
  ## Example Usage in React
71
71
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2025-03-17
3
- updatedAt: 2025-09-22
3
+ updatedAt: 2025-09-30
4
4
  title: Official VS Code Extension
5
5
  description: Learn how to use the Intlayer extension in VS Code to enhance your development workflow. Quickly navigate between localised content and manage your dictionaries efficiently.
6
6
  keywords:
@@ -23,92 +23,36 @@ slugs:
23
23
 
24
24
  [**Intlayer**](https://marketplace.visualstudio.com/items?itemName=Intlayer.intlayer-vs-code-extension) is the official Visual Studio Code extension for **Intlayer**, designed to improve the developer experience when working with localised content in your projects.
25
25
 
26
- ![Intlayer VS Code Extension](https://github.com/aymericzip/intlayer/blob/main/docs/assets/vs_code_extension_demo.gif)
26
+ ![Intlayer VS Code Extension](https://github.com/aymericzip/intlayer/blob/main/docs/assets/vs_code_extension_demo.gif?raw=true)
27
27
 
28
28
  Extension link: [https://marketplace.visualstudio.com/items?itemName=Intlayer.intlayer-vs-code-extension](https://marketplace.visualstudio.com/items?itemName=Intlayer.intlayer-vs-code-extension)
29
29
 
30
30
  ## Features
31
31
 
32
- ### Instant Navigation
32
+ ![Fill dictionaries](https://github.com/aymericzip/intlayer-vs-code-extension/blob/master/assets/vscode_extention_fill_active_dictionary.gif?raw=true)
33
33
 
34
- **Go to Definition Support** – Use `⌘ + Click` (Mac) or `Ctrl + Click` (Windows/Linux) on a `useIntlayer` key to open the corresponding content file instantly.
35
- **Seamless Integration** – Works effortlessly with **react-intlayer** and **next-intlayer** projects.
36
- **Multi-language Support** – Supports localised content across different languages.
37
- **VS Code Integration** – Smoothly integrates with VS Code’s navigation and command palette.
38
-
39
- ### Dictionary Management Commands
40
-
41
- Manage your content dictionaries directly from VS Code:
42
-
43
- - **Build Dictionaries** – Generate content files based on your project structure.
44
- - **Push Dictionaries** – Upload the latest dictionary content to your repository.
45
- - **Pull Dictionaries** – Synchronise the latest dictionary content from your repository to your local environment.
34
+ - **Instant Navigation** – Quickly jump to the correct content file when clicking on a `useIntlayer` key.
46
35
  - **Fill Dictionaries** – Populate dictionaries with content from your project.
47
- - **Test Dictionaries** – Identify missing or incomplete translations.
48
-
49
- ### Content Declaration Generator
50
-
51
- Easily generate structured dictionary files in different formats:
52
36
 
53
- If you are currently working on a component, it will generate the `.content.{ts,tsx,js,jsx,mjs,cjs,json}` file for you.
37
+ ![List commands](https://github.com/aymericzip/intlayer-vs-code-extension/blob/master/assets/vscode_extention_list_commands.gif?raw=true)
54
38
 
55
- Example of component:
39
+ - **Easy access to Intlayer Commands** – Build, push, pull, fill, test content dictionaries with ease.
56
40
 
57
- ```tsx fileName="src/components/MyComponent/index.tsx"
58
- const MyComponent = () => {
59
- const { myTranslatedContent } = useIntlayer("my-component");
41
+ ![Create content file](https://github.com/aymericzip/intlayer-vs-code-extension/blob/master/assets/vscode_extention_create_content_file.gif?raw=true)
60
42
 
61
- return <span>{myTranslatedContent}</span>;
62
- };
63
- ```
64
-
65
- Generated file in TypeScript format:
43
+ - **Content Declaration Generator** – Create dictionary content files in various formats (`.ts`, `.esm`, `.cjs`, `.json`).
66
44
 
67
- ```tsx fileName="src/components/MyComponent/index.content.ts"
68
- import { t, type Dictionary } from "intlayer";
45
+ ![Test dictionaties](https://github.com/aymericzip/intlayer-vs-code-extension/blob/master/assets/vscode_extention_test_missing_dictionary.gif?raw=true)
69
46
 
70
- const componentContent = {
71
- key: "my-component",
72
- content: {
73
- myTranslatedContent: t({
74
- en: "Hello World",
75
- es: "Hola Mundo",
76
- fr: "Bonjour le monde",
77
- }),
78
- },
79
- };
47
+ - **Test Dictionaries** – Test dictionaries for missing translations.
80
48
 
81
- export default componentContent;
82
- ```
49
+ ![Rebuild dictionary](https://github.com/aymericzip/intlayer-vs-code-extension/blob/master/assets/vscode_extention_rebuild_dictionary.gif?raw=true)
83
50
 
84
- Available formats:
51
+ - **Keep your dictionaries up to date** – Keep your dictionaries up to date with the latest content from your project.
85
52
 
86
- - **TypeScript (`.ts`)**
87
- - **ES Module (`.esm`)**
88
- - **CommonJS (`.cjs`)**
89
- - **JSON (`.json`)**
90
-
91
- ### Intlayer Tab (Activity Bar)
53
+ ![Intlayer Tab (Activity Bar)](https://github.com/aymericzip/intlayer-vs-code-extension/blob/master/assets/vscode_extention_search_dictionary.gif?raw=true)
92
54
 
93
- Open the Intlayer tab by clicking the Intlayer icon in the VS Code Activity Bar. It contains two views:
94
-
95
- - **Search**: A live search bar to quickly filter dictionaries and their content. Typing updates the results instantly.
96
- - **Dictionaries**: A tree view of your environments/projects, dictionary keys, and the files contributing entries. You can:
97
- - Click a file to open it in the editor.
98
- - Use the toolbar to run actions: Build, Pull, Push, Fill, Refresh, Test, and Create Dictionary File.
99
- - Use the context menu for item‑specific actions:
100
- - On a dictionary: Pull or Push
101
- - On a file: Fill Dictionary
102
- - When you switch editors, the tree will reveal the matching file if it belongs to a dictionary.
103
-
104
- ## Installation
105
-
106
- You can install **Intlayer** directly from the VS Code Marketplace:
107
-
108
- 1. Open **VS Code**.
109
- 2. Go to the **Extensions Marketplace**.
110
- 3. Search for **"Intlayer"**.
111
- 4. Click **Install**.
55
+ - **Intlayer Tab (Activity Bar)** Browse and search dictionaries from a dedicated side tab with toolbar and context actions (Build, Pull, Push, Fill, Refresh, Test, Create File).
112
56
 
113
57
  ## Usage
114
58
 
@@ -124,60 +68,55 @@ You can install **Intlayer** directly from the VS Code Marketplace:
124
68
  3. **Command-click** (`⌘+Click` on macOS) or **Ctrl+Click** (on Windows/Linux) on the key (e.g., `"app"`).
125
69
  4. VS Code will automatically open the corresponding dictionary file, e.g., `src/app.content.ts`.
126
70
 
127
- ### Managing Content Dictionaries
128
-
129
71
  ### Intlayer Tab (Activity Bar)
130
72
 
131
73
  Use the side tab to browse and manage dictionaries:
132
74
 
133
75
  - Open the Intlayer icon in the Activity Bar.
134
76
  - In **Search**, type to filter dictionaries and entries in real time.
135
- - In **Dictionaries**, browse environments, dictionaries, and files. Use the toolbar for Build, Pull, Push, Fill, Refresh, Test, and Create Dictionary File. Rightclick for context actions (Pull/Push on dictionaries, Fill on files). The current editor file autoreveals in the tree when applicable.
77
+ - In **Dictionaries**, browse environments, dictionaries, and files. Use the toolbar for Build, Pull, Push, Fill, Refresh, Test, and Create Dictionary File. Right-click for context actions (Pull/Push on dictionaries, Fill on files). The current editor file auto-reveals in the tree when applicable.
136
78
 
137
- #### Building Dictionaries
79
+ ### Accessing the commands
138
80
 
139
- Generate all dictionary content files with:
81
+ You can access the commands from the **Command Palette**.
140
82
 
141
83
  ```sh
142
84
  Cmd + Shift + P (macOS) / Ctrl + Shift + P (Windows/Linux)
143
85
  ```
144
86
 
145
- Search for **Build Dictionaries** and execute the command.
146
-
147
- #### Pushing Dictionaries
148
-
149
- Upload the latest dictionary content:
150
-
151
- 1. Open the **Command Palette**.
152
- 2. Search for **Push Dictionaries**.
153
- 3. Select the dictionaries to push and confirm.
154
-
155
- #### Pulling Dictionaries
87
+ - **Build Dictionaries**
88
+ - **Push Dictionaries**
89
+ - **Pull Dictionaries**
90
+ - **Fill Dictionaries**
91
+ - **Test Dictionaries**
92
+ - **Create Dictionary File**
156
93
 
157
- Sync the latest dictionary content:
94
+ ### Loading Environment Variables
158
95
 
159
- 1. Open the **Command Palette**.
160
- 2. Search for **Pull Dictionaries**.
161
- 3. Choose the dictionaries to pull.
96
+ Intlayer recommends storing your AI API keys, as well as the Intlayer client ID and secret, in environment variables.
162
97
 
163
- #### Filling Dictionaries
98
+ The extension can load environment variables from your workspace to run Intlayer commands with the correct context.
164
99
 
165
- Fill dictionaries with content from your project:
100
+ - **Load order (by priority)**: `.env.<env>.local` → `.env.<env>` → `.env.local` → `.env`
101
+ - **Non-destructive**: existing `process.env` values are not overridden.
102
+ - **Scope**: files are resolved from the configured base directory (defaults to the workspace root).
166
103
 
167
- 1. Open the **Command Palette**.
168
- 2. Search for **Fill Dictionaries**.
169
- 3. Run the command to populate dictionaries.
104
+ #### Selecting the active environment
170
105
 
171
- #### Testing Dictionaries
106
+ - **Command Palette**: open the palette and run `Intlayer: Select Environment`, then choose the environment (e.g., `development`, `staging`, `production`). The extension will attempt to load the first available file in the priority list above and show a notification like “Loaded env from .env.<env>.local”.
107
+ - **Settings**: go to `Settings → Extensions → Intlayer`, and set:
108
+ - **Environment**: the environment name used to resolve `.env.<env>*` files.
109
+ - (Optional) **Env File**: an explicit path to a `.env` file. When provided, it takes precedence over the inferred list.
172
110
 
173
- Validate dictionaries and find missing translations:
111
+ #### Monorepos and custom directories
174
112
 
175
- 1. Open the **Command Palette**.
176
- 2. Search for **Test Dictionaries**.
177
- 3. Review the reported issues and fix as needed.
113
+ If your `.env` files reside outside the workspace root, set the **Base Directory** in `Settings → Extensions → Intlayer`. The loader will search for `.env` files relative to that directory.
178
114
 
179
115
  ## Doc History
180
116
 
181
- | Version | Date | Changes |
182
- | ------- | ---------- | ------------ |
183
- | 5.5.10 | 2025-06-29 | Init history |
117
+ | Version | Date | Changes |
118
+ | ------- | ---------- | ----------------------------------- |
119
+ | 6.1.5 | 2025-09-30 | Added demo gif |
120
+ | 6.1.0 | 2025-09-24 | Added environment selection section |
121
+ | 6.0.0 | 2025-09-22 | Intlayer Tab / Fill & Test commands |
122
+ | 5.5.10 | 2025-06-29 | Initial history |
@@ -0,0 +1,182 @@
1
+ ---
2
+ createdAt: 2024-03-07
3
+ updatedAt: 2025-09-30
4
+ title: Hacer un componente multilingüe (biblioteca i18n) en React y Next.js
5
+ description: Aprende a declarar y recuperar contenido localizado para construir un componente multilingüe de React o Next.js con Intlayer.
6
+ keywords:
7
+ - i18n
8
+ - componente
9
+ - react
10
+ - multilingüe
11
+ - next.js
12
+ - intlayer
13
+ slugs:
14
+ - doc
15
+ - component
16
+ - i18n
17
+ applicationTemplate: https://github.com/aymericzip/intlayer-vite-react-template
18
+ youtubeVideo: https://www.youtube.com/watch?v=dS9L7uJeak4
19
+ ---
20
+
21
+ # Cómo hacer un componente multilingüe (i18n) con Intlayer
22
+
23
+ Esta guía muestra los pasos mínimos para hacer que un componente de interfaz sea multilingüe en dos configuraciones comunes:
24
+
25
+ - React (Vite/SPA)
26
+ - Next.js (App Router)
27
+
28
+ Primero declararás tu contenido y luego lo recuperarás en tu componente.
29
+
30
+ ## 1) Declara tu contenido (compartido para React y Next.js)
31
+
32
+ Crea un archivo de declaración de contenido cerca de tu componente. Esto mantiene las traducciones cerca del lugar donde se usan y habilita la seguridad de tipos.
33
+
34
+ ```ts fileName="component.content.ts"
35
+ import { t, type Dictionary } from "intlayer";
36
+
37
+ const componentContent = {
38
+ key: "component-example",
39
+ content: {
40
+ title: t({
41
+ en: "Hello",
42
+ fr: "Bonjour",
43
+ es: "Hola",
44
+ }),
45
+ description: t({
46
+ en: "A multilingual React component",
47
+ fr: "Un composant React multilingue",
48
+ es: "Un componente React multilingüe",
49
+ }),
50
+ },
51
+ } satisfies Dictionary;
52
+
53
+ export default componentContent;
54
+ ```
55
+
56
+ También se admite JSON si prefieres archivos de configuración.
57
+
58
+ ```json fileName="component.content.json"
59
+ {
60
+ "$schema": "https://intlayer.org/schema.json",
61
+ "key": "component-example",
62
+ "content": {
63
+ "title": {
64
+ "nodeType": "translation",
65
+ "translation": { "en": "Hello", "fr": "Bonjour", "es": "Hola" }
66
+ },
67
+ "description": {
68
+ "nodeType": "translation",
69
+ "translation": {
70
+ "en": "A multilingual React component",
71
+ "fr": "Un composant React multilingue",
72
+ "es": "Un componente React multilingüe"
73
+ }
74
+ }
75
+ }
76
+ }
77
+ ```
78
+
79
+ ## 2) Recupera tu contenido
80
+
81
+ ### Caso A — Aplicación React (Vite/SPA)
82
+
83
+ Enfoque por defecto: usa `useIntlayer` para recuperar por clave. Esto mantiene los componentes ligeros y tipados.
84
+
85
+ ```tsx fileName="ComponentExample.tsx"
86
+ import { useIntlayer } from "react-intlayer";
87
+
88
+ export function ComponentExample() {
89
+ const content = useIntlayer("component-example");
90
+ return (
91
+ <div>
92
+ <h1>{content.title}</h1>
93
+ <p>{content.description}</p>
94
+ </div>
95
+ );
96
+ }
97
+ ```
98
+
99
+ Renderizado en servidor o fuera del provider: usa `react-intlayer/server` y pasa un `locale` explícito cuando sea necesario.
100
+
101
+ ```tsx fileName="ServerRenderedExample.tsx"
102
+ import { useIntlayer } from "react-intlayer/server";
103
+
104
+ export function ServerRenderedExample({ locale }: { locale: string }) {
105
+ const content = useIntlayer("component-example", locale);
106
+ return (
107
+ <>
108
+ <h1>{content.title}</h1>
109
+ <p>{content.description}</p>
110
+ </>
111
+ );
112
+ }
113
+ ```
114
+
115
+ Alternativa: `useDictionary` puede leer un objeto declarado completo si prefieres colocar la estructura en el punto de uso.
116
+
117
+ ```tsx fileName="ComponentWithDictionary.tsx"
118
+ import { useDictionary } from "react-intlayer";
119
+ import componentContent from "./component.content";
120
+
121
+ export function ComponentWithDictionary() {
122
+ const { title, description } = useDictionary(componentContent);
123
+ return (
124
+ <div>
125
+ <h1>{title}</h1>
126
+ <p>{description}</p>
127
+ </div>
128
+ );
129
+ }
130
+ ```
131
+
132
+ ### Caso B — Next.js (App Router)
133
+
134
+ Prefiere componentes de servidor por seguridad y rendimiento. Usa `useIntlayer` de `next-intlayer/server` en archivos de servidor, y `useIntlayer` de `next-intlayer` en componentes cliente.
135
+
136
+ ```tsx fileName="app/[locale]/example/ServerComponent.tsx"
137
+ import { useIntlayer } from "next-intlayer/server";
138
+
139
+ export default function ServerComponent() {
140
+ const content = useIntlayer("component-example");
141
+ return (
142
+ <>
143
+ <h1>{content.title}</h1>
144
+ <p>{content.description}</p>
145
+ </>
146
+ );
147
+ }
148
+ ```
149
+
150
+ ```tsx fileName="app/[locale]/example/ClientComponent.tsx"
151
+ "use client";
152
+
153
+ import { useIntlayer } from "next-intlayer";
154
+
155
+ export function ClientComponent() {
156
+ const content = useIntlayer("component-example");
157
+ return (
158
+ <div>
159
+ <h1>{content.title}</h1>
160
+ <p>{content.description}</p>
161
+ </div>
162
+ );
163
+ }
164
+ ```
165
+
166
+ Consejo: Para metadatos de página y SEO, también puedes obtener contenido con `getIntlayer` y generar URLs multilingües con `getMultilingualUrls`.
167
+
168
+ ## Por qué el enfoque de componentes de Intlayer es el mejor
169
+
170
+ - Colocación: Las declaraciones de contenido viven cerca de los componentes, reduciendo la deriva y mejorando la reutilización en los sistemas de diseño.
171
+ - Seguridad de tipos: Las claves y estructuras están fuertemente tipadas; las traducciones faltantes aparecen en tiempo de build en lugar de en tiempo de ejecución.
172
+ - Server-first: Funciona de forma nativa en componentes de servidor para mejor seguridad y rendimiento; los hooks de cliente siguen siendo ergonómicos.
173
+ - Tree-shaking: Solo se incluye el contenido usado por el componente, manteniendo cargas pequeñas en aplicaciones grandes.
174
+ - DX y herramientas: Middleware incorporado, asistentes de SEO y traducciones opcionales mediante Editor Visual/IA agilizan el trabajo diario.
175
+
176
+ ## Guías y referencias relacionadas
177
+
178
+ - Configuración React (Vite): https://intlayer.org/doc/environment/vite-and-react
179
+ - React Router v7: https://intlayer.org/doc/environment/vite-and-react/react-router-v7
180
+ - TanStack Start: https://intlayer.org/doc/environment/vite-and-react/tanstack-start
181
+ - Configuración Next.js: https://intlayer.org/doc/environment/nextjs
182
+ - Por qué Intlayer vs. next-intl vs. next-i18next: https://intlayer.org/blog/next-i18next-vs-next-intl-vs-intlayer
@@ -642,9 +642,9 @@ Para escenarios más complejos, puedes crear un pipe para renderizar el HTML de
642
642
 
643
643
  Intlayer utiliza la ampliación de módulos para aprovechar las ventajas de TypeScript y fortalecer tu base de código.
644
644
 
645
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png)
645
+ ![Autocompletion](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true)
646
646
 
647
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png)
647
+ ![Translation error](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png?raw=true)
648
648
 
649
649
  Asegúrate de que tu configuración de TypeScript incluya los tipos autogenerados.
650
650