@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.
- package/blog/ar/intlayer_with_next-i18next.md +2 -2
- package/blog/ar/next-i18next_vs_next-intl_vs_intlayer.md +96 -219
- package/blog/ar/react-i18next_vs_react-intl_vs_intlayer.md +88 -129
- package/blog/ar/vue-i18n_vs_intlayer.md +268 -0
- package/blog/de/intlayer_with_next-i18next.md +2 -2
- package/blog/de/next-i18next_vs_next-intl_vs_intlayer.md +93 -216
- package/blog/de/react-i18next_vs_react-intl_vs_intlayer.md +87 -128
- package/blog/de/vue-i18n_vs_intlayer.md +268 -0
- package/blog/en/intlayer_with_next-i18next.md +2 -2
- package/blog/en/next-i18next_vs_next-intl_vs_intlayer.md +93 -216
- package/blog/en/react-i18next_vs_react-intl_vs_intlayer.md +88 -120
- package/blog/en/vue-i18n_vs_intlayer.md +276 -0
- package/blog/en-GB/intlayer_with_next-i18next.md +2 -2
- package/blog/en-GB/next-i18next_vs_next-intl_vs_intlayer.md +85 -218
- package/blog/en-GB/react-i18next_vs_react-intl_vs_intlayer.md +80 -130
- package/blog/en-GB/vue-i18n_vs_intlayer.md +258 -0
- package/blog/es/intlayer_with_next-i18next.md +2 -2
- package/blog/es/next-i18next_vs_next-intl_vs_intlayer.md +93 -216
- package/blog/es/react-i18next_vs_react-intl_vs_intlayer.md +87 -128
- package/blog/es/vue-i18n_vs_intlayer.md +268 -0
- package/blog/fr/intlayer_with_next-i18next.md +2 -2
- package/blog/fr/next-i18next_vs_next-intl_vs_intlayer.md +91 -214
- package/blog/fr/react-i18next_vs_react-intl_vs_intlayer.md +86 -127
- package/blog/fr/vue-i18n_vs_intlayer.md +269 -0
- package/blog/hi/intlayer_with_next-i18next.md +2 -2
- package/blog/hi/next-i18next_vs_next-intl_vs_intlayer.md +97 -220
- package/blog/hi/react-i18next_vs_react-intl_vs_intlayer.md +89 -130
- package/blog/hi/vue-i18n_vs_intlayer.md +268 -0
- package/blog/it/intlayer_with_next-i18next.md +2 -2
- package/blog/it/next-i18next_vs_next-intl_vs_intlayer.md +91 -214
- package/blog/it/react-i18next_vs_react-intl_vs_intlayer.md +86 -127
- package/blog/it/vue-i18n_vs_intlayer.md +268 -0
- package/blog/ja/intlayer_with_next-i18next.md +2 -2
- package/blog/ja/next-i18next_vs_next-intl_vs_intlayer.md +93 -216
- package/blog/ja/react-i18next_vs_react-intl_vs_intlayer.md +87 -128
- package/blog/ja/vue-i18n_vs_intlayer.md +268 -0
- package/blog/ko/intlayer_with_next-i18next.md +2 -2
- package/blog/ko/next-i18next_vs_next-intl_vs_intlayer.md +95 -217
- package/blog/ko/react-i18next_vs_react-intl_vs_intlayer.md +89 -130
- package/blog/ko/vue-i18n_vs_intlayer.md +268 -0
- package/blog/pt/intlayer_with_next-i18next.md +2 -2
- package/blog/pt/next-i18next_vs_next-intl_vs_intlayer.md +93 -216
- package/blog/pt/react-i18next_vs_react-intl_vs_intlayer.md +87 -128
- package/blog/pt/vue-i18n_vs_intlayer.md +268 -0
- package/blog/ru/intlayer_with_next-i18next.md +2 -2
- package/blog/ru/next-i18next_vs_next-intl_vs_intlayer.md +94 -217
- package/blog/ru/react-i18next_vs_react-intl_vs_intlayer.md +87 -128
- package/blog/ru/vue-i18n_vs_intlayer.md +268 -0
- package/blog/zh/intlayer_with_next-i18next.md +2 -2
- package/blog/zh/next-i18next_vs_next-intl_vs_intlayer.md +93 -216
- package/blog/zh/react-i18next_vs_react-intl_vs_intlayer.md +87 -128
- package/blog/zh/vue-i18n_vs_intlayer.md +269 -0
- package/dist/cjs/generated/blog.entry.cjs +41 -0
- package/dist/cjs/generated/blog.entry.cjs.map +1 -1
- package/dist/esm/generated/blog.entry.mjs +41 -0
- package/dist/esm/generated/blog.entry.mjs.map +1 -1
- package/dist/types/generated/blog.entry.d.ts +1 -0
- package/dist/types/generated/blog.entry.d.ts.map +1 -1
- package/docs/ar/formatters.md +417 -31
- package/docs/ar/how_works_intlayer.md +2 -4
- package/docs/ar/interest_of_intlayer.md +7 -10
- package/docs/ar/intlayer_CMS.md +2 -3
- package/docs/ar/intlayer_visual_editor.md +2 -3
- package/docs/ar/intlayer_with_tanstack.md +1 -1
- package/docs/ar/introduction.md +4 -4
- package/docs/de/formatters.md +444 -34
- package/docs/de/introduction.md +2 -2
- package/docs/en/dictionary/enumeration.md +2 -2
- package/docs/en/dictionary/function_fetching.md +2 -2
- package/docs/en/dictionary/get_started.md +2 -2
- package/docs/en/dictionary/translation.md +2 -2
- package/docs/en/formatters.md +383 -15
- package/docs/en/how_works_intlayer.md +2 -4
- package/docs/en/interest_of_intlayer.md +48 -29
- package/docs/en/intlayer_CMS.md +2 -3
- package/docs/en/intlayer_visual_editor.md +2 -3
- package/docs/en/intlayer_with_create_react_app.md +2 -2
- package/docs/en/intlayer_with_express.md +2 -2
- package/docs/en/intlayer_with_tanstack.md +1 -1
- package/docs/en/introduction.md +4 -4
- package/docs/en/packages/express-intlayer/index.md +2 -2
- package/docs/en/packages/intlayer/getConfiguration.md +2 -3
- package/docs/en/packages/intlayer/getEnumeration.md +2 -7
- package/docs/en/packages/intlayer/getHTMLTextDir.md +2 -4
- package/docs/en/packages/intlayer/getLocaleLang.md +2 -4
- package/docs/en/packages/intlayer/getLocaleName.md +2 -3
- package/docs/en/packages/intlayer/getLocalizedUrl.md +2 -8
- package/docs/en/packages/intlayer/getMultilingualUrls.md +2 -7
- package/docs/en/packages/intlayer/getPathWithoutLocale.md +2 -3
- package/docs/en/packages/intlayer/getTranslation.md +2 -4
- package/docs/en/packages/intlayer/index.md +2 -2
- package/docs/en/packages/next-intlayer/index.md +2 -2
- package/docs/en/packages/next-intlayer/t.md +2 -2
- package/docs/en/packages/next-intlayer/useDictionary.md +2 -2
- package/docs/en/packages/next-intlayer/useIntlayer.md +2 -2
- package/docs/en/packages/next-intlayer/useLocale.md +2 -2
- package/docs/en/packages/react-intlayer/index.md +2 -2
- package/docs/en/packages/react-intlayer/t.md +2 -2
- package/docs/en/packages/react-intlayer/useI18n.md +2 -2
- package/docs/en/packages/react-intlayer/useIntlayer.md +2 -2
- package/docs/en/packages/react-intlayer/useLocale.md +2 -2
- package/docs/en/packages/react-scripts-intlayer/index.md +2 -2
- package/docs/en/packages/solid-intlayer/index.md +2 -2
- package/docs/en/packages/vite-intlayer/index.md +2 -2
- package/docs/en-GB/formatters.md +402 -16
- package/docs/en-GB/how_works_intlayer.md +2 -4
- package/docs/en-GB/interest_of_intlayer.md +7 -10
- package/docs/en-GB/intlayer_with_tanstack.md +1 -1
- package/docs/en-GB/introduction.md +2 -2
- package/docs/es/formatters.md +438 -28
- package/docs/es/how_works_intlayer.md +2 -4
- package/docs/es/interest_of_intlayer.md +7 -10
- package/docs/es/intlayer_with_tanstack.md +1 -1
- package/docs/es/introduction.md +2 -2
- package/docs/fr/formatters.md +438 -28
- package/docs/fr/how_works_intlayer.md +2 -4
- package/docs/fr/interest_of_intlayer.md +7 -10
- package/docs/fr/intlayer_with_tanstack.md +1 -1
- package/docs/fr/introduction.md +2 -2
- package/docs/hi/formatters.md +430 -39
- package/docs/hi/how_works_intlayer.md +2 -4
- package/docs/hi/interest_of_intlayer.md +7 -10
- package/docs/hi/intlayer_with_tanstack.md +1 -1
- package/docs/hi/introduction.md +2 -2
- package/docs/it/formatters.md +438 -30
- package/docs/it/how_works_intlayer.md +2 -4
- package/docs/it/interest_of_intlayer.md +7 -10
- package/docs/it/intlayer_with_tanstack.md +1 -1
- package/docs/it/introduction.md +2 -2
- package/docs/ja/formatters.md +435 -47
- package/docs/ja/how_works_intlayer.md +2 -4
- package/docs/ja/interest_of_intlayer.md +7 -10
- package/docs/ja/intlayer_with_tanstack.md +1 -1
- package/docs/ja/introduction.md +2 -2
- package/docs/ko/formatters.md +432 -41
- package/docs/ko/how_works_intlayer.md +2 -4
- package/docs/ko/interest_of_intlayer.md +7 -10
- package/docs/ko/intlayer_with_tanstack.md +1 -1
- package/docs/ko/introduction.md +2 -2
- package/docs/pt/formatters.md +416 -30
- package/docs/pt/how_works_intlayer.md +2 -4
- package/docs/pt/intlayer_with_tanstack.md +1 -1
- package/docs/pt/introduction.md +2 -2
- package/docs/ru/autoFill.md +2 -2
- package/docs/ru/configuration.md +1 -40
- package/docs/ru/formatters.md +438 -28
- package/docs/ru/how_works_intlayer.md +5 -7
- package/docs/ru/index.md +1 -1
- package/docs/ru/interest_of_intlayer.md +8 -11
- package/docs/ru/intlayer_CMS.md +7 -8
- package/docs/ru/intlayer_cli.md +4 -7
- package/docs/ru/intlayer_visual_editor.md +5 -6
- package/docs/ru/intlayer_with_angular.md +1 -1
- package/docs/ru/intlayer_with_create_react_app.md +5 -5
- package/docs/ru/intlayer_with_lynx+react.md +1 -1
- package/docs/ru/intlayer_with_nextjs_15.md +3 -3
- package/docs/ru/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/ru/intlayer_with_nuxt.md +1 -1
- package/docs/ru/intlayer_with_react_native+expo.md +2 -2
- package/docs/ru/intlayer_with_tanstack.md +3 -3
- package/docs/ru/intlayer_with_vite+preact.md +3 -3
- package/docs/ru/intlayer_with_vite+react.md +3 -3
- package/docs/ru/intlayer_with_vite+solid.md +1 -1
- package/docs/ru/intlayer_with_vite+svelte.md +1 -1
- package/docs/ru/intlayer_with_vite+vue.md +2 -2
- package/docs/ru/introduction.md +5 -5
- package/docs/ru/locale_mapper.md +1 -1
- package/docs/ru/packages/@intlayer/api/index.md +2 -2
- package/docs/ru/packages/@intlayer/chokidar/index.md +1 -1
- package/docs/ru/packages/@intlayer/cli/index.md +2 -2
- package/docs/ru/packages/@intlayer/config/index.md +2 -2
- package/docs/ru/packages/@intlayer/core/index.md +2 -2
- package/docs/ru/packages/@intlayer/design-system/index.md +2 -2
- package/docs/ru/packages/@intlayer/dictionary-entry/index.md +2 -2
- package/docs/ru/packages/@intlayer/editor/index.md +1 -1
- package/docs/ru/packages/@intlayer/editor-react/index.md +1 -1
- package/docs/ru/packages/@intlayer/webpack/index.md +1 -1
- package/docs/ru/packages/angular-intlayer/index.md +1 -1
- package/docs/ru/packages/express-intlayer/index.md +3 -3
- package/docs/ru/packages/express-intlayer/t.md +1 -1
- package/docs/ru/packages/intlayer/getEnumeration.md +3 -8
- package/docs/ru/packages/intlayer/getTranslation.md +3 -5
- package/docs/ru/packages/intlayer/getTranslationContent.md +1 -3
- package/docs/ru/packages/intlayer/index.md +3 -3
- package/docs/ru/packages/intlayer-cli/index.md +1 -1
- package/docs/ru/packages/intlayer-editor/index.md +2 -2
- package/docs/ru/packages/lynx-intlayer/index.md +1 -1
- package/docs/ru/packages/next-intlayer/index.md +4 -4
- package/docs/ru/packages/next-intlayer/t.md +4 -4
- package/docs/ru/packages/next-intlayer/useLocale.md +3 -3
- package/docs/ru/packages/nuxt-intlayer/index.md +1 -1
- package/docs/ru/packages/preact-intlayer/index.md +1 -1
- package/docs/ru/packages/react-intlayer/index.md +4 -4
- package/docs/ru/packages/react-intlayer/t.md +4 -4
- package/docs/ru/packages/react-native-intlayer/index.md +1 -1
- package/docs/ru/packages/react-scripts-intlayer/index.md +3 -3
- package/docs/ru/packages/solid-intlayer/index.md +3 -3
- package/docs/ru/packages/svelte-intlayer/index.md +1 -1
- package/docs/ru/packages/vite-intlayer/index.md +3 -3
- package/docs/ru/packages/vue-intlayer/index.md +1 -1
- package/docs/ru/per_locale_file.md +1 -1
- package/docs/ru/roadmap.md +3 -5
- package/docs/ru/vs_code_extension.md +1 -1
- package/docs/zh/formatters.md +446 -38
- package/docs/zh/how_works_intlayer.md +2 -4
- package/docs/zh/interest_of_intlayer.md +7 -10
- package/docs/zh/intlayer_with_tanstack.md +1 -1
- package/docs/zh/introduction.md +2 -2
- package/frequent_questions/ar/domain_routing.md +1 -1
- package/frequent_questions/en/domain_routing.md +1 -1
- package/frequent_questions/en-GB/domain_routing.md +1 -1
- package/frequent_questions/es/domain_routing.md +1 -1
- package/frequent_questions/fr/domain_routing.md +1 -1
- package/frequent_questions/hi/domain_routing.md +1 -1
- package/frequent_questions/it/domain_routing.md +1 -1
- package/frequent_questions/ko/domain_routing.md +1 -1
- package/frequent_questions/pt/domain_routing.md +1 -1
- package/frequent_questions/ru/domain_routing.md +1 -1
- package/frequent_questions/ru/get_locale_cookie.md +4 -4
- package/frequent_questions/ru/static_rendering.md +1 -2
- package/frequent_questions/zh/domain_routing.md +1 -1
- package/package.json +9 -11
- package/src/generated/blog.entry.ts +42 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
createdAt:
|
|
3
|
-
updatedAt: 2025-
|
|
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
|
|
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
|
|
20
|
+
# next-i18next VS next-intl VS intlayer | Next.js Internationalisation (i18n)
|
|
21
21
|
|
|
22
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
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
|
-
- **
|
|
44
|
-
- **
|
|
45
|
-
- **
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
- **
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
**
|
|
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
|
-
|
|
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
|
|
73
|
+
### 1) Architecture & scalability
|
|
76
74
|
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
|
|
78
|
+
**Why it matters:** In large codebases or design-system setups, **modular content** scales better than monolithic catalogues.
|
|
81
79
|
|
|
82
|
-
|
|
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
|
-
|
|
88
|
-
- This ensures you never accidentally ship with missing text across your languages.
|
|
82
|
+
### 2) TypeScript & safety
|
|
89
83
|
|
|
90
|
-
|
|
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
|
-
|
|
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
|
-
|
|
90
|
+
---
|
|
96
91
|
|
|
97
|
-
|
|
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
|
-
|
|
102
|
-
|
|
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
|
-
|
|
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
|
-
|
|
101
|
+
### 4) Routing, middleware & URL strategy
|
|
111
102
|
|
|
112
|
-
|
|
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
|
-
|
|
106
|
+
**Why it matters:** Fewer custom glue layers; **consistent UX** and **clean SEO** across locales.
|
|
124
107
|
|
|
125
|
-
|
|
108
|
+
---
|
|
126
109
|
|
|
127
|
-
|
|
110
|
+
### 5) Server Components (RSC) alignment
|
|
128
111
|
|
|
129
|
-
|
|
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
|
-
|
|
115
|
+
**Why it matters:** Cleaner mental model and fewer edge cases in hybrid trees.
|
|
132
116
|
|
|
133
|
-
|
|
117
|
+
---
|
|
134
118
|
|
|
135
|
-
|
|
119
|
+
### 6) Performance & loading behaviour
|
|
136
120
|
|
|
137
|
-
|
|
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
|
-
|
|
124
|
+
**Why it matters:** Smaller bundles and faster start-up, especially on multi-locale sites.
|
|
140
125
|
|
|
141
|
-
|
|
142
|
-
- A standard `intlayerMiddleware` does not require deep custom rewrites.
|
|
126
|
+
---
|
|
143
127
|
|
|
144
|
-
|
|
128
|
+
### 7) DX, tooling & maintenance
|
|
145
129
|
|
|
146
|
-
|
|
147
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
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
|
-
|
|
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
|
-
- **
|
|
280
|
-
-
|
|
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
|
-
|
|
152
|
+
Refer to the ['Why Intlayer?' doc](https://intlayer.org/doc/why) for more details.
|