@intlayer/docs 5.7.8 → 5.8.0

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 (297) hide show
  1. package/blog/ar/intlayer_with_next-i18next.md +5 -6
  2. package/blog/ar/intlayer_with_next-intl.md +3 -4
  3. package/blog/ar/intlayer_with_react-i18next.md +1 -1
  4. package/blog/ar/intlayer_with_react-intl.md +1 -1
  5. package/blog/ar/next-i18next_vs_next-intl_vs_intlayer.md +96 -219
  6. package/blog/ar/react-i18next_vs_react-intl_vs_intlayer.md +88 -129
  7. package/blog/ar/vue-i18n_vs_intlayer.md +268 -0
  8. package/blog/de/intlayer_with_next-i18next.md +5 -6
  9. package/blog/de/intlayer_with_react-intl.md +1 -1
  10. package/blog/de/next-i18next_vs_next-intl_vs_intlayer.md +93 -216
  11. package/blog/de/react-i18next_vs_react-intl_vs_intlayer.md +87 -128
  12. package/blog/de/vue-i18n_vs_intlayer.md +268 -0
  13. package/blog/en/intlayer_with_next-i18next.md +5 -6
  14. package/blog/en/intlayer_with_next-intl.md +3 -4
  15. package/blog/en/intlayer_with_react-i18next.md +1 -1
  16. package/blog/en/intlayer_with_react-intl.md +1 -1
  17. package/blog/en/next-i18next_vs_next-intl_vs_intlayer.md +89 -220
  18. package/blog/en/react-i18next_vs_react-intl_vs_intlayer.md +85 -123
  19. package/blog/en/vue-i18n_vs_intlayer.md +268 -0
  20. package/blog/en-GB/intlayer_with_next-i18next.md +5 -6
  21. package/blog/en-GB/intlayer_with_next-intl.md +3 -4
  22. package/blog/en-GB/intlayer_with_react-i18next.md +1 -1
  23. package/blog/en-GB/intlayer_with_react-intl.md +1 -1
  24. package/blog/en-GB/next-i18next_vs_next-intl_vs_intlayer.md +85 -218
  25. package/blog/en-GB/react-i18next_vs_react-intl_vs_intlayer.md +80 -130
  26. package/blog/en-GB/vue-i18n_vs_intlayer.md +258 -0
  27. package/blog/es/intlayer_with_next-i18next.md +5 -6
  28. package/blog/es/intlayer_with_next-intl.md +3 -4
  29. package/blog/es/intlayer_with_react-i18next.md +1 -1
  30. package/blog/es/intlayer_with_react-intl.md +1 -1
  31. package/blog/es/next-i18next_vs_next-intl_vs_intlayer.md +93 -216
  32. package/blog/es/react-i18next_vs_react-intl_vs_intlayer.md +87 -128
  33. package/blog/es/vue-i18n_vs_intlayer.md +268 -0
  34. package/blog/fr/intlayer_with_next-i18next.md +5 -6
  35. package/blog/fr/intlayer_with_next-intl.md +3 -4
  36. package/blog/fr/intlayer_with_react-i18next.md +1 -1
  37. package/blog/fr/intlayer_with_react-intl.md +1 -1
  38. package/blog/fr/next-i18next_vs_next-intl_vs_intlayer.md +91 -214
  39. package/blog/fr/react-i18next_vs_react-intl_vs_intlayer.md +86 -127
  40. package/blog/fr/vue-i18n_vs_intlayer.md +269 -0
  41. package/blog/hi/intlayer_with_next-i18next.md +5 -6
  42. package/blog/hi/intlayer_with_next-intl.md +3 -4
  43. package/blog/hi/intlayer_with_react-i18next.md +1 -1
  44. package/blog/hi/intlayer_with_react-intl.md +1 -1
  45. package/blog/hi/next-i18next_vs_next-intl_vs_intlayer.md +97 -220
  46. package/blog/hi/react-i18next_vs_react-intl_vs_intlayer.md +89 -130
  47. package/blog/hi/vue-i18n_vs_intlayer.md +268 -0
  48. package/blog/it/intlayer_with_next-i18next.md +5 -6
  49. package/blog/it/intlayer_with_next-intl.md +3 -4
  50. package/blog/it/intlayer_with_react-i18next.md +1 -1
  51. package/blog/it/intlayer_with_react-intl.md +1 -1
  52. package/blog/it/next-i18next_vs_next-intl_vs_intlayer.md +91 -214
  53. package/blog/it/react-i18next_vs_react-intl_vs_intlayer.md +86 -127
  54. package/blog/it/vue-i18n_vs_intlayer.md +268 -0
  55. package/blog/ja/intlayer_with_next-i18next.md +5 -6
  56. package/blog/ja/intlayer_with_next-intl.md +3 -4
  57. package/blog/ja/intlayer_with_react-intl.md +1 -1
  58. package/blog/ja/next-i18next_vs_next-intl_vs_intlayer.md +93 -216
  59. package/blog/ja/react-i18next_vs_react-intl_vs_intlayer.md +87 -128
  60. package/blog/ja/vue-i18n_vs_intlayer.md +268 -0
  61. package/blog/ko/intlayer_with_next-i18next.md +5 -6
  62. package/blog/ko/intlayer_with_next-intl.md +3 -4
  63. package/blog/ko/intlayer_with_react-intl.md +1 -1
  64. package/blog/ko/next-i18next_vs_next-intl_vs_intlayer.md +95 -217
  65. package/blog/ko/react-i18next_vs_react-intl_vs_intlayer.md +89 -130
  66. package/blog/ko/vue-i18n_vs_intlayer.md +268 -0
  67. package/blog/pt/intlayer_with_next-i18next.md +5 -6
  68. package/blog/pt/intlayer_with_next-intl.md +3 -4
  69. package/blog/pt/intlayer_with_react-intl.md +1 -1
  70. package/blog/pt/next-i18next_vs_next-intl_vs_intlayer.md +93 -216
  71. package/blog/pt/react-i18next_vs_react-intl_vs_intlayer.md +87 -128
  72. package/blog/pt/vue-i18n_vs_intlayer.md +268 -0
  73. package/blog/ru/intlayer_with_next-i18next.md +5 -6
  74. package/blog/ru/intlayer_with_next-intl.md +3 -4
  75. package/blog/ru/intlayer_with_react-i18next.md +1 -1
  76. package/blog/ru/intlayer_with_react-intl.md +1 -1
  77. package/blog/ru/next-i18next_vs_next-intl_vs_intlayer.md +94 -217
  78. package/blog/ru/react-i18next_vs_react-intl_vs_intlayer.md +87 -128
  79. package/blog/ru/vue-i18n_vs_intlayer.md +268 -0
  80. package/blog/zh/intlayer_with_next-i18next.md +5 -6
  81. package/blog/zh/intlayer_with_next-intl.md +3 -4
  82. package/blog/zh/intlayer_with_react-i18next.md +1 -1
  83. package/blog/zh/intlayer_with_react-intl.md +1 -1
  84. package/blog/zh/next-i18next_vs_next-intl_vs_intlayer.md +93 -216
  85. package/blog/zh/react-i18next_vs_react-intl_vs_intlayer.md +87 -128
  86. package/blog/zh/vue-i18n_vs_intlayer.md +269 -0
  87. package/dist/cjs/generated/blog.entry.cjs +41 -0
  88. package/dist/cjs/generated/blog.entry.cjs.map +1 -1
  89. package/dist/cjs/generated/docs.entry.cjs +41 -0
  90. package/dist/cjs/generated/docs.entry.cjs.map +1 -1
  91. package/dist/esm/generated/blog.entry.mjs +41 -0
  92. package/dist/esm/generated/blog.entry.mjs.map +1 -1
  93. package/dist/esm/generated/docs.entry.mjs +41 -0
  94. package/dist/esm/generated/docs.entry.mjs.map +1 -1
  95. package/dist/types/generated/blog.entry.d.ts +1 -0
  96. package/dist/types/generated/blog.entry.d.ts.map +1 -1
  97. package/dist/types/generated/docs.entry.d.ts +1 -0
  98. package/dist/types/generated/docs.entry.d.ts.map +1 -1
  99. package/docs/ar/formatters.md +625 -0
  100. package/docs/ar/how_works_intlayer.md +2 -4
  101. package/docs/ar/interest_of_intlayer.md +159 -49
  102. package/docs/ar/intlayer_CMS.md +2 -3
  103. package/docs/ar/intlayer_visual_editor.md +2 -3
  104. package/docs/ar/intlayer_with_tanstack.md +1 -1
  105. package/docs/ar/introduction.md +7 -7
  106. package/docs/ar/packages/intlayer/index.md +3 -3
  107. package/docs/ar/packages/next-intlayer/index.md +3 -3
  108. package/docs/de/formatters.md +649 -0
  109. package/docs/de/interest_of_intlayer.md +161 -47
  110. package/docs/de/introduction.md +5 -5
  111. package/docs/de/packages/intlayer/index.md +3 -3
  112. package/docs/de/packages/next-intlayer/index.md +3 -3
  113. package/docs/de/packages/react-intlayer/index.md +3 -3
  114. package/docs/en/dictionary/enumeration.md +2 -2
  115. package/docs/en/dictionary/function_fetching.md +2 -2
  116. package/docs/en/dictionary/get_started.md +2 -2
  117. package/docs/en/dictionary/translation.md +2 -2
  118. package/docs/en/formatters.md +618 -0
  119. package/docs/en/how_works_intlayer.md +2 -4
  120. package/docs/en/interest_of_intlayer.md +170 -46
  121. package/docs/en/intlayer_CMS.md +2 -3
  122. package/docs/en/intlayer_visual_editor.md +2 -3
  123. package/docs/en/intlayer_with_create_react_app.md +2 -2
  124. package/docs/en/intlayer_with_express.md +2 -2
  125. package/docs/en/intlayer_with_tanstack.md +1 -1
  126. package/docs/en/introduction.md +7 -7
  127. package/docs/en/packages/express-intlayer/index.md +2 -2
  128. package/docs/en/packages/intlayer/getConfiguration.md +2 -3
  129. package/docs/en/packages/intlayer/getEnumeration.md +2 -7
  130. package/docs/en/packages/intlayer/getHTMLTextDir.md +2 -4
  131. package/docs/en/packages/intlayer/getLocaleLang.md +2 -4
  132. package/docs/en/packages/intlayer/getLocaleName.md +2 -3
  133. package/docs/en/packages/intlayer/getLocalizedUrl.md +2 -8
  134. package/docs/en/packages/intlayer/getMultilingualUrls.md +2 -7
  135. package/docs/en/packages/intlayer/getPathWithoutLocale.md +2 -3
  136. package/docs/en/packages/intlayer/getTranslation.md +2 -4
  137. package/docs/en/packages/intlayer/index.md +5 -5
  138. package/docs/en/packages/next-intlayer/index.md +5 -5
  139. package/docs/en/packages/next-intlayer/t.md +2 -2
  140. package/docs/en/packages/next-intlayer/useDictionary.md +2 -2
  141. package/docs/en/packages/next-intlayer/useIntlayer.md +2 -2
  142. package/docs/en/packages/next-intlayer/useLocale.md +2 -2
  143. package/docs/en/packages/react-intlayer/index.md +5 -5
  144. package/docs/en/packages/react-intlayer/t.md +2 -2
  145. package/docs/en/packages/react-intlayer/useI18n.md +2 -2
  146. package/docs/en/packages/react-intlayer/useIntlayer.md +2 -2
  147. package/docs/en/packages/react-intlayer/useLocale.md +2 -2
  148. package/docs/en/packages/react-scripts-intlayer/index.md +2 -2
  149. package/docs/en/packages/solid-intlayer/index.md +2 -2
  150. package/docs/en/packages/vite-intlayer/index.md +2 -2
  151. package/docs/en-GB/formatters.md +625 -0
  152. package/docs/en-GB/how_works_intlayer.md +2 -4
  153. package/docs/en-GB/interest_of_intlayer.md +157 -53
  154. package/docs/en-GB/intlayer_with_tanstack.md +1 -1
  155. package/docs/en-GB/introduction.md +2 -2
  156. package/docs/en-GB/packages/intlayer/index.md +3 -3
  157. package/docs/en-GB/packages/next-intlayer/index.md +3 -3
  158. package/docs/en-GB/packages/react-intlayer/index.md +3 -3
  159. package/docs/es/formatters.md +649 -0
  160. package/docs/es/how_works_intlayer.md +2 -4
  161. package/docs/es/interest_of_intlayer.md +156 -47
  162. package/docs/es/intlayer_with_tanstack.md +1 -1
  163. package/docs/es/introduction.md +5 -5
  164. package/docs/es/packages/intlayer/index.md +3 -3
  165. package/docs/es/packages/next-intlayer/index.md +3 -3
  166. package/docs/fr/formatters.md +649 -0
  167. package/docs/fr/how_works_intlayer.md +2 -4
  168. package/docs/fr/interest_of_intlayer.md +157 -46
  169. package/docs/fr/intlayer_with_tanstack.md +1 -1
  170. package/docs/fr/introduction.md +5 -5
  171. package/docs/fr/packages/intlayer/index.md +3 -3
  172. package/docs/fr/packages/next-intlayer/index.md +3 -3
  173. package/docs/fr/packages/react-intlayer/index.md +3 -3
  174. package/docs/hi/formatters.md +630 -0
  175. package/docs/hi/how_works_intlayer.md +2 -4
  176. package/docs/hi/interest_of_intlayer.md +155 -42
  177. package/docs/hi/intlayer_with_tanstack.md +1 -1
  178. package/docs/hi/introduction.md +5 -5
  179. package/docs/hi/packages/intlayer/index.md +3 -3
  180. package/docs/hi/packages/next-intlayer/index.md +3 -3
  181. package/docs/hi/packages/react-intlayer/index.md +3 -3
  182. package/docs/it/formatters.md +647 -0
  183. package/docs/it/how_works_intlayer.md +2 -4
  184. package/docs/it/interest_of_intlayer.md +157 -46
  185. package/docs/it/intlayer_with_tanstack.md +1 -1
  186. package/docs/it/introduction.md +5 -5
  187. package/docs/it/packages/intlayer/index.md +3 -3
  188. package/docs/it/packages/next-intlayer/index.md +3 -3
  189. package/docs/it/packages/react-intlayer/index.md +3 -3
  190. package/docs/ja/formatters.md +649 -0
  191. package/docs/ja/how_works_intlayer.md +2 -4
  192. package/docs/ja/interest_of_intlayer.md +154 -48
  193. package/docs/ja/intlayer_with_tanstack.md +1 -1
  194. package/docs/ja/introduction.md +5 -5
  195. package/docs/ja/packages/intlayer/index.md +3 -3
  196. package/docs/ja/packages/next-intlayer/index.md +3 -3
  197. package/docs/ja/packages/react-intlayer/index.md +3 -3
  198. package/docs/ko/formatters.md +649 -0
  199. package/docs/ko/how_works_intlayer.md +2 -4
  200. package/docs/ko/interest_of_intlayer.md +157 -48
  201. package/docs/ko/intlayer_with_tanstack.md +1 -1
  202. package/docs/ko/introduction.md +5 -5
  203. package/docs/ko/packages/intlayer/index.md +3 -3
  204. package/docs/ko/packages/next-intlayer/index.md +3 -3
  205. package/docs/ko/packages/react-intlayer/index.md +3 -3
  206. package/docs/pt/formatters.md +625 -0
  207. package/docs/pt/how_works_intlayer.md +2 -4
  208. package/docs/pt/interest_of_intlayer.md +162 -47
  209. package/docs/pt/intlayer_with_tanstack.md +1 -1
  210. package/docs/pt/introduction.md +5 -5
  211. package/docs/pt/packages/intlayer/index.md +3 -3
  212. package/docs/pt/packages/next-intlayer/index.md +3 -3
  213. package/docs/pt/packages/react-intlayer/index.md +3 -3
  214. package/docs/ru/autoFill.md +2 -2
  215. package/docs/ru/configuration.md +1 -40
  216. package/docs/ru/formatters.md +649 -0
  217. package/docs/ru/how_works_intlayer.md +5 -7
  218. package/docs/ru/index.md +1 -1
  219. package/docs/ru/interest_of_intlayer.md +165 -50
  220. package/docs/ru/intlayer_CMS.md +7 -8
  221. package/docs/ru/intlayer_cli.md +4 -7
  222. package/docs/ru/intlayer_visual_editor.md +5 -6
  223. package/docs/ru/intlayer_with_angular.md +1 -1
  224. package/docs/ru/intlayer_with_create_react_app.md +5 -5
  225. package/docs/ru/intlayer_with_lynx+react.md +1 -1
  226. package/docs/ru/intlayer_with_nextjs_15.md +3 -3
  227. package/docs/ru/intlayer_with_nextjs_page_router.md +2 -2
  228. package/docs/ru/intlayer_with_nuxt.md +1 -1
  229. package/docs/ru/intlayer_with_react_native+expo.md +2 -2
  230. package/docs/ru/intlayer_with_tanstack.md +3 -3
  231. package/docs/ru/intlayer_with_vite+preact.md +3 -3
  232. package/docs/ru/intlayer_with_vite+react.md +3 -3
  233. package/docs/ru/intlayer_with_vite+solid.md +1 -1
  234. package/docs/ru/intlayer_with_vite+svelte.md +1 -1
  235. package/docs/ru/intlayer_with_vite+vue.md +2 -2
  236. package/docs/ru/introduction.md +8 -8
  237. package/docs/ru/locale_mapper.md +1 -1
  238. package/docs/ru/packages/@intlayer/api/index.md +2 -2
  239. package/docs/ru/packages/@intlayer/chokidar/index.md +1 -1
  240. package/docs/ru/packages/@intlayer/cli/index.md +2 -2
  241. package/docs/ru/packages/@intlayer/config/index.md +2 -2
  242. package/docs/ru/packages/@intlayer/core/index.md +2 -2
  243. package/docs/ru/packages/@intlayer/design-system/index.md +2 -2
  244. package/docs/ru/packages/@intlayer/dictionary-entry/index.md +2 -2
  245. package/docs/ru/packages/@intlayer/editor/index.md +1 -1
  246. package/docs/ru/packages/@intlayer/editor-react/index.md +1 -1
  247. package/docs/ru/packages/@intlayer/webpack/index.md +1 -1
  248. package/docs/ru/packages/angular-intlayer/index.md +1 -1
  249. package/docs/ru/packages/express-intlayer/index.md +3 -3
  250. package/docs/ru/packages/express-intlayer/t.md +1 -1
  251. package/docs/ru/packages/intlayer/getEnumeration.md +3 -8
  252. package/docs/ru/packages/intlayer/getTranslation.md +3 -5
  253. package/docs/ru/packages/intlayer/getTranslationContent.md +1 -3
  254. package/docs/ru/packages/intlayer/index.md +6 -6
  255. package/docs/ru/packages/intlayer-cli/index.md +1 -1
  256. package/docs/ru/packages/intlayer-editor/index.md +2 -2
  257. package/docs/ru/packages/lynx-intlayer/index.md +1 -1
  258. package/docs/ru/packages/next-intlayer/index.md +7 -7
  259. package/docs/ru/packages/next-intlayer/t.md +4 -4
  260. package/docs/ru/packages/next-intlayer/useLocale.md +3 -3
  261. package/docs/ru/packages/nuxt-intlayer/index.md +1 -1
  262. package/docs/ru/packages/preact-intlayer/index.md +1 -1
  263. package/docs/ru/packages/react-intlayer/index.md +7 -7
  264. package/docs/ru/packages/react-intlayer/t.md +4 -4
  265. package/docs/ru/packages/react-native-intlayer/index.md +1 -1
  266. package/docs/ru/packages/react-scripts-intlayer/index.md +3 -3
  267. package/docs/ru/packages/solid-intlayer/index.md +3 -3
  268. package/docs/ru/packages/svelte-intlayer/index.md +1 -1
  269. package/docs/ru/packages/vite-intlayer/index.md +3 -3
  270. package/docs/ru/packages/vue-intlayer/index.md +1 -1
  271. package/docs/ru/per_locale_file.md +1 -1
  272. package/docs/ru/roadmap.md +3 -5
  273. package/docs/ru/vs_code_extension.md +1 -1
  274. package/docs/zh/formatters.md +647 -0
  275. package/docs/zh/how_works_intlayer.md +2 -4
  276. package/docs/zh/interest_of_intlayer.md +155 -48
  277. package/docs/zh/intlayer_with_tanstack.md +1 -1
  278. package/docs/zh/introduction.md +5 -5
  279. package/docs/zh/packages/intlayer/index.md +3 -3
  280. package/docs/zh/packages/next-intlayer/index.md +3 -3
  281. package/docs/zh/packages/react-intlayer/index.md +3 -3
  282. package/frequent_questions/ar/domain_routing.md +1 -1
  283. package/frequent_questions/en/domain_routing.md +1 -1
  284. package/frequent_questions/en-GB/domain_routing.md +1 -1
  285. package/frequent_questions/es/domain_routing.md +1 -1
  286. package/frequent_questions/fr/domain_routing.md +1 -1
  287. package/frequent_questions/hi/domain_routing.md +1 -1
  288. package/frequent_questions/it/domain_routing.md +1 -1
  289. package/frequent_questions/ko/domain_routing.md +1 -1
  290. package/frequent_questions/pt/domain_routing.md +1 -1
  291. package/frequent_questions/ru/domain_routing.md +1 -1
  292. package/frequent_questions/ru/get_locale_cookie.md +4 -4
  293. package/frequent_questions/ru/static_rendering.md +1 -2
  294. package/frequent_questions/zh/domain_routing.md +1 -1
  295. package/package.json +11 -11
  296. package/src/generated/blog.entry.ts +41 -0
  297. package/src/generated/docs.entry.ts +41 -0
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  createdAt: 2025-01-02
3
3
  updatedAt: 2025-06-29
4
- title: react-i18n vs react-intl vs Intlayer
5
- description: Integrate react-i18next with next-intl and Intlayer for the internationalization (i18n) of a React app
4
+ title: react-i18next vs react-intl vs Intlayer
5
+ description: Integrate react-i18next with next-intl and Intlayer for the internationalisation (i18n) of a React app
6
6
  keywords:
7
7
  - next-intl
8
8
  - react-i18next
@@ -17,178 +17,128 @@ slugs:
17
17
  - react-i18next-vs-react-intl-vs-intlayer
18
18
  ---
19
19
 
20
- # React-Intl VS React-i18next VS Intlayer | React Internationalization (i18n)
20
+ # react-Intl VS react-i18next VS intlayer | React Internationalisation (i18n)
21
21
 
22
- Below is a concise comparison of three popular i18n (internationalization) libraries for React: **React-Intl**, **React-i18next**, and **Intlayer**. Each library offers unique features and workflows for integrating multilingual support in your React application. After reading this, you should be able to decide which solution best meets your needs.
22
+ This guide compares three established i18n options for **React**: **react-intl** (FormatJS), **react-i18next** (i18next), and **Intlayer**.
23
+ We focus on **plain React** applications (e.g., Vite, CRA, SPA). If you’re using Next.js, see our dedicated Next.js comparison.
23
24
 
24
- ---
25
-
26
- ## 1. Introduction
25
+ We evaluate:
27
26
 
28
- Internationalization (i18n) in React applications can be achieved in multiple ways. The three libraries presented here have different design philosophies, sets of features, and community support:
27
+ - Architecture & content organisation
28
+ - TypeScript & safety
29
+ - Missing translation handling
30
+ - Rich content & formatting capabilities
31
+ - Performance & loading behaviour
32
+ - Developer experience (DX), tooling & maintenance
33
+ - SEO/routing (framework-dependent)
29
34
 
30
- 1. **React-Intl**
31
- 2. **React-i18next**
32
- 3. **Intlayer**
33
-
34
- Below, you’ll find an overview of each solution, followed by a feature comparison, pros & cons, and example use cases.
35
+ > **tl;dr**: All three can localise a React app. If you want **component-scoped content**, **strict TypeScript types**, **build-time missing-key checks**, **tree-shaken dictionaries**, and built-in editorial tooling (Visual Editor/CMS + optional AI translation), **Intlayer** is the most complete choice for modular React codebases.
35
36
 
36
37
  ---
37
38
 
38
- ## 2. React-Intl
39
-
40
- ### Overview
41
-
42
- [**React-Intl**](https://formatjs.io/docs/react-intl/) is part of the [FormatJS](https://formatjs.io/) suite. It provides a powerful set of **APIs and components** to handle message formatting, pluralization, date/time, and number formatting. React-Intl is widely used in enterprise applications, mainly because it is part of an ecosystem that standardizes message syntax and formatting.
43
-
44
- ### Key Features
45
-
46
- - **ICU Message Syntax**: Offers a comprehensive syntax for message interpolation, pluralization, and more.
47
- - **Localized Formatting**: Built-in utilities to format dates, times, numbers, and relative times based on locale.
48
- - **Declarative Components**: Exposes `<FormattedMessage>`, `<FormattedNumber>`, `<FormattedDate>`, etc., for seamless usage in JSX.
49
- - **Rich Ecosystem**: Integrates well with the FormatJS tooling (e.g., [babel-plugin-react-intl](https://formatjs.io/docs/tooling/babel-plugin/)) for extracting, managing, and compiling messages.
39
+ ## High-level positioning
50
40
 
51
- ### Typical Workflow
52
-
53
- 1. **Define message catalogs** (usually JSON files per locale).
54
- 2. **Wrap your app** in `<IntlProvider locale="en-GB" messages={messages}>`.
55
- 3. **Use** `<FormattedMessage id="myMessage" defaultMessage="Hello world" />` or the `useIntl()` hook to access translation strings.
56
-
57
- ### Pros
58
-
59
- - Well-established and used in many production environments.
60
- - Advanced message formatting, including pluralization, gender, time zones, and more.
61
- - Strong tooling support for message extraction and compilation.
62
-
63
- ### Cons
64
-
65
- - Requires familiarity with the **ICU message format**, which can be verbose.
66
- - Not as straightforward to handle dynamic or complex translations that are more than just string-based.
41
+ - **react-intl** - ICU-first, standards-aligned formatting (dates/numbers/plurals) with a mature API. Catalogues are typically centralised; key safety and build-time validation are largely your responsibility.
42
+ - **react-i18next** - Extremely popular and flexible; namespaces, detectors, and many plugins (ICU, backends). Powerful, but configuration can become sprawling as projects scale.
43
+ - **Intlayer** - Component-centric content model for React, **strict TS typing**, **build-time checks**, **tree-shaking**, plus **Visual Editor/CMS** and **AI-assisted translations**. Works with React Router, Vite, CRA, etc.
67
44
 
68
45
  ---
69
46
 
70
- ## 3. React-i18next
71
-
72
- ### Overview
47
+ ## Feature matrix (React focus)
48
+
49
+ | Feature | `react-intlayer` (Intlayer) | `react-i18next` (i18next) | `react-intl` (FormatJS) |
50
+ | --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
51
+ | **Translations Near Components** | ✅ Yes, content collocated with each component | ❌ No | ❌ No |
52
+ | **TypeScript Integration** | ✅ Advanced, auto-generated strict types | ⚠️ Basic; extra config for safety | ✅ Good, but less strict |
53
+ | **Missing Translation Detection** | ✅ TypeScript error highlight and build-time error/warning | ⚠️ Mostly fallback strings at runtime | ⚠️ Fallback strings |
54
+ | **Rich Content (JSX/Markdown/components)** | ✅ Direct support | ⚠️ Limited / interpolation only | ⚠️ ICU syntax, not real JSX |
55
+ | **AI-powered Translation** | ✅ Yes, supports multiple AI providers. Usable using your own API keys. Considers the context of your application and content scope | ❌ No | ❌ No |
56
+ | **Visual Editor** | ✅ Yes, local Visual Editor + optional CMS; can externalise codebase content; embeddable | ❌ No / available via external localisation platforms | ❌ No / available via external localisation platforms |
57
+ | **Localised Routing** | ✅ Yes, supports localised paths out of the box (works with Next.js & Vite) | ⚠️ No built-in, requires plugins (e.g. `next-i18next`) or custom router config | ❌ No, only message formatting, routing must be manual |
58
+ | **Dynamic Route Generation** | ✅ Yes | ⚠️ Plugin/ecosystem or manual setup | ❌ Not provided |
59
+ | **Pluralisation** | ✅ Enumeration-based patterns | ✅ Configurable (plugins like i18next-icu) | ✅ (ICU) |
60
+ | **Formatting (dates, numbers, currencies)** | ✅ Optimised formatters (Intl under the hood) | ⚠️ Via plugins or custom Intl usage | ✅ ICU formatters |
61
+ | **Content Format** | ✅ .tsx, .ts, .js, .json, .md, .txt, (.yaml WIP) | ⚠️ .json | ✅ .json, .js |
62
+ | **ICU support** | ⚠️ WIP | ⚠️ Via plugin (i18next-icu) | ✅ Yes |
63
+ | **SEO Helpers (hreflang, sitemap)** | ✅ Built-in tools: helpers for sitemap, robots.txt, metadata | ⚠️ Community plugins/manual | ❌ Not core |
64
+ | **Ecosystem / Community** | ⚠️ Smaller but growing fast and reactive | ✅ Largest and mature | ✅ Large |
65
+ | **Server-side Rendering & Server Components** | ✅ Yes, streamlined for SSR / React Server Components | ⚠️ Supported at page level but need to pass t-functions on component tree for children server components | ❌ Not supported, need to pass t-functions on component tree for children server components |
66
+ | **Tree-shaking (load only used content)** | ✅ Yes, per-component at build time via Babel/SWC plugins | ⚠️ Usually loads all (can be improved with namespaces/code-splitting) | ⚠️ Usually loads all |
67
+ | **Lazy loading** | ✅ Yes, per-locale / per-dictionary | ✅ Yes (e.g., backends/namespaces on demand) | ✅ Yes (split locale bundles) |
68
+ | **Purge unused content** | ✅ Yes, per-dictionary at build time | ❌ No, only via manual namespace segmentation | ❌ No, all declared messages are bundled |
69
+ | **Management of Large Projects** | ✅ Encourages modularity, suited for design systems | ⚠️ Requires good file discipline | ⚠️ Central catalogues can become large |
73
70
 
74
- [**React-i18next**](https://react.i18next.com/) is a React extension of [i18next](https://www.i18next.com/), one of the most popular JavaScript i18n frameworks. It offers **extensive features** for runtime translations, lazy loading, and detection of language, making it extremely flexible for a wide variety of use cases.
75
-
76
- ### Key Features
77
-
78
- - **Flexible Translation Structure**: Not tied to a single format like ICU. You can store translations in JSON, use interpolation, pluralization, etc.
79
- - **Dynamic Language Switching**: Built-in language detector plugins and runtime updates.
80
- - **Nested & Structured Translations**: You can nest translations easily within JSON.
81
- - **Extensive Plugin Ecosystem**: For detection (browser, path, subdomain, etc.), resource loading, caching, and more.
82
-
83
- ### Typical Workflow
84
-
85
- 1. **Install `i18next` & `react-i18next`.**
86
- 2. **Configure i18n** to load translations (JSON) and set up language detection or fallback.
87
- 3. **Wrap your app** in `I18nextProvider`.
88
- 4. **Use the `useTranslation()` hook** or `<Trans>` component to display translations.
71
+ ---
89
72
 
90
- ### Pros
73
+ ## Deep-dive comparison
91
74
 
92
- - Highly **flexible** and feature-rich.
93
- - Very active community and large ecosystem of plugins.
94
- - Ease of **dynamic loading** of translations (e.g., from a server, on demand).
75
+ ### 1) Architecture & scalability
95
76
 
96
- ### Cons
77
+ - **react-intl / react-i18next**: Most setups maintain **centralised locale folders** per language, sometimes split by **namespaces** (i18next). Works well early on but becomes a shared surface area as apps grow.
78
+ - **Intlayer**: Promotes **per-component (or per-feature) dictionaries** **co-located** with the UI they serve. This keeps ownership clear, eases duplication/migration of components, and reduces cross-team key churn. Unused content is easier to identify and remove.
97
79
 
98
- - **Configuration can be verbose**, especially if you have more advanced needs.
99
- - If you prefer strongly typed translations, you may need additional TypeScript setups.
80
+ **Why it matters:** Modular content mirrors modular UI. Large React codebases remain cleaner when translations reside with the components they belong to.
100
81
 
101
82
  ---
102
83
 
103
- ## 4. Intlayer
84
+ ### 2) TypeScript & safety
104
85
 
105
- ### Overview
86
+ - **react-intl**: Solid typings, but **no automatic key typing**; you enforce safety patterns yourself.
87
+ - **react-i18next**: Strong typings for hooks; **strict key typing** typically requires extra configuration or generators.
88
+ - **Intlayer**: **Auto-generates strict types** from your content. IDE autocomplete and **compile-time errors** catch typos and missing keys before runtime.
106
89
 
107
- [**Intlayer**](https://github.com/aymericzip/intlayer) is a newer, open-source i18n library focused on **component-level content declarations**, type safety, and **dynamic routing**. It is designed for modern React workflows, supporting both **Create React App** and **Vite** setups. It also includes advanced features like **locale-based routing** and **auto-generated TypeScript types** for translations.
90
+ **Why it matters:** Shifting failures **left** (to build/CI) reduces production issues and speeds developer feedback loops.
108
91
 
109
- ### Key Features
92
+ ---
110
93
 
111
- - **Declarative Content Files**: Each component or module can declare its translations in dedicated `.content.tsx` or `.content.json` files, keeping content close to where it’s used.
112
- - **Built-in Routing & Middleware**: Optional modules for localized routing (e.g., `/en-GB/about`, `/fr/about`) and server middleware for detecting user locale.
113
- - **Auto-generated TypeScript Types**: Ensures type safety with features like autocompletion and compile-time error detection.
114
- - **Dynamic & Rich Translations**: Can include JSX/TSX in translations for more complex use cases (e.g., links, bold text, icons in translations).
94
+ ### 3) Missing translation handling
115
95
 
116
- ### Typical Workflow
96
+ - **react-intl / react-i18next**: Default to **runtime fallbacks** (key echo or default locale). You can add linting/plugins, but it’s not guaranteed at build.
97
+ - **Intlayer**: **Build-time detection** with warnings or errors when required locales/keys are missing.
117
98
 
118
- 1. **Install `intlayer` and `react-intlayer`.**
119
- 2. **Create `intlayer.config.ts`** to define available locales and default locale.
120
- 3. **Use the Intlayer CLI** or plugin to **transpile** content declarations.
121
- 4. **Wrap your app** in `<IntlayerProvider>` and retrieve content with `useIntlayer("keyName")`.
99
+ **Why it matters:** CI failing on missing strings prevents “mystery English” leaking into non-English UIs.
122
100
 
123
- ### Pros
101
+ ---
124
102
 
125
- - **TypeScript-friendly** with built-in type generation and error-checking.
126
- - **Rich content** possible (e.g., passing React nodes as translations).
127
- - **Localized Routing** out-of-the-box.
128
- - Integrated with popular build tools (CRA, Vite) for easy setup.
103
+ ### 4) Rich content & formatting
129
104
 
130
- ### Cons
105
+ - **react-intl**: Excellent **ICU** support for plurals, selects, dates/numbers, and message composition. JSX can be used, but the mental model remains message-centric.
106
+ - **react-i18next**: Flexible interpolation and **`<Trans>`** for embedding elements/components; ICU available via a plugin.
107
+ - **Intlayer**: Content files can include **rich nodes** (JSX/Markdown/components) and **metadata**. Formatting uses Intl under the hood; plural patterns are ergonomic.
131
108
 
132
- - Still **relatively new** compared to React-Intl or React-i18next.
133
- - Heavier focus on a “component-level content declaration” approach, may be a shift from typical .json catalogs.
134
- - Smaller ecosystem and community compared to the more established libraries.
109
+ **Why it matters:** Complex UI texts (links, bold sections, inline components) are easier when the library embraces React nodes cleanly.
135
110
 
136
111
  ---
137
112
 
138
- ## 5. Feature Comparison
113
+ ### 5) Performance & loading behaviour
139
114
 
140
- | **Feature** | **React-Intl** | **React-i18next** | **Intlayer** |
141
- | ------------------------------ | --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
142
- | **Primary Use Case** | String-based translations, date/number formatting, ICU message syntax | Full-featured i18n with easy dynamic switching, nesting, plugin ecosystem | Type-safe translations with focus on declarative content, localized routing, & optional server middleware |
143
- | **Approach** | Utilize `<IntlProvider>` & FormatJS message components | Utilize `I18nextProvider` & `useTranslation()` hook | Utilize `<IntlayerProvider>` & `useIntlayer()` hook with content declarations |
144
- | **Localization Format** | ICU-based strings (JSON or JavaScript catalogs) | JSON resource files (or custom loaders). ICU format optional via i18next plugin | `.content.[ts/js/tsx]` or JSON declarations; can contain strings or React components |
145
- | **Routing** | Handled externally (no built-in localized routing) | Handled externally with i18next plugins (path, subdomain detection, etc.) | Built-in localized routing support (e.g., `/en-GB/about`, `/fr/about`), plus optional server middleware (for SSR/Vite) |
146
- | **TypeScript Support** | Good (typings for official packages) | Good but extra config for typed translations if you want strict checking | Excellent (auto-generated type definitions for content keys and translations) |
147
- | **Pluralization & Formatting** | Advanced: Built-in date/time/number formatting, plural/gender support | Configurable pluralization. Date/time formatting typically done via external libs or i18next plugin | Can rely on standard JavaScript Intl or embed logic in content. Not as specialized as FormatJS, but handles typical cases. |
148
- | **Community & Ecosystem** | Large, part of FormatJS ecosystem | Very large, highly active, lots of plugins (detection, caching, frameworks) | Smaller but growing; open-source, modern approach |
149
- | **Learning Curve** | Moderate (learning ICU message syntax, FormatJS conventions) | Low to moderate (straightforward usage, but advanced config can get verbose) | Moderate (concept of content declarations and specialized build steps) |
115
+ - **react-intl / react-i18next**: You typically manage **catalogue splitting** and **lazy loading** manually (namespaces/dynamic imports). Effective but requires discipline.
116
+ - **Intlayer**: **Tree-shakes** unused dictionaries and supports **per-dictionary/per-locale lazy loading** out-of-the-box.
150
117
 
151
- ---
152
-
153
- ## 6. When to Choose Each
154
-
155
- 1. **React-Intl**
118
+ **Why it matters:** Smaller bundles and fewer unused strings improve startup and navigation performance.
156
119
 
157
- - You need **powerful formatting** for dates/times/numbers and strong **ICU message syntax**.
158
- - You prefer a more “**standards-based**” approach to translations.
159
- - You don’t require localized routing or strongly typed translation keys.
120
+ ---
160
121
 
161
- 2. **React-i18next**
122
+ ### 6) DX, tooling & maintenance
162
123
 
163
- - You need a **flexible, established** solution with **dynamic** and **on-demand** translation loading.
164
- - You want **plugin-based** language detection (e.g., from URL, cookies, local storage) or advanced caching.
165
- - You need the largest ecosystem, with many existing integrations for various frameworks (Next.js, React Native, etc.).
124
+ - **react-intl / react-i18next**: Broad community ecosystem; for editorial workflows you usually adopt external localisation platforms.
125
+ - **Intlayer**: Ships a **free Visual Editor** and **optional CMS** (keep content in Git or externalise it). Also offers a **VSCode extension** for content authoring and **AI-assisted translation** using your own provider keys.
166
126
 
167
- 3. **Intlayer**
168
- - You want **strong TypeScript** integration with _autogenerated types_, ensuring you rarely miss a translation key.
169
- - You prefer **declarative content** close to the component, possibly including React nodes or advanced logic in translations.
170
- - You require **built-in localized routing** or want to easily incorporate it into your SSR or Vite setup.
171
- - You desire a modern approach or simply want a single library that covers both **content management** (i18n) and **routing** in a type-safe way.
127
+ **Why it matters:** Built-in tooling shortens the loop between developers and content authors - less glue code, fewer vendor dependencies.
172
128
 
173
129
  ---
174
130
 
175
- ## 7. Conclusion
176
-
177
- Each library offers a robust solution for internationalizing a React application:
178
-
179
- - **React-Intl** excels at message formatting and is a popular choice for enterprise solutions focusing on ICU message syntax.
180
- - **React-i18next** provides a highly flexible, plugin-driven environment for advanced or dynamic i18n needs.
181
- - **Intlayer** offers a **modern, strongly typed** approach that merges content declarations, advanced localized routing, and plugin-based (CRA, Vite) integrations.
131
+ ## When to choose which?
182
132
 
183
- Your choice largely depends on project requirements, desired developer experience (DX), and how important typed translations or advanced routing are. If you value built-in localized routing and TypeScript integration, **Intlayer** may be most appealing. If you want a battle-tested, ecosystem-rich solution, **React-i18next** is a great choice. For straightforward ICU-based formatting needs, **React-Intl** is a reliable option.
133
+ - **Choose react-intl** if you want **ICU-first** message formatting with a straightforward, standards-aligned API and your team is comfortable maintaining catalogues and safety checks manually.
134
+ - **Choose react-i18next** if you need the **breadth of i18next’s ecosystem** (detectors, backends, ICU plugin, integrations) and accept more configuration to gain flexibility.
135
+ - **Choose Intlayer** if you value **component-scoped content**, **strict TypeScript**, **build-time guarantees**, **tree-shaking**, and **batteries-included** editorial tooling - especially for **large, modular** React apps, design-systems, etc.
184
136
 
185
137
  ---
186
138
 
187
- ### Further Reading
139
+ ## Conclusion
188
140
 
189
- - [React-Intl Documentation](https://formatjs.io/docs/react-intl/)
190
- - [React-i18next Documentation](https://react.i18next.com/)
191
- - [Intlayer + CRA Getting Started Guide](/#) (from your doc)
192
- - [Intlayer + Vite & React Getting Started Guide](/#) (from your doc)
141
+ All three libraries localise React effectively. The differentiator is how much **infrastructure** you must build to reach a **safe, scalable** setup:
193
142
 
194
- Feel free to mix and match approaches to suit your requirements, there is no “one-size-fits-all” solution, and each library continues to evolve to address new use cases in the React ecosystem.
143
+ - With **Intlayer**, **modular content**, **strict TS typing**, **build-time safety**, **tree-shaken bundles**, and **editorial tooling** are defaults - not chores.
144
+ - If your team prizes **maintainability and speed** in multi-locale, component-driven React apps, Intlayer offers the **most complete** developer and content workflow today.
@@ -0,0 +1,258 @@
1
+ ---
2
+ createdAt: 2024-08-11
3
+ updatedAt: 2025-08-23
4
+ title: vue-i18n vs Intlayer
5
+ description: Compare vue-i18n with Intlayer for internationalisation (i18n) in Vue/Nuxt apps
6
+ keywords:
7
+ - vue-i18n
8
+ - Intlayer
9
+ - Internationalisation
10
+ - i18n
11
+ - Blog
12
+ - Vue
13
+ - Nuxt
14
+ - JavaScript
15
+ slugs:
16
+ - blog
17
+ - vue-i18n-vs-intlayer
18
+ ---
19
+
20
+ # vue-i18n VS Intlayer | Vue Internationalisation (i18n)
21
+
22
+ This guide compares two popular i18n options for **Vue 3** (and **Nuxt**): **vue-i18n** and **Intlayer**.
23
+ We focus on modern Vue tooling (Vite, Composition API) and evaluate:
24
+
25
+ 1. **Architecture & content organisation**
26
+ 2. **TypeScript & safety**
27
+ 3. **Missing translation handling**
28
+ 4. **Routing & URL strategy**
29
+ 5. **Performance & loading behaviour**
30
+ 6. **Developer experience (DX), tooling & maintenance**
31
+ 7. **SEO & large-project scalability**
32
+
33
+ > **tl;dr**: Both can localise Vue apps. If you want **component-scoped content**, **strict TypeScript types**, **build-time missing-key checks**, **tree-shaken dictionaries**, and **batteries-included router/SEO helpers** plus **Visual Editor & AI translations**, **Intlayer** is the more complete, modern choice.
34
+
35
+ ---
36
+
37
+ ## High-level positioning
38
+
39
+ - **vue-i18n** - The de-facto i18n library for Vue. Flexible message formatting (ICU-style), SFC `<i18n>` blocks for local messages, and a large ecosystem. Safety and large-scale maintenance are mostly your responsibility.
40
+ - **Intlayer** - Component-centric content model for Vue/Vite/Nuxt with **strict TS typing**, **build-time checks**, **tree-shaking**, **router & SEO helpers**, optional **Visual Editor/CMS**, and **AI-assisted translations**.
41
+
42
+ ---
43
+
44
+ ## Side-by-Side Feature Comparison (Vue-focused)
45
+
46
+ | Feature | **Intlayer** | **vue-i18n** |
47
+ | ------------------------------------------- | -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
48
+ | **Translations near components** | ✅ Yes, content collocated per component (e.g., `MyComp.content.ts`) | ✅ Yes, via SFC `<i18n>` blocks (optional) |
49
+ | **TypeScript integration** | ✅ Advanced, auto-generated **strict** types & key autocompletion | ✅ Good typings; **strict key safety requires additional setup/disciplines** |
50
+ | **Missing translation detection** | ✅ **Build-time** warnings/errors and TS surfacing | ⚠️ Runtime fallbacks/warnings |
51
+ | **Rich content (components/Markdown)** | ✅ Direct support for rich nodes and Markdown content files | ⚠️ Limited (components via `<i18n-t>`, Markdown via external plugins) |
52
+ | **AI-powered translation** | ✅ Built-in workflows using your own AI provider keys | ❌ Not built-in |
53
+ | **Visual Editor / CMS** | ✅ Free Visual Editor & optional CMS | ❌ Not built-in (use external platforms) |
54
+ | **Localised routing** | ✅ Helpers for Vue Router/Nuxt to generate localised paths, URLs, and `hreflang` | ⚠️ Not core (use Nuxt i18n or custom Vue Router setup) |
55
+ | **Dynamic route generation** | ✅ Yes | ❌ Not provided (Nuxt i18n provides) |
56
+ | **Pluralisation & formatting** | ✅ Enumeration patterns; Intl-based formatters | ✅ ICU-style messages; Intl formatters |
57
+ | **Content formats** | ✅ `.ts`, `.js`, `.json`, `.md`, `.txt` (YAML WIP) | ✅ `.json`, `.js` (plus SFC `<i18n>` blocks) |
58
+ | **ICU support** | ⚠️ WIP | ✅ Yes |
59
+ | **SEO helpers (sitemap, robots, metadata)** | ✅ Built-in helpers (framework-agnostic) | ❌ Not core (Nuxt i18n/community) |
60
+ | **SSR/SSG** | ✅ Works with Vue SSR and Nuxt; does not block static rendering | ✅ Works with Vue SSR/Nuxt |
61
+ | **Tree-shaking (ship only used content)** | ✅ Per-component at build time | ⚠️ Partial; requires manual code-splitting/async messages |
62
+ | **Lazy loading** | ✅ Per-locale / per-dictionary | ✅ Async locale messages supported |
63
+ | **Purge unused content** | ✅ Yes (build-time) | ❌ Not built-in |
64
+ | **Large-project maintainability** | ✅ Encourages modular, design-system-friendly structure | ✅ Possible, but requires strong file/namespace discipline |
65
+ | **Ecosystem / community** | ⚠️ Smaller but growing fast | ✅ Large and mature in the Vue ecosystem |
66
+
67
+ ---
68
+
69
+ ## Deep-dive comparison
70
+
71
+ ### 1) Architecture & scalability
72
+
73
+ - **vue-i18n**: Common setups use **centralised catalogues** per locale (optionally split into files/namespaces). SFC `<i18n>` blocks allow local messages but teams often revert to shared catalogues as projects grow.
74
+ - **Intlayer**: Promotes **per-component dictionaries** stored next to the component they serve. This reduces cross-team conflicts, keeps content discoverable, and naturally limits drift/unused keys.
75
+
76
+ **Why it matters:** In large Vue apps or design systems, **modular content** scales better than monolithic catalogues.
77
+
78
+ ---
79
+
80
+ ### 2) TypeScript & safety
81
+
82
+ - **vue-i18n**: Good TS support; **strict key typing** typically needs custom schemas/generics and careful conventions.
83
+ - **Intlayer**: **Generates strict types** from your content, providing **IDE autocompletion** and **compile-time errors** for typos or missing keys.
84
+
85
+ **Why it matters:** Strong typing catches issues **before** runtime.
86
+
87
+ ---
88
+
89
+ ### 3) Missing translation handling
90
+
91
+ - **vue-i18n**: **Runtime** warnings/fallbacks (e.g., fallback locale or key).
92
+ - **Intlayer**: **Build-time** detection with warnings/errors across locales and keys.
93
+
94
+ **Why it matters:** Build-time enforcement keeps the production UI clean and consistent.
95
+
96
+ ---
97
+
98
+ ### 4) Routing & URL strategy (Vue Router/Nuxt)
99
+
100
+ - **Both** can work with localised routes.
101
+ - **Intlayer** provides helpers to **generate localised paths**, **manage locale prefixes**, and emit **`<link rel="alternate" hreflang>`** for SEO. With Nuxt, it complements the framework’s routing.
102
+
103
+ **Why it matters:** Fewer custom glue layers and **cleaner SEO** across locales.
104
+
105
+ ---
106
+
107
+ ### 5) Performance & loading behaviour
108
+
109
+ - **vue-i18n**: Supports async locale messages; avoiding over-bundling is your responsibility (split catalogues carefully).
110
+ - **Intlayer**: **Tree-shakes** at build and **lazy-loads per dictionary/locale**. Unused content isn’t shipped.
111
+
112
+ **Why it matters:** Smaller bundles and faster startup for multi-locale Vue apps.
113
+
114
+ ---
115
+
116
+ ### 6) Developer experience & tooling
117
+
118
+ - **vue-i18n**: Mature docs and community; you’ll typically rely on **external localisation platforms** for editorial workflows.
119
+ - **Intlayer**: Ships a **free Visual Editor**, optional **CMS** (Git-friendly or externalised), a **VSCode extension**, **CLI/CI** utilities, and **AI-assisted translations** using your own provider keys.
120
+
121
+ **Why it matters:** Lower ops cost and a shorter dev–content loop.
122
+
123
+ ---
124
+
125
+ ### 7) SEO, SSR & SSG
126
+
127
+ - **Both** work with Vue SSR and Nuxt.
128
+ - **Intlayer**: Adds **SEO helpers** (sitemaps/metadata/`hreflang`) that are framework-agnostic and play nicely with Vue/Nuxt builds.
129
+
130
+ **Why it matters:** International SEO without bespoke wiring.
131
+
132
+ ---
133
+
134
+ ## Why Intlayer? (Problem & approach)
135
+
136
+ Most i18n stacks (including **vue-i18n**) start from **centralised catalogues**:
137
+
138
+ ```bash
139
+ .
140
+ ├── locales
141
+ │ ├── en.json
142
+ │ ├── es.json
143
+ │ └── fr.json
144
+ └── src
145
+ └── components
146
+ └── MyComponent.vue
147
+ ```
148
+
149
+ Or with per-locale folders:
150
+
151
+ ```bash
152
+ .
153
+ ├── locales
154
+ │ ├── en
155
+ │ │ ├── footer.json
156
+ │ │ └── navbar.json
157
+ │ ├── fr
158
+ │ │ ├── footer.json
159
+ │ │ └── navbar.json
160
+ │ └── es
161
+ │ ├── footer.json
162
+ │ └── navbar.json
163
+ └── src
164
+ └── components
165
+ └── MyComponent.vue
166
+ ```
167
+
168
+ This often slows development as apps grow:
169
+
170
+ 1. **For a new component** you create/edit remote catalogues, wire namespaces, and translate (often via manual copy/paste from AI tools).
171
+ 2. **When changing components** you hunt down shared keys, translate, keep locales in sync, remove dead keys, and align JSON structures.
172
+
173
+ **Intlayer** scopes content **per-component** and keeps it **next to the code**, as we already do with CSS, stories, tests, and docs:
174
+
175
+ ```bash
176
+ .
177
+ └── components
178
+ └── MyComponent
179
+ ├── MyComponent.content.ts
180
+ └── MyComponent.vue
181
+ ```
182
+
183
+ **Content declaration** (per component):
184
+
185
+ ```ts fileName="./components/MyComponent/MyComponent.content.ts"
186
+ import { t, type Dictionary } from "intlayer";
187
+
188
+ const componentExampleContent = {
189
+ key: "component-example",
190
+ content: {
191
+ greeting: t({
192
+ en: "Hello World",
193
+ es: "Hola Mundo",
194
+ fr: "Bonjour le monde",
195
+ }),
196
+ },
197
+ } satisfies Dictionary;
198
+
199
+ export default componentExampleContent;
200
+ ```
201
+
202
+ **Usage in Vue** (Composition API):
203
+
204
+ ```vue fileName="./components/MyComponent/MyComponent.vue"
205
+ <script setup lang="ts">
206
+ import { useIntlayer } from "vue-intlayer"; // Vue integration
207
+ const { greeting } = useIntlayer("component-example");
208
+ </script>
209
+
210
+ <template>
211
+ <span>{{ greeting }}</span>
212
+ </template>
213
+ ```
214
+
215
+ This approach:
216
+
217
+ - **Speeds up development** (declare once; IDE/AI autocompletes).
218
+ - **Cleans the codebase** (1 component = 1 dictionary).
219
+ - **Facilitates duplication/migration** (copy a component and its content together).
220
+ - **Avoids dead keys** (unused components don’t import content).
221
+ - **Optimises loading** (lazy-loaded components bring their content with them).
222
+
223
+ ---
224
+
225
+ ## Additional features of Intlayer (Vue-relevant)
226
+
227
+ - **Cross-framework support**: Works with Vue, Nuxt, Vite, React, Express, and more.
228
+ - **JavaScript-powered content management**: Declare in code with full flexibility.
229
+ - **Per-locale declaration file**: Seed all locales and let tooling generate the rest.
230
+ - **Type-safe environment**: Strong TS config with autocompletion.
231
+ - **Simplified content retrieval**: A single hook/composable to fetch all content for a dictionary.
232
+ - **Organised codebase**: 1 component = 1 dictionary in the same folder.
233
+ - **Enhanced routing**: Helpers for **Vue Router/Nuxt** localised paths and metadata.
234
+ - **Markdown support**: Import remote/local Markdown per locale; expose frontmatter to code.
235
+ - **Free Visual Editor & optional CMS**: Authoring without a paid localisation platform; Git-friendly sync.
236
+ - **Tree-shakable content**: Ships only what’s used; supports lazy loading.
237
+ - **Static rendering friendly**: Does not block SSG.
238
+ - **AI-powered translations**: Translate to 231 languages using your own AI provider/API key.
239
+ - **MCP server & VSCode extension**: Automate i18n workflows and authoring inside your IDE.
240
+ - **Interoperability**: Bridges with **vue-i18n**, **react-i18next**, and **react-intl** when needed.
241
+
242
+ ---
243
+
244
+ ## When to choose which?
245
+
246
+ - **Choose vue-i18n** if you want the **standard Vue approach**, you’re comfortable managing catalogues/namespaces yourself, and your app is **small to mid-size** (or you already rely on Nuxt i18n).
247
+ - **Choose Intlayer** if you value **component-scoped content**, **strict TypeScript**, **build-time guarantees**, **tree-shaking**, and **batteries-included** routing/SEO/editor tooling-especially for **large, modular Vue/Nuxt codebases**, design-systems, etc.
248
+
249
+ ---
250
+
251
+ ## Conclusion
252
+
253
+ Both **vue-i18n** and **Intlayer** localise Vue apps well. The difference is **how much you must build yourself** to achieve a robust, scalable setup:
254
+
255
+ - With **Intlayer**, **modular content**, **strict TS**, **build-time safety**, **tree-shaken bundles**, and **router/SEO/editor tooling** come **out of the box**.
256
+ - If your team prioritises **maintainability and speed** in a multi-locale, component-driven Vue/Nuxt app, Intlayer offers the **most complete** experience today.
257
+
258
+ Refer to ['Why Intlayer?' doc](https://intlayer.org/doc/why) for more details.
@@ -1,6 +1,6 @@
1
1
  ---
2
- createdAt: 2024-08-11
3
- updatedAt: 2025-06-29
2
+ createdAt: 2025-08-23
3
+ updatedAt: 2025-08-23
4
4
  title: Intlayer y next-i18next
5
5
  description: Integra Intlayer con next-i18next para una aplicación Next.js
6
6
  keywords:
@@ -24,7 +24,6 @@ Tanto next-i18next como Intlayer son frameworks de internacionalización (i18n)
24
24
  Ambas soluciones incluyen tres nociones principales:
25
25
 
26
26
  1. **Declaración de Contenido**: El método para definir el contenido traducible de tu aplicación.
27
-
28
27
  - Nombrado `resource` en el caso de `i18next`, la declaración de contenido es un objeto JSON estructurado que contiene pares clave-valor para traducciones en uno o varios idiomas. Consulta la [documentación de i18next](https://www.i18next.com/translation-function/essentials) para más información.
29
28
  - Nombrado `archivo de declaración de contenido` en el caso de `Intlayer`, la declaración de contenido puede ser un archivo JSON, JS o TS que exporta los datos estructurados. Consulta la [documentación de Intlayer](https://intlayer.org/fr/doc/concept/content) para más información.
30
29
 
@@ -213,8 +212,8 @@ const content = {
213
212
  content: {
214
213
  myTranslatedContent: t({
215
214
  en: "Hello World",
216
- fr: "Bonjour le monde",
217
215
  es: "Hola Mundo",
216
+ fr: "Bonjour le monde",
218
217
  }),
219
218
  },
220
219
  } satisfies Dictionary;
@@ -231,8 +230,8 @@ const content = {
231
230
  content: {
232
231
  myTranslatedContent: t({
233
232
  en: "Hello World",
234
- fr: "Bonjour le monde",
235
233
  es: "Hola Mundo",
234
+ fr: "Bonjour le monde",
236
235
  }),
237
236
  },
238
237
  };
@@ -246,8 +245,8 @@ module.exports = {
246
245
  content: {
247
246
  myTranslatedContent: t({
248
247
  en: "Hello World",
249
- fr: "Bonjour le monde",
250
248
  es: "Hola Mundo",
249
+ fr: "Bonjour le monde",
251
250
  }),
252
251
  },
253
252
  };
@@ -23,7 +23,6 @@ Tanto next-intl como Intlayer son frameworks de internacionalización (i18n) de
23
23
  Comparten tres nociones principales:
24
24
 
25
25
  1. **Declaración de Contenido**: El método para definir el contenido traducible de tu aplicación.
26
-
27
26
  - Nombrada `content declaration file` en Intlayer, que puede ser un archivo JSON, JS o TS que exporta datos estructurados. Consulta la [documentación de Intlayer](https://intlayer.org/fr/doc/concept/content) para más información.
28
27
  - Nombrada `messages` o `locale messages` en next-intl, usualmente en archivos JSON. Consulta la [documentación de next-intl](https://github.com/amannn/next-intl) para más información.
29
28
 
@@ -170,8 +169,8 @@ const content = {
170
169
  content: {
171
170
  helloWorld: t({
172
171
  en: "Hello World",
173
- fr: "Bonjour le monde",
174
172
  es: "Hola Mundo",
173
+ fr: "Bonjour le monde",
175
174
  }),
176
175
  },
177
176
  } satisfies Dictionary;
@@ -188,8 +187,8 @@ const content = {
188
187
  content: {
189
188
  helloWorld: t({
190
189
  en: "Hello World",
191
- fr: "Bonjour le monde",
192
190
  es: "Hola Mundo",
191
+ fr: "Bonjour le monde",
193
192
  }),
194
193
  },
195
194
  };
@@ -205,8 +204,8 @@ module.exports = {
205
204
  content: {
206
205
  helloWorld: t({
207
206
  en: "Hello World",
208
- fr: "Bonjour le monde",
209
207
  es: "Hola Mundo",
208
+ fr: "Bonjour le monde",
210
209
  }),
211
210
  },
212
211
  };
@@ -247,8 +247,8 @@ const content = {
247
247
  // Cada llamada "t" es un nodo de traducción separado
248
248
  heading: t({
249
249
  en: "Hello World",
250
- fr: "Bonjour le monde",
251
250
  es: "Hola Mundo",
251
+ fr: "Bonjour le monde",
252
252
  }),
253
253
  description: t({
254
254
  en: "My i18n description text...",