@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
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  createdAt: 2025-09-04
3
- updatedAt: 2025-09-04
3
+ updatedAt: 2025-10-03
4
4
  title: 在 React Router v7 中使用 Intlayer 入门
5
- description: 学习如何使用 Intlayer 为您的 React Router v7 应用添加国际化 (i18n)。按照本综合指南,使您的应用支持多语言和基于区域设置的路由。
5
+ description: 学习如何使用 Intlayer 为您的 React Router v7 应用添加国际化(i18n)。按照本综合指南,使您的应用支持多语言和基于区域的路由。
6
6
  keywords:
7
7
  - 国际化
8
8
  - 文档
@@ -17,25 +17,24 @@ slugs:
17
17
  - environment
18
18
  - vite-and-react
19
19
  - react-router-v7
20
- applicationTemplate: https://github.com/AydinTheFirst/react-router-intlayer
21
- author: AydinTheFirst
20
+ applicationTemplate: https://github.com/aymericzip/intlayer-react-router-v7-template
22
21
  ---
23
22
 
24
- # 使用 Intlayer 和 React Router v7 开始国际化 (i18n)
23
+ # 使用 Intlayer 和 React Router v7 开始国际化(i18n
25
24
 
26
- 本指南演示了如何在 React Router v7 项目中集成 **Intlayer**,实现无缝国际化,支持基于区域设置的路由、TypeScript 支持以及现代开发实践。
25
+ 本指南演示了如何在 React Router v7 项目中集成 **Intlayer**,实现无缝国际化,支持基于区域的路由、TypeScript 支持以及现代开发实践。
27
26
 
28
27
  ## 什么是 Intlayer?
29
28
 
30
- **Intlayer** 是一个创新的开源国际化 (i18n) 库,旨在简化现代 Web 应用中的多语言支持。
29
+ **Intlayer** 是一个创新的开源国际化(i18n)库,旨在简化现代 Web 应用的多语言支持。
31
30
 
32
31
  使用 Intlayer,您可以:
33
32
 
34
33
  - **通过组件级声明式字典轻松管理翻译**。
35
34
  - **动态本地化元数据、路由和内容**。
36
- - **通过自动生成的类型确保 TypeScript 支持,提升自动补全和错误检测能力**。
37
- - **享受高级功能**,如动态区域设置检测和切换。
38
- - **通过 React Router v7 的基于配置的路由系统启用区域设置感知路由**。
35
+ - **确保 TypeScript 支持**,通过自动生成类型,提升自动补全和错误检测能力。
36
+ - **享受高级功能**,如动态区域检测和切换。
37
+ - **通过 React Router v7 的基于配置的路由系统启用区域感知路由**。
39
38
 
40
39
  ---
41
40
 
@@ -43,7 +42,7 @@ author: AydinTheFirst
43
42
 
44
43
  ### 第一步:安装依赖
45
44
 
46
- 使用你喜欢的包管理器安装必要的包:
45
+ 使用您喜欢的包管理器安装必要的包:
47
46
 
48
47
  ```bash packageManager="npm"
49
48
  npm install intlayer react-intlayer
@@ -62,10 +61,10 @@ pnpm add vite-intlayer --save-dev
62
61
  提供国际化工具的核心包,用于配置管理、翻译、[内容声明](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/dictionary/get_started.md)、转译以及[命令行工具](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/intlayer_cli.md)。
63
62
 
64
63
  - **react-intlayer**
65
- 将 Intlayer 集成到 React 应用中的包。它提供了用于 React 国际化的上下文提供者和钩子。
64
+ 将 Intlayer 集成到 React 应用中的包。它提供了 React 国际化的上下文提供者和钩子。
66
65
 
67
66
  - **vite-intlayer**
68
- 包含用于将 Intlayer 集成到[Vite 打包工具](https://vite.dev/guide/why.html#why-bundle-for-production)的 Vite 插件,以及用于检测用户首选语言、管理 Cookie 和处理 URL 重定向的中间件。
67
+ 包含用于将 Intlayer 集成到 [Vite 打包工具](https://vite.dev/guide/why.html#why-bundle-for-production) 的 Vite 插件,以及用于检测用户首选语言、管理 Cookie 和处理 URL 重定向的中间件。
69
68
 
70
69
  ### 第 2 步:项目配置
71
70
 
@@ -76,11 +75,8 @@ import { type IntlayerConfig, Locales } from "intlayer";
76
75
 
77
76
  const config: IntlayerConfig = {
78
77
  internationalization: {
79
- defaultLocale: Locales.ENGLISH,
80
- locales: [Locales.ENGLISH, Locales.TURKISH],
81
- },
82
- middleware: {
83
- prefixDefault: true, // 始终在 URL 中添加默认语言前缀
78
+ defaultLocale: Locales.ENGLISH, // 默认语言
79
+ locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH], // 支持的语言列表
84
80
  },
85
81
  };
86
82
 
@@ -93,11 +89,8 @@ import { Locales } from "intlayer";
93
89
  /** @type {import('intlayer').IntlayerConfig} */
94
90
  const config = {
95
91
  internationalization: {
96
- defaultLocale: Locales.ENGLISH,
97
- locales: [Locales.ENGLISH, Locales.TURKISH],
98
- },
99
- middleware: {
100
- prefixDefault: true,
92
+ defaultLocale: Locales.ENGLISH, // 默认语言
93
+ locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH], // 支持的语言列表
101
94
  },
102
95
  };
103
96
 
@@ -108,75 +101,68 @@ export default config;
108
101
  const { Locales } = require("intlayer");
109
102
 
110
103
  /** @type {import('intlayer').IntlayerConfig} */
111
- // 配置对象,定义国际化相关设置
104
+ // 配置对象,定义国际化设置
112
105
  const config = {
113
106
  internationalization: {
114
- defaultLocale: Locales.ENGLISH, // 默认语言为英语
115
- locales: [Locales.ENGLISH, Locales.TURKISH], // 支持的语言列表:英语和土耳其语
116
- },
117
- middleware: {
118
- prefixDefault: true, // 默认语言的 URL 也加前缀
107
+ defaultLocale: Locales.ENGLISH, // 默认语言
108
+ locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH], // 支持的语言列表
119
109
  },
120
110
  };
121
111
 
122
112
  module.exports = config;
123
113
  ```
124
114
 
125
- > 通过此配置文件,您可以设置本地化的 URL、中间件重定向、cookie 名称、内容声明的位置和扩展名、禁用控制台中的 Intlayer 日志等。有关可用参数的完整列表,请参阅[配置文档](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/configuration.md)。
126
-
127
- ### 第3步:配置 React Router v7 路由
128
-
129
- 设置支持多语言的路由配置:
115
+ > 通过此配置文件,您可以设置本地化的 URL、中间件重定向、cookie 名称、内容声明的位置和扩展名,禁用控制台中的 Intlayer 日志等。有关可用参数的完整列表,请参阅[配置文档](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/configuration.md)。
130
116
 
131
- ```typescript fileName="app/routes.ts" codeFormat="typescript"
132
- import { layout, route, type RouteConfig } from "@react-router/dev/routes";
117
+ ### 第三步:在您的 Vite 配置中集成 Intlayer
133
118
 
134
- export default [
135
- layout("routes/layout.tsx", [
136
- route("/", "routes/page.tsx"), // 根页面 - 重定向到语言版本
137
- route("/:lang", "routes/[lang]/page.tsx"), // 本地化首页
138
- route("/:lang/about", "routes/[lang]/about/page.tsx"), // 本地化关于页面
139
- ]),
140
- ] satisfies RouteConfig;
141
- ```
119
+ intlayer 插件添加到您的配置中:
142
120
 
143
- ### 第4步:在 Vite 配置中集成 Intlayer
144
-
145
- 将 intlayer 插件添加到你的配置中:
146
-
147
- ```typescript fileName="vite.config.ts" codeFormat="typescript"
121
+ ```typescript fileName="vite.config.ts"
148
122
  import { reactRouter } from "@react-router/dev/vite";
149
123
  import { defineConfig } from "vite";
150
- import { intlayerMiddlewarePlugin, intlayer } from "vite-intlayer";
124
+ import { intlayer } from "vite-intlayer";
151
125
  import tsconfigPaths from "vite-tsconfig-paths";
152
126
 
153
127
  export default defineConfig({
154
- plugins: [
155
- reactRouter(),
156
- tsconfigPaths(),
157
- intlayer(),
158
- intlayerMiddlewarePlugin(),
159
- ],
128
+ plugins: [reactRouter(), tsconfigPaths(), intlayer()],
160
129
  });
161
130
  ```
162
131
 
163
- > `intlayer()` 是用于将 Intlayer 集成到 Vite 中的插件。它确保内容声明文件的构建,并在开发模式下监视这些文件。它在 Vite 应用中定义了 Intlayer 的环境变量。此外,它还提供别名以优化性能。
132
+ > `intlayer()` Vite 插件用于将 Intlayer 集成到 Vite 中。它确保内容声明文件的构建,并在开发模式下监视这些文件。它在 Vite 应用中定义了 Intlayer 的环境变量。此外,它还提供别名以优化性能。
133
+
134
+ ### 第4步:配置 React Router v7 路由
135
+
136
+ 设置支持多语言的路由配置:
137
+
138
+ ```typescript fileName="app/routes.ts"
139
+ import { layout, route, type RouteConfig } from "@react-router/dev/routes";
140
+
141
+ export default [
142
+ layout("routes/layout.tsx", [
143
+ route("/:lang?", "routes/page.tsx"), // 本地化主页
144
+ route("/:lang?/about", "routes/about/page.tsx"), // 本地化关于页面
145
+ ]),
146
+ ] satisfies RouteConfig;
147
+ ```
164
148
 
165
- ### 第五步:创建布局组件
149
+ ### 第5步:创建布局组件
166
150
 
167
- 设置你的根布局和特定语言环境的布局:
151
+ 设置根布局和特定语言环境的布局:
168
152
 
169
153
  #### 根布局
170
154
 
171
- ```tsx fileName="app/routes/layout.tsx" codeFormat="typescript"
172
- tsx;
173
- // app/routes/layout.tsx
174
- import { Outlet } from "react-router";
155
+ ```tsx fileName="app/routes/layout.tsx"
175
156
  import { IntlayerProvider } from "react-intlayer";
157
+ import { Outlet } from "react-router";
158
+
159
+ import type { Route } from "./+types/layout";
160
+
161
+ export default function RootLayout({ params }: Route.ComponentProps) {
162
+ const { locale } = params;
176
163
 
177
- export default function RootLayout() {
178
164
  return (
179
- <IntlayerProvider>
165
+ <IntlayerProvider locale={locale}>
180
166
  <Outlet />
181
167
  </IntlayerProvider>
182
168
  );
@@ -187,7 +173,7 @@ export default function RootLayout() {
187
173
 
188
174
  创建并管理您的内容声明以存储翻译:
189
175
 
190
- ```tsx fileName="app/routes/[lang]/page.content.ts" contentDeclarationFormat="typescript"
176
+ ```tsx fileName="app/routes/[lang]/page.content.ts"
191
177
  import { t, type Dictionary } from "intlayer";
192
178
 
193
179
  const pageContent = {
@@ -195,19 +181,23 @@ const pageContent = {
195
181
  content: {
196
182
  title: t({
197
183
  en: "Welcome to React Router v7 + Intlayer",
198
- tr: "React Router v7 + Intlayer'a Hoş Geldiniz",
184
+ es: "Bienvenido a React Router v7 + Intlayer",
185
+ fr: "Bienvenue sur React Router v7 + Intlayer",
199
186
  }),
200
187
  description: t({
201
188
  en: "Build multilingual applications with ease using React Router v7 and Intlayer.",
202
- tr: "使用 React Router v7 Intlayer 轻松构建多语言应用程序。",
189
+ es: "Cree aplicaciones multilingües fácilmente usando React Router v7 y Intlayer.",
190
+ fr: "Créez des applications multilingues facilement avec React Router v7 et Intlayer.",
203
191
  }),
204
192
  aboutLink: t({
205
193
  en: "了解我们",
206
- tr: "关于我们",
194
+ es: "Aprender Sobre Nosotros",
195
+ fr: "En savoir plus sur nous",
207
196
  }),
208
197
  homeLink: t({
209
198
  en: "首页",
210
- tr: "主页",
199
+ es: "Inicio",
200
+ fr: "Accueil",
211
201
  }),
212
202
  },
213
203
  } satisfies Dictionary;
@@ -215,163 +205,163 @@ const pageContent = {
215
205
  export default pageContent;
216
206
  ```
217
207
 
218
- > 您的内容声明可以在应用程序中的任何位置定义,只要它们被包含在 `contentDir` 目录中(默认是 `./app`)。并且文件扩展名需匹配内容声明文件扩展名(默认是 `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`)。
208
+ > 您的内容声明可以定义在应用程序中的任何位置,只要它们被包含在 `contentDir` 目录中(默认是 `./app`)。并且文件扩展名需匹配内容声明文件扩展名(默认是 `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`)。
219
209
 
220
210
  > 更多详情,请参阅[内容声明文档](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/dictionary/get_started.md)。
221
211
 
222
212
  ### 第7步:创建支持多语言的组件
223
213
 
224
- 创建一个 `LocalizedLink` 组件以实现基于语言环境的导航:
225
-
226
- ```tsx fileName="app/components/localized-link.tsx" codeFormat="typescript"
227
- // app/components/localized-link.tsx
228
- import { getLocalizedUrl } from "intlayer";
229
- import { useLocale } from "react-intlayer";
230
- import React from "react";
231
- import { Link, useLocation } from "react-router";
214
+ 创建一个 `LocalizedLink` 组件,用于支持多语言的导航:
232
215
 
233
- type RouterLinkProps = React.ComponentProps<typeof Link>;
216
+ ```tsx fileName="app/components/localized-link.tsx"
217
+ import type { FC } from "react";
234
218
 
235
- export default function LocalizedLink({ to, ...props }: RouterLinkProps) {
236
- const { locale } = useLocale();
237
- const location = useLocation();
219
+ import { getLocalizedUrl, type LocalesValues } from "intlayer";
220
+ import { useLocale } from "react-intlayer";
221
+ import { Link, type LinkProps, type To } from "react-router";
238
222
 
239
- const isExternal = (path: string) =>
240
- /^([a-z][a-z0-9+.-]*:)?\/\//i.test(path) || path.startsWith("mailto:");
223
+ const isExternalLink = (to: string) => /^(https?:)?\/\//.test(to); // 判断是否为外部链接
241
224
 
225
+ export const locacalizeTo = (to: To, locale: LocalesValues): To => {
242
226
  if (typeof to === "string") {
243
- if (to.startsWith("/") && !isExternal(to)) {
244
- return <Link to={getLocalizedUrl(to, locale)} {...props} />;
227
+ if (isExternalLink(to)) {
228
+ return to; // 如果是外部链接,直接返回
245
229
  }
246
- return <Link to={to} {...props} />;
230
+
231
+ return getLocalizedUrl(to, locale); // 获取本地化的URL
247
232
  }
248
233
 
249
- if (to && typeof to === "object") {
250
- const pathname = (to as { pathname?: string }).pathname;
251
- if (pathname && pathname.startsWith("/") && !isExternal(pathname)) {
252
- return (
253
- <Link
254
- to={{ ...to, pathname: getLocalizedUrl(pathname, locale) }}
255
- {...props}
256
- />
257
- );
258
- }
259
- return <Link to={to} {...props} />;
234
+ if (isExternalLink(to.pathname ?? "")) {
235
+ return to; // 如果路径名是外部链接,直接返回
260
236
  }
261
237
 
262
- return (
263
- <Link
264
- to={getLocalizedUrl(location.pathname + location.search, locale)}
265
- {...props}
266
- />
267
- );
268
- }
269
- ```
238
+ return {
239
+ ...to,
240
+ pathname: getLocalizedUrl(to.pathname ?? "", locale), // 本地化路径名
241
+ };
242
+ };
270
243
 
271
- ### 第8步:在您的页面中使用 Intlayer
244
+ export const LocalizedLink: FC<LinkProps> = (props) => {
245
+ const { locale } = useLocale(); // 获取当前语言环境
272
246
 
273
- 在您的整个应用程序中访问内容字典:
247
+ return <Link {...props} to={locacalizeTo(props.to, locale)} />;
248
+ };
249
+ ```
274
250
 
275
- #### 根重定向页面
251
+ 如果你想导航到本地化路由,可以使用 `useLocalizedNavigate` 钩子:
276
252
 
277
- ```tsx fileName="app/routes/page.tsx" codeFormat="typescript"
278
- // app/routes/page.tsx
279
- import { useLocale } from "react-intlayer";
280
- import { Navigate } from "react-router";
253
+ ```tsx fileName="app/hooks/useLocalizedNavigate.ts"
254
+ import { useLocale } from "intlayer";
255
+ import { type NavigateOptions, type To, useNavigate } from "react-router";
281
256
 
282
- export default function Page() {
257
+ import { locacalizeTo } from "~/components/localized-link";
258
+
259
+ export const useLocalizedNavigate = () => {
260
+ const navigate = useNavigate();
283
261
  const { locale } = useLocale();
284
262
 
285
- return <Navigate replace to={locale} />;
286
- }
263
+ const localizedNavigate = (to: To, options?: NavigateOptions) => {
264
+ const localedTo = locacalizeTo(to, locale);
265
+
266
+ navigate(localedTo, options);
267
+ };
268
+
269
+ return localizedNavigate;
270
+ };
287
271
  ```
288
272
 
273
+ ### 第8步:在你的页面中使用 Intlayer
274
+
275
+ 在您的整个应用程序中访问内容字典:
276
+
289
277
  #### 本地化主页
290
278
 
291
- ```tsx fileName="app/routes/[lang]/page.tsx" codeFormat="typescript"
279
+ ```tsx fileName="app/routes/[lang]/page.tsx"
292
280
  import { useIntlayer } from "react-intlayer";
293
- import LocalizedLink from "~/components/localized-link";
281
+ import { LocalizedLink } from "~/components/localized-link";
294
282
 
295
283
  export default function Page() {
296
- const content = useIntlayer("page");
284
+ const { title, description, aboutLink } = useIntlayer("page");
297
285
 
298
286
  return (
299
- <div style={{ padding: "2rem", textAlign: "center" }}>
300
- <h1>{content.title}</h1>
301
- <p>{content.description}</p>
302
- <nav style={{ marginTop: "2rem" }}>
303
- <LocalizedLink
304
- to="/about"
305
- style={{
306
- display: "inline-block",
307
- padding: "0.5rem 1rem",
308
- backgroundColor: "#007bff",
309
- color: "white",
310
- textDecoration: "none",
311
- borderRadius: "4px",
312
- }}
313
- >
314
- {content.aboutLink}
315
- </LocalizedLink>
287
+ <div>
288
+ <h1>{title}</h1>
289
+ <p>{description}</p>
290
+ <nav>
291
+ <LocalizedLink to="/about">{aboutLink}</LocalizedLink>
316
292
  </nav>
317
293
  </div>
318
294
  );
319
295
  }
320
296
  ```
321
297
 
322
- > 想了解更多关于 `useIntlayer` 钩子的内容,请参考[文档](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/packages/react-intlayer/useIntlayer.md)。
298
+ > 想了解更多关于 `useIntlayer` 钩子的内容,请参阅[文档](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/packages/react-intlayer/useIntlayer.md)。
323
299
 
324
300
  ### 第9步:创建语言切换组件
325
301
 
326
302
  创建一个组件,允许用户切换语言:
327
303
 
328
- ```tsx fileName="app/components/locale-switcher.tsx" codeFormat="typescript"
329
- import { getLocalizedUrl, getLocaleName } from "intlayer";
330
- import { useLocale } from "react-intlayer";
331
- import { useLocation, useNavigate } from "react-router";
304
+ ```tsx fileName="app/components/locale-switcher.tsx"
305
+ import type { FC } from "react";
332
306
 
333
- export default function LocaleSwitcher() {
334
- const { locale, availableLocales, setLocale } = useLocale();
335
- const location = useLocation();
336
- const navigate = useNavigate();
307
+ import {
308
+ getHTMLTextDir,
309
+ getLocaleName,
310
+ getLocalizedUrl,
311
+ getPathWithoutLocale,
312
+ } from "intlayer";
313
+ import { setLocaleCookie, useIntlayer, useLocale } from "react-intlayer";
314
+ import { Link, useLocation } from "react-router";
337
315
 
338
- const handleLocaleChange = (newLocale: string) => {
339
- const localizedUrl = getLocalizedUrl(
340
- location.pathname + location.search,
341
- newLocale
342
- );
343
- setLocale(newLocale);
344
- navigate(localizedUrl);
345
- };
316
+ export const LocaleSwitcher: FC = () => {
317
+ const { localeSwitcherLabel } = useIntlayer("locale-switcher"); // 使用 useIntlayer 钩子获取本地化标签
318
+ const { pathname } = useLocation(); // 获取当前路径名
319
+
320
+ const { availableLocales, locale } = useLocale(); // 获取可用语言和当前语言
321
+
322
+ const pathWithoutLocale = getPathWithoutLocale(pathname); // 获取不带语言前缀的路径
346
323
 
347
324
  return (
348
- <div style={{ margin: "1rem 0" }}>
349
- <label htmlFor="locale-select">选择语言: </label>
350
- <select
351
- id="locale-select"
352
- value={locale}
353
- onChange={(e) => handleLocaleChange(e.target.value)}
354
- style={{ padding: "0.25rem", marginLeft: "0.5rem" }}
355
- >
356
- {availableLocales.map((availableLocale) => (
357
- <option key={availableLocale} value={availableLocale}>
358
- {getLocaleName(availableLocale)}
359
- </option>
360
- ))}
361
- </select>
362
- </div>
325
+ <ol>
326
+ {availableLocales.map((localeItem) => (
327
+ <li key={localeItem}>
328
+ <Link
329
+ aria-current={localeItem === locale ? "page" : undefined}
330
+ aria-label={`${localeSwitcherLabel.value} ${getLocaleName(localeItem)}`}
331
+ onClick={() => setLocaleCookie(localeItem)}
332
+ to={getLocalizedUrl(pathWithoutLocale, localeItem)}
333
+ >
334
+ <span>
335
+ {/* 语言环境 - 例如 FR */}
336
+ {localeItem}
337
+ </span>
338
+ <span>
339
+ {/* 语言在其自身语言环境中的名称 - 例如 Français */}
340
+ {getLocaleName(localeItem, locale)}
341
+ </span>
342
+ <span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
343
+ {/* 语言在当前语言环境中的名称 - 例如当前语言环境为 Locales.SPANISH 时显示 Francés */}
344
+ {getLocaleName(localeItem)}
345
+ </span>
346
+ <span dir="ltr" lang={Locales.ENGLISH}>
347
+ {/* 语言的英文名称 - 例如 French */}
348
+ {getLocaleName(localeItem, Locales.ENGLISH)}
349
+ </span>
350
+ </Link>
351
+ </li>
352
+ ))}
353
+ </ol>
363
354
  );
364
- }
355
+ };
365
356
  ```
366
357
 
367
- > 想了解更多关于 `useLocale` 钩子的内容,请参考[文档](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/packages/react-intlayer/useLocale.md)。
358
+ > 想了解更多关于 `useLocale` 钩子的内容,请参阅[文档](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/packages/react-intlayer/useLocale.md)。
368
359
 
369
- ### 第10步:添加 HTML 属性管理(可选)
360
+ ### 第10步:添加HTML属性管理(可选)
370
361
 
371
- 创建一个钩子来管理 HTML 的 lang 和 dir 属性:
362
+ 创建一个钩子来管理HTML的 lang 和 dir 属性:
372
363
 
373
- ```tsx fileName="app/hooks/useI18nHTMLAttributes.tsx" codeFormat="typescript"
374
- // app/hooks/useI18nHTMLAttributes.tsx
364
+ ```tsx fileName="app/hooks/useI18nHTMLAttributes.tsx"
375
365
  import { getHTMLTextDir } from "intlayer";
376
366
  import { useEffect } from "react";
377
367
  import { useLocale } from "react-intlayer";
@@ -388,15 +378,14 @@ export const useI18nHTMLAttributes = () => {
388
378
 
389
379
  然后在你的根组件中使用它:
390
380
 
391
- ```tsx fileName="app/root.tsx" codeFormat="typescript"
392
- // app/routes/layout.tsx
381
+ ```tsx fileName="app/routes/layout.tsx"
393
382
  import { Outlet } from "react-router";
394
383
  import { IntlayerProvider } from "react-intlayer";
395
384
 
396
- import { useI18nHTMLAttributes } from "app/hooks/useI18nHTMLAttributes"; // 导入钩子
385
+ import { useI18nHTMLAttributes } from "app/hooks/useI18nHTMLAttributes"; // 导入该钩子
397
386
 
398
387
  export default function RootLayout() {
399
- useI18nHTMLAttributes(); // 调用钩子
388
+ useI18nHTMLAttributes(); // 调用该钩子
400
389
 
401
390
  return (
402
391
  <IntlayerProvider>
@@ -406,57 +395,48 @@ export default function RootLayout() {
406
395
  }
407
396
  ```
408
397
 
409
- ### 第11步:构建并运行你的应用程序
398
+ ### 第11步:添加中间件(可选)
410
399
 
411
- 构建内容字典并运行您的应用程序:
400
+ 你也可以使用 `intlayerMiddleware` 为你的应用添加服务器端路由。该插件会根据 URL 自动检测当前的语言环境,并设置相应的语言环境 cookie。如果未指定语言环境,插件将根据用户浏览器的语言偏好确定最合适的语言环境。如果仍未检测到语言环境,则会重定向到默认语言环境。
412
401
 
413
- ```bash packageManager="npm"
414
- # 构建 Intlayer 字典
415
- npm run intlayer:build
416
-
417
- # 启动开发服务器
418
- npm run dev
419
- ```
402
+ > 注意,要在生产环境中使用 `intlayerMiddleware`,你需要将 `vite-intlayer` 包从 `devDependencies` 切换到 `dependencies`。
420
403
 
421
- ```bash packageManager="pnpm"
422
- # 构建 Intlayer 字典
423
- pnpm intlayer:build
404
+ ```typescript {3,7} fileName="vite.config.ts"
405
+ import { defineConfig } from "vite";
406
+ import react from "@vitejs/plugin-react-swc";
407
+ import { intlayer, intlayerMiddleware } from "vite-intlayer";
424
408
 
425
- # 启动开发服务器
426
- pnpm dev
409
+ // https://vitejs.dev/config/
410
+ export default defineConfig({
411
+ plugins: [react(), intlayer(), intlayerMiddleware()],
412
+ });
427
413
  ```
428
414
 
429
- ```bash packageManager="yarn"
430
- # 构建 Intlayer 字典
431
- yarn intlayer:build
432
-
433
- # 启动开发服务器
434
- yarn dev
435
- ```
415
+ ---
436
416
 
437
- ### 第12步:配置 TypeScript(可选)
417
+ ## 配置 TypeScript
438
418
 
439
- Intlayer 使用模块增强来利用 TypeScript 的优势,使您的代码库更健壮。
419
+ Intlayer 使用模块增强来利用 TypeScript 的优势,使您的代码库更强大。
440
420
 
441
421
  确保您的 TypeScript 配置包含自动生成的类型:
442
422
 
443
423
  ```json5 fileName="tsconfig.json"
444
424
  {
445
- compilerOptions: {
446
- // ... 您现有的 TypeScript 配置
447
- },
425
+ // ... 您现有的配置
448
426
  include: [
449
- // ... 你现有的包含项
427
+ // ... 您现有的包含项
450
428
  ".intlayer/**/*.ts", // 包含自动生成的类型
451
429
  ],
452
430
  }
453
431
  ```
454
432
 
455
- ### Git 配置
433
+ ---
434
+
435
+ ## Git 配置
456
436
 
457
- 建议忽略 Intlayer 生成的文件。这样可以避免将它们提交到你的 Git 仓库。
437
+ 建议忽略 Intlayer 生成的文件,这样可以避免将它们提交到您的 Git 仓库。
458
438
 
459
- 为此,你可以在 `.gitignore` 文件中添加以下内容:
439
+ 为此,您可以在 `.gitignore` 文件中添加以下指令:
460
440
 
461
441
  ```plaintext fileName=".gitignore"
462
442
  # 忽略 Intlayer 生成的文件
@@ -465,35 +445,6 @@ Intlayer 使用模块增强来利用 TypeScript 的优势,使您的代码库
465
445
 
466
446
  ---
467
447
 
468
- ## 生产环境部署
469
-
470
- 部署你的应用时:
471
-
472
- 1. **构建你的应用:**
473
-
474
- ```bash
475
- npm run build
476
- ```
477
-
478
- 2. **构建 Intlayer 字典:**
479
-
480
- ```bash
481
- npm run intlayer:build
482
- ```
483
-
484
- 3. **如果在生产环境使用中间件,需将 `vite-intlayer` 移动到依赖中:**
485
- ```bash
486
- npm install vite-intlayer --save
487
- ```
488
-
489
- 您的应用程序现在将支持:
490
-
491
- - **URL 结构**:`/en`,`/en/about`,`/tr`,`/tr/about`
492
- - 基于浏览器偏好的**自动语言环境检测**
493
- - 使用 React Router v7 的**语言环境感知路由**
494
- - 具有自动生成类型的**TypeScript 支持**
495
- - 具有正确语言环境处理的**服务器端渲染**
496
-
497
448
  ## VS Code 扩展
498
449
 
499
450
  为了提升您使用 Intlayer 的开发体验,您可以安装官方的 **Intlayer VS Code 扩展**。
@@ -502,18 +453,18 @@ Intlayer 使用模块增强来利用 TypeScript 的优势,使您的代码库
502
453
 
503
454
  该扩展提供:
504
455
 
505
- - 翻译键的**自动补全**
506
- - 缺失翻译的**实时错误检测**
507
- - 翻译内容的**内联预览**
508
- - **快速操作**,轻松创建和更新翻译。
456
+ - 翻译键的**自动补全**。
457
+ - 缺失翻译的**实时错误检测**。
458
+ - 翻译内容的**内联预览**。
459
+ - 轻松创建和更新翻译的**快速操作**。
509
460
 
510
- 有关如何使用该扩展的更多详细信息,请参阅[Intlayer VS Code 扩展文档](https://intlayer.org/doc/vs-code-extension)。
461
+ 有关如何使用该扩展的更多详细信息,请参阅 [Intlayer VS Code 扩展文档](https://intlayer.org/doc/vs-code-extension)。
511
462
 
512
463
  ---
513
464
 
514
465
  ## 深入了解
515
466
 
516
- 要进一步使用,您可以实现[可视化编辑器](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/intlayer_visual_editor.md)或使用[内容管理系统(CMS)](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/intlayer_CMS.md)将内容外部化。
467
+ 要更进一步,您可以实现[可视化编辑器](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/intlayer_visual_editor.md)或使用[内容管理系统(CMS)](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/intlayer_CMS.md)来外部化您的内容。
517
468
 
518
469
  ---
519
470
 
@@ -526,10 +477,11 @@ Intlayer 使用模块增强来利用 TypeScript 的优势,使您的代码库
526
477
  - [内容声明](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/dictionary/get_started.md)
527
478
  - [配置](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/configuration.md)
528
479
 
529
- 本综合指南提供了将 Intlayer 与 React Router v7 集成所需的一切,支持完全国际化的应用程序,具备基于语言环境的路由和 TypeScript 支持。
480
+ 本综合指南提供了将 Intlayer 与 React Router v7 集成所需的一切,支持完全国际化的应用程序,具备基于区域设置的路由和 TypeScript 支持。
530
481
 
531
482
  ## 文档历史
532
483
 
533
- | 版本 | 日期 | 变更内容 |
534
- | ----- | --------- | ------------------------- |
535
- | 5.8.2 | 2025-09-4 | 新增 React Router v7 支持 |
484
+ | 版本 | 日期 | 变更内容 |
485
+ | ----- | ---------- | ------------------------- |
486
+ | 6.1.5 | 2025-10-03 | 更新文档 |
487
+ | 5.8.2 | 2025-09-04 | 添加 React Router v7 支持 |