@intlayer/docs 6.1.6-canary.0 → 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 (242) hide show
  1. package/blog/en/next-i18next_vs_next-intl_vs_intlayer.md +71 -80
  2. package/dist/cjs/generated/docs.entry.cjs +16 -0
  3. package/dist/cjs/generated/docs.entry.cjs.map +1 -1
  4. package/dist/esm/generated/docs.entry.mjs +16 -0
  5. package/dist/esm/generated/docs.entry.mjs.map +1 -1
  6. package/dist/types/generated/docs.entry.d.ts +1 -0
  7. package/dist/types/generated/docs.entry.d.ts.map +1 -1
  8. package/docs/ar/intlayer_with_angular.md +2 -2
  9. package/docs/ar/intlayer_with_astro.md +246 -0
  10. package/docs/ar/intlayer_with_create_react_app.md +3 -2
  11. package/docs/ar/intlayer_with_express.md +2 -2
  12. package/docs/ar/intlayer_with_nestjs.md +2 -2
  13. package/docs/ar/intlayer_with_nextjs_14.md +2 -2
  14. package/docs/ar/intlayer_with_nextjs_15.md +2 -2
  15. package/docs/ar/intlayer_with_nextjs_page_router.md +2 -2
  16. package/docs/ar/intlayer_with_nuxt.md +2 -2
  17. package/docs/ar/intlayer_with_react_native+expo.md +11 -20
  18. package/docs/ar/intlayer_with_react_router_v7.md +195 -241
  19. package/docs/ar/intlayer_with_tanstack.md +198 -272
  20. package/docs/ar/intlayer_with_vite+preact.md +9 -9
  21. package/docs/ar/intlayer_with_vite+react.md +7 -7
  22. package/docs/ar/intlayer_with_vite+vue.md +9 -9
  23. package/docs/de/intlayer_with_angular.md +2 -2
  24. package/docs/de/intlayer_with_astro.md +246 -0
  25. package/docs/de/intlayer_with_create_react_app.md +2 -2
  26. package/docs/de/intlayer_with_express.md +2 -2
  27. package/docs/de/intlayer_with_nestjs.md +2 -2
  28. package/docs/de/intlayer_with_nextjs_14.md +2 -2
  29. package/docs/de/intlayer_with_nextjs_15.md +2 -2
  30. package/docs/de/intlayer_with_nextjs_page_router.md +2 -2
  31. package/docs/de/intlayer_with_nuxt.md +2 -2
  32. package/docs/de/intlayer_with_react_native+expo.md +11 -20
  33. package/docs/de/intlayer_with_react_router_v7.md +193 -242
  34. package/docs/de/intlayer_with_tanstack.md +194 -266
  35. package/docs/de/intlayer_with_vite+preact.md +9 -9
  36. package/docs/de/intlayer_with_vite+react.md +9 -9
  37. package/docs/de/intlayer_with_vite+vue.md +11 -11
  38. package/docs/de/packages/vite-intlayer/index.md +3 -3
  39. package/docs/en/how_works_intlayer.md +1 -1
  40. package/docs/en/index.md +1 -1
  41. package/docs/en/intlayer_cli.md +1 -1
  42. package/docs/en/intlayer_with_angular.md +4 -4
  43. package/docs/en/intlayer_with_astro.md +246 -0
  44. package/docs/en/intlayer_with_create_react_app.md +4 -4
  45. package/docs/en/intlayer_with_express.md +3 -3
  46. package/docs/en/intlayer_with_lynx+react.md +1 -1
  47. package/docs/en/intlayer_with_nestjs.md +2 -2
  48. package/docs/en/intlayer_with_nextjs_14.md +13 -4
  49. package/docs/en/intlayer_with_nextjs_15.md +13 -4
  50. package/docs/en/intlayer_with_nextjs_page_router.md +5 -5
  51. package/docs/en/intlayer_with_nuxt.md +4 -4
  52. package/docs/en/intlayer_with_react_native+expo.md +46 -24
  53. package/docs/en/intlayer_with_react_router_v7.md +164 -211
  54. package/docs/en/intlayer_with_tanstack.md +166 -241
  55. package/docs/en/intlayer_with_vite+preact.md +12 -12
  56. package/docs/en/intlayer_with_vite+react.md +12 -12
  57. package/docs/en/intlayer_with_vite+solid.md +2 -2
  58. package/docs/en/intlayer_with_vite+svelte.md +2 -2
  59. package/docs/en/intlayer_with_vite+vue.md +12 -12
  60. package/docs/en/introduction.md +1 -1
  61. package/docs/en/packages/next-intlayer/useDictionary.md +1 -1
  62. package/docs/en/packages/next-intlayer/useIntlayer.md +1 -1
  63. package/docs/en/packages/react-intlayer/useDictionary.md +1 -1
  64. package/docs/en/packages/react-intlayer/useI18n.md +1 -1
  65. package/docs/en/packages/react-intlayer/useIntlayer.md +1 -1
  66. package/docs/en/releases/v6.md +1 -0
  67. package/docs/en/roadmap.md +1 -1
  68. package/docs/en-GB/intlayer_with_angular.md +3 -3
  69. package/docs/en-GB/intlayer_with_astro.md +246 -0
  70. package/docs/en-GB/intlayer_with_create_react_app.md +5 -4
  71. package/docs/en-GB/intlayer_with_express.md +2 -2
  72. package/docs/en-GB/intlayer_with_nestjs.md +2 -2
  73. package/docs/en-GB/intlayer_with_nextjs_14.md +4 -4
  74. package/docs/en-GB/intlayer_with_nextjs_15.md +2 -2
  75. package/docs/en-GB/intlayer_with_nextjs_page_router.md +2 -2
  76. package/docs/en-GB/intlayer_with_nuxt.md +2 -2
  77. package/docs/en-GB/intlayer_with_react_native+expo.md +11 -20
  78. package/docs/en-GB/intlayer_with_react_router_v7.md +171 -220
  79. package/docs/en-GB/intlayer_with_tanstack.md +174 -248
  80. package/docs/en-GB/intlayer_with_vite+preact.md +9 -9
  81. package/docs/en-GB/intlayer_with_vite+react.md +9 -9
  82. package/docs/en-GB/intlayer_with_vite+vue.md +11 -11
  83. package/docs/en-GB/packages/next-intlayer/useIntlayer.md +1 -1
  84. package/docs/en-GB/packages/react-intlayer/useIntlayer.md +1 -1
  85. package/docs/es/intlayer_with_angular.md +2 -2
  86. package/docs/es/intlayer_with_astro.md +246 -0
  87. package/docs/es/intlayer_with_create_react_app.md +3 -2
  88. package/docs/es/intlayer_with_express.md +2 -2
  89. package/docs/es/intlayer_with_nextjs_14.md +2 -2
  90. package/docs/es/intlayer_with_nextjs_15.md +2 -2
  91. package/docs/es/intlayer_with_react_native+expo.md +11 -20
  92. package/docs/es/intlayer_with_react_router_v7.md +188 -232
  93. package/docs/es/intlayer_with_tanstack.md +203 -273
  94. package/docs/es/intlayer_with_vite+preact.md +7 -7
  95. package/docs/es/intlayer_with_vite+react.md +7 -7
  96. package/docs/es/intlayer_with_vite+vue.md +9 -9
  97. package/docs/fr/intlayer_with_angular.md +2 -2
  98. package/docs/fr/intlayer_with_astro.md +246 -0
  99. package/docs/fr/intlayer_with_create_react_app.md +3 -2
  100. package/docs/fr/intlayer_with_express.md +2 -2
  101. package/docs/fr/intlayer_with_nestjs.md +2 -2
  102. package/docs/fr/intlayer_with_nextjs_14.md +2 -2
  103. package/docs/fr/intlayer_with_react_native+expo.md +11 -20
  104. package/docs/fr/intlayer_with_react_router_v7.md +188 -248
  105. package/docs/fr/intlayer_with_tanstack.md +192 -265
  106. package/docs/fr/intlayer_with_vite+preact.md +7 -7
  107. package/docs/fr/intlayer_with_vite+react.md +7 -7
  108. package/docs/fr/intlayer_with_vite+vue.md +9 -9
  109. package/docs/hi/intlayer_cli.md +1 -4
  110. package/docs/hi/intlayer_with_angular.md +2 -2
  111. package/docs/hi/intlayer_with_astro.md +246 -0
  112. package/docs/hi/intlayer_with_create_react_app.md +2 -2
  113. package/docs/hi/intlayer_with_express.md +2 -2
  114. package/docs/hi/intlayer_with_nestjs.md +2 -2
  115. package/docs/hi/intlayer_with_nextjs_14.md +2 -2
  116. package/docs/hi/intlayer_with_nextjs_15.md +2 -2
  117. package/docs/hi/intlayer_with_nextjs_page_router.md +2 -2
  118. package/docs/hi/intlayer_with_nuxt.md +2 -2
  119. package/docs/hi/intlayer_with_react_native+expo.md +11 -20
  120. package/docs/hi/intlayer_with_react_router_v7.md +199 -243
  121. package/docs/hi/intlayer_with_tanstack.md +210 -285
  122. package/docs/hi/intlayer_with_vite+preact.md +9 -9
  123. package/docs/hi/intlayer_with_vite+react.md +9 -9
  124. package/docs/hi/intlayer_with_vite+solid.md +1 -1
  125. package/docs/hi/intlayer_with_vite+vue.md +11 -11
  126. package/docs/it/intlayer_with_angular.md +2 -2
  127. package/docs/it/intlayer_with_astro.md +246 -0
  128. package/docs/it/intlayer_with_create_react_app.md +3 -2
  129. package/docs/it/intlayer_with_express.md +2 -2
  130. package/docs/it/intlayer_with_nestjs.md +2 -2
  131. package/docs/it/intlayer_with_nextjs_14.md +2 -2
  132. package/docs/it/intlayer_with_nextjs_15.md +2 -2
  133. package/docs/it/intlayer_with_nextjs_page_router.md +2 -2
  134. package/docs/it/intlayer_with_nuxt.md +2 -2
  135. package/docs/it/intlayer_with_react_native+expo.md +11 -21
  136. package/docs/it/intlayer_with_react_router_v7.md +195 -242
  137. package/docs/it/intlayer_with_tanstack.md +203 -267
  138. package/docs/it/intlayer_with_vite+preact.md +9 -9
  139. package/docs/it/intlayer_with_vite+react.md +13 -11
  140. package/docs/it/intlayer_with_vite+vue.md +11 -11
  141. package/docs/ja/intlayer_with_angular.md +2 -2
  142. package/docs/ja/intlayer_with_astro.md +246 -0
  143. package/docs/ja/intlayer_with_create_react_app.md +3 -2
  144. package/docs/ja/intlayer_with_express.md +2 -2
  145. package/docs/ja/intlayer_with_nestjs.md +2 -2
  146. package/docs/ja/intlayer_with_nextjs_14.md +2 -2
  147. package/docs/ja/intlayer_with_nextjs_15.md +2 -2
  148. package/docs/ja/intlayer_with_nextjs_page_router.md +2 -2
  149. package/docs/ja/intlayer_with_nuxt.md +2 -2
  150. package/docs/ja/intlayer_with_react_native+expo.md +18 -29
  151. package/docs/ja/intlayer_with_react_router_v7.md +204 -250
  152. package/docs/ja/intlayer_with_tanstack.md +218 -286
  153. package/docs/ja/intlayer_with_vite+preact.md +9 -9
  154. package/docs/ja/intlayer_with_vite+react.md +11 -11
  155. package/docs/ja/intlayer_with_vite+vue.md +11 -11
  156. package/docs/ko/intlayer_with_angular.md +2 -2
  157. package/docs/ko/intlayer_with_astro.md +246 -0
  158. package/docs/ko/intlayer_with_create_react_app.md +3 -2
  159. package/docs/ko/intlayer_with_express.md +2 -2
  160. package/docs/ko/intlayer_with_nestjs.md +2 -2
  161. package/docs/ko/intlayer_with_nextjs_14.md +2 -2
  162. package/docs/ko/intlayer_with_nextjs_15.md +2 -2
  163. package/docs/ko/intlayer_with_nextjs_page_router.md +2 -2
  164. package/docs/ko/intlayer_with_nuxt.md +2 -2
  165. package/docs/ko/intlayer_with_react_native+expo.md +19 -28
  166. package/docs/ko/intlayer_with_react_router_v7.md +190 -244
  167. package/docs/ko/intlayer_with_tanstack.md +200 -270
  168. package/docs/ko/intlayer_with_vite+preact.md +9 -9
  169. package/docs/ko/intlayer_with_vite+react.md +9 -9
  170. package/docs/ko/intlayer_with_vite+vue.md +11 -11
  171. package/docs/pt/intlayer_with_angular.md +2 -2
  172. package/docs/pt/intlayer_with_astro.md +246 -0
  173. package/docs/pt/intlayer_with_create_react_app.md +3 -2
  174. package/docs/pt/intlayer_with_express.md +2 -2
  175. package/docs/pt/intlayer_with_nestjs.md +2 -2
  176. package/docs/pt/intlayer_with_nextjs_14.md +2 -2
  177. package/docs/pt/intlayer_with_nextjs_15.md +2 -2
  178. package/docs/pt/intlayer_with_nextjs_page_router.md +2 -2
  179. package/docs/pt/intlayer_with_nuxt.md +2 -2
  180. package/docs/pt/intlayer_with_react_native+expo.md +11 -20
  181. package/docs/pt/intlayer_with_react_router_v7.md +7 -13
  182. package/docs/pt/intlayer_with_tanstack.md +183 -258
  183. package/docs/pt/intlayer_with_vite+preact.md +9 -9
  184. package/docs/pt/intlayer_with_vite+react.md +9 -9
  185. package/docs/pt/intlayer_with_vite+vue.md +9 -9
  186. package/docs/ru/intlayer_with_angular.md +2 -2
  187. package/docs/ru/intlayer_with_astro.md +246 -0
  188. package/docs/ru/intlayer_with_create_react_app.md +3 -2
  189. package/docs/ru/intlayer_with_express.md +2 -2
  190. package/docs/ru/intlayer_with_nestjs.md +2 -2
  191. package/docs/ru/intlayer_with_nextjs_14.md +2 -2
  192. package/docs/ru/intlayer_with_nextjs_15.md +2 -2
  193. package/docs/ru/intlayer_with_nextjs_page_router.md +2 -2
  194. package/docs/ru/intlayer_with_nuxt.md +2 -2
  195. package/docs/ru/intlayer_with_react_native+expo.md +11 -20
  196. package/docs/ru/intlayer_with_react_router_v7.md +192 -238
  197. package/docs/ru/intlayer_with_tanstack.md +197 -269
  198. package/docs/ru/intlayer_with_vite+preact.md +9 -9
  199. package/docs/ru/intlayer_with_vite+react.md +9 -9
  200. package/docs/ru/intlayer_with_vite+vue.md +11 -11
  201. package/docs/tr/how_works_intlayer.md +1 -1
  202. package/docs/tr/index.md +1 -1
  203. package/docs/tr/intlayer_cli.md +1 -1
  204. package/docs/tr/intlayer_with_angular.md +4 -4
  205. package/docs/tr/intlayer_with_astro.md +246 -0
  206. package/docs/tr/intlayer_with_create_react_app.md +4 -4
  207. package/docs/tr/intlayer_with_express.md +3 -3
  208. package/docs/tr/intlayer_with_lynx+react.md +1 -1
  209. package/docs/tr/intlayer_with_nestjs.md +2 -2
  210. package/docs/tr/intlayer_with_nextjs_14.md +2 -2
  211. package/docs/tr/intlayer_with_nextjs_15.md +4 -4
  212. package/docs/tr/intlayer_with_nextjs_page_router.md +5 -5
  213. package/docs/tr/intlayer_with_nuxt.md +4 -4
  214. package/docs/tr/intlayer_with_react_native+expo.md +12 -21
  215. package/docs/tr/intlayer_with_react_router_v7.md +222 -267
  216. package/docs/tr/intlayer_with_tanstack.md +400 -303
  217. package/docs/tr/intlayer_with_vite+preact.md +12 -12
  218. package/docs/tr/intlayer_with_vite+react.md +12 -12
  219. package/docs/tr/intlayer_with_vite+solid.md +2 -2
  220. package/docs/tr/intlayer_with_vite+svelte.md +2 -2
  221. package/docs/tr/intlayer_with_vite+vue.md +12 -12
  222. package/docs/tr/introduction.md +1 -1
  223. package/docs/tr/packages/react-intlayer/useDictionary.md +1 -1
  224. package/docs/tr/packages/react-intlayer/useI18n.md +1 -1
  225. package/docs/tr/roadmap.md +1 -1
  226. package/docs/zh/intlayer_with_angular.md +2 -2
  227. package/docs/zh/intlayer_with_astro.md +246 -0
  228. package/docs/zh/intlayer_with_create_react_app.md +3 -2
  229. package/docs/zh/intlayer_with_express.md +2 -2
  230. package/docs/zh/intlayer_with_nestjs.md +2 -2
  231. package/docs/zh/intlayer_with_nextjs_14.md +2 -2
  232. package/docs/zh/intlayer_with_nextjs_15.md +2 -2
  233. package/docs/zh/intlayer_with_nextjs_page_router.md +2 -2
  234. package/docs/zh/intlayer_with_nuxt.md +2 -2
  235. package/docs/zh/intlayer_with_react_native+expo.md +19 -28
  236. package/docs/zh/intlayer_with_react_router_v7.md +200 -248
  237. package/docs/zh/intlayer_with_tanstack.md +208 -283
  238. package/docs/zh/intlayer_with_vite+preact.md +9 -9
  239. package/docs/zh/intlayer_with_vite+react.md +9 -9
  240. package/docs/zh/intlayer_with_vite+vue.md +9 -9
  241. package/package.json +11 -11
  242. package/src/generated/docs.entry.ts +16 -0
@@ -2,7 +2,7 @@
2
2
  createdAt: 2025-09-09
3
3
  updatedAt: 2025-09-09
4
4
  title: Comenzando con Intlayer en Tanstack Start
5
- description: Aprende cómo agregar internacionalización (i18n) a tu aplicación Tanstack Start usando Intlayer. Sigue esta guía completa para hacer tu aplicación multilingüe con enrutamiento consciente del locale.
5
+ description: Aprende cómo agregar internacionalización (i18n) a tu aplicación Tanstack Start usando Intlayer. Sigue esta guía completa para hacer que tu aplicación sea multilingüe con enrutamiento consciente de la configuración regional.
6
6
  keywords:
7
7
  - Internacionalización
8
8
  - Documentación
@@ -11,19 +11,17 @@ keywords:
11
11
  - React
12
12
  - i18n
13
13
  - TypeScript
14
- - Enrutamiento por Locale
14
+ - Enrutamiento por Configuración Regional
15
15
  slugs:
16
16
  - doc
17
17
  - environment
18
- - vite-and-react
19
18
  - tanstack-start
20
- applicationTemplate: https://github.com/AydinTheFirst/tanstack-start-intlayer
21
- author: AydinTheFirst
19
+ applicationTemplate: https://github.com/aymericzip/intlayer-tanstack-start-template
22
20
  ---
23
21
 
24
22
  # Comenzando con la Internacionalización (i18n) usando Intlayer y Tanstack Start
25
23
 
26
- Esta guía demuestra cómo integrar **Intlayer** para una internacionalización fluida en proyectos Tanstack Start con enrutamiento consciente del locale, soporte para TypeScript y prácticas modernas de desarrollo.
24
+ Esta guía demuestra cómo integrar **Intlayer** para una internacionalización fluida en proyectos Tanstack Start con enrutamiento consciente de la configuración regional, soporte para TypeScript y prácticas modernas de desarrollo.
27
25
 
28
26
  ## ¿Qué es Intlayer?
29
27
 
@@ -34,18 +32,18 @@ Con Intlayer, puedes:
34
32
  - **Gestionar traducciones fácilmente** usando diccionarios declarativos a nivel de componente.
35
33
  - **Localizar dinámicamente metadatos**, rutas y contenido.
36
34
  - **Garantizar soporte para TypeScript** con tipos autogenerados, mejorando la autocompletación y la detección de errores.
37
- - **Beneficiarte de características avanzadas**, como la detección y cambio dinámico de locale.
38
- - **Habilitar enrutamiento consciente del locale** con el sistema de enrutamiento basado en archivos de Tanstack Start.
35
+ - **Beneficiarte de características avanzadas**, como la detección y el cambio dinámico de configuración regional.
36
+ - **Habilitar enrutamiento consciente de la configuración regional** con el sistema de enrutamiento basado en archivos de Tanstack Start.
39
37
 
40
38
  ---
41
39
 
42
40
  ## Guía paso a paso para configurar Intlayer en una aplicación Tanstack Start
43
41
 
44
- ### Paso 1: Crear el proyecto
42
+ ### Paso 1: Crear proyecto
45
43
 
46
44
  Comienza creando un nuevo proyecto TanStack Start siguiendo la guía [Start new project](https://tanstack.com/start/latest/docs/framework/react/quick-start) en el sitio web de TanStack Start.
47
45
 
48
- ### Paso 2: Instalar los paquetes de Intlayer
46
+ ### Paso 2: Instalar paquetes de Intlayer
49
47
 
50
48
  Instala los paquetes necesarios usando tu gestor de paquetes preferido:
51
49
 
@@ -63,19 +61,19 @@ pnpm add vite-intlayer --save-dev
63
61
 
64
62
  - **intlayer**
65
63
 
66
- El paquete principal que proporciona herramientas de internacionalización para la gestión de configuración, traducción, [declaración de contenido](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/dictionary/get_started.md), transpilación y [comandos CLI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/intlayer_cli.md).
64
+ El paquete principal que proporciona herramientas de internacionalización para la gestión de configuración, traducción, [declaración de contenido](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/dictionary/get_started.md), transpileación y [comandos CLI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/intlayer_cli.md).
67
65
 
68
66
  - **react-intlayer**
69
67
  El paquete que integra Intlayer con aplicaciones React. Proporciona proveedores de contexto y hooks para la internacionalización en React.
70
68
 
71
69
  - **vite-intlayer**
72
- Incluye el plugin de Vite para integrar Intlayer con el [empaquetador Vite](https://vite.dev/guide/why.html#why-bundle-for-production), así como middleware para detectar el locale preferido del usuario, gestionar cookies y manejar redirecciones de URL.
70
+ Incluye el plugin de Vite para integrar Intlayer con el [empaquetador Vite](https://vite.dev/guide/why.html#why-bundle-for-production), así como middleware para detectar la configuración regional preferida del usuario, gestionar cookies y manejar redirecciones de URL.
73
71
 
74
72
  ### Paso 3: Configuración de tu proyecto
75
73
 
76
- Crea un archivo de configuración para configurar los idiomas de tu aplicación:
74
+ Cree un archivo de configuración para configurar los idiomas de su aplicación:
77
75
 
78
- ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
76
+ ```typescript fileName="intlayer.config.ts"
79
77
  import type { IntlayerConfig } from "intlayer";
80
78
 
81
79
  import { Locales } from "intlayer";
@@ -83,90 +81,40 @@ import { Locales } from "intlayer";
83
81
  const config: IntlayerConfig = {
84
82
  internationalization: {
85
83
  defaultLocale: Locales.ENGLISH,
86
- locales: [
87
- Locales.ENGLISH,
88
- Locales.FRENCH,
89
- Locales.SPANISH,
90
- // Tus otros idiomas
91
- ],
84
+ locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
92
85
  },
93
86
  };
94
87
 
95
88
  export default config;
96
89
  ```
97
90
 
98
- ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
99
- import { Locales } from "intlayer";
100
-
101
- /** @type {import('intlayer').IntlayerConfig} */
102
- const config = {
103
- internationalization: {
104
- defaultLocale: Locales.ENGLISH,
105
- locales: [
106
- Locales.ENGLISH,
107
- Locales.FRENCH,
108
- Locales.SPANISH,
109
- // Tus otros idiomas
110
- ],
111
- },
112
- };
113
-
114
- export default config;
115
- ```
116
-
117
- ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
118
- const { Locales } = require("intlayer");
119
-
120
- /** @type {import('intlayer').IntlayerConfig} */
121
- const config = {
122
- internationalization: {
123
- defaultLocale: Locales.ENGLISH,
124
- locales: [
125
- Locales.ENGLISH,
126
- Locales.FRENCH,
127
- Locales.SPANISH,
128
- // Tus otros idiomas
129
- ],
130
- },
131
- };
132
-
133
- module.exports = config;
134
- ```
135
-
136
- > A través de este archivo de configuración, puedes configurar URLs localizadas, redirección de middleware, nombres de cookies, la ubicación y extensión de tus declaraciones de contenido, desactivar los registros de Intlayer en la consola y más. Para una lista completa de los parámetros disponibles, consulta la [documentación de configuración](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/configuration.md).
91
+ > A través de este archivo de configuración, puede configurar URLs localizadas, redirección mediante middleware, nombres de cookies, la ubicación y extensión de sus declaraciones de contenido, desactivar los registros de Intlayer en la consola y más. Para una lista completa de los parámetros disponibles, consulte la [documentación de configuración](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/configuration.md).
137
92
 
138
93
  ### Paso 4: Integra Intlayer en tu configuración de Vite
139
94
 
140
95
  Agrega el plugin intlayer en tu configuración:
141
96
 
142
- ```typescript fileName="vite.config.ts" codeFormat="typescript"
97
+ ```typescript fileName="vite.config.ts"
143
98
  import { reactRouter } from "@react-router/dev/vite";
144
99
  import { defineConfig } from "vite";
145
- import { intlayerMiddlewarePlugin, intlayer } from "vite-intlayer";
100
+ import { intlayer } from "vite-intlayer";
146
101
  import tsconfigPaths from "vite-tsconfig-paths";
147
102
 
148
103
  export default defineConfig({
149
- plugins: [
150
- reactRouter(),
151
- tsconfigPaths(),
152
- intlayer(),
153
- intlayerMiddlewarePlugin(),
154
- ],
104
+ plugins: [reactRouter(), tsconfigPaths(), intlayer()],
155
105
  });
156
106
  ```
157
107
 
158
- > El plugin `intlayer()` de Vite se utiliza para integrar Intlayer con Vite. Asegura la construcción de los archivos de declaración de contenido y los supervisa en modo desarrollo. Define las variables de entorno de Intlayer dentro de la aplicación Vite. Además, proporciona alias para optimizar el rendimiento.
108
+ > El plugin `intlayer()` para Vite se utiliza para integrar Intlayer con Vite. Asegura la construcción de los archivos de declaración de contenido y los monitorea en modo desarrollo. Define variables de entorno de Intlayer dentro de la aplicación Vite. Además, proporciona alias para optimizar el rendimiento.
159
109
 
160
- ### Paso 5: Crear Componentes de Layout
110
+ ### Paso 5: Crear Componentes de Diseño
161
111
 
162
- Configura tu layout raíz y los layouts específicos por locale:
112
+ Configura tu diseño raíz y los diseños específicos por localización:
163
113
 
164
- #### Layout Raíz
114
+ #### Diseño Raíz
165
115
 
166
- ```tsx fileName="src/routes/{-$locale}/route.tsx" codeFormat="typescript"
167
- // src/routes/{-$locale}/route.tsx
116
+ ```tsx fileName="src/routes/{-$locale}/route.tsx"
168
117
  import { createFileRoute, Navigate, Outlet } from "@tanstack/react-router";
169
- import { configuration } from "intlayer";
170
118
  import { IntlayerProvider, useLocale } from "react-intlayer";
171
119
 
172
120
  import { useI18nHTMLAttributes } from "@/hooks/useI18nHTMLAttributes";
@@ -176,10 +124,11 @@ export const Route = createFileRoute("/{-$locale}")({
176
124
  });
177
125
 
178
126
  function LayoutComponent() {
127
+ const { defaultLocale } = useLocale();
179
128
  const { locale } = Route.useParams();
180
129
 
181
130
  return (
182
- <IntlayerProvider locale={locale}>
131
+ <IntlayerProvider locale={defaultLocale}>
183
132
  <Outlet />
184
133
  </IntlayerProvider>
185
134
  );
@@ -188,9 +137,9 @@ function LayoutComponent() {
188
137
 
189
138
  ### Paso 6: Declara Tu Contenido
190
139
 
191
- Crea y gestiona tus declaraciones de contenido para almacenar traducciones:
140
+ Crea y administra tus declaraciones de contenido para almacenar traducciones:
192
141
 
193
- ```tsx fileName="src/contents/page.content.ts" contentDeclarationFormat="typescript"
142
+ ```tsx fileName="src/contents/page.content.ts"
194
143
  import type { Dictionary } from "intlayer";
195
144
 
196
145
  import { t } from "intlayer";
@@ -204,20 +153,20 @@ const appContent = {
204
153
  fr: "À propos",
205
154
  }),
206
155
  home: t({
207
- en: "Inicio",
156
+ en: "Home",
208
157
  es: "Inicio",
209
158
  fr: "Accueil",
210
159
  }),
211
160
  },
212
161
  meta: {
213
162
  description: t({
214
- en: "Este es un ejemplo de uso de Intlayer con TanStack Router",
163
+ en: "This is an example of using Intlayer with TanStack Router",
215
164
  es: "Este es un ejemplo de uso de Intlayer con TanStack Router",
216
165
  fr: "Ceci est un exemple d'utilisation d'Intlayer avec TanStack Router",
217
166
  }),
218
167
  },
219
168
  title: t({
220
- en: "Bienvenido a Intlayer + TanStack Router",
169
+ en: "Welcome to Intlayer + TanStack Router",
221
170
  es: "Bienvenido a Intlayer + TanStack Router",
222
171
  fr: "Bienvenue à Intlayer + TanStack Router",
223
172
  }),
@@ -225,101 +174,133 @@ const appContent = {
225
174
  key: "app",
226
175
  } satisfies Dictionary;
227
176
 
177
+ export default appContent;
178
+ fr: "Bienvenue à Intlayer + TanStack Router",
179
+ }),
180
+ },
181
+ key: "app",
182
+ } satisfies Dictionary;
183
+
228
184
  export default appContent;
229
185
  ```
230
186
 
231
- > Tus declaraciones de contenido pueden definirse en cualquier parte de tu aplicación tan pronto como se incluyan en el directorio `contentDir` (por defecto, `./app`). Y deben coincidir con la extensión del archivo de declaración de contenido (por defecto, `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`).
187
+ > Tus declaraciones de contenido pueden definirse en cualquier parte de tu aplicación tan pronto como se incluyan en el directorio `contentDir` (por defecto, `./app`). Y deben coincidir con la extensión de archivo de declaración de contenido (por defecto, `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`).
232
188
 
233
189
  > Para más detalles, consulta la [documentación de declaración de contenido](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/dictionary/get_started.md).
234
190
 
235
191
  ### Paso 7: Crear Componentes y Hooks Sensibles al Idioma
236
192
 
237
- Crea un componente `LocalizedLink` para navegación sensible al idioma:
193
+ Crea un componente `LocalizedLink` para la navegación sensible al idioma:
238
194
 
239
- ```tsx fileName="src/components/localized-link.tsx" codeFormat="typescript"
240
- // src/components/localized-link.tsx
241
- // eslint-disable-next-line no-restricted-imports
242
- import { Link, type LinkProps } from "@tanstack/react-router";
243
- import { getLocalizedUrl } from "intlayer";
244
- import { useLocale } from "react-intlayer";
195
+ ```tsx fileName="src/components/localized-link.tsx"
196
+ import type { FC } from "react";
197
+
198
+ import { Link, type LinkComponentProps } from "@tanstack/react-router";
199
+ import { useLocale } from "react.intlayer";
200
+
201
+ export const LOCALE_ROUTE = "{-$locale}" as const;
202
+
203
+ // Utilidad principal
204
+ export type RemoveLocaleParam<T> = T extends string
205
+ ? RemoveLocaleFromString<T>
206
+ : T;
207
+
208
+ export type To = RemoveLocaleParam<LinkComponentProps["to"]>;
209
+
210
+ type CollapseDoubleSlashes<S extends string> =
211
+ S extends `${infer H}//${infer T}` ? CollapseDoubleSlashes<`${H}/${T}`> : S;
245
212
 
246
213
  type LocalizedLinkProps = {
247
- to: string;
248
- } & Omit<LinkProps, "to">;
214
+ to?: To;
215
+ } & Omit<LinkComponentProps, "to">;
249
216
 
250
- export function LocalizedLink(props: LocalizedLinkProps) {
251
- const { locale } = useLocale();
217
+ // Ayudantes
218
+ type RemoveAll<
219
+ S extends string,
220
+ Sub extends string,
221
+ > = S extends `${infer H}${Sub}${infer T}` ? RemoveAll<`${H}${T}`, Sub> : S;
252
222
 
253
- const isExternal = (to: string) => {
254
- return /^(https?:)?\/\//.test(to);
255
- };
223
+ type RemoveLocaleFromString<S extends string> = CollapseDoubleSlashes<
224
+ RemoveAll<S, typeof LOCALE_ROUTE>
225
+ >;
256
226
 
257
- const to = isExternal(props.to)
258
- ? props.to
259
- : getLocalizedUrl(props.to, locale);
227
+ export const LocalizedLink: FC<LocalizedLinkProps> = (props) => {
228
+ const { locale } = useLocale();
260
229
 
261
- return <Link {...props} to={to as LinkProps["to"]} />;
262
- }
230
+ return (
231
+ <Link
232
+ {...props}
233
+ params={{
234
+ locale,
235
+ ...(typeof props?.params === "object" ? props?.params : {}),
236
+ }}
237
+ to={`/${LOCALE_ROUTE}${props.to}` as LinkComponentProps["to"]}
238
+ />
239
+ );
240
+ };
263
241
  ```
264
242
 
265
- Crea un hook `useLocalizedNavigate` para la navegación programática:
243
+ Este componente tiene dos objetivos:
266
244
 
267
- ```tsx fileName="src/hooks/useLocalizedNavigate.tsx" codeFormat="typescript"
268
- // src/hooks/useLocalizedNavigate.tsx
269
- // eslint-disable-next-line no-restricted-imports
270
- import { NavigateOptions, useNavigate } from "@tanstack/react-router";
271
- import { getLocalizedUrl } from "intlayer";
272
- import { useLocale } from "react-intlayer";
245
+ - Eliminar el prefijo `{-$locale}` innecesario de la URL.
246
+ - Inyectar el parámetro de localización en la URL para asegurar que el usuario sea redirigido directamente a la ruta localizada.
273
247
 
274
- type LocalizedNavigateOptions = {
275
- to: string;
276
- } & Omit<NavigateOptions, "to">;
248
+ Luego podemos crear un hook `useLocalizedNavigate` para la navegación programática:
249
+
250
+ ```tsx fileName="src/hooks/useLocalizedNavigate.tsx"
251
+ import { useLocale } from "react.intlayer";
252
+ import { useNavigate } from "@tanstack/react-router";
253
+ import { LOCALE_ROUTE } from "@/components/localized-link";
254
+ import type { FileRouteTypes } from "@/routeTree.gen";
277
255
 
278
256
  export const useLocalizedNavigate = () => {
279
257
  const navigate = useNavigate();
258
+
280
259
  const { locale } = useLocale();
281
260
 
282
- const isExternal = (to: string) => {
283
- // Comprueba si la URL es externa
284
- return /^(https?:)?\/\//.test(to);
285
- };
261
+ type StripLocalePrefix<T extends string> = T extends
262
+ | `/${typeof LOCALE_ROUTE}`
263
+ | `/${typeof LOCALE_ROUTE}/`
264
+ ? "/"
265
+ : T extends `/${typeof LOCALE_ROUTE}/${infer Rest}`
266
+ ? `/${Rest}`
267
+ : never;
268
+
269
+ type LocalizedTo = StripLocalePrefix<FileRouteTypes["to"]>;
270
+
271
+ interface LocalizedNavigate {
272
+ (to: LocalizedTo): ReturnType<typeof navigate>;
273
+ (
274
+ opts: { to: LocalizedTo } & Record<string, unknown>
275
+ ): ReturnType<typeof navigate>;
276
+ }
277
+
278
+ const localizedNavigate: LocalizedNavigate = (args: any) => {
279
+ if (typeof args === "string") {
280
+ return navigate({ to: `/${LOCALE_ROUTE}${args}`, params: { locale } });
281
+ }
286
282
 
287
- const localizedNavigate = (options: LocalizedNavigateOptions) => {
288
- const to = isExternal(options.to)
289
- ? options.to
290
- : getLocalizedUrl(options.to, locale);
283
+ const { to, ...rest } = args;
291
284
 
292
- navigate({ ...options, to: to as NavigateOptions["to"] });
285
+ const localedTo = `/${LOCALE_ROUTE}${to}` as any;
286
+
287
+ return navigate({ to: localedTo, params: { locale, ...rest } as any });
293
288
  };
294
289
 
295
290
  return localizedNavigate;
296
291
  };
297
292
  ```
298
293
 
299
- ### Paso 8: Utiliza Intlayer en tus Páginas
300
-
301
- Accede a tus diccionarios de contenido en toda tu aplicación:
294
+ ### Paso 8: Utiliza Intlayer en Tus Páginas
302
295
 
303
- #### Página de Redirección Raíz
304
-
305
- ```tsx fileName="src/routes/page.tsx" codeFormat="typescript"
306
- // src/routes/page.tsx
307
- import { useLocale } from "react-intlayer";
308
- import { Navigate } from "react-router";
309
-
310
- export default function Page() {
311
- const { locale } = useLocale();
312
-
313
- return <Navigate replace to={locale} />;
314
- }
315
- ```
296
+ Accede a tus diccionarios de contenido a lo largo de toda tu aplicación:
316
297
 
317
298
  #### Página de Inicio Localizada
318
299
 
319
- ```tsx fileName="src/routes/{-$locale}/index.tsx" codeFormat="typescript"
300
+ ```tsx fileName="src/routes/{-$locale}/index.tsx"
320
301
  import { createFileRoute } from "@tanstack/react-router";
321
302
  import { getIntlayer } from "intlayer";
322
- import { useIntlayer } from "react-intlayer";
303
+ import { useIntlayer } from "react.intlayer";
323
304
 
324
305
  import LocaleSwitcher from "@/components/locale-switcher";
325
306
  import { LocalizedLink } from "@/components/localized-link";
@@ -345,16 +326,15 @@ function RouteComponent() {
345
326
  const navigate = useLocalizedNavigate();
346
327
 
347
328
  return (
348
- <div className="grid place-items-center h-screen">
349
- <div className="flex flex-col gap-4 items-center text-center">
329
+ <div>
330
+ <div>
350
331
  {content.title}
351
332
  <LocaleSwitcher />
352
- <div className="flex gap-4">
353
- <a href="/">Índice</a>
333
+ <div>
354
334
  <LocalizedLink to="/">{content.links.home}</LocalizedLink>
355
335
  <LocalizedLink to="/about">{content.links.about}</LocalizedLink>
356
336
  </div>
357
- <div className="flex gap-4">
337
+ <div>
358
338
  <button onClick={() => navigate({ to: "/" })}>
359
339
  {content.links.home}
360
340
  </button>
@@ -370,61 +350,69 @@ function RouteComponent() {
370
350
 
371
351
  > Para aprender más sobre el hook `useIntlayer`, consulta la [documentación](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/packages/react-intlayer/useIntlayer.md).
372
352
 
373
- ### Paso 9: Crear un Componente para Cambiar de Idioma
353
+ ### Paso 9: Crear un Componente Selector de Idioma
374
354
 
375
355
  Crea un componente para permitir a los usuarios cambiar de idioma:
376
356
 
377
- ```tsx fileName="src/components/locale-switcher.tsx" codeFormat="typescript"
357
+ ```tsx fileName="src/components/locale-switcher.tsx"
358
+ import type { FC } from "react";
359
+
378
360
  import { useLocation } from "@tanstack/react-router";
379
- import {
380
- getHTMLTextDir,
381
- getLocaleName,
382
- getLocalizedUrl,
383
- Locales,
384
- } from "intlayer";
385
- import { useIntlayer, useLocale } from "react-intlayer";
386
-
387
- export default function LocaleSwitcher() {
388
- const { pathname, searchStr } = useLocation();
389
- const content = useIntlayer("locale-switcher");
390
-
391
- const { availableLocales, locale, setLocale } = useLocale({
392
- onLocaleChange: (newLocale) => {
393
- const pathWithLocale = getLocalizedUrl(pathname + searchStr, newLocale);
394
- location.replace(pathWithLocale);
395
- },
396
- });
361
+ import { getHTMLTextDir, getLocaleName, getPathWithoutLocale } from "intlayer";
362
+ import { setLocaleCookie, useIntlayer, useLocale } from "react-intlayer";
363
+
364
+ import { LocalizedLink, To } from "./localized-link";
365
+
366
+ export const LocaleSwitcher: FC = () => {
367
+ const { localeSwitcherLabel } = useIntlayer("locale-switcher");
368
+ const { pathname } = useLocation();
369
+
370
+ const { availableLocales, locale } = useLocale();
371
+
372
+ const pathWithoutLocale = getPathWithoutLocale(pathname);
397
373
 
398
374
  return (
399
- <select
400
- aria-label={content.label.toString()}
401
- onChange={(e) => setLocale(e.target.value)}
402
- value={locale}
403
- >
404
- {availableLocales.map((localeItem) => (
405
- <option
406
- dir={getHTMLTextDir(localeItem)}
407
- key={localeItem}
408
- lang={localeItem}
409
- value={localeItem}
410
- >
411
- {/* Ejemplo: Français (Francés) */}
412
- {getLocaleName(localeItem, locale)} (
413
- {getLocaleName(localeItem, Locales.ENGLISH)})
414
- </option>
375
+ <ol>
376
+ {availableLocales.map((localeEl) => (
377
+ <li key={localeEl}>
378
+ <LocalizedLink
379
+ aria-current={localeEl === locale ? "page" : undefined}
380
+ aria-label={`${localeSwitcherLabel.value} ${getLocaleName(localeEl)}`}
381
+ onClick={() => setLocaleCookie(localeEl)}
382
+ params={{ locale: localeEl }}
383
+ to={pathWithoutLocale as To}
384
+ >
385
+ <span>
386
+ {/* Localización - por ejemplo FR */}
387
+ {localeItem}
388
+ </span>
389
+ <span>
390
+ {/* Idioma en su propia localización - por ejemplo Français */}
391
+ {getLocaleName(localeItem, locale)}
392
+ </span>
393
+ <span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
394
+ {/* Idioma en la localización actual - por ejemplo Francés con la localización actual configurada en Locales.SPANISH */}
395
+ {getLocaleName(localeItem)}
396
+ </span>
397
+ <span dir="ltr" lang={Locales.ENGLISH}>
398
+ {/* Idioma en inglés - por ejemplo French */}
399
+ {getLocaleName(localeItem, Locales.ENGLISH)}
400
+ </span>
401
+ </LocalizedLink>
402
+ </li>
415
403
  ))}
416
- </select>
404
+ </ol>
417
405
  );
418
- }
406
+ };
419
407
  ```
420
408
 
421
409
  > Para aprender más sobre el hook `useLocale`, consulta la [documentación](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/packages/react-intlayer/useLocale.md).
422
410
 
423
411
  ### Paso 10: Añadir gestión de atributos HTML (Opcional)
424
412
 
425
- Crea un hook para gestionar los atributos lang y dir en HTML:
413
+ Crea un hook para gestionar los atributos lang y dir del HTML:
426
414
 
427
- ```tsx fileName="src/hooks/useI18nHTMLAttributes.tsx" codeFormat="typescript"
415
+ ```tsx fileName="src/hooks/useI18nHTMLAttributes.tsx"
428
416
  // src/hooks/useI18nHTMLAttributes.tsx
429
417
  import { getHTMLTextDir } from "intlayer";
430
418
  import { useEffect } from "react";
@@ -442,9 +430,8 @@ export const useI18nHTMLAttributes = () => {
442
430
 
443
431
  Luego úsalo en tu componente raíz:
444
432
 
445
- ```tsx fileName="src/routes/{-$locale}/index.tsx" codeFormat="typescript"
433
+ ```tsx fileName="src/routes/{-$locale}/index.tsx"
446
434
  import { createFileRoute, Navigate, Outlet } from "@tanstack/react-router";
447
- import { configuration } from "intlayer";
448
435
  import { IntlayerProvider, useLocale } from "react-intlayer";
449
436
 
450
437
  import { useI18nHTMLAttributes } from "@/hooks/useI18nHTMLAttributes"; // importar el hook
@@ -456,43 +443,44 @@ export const Route = createFileRoute("/{-$locale}")({
456
443
  function LayoutComponent() {
457
444
  useI18nHTMLAttributes(); // agregar esta línea
458
445
 
446
+ const { defaultLocale } = useLocale();
459
447
  const { locale } = Route.useParams();
460
448
 
461
449
  return (
462
- <IntlayerProvider locale={locale}>
450
+ <IntlayerProvider locale={locale ?? defaultLocale}>
463
451
  <Outlet />
464
452
  </IntlayerProvider>
465
453
  );
466
454
  }
467
455
  ```
468
456
 
469
- ### Paso 11: Construye y Ejecuta Tu Aplicación
457
+ ---
470
458
 
471
- Construye los diccionarios de contenido y ejecuta tu aplicación:
459
+ ### Paso 11: Añadir middleware (Opcional)
472
460
 
473
- ```bash packageManager="npm"
474
- # Construir diccionarios de Intlayer
475
- npm run intlayer:build
461
+ También puedes usar el `intlayerMiddleware` para agregar enrutamiento del lado del servidor a tu aplicación. Este plugin detectará automáticamente la configuración regional actual basada en la URL y establecerá la cookie de configuración regional apropiada. Si no se especifica ninguna configuración regional, el plugin determinará la configuración regional más adecuada según las preferencias de idioma del navegador del usuario. Si no se detecta ninguna configuración regional, redirigirá a la configuración regional predeterminada.
476
462
 
477
- # Iniciar servidor de desarrollo
478
- npm run dev
479
- ```
463
+ > Ten en cuenta que para usar el `intlayerMiddleware` en producción, necesitas cambiar el paquete `vite-intlayer` de `devDependencies` a `dependencies`.
480
464
 
481
- ```bash packageManager="pnpm"
482
- # Construir diccionarios de Intlayer
483
- pnpm intlayer:build
465
+ ```typescript {3,7} fileName="vite.config.ts"
466
+ import { reactRouter } from "@react-router/dev/vite";
467
+ import tailwindcss from "@tailwindcss/vite";
468
+ import { defineConfig } from "vite";
469
+ import { intlayer, intlayerMiddleware } from "vite-intlayer";
470
+ import tsconfigPaths from "vite-tsconfig-paths";
484
471
 
485
- # Iniciar servidor de desarrollo
486
- pnpm dev
472
+ export default defineConfig({
473
+ plugins: [
474
+ tailwindcss(),
475
+ reactRouter(),
476
+ tsconfigPaths(),
477
+ intlayer(),
478
+ intlayerMiddleware(),
479
+ ],
480
+ });
487
481
  ```
488
482
 
489
- ```bash packageManager="yarn"
490
- # Construir diccionarios de Intlayer
491
- yarn intlayer:build
492
-
493
- # Iniciar servidor de desarrollo
494
- yarn dev
495
- ```
483
+ ---
496
484
 
497
485
  ### Paso 12: Configurar TypeScript (Opcional)
498
486
 
@@ -502,9 +490,7 @@ Asegúrate de que tu configuración de TypeScript incluya los tipos autogenerado
502
490
 
503
491
  ```json5 fileName="tsconfig.json"
504
492
  {
505
- compilerOptions: {
506
- // ... tus configuraciones existentes de TypeScript
507
- },
493
+ // ... tus configuraciones existentes
508
494
  include: [
509
495
  // ... tus inclusiones existentes
510
496
  ".intlayer/**/*.ts", // Incluir los tipos autogenerados
@@ -512,11 +498,13 @@ Asegúrate de que tu configuración de TypeScript incluya los tipos autogenerado
512
498
  }
513
499
  ```
514
500
 
501
+ ---
502
+
515
503
  ### Configuración de Git
516
504
 
517
505
  Se recomienda ignorar los archivos generados por Intlayer. Esto te permite evitar comprometerlos en tu repositorio Git.
518
506
 
519
- Para hacerlo, puedes agregar las siguientes instrucciones a tu archivo `.gitignore`:
507
+ Para hacer esto, puedes agregar las siguientes instrucciones a tu archivo `.gitignore`:
520
508
 
521
509
  ```plaintext fileName=".gitignore"
522
510
  # Ignorar los archivos generados por Intlayer
@@ -525,71 +513,13 @@ Para hacerlo, puedes agregar las siguientes instrucciones a tu archivo `.gitigno
525
513
 
526
514
  ---
527
515
 
528
- ### Paso 13: Crear Redirección (Opcional)
529
-
530
- ```typescript fileName="src/routes/{-$locale}/rotue.tsx" codeFormat="typescript"
531
- function LayoutComponent() {
532
- useI18nHTMLAttributes();
533
-
534
- const { locale } = Route.useParams();
535
- const { locale: selectedLocale } = useLocale();
536
- const { defaultLocale } = configuration.internationalization;
537
- const { prefixDefault } = configuration.middleware;
538
-
539
- // Redirigir a la configuración regional predeterminada si no hay configuración regional en la URL cuando prefixDefault es verdadero
540
- if (selectedLocale === defaultLocale && !locale && prefixDefault) {
541
- return <Navigate replace to={defaultLocale} />;
542
- }
543
-
544
- // Redirigir a la configuración regional seleccionada si la configuración regional en la URL no coincide con la seleccionada
545
- if (selectedLocale !== defaultLocale && !locale) {
546
- return <Navigate replace to={selectedLocale} />;
547
- }
548
-
549
- return (
550
- <IntlayerProvider locale={locale}>
551
- <Outlet />
552
- </IntlayerProvider>
553
- );
554
- }
555
- ```
556
-
557
- ## Despliegue en Producción
558
-
559
- Al desplegar tu aplicación:
560
-
561
- 1. **Construye tu aplicación:**
562
-
563
- ```bash
564
- npm run build
565
- ```
566
-
567
- 2. **Construye los diccionarios de Intlayer:**
568
-
569
- ```bash
570
- npm run intlayer:build
571
- ```
572
-
573
- 3. **Mueve `vite-intlayer` a las dependencias** si usas middleware en producción:
574
- ```bash
575
- npm install vite-intlayer --save
576
- ```
577
-
578
- Tu aplicación ahora soportará:
579
-
580
- - **Estructura de URL**: `/en`, `/en/about`, `/tr`, `/tr/about`
581
- - **Detección automática de locale** basada en las preferencias del navegador
582
- - **Ruteo consciente del locale** con Tanstack Start
583
- - **Soporte para TypeScript** con tipos generados automáticamente
584
- - **Renderizado del lado servidor** con manejo adecuado del locale
585
-
586
- ## Extensión para VS Code
516
+ ## Extensión de VS Code
587
517
 
588
- Para mejorar tu experiencia de desarrollo con Intlayer, puedes instalar la extensión oficial **Intlayer VS Code Extension**.
518
+ Para mejorar tu experiencia de desarrollo con Intlayer, puedes instalar la **Extensión oficial de Intlayer para VS Code**.
589
519
 
590
520
  [Instalar desde el Marketplace de VS Code](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
591
521
 
592
- Esta extensión ofrece:
522
+ Esta extensión proporciona:
593
523
 
594
524
  - **Autocompletado** para las claves de traducción.
595
525
  - **Detección de errores en tiempo real** para traducciones faltantes.
@@ -602,7 +532,7 @@ Para más detalles sobre cómo usar la extensión, consulta la [documentación d
602
532
 
603
533
  ## Ir Más Allá
604
534
 
605
- Para profundizar, puedes implementar el [editor visual](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/intlayer_visual_editor.md) o externalizar tu contenido usando el [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/intlayer_CMS.md).
535
+ Para ir más allá, puedes implementar el [editor visual](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/intlayer_visual_editor.md) o externalizar tu contenido usando el [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/intlayer_CMS.md).
606
536
 
607
537
  ---
608
538
 
@@ -615,9 +545,9 @@ Para profundizar, puedes implementar el [editor visual](https://github.com/aymer
615
545
  - [Declaración de Contenido](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/dictionary/get_started.md)
616
546
  - [Configuración](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/configuration.md)
617
547
 
618
- Esta guía completa proporciona todo lo que necesitas para integrar Intlayer con Tanstack Start para una aplicación completamente internacionalizada con enrutamiento consciente del locale y soporte para TypeScript.
548
+ Esta guía completa proporciona todo lo que necesitas para integrar Intlayer con Tanstack Start para una aplicación completamente internacionalizada con enrutamiento consciente de la configuración regional y soporte para TypeScript.
619
549
 
620
- ## Historial de la Documentación
550
+ ## Historial de Documentación
621
551
 
622
552
  | Versión | Fecha | Cambios |
623
553
  | ------- | ---------- | --------------------------- |