@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
@@ -1050,38 +1050,38 @@ const App = () => (
1050
1050
  module.exports = App;
1051
1051
  ```
1052
1052
 
1053
- Parallel dazu können Sie auch das `intlayerMiddlewarePlugin` verwenden, um serverseitiges Routing zu Ihrer Anwendung hinzuzufügen. Dieses Plugin erkennt automatisch die aktuelle Locale basierend auf der URL und setzt das entsprechende Locale-Cookie. Wenn keine Locale angegeben ist, bestimmt das Plugin die am besten geeignete Locale basierend auf den Spracheinstellungen des Browsers des Benutzers. Wenn keine Locale erkannt wird, erfolgt eine Weiterleitung zur Standard-Locale.
1053
+ Parallel dazu können Sie auch das `intlayerMiddleware` verwenden, um serverseitiges Routing zu Ihrer Anwendung hinzuzufügen. Dieses Plugin erkennt automatisch die aktuelle Locale basierend auf der URL und setzt das entsprechende Locale-Cookie. Wenn keine Locale angegeben ist, bestimmt das Plugin die am besten geeignete Locale basierend auf den Spracheinstellungen des Browsers des Benutzers. Wenn keine Locale erkannt wird, erfolgt eine Weiterleitung zur Standard-Locale.
1054
1054
 
1055
1055
  ```typescript {3,7} fileName="vite.config.ts" codeFormat="typescript"
1056
1056
  import { defineConfig } from "vite";
1057
1057
  import preact from "@preact/preset-vite";
1058
- import { intlayer, intlayerMiddlewarePlugin } from "vite-intlayer";
1058
+ import { intlayer, intlayerMiddleware } from "vite-intlayer";
1059
1059
 
1060
1060
  // https://vitejs.dev/config/
1061
1061
  export default defineConfig({
1062
- plugins: [preact(), intlayer(), intlayerMiddlewarePlugin()],
1062
+ plugins: [preact(), intlayer(), intlayerMiddleware()],
1063
1063
  });
1064
1064
  ```
1065
1065
 
1066
1066
  ```javascript {3,7} fileName="vite.config.mjs" codeFormat="esm"
1067
1067
  import { defineConfig } from "vite";
1068
1068
  import preact from "@preact/preset-vite";
1069
- import { intlayer, intlayerMiddlewarePlugin } from "vite-intlayer";
1069
+ import { intlayer, intlayerMiddleware } from "vite-intlayer";
1070
1070
 
1071
1071
  // https://vitejs.dev/config/
1072
1072
  export default defineConfig({
1073
- plugins: [preact(), intlayer(), intlayerMiddlewarePlugin()],
1073
+ plugins: [preact(), intlayer(), intlayerMiddleware()],
1074
1074
  });
1075
1075
  ```
1076
1076
 
1077
1077
  ```javascript {3,7} fileName="vite.config.cjs" codeFormat="commonjs"
1078
1078
  const { defineConfig } = require("vite");
1079
1079
  const preact = require("@preact/preset-vite");
1080
- const { intlayer, intlayerMiddlewarePlugin } = require("vite-intlayer");
1080
+ const { intlayer, intlayerMiddleware } = require("vite-intlayer");
1081
1081
 
1082
1082
  // https://vitejs.dev/config/
1083
1083
  module.exports = defineConfig({
1084
- plugins: [preact(), intlayer(), intlayerMiddlewarePlugin()],
1084
+ plugins: [preact(), intlayer(), intlayerMiddleware()],
1085
1085
  });
1086
1086
  ```
1087
1087
 
@@ -1627,9 +1627,9 @@ module.exports = { LocalizedLink, checkIsExternalLink };
1627
1627
 
1628
1628
  Intlayer verwendet Module Augmentation, um die Vorteile von TypeScript zu nutzen und Ihren Code robuster zu machen.
1629
1629
 
1630
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png)
1630
+ ![Autocompletion](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true)
1631
1631
 
1632
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png)
1632
+ ![Translation error](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png?raw=true)
1633
1633
 
1634
1634
  Stellen Sie sicher, dass Ihre TypeScript-Konfiguration die automatisch generierten Typen enthält.
1635
1635
 
@@ -1016,38 +1016,38 @@ const App = () => (
1016
1016
  );
1017
1017
  ```
1018
1018
 
1019
- Parallel dazu können Sie auch das `intlayerMiddlewarePlugin` verwenden, um serverseitiges Routing in Ihre Anwendung zu integrieren. Dieses Plugin erkennt automatisch die aktuelle Locale basierend auf der URL und setzt das entsprechende Locale-Cookie. Wenn keine Locale angegeben ist, bestimmt das Plugin die passendste Locale basierend auf den Spracheinstellungen des Browsers des Benutzers. Wird keine Locale erkannt, erfolgt eine Weiterleitung zur Standard-Locale.
1019
+ Parallel dazu können Sie auch das `intlayerMiddleware` verwenden, um serverseitiges Routing in Ihre Anwendung zu integrieren. Dieses Plugin erkennt automatisch die aktuelle Locale basierend auf der URL und setzt das entsprechende Locale-Cookie. Wenn keine Locale angegeben ist, bestimmt das Plugin die passendste Locale basierend auf den Spracheinstellungen des Browsers des Benutzers. Wird keine Locale erkannt, erfolgt eine Weiterleitung zur Standard-Locale.
1020
1020
 
1021
1021
  ```typescript {3,7} fileName="vite.config.ts" codeFormat="typescript"
1022
1022
  import { defineConfig } from "vite";
1023
1023
  import react from "@vitejs/plugin-react-swc";
1024
- import { intlayer, intlayerMiddlewarePlugin } from "vite-intlayer";
1024
+ import { intlayer, intlayerMiddleware } from "vite-intlayer";
1025
1025
 
1026
1026
  // https://vitejs.dev/config/
1027
1027
  export default defineConfig({
1028
- plugins: [react(), intlayer(), intlayerMiddlewarePlugin()],
1028
+ plugins: [react(), intlayer(), intlayerMiddleware()],
1029
1029
  });
1030
1030
  ```
1031
1031
 
1032
1032
  ```javascript {3,7} fileName="vite.config.mjs" codeFormat="esm"
1033
1033
  import { defineConfig } from "vite";
1034
1034
  import react from "@vitejs/plugin-react-swc";
1035
- import { intlayer, intlayerMiddlewarePlugin } from "vite-intlayer";
1035
+ import { intlayer, intlayerMiddleware } from "vite-intlayer";
1036
1036
 
1037
1037
  // https://vitejs.dev/config/
1038
1038
  export default defineConfig({
1039
- plugins: [react(), intlayer(), intlayerMiddlewarePlugin()],
1039
+ plugins: [react(), intlayer(), intlayerMiddleware()],
1040
1040
  });
1041
1041
  ```
1042
1042
 
1043
1043
  ```javascript {3,7} fileName="vite.config.cjs" codeFormat="commonjs"
1044
1044
  const { defineConfig } = require("vite");
1045
1045
  const react = require("@vitejs/plugin-react-swc");
1046
- const { intlayer, intlayerMiddlewarePlugin } = require("vite-intlayer");
1046
+ const { intlayer, intlayerMiddleware } = require("vite-intlayer");
1047
1047
 
1048
1048
  // https://vitejs.dev/config/
1049
1049
  module.exports = defineConfig({
1050
- plugins: [react(), intlayer(), intlayerMiddlewarePlugin()],
1050
+ plugins: [react(), intlayer(), intlayerMiddleware()],
1051
1051
  });
1052
1052
  ```
1053
1053
 
@@ -1615,9 +1615,9 @@ Indem Sie diese `Link`-Komponente in Ihrer gesamten Anwendung integrieren, gewä
1615
1615
 
1616
1616
  Intlayer verwendet Module Augmentation, um die Vorteile von TypeScript zu nutzen und Ihren Codebasis robuster zu machen.
1617
1617
 
1618
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png)
1618
+ ![Autocompletion](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true)
1619
1619
 
1620
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png)
1620
+ ![Translation error](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png?raw=true)
1621
1621
 
1622
1622
  Stellen Sie sicher, dass Ihre TypeScript-Konfiguration die automatisch generierten Typen einschließt.
1623
1623
 
@@ -698,46 +698,46 @@ import LocaleSwitcher from "@components/LocaleSwitcher.vue";
698
698
  </template>
699
699
  ```
700
700
 
701
- Parallel dazu können Sie auch das `intlayerMiddlewarePlugin` verwenden, um serverseitiges Routing zu Ihrer Anwendung hinzuzufügen. Dieses Plugin erkennt automatisch die aktuelle Locale basierend auf der URL und setzt das entsprechende Locale-Cookie. Wenn keine Locale angegeben ist, bestimmt das Plugin die am besten geeignete Locale basierend auf den Spracheinstellungen des Browsers des Benutzers. Wenn keine Locale erkannt wird, erfolgt eine Weiterleitung zur Standard-Locale.
701
+ Parallel dazu können Sie auch das `intlayerMiddleware` verwenden, um serverseitiges Routing zu Ihrer Anwendung hinzuzufügen. Dieses Plugin erkennt automatisch die aktuelle Locale basierend auf der URL und setzt das entsprechende Locale-Cookie. Wenn keine Locale angegeben ist, bestimmt das Plugin die am besten geeignete Locale basierend auf den Spracheinstellungen des Browsers des Benutzers. Wenn keine Locale erkannt wird, erfolgt eine Weiterleitung zur Standard-Locale.
702
702
 
703
703
  ```typescript {3,7} fileName="vite.config.ts" codeFormat="typescript"
704
704
  import { defineConfig } from "vite";
705
705
  import vue from "@vitejs/plugin-vue";
706
- import { intlayer, intlayerMiddlewarePlugin } from "vite-intlayer";
706
+ import { intlayer, intlayerMiddleware } from "vite-intlayer";
707
707
 
708
708
  // https://vitejs.dev/config/
709
709
  export default defineConfig({
710
- plugins: [vue(), intlayer(), intlayerMiddlewarePlugin()],
710
+ plugins: [vue(), intlayer(), intlayerMiddleware()],
711
711
  });
712
712
  ```
713
713
 
714
714
  ```javascript {3,7} fileName="vite.config.mjs" codeFormat="esm"
715
715
  import { defineConfig } from "vite";
716
716
  import vue from "@vitejs/plugin-vue";
717
- import { intlayer, intlayerMiddlewarePlugin } from "vite-intlayer";
717
+ import { intlayer, intlayerMiddleware } from "vite-intlayer";
718
718
 
719
719
  // https://vitejs.dev/config/
720
720
  export default defineConfig({
721
- plugins: [vue(), intlayer(), intlayerMiddlewarePlugin()],
721
+ plugins: [vue(), intlayer(), intlayerMiddleware()],
722
722
  });
723
723
  ```
724
724
 
725
725
  ```javascript {3,7} fileName="vite.config.cjs" codeFormat="commonjs"
726
726
  const { defineConfig } = require("vite");
727
727
  const vue = require("@vitejs/plugin-vue");
728
- const { intlayer, intlayerMiddlewarePlugin } = require("vite-intlayer");
728
+ const { intlayer, intlayerMiddleware } = require("vite-intlayer");
729
729
 
730
730
  // https://vitejs.dev/config/
731
731
  module.exports = defineConfig({
732
- plugins: [vue(), intlayer(), intlayerMiddlewarePlugin()],
732
+ plugins: [vue(), intlayer(), intlayerMiddleware()],
733
733
  });
734
734
  const { defineConfig } = require("vite");
735
735
  const vue = require("@vitejs/plugin-vue");
736
- const { intlayer, intlayerMiddlewarePlugin } = require("vite-intlayer");
736
+ const { intlayer, intlayerMiddleware } = require("vite-intlayer");
737
737
 
738
738
  // https://vitejs.dev/config/
739
739
  module.exports = defineConfig({
740
- plugins: [vue(), intlayer(), intlayerMiddlewarePlugin()],
740
+ plugins: [vue(), intlayer(), intlayerMiddleware()],
741
741
  });
742
742
  ```
743
743
 
@@ -1042,9 +1042,9 @@ const { myMarkdownContent } = useIntlayer("my-component");
1042
1042
 
1043
1043
  Intlayer verwendet Module Augmentation, um die Vorteile von TypeScript zu nutzen und Ihren Code robuster zu machen.
1044
1044
 
1045
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png)
1045
+ ![Autocompletion](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true)
1046
1046
 
1047
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png)
1047
+ ![Translation error](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png?raw=true)
1048
1048
 
1049
1049
  Stellen Sie sicher, dass Ihre TypeScript-Konfiguration die automatisch generierten Typen einschließt.
1050
1050
 
@@ -53,17 +53,17 @@ Sehen Sie ein Beispiel, wie Sie die Plugins in Ihre Vite-Konfiguration einbinden
53
53
 
54
54
  ```typescript fileName="vite.config.ts"
55
55
  import { defineConfig } from "vite";
56
- import { intlayer, intlayerMiddlewarePlugin } from "vite-intlayer";
56
+ import { intlayer, intlayerMiddleware } from "vite-intlayer";
57
57
 
58
58
  // https://vitejs.dev/config/
59
59
  export default defineConfig({
60
- plugins: [intlayer(), intlayerMiddlewarePlugin()],
60
+ plugins: [intlayer(), intlayerMiddleware()],
61
61
  });
62
62
  ```
63
63
 
64
64
  > Das `intlayer()` Vite-Plugin wird verwendet, um Intlayer in Vite zu integrieren. Es sorgt für den Aufbau von Inhaltsdeklarationsdateien und überwacht diese im Entwicklungsmodus. Es definiert Intlayer-Umgebungsvariablen innerhalb der Vite-Anwendung. Zusätzlich stellt es Aliase bereit, um die Leistung zu optimieren.
65
65
 
66
- > Das `intlayerMiddlewarePlugin()` fügt Ihrer Anwendung serverseitiges Routing hinzu. Dieses Plugin erkennt automatisch die aktuelle Sprache basierend auf der URL und setzt das entsprechende Sprach-Cookie. Wenn keine Sprache angegeben ist, bestimmt das Plugin die am besten geeignete Sprache basierend auf den Spracheinstellungen des Browsers des Benutzers. Wenn keine Sprache erkannt wird, erfolgt eine Weiterleitung zur Standardsprache.
66
+ > Das `intlayerMiddleware()` fügt Ihrer Anwendung serverseitiges Routing hinzu. Dieses Plugin erkennt automatisch die aktuelle Sprache basierend auf der URL und setzt das entsprechende Sprach-Cookie. Wenn keine Sprache angegeben ist, bestimmt das Plugin die am besten geeignete Sprache basierend auf den Spracheinstellungen des Browsers des Benutzers. Wenn keine Sprache erkannt wird, erfolgt eine Weiterleitung zur Standardsprache.
67
67
 
68
68
  ## Beherrschen der Internationalisierung Ihrer Vite-Anwendung
69
69
 
@@ -74,7 +74,7 @@ const MyComponent = () => {
74
74
 
75
75
  This hook will manage the locale detection for you and will return the content for the current locale. Using this hook, you will also be able to interpret markdown, manage pluralization, and more.
76
76
 
77
- > To see all the features of Intlayer, you can read the [dictionary documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/get_started.md).
77
+ > To see all the features of Intlayer, you can read the [dictionary documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md).
78
78
 
79
79
  ## Distant content
80
80
 
package/docs/en/index.md CHANGED
@@ -51,7 +51,7 @@ Intlayer offers a flexible, modern approach to translating your application. Our
51
51
 
52
52
  Organize your multilingual content close to your code to keep everything consistent and maintainable.
53
53
 
54
- - **[Get Started](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/get_started.md)**
54
+ - **[Get Started](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md)**
55
55
  Learn the basics of declaring your content in Intlayer.
56
56
 
57
57
  - **[Translation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/translation.md)**
@@ -40,7 +40,7 @@ pnpm add intlayer-cli -g
40
40
 
41
41
  ## intlayer-cli package
42
42
 
43
- `intlayer-cli` package intend to transpile your [intlayer declarations](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/get_started.md) into dictionaries.
43
+ `intlayer-cli` package intend to transpile your [intlayer declarations](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md) into dictionaries.
44
44
 
45
45
  This package will transpile all intlayer files, such as `src/**/*.content.{ts|js|mjs|cjs|json}`. [See how to declare your Intlayer declaration files](https://github.com/aymericzip/intlayer/blob/main/packages/intlayer/README.md).
46
46
 
@@ -55,7 +55,7 @@ yarn add intlayer angular-intlayer @intlayer/webpack
55
55
 
56
56
  - **intlayer**
57
57
 
58
- The core package that provides internationalization tools for configuration management, translation, [content declaration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/get_started.md), transpilation, and [CLI commands](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_cli.md).
58
+ The core package that provides internationalization tools for configuration management, translation, [content declaration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md), transpilation, and [CLI commands](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_cli.md).
59
59
 
60
60
  - **angular-intlayer**
61
61
  The package that integrates Intlayer with Angular application. It provides context providers and hooks for Angular internationalization.
@@ -283,7 +283,7 @@ export default appContent;
283
283
 
284
284
  > Your content declarations can be defined anywhere in your application as soon they are included into the `contentDir` directory (by default, `./src`). And match the content declaration file extension (by default, `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`).
285
285
 
286
- > For more details, refer to the [content declaration documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/get_started.md).
286
+ > For more details, refer to the [content declaration documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md).
287
287
 
288
288
  ### Step 5: Utilize Intlayer in Your Code
289
289
 
@@ -637,9 +637,9 @@ For more complex scenarios, you can create a pipe to safely render the HTML.
637
637
 
638
638
  Intlayer uses module augmentation to get benefits of TypeScript and make your codebase stronger.
639
639
 
640
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png)
640
+ ![Autocompletion](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true)
641
641
 
642
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png)
642
+ ![Translation error](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png?raw=true)
643
643
 
644
644
  Ensure your TypeScript configuration includes the autogenerated types.
645
645
 
@@ -0,0 +1,246 @@
1
+ ---
2
+ createdAt: 2024-03-07
3
+ updatedAt: 2025-10-03
4
+ title: Getting Started with Intlayer in Astro
5
+ description: Learn how to add internationalization (i18n) to your Vite and React application using Intlayer. Follow this guide to make your app multilingual.
6
+ keywords:
7
+ - Internationalization
8
+ - Documentation
9
+ - Intlayer
10
+ - Vite
11
+ - React
12
+ - i18n
13
+ - JavaScript
14
+ slugs:
15
+ - doc
16
+ - environment
17
+ - astro
18
+ applicationTemplate: https://github.com/aymericzip/intlayer-astro-template
19
+ ---
20
+
21
+ # Getting Started Internationalizing (i18n) with Intlayer and Astro
22
+
23
+ See [Application Template](https://github.com/aymericzip/intlayer-astro-template) on GitHub.
24
+
25
+ ## What is Intlayer?
26
+
27
+ **Intlayer** is an innovative, open-source internationalization (i18n) library designed to simplify multilingual support in modern web applications.
28
+
29
+ With Intlayer, you can:
30
+
31
+ - **Easily manage translations** using declarative dictionaries at the component level.
32
+ - **Dynamically localize metadata**, routes, and content.
33
+ - **Ensure TypeScript support** with autogenerated types, improving autocompletion and error detection.
34
+ - **Benefit from advanced features**, like dynamic locale detection and switching.
35
+
36
+ ---
37
+
38
+ ## Step-by-Step Guide to Set Up Intlayer in Astro
39
+
40
+ ### Step 1: Install Dependencies
41
+
42
+ Install the necessary packages using your package manager:
43
+
44
+ ```bash packageManager="npm"
45
+ npm install intlayer astro-intlayer
46
+ # Optional: add React island support
47
+ npm install react react-dom react-intlayer @astrojs/react
48
+ ```
49
+
50
+ ```bash packageManager="pnpm"
51
+ pnpm add intlayer astro-intlayer
52
+ # Optional: add React island support
53
+ pnpm add react react-dom react-intlayer @astrojs/react
54
+ ```
55
+
56
+ ```bash packageManager="yarn"
57
+ yarn add intlayer astro-intlayer
58
+ # Optional: add React island support
59
+ yarn add react react-dom react-intlayer @astrojs/react
60
+ ```
61
+
62
+ - **intlayer**
63
+ The core package that provides internationalization tools for configuration management, translation, [content declaration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md), transpilation, and [CLI commands](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_cli.md).
64
+
65
+ - **astro-intlayer**
66
+ Includes the Astro integration plugin for integrating Intlayer with the [Vite bundler](https://vite.dev/guide/why.html#why-bundle-for-production), as well as middleware for detecting the user's preferred locale, managing cookies, and handling URL redirection.
67
+
68
+ ### Step 2: Configuration of your project
69
+
70
+ Create a config file to configure the languages of your application:
71
+
72
+ ```typescript fileName="intlayer.config.ts"
73
+ import { Locales, type IntlayerConfig } from "intlayer";
74
+
75
+ const config: IntlayerConfig = {
76
+ internationalization: {
77
+ locales: [
78
+ Locales.ENGLISH,
79
+ Locales.FRENCH,
80
+ Locales.SPANISH,
81
+ // Your other locales
82
+ ],
83
+ defaultLocale: Locales.ENGLISH,
84
+ },
85
+ };
86
+
87
+ export default config;
88
+ ```
89
+
90
+ > Through this configuration file, you can set up localized URLs, middleware redirection, cookie names, the location and extension of your content declarations, disable Intlayer logs in the console, and more. For a complete list of available parameters, refer to the [configuration documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/configuration.md).
91
+
92
+ ### Step 3: Integrate Intlayer in Your Astro Configuration
93
+
94
+ Add the intlayer plugin into your configuration.
95
+
96
+ ```typescript fileName="astro.config.ts"
97
+ // @ts-check
98
+
99
+ import { intlayer } from "astro-intlayer";
100
+ import { defineConfig } from "astro/config";
101
+
102
+ // https://astro.build/config
103
+ export default defineConfig({
104
+ integrations: [intlayer()],
105
+ });
106
+ ```
107
+
108
+ > The `intlayer()` Astro integration plugin is used to integrate Intlayer with Astro. It ensures the building of content declaration files and monitors them in development mode. It defines Intlayer environment variables within the Astro application. Additionally, it provides aliases to optimize performance.
109
+
110
+ ### Step 4: Declare Your Content
111
+
112
+ Create and manage your content declarations to store translations:
113
+
114
+ ```tsx fileName="src/app.content.tsx"
115
+ import { t, type Dictionary } from "intlayer";
116
+ import type { ReactNode } from "react";
117
+
118
+ const appContent = {
119
+ key: "app",
120
+ content: {
121
+ title: t({
122
+ en: "Hello World",
123
+ fr: "Bonjour le monde",
124
+ es: "Hola mundo",
125
+ }),
126
+ },
127
+ } satisfies Dictionary;
128
+
129
+ export default appContent;
130
+ ```
131
+
132
+ > Your content declarations can be defined anywhere in your application as soon they are included into the `contentDir` directory (by default, `./src`). And match the content declaration file extension (by default, `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`).
133
+
134
+ > For more details, refer to the [content declaration documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md).
135
+
136
+ ### Step 5: Use your content in Astro
137
+
138
+ You can consume dictionaries directly in `.astro` files using the core helpers exported by `intlayer`.
139
+
140
+ ```astro fileName="src/pages/index.astro"
141
+ <!-- astro -->
142
+ ---
143
+ import { getIntlayer } from "intlayer";
144
+ import appContent from "../app.content";
145
+
146
+ const { title } = getIntlayer('app');
147
+ ---
148
+
149
+ <html lang="en">
150
+ <head>
151
+ <meta charset="utf-8" />
152
+ <meta name="viewport" content="width=device-width" />
153
+ <title>{title}</title>
154
+ </head>
155
+ <body>
156
+ <h1>{title}</h1>
157
+ </body>
158
+ </html>
159
+ ```
160
+
161
+ ### Step 6: Localized routing
162
+
163
+ Create a dynamic route segment to serve localized pages, for example `src/pages/[locale]/index.astro`:
164
+
165
+ ```astro fileName="src/pages/[locale]/index.astro"
166
+ <!-- astro -->
167
+ ---
168
+ import { getIntlayer } from "intlayer";
169
+
170
+ const { title } = getIntlayer('app');
171
+ ---
172
+
173
+ <h1>{title}</h1>
174
+ ```
175
+
176
+ The Astro integration adds a Vite middleware during development that helps with locale-aware routing and environment definitions. You can still link between locales using your own logic, or utility functions like `getLocalizedUrl` from `intlayer`.
177
+
178
+ ### Step 7: Continue using your favorite framework
179
+
180
+ Continue using your favorite framework to build your application.
181
+
182
+ - Intlayer + React: [Intlayer with React](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_vite+react.md)
183
+ - Intlayer + Vue: [Intlayer with Vue](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_vite+vue.md)
184
+ - Intlayer + Svelte: [Intlayer with Svelte](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_vite+svelte.md)
185
+ - Intlayer + Solid: [Intlayer with Solid](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_vite+solid.md)
186
+ - Intlayer + Preact: [Intlayer with Preact](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_vite+preact.md)
187
+
188
+ ### Configure TypeScript
189
+
190
+ Intlayer use module augmentation to get benefits of TypeScript and make your codebase stronger.
191
+
192
+ ![Autocompletion](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true)
193
+
194
+ ![Translation error](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png?raw=true)
195
+
196
+ Ensure your TypeScript configuration includes the autogenerated types.
197
+
198
+ ```json5 fileName="tsconfig.json"
199
+ {
200
+ // ... Your existing TypeScript configurations
201
+ "include": [
202
+ // ... Your existing TypeScript configurations
203
+ ".intlayer/**/*.ts", // Include the auto-generated types
204
+ ],
205
+ }
206
+ ```
207
+
208
+ ### Git Configuration
209
+
210
+ It is recommended to ignore the files generated by Intlayer. This allows you to avoid committing them to your Git repository.
211
+
212
+ To do this, you can add the following instructions to your `.gitignore` file:
213
+
214
+ ```plaintext
215
+ # Ignore the files generated by Intlayer
216
+ .intlayer
217
+ ```
218
+
219
+ ### VS Code Extension
220
+
221
+ To improve your development experience with Intlayer, you can install the official **Intlayer VS Code Extension**.
222
+
223
+ [Install from the VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
224
+
225
+ This extension provides:
226
+
227
+ - **Autocompletion** for translation keys.
228
+ - **Real-time error detection** for missing translations.
229
+ - **Inline previews** of translated content.
230
+ - **Quick actions** to easily create and update translations.
231
+
232
+ For more details on how to use the extension, refer to the [Intlayer VS Code Extension documentation](https://intlayer.org/doc/vs-code-extension).
233
+
234
+ ---
235
+
236
+ ### Go Further
237
+
238
+ To go further, you can implement the [visual editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_visual_editor.md) or externalize your content using the [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_CMS.md).
239
+
240
+ ---
241
+
242
+ ## Doc History
243
+
244
+ | Version | Date | Changes |
245
+ | ------- | ---------- | -------------------------------------------- |
246
+ | 6.2.0 | 2025-10-03 | Refresh for Astro integration, config, usage |
@@ -53,7 +53,7 @@ yarn add intlayer react-intlayer react-scripts-intlayer
53
53
 
54
54
  - **intlayer**
55
55
 
56
- The core package that provides internationalization tools for configuration management, translation, [content declaration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/get_started.md), transpilation, and [CLI commands](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_cli.md).
56
+ The core package that provides internationalization tools for configuration management, translation, [content declaration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md), transpilation, and [CLI commands](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_cli.md).
57
57
 
58
58
  - **react-intlayer**
59
59
 
@@ -235,7 +235,7 @@ module.exports = appContent;
235
235
 
236
236
  > Your content declarations can be defined anywhere in your application as soon they are included into the `contentDir` directory (by default, `./src`). And match the content declaration file extension (by default, `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`).
237
237
 
238
- > For more details, refer to the [content declaration documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/get_started.md).
238
+ > For more details, refer to the [content declaration documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md).
239
239
 
240
240
  > If your content file includes TSX code, you should consider importing `import React from "react";` in your content file.
241
241
 
@@ -1169,9 +1169,9 @@ By applying these changes, your application will:
1169
1169
 
1170
1170
  Intlayer use module augmentation to get benefits of TypeScript and make your codebase stronger.
1171
1171
 
1172
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png)
1172
+ ![Autocompletion](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true)
1173
1173
 
1174
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png)
1174
+ ![Translation error](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png?raw=true)
1175
1175
 
1176
1176
  Ensure your TypeScript configuration includes the autogenerated types.
1177
1177
 
@@ -192,7 +192,7 @@ module.exports = indexContent;
192
192
 
193
193
  > Your content declarations can be defined anywhere in your application as soon as they are included into the `contentDir` directory (by default, `./src`). And match the content declaration file extension (by default, `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`).
194
194
 
195
- > For more details, refer to the [content declaration documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/get_started.md).
195
+ > For more details, refer to the [content declaration documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md).
196
196
 
197
197
  ### Express Application Setup
198
198
 
@@ -362,9 +362,9 @@ By default, `express-intlayer` will interpret the `Accept-Language` header to de
362
362
 
363
363
  `express-intlayer` leverages the robust capabilities of TypeScript to enhance the internationalization process. TypeScript's static typing ensures that every translation key is accounted for, reducing the risk of missing translations and improving maintainability.
364
364
 
365
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png)
365
+ ![Autocompletion](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true)
366
366
 
367
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png)
367
+ ![Translation error](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png?raw=true)
368
368
 
369
369
  Ensure the autogenerated types (by default at ./types/intlayer.d.ts) are included in your tsconfig.json file.
370
370
 
@@ -339,7 +339,7 @@ module.exports = appContent;
339
339
  }
340
340
  ```
341
341
 
342
- > For details on content declarations, see [Intlayer’s content docs](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/get_started.md).
342
+ > For details on content declarations, see [Intlayer’s content docs](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md).
343
343
 
344
344
  ---
345
345
 
@@ -215,9 +215,9 @@ By default, `express-intlayer` will interpret the `Accept-Language` header to de
215
215
 
216
216
  `express-intlayer` leverages the robust capabilities of TypeScript to enhance the internationalization process. TypeScript's static typing ensures that every translation key is accounted for, reducing the risk of missing translations and improving maintainability.
217
217
 
218
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png)
218
+ ![Autocompletion](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true)
219
219
 
220
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png)
220
+ ![Translation error](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png?raw=true)
221
221
 
222
222
  Ensure the autogenerated types (by default at ./types/intlayer.d.ts) are included in your tsconfig.json file.
223
223
 
@@ -58,7 +58,7 @@ yarn add intlayer next-intlayer
58
58
 
59
59
  - **intlayer**
60
60
 
61
- The core package that provides internationalization tools for configuration management, translation, [content declaration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/get_started.md), transpilation, and [CLI commands](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_cli.md).
61
+ The core package that provides internationalization tools for configuration management, translation, [content declaration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md), transpilation, and [CLI commands](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_cli.md).
62
62
 
63
63
  - **next-intlayer**
64
64
 
@@ -414,7 +414,7 @@ module.exports = pageContent;
414
414
 
415
415
  > Your content declarations can be defined anywhere in your application as soon they are included into the `contentDir` directory (by default, `./src`). And match the content declaration file extension (by default, `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`).
416
416
 
417
- > For more details, refer to the [content declaration documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/get_started.md).
417
+ > For more details, refer to the [content declaration documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md).
418
418
 
419
419
  ### Step 7: Utilize Content in Your Code
420
420
 
@@ -1414,6 +1414,15 @@ export const myServerAction = async () => {
1414
1414
  };
1415
1415
  ```
1416
1416
 
1417
+ > The `getLocale` function follows a cascading strategy to determine the user's locale:
1418
+ >
1419
+ > 1. First, it checks the request headers for a locale value that may have been set by the middleware
1420
+ > 2. If no locale is found in headers, it looks for a locale stored in cookies
1421
+ > 3. If no cookie is found, it attempts to detect the user's preferred language from their browser settings
1422
+ > 4. As a last resort, it falls back to the application's configured default locale
1423
+ >
1424
+ > This ensures the most appropriate locale is selected based on available context.
1425
+
1417
1426
  ### (Optional) Step 13: Optmize your bundle size
1418
1427
 
1419
1428
  When using `next-intlayer`, dictionaries are included in the bundle for every page by default. To optimize bundle size, Intlayer provides an optional SWC plugin that intelligently replace `useIntlayer` calls using macros. This ensures dictionaries are only included in bundles for pages that actually use them.
@@ -1440,9 +1449,9 @@ yarn add @intlayer/swc --save-dev
1440
1449
 
1441
1450
  Intlayer use module augmentation to get benefits of TypeScript and make your codebase stronger.
1442
1451
 
1443
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png)
1452
+ ![Autocompletion](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true)
1444
1453
 
1445
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png)
1454
+ ![Translation error](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png?raw=true)
1446
1455
 
1447
1456
  Ensure your TypeScript configuration includes the autogenerated types.
1448
1457