@intlayer/docs 5.8.0-canary.0 → 5.8.1-canary.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 (223) hide show
  1. package/blog/ar/intlayer_with_next-i18next.md +2 -2
  2. package/blog/ar/next-i18next_vs_next-intl_vs_intlayer.md +96 -219
  3. package/blog/ar/react-i18next_vs_react-intl_vs_intlayer.md +88 -129
  4. package/blog/ar/vue-i18n_vs_intlayer.md +268 -0
  5. package/blog/de/intlayer_with_next-i18next.md +2 -2
  6. package/blog/de/next-i18next_vs_next-intl_vs_intlayer.md +93 -216
  7. package/blog/de/react-i18next_vs_react-intl_vs_intlayer.md +87 -128
  8. package/blog/de/vue-i18n_vs_intlayer.md +268 -0
  9. package/blog/en/intlayer_with_next-i18next.md +2 -2
  10. package/blog/en/next-i18next_vs_next-intl_vs_intlayer.md +93 -216
  11. package/blog/en/react-i18next_vs_react-intl_vs_intlayer.md +88 -120
  12. package/blog/en/vue-i18n_vs_intlayer.md +276 -0
  13. package/blog/en-GB/intlayer_with_next-i18next.md +2 -2
  14. package/blog/en-GB/next-i18next_vs_next-intl_vs_intlayer.md +85 -218
  15. package/blog/en-GB/react-i18next_vs_react-intl_vs_intlayer.md +80 -130
  16. package/blog/en-GB/vue-i18n_vs_intlayer.md +258 -0
  17. package/blog/es/intlayer_with_next-i18next.md +2 -2
  18. package/blog/es/next-i18next_vs_next-intl_vs_intlayer.md +93 -216
  19. package/blog/es/react-i18next_vs_react-intl_vs_intlayer.md +87 -128
  20. package/blog/es/vue-i18n_vs_intlayer.md +268 -0
  21. package/blog/fr/intlayer_with_next-i18next.md +2 -2
  22. package/blog/fr/next-i18next_vs_next-intl_vs_intlayer.md +91 -214
  23. package/blog/fr/react-i18next_vs_react-intl_vs_intlayer.md +86 -127
  24. package/blog/fr/vue-i18n_vs_intlayer.md +269 -0
  25. package/blog/hi/intlayer_with_next-i18next.md +2 -2
  26. package/blog/hi/next-i18next_vs_next-intl_vs_intlayer.md +97 -220
  27. package/blog/hi/react-i18next_vs_react-intl_vs_intlayer.md +89 -130
  28. package/blog/hi/vue-i18n_vs_intlayer.md +268 -0
  29. package/blog/it/intlayer_with_next-i18next.md +2 -2
  30. package/blog/it/next-i18next_vs_next-intl_vs_intlayer.md +91 -214
  31. package/blog/it/react-i18next_vs_react-intl_vs_intlayer.md +86 -127
  32. package/blog/it/vue-i18n_vs_intlayer.md +268 -0
  33. package/blog/ja/intlayer_with_next-i18next.md +2 -2
  34. package/blog/ja/next-i18next_vs_next-intl_vs_intlayer.md +93 -216
  35. package/blog/ja/react-i18next_vs_react-intl_vs_intlayer.md +87 -128
  36. package/blog/ja/vue-i18n_vs_intlayer.md +268 -0
  37. package/blog/ko/intlayer_with_next-i18next.md +2 -2
  38. package/blog/ko/next-i18next_vs_next-intl_vs_intlayer.md +95 -217
  39. package/blog/ko/react-i18next_vs_react-intl_vs_intlayer.md +89 -130
  40. package/blog/ko/vue-i18n_vs_intlayer.md +268 -0
  41. package/blog/pt/intlayer_with_next-i18next.md +2 -2
  42. package/blog/pt/next-i18next_vs_next-intl_vs_intlayer.md +93 -216
  43. package/blog/pt/react-i18next_vs_react-intl_vs_intlayer.md +87 -128
  44. package/blog/pt/vue-i18n_vs_intlayer.md +268 -0
  45. package/blog/ru/intlayer_with_next-i18next.md +2 -2
  46. package/blog/ru/next-i18next_vs_next-intl_vs_intlayer.md +94 -217
  47. package/blog/ru/react-i18next_vs_react-intl_vs_intlayer.md +87 -128
  48. package/blog/ru/vue-i18n_vs_intlayer.md +268 -0
  49. package/blog/zh/intlayer_with_next-i18next.md +2 -2
  50. package/blog/zh/next-i18next_vs_next-intl_vs_intlayer.md +93 -216
  51. package/blog/zh/react-i18next_vs_react-intl_vs_intlayer.md +87 -128
  52. package/blog/zh/vue-i18n_vs_intlayer.md +269 -0
  53. package/dist/cjs/generated/blog.entry.cjs +41 -0
  54. package/dist/cjs/generated/blog.entry.cjs.map +1 -1
  55. package/dist/esm/generated/blog.entry.mjs +41 -0
  56. package/dist/esm/generated/blog.entry.mjs.map +1 -1
  57. package/dist/types/generated/blog.entry.d.ts +1 -0
  58. package/dist/types/generated/blog.entry.d.ts.map +1 -1
  59. package/docs/ar/formatters.md +417 -31
  60. package/docs/ar/how_works_intlayer.md +2 -4
  61. package/docs/ar/interest_of_intlayer.md +7 -10
  62. package/docs/ar/intlayer_CMS.md +2 -3
  63. package/docs/ar/intlayer_visual_editor.md +2 -3
  64. package/docs/ar/intlayer_with_tanstack.md +1 -1
  65. package/docs/ar/introduction.md +4 -4
  66. package/docs/de/formatters.md +444 -34
  67. package/docs/de/introduction.md +2 -2
  68. package/docs/en/dictionary/enumeration.md +2 -2
  69. package/docs/en/dictionary/function_fetching.md +2 -2
  70. package/docs/en/dictionary/get_started.md +2 -2
  71. package/docs/en/dictionary/translation.md +2 -2
  72. package/docs/en/formatters.md +383 -15
  73. package/docs/en/how_works_intlayer.md +2 -4
  74. package/docs/en/interest_of_intlayer.md +48 -29
  75. package/docs/en/intlayer_CMS.md +2 -3
  76. package/docs/en/intlayer_visual_editor.md +2 -3
  77. package/docs/en/intlayer_with_create_react_app.md +2 -2
  78. package/docs/en/intlayer_with_express.md +2 -2
  79. package/docs/en/intlayer_with_tanstack.md +1 -1
  80. package/docs/en/introduction.md +4 -4
  81. package/docs/en/packages/express-intlayer/index.md +2 -2
  82. package/docs/en/packages/intlayer/getConfiguration.md +2 -3
  83. package/docs/en/packages/intlayer/getEnumeration.md +2 -7
  84. package/docs/en/packages/intlayer/getHTMLTextDir.md +2 -4
  85. package/docs/en/packages/intlayer/getLocaleLang.md +2 -4
  86. package/docs/en/packages/intlayer/getLocaleName.md +2 -3
  87. package/docs/en/packages/intlayer/getLocalizedUrl.md +2 -8
  88. package/docs/en/packages/intlayer/getMultilingualUrls.md +2 -7
  89. package/docs/en/packages/intlayer/getPathWithoutLocale.md +2 -3
  90. package/docs/en/packages/intlayer/getTranslation.md +2 -4
  91. package/docs/en/packages/intlayer/index.md +2 -2
  92. package/docs/en/packages/next-intlayer/index.md +2 -2
  93. package/docs/en/packages/next-intlayer/t.md +2 -2
  94. package/docs/en/packages/next-intlayer/useDictionary.md +2 -2
  95. package/docs/en/packages/next-intlayer/useIntlayer.md +2 -2
  96. package/docs/en/packages/next-intlayer/useLocale.md +2 -2
  97. package/docs/en/packages/react-intlayer/index.md +2 -2
  98. package/docs/en/packages/react-intlayer/t.md +2 -2
  99. package/docs/en/packages/react-intlayer/useI18n.md +2 -2
  100. package/docs/en/packages/react-intlayer/useIntlayer.md +2 -2
  101. package/docs/en/packages/react-intlayer/useLocale.md +2 -2
  102. package/docs/en/packages/react-scripts-intlayer/index.md +2 -2
  103. package/docs/en/packages/solid-intlayer/index.md +2 -2
  104. package/docs/en/packages/vite-intlayer/index.md +2 -2
  105. package/docs/en-GB/formatters.md +402 -16
  106. package/docs/en-GB/how_works_intlayer.md +2 -4
  107. package/docs/en-GB/interest_of_intlayer.md +7 -10
  108. package/docs/en-GB/intlayer_with_tanstack.md +1 -1
  109. package/docs/en-GB/introduction.md +2 -2
  110. package/docs/es/formatters.md +438 -28
  111. package/docs/es/how_works_intlayer.md +2 -4
  112. package/docs/es/interest_of_intlayer.md +7 -10
  113. package/docs/es/intlayer_with_tanstack.md +1 -1
  114. package/docs/es/introduction.md +2 -2
  115. package/docs/fr/formatters.md +438 -28
  116. package/docs/fr/how_works_intlayer.md +2 -4
  117. package/docs/fr/interest_of_intlayer.md +7 -10
  118. package/docs/fr/intlayer_with_tanstack.md +1 -1
  119. package/docs/fr/introduction.md +2 -2
  120. package/docs/hi/formatters.md +430 -39
  121. package/docs/hi/how_works_intlayer.md +2 -4
  122. package/docs/hi/interest_of_intlayer.md +7 -10
  123. package/docs/hi/intlayer_with_tanstack.md +1 -1
  124. package/docs/hi/introduction.md +2 -2
  125. package/docs/it/formatters.md +438 -30
  126. package/docs/it/how_works_intlayer.md +2 -4
  127. package/docs/it/interest_of_intlayer.md +7 -10
  128. package/docs/it/intlayer_with_tanstack.md +1 -1
  129. package/docs/it/introduction.md +2 -2
  130. package/docs/ja/formatters.md +435 -47
  131. package/docs/ja/how_works_intlayer.md +2 -4
  132. package/docs/ja/interest_of_intlayer.md +7 -10
  133. package/docs/ja/intlayer_with_tanstack.md +1 -1
  134. package/docs/ja/introduction.md +2 -2
  135. package/docs/ko/formatters.md +432 -41
  136. package/docs/ko/how_works_intlayer.md +2 -4
  137. package/docs/ko/interest_of_intlayer.md +7 -10
  138. package/docs/ko/intlayer_with_tanstack.md +1 -1
  139. package/docs/ko/introduction.md +2 -2
  140. package/docs/pt/formatters.md +416 -30
  141. package/docs/pt/how_works_intlayer.md +2 -4
  142. package/docs/pt/intlayer_with_tanstack.md +1 -1
  143. package/docs/pt/introduction.md +2 -2
  144. package/docs/ru/autoFill.md +2 -2
  145. package/docs/ru/configuration.md +1 -40
  146. package/docs/ru/formatters.md +438 -28
  147. package/docs/ru/how_works_intlayer.md +5 -7
  148. package/docs/ru/index.md +1 -1
  149. package/docs/ru/interest_of_intlayer.md +8 -11
  150. package/docs/ru/intlayer_CMS.md +7 -8
  151. package/docs/ru/intlayer_cli.md +4 -7
  152. package/docs/ru/intlayer_visual_editor.md +5 -6
  153. package/docs/ru/intlayer_with_angular.md +1 -1
  154. package/docs/ru/intlayer_with_create_react_app.md +5 -5
  155. package/docs/ru/intlayer_with_lynx+react.md +1 -1
  156. package/docs/ru/intlayer_with_nextjs_15.md +3 -3
  157. package/docs/ru/intlayer_with_nextjs_page_router.md +2 -2
  158. package/docs/ru/intlayer_with_nuxt.md +1 -1
  159. package/docs/ru/intlayer_with_react_native+expo.md +2 -2
  160. package/docs/ru/intlayer_with_tanstack.md +3 -3
  161. package/docs/ru/intlayer_with_vite+preact.md +3 -3
  162. package/docs/ru/intlayer_with_vite+react.md +3 -3
  163. package/docs/ru/intlayer_with_vite+solid.md +1 -1
  164. package/docs/ru/intlayer_with_vite+svelte.md +1 -1
  165. package/docs/ru/intlayer_with_vite+vue.md +2 -2
  166. package/docs/ru/introduction.md +5 -5
  167. package/docs/ru/locale_mapper.md +1 -1
  168. package/docs/ru/packages/@intlayer/api/index.md +2 -2
  169. package/docs/ru/packages/@intlayer/chokidar/index.md +1 -1
  170. package/docs/ru/packages/@intlayer/cli/index.md +2 -2
  171. package/docs/ru/packages/@intlayer/config/index.md +2 -2
  172. package/docs/ru/packages/@intlayer/core/index.md +2 -2
  173. package/docs/ru/packages/@intlayer/design-system/index.md +2 -2
  174. package/docs/ru/packages/@intlayer/dictionary-entry/index.md +2 -2
  175. package/docs/ru/packages/@intlayer/editor/index.md +1 -1
  176. package/docs/ru/packages/@intlayer/editor-react/index.md +1 -1
  177. package/docs/ru/packages/@intlayer/webpack/index.md +1 -1
  178. package/docs/ru/packages/angular-intlayer/index.md +1 -1
  179. package/docs/ru/packages/express-intlayer/index.md +3 -3
  180. package/docs/ru/packages/express-intlayer/t.md +1 -1
  181. package/docs/ru/packages/intlayer/getEnumeration.md +3 -8
  182. package/docs/ru/packages/intlayer/getTranslation.md +3 -5
  183. package/docs/ru/packages/intlayer/getTranslationContent.md +1 -3
  184. package/docs/ru/packages/intlayer/index.md +3 -3
  185. package/docs/ru/packages/intlayer-cli/index.md +1 -1
  186. package/docs/ru/packages/intlayer-editor/index.md +2 -2
  187. package/docs/ru/packages/lynx-intlayer/index.md +1 -1
  188. package/docs/ru/packages/next-intlayer/index.md +4 -4
  189. package/docs/ru/packages/next-intlayer/t.md +4 -4
  190. package/docs/ru/packages/next-intlayer/useLocale.md +3 -3
  191. package/docs/ru/packages/nuxt-intlayer/index.md +1 -1
  192. package/docs/ru/packages/preact-intlayer/index.md +1 -1
  193. package/docs/ru/packages/react-intlayer/index.md +4 -4
  194. package/docs/ru/packages/react-intlayer/t.md +4 -4
  195. package/docs/ru/packages/react-native-intlayer/index.md +1 -1
  196. package/docs/ru/packages/react-scripts-intlayer/index.md +3 -3
  197. package/docs/ru/packages/solid-intlayer/index.md +3 -3
  198. package/docs/ru/packages/svelte-intlayer/index.md +1 -1
  199. package/docs/ru/packages/vite-intlayer/index.md +3 -3
  200. package/docs/ru/packages/vue-intlayer/index.md +1 -1
  201. package/docs/ru/per_locale_file.md +1 -1
  202. package/docs/ru/roadmap.md +3 -5
  203. package/docs/ru/vs_code_extension.md +1 -1
  204. package/docs/zh/formatters.md +446 -38
  205. package/docs/zh/how_works_intlayer.md +2 -4
  206. package/docs/zh/interest_of_intlayer.md +7 -10
  207. package/docs/zh/intlayer_with_tanstack.md +1 -1
  208. package/docs/zh/introduction.md +2 -2
  209. package/frequent_questions/ar/domain_routing.md +1 -1
  210. package/frequent_questions/en/domain_routing.md +1 -1
  211. package/frequent_questions/en-GB/domain_routing.md +1 -1
  212. package/frequent_questions/es/domain_routing.md +1 -1
  213. package/frequent_questions/fr/domain_routing.md +1 -1
  214. package/frequent_questions/hi/domain_routing.md +1 -1
  215. package/frequent_questions/it/domain_routing.md +1 -1
  216. package/frequent_questions/ko/domain_routing.md +1 -1
  217. package/frequent_questions/pt/domain_routing.md +1 -1
  218. package/frequent_questions/ru/domain_routing.md +1 -1
  219. package/frequent_questions/ru/get_locale_cookie.md +4 -4
  220. package/frequent_questions/ru/static_rendering.md +1 -2
  221. package/frequent_questions/zh/domain_routing.md +1 -1
  222. package/package.json +9 -11
  223. package/src/generated/blog.entry.ts +42 -1
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  createdAt: 2025-01-02
3
3
  updatedAt: 2025-06-29
4
- title: react-i18n vs react-intl vs Intlayer
4
+ title: react-i18next vs react-intl vs Intlayer
5
5
  description: Integrate react-i18next with next-intl and Intlayer for the internationalization (i18n) of a React app
6
6
  keywords:
7
7
  - next-intl
@@ -17,178 +17,146 @@ 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 Internationalization (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
27
-
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:
25
+ We evaluate:
29
26
 
30
- 1. **React-Intl**
31
- 2. **React-i18next**
32
- 3. **Intlayer**
27
+ - Architecture & content organization
28
+ - TypeScript & safety
29
+ - Missing translation handling
30
+ - Rich content & formatting capabilities
31
+ - Performance & loading behavior
32
+ - Developer experience (DX), tooling & maintenance
33
+ - SEO/routing (framework-dependent)
33
34
 
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 localize 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.
39
+ ## High-level positioning
43
40
 
44
- ### Key Features
41
+ - **react-intl** - ICU-first, standards-aligned formatting (dates/numbers/plurals) with a mature API. Catalogs are typically centralized; key safety and build-time validation are largely on you.
42
+ - **react-i18next** - Extremely popular and flexible; namespaces, detectors, and many plugins (ICU, backends). Powerful, but configuration can sprawl 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.
45
44
 
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.
45
+ ---
50
46
 
51
- ### Typical Workflow
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 hightlight 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 externalize codebase content; embeddable | ❌ No / available via external localization platforms | ❌ No / available via external localization platforms |
57
+ | **Localized Routing** | ✅ Yes, supports localized 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
+ | **Pluralization** | ✅ Enumeration-based patterns | ✅ Configurable (plugins like i18next-icu) | ✅ (ICU) |
60
+ | **Formatting (dates, numbers, currencies)** | ✅ Optimized 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 modular, suited for design-system | ⚠️ Needs good file discipline | ⚠️ Central catalogs can get large |
52
70
 
53
- 1. **Define message catalogs** (usually JSON files per locale).
54
- 2. **Wrap your app** in `<IntlProvider locale="en" messages={messages}>`.
55
- 3. **Use** `<FormattedMessage id="myMessage" defaultMessage="Hello world" />` or the `useIntl()` hook to access translation strings.
71
+ ---
56
72
 
57
- ### Pros
73
+ ## Deep-dive comparison
58
74
 
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.
75
+ ### 1) Architecture & scalability
62
76
 
63
- ### Cons
77
+ - **react-intl / react-i18next**: Most setups maintain **centralized 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.
64
79
 
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.
80
+ **Why it matters:** Modular content mirrors modular UI. Large React codebases stay cleaner when translations live with the components they belong to.
67
81
 
68
82
  ---
69
83
 
70
- ## 3. React-i18next
71
-
72
- ### Overview
73
-
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.
84
+ ### 2) TypeScript & safety
75
85
 
76
- ### Key Features
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.
77
89
 
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.
90
+ **Why it matters:** Shifting failures **left** (to build/CI) reduces production issues and speeds developer feedback loops.
82
91
 
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.
89
-
90
- ### Pros
92
+ ---
91
93
 
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).
94
+ ### 3) Missing translation handling
95
95
 
96
- ### Cons
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.
97
98
 
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.
99
+ **Why it matters:** CI failing on missing strings prevents “mystery English” leaking into non-English UIs.
100
100
 
101
101
  ---
102
102
 
103
- ## 4. Intlayer
103
+ ### 4) Rich content & formatting
104
104
 
105
- ### Overview
105
+ - **react-intl**: Excellent **ICU** support for plurals, selects, dates/numbers, and message composition. JSX can be used, but the mental model stays message-centric.
106
+ - **react-i18next**: Flexible interpolation and **`<Trans>`** for embedding elements/components; ICU available via plugin.
107
+ - **Intlayer**: Content files can include **rich nodes** (JSX/Markdown/components) and **metadata**. Formatting uses Intl under the hood; plural patterns are ergonomic.
106
108
 
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.
109
+ **Why it matters:** Complex UI texts (links, bold pieces, inline components) are easier when the library embraces React nodes cleanly.
108
110
 
109
- ### Key Features
111
+ ---
110
112
 
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/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).
113
+ ### 5) Performance & loading behavior
115
114
 
116
- ### Typical Workflow
115
+ - **react-intl / react-i18next**: You typically manage **catalog 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.
117
117
 
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")`.
118
+ **Why it matters:** Smaller bundles and fewer unused strings improve startup and navigation performance.
122
119
 
123
- ### Pros
120
+ ---
124
121
 
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.
122
+ ### 6) DX, tooling & maintenance
129
123
 
130
- ### Cons
124
+ - **react-intl / react-i18next**: Broad community ecosystem; for editorial workflows you usually adopt external localization platforms.
125
+ - **Intlayer**: Ships a **free Visual Editor** and **optional CMS** (keep content in Git or externalize it). Also offers a **VSCode extension** for content authoring and **AI-assisted translation** using your own provider keys.
131
126
 
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.
127
+ **Why it matters:** Built-in tooling shortens the loop between developers and content authors - less glue code, fewer vendor dependencies.
135
128
 
136
129
  ---
137
130
 
138
- ## 5. Feature Comparison
131
+ ## When to choose which?
139
132
 
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/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) |
133
+ - **Choose react-intl** if you want **ICU-first** message formatting with a straightforward, standards-aligned API and your team is comfortable maintaining catalogs 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.
150
136
 
151
137
  ---
152
138
 
153
- ## 6. When to Choose Each
139
+ ## Interoperability with `react-intl` and `react-i18next`
154
140
 
155
- 1. **React-Intl**
141
+ `intlayer` can also help to manage your `react-intl` and `react-i18next` namespaces.
156
142
 
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.
143
+ Using `intlayer`, you can declare your content in the format of your favorite i18n library, and intlayer will generate your namespaces in the location of your choice (example: `/messages/{{locale}}/{{namespace}}.json`).
160
144
 
161
- 2. **React-i18next**
162
-
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.).
166
-
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.
145
+ Refer to [`dictionaryOutput` and `i18nextResourcesDir` options](https://intlayer.org/doc/concept/configuration#content-configuration) for more details.
172
146
 
173
147
  ---
174
148
 
175
- ## 7. Conclusion
149
+ ## GitHub STARs
176
150
 
177
- Each library offers a robust solution for internationalizing a React application:
151
+ GitHub stars are a strong indicator of a project's popularity, community trust, and long-term relevance. While not a direct measure of technical quality, they reflect how many developers find the project useful, follow its progress, and are likely to adopt it. For estimating the value of a project, stars help compare traction across alternatives and provide insights into ecosystem growth.
178
152
 
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.
153
+ ## [![Star History Chart](https://api.star-history.com/svg?repos=formatjs/formatjs&repos=i18next/react-i18next&repos=aymericzip/intlayer&type=Date)](https://www.star-history.com/#formatjs/formatjs&i18next/react-i18next&aymericzip/intlayer)
182
154
 
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.
184
-
185
- ---
155
+ ## Conclusion
186
156
 
187
- ### Further Reading
157
+ All three libraries localize React effectively. The differentiator is how much **infrastructure** you must build to reach a **safe, scalable** setup:
188
158
 
189
- - [react-intl Documentation](https://formatjs.io/docs/react-intl/)
190
- - [react-i18next Documentation](https://react.i18next.com/)
191
- - [Intlayer + CRA Getting Started Guide](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_create_react_app.md)
192
- - [Intlayer + Vite & React Getting Started Guide](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_vite%2Breact.md)
159
+ - With **Intlayer**, **modular content**, **strict TS typing**, **build-time safety**, **tree-shaken bundles**, and **editorial tooling** are defaults - not chores.
160
+ - If your team prizes **maintainability and speed** in multi-locale, component-driven React apps, Intlayer offers the **most complete** developer and content workflow today.
193
161
 
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.
162
+ Refer to ['Why Intlayer?' doc](https://intlayer.org/doc/why) for more details.
@@ -0,0 +1,276 @@
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 internationalization (i18n) in Vue/Nuxt apps
6
+ keywords:
7
+ - vue-i18n
8
+ - Intlayer
9
+ - Internationalization
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 Internationalization (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 organization**
26
+ 2. **TypeScript & safety**
27
+ 3. **Missing translation handling**
28
+ 4. **Routing & URL strategy**
29
+ 5. **Performance & loading behavior**
30
+ 6. **Developer experience (DX), tooling & maintenance**
31
+ 7. **SEO & large-project scalability**
32
+
33
+ > **tl;dr**: Both can localize 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 big ecosystem. Safety and large-scale maintenance are mostly on you.
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
+ | **Localized routing** | ✅ Helpers for Vue Router/Nuxt to generate localized 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
+ | **Pluralization & 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 needs 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 **centralized catalogs** per locale (optionally split into files/namespaces). SFC `<i18n>` blocks allow local messages but teams often revert to shared catalogs 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 catalogs.
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, giving **IDE autocompletion** and **compile-time errors** for typos/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., fall back locale or key).
92
+ - **Intlayer**: **Build-time** detection with warnings/errors across locales and keys.
93
+
94
+ **Why it matters:** Build-time enforcement keeps production UI clean and consistent.
95
+
96
+ ---
97
+
98
+ ### 4) Routing & URL strategy (Vue Router/Nuxt)
99
+
100
+ - **Both** can work with localized routes.
101
+ - **Intlayer** provides helpers to **generate localized 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 behavior
108
+
109
+ - **vue-i18n**: Supports async locale messages; avoiding over-bundling is on you (split catalogs carefully).
110
+ - **Intlayer**: **Tree-shakes** at build and **lazy-loads per dictionary/locale**. Unused content doesn’t ship.
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 localization platforms** for editorial workflows.
119
+ - **Intlayer**: Ships a **free Visual Editor**, optional **CMS** (Git-friendly or externalized), 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 **centralized catalogs**:
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 catalogs, 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**, like 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 development** (declare once; IDE/AI autocompletes).
218
+ - **Cleans the codebase** (1 component = 1 dictionary).
219
+ - **Eases duplication/migration** (copy a component and its content together).
220
+ - **Avoids dead keys** (unused components don’t import content).
221
+ - **Optimizes 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
+ - **Organized codebase**: 1 component = 1 dictionary in the same folder.
233
+ - **Enhanced routing**: Helpers for **Vue Router/Nuxt** localized 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 localization 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 catalogs/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
+ ## Interoperability with vue-i18n
252
+
253
+ `intlayer` can also help to manage your `vue-i18n` namespaces.
254
+
255
+ Using `intlayer`, you can declare your content in the format of your favorite i18n library, and intlayer will generate your namespaces in the location of your choice (example: `/messages/{{locale}}/{{namespace}}.json`).
256
+
257
+ Refer to [`dictionaryOutput` and `i18nextResourcesDir` options](https://intlayer.org/doc/concept/configuration#content-configuration) for more details.
258
+
259
+ ---
260
+
261
+ ## GitHub STARs
262
+
263
+ GitHub stars are a strong indicator of a project's popularity, community trust, and long-term relevance. While not a direct measure of technical quality, they reflect how many developers find the project useful, follow its progress, and are likely to adopt it. For estimating the value of a project, stars help compare traction across alternatives and provide insights into ecosystem growth.
264
+
265
+ [![Star History Chart](https://api.star-history.com/svg?repos=intlify/vue-i18n&repos=aymericzip/intlayer&type=Date)](https://www.star-history.com/#intlify/vue-i18n&aymericzip/intlayer)
266
+
267
+ ---
268
+
269
+ ## Conclusion
270
+
271
+ Both **vue-i18n** and **Intlayer** localize Vue apps well. The difference is **how much you must build yourself** to achieve a robust, scalable setup:
272
+
273
+ - With **Intlayer**, **modular content**, **strict TS**, **build-time safety**, **tree-shaken bundles**, and **router/SEO/editor tooling** come **out of the box**.
274
+ - If your team prioritizes **maintainability and speed** in a multi-locale, component-driven Vue/Nuxt app, Intlayer offers the **most complete** experience today.
275
+
276
+ 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 and next-i18next
5
5
  description: Integrate Intlayer with next-i18next for a Next.js app
6
6
  keywords: