@intlayer/docs 8.3.0-canary.4 → 8.3.1
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/docs/ar/compiler.md +84 -49
- package/docs/ar/configuration.md +80 -37
- package/docs/ar/intlayer_with_nextjs_16.md +174 -1
- package/docs/ar/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/ar/intlayer_with_react_router_v7.md +224 -1
- package/docs/ar/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/ar/intlayer_with_svelte_kit.md +175 -2
- package/docs/ar/intlayer_with_tanstack.md +176 -1
- package/docs/ar/intlayer_with_vite+preact.md +174 -1
- package/docs/ar/intlayer_with_vite+react.md +174 -1
- package/docs/ar/intlayer_with_vite+solid.md +174 -1
- package/docs/ar/intlayer_with_vite+svelte.md +174 -1
- package/docs/ar/intlayer_with_vite+vue.md +174 -1
- package/docs/de/compiler.md +83 -48
- package/docs/de/configuration.md +434 -212
- package/docs/de/intlayer_with_nextjs_16.md +176 -1
- package/docs/de/intlayer_with_nextjs_compiler.md +106 -349
- package/docs/de/intlayer_with_react_router_v7.md +225 -2
- package/docs/de/intlayer_with_react_router_v7_fs_routes.md +221 -79
- package/docs/de/intlayer_with_svelte_kit.md +158 -2
- package/docs/de/intlayer_with_tanstack.md +159 -1
- package/docs/de/intlayer_with_vite+preact.md +157 -1
- package/docs/de/intlayer_with_vite+react.md +157 -1
- package/docs/de/intlayer_with_vite+solid.md +159 -3
- package/docs/de/intlayer_with_vite+svelte.md +157 -1
- package/docs/de/intlayer_with_vite+vue.md +157 -1
- package/docs/en/compiler.md +60 -33
- package/docs/en/configuration.md +80 -57
- package/docs/en/intlayer_with_nextjs_16.md +176 -0
- package/docs/en/intlayer_with_nextjs_compiler.md +179 -1
- package/docs/en/intlayer_with_react_router_v7.md +159 -0
- package/docs/en/intlayer_with_react_router_v7_fs_routes.md +159 -0
- package/docs/en/intlayer_with_svelte_kit.md +159 -0
- package/docs/en/intlayer_with_tanstack.md +160 -1
- package/docs/en/intlayer_with_vite+preact.md +159 -0
- package/docs/en/intlayer_with_vite+react.md +159 -0
- package/docs/en/intlayer_with_vite+solid.md +148 -27
- package/docs/en/intlayer_with_vite+svelte.md +159 -0
- package/docs/en/intlayer_with_vite+vue.md +142 -41
- package/docs/en-GB/compiler.md +66 -34
- package/docs/en-GB/configuration.md +78 -36
- package/docs/es/compiler.md +83 -48
- package/docs/es/configuration.md +429 -206
- package/docs/es/intlayer_with_adonisjs.md +1 -1
- package/docs/es/intlayer_with_express.md +1 -1
- package/docs/es/intlayer_with_fastify.md +1 -1
- package/docs/es/intlayer_with_hono.md +1 -1
- package/docs/es/intlayer_with_nestjs.md +1 -1
- package/docs/es/intlayer_with_nextjs_16.md +176 -3
- package/docs/es/intlayer_with_nextjs_compiler.md +175 -2
- package/docs/es/intlayer_with_nuxt.md +1 -1
- package/docs/es/intlayer_with_react_router_v7.md +227 -4
- package/docs/es/intlayer_with_react_router_v7_fs_routes.md +162 -4
- package/docs/es/intlayer_with_svelte_kit.md +158 -2
- package/docs/es/intlayer_with_tanstack.md +160 -2
- package/docs/es/intlayer_with_vite+preact.md +162 -6
- package/docs/es/intlayer_with_vite+react.md +160 -4
- package/docs/es/intlayer_with_vite+solid.md +163 -7
- package/docs/es/intlayer_with_vite+svelte.md +157 -1
- package/docs/es/intlayer_with_vite+vue.md +165 -9
- package/docs/fr/compiler.md +81 -46
- package/docs/fr/configuration.md +355 -134
- package/docs/fr/intlayer_with_adonisjs.md +1 -1
- package/docs/fr/intlayer_with_express.md +1 -1
- package/docs/fr/intlayer_with_fastify.md +1 -1
- package/docs/fr/intlayer_with_hono.md +1 -1
- package/docs/fr/intlayer_with_nestjs.md +1 -1
- package/docs/fr/intlayer_with_nextjs_16.md +183 -7
- package/docs/fr/intlayer_with_nextjs_compiler.md +179 -3
- package/docs/fr/intlayer_with_react_router_v7.md +229 -3
- package/docs/fr/intlayer_with_react_router_v7_fs_routes.md +237 -6
- package/docs/fr/intlayer_with_svelte_kit.md +158 -2
- package/docs/fr/intlayer_with_tanstack.md +159 -1
- package/docs/fr/intlayer_with_vite+preact.md +164 -8
- package/docs/fr/intlayer_with_vite+react.md +162 -6
- package/docs/fr/intlayer_with_vite+solid.md +163 -7
- package/docs/fr/intlayer_with_vite+svelte.md +157 -1
- package/docs/fr/intlayer_with_vite+vue.md +164 -8
- package/docs/hi/compiler.md +81 -46
- package/docs/hi/configuration.md +87 -44
- package/docs/hi/intlayer_with_nextjs_16.md +174 -1
- package/docs/hi/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/hi/intlayer_with_react_router_v7.md +224 -1
- package/docs/hi/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/hi/intlayer_with_svelte_kit.md +158 -2
- package/docs/hi/intlayer_with_tanstack.md +159 -1
- package/docs/hi/intlayer_with_vite+preact.md +157 -1
- package/docs/hi/intlayer_with_vite+react.md +157 -1
- package/docs/hi/intlayer_with_vite+solid.md +157 -1
- package/docs/hi/intlayer_with_vite+svelte.md +157 -1
- package/docs/hi/intlayer_with_vite+vue.md +157 -1
- package/docs/id/compiler.md +84 -51
- package/docs/id/configuration.md +83 -45
- package/docs/id/intlayer_with_nextjs_16.md +174 -1
- package/docs/id/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/id/intlayer_with_react_router_v7.md +224 -1
- package/docs/id/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/id/intlayer_with_svelte_kit.md +158 -2
- package/docs/id/intlayer_with_tanstack.md +159 -1
- package/docs/id/intlayer_with_vite+preact.md +157 -1
- package/docs/id/intlayer_with_vite+react.md +157 -1
- package/docs/id/intlayer_with_vite+solid.md +157 -1
- package/docs/id/intlayer_with_vite+svelte.md +157 -1
- package/docs/id/intlayer_with_vite+vue.md +157 -1
- package/docs/it/compiler.md +81 -46
- package/docs/it/configuration.md +426 -204
- package/docs/it/intlayer_with_nextjs_16.md +174 -1
- package/docs/it/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/it/intlayer_with_react_router_v7.md +225 -2
- package/docs/it/intlayer_with_react_router_v7_fs_routes.md +226 -2
- package/docs/it/intlayer_with_svelte_kit.md +158 -2
- package/docs/it/intlayer_with_tanstack.md +159 -1
- package/docs/it/intlayer_with_vite+preact.md +157 -1
- package/docs/it/intlayer_with_vite+react.md +157 -1
- package/docs/it/intlayer_with_vite+solid.md +159 -3
- package/docs/it/intlayer_with_vite+svelte.md +157 -1
- package/docs/it/intlayer_with_vite+vue.md +157 -1
- package/docs/ja/compiler.md +94 -58
- package/docs/ja/configuration.md +88 -45
- package/docs/ja/intlayer_with_nextjs_16.md +174 -1
- package/docs/ja/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/ja/intlayer_with_react_router_v7.md +184 -394
- package/docs/ja/intlayer_with_react_router_v7_fs_routes.md +226 -2
- package/docs/ja/intlayer_with_svelte_kit.md +119 -595
- package/docs/ja/intlayer_with_tanstack.md +131 -642
- package/docs/ja/intlayer_with_vite+preact.md +111 -1231
- package/docs/ja/intlayer_with_vite+react.md +129 -1304
- package/docs/ja/intlayer_with_vite+solid.md +159 -3
- package/docs/ja/intlayer_with_vite+svelte.md +157 -1
- package/docs/ja/intlayer_with_vite+vue.md +157 -1
- package/docs/ko/compiler.md +88 -52
- package/docs/ko/configuration.md +87 -44
- package/docs/ko/intlayer_with_nextjs_16.md +174 -1
- package/docs/ko/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/ko/intlayer_with_react_router_v7.md +225 -2
- package/docs/ko/intlayer_with_react_router_v7_fs_routes.md +226 -2
- package/docs/ko/intlayer_with_svelte_kit.md +158 -2
- package/docs/ko/intlayer_with_tanstack.md +159 -1
- package/docs/ko/intlayer_with_vite+preact.md +157 -1
- package/docs/ko/intlayer_with_vite+react.md +157 -1
- package/docs/ko/intlayer_with_vite+solid.md +159 -3
- package/docs/ko/intlayer_with_vite+svelte.md +157 -1
- package/docs/ko/intlayer_with_vite+vue.md +157 -1
- package/docs/pl/compiler.md +84 -51
- package/docs/pl/configuration.md +83 -37
- package/docs/pl/intlayer_with_nextjs_16.md +174 -1
- package/docs/pl/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/pl/intlayer_with_react_router_v7.md +224 -1
- package/docs/pl/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/pl/intlayer_with_svelte_kit.md +158 -2
- package/docs/pl/intlayer_with_tanstack.md +159 -1
- package/docs/pl/intlayer_with_vite+preact.md +157 -1
- package/docs/pl/intlayer_with_vite+react.md +157 -1
- package/docs/pl/intlayer_with_vite+solid.md +157 -1
- package/docs/pl/intlayer_with_vite+svelte.md +157 -1
- package/docs/pl/intlayer_with_vite+vue.md +157 -1
- package/docs/pt/compiler.md +81 -46
- package/docs/pt/configuration.md +404 -194
- package/docs/pt/intlayer_with_nextjs_16.md +174 -1
- package/docs/pt/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/pt/intlayer_with_react_router_v7.md +224 -1
- package/docs/pt/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/pt/intlayer_with_svelte_kit.md +158 -2
- package/docs/pt/intlayer_with_tanstack.md +159 -1
- package/docs/pt/intlayer_with_vite+preact.md +157 -1
- package/docs/pt/intlayer_with_vite+react.md +157 -1
- package/docs/pt/intlayer_with_vite+solid.md +157 -1
- package/docs/pt/intlayer_with_vite+svelte.md +157 -1
- package/docs/pt/intlayer_with_vite+vue.md +157 -1
- package/docs/ru/compiler.md +90 -57
- package/docs/ru/configuration.md +76 -46
- package/docs/ru/intlayer_with_nextjs_16.md +174 -1
- package/docs/ru/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/ru/intlayer_with_react_router_v7.md +224 -1
- package/docs/ru/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/ru/intlayer_with_svelte_kit.md +158 -2
- package/docs/ru/intlayer_with_tanstack.md +159 -1
- package/docs/ru/intlayer_with_vite+preact.md +157 -1
- package/docs/ru/intlayer_with_vite+react.md +157 -1
- package/docs/ru/intlayer_with_vite+solid.md +157 -1
- package/docs/ru/intlayer_with_vite+svelte.md +157 -1
- package/docs/ru/intlayer_with_vite+vue.md +157 -1
- package/docs/tr/compiler.md +85 -52
- package/docs/tr/configuration.md +83 -40
- package/docs/tr/intlayer_with_nextjs_16.md +174 -1
- package/docs/tr/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/tr/intlayer_with_react_router_v7.md +224 -1
- package/docs/tr/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/tr/intlayer_with_svelte_kit.md +158 -2
- package/docs/tr/intlayer_with_tanstack.md +159 -1
- package/docs/tr/intlayer_with_vite+preact.md +157 -1
- package/docs/tr/intlayer_with_vite+react.md +157 -1
- package/docs/tr/intlayer_with_vite+solid.md +157 -1
- package/docs/tr/intlayer_with_vite+svelte.md +157 -1
- package/docs/tr/intlayer_with_vite+vue.md +157 -1
- package/docs/uk/compiler.md +96 -61
- package/docs/uk/configuration.md +83 -37
- package/docs/uk/intlayer_with_nextjs_16.md +174 -1
- package/docs/uk/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/uk/intlayer_with_react_router_v7.md +224 -1
- package/docs/uk/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/uk/intlayer_with_svelte_kit.md +157 -1
- package/docs/uk/intlayer_with_tanstack.md +159 -1
- package/docs/uk/intlayer_with_vite+preact.md +157 -1
- package/docs/uk/intlayer_with_vite+react.md +157 -1
- package/docs/uk/intlayer_with_vite+solid.md +157 -1
- package/docs/uk/intlayer_with_vite+svelte.md +157 -1
- package/docs/uk/intlayer_with_vite+vue.md +157 -1
- package/docs/vi/compiler.md +85 -50
- package/docs/vi/configuration.md +85 -39
- package/docs/vi/intlayer_with_nextjs_16.md +174 -1
- package/docs/vi/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/vi/intlayer_with_react_router_v7.md +224 -1
- package/docs/vi/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/vi/intlayer_with_svelte_kit.md +158 -2
- package/docs/vi/intlayer_with_tanstack.md +159 -1
- package/docs/vi/intlayer_with_vite+preact.md +157 -1
- package/docs/vi/intlayer_with_vite+react.md +157 -1
- package/docs/vi/intlayer_with_vite+solid.md +157 -1
- package/docs/vi/intlayer_with_vite+svelte.md +157 -1
- package/docs/vi/intlayer_with_vite+vue.md +157 -1
- package/docs/zh/compiler.md +84 -49
- package/docs/zh/configuration.md +80 -37
- package/docs/zh/intlayer_with_adonisjs.md +1 -1
- package/docs/zh/intlayer_with_express.md +1 -1
- package/docs/zh/intlayer_with_fastify.md +1 -1
- package/docs/zh/intlayer_with_hono.md +1 -1
- package/docs/zh/intlayer_with_nestjs.md +1 -1
- package/docs/zh/intlayer_with_nextjs_16.md +174 -1
- package/docs/zh/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/zh/intlayer_with_react_router_v7.md +227 -4
- package/docs/zh/intlayer_with_react_router_v7_fs_routes.md +228 -4
- package/docs/zh/intlayer_with_svelte_kit.md +158 -2
- package/docs/zh/intlayer_with_tanstack.md +159 -1
- package/docs/zh/intlayer_with_vite+preact.md +159 -3
- package/docs/zh/intlayer_with_vite+react.md +157 -1
- package/docs/zh/intlayer_with_vite+solid.md +161 -5
- package/docs/zh/intlayer_with_vite+svelte.md +157 -1
- package/docs/zh/intlayer_with_vite+vue.md +158 -2
- package/package.json +6 -6
|
@@ -44,7 +44,7 @@ En internationalisant le backend, votre application non seulement respecte les d
|
|
|
44
44
|
<iframe
|
|
45
45
|
src="https://stackblitz.com/github/aymericzip/intlayer-adonisjs-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
46
46
|
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
47
|
-
title="
|
|
47
|
+
title="Démo CodeSandbox - Comment internationaliser votre application avec Intlayer"
|
|
48
48
|
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
49
49
|
loading="lazy"
|
|
50
50
|
/>
|
|
@@ -49,7 +49,7 @@ Internationaliser votre backend est essentiel pour servir efficacement un public
|
|
|
49
49
|
<iframe
|
|
50
50
|
src="https://stackblitz.com/github/aymericzip/intlayer-express-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
51
51
|
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
52
|
-
title="
|
|
52
|
+
title="Démo CodeSandbox - Comment internationaliser votre application avec Intlayer"
|
|
53
53
|
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
54
54
|
loading="lazy"
|
|
55
55
|
/>
|
|
@@ -43,7 +43,7 @@ En internationalisant le backend, votre application non seulement respecte les d
|
|
|
43
43
|
<iframe
|
|
44
44
|
src="https://stackblitz.com/github/aymericzip/intlayer-fastify-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
45
45
|
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
46
|
-
title="
|
|
46
|
+
title="Démo CodeSandbox - Comment internationaliser votre application avec Intlayer"
|
|
47
47
|
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
48
48
|
loading="lazy"
|
|
49
49
|
/>
|
|
@@ -47,7 +47,7 @@ En internationalisant le backend, votre application respecte non seulement les d
|
|
|
47
47
|
<iframe
|
|
48
48
|
src="https://stackblitz.com/github/aymericzip/intlayer-hono-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
49
49
|
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
50
|
-
title="
|
|
50
|
+
title="Démo CodeSandbox - Comment internationaliser votre application avec Intlayer"
|
|
51
51
|
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
52
52
|
loading="lazy"
|
|
53
53
|
/>
|
|
@@ -52,7 +52,7 @@ En internationalisant le backend, votre application respecte non seulement les d
|
|
|
52
52
|
<iframe
|
|
53
53
|
src="https://stackblitz.com/github/aymericzip/intlayer-nestjs-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
54
54
|
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
55
|
-
title="
|
|
55
|
+
title="Démo CodeSandbox - Comment internationaliser votre application avec Intlayer"
|
|
56
56
|
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
57
57
|
loading="lazy"
|
|
58
58
|
/>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2024-12-06
|
|
3
|
-
updatedAt:
|
|
3
|
+
updatedAt: 2026-03-12
|
|
4
4
|
title: Next.js i18n - Comment traduire une application Next.js 16 en 2026
|
|
5
5
|
description: Découvrez comment rendre votre site Next.js 16 multilingue. Suivez la documentation pour internationaliser (i18n) et traduire votre site.
|
|
6
6
|
keywords:
|
|
@@ -31,7 +31,7 @@ history:
|
|
|
31
31
|
# Traduisez votre site Next.js 16 avec Intlayer | Internationalisation (i18n)
|
|
32
32
|
|
|
33
33
|
<Tabs defaultTab="video">
|
|
34
|
-
<Tab label="
|
|
34
|
+
<Tab label="Vidéo" value="video">
|
|
35
35
|
|
|
36
36
|
<iframe title="La meilleure solution i18n pour Next.js ? Découvrez Intlayer" class="m-auto aspect-16/9 w-full overflow-hidden rounded-lg border-0" allow="autoplay; gyroscope;" loading="lazy" width="1080" height="auto" src="https://www.youtube.com/embed/e_PPG7PTqGU?autoplay=0&origin=http://intlayer.org&controls=0&rel=1"/>
|
|
37
37
|
|
|
@@ -41,7 +41,7 @@ history:
|
|
|
41
41
|
<iframe
|
|
42
42
|
src="https://stackblitz.com/github/aymericzip/intlayer-next-16-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
43
43
|
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
44
|
-
title="
|
|
44
|
+
title="Démo CodeSandbox - Comment internationaliser votre application avec Intlayer"
|
|
45
45
|
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
46
46
|
loading="lazy"
|
|
47
47
|
/>
|
|
@@ -109,17 +109,17 @@ Le package qui intègre Intlayer avec Next.js. Il fournit des fournisseurs de co
|
|
|
109
109
|
|
|
110
110
|
### Étape 2 : Configurez votre projet
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
Voici la structure finale que nous allons obtenir :
|
|
113
113
|
|
|
114
114
|
```bash
|
|
115
115
|
.
|
|
116
116
|
├── src
|
|
117
117
|
│ ├── app
|
|
118
118
|
│ │ ├── [locale]
|
|
119
|
-
│ │ │ ├── layout.tsx #
|
|
119
|
+
│ │ │ ├── layout.tsx # Layout de locale pour le fournisseur Intlayer
|
|
120
120
|
│ │ │ ├── page.content.ts
|
|
121
121
|
│ │ │ └── page.tsx
|
|
122
|
-
│ │ └── layout.tsx #
|
|
122
|
+
│ │ └── layout.tsx # Layout racine pour le style et les fournisseurs globaux
|
|
123
123
|
│ ├── components
|
|
124
124
|
│ │ ├── client-component-example.content.ts
|
|
125
125
|
│ │ ├── ClientComponentExample.tsx
|
|
@@ -135,7 +135,7 @@ Here is the final structure that we will make:
|
|
|
135
135
|
└── tsconfig.json
|
|
136
136
|
```
|
|
137
137
|
|
|
138
|
-
>
|
|
138
|
+
> Si vous ne souhaitez pas de routage par locale, intlayer peut être utilisé comme un simple fournisseur / hook. Consultez [ce guide](https://github.com/aymericzip/intlayer/blob/main/docs/docs/fr/intlayer_with_nextjs_no_locale_path.md) pour plus de détails.
|
|
139
139
|
|
|
140
140
|
Créez un fichier de configuration pour configurer les langues de votre application :
|
|
141
141
|
|
|
@@ -1655,6 +1655,182 @@ bun add @intlayer/swc --dev
|
|
|
1655
1655
|
>
|
|
1656
1656
|
> Note : Si vous définissez l'option comme `importMode: 'dynamic'` ou `importMode: 'fetch'` (dans la configuration des dictionnaires), elle reposera sur Suspense, vous devrez donc envelopper vos appels `useIntlayer` dans une limite `Suspense`. Cela signifie que vous ne pourrez pas utiliser `useIntlayer` directement au niveau supérieur de votre composant Page / Layout.
|
|
1657
1657
|
|
|
1658
|
+
### (Optionnel) Étape 14 : Extraire le contenu de vos composants
|
|
1659
|
+
|
|
1660
|
+
Si vous avez une base de code existante, transformer des milliers de fichiers peut prendre beaucoup de temps.
|
|
1661
|
+
|
|
1662
|
+
Pour faciliter ce processus, Intlayer propose un [compilateur](https://github.com/aymericzip/intlayer/blob/main/docs/docs/fr/compiler.md) / [extracteur](https://github.com/aymericzip/intlayer/blob/main/docs/docs/fr/cli/extract.md) pour transformer vos composants et extraire le contenu.
|
|
1663
|
+
|
|
1664
|
+
Pour le configurer, vous pouvez ajouter une section `compiler` dans votre fichier `intlayer.config.ts` :
|
|
1665
|
+
|
|
1666
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
1667
|
+
import { type IntlayerConfig } from "intlayer";
|
|
1668
|
+
|
|
1669
|
+
const config: IntlayerConfig = {
|
|
1670
|
+
// ... Reste de votre configuration
|
|
1671
|
+
compiler: {
|
|
1672
|
+
/**
|
|
1673
|
+
* Indique si le compilateur doit être activé.
|
|
1674
|
+
*/
|
|
1675
|
+
enabled: true,
|
|
1676
|
+
|
|
1677
|
+
/**
|
|
1678
|
+
* Définit le chemin des fichiers de sortie
|
|
1679
|
+
*/
|
|
1680
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
1681
|
+
|
|
1682
|
+
/**
|
|
1683
|
+
* Indique si les composants doivent être sauvegardés après avoir été transformés.
|
|
1684
|
+
* De cette façon, le compilateur peut être exécuté une seule fois pour transformer l'application, puis il peut être supprimé.
|
|
1685
|
+
*/
|
|
1686
|
+
saveComponents: false,
|
|
1687
|
+
|
|
1688
|
+
/**
|
|
1689
|
+
* Préfixe de clé de dictionnaire
|
|
1690
|
+
*/
|
|
1691
|
+
dictionaryKeyPrefix: "",
|
|
1692
|
+
},
|
|
1693
|
+
};
|
|
1694
|
+
|
|
1695
|
+
export default config;
|
|
1696
|
+
```
|
|
1697
|
+
|
|
1698
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
1699
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
1700
|
+
const config = {
|
|
1701
|
+
// ... Reste de votre configuration
|
|
1702
|
+
compiler: {
|
|
1703
|
+
/**
|
|
1704
|
+
* Indique si le compilateur doit être activé.
|
|
1705
|
+
*/
|
|
1706
|
+
enabled: true,
|
|
1707
|
+
|
|
1708
|
+
/**
|
|
1709
|
+
* Définit le chemin des fichiers de sortie
|
|
1710
|
+
*/
|
|
1711
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
1712
|
+
|
|
1713
|
+
/**
|
|
1714
|
+
* Indique si les composants doivent être sauvegardés après avoir été transformés.
|
|
1715
|
+
* De cette façon, le compilateur peut être exécuté une seule fois pour transformer l'application, puis il peut être supprimé.
|
|
1716
|
+
*/
|
|
1717
|
+
saveComponents: false,
|
|
1718
|
+
|
|
1719
|
+
/**
|
|
1720
|
+
* Préfixe de clé de dictionnaire
|
|
1721
|
+
*/
|
|
1722
|
+
dictionaryKeyPrefix: "",
|
|
1723
|
+
},
|
|
1724
|
+
};
|
|
1725
|
+
|
|
1726
|
+
export default config;
|
|
1727
|
+
```
|
|
1728
|
+
|
|
1729
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
1730
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
1731
|
+
const config = {
|
|
1732
|
+
// ... Reste de votre configuration
|
|
1733
|
+
compiler: {
|
|
1734
|
+
/**
|
|
1735
|
+
* Indique si le compilateur doit être activé.
|
|
1736
|
+
*/
|
|
1737
|
+
enabled: true,
|
|
1738
|
+
|
|
1739
|
+
/**
|
|
1740
|
+
* Définit le chemin des fichiers de sortie
|
|
1741
|
+
*/
|
|
1742
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
1743
|
+
|
|
1744
|
+
/**
|
|
1745
|
+
* Indique si les composants doivent être sauvegardés après avoir été transformés.
|
|
1746
|
+
* De cette façon, le compilateur peut être exécuté une seule fois pour transformer l'application, puis il peut être supprimé.
|
|
1747
|
+
*/
|
|
1748
|
+
saveComponents: false,
|
|
1749
|
+
|
|
1750
|
+
/**
|
|
1751
|
+
* Préfixe de clé de dictionnaire
|
|
1752
|
+
*/
|
|
1753
|
+
dictionaryKeyPrefix: "",
|
|
1754
|
+
},
|
|
1755
|
+
};
|
|
1756
|
+
|
|
1757
|
+
module.exports = config;
|
|
1758
|
+
```
|
|
1759
|
+
|
|
1760
|
+
<Tabs>
|
|
1761
|
+
<Tab value='Commande d'extraction'>
|
|
1762
|
+
|
|
1763
|
+
Exécutez l'extracteur pour transformer vos composants et extraire le contenu
|
|
1764
|
+
|
|
1765
|
+
```bash packageManager="npm"
|
|
1766
|
+
npx intlayer extract
|
|
1767
|
+
```
|
|
1768
|
+
|
|
1769
|
+
```bash packageManager="pnpm"
|
|
1770
|
+
pnpm intlayer extract
|
|
1771
|
+
```
|
|
1772
|
+
|
|
1773
|
+
```bash packageManager="yarn"
|
|
1774
|
+
yarn intlayer extract
|
|
1775
|
+
```
|
|
1776
|
+
|
|
1777
|
+
```bash packageManager="bun"
|
|
1778
|
+
bunx intlayer extract
|
|
1779
|
+
```
|
|
1780
|
+
|
|
1781
|
+
</Tab>
|
|
1782
|
+
<Tab value='Compilateur Babel'>
|
|
1783
|
+
|
|
1784
|
+
```bash packageManager="npm"
|
|
1785
|
+
npm install @intlayer/babel --save-dev
|
|
1786
|
+
```
|
|
1787
|
+
|
|
1788
|
+
```bash packageManager="pnpm"
|
|
1789
|
+
pnpm add @intlayer/babel --save-dev
|
|
1790
|
+
```
|
|
1791
|
+
|
|
1792
|
+
```bash packageManager="yarn"
|
|
1793
|
+
yarn add @intlayer/babel --save-dev
|
|
1794
|
+
```
|
|
1795
|
+
|
|
1796
|
+
```bash packageManager="bun"
|
|
1797
|
+
bun add @intlayer/babel --dev
|
|
1798
|
+
```
|
|
1799
|
+
|
|
1800
|
+
```js fileName="babel.config.js"
|
|
1801
|
+
const {
|
|
1802
|
+
intlayerExtractBabelPlugin,
|
|
1803
|
+
getExtractPluginOptions,
|
|
1804
|
+
} = require("@intlayer/babel");
|
|
1805
|
+
|
|
1806
|
+
module.exports = {
|
|
1807
|
+
presets: ["next/babel"],
|
|
1808
|
+
plugins: [
|
|
1809
|
+
// Extraire le contenu des composants dans les dictionnaires
|
|
1810
|
+
[intlayerExtractBabelPlugin, getExtractPluginOptions()],
|
|
1811
|
+
],
|
|
1812
|
+
};
|
|
1813
|
+
```
|
|
1814
|
+
|
|
1815
|
+
```bash packageManager="npm"
|
|
1816
|
+
npm run build # Ou npm run dev
|
|
1817
|
+
```
|
|
1818
|
+
|
|
1819
|
+
```bash packageManager="pnpm"
|
|
1820
|
+
pnpm run build # Ou pnpm run dev
|
|
1821
|
+
```
|
|
1822
|
+
|
|
1823
|
+
```bash packageManager="yarn"
|
|
1824
|
+
yarn build # Ou yarn dev
|
|
1825
|
+
```
|
|
1826
|
+
|
|
1827
|
+
```bash packageManager="bun"
|
|
1828
|
+
bun run build # Or bun run dev
|
|
1829
|
+
```
|
|
1830
|
+
|
|
1831
|
+
</Tab>
|
|
1832
|
+
</Tabs>
|
|
1833
|
+
|
|
1658
1834
|
### Surveiller les modifications des dictionnaires avec Turbopack
|
|
1659
1835
|
|
|
1660
1836
|
Lorsque vous utilisez Turbopack comme serveur de développement avec la commande `next dev`, les modifications des dictionnaires ne sont pas détectées automatiquement par défaut.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2026-01-10
|
|
3
|
-
updatedAt: 2026-
|
|
3
|
+
updatedAt: 2026-03-12
|
|
4
4
|
title: Next.js i18n - Transformer une application Next.js existante en une application multilingue en 2026
|
|
5
5
|
description: Découvrez comment rendre votre application Next.js existante multilingue avec le compilateur Intlayer. Suivez la documentation pour internationaliser (i18n) et la traduire avec l'IA.
|
|
6
6
|
keywords:
|
|
@@ -346,7 +346,7 @@ export default async function Page() {
|
|
|
346
346
|
- **`IntlayerClientProvider`** est utilisé pour fournir la locale aux composants côté client.
|
|
347
347
|
- **`IntlayerServerProvider`** est utilisé pour fournir la locale aux enfants serveurs.
|
|
348
348
|
|
|
349
|
-
>
|
|
349
|
+
> Le layout et la page ne peuvent pas partager un contexte serveur commun car le système de contexte serveur est basé sur un magasin de données par requête (via le mécanisme de [cache de React](https://react.dev/reference/react/cache)), ce qui entraîne la recréation de chaque « contexte » pour différents segments de l'application. Placer le fournisseur dans un layout partagé briserait cette isolation, empêchant la propagation correcte des valeurs du contexte serveur vers vos composants serveur.
|
|
350
350
|
|
|
351
351
|
### (Optionnel) Étape 7 : Remplir les traductions manquantes
|
|
352
352
|
|
|
@@ -455,6 +455,182 @@ bun add @intlayer/swc --dev
|
|
|
455
455
|
|
|
456
456
|
> Note : Si vous définissez l'option comme `importMode: 'dynamic'` ou `importMode: 'fetch'` (dans la configuration de `dictionary`), elle s'appuiera sur Suspense, de sorte que vous devrez envelopper vos appels à `useIntlayer` dans une frontière `Suspense`. Cela signifie que vous ne pourrez pas utiliser `useIntlayer` directement au niveau le plus haut de votre composant Page / Layout.
|
|
457
457
|
|
|
458
|
+
### (Optionnel) Étape 11 : Extraire le contenu de vos composants
|
|
459
|
+
|
|
460
|
+
Si vous avez une base de code existante, transformer des milliers de fichiers peut prendre beaucoup de temps.
|
|
461
|
+
|
|
462
|
+
Pour faciliter ce processus, Intlayer propose un [compilateur](https://github.com/aymericzip/intlayer/blob/main/docs/docs/fr/compiler.md) / [extracteur](https://github.com/aymericzip/intlayer/blob/main/docs/docs/fr/cli/extract.md) pour transformer vos composants et extraire le contenu.
|
|
463
|
+
|
|
464
|
+
Pour le configurer, vous pouvez ajouter une section `compiler` dans votre fichier `intlayer.config.ts` :
|
|
465
|
+
|
|
466
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
467
|
+
import { type IntlayerConfig } from "intlayer";
|
|
468
|
+
|
|
469
|
+
const config: IntlayerConfig = {
|
|
470
|
+
// ... Reste de votre configuration
|
|
471
|
+
compiler: {
|
|
472
|
+
/**
|
|
473
|
+
* Indique si le compilateur doit être activé.
|
|
474
|
+
*/
|
|
475
|
+
enabled: true,
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Définit le chemin des fichiers de sortie
|
|
479
|
+
*/
|
|
480
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* Indique si les composants doivent être sauvegardés après avoir été transformés.
|
|
484
|
+
* De cette façon, le compilateur peut être exécuté une seule fois pour transformer l'application, puis il peut être supprimé.
|
|
485
|
+
*/
|
|
486
|
+
saveComponents: false,
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Préfixe de clé de dictionnaire
|
|
490
|
+
*/
|
|
491
|
+
dictionaryKeyPrefix: "",
|
|
492
|
+
},
|
|
493
|
+
};
|
|
494
|
+
|
|
495
|
+
export default config;
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
499
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
500
|
+
const config = {
|
|
501
|
+
// ... Reste de votre configuration
|
|
502
|
+
compiler: {
|
|
503
|
+
/**
|
|
504
|
+
* Indique si le compilateur doit être activé.
|
|
505
|
+
*/
|
|
506
|
+
enabled: true,
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* Définit le chemin des fichiers de sortie
|
|
510
|
+
*/
|
|
511
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* Indique si les composants doivent être sauvegardés après avoir été transformés.
|
|
515
|
+
* De cette façon, le compilateur peut être exécuté une seule fois pour transformer l'application, puis il peut être supprimé.
|
|
516
|
+
*/
|
|
517
|
+
saveComponents: false,
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Préfixe de clé de dictionnaire
|
|
521
|
+
*/
|
|
522
|
+
dictionaryKeyPrefix: "",
|
|
523
|
+
},
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
export default config;
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
530
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
531
|
+
const config = {
|
|
532
|
+
// ... Reste de votre configuration
|
|
533
|
+
compiler: {
|
|
534
|
+
/**
|
|
535
|
+
* Indique si le compilateur doit être activé.
|
|
536
|
+
*/
|
|
537
|
+
enabled: true,
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Définit le chemin des fichiers de sortie
|
|
541
|
+
*/
|
|
542
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* Indique si les composants doivent être sauvegardés après avoir été transformés.
|
|
546
|
+
* De cette façon, le compilateur peut être exécuté une seule fois pour transformer l'application, puis il peut être supprimé.
|
|
547
|
+
*/
|
|
548
|
+
saveComponents: false,
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* Préfixe de clé de dictionnaire
|
|
552
|
+
*/
|
|
553
|
+
dictionaryKeyPrefix: "",
|
|
554
|
+
},
|
|
555
|
+
};
|
|
556
|
+
|
|
557
|
+
module.exports = config;
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
<Tabs>
|
|
561
|
+
<Tab value='Commande d'extraction'>
|
|
562
|
+
|
|
563
|
+
Exécutez l'extracteur pour transformer vos composants et extraire le contenu
|
|
564
|
+
|
|
565
|
+
```bash packageManager="npm"
|
|
566
|
+
npx intlayer extract
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
```bash packageManager="pnpm"
|
|
570
|
+
pnpm intlayer extract
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
```bash packageManager="yarn"
|
|
574
|
+
yarn intlayer extract
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
```bash packageManager="bun"
|
|
578
|
+
bunx intlayer extract
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
</Tab>
|
|
582
|
+
<Tab value='Compilateur Babel'>
|
|
583
|
+
|
|
584
|
+
```bash packageManager="npm"
|
|
585
|
+
npm install @intlayer/babel --save-dev
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
```bash packageManager="pnpm"
|
|
589
|
+
pnpm add @intlayer/babel --save-dev
|
|
590
|
+
```
|
|
591
|
+
|
|
592
|
+
```bash packageManager="yarn"
|
|
593
|
+
yarn add @intlayer/babel --save-dev
|
|
594
|
+
```
|
|
595
|
+
|
|
596
|
+
```bash packageManager="bun"
|
|
597
|
+
bun add @intlayer/babel --dev
|
|
598
|
+
```
|
|
599
|
+
|
|
600
|
+
```js fileName="babel.config.js"
|
|
601
|
+
const {
|
|
602
|
+
intlayerExtractBabelPlugin,
|
|
603
|
+
getExtractPluginOptions,
|
|
604
|
+
} = require("@intlayer/babel");
|
|
605
|
+
|
|
606
|
+
module.exports = {
|
|
607
|
+
presets: ["next/babel"],
|
|
608
|
+
plugins: [
|
|
609
|
+
// Extraire le contenu des composants dans les dictionnaires
|
|
610
|
+
[intlayerExtractBabelPlugin, getExtractPluginOptions()],
|
|
611
|
+
],
|
|
612
|
+
};
|
|
613
|
+
```
|
|
614
|
+
|
|
615
|
+
```bash packageManager="npm"
|
|
616
|
+
npm run build # Ou npm run dev
|
|
617
|
+
```
|
|
618
|
+
|
|
619
|
+
```bash packageManager="pnpm"
|
|
620
|
+
pnpm run build # Ou pnpm run dev
|
|
621
|
+
```
|
|
622
|
+
|
|
623
|
+
```bash packageManager="yarn"
|
|
624
|
+
yarn build # Ou yarn dev
|
|
625
|
+
```
|
|
626
|
+
|
|
627
|
+
```bash packageManager="bun"
|
|
628
|
+
bun run build # Ou bun run dev
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
</Tab>
|
|
632
|
+
</Tabs>
|
|
633
|
+
|
|
458
634
|
### Configurer TypeScript
|
|
459
635
|
|
|
460
636
|
Intlayer utilise l'augmentation de module pour tirer parti des avantages de TypeScript et renforcer votre base de code.
|
|
@@ -482,7 +658,7 @@ Il est recommandé d'ignorer les fichiers générés par Intlayer. Cela vous per
|
|
|
482
658
|
Pour ce faire, vous pouvez ajouter les instructions suivantes à votre fichier `.gitignore` :
|
|
483
659
|
|
|
484
660
|
```plaintext fileName=".gitignore"
|
|
485
|
-
# Ignorer les fichiers générés
|
|
661
|
+
# Ignorer les fichiers générés par Intlayer
|
|
486
662
|
.intlayer
|
|
487
663
|
```
|
|
488
664
|
|