@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,8 +1,8 @@
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: next-i18next vs next-intl vs Intlayer
5
- description: Compare next-i18next with next-intl and Intlayer for the internationalization (i18n) of a Next.js app
5
+ description: Compare next-i18next with next-intl and Intlayer for the internationalisation (i18n) of a Next.js app
6
6
  keywords:
7
7
  - next-intl
8
8
  - next-i18next
@@ -17,269 +17,136 @@ slugs:
17
17
  - next-i18next-vs-next-intl-vs-intlayer
18
18
  ---
19
19
 
20
- # next-i18next VS next-intl VS Intlayer | Next.js Internationalisation (i18n)
20
+ # next-i18next VS next-intl VS intlayer | Next.js Internationalisation (i18n)
21
21
 
22
- Below is a concise comparison of **three popular libraries** for internationalising (i18n) a Next.js application: **next-intl**, **next-i18next**, and **Intlayer**.
22
+ This guide compares three widely used i18n options for **Next.js**: **next-intl**, **next-i18next**, and **Intlayer**.
23
+ We focus on **Next.js 13+ App Router** (with **React Server Components**) and evaluate:
23
24
 
24
- This document highlights key criteria:
25
+ 1. **Architecture & content organisation**
26
+ 2. **TypeScript & safety**
27
+ 3. **Missing translation handling**
28
+ 4. **Routing & middleware**
29
+ 5. **Performance & loading behaviour**
30
+ 6. **Developer experience (DX), tooling & maintenance**
31
+ 7. **SEO & large-project scalability**
25
32
 
26
- 1. **Architecture** (keeping translations close to their components)
27
- 2. **TypeScript support**
28
- 3. **Management of missing translations**
29
- 4. **Server Components support**
30
- 5. **Enhanced routing & middleware** for Next.js
31
- 6. **Simplicity of setup**
32
-
33
- The guide also provides an **in-depth look at Intlayer**, showing why it can be a strong choice, especially for Next.js 13+, including **App Router** and **Server Components**.
33
+ > **tl;dr**: All three can localise a Next.js app. If you want **component-scoped content**, **strict TypeScript types**, **build-time missing-key checks**, **tree-shaken dictionaries**, and **first-class App Router + SEO helpers**, **Intlayer** is the most complete, modern choice.
34
34
 
35
35
  ---
36
36
 
37
- ## Overview of Each Library
38
-
39
- ### 1. next-intl
40
-
41
- **Main Focus**: Quick and easy setup with a lightweight approach to localisation.
37
+ ## High-level positioning
42
38
 
43
- - **Architecture**: Encourages co-locating translations in a single folder (e.g., `locales/`) but also allows multiple strategies. Does not strictly enforce “translation per component” architecture.
44
- - **TypeScript Support**: Basic TypeScript integration. Some type definitions exist, but they are not heavily centered on auto-generating TypeScript definitions from your translation files.
45
- - **Missing Translations**: Basic fallback mechanism. By default, falls back to a key or a default locale string. No robust out-of-the-box tooling for advanced missing translations checks.
46
- - **Server Components Support**: Works with Next.js 13+ in general, but the pattern is less specialised for deep server-side usage (e.g., server components with complex dynamic routing).
47
- - **Routing & Middleware**: Middleware support is possible but limited. Typically relies on Next.js `Middleware` for locale detection, or manual configuration for rewriting locale paths.
48
- - **Setup Simplicity**: Very straightforward. Minimal boilerplate is needed.
49
-
50
- **Use when**: You want a simpler approach or are comfortable managing your translations in more conventional ways (like one folder with locale JSON files).
39
+ - **next-intl** - Lightweight, straightforward message formatting with solid Next.js support. Centralised catalogues are common; DX is simple, but safety and large-scale maintenance remain mostly your responsibility.
40
+ - **next-i18next** - i18next in Next.js attire. Mature ecosystem and features via plugins (e.g., ICU), but configuration can be verbose and catalogues tend to centralise as projects grow.
41
+ - **Intlayer** - Component-centric content model for Next.js, **strict TS typing**, **build-time checks**, **tree-shaking**, **built-in middleware & SEO helpers**, optional **Visual Editor/CMS**, and **AI-assisted translations**.
51
42
 
52
43
  ---
53
44
 
54
- ### 2. next-i18next
55
-
56
- **Main Focus**: Time-tested solution using `i18next` under the hood, widely adopted for Next.js projects.
57
-
58
- - **Architecture**: Often organizes translations in the `public/locales` folder. Not specifically designed to keep translations “close” to each component, though you can manually adopt a different structure.
59
- - **TypeScript Support**: Reasonable TypeScript coverage but requires custom configuration for typed translations and typed hooks.
60
- - **Missing Translations**: i18next offers interpolation/fallbacks. However, missing translation detection typically needs extra setup or third-party plugins.
61
- - **Server Components Support**: Basic usage with Next.js 13 is documented, but advanced usage (e.g., deep integration with server components, dynamic route generation) can be cumbersome.
62
- - **Routing & Middleware**: Relies heavily on Next.js `Middleware` and rewrites for locale subpaths. For more complex setups, you might need to dive into advanced i18next configuration.
63
- - **Setup Simplicity**: Familiar approach for those used to i18next. However, it can get more boilerplate-heavy when advanced i18n features are needed (namespaces, multiple fallback locales, etc.).
64
-
65
- **Use when**: You’re already committed to the `i18next` ecosystem or have existing i18next-based translations.
45
+ ## Side-by-Side Feature Comparison (Next.js focused)
46
+
47
+ | Feature | `next-intlayer` (Intlayer) | `next-intl` | `next-i18next` |
48
+ | --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
49
+ | **Translations Near Components** | Yes, content collocated with each component | No | No |
50
+ | **TypeScript Integration** | Advanced, auto-generated strict types | Good | ⚠️ Basic |
51
+ | **Missing Translation Detection** | TypeScript error highlight and build-time error/warning | ⚠️ Runtime fallback | ⚠️ Runtime fallback |
52
+ | **Rich Content (JSX/Markdown/components)** | Direct support | Not designed for rich nodes | ⚠️ Limited |
53
+ | **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 |
54
+ | **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 |
55
+ | **Localised Routing** | ✅ Yes, supports localised paths out of the box (works with Next.js & Vite) | ✅ Built-in, App Router supports `[locale]` segment | ✅ Built-in |
56
+ | **Dynamic Route Generation** | Yes | Yes | Yes |
57
+ | **Pluralisation** | ✅ Enumeration-based patterns | ✅ Good | ✅ Good |
58
+ | **Formatting (dates, numbers, currencies)** | ✅ Optimised formatters (Intl under the hood) | ✅ Good (Intl helpers) | ✅ Good (Intl helpers) |
59
+ | **Content Format** | ✅ .tsx, .ts, .js, .json, .md, .txt, (.yaml WIP) | ✅ .json, .js, .ts | ⚠️ .json |
60
+ | **ICU support** | ⚠️ WIP | ✅ Yes | ⚠️ Via plugin (`i18next-icu`) |
61
+ | **SEO Helpers (hreflang, sitemap)** | ✅ Built-in tools: helpers for sitemap, robots.txt, metadata | ✅ Good | ✅ Good |
62
+ | **Ecosystem / Community** | ⚠️ Smaller but growing fast and reactive | ✅ Good | ✅ Good |
63
+ | **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 | ⚠️ Supported at page level but need to pass t-functions on component tree for children server components |
64
+ | **Tree-shaking (load only used content)** | ✅ Yes, per-component at build time via Babel/SWC plugins | ⚠️ Partial | ⚠️ Partial |
65
+ | **Lazy loading** | ✅ Yes, per-locale / per-dictionary | ✅ Yes (per-route/per-locale), need namespace management | ✅ Yes (per-route/per-locale), need namespace management |
66
+ | **Purge unused content** | ✅ Yes, per-dictionary at build time | ❌ No, can be managed manually with namespace management | ❌ No, can be managed manually with namespace management |
67
+ | **Management of Large Projects** | ✅ Encourages modular, suited for design-system | ✅ Modular with setup | ✅ Modular with setup |
66
68
 
67
69
  ---
68
70
 
69
- ### 3. Intlayer
70
-
71
- **Main Focus**: A modern, open-source i18n library specifically tailored for Next.js **App Router** (12, 13, 14, and 15) with built-in support for **Server Components** and **Turbopack**.
72
-
73
- #### Key Advantages
71
+ ## Deep-dive comparison
74
72
 
75
- 1. **Architecture**
73
+ ### 1) Architecture & scalability
76
74
 
77
- - Encourages placing **translations right next to their components**. Each page or component can have its own `.content.ts` (or JSON) file, no more rummaging through a giant translation folder.
78
- - This makes your code more **modular and maintainable**, especially in large codebases.
75
+ - **next-intl / next-i18next**: Default to **centralised catalogues** per locale (plus **namespaces** in i18next). Works fine early on, but often becomes a big shared surface area with rising coupling and key churn.
76
+ - **Intlayer**: Encourages **per-component** (or per-feature) dictionaries **co-located** with the code they serve. This lowers cognitive load, eases duplication/migration of UI pieces, and reduces cross-team conflicts. Unused content is naturally easier to spot and purge.
79
77
 
80
- 2. **TypeScript Support**
78
+ **Why it matters:** In large codebases or design-system setups, **modular content** scales better than monolithic catalogues.
81
79
 
82
- - **Auto-generated type definitions**: The moment you define your content, Intlayer generates types that power autocomplete and catch translation errors.
83
- - Minimises runtime errors like missing keys and offers advanced **autocomplete** directly in your IDE.
84
-
85
- 3. **Management of Missing Translations**
80
+ ---
86
81
 
87
- - During build, Intlayer can **detect missing translation keys** and throw warnings or errors.
88
- - This ensures you never accidentally ship with missing text across your languages.
82
+ ### 2) TypeScript & safety
89
83
 
90
- 4. **Optimised for Server Components**
84
+ - **next-intl**: Solid TypeScript support, but **keys aren’t strictly typed by default**; you’ll maintain safety patterns manually.
85
+ - **next-i18next**: Base typings for hooks; **strict key typing requires extra tooling/config**.
86
+ - **Intlayer**: **Generates strict types** from your content. **IDE autocompletion** and **compile-time errors** catch typos and missing keys before deployment.
91
87
 
92
- - Fully compatible with the Next.js **App Router** and the new **Server Components** paradigm.
93
- - Provides specialised providers (`IntlayerServerProvider`, `IntlayerClientProvider`) to **isolate server context** (vital when dealing with Next.js 13+).
88
+ **Why it matters:** Strong typing shifts failures **left** (CI/build) instead of **right** (runtime).
94
89
 
95
- 5. **Enhanced Routing & Middleware**
90
+ ---
96
91
 
97
- - Includes a dedicated [**`intlayerMiddleware`**](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/#) for **automatic locale detection** (via cookies or browser headers) and advanced route generation.
98
- - Dynamically handles localised paths (e.g., `/en-GB/about` vs. `/fr/about`) with minimal configuration.
99
- - Offers helper methods like `getMultilingualUrls` for generating alternate language links (great for **SEO**).
92
+ ### 3) Missing translation handling
100
93
 
101
- 6. **Simplified Setup**
102
- - A single config file (`intlayer.config.ts`) to define your locales, default locale, and integration preferences.
103
- - A wrapper plugin `withIntlayer(nextConfig)` that **injects** all environment variables and watchers for your content.
104
- - **No large fallback configurations**, the system is built to “just work” with minimal friction.
94
+ - **next-intl / next-i18next**: Rely on **runtime fallbacks** (e.g., show the key or default locale). Build doesn’t fail.
95
+ - **Intlayer**: **Build-time detection** with **warnings/errors** for missing locales or keys.
105
96
 
106
- > **Bottom line**: Intlayer is a modern solution that wants to **push best practices**: from **keeping translations close** to each React component, to offering **robust TS support** and **easy server-side** usage, while **drastically reducing boilerplate**.
97
+ **Why it matters:** Catching gaps during build prevents “mystery strings” in production and aligns with strict release gates.
107
98
 
108
99
  ---
109
100
 
110
- ## Side-by-Side Feature Comparison
101
+ ### 4) Routing, middleware & URL strategy
111
102
 
112
- | **Feature** | **next-intl** | **next-i18next** | **Intlayer** |
113
- | ------------------------------------- | ---------------------------------------- | ---------------------------------------------- | ---------------------------------------------- |
114
- | **Keep translations near components** | Partial – typically one locales folder | Not default – often `public/locales` | **Yes – recommended & easy** |
115
- | **TypeScript Autogenerated** | Basic TS definitions | Basic TS support | **Yes – advanced out-of-the-box** |
116
- | **Missing translations detection** | Mostly fallback strings | Mostly fallback strings | **Yes – build-time checks** |
117
- | **Server Components Support** | Works but not specialised | Supported but can be verbose | **Full support with specialised providers** |
118
- | **Routing & Middleware** | Manually integrated with Next middleware | Provided via rewriting config | **Dedicated i18n middleware + advanced hooks** |
119
- | **Setup Complexity** | Simple, minimal configuration | Traditional, can be verbose for advanced usage | **One config file & plugin** |
120
-
121
- ---
103
+ - All three work with **Next.js localised routing** on the App Router.
104
+ - **Intlayer** goes further with **i18n middleware** (locale detection via headers/cookies) and **helpers** to generate localised URLs and `<link rel="alternate" hreflang="…">` tags.
122
105
 
123
- ## Why Intlayer?
106
+ **Why it matters:** Fewer custom glue layers; **consistent UX** and **clean SEO** across locales.
124
107
 
125
- For teams migrating to or building on top of **Next.js App Router** (versions 13, 14, or 15) with **Server Components**, Intlayer provides:
108
+ ---
126
109
 
127
- 1. **A Streamlined Architecture**
110
+ ### 5) Server Components (RSC) alignment
128
111
 
129
- - Each route or component holds its own translations. This fosters clarity and maintainability.
112
+ - **All** support Next.js 13+.
113
+ - **Intlayer** smooths the **server/client boundary** with a consistent API and providers designed for RSC, so you don’t shuttle formatters or t-functions through component trees.
130
114
 
131
- 2. **Powerful TypeScript Integration**
115
+ **Why it matters:** Cleaner mental model and fewer edge cases in hybrid trees.
132
116
 
133
- - You gain compiler-level safety, avoiding “typo-laden” or missing translation keys.
117
+ ---
134
118
 
135
- 3. **Real Missing Translation Alerts**
119
+ ### 6) Performance & loading behaviour
136
120
 
137
- - If you forget a key or language translation, you’ll be warned at build time (rather than shipping an incomplete UI).
121
+ - **next-intl / next-i18next**: Partial control via **namespaces** and **route-level splits**; risk of bundling unused strings if discipline slips.
122
+ - **Intlayer**: **Tree-shakes** at build and **lazy-loads per dictionary/locale**. Unused content doesn’t ship.
138
123
 
139
- 4. **Built-In Advanced Routing**
124
+ **Why it matters:** Smaller bundles and faster start-up, especially on multi-locale sites.
140
125
 
141
- - Automatic locale detection, dynamic route generation, and easy localised URL management are included.
142
- - A standard `intlayerMiddleware` does not require deep custom rewrites.
126
+ ---
143
127
 
144
- 5. **One-Stop Setup**
128
+ ### 7) DX, tooling & maintenance
145
129
 
146
- - Minimal boilerplate: simply define your `intlayer.config.ts`, wrap `next.config` with `withIntlayer`, and add the official middleware.
147
- - Clear, straightforward usage for both **server** and **client** components via `IntlayerServerProvider` and `IntlayerClientProvider`.
130
+ - **next-intl / next-i18next**: You’ll typically wire up external platforms for translations and editorial workflows.
131
+ - **Intlayer**: Ships a **free Visual Editor** and **optional CMS** (Git-friendly or externalised). Plus **VSCode extension** for content authoring and **AI-assisted translations** using your own provider keys.
148
132
 
149
- 6. **SEO-Friendly**
150
- - Built-in helpers (`getMultilingualUrls`, `hrefLang` attributes, etc.) make it easy to produce SEO-compliant pages and sitemaps.
133
+ **Why it matters:** Lowers operational costs and shortens the feedback loop between developers and content authors.
151
134
 
152
135
  ---
153
136
 
154
- ## Example: Intlayer in Action
155
-
156
- Below is a _very_ condensed snippet illustrating how to harness Intlayer in a Next.js 15 project. For the full details and code examples, [check out the full Intlayer guide](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/#).
157
-
158
- <details>
159
- <summary>Step-by-step example</summary>
160
-
161
- 1. **Install & Configure**
162
-
163
- ```bash
164
- npm install intlayer next-intlayer
165
- ```
166
-
167
- ```ts
168
- // intlayer.config.ts
169
- import { Locales, type IntlayerConfig } from "intlayer";
170
-
171
- const config: IntlayerConfig = {
172
- internationalization: {
173
- locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
174
- defaultLocale: Locales.ENGLISH,
175
- },
176
- };
177
- export default config;
178
- ```
179
-
180
- 2. **Use the Plugin**
181
-
182
- ```ts
183
- // next.config.mjs
184
- import { withIntlayer } from "next-intlayer/server";
185
-
186
- /** @type {import('next').NextConfig} */
187
- const nextConfig = {};
188
-
189
- export default withIntlayer(nextConfig);
190
- ```
191
-
192
- 3. **Add Middleware**
193
-
194
- ```ts
195
- // src/middleware.ts
196
- export { intlayerMiddleware as middleware } from "next-intlayer/middleware";
197
-
198
- export const config = {
199
- matcher:
200
- "/((?!api|static|assets|robots|sitemap|sw|service-worker|manifest|.*\\..*|_next).*)",
201
- };
202
- ```
203
-
204
- 4. **Create a Localised Layout**
205
-
206
- ```tsx
207
- // src/app/[locale]/layout.tsx
208
- import { getHTMLTextDir } from "intlayer";
209
- import { NextLayoutIntlayer } from "next-intlayer";
210
-
211
- const LocaleLayout: NextLayoutIntlayer = async ({ children, params }) => {
212
- const { locale } = params;
213
- return (
214
- <html lang={locale} dir={getHTMLTextDir(locale)}>
215
- <body>{children}</body>
216
- </html>
217
- );
218
- };
219
-
220
- export { generateStaticParams } from "next-intlayer";
221
- export default LocaleLayout;
222
- ```
223
-
224
- 5. **Declare & Use Content**
225
-
226
- ```tsx
227
- // src/app/[locale]/page.content.ts
228
- import { t } from "intlayer";
229
-
230
- export default {
231
- key: "page",
232
- content: {
233
- getStarted: {
234
- main: t({
235
- en: "Get started by editing",
236
- fr: "Commencez par éditer",
237
- es: "Comience por editar",
238
- }),
239
- pageLink: "src/app/page.tsx",
240
- },
241
- },
242
- };
243
- ```
244
-
245
- ```tsx
246
- // src/app/[locale]/page.tsx
247
- import { IntlayerServerProvider } from "next-intlayer/server";
248
- import { IntlayerClientProvider, useIntlayer } from "next-intlayer";
249
-
250
- const PageContent = () => {
251
- const { content } = useIntlayer("page");
252
- return (
253
- <>
254
- <p>{content.getStarted.main}</p>
255
- <code>{content.getStarted.pageLink}</code>
256
- </>
257
- );
258
- };
259
-
260
- export default function Page({ params }) {
261
- return (
262
- <IntlayerServerProvider locale={params.locale}>
263
- <IntlayerClientProvider locale={params.locale}>
264
- <PageContent />
265
- </IntlayerClientProvider>
266
- </IntlayerServerProvider>
267
- );
268
- }
269
- ```
270
-
271
- </details>
137
+ ## When to choose which?
138
+
139
+ - **Choose next-intl** if you want a **minimal** solution, you’re comfortable with centralised catalogues, and your app is **small to mid-size**.
140
+ - **Choose next-i18next** if you need **i18next’s plugin ecosystem** (e.g., advanced ICU rules via plugins) and your team already knows i18next, accepting **more configuration** for flexibility.
141
+ - **Choose Intlayer** if you value **component-scoped content**, **strict TypeScript**, **build-time guarantees**, **tree-shaking**, and **batteries-included** routing/SEO/editor tooling - especially for **Next.js App Router**, design-systems and **large, modular codebases**.
272
142
 
273
143
  ---
274
144
 
275
145
  ## Conclusion
276
146
 
277
- Each solution, **next-intl**, **next-i18next**, and **Intlayer**, has proven effective for multilingual Next.js projects. However, **Intlayer** goes further by:
147
+ All three libraries succeed at core localisation. The difference is **how much work you must do** to achieve a robust, scalable setup in **modern Next.js**:
278
148
 
279
- - **Strongly encouraging a component-level translation architecture**
280
- - Integrating seamlessly with **Next.js 13+ and Server Components**
281
- - Offering **powerful TypeScript** auto-generation for safer code
282
- - Handling **missing translations** at build time
283
- - Providing a **simplified, single configuration** approach with advanced routing & middleware
149
+ - With **Intlayer**, **modular content**, **strict TS**, **build-time safety**, **tree-shaken bundles**, and **first-class App Router + SEO tooling** are **defaults**, not chores.
150
+ - If your team values **maintainability and speed** in a multi-locale, component-driven app, Intlayer offers the **most complete** experience today.
284
151
 
285
- If you want **modern** i18n features tailored to Next.js App Router and are looking for a **fully typed** experience without manually rigging fallback logic, route rewrites, or complex build steps, **Intlayer** is a compelling choice. It not only shortens your setup time but also ensures a more maintainable, scalable approach to translations for your team.
152
+ Refer to the ['Why Intlayer?' doc](https://intlayer.org/doc/why) for more details.