@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-11-20
|
|
3
|
-
updatedAt:
|
|
3
|
+
updatedAt: 2026-03-12
|
|
4
4
|
title: SvelteKit i18n - Comment traduire une application SvelteKit en 2026
|
|
5
5
|
description: Découvrez comment rendre votre site SvelteKit multilingue. Suivez la documentation pour internationaliser (i18n) et traduire votre site en utilisant le Server-Side Rendering (SSR).
|
|
6
6
|
keywords:
|
|
@@ -185,7 +185,7 @@ Vous pouvez maintenant utiliser la fonction `useIntlayer` dans n'importe quel co
|
|
|
185
185
|
|
|
186
186
|
> **Note :** `useIntlayer` retourne un store Svelte, vous devez donc utiliser le préfixe `---
|
|
187
187
|
> createdAt: 2025-11-20
|
|
188
|
-
> updatedAt:
|
|
188
|
+
> updatedAt: 2026-03-12
|
|
189
189
|
> title: Comment traduire votre application SvelteKit in i18n 2026
|
|
190
190
|
> description: Découvrez comment rendre votre site SvelteKit multilingue. Suivez la documentation pour internationaliser (i18n) et traduire votre site en utilisant le Server-Side Rendering (SSR).
|
|
191
191
|
> keywords:
|
|
@@ -733,6 +733,162 @@ Pour pouvoir visualiser le sélecteur de l'éditeur intlayer, vous devrez utilis
|
|
|
733
733
|
</div>
|
|
734
734
|
```
|
|
735
735
|
|
|
736
|
+
### (Optionnel) Étape 12 : Extraire le contenu de vos composants
|
|
737
|
+
|
|
738
|
+
Si vous avez une base de code existante, transformer des milliers de fichiers peut prendre beaucoup de temps.
|
|
739
|
+
|
|
740
|
+
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.
|
|
741
|
+
|
|
742
|
+
Pour le configurer, vous pouvez ajouter une section `compiler` dans votre fichier `intlayer.config.ts` :
|
|
743
|
+
|
|
744
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
745
|
+
import { type IntlayerConfig } from "intlayer";
|
|
746
|
+
|
|
747
|
+
const config: IntlayerConfig = {
|
|
748
|
+
// ... Reste de votre configuration
|
|
749
|
+
compiler: {
|
|
750
|
+
/**
|
|
751
|
+
* Indique si le compilateur doit être activé.
|
|
752
|
+
*/
|
|
753
|
+
enabled: true,
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* Définit le chemin des fichiers de sortie
|
|
757
|
+
*/
|
|
758
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* Indique si les composants doivent être sauvegardés après avoir été transformés. De cette façon, le compilateur peut être exécuté une seule fois pour transformer l'application, puis il peut être supprimé.
|
|
762
|
+
*/
|
|
763
|
+
saveComponents: false,
|
|
764
|
+
|
|
765
|
+
/**
|
|
766
|
+
* Préfixe de clé de dictionnaire
|
|
767
|
+
*/
|
|
768
|
+
dictionaryKeyPrefix: "",
|
|
769
|
+
},
|
|
770
|
+
};
|
|
771
|
+
|
|
772
|
+
export default config;
|
|
773
|
+
```
|
|
774
|
+
|
|
775
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
776
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
777
|
+
const config = {
|
|
778
|
+
// ... Reste de votre configuration
|
|
779
|
+
compiler: {
|
|
780
|
+
/**
|
|
781
|
+
* Indique si le compilateur doit être activé.
|
|
782
|
+
*/
|
|
783
|
+
enabled: true,
|
|
784
|
+
|
|
785
|
+
/**
|
|
786
|
+
* Définit le chemin des fichiers de sortie
|
|
787
|
+
*/
|
|
788
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* Indique si les composants doivent être sauvegardés après avoir été transformés. De cette façon, le compilateur peut être exécuté une seule fois pour transformer l'application, puis il peut être supprimé.
|
|
792
|
+
*/
|
|
793
|
+
saveComponents: false,
|
|
794
|
+
|
|
795
|
+
/**
|
|
796
|
+
* Préfixe de clé de dictionnaire
|
|
797
|
+
*/
|
|
798
|
+
dictionaryKeyPrefix: "",
|
|
799
|
+
},
|
|
800
|
+
};
|
|
801
|
+
|
|
802
|
+
export default config;
|
|
803
|
+
```
|
|
804
|
+
|
|
805
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
806
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
807
|
+
const config = {
|
|
808
|
+
// ... Reste de votre configuration
|
|
809
|
+
compiler: {
|
|
810
|
+
/**
|
|
811
|
+
* Indique si le compilateur doit être activé.
|
|
812
|
+
*/
|
|
813
|
+
enabled: true,
|
|
814
|
+
|
|
815
|
+
/**
|
|
816
|
+
* Définit le chemin des fichiers de sortie
|
|
817
|
+
*/
|
|
818
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
819
|
+
|
|
820
|
+
/**
|
|
821
|
+
* Indique si les composants doivent être sauvegardés après avoir été transformés. De cette façon, le compilateur peut être exécuté une seule fois pour transformer l'application, puis il peut être supprimé.
|
|
822
|
+
*/
|
|
823
|
+
saveComponents: false,
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* Préfixe de clé de dictionnaire
|
|
827
|
+
*/
|
|
828
|
+
dictionaryKeyPrefix: "",
|
|
829
|
+
},
|
|
830
|
+
};
|
|
831
|
+
|
|
832
|
+
module.exports = config;
|
|
833
|
+
```
|
|
834
|
+
|
|
835
|
+
<Tabs>
|
|
836
|
+
<Tab value='Commande d'extraction'>
|
|
837
|
+
|
|
838
|
+
Exécutez l'extracteur pour transformer vos composants et extraire le contenu
|
|
839
|
+
|
|
840
|
+
```bash packageManager="npm"
|
|
841
|
+
npx intlayer extract
|
|
842
|
+
```
|
|
843
|
+
|
|
844
|
+
```bash packageManager="pnpm"
|
|
845
|
+
pnpm intlayer extract
|
|
846
|
+
```
|
|
847
|
+
|
|
848
|
+
```bash packageManager="yarn"
|
|
849
|
+
yarn intlayer extract
|
|
850
|
+
```
|
|
851
|
+
|
|
852
|
+
```bash packageManager="bun"
|
|
853
|
+
bunx intlayer extract
|
|
854
|
+
```
|
|
855
|
+
|
|
856
|
+
</Tab>
|
|
857
|
+
<Tab value='Compilateur Babel'>
|
|
858
|
+
|
|
859
|
+
Mettez à jour votre fichier `vite.config.ts` pour inclure le plugin `intlayerCompiler` :
|
|
860
|
+
|
|
861
|
+
```ts fileName="vite.config.ts"
|
|
862
|
+
import { defineConfig } from "vite";
|
|
863
|
+
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
864
|
+
|
|
865
|
+
export default defineConfig({
|
|
866
|
+
plugins: [
|
|
867
|
+
intlayer(),
|
|
868
|
+
intlayerCompiler(), // Ajoute le plugin du compilateur
|
|
869
|
+
],
|
|
870
|
+
});
|
|
871
|
+
```
|
|
872
|
+
|
|
873
|
+
```bash packageManager="npm"
|
|
874
|
+
npm run build # Ou npm run dev
|
|
875
|
+
```
|
|
876
|
+
|
|
877
|
+
```bash packageManager="pnpm"
|
|
878
|
+
pnpm run build # Ou pnpm run dev
|
|
879
|
+
```
|
|
880
|
+
|
|
881
|
+
```bash packageManager="yarn"
|
|
882
|
+
yarn build # Ou yarn dev
|
|
883
|
+
```
|
|
884
|
+
|
|
885
|
+
```bash packageManager="bun"
|
|
886
|
+
bun run build # Or bun run dev
|
|
887
|
+
```
|
|
888
|
+
|
|
889
|
+
</Tab>
|
|
890
|
+
</Tabs>
|
|
891
|
+
|
|
736
892
|
### Configuration Git
|
|
737
893
|
|
|
738
894
|
Il est recommandé d'ignorer les fichiers générés par Intlayer.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-09-09
|
|
3
|
-
updatedAt:
|
|
3
|
+
updatedAt: 2026-03-12
|
|
4
4
|
title: Tanstack Start i18n - Comment traduire une application Tanstack Start en 2026
|
|
5
5
|
description: Apprenez à ajouter l'internationalisation (i18n) à votre application Tanstack Start en utilisant Intlayer. Suivez ce guide complet pour rendre votre application multilingue avec un routage tenant compte de la locale.
|
|
6
6
|
keywords:
|
|
@@ -773,6 +773,164 @@ Assurez-vous que votre configuration TypeScript inclut les types autogénérés
|
|
|
773
773
|
|
|
774
774
|
---
|
|
775
775
|
|
|
776
|
+
### (Optionnel) Étape 16 : Extraire le contenu de vos composants
|
|
777
|
+
|
|
778
|
+
Si vous avez une base de code existante, transformer des milliers de fichiers peut prendre beaucoup de temps.
|
|
779
|
+
|
|
780
|
+
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.
|
|
781
|
+
|
|
782
|
+
Pour le configurer, vous pouvez ajouter une section `compiler` dans votre fichier `intlayer.config.ts` :
|
|
783
|
+
|
|
784
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
785
|
+
import { type IntlayerConfig } from "intlayer";
|
|
786
|
+
|
|
787
|
+
const config: IntlayerConfig = {
|
|
788
|
+
// ... Reste de votre configuration
|
|
789
|
+
compiler: {
|
|
790
|
+
/**
|
|
791
|
+
* Indique si le compilateur doit être activé.
|
|
792
|
+
*/
|
|
793
|
+
enabled: true,
|
|
794
|
+
|
|
795
|
+
/**
|
|
796
|
+
* Définit le chemin des fichiers de sortie
|
|
797
|
+
*/
|
|
798
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
799
|
+
|
|
800
|
+
/**
|
|
801
|
+
* Indique si les composants doivent être sauvegardés après avoir été transformés. De cette façon, le compilateur peut être exécuté une seule fois pour transformer l'application, puis il peut être supprimé.
|
|
802
|
+
*/
|
|
803
|
+
saveComponents: false,
|
|
804
|
+
|
|
805
|
+
/**
|
|
806
|
+
* Préfixe de clé de dictionnaire
|
|
807
|
+
*/
|
|
808
|
+
dictionaryKeyPrefix: "",
|
|
809
|
+
},
|
|
810
|
+
};
|
|
811
|
+
|
|
812
|
+
export default config;
|
|
813
|
+
```
|
|
814
|
+
|
|
815
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
816
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
817
|
+
const config = {
|
|
818
|
+
// ... Reste de votre configuration
|
|
819
|
+
compiler: {
|
|
820
|
+
/**
|
|
821
|
+
* Indique si le compilateur doit être activé.
|
|
822
|
+
*/
|
|
823
|
+
enabled: true,
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* Définit le chemin des fichiers de sortie
|
|
827
|
+
*/
|
|
828
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
829
|
+
|
|
830
|
+
/**
|
|
831
|
+
* Indique si les composants doivent être sauvegardés après avoir été transformés. De cette façon, le compilateur peut être exécuté une seule fois pour transformer l'application, puis il peut être supprimé.
|
|
832
|
+
*/
|
|
833
|
+
saveComponents: false,
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* Préfixe de clé de dictionnaire
|
|
837
|
+
*/
|
|
838
|
+
dictionaryKeyPrefix: "",
|
|
839
|
+
},
|
|
840
|
+
};
|
|
841
|
+
|
|
842
|
+
export default config;
|
|
843
|
+
```
|
|
844
|
+
|
|
845
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
846
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
847
|
+
const config = {
|
|
848
|
+
// ... Reste de votre configuration
|
|
849
|
+
compiler: {
|
|
850
|
+
/**
|
|
851
|
+
* Indique si le compilateur doit être activé.
|
|
852
|
+
*/
|
|
853
|
+
enabled: true,
|
|
854
|
+
|
|
855
|
+
/**
|
|
856
|
+
* Définit le chemin des fichiers de sortie
|
|
857
|
+
*/
|
|
858
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
859
|
+
|
|
860
|
+
/**
|
|
861
|
+
* Indique si les composants doivent être sauvegardés après avoir été transformés. De cette façon, le compilateur peut être exécuté une seule fois pour transformer l'application, puis il peut être supprimé.
|
|
862
|
+
*/
|
|
863
|
+
saveComponents: false,
|
|
864
|
+
|
|
865
|
+
/**
|
|
866
|
+
* Préfixe de clé de dictionnaire
|
|
867
|
+
*/
|
|
868
|
+
dictionaryKeyPrefix: "",
|
|
869
|
+
},
|
|
870
|
+
};
|
|
871
|
+
|
|
872
|
+
module.exports = config;
|
|
873
|
+
```
|
|
874
|
+
|
|
875
|
+
<Tabs>
|
|
876
|
+
<Tab value='Commande d'extraction'>
|
|
877
|
+
|
|
878
|
+
Exécutez l'extracteur pour transformer vos composants et extraire le contenu
|
|
879
|
+
|
|
880
|
+
```bash packageManager="npm"
|
|
881
|
+
npx intlayer extract
|
|
882
|
+
```
|
|
883
|
+
|
|
884
|
+
```bash packageManager="pnpm"
|
|
885
|
+
pnpm intlayer extract
|
|
886
|
+
```
|
|
887
|
+
|
|
888
|
+
```bash packageManager="yarn"
|
|
889
|
+
yarn intlayer extract
|
|
890
|
+
```
|
|
891
|
+
|
|
892
|
+
```bash packageManager="bun"
|
|
893
|
+
bunx intlayer extract
|
|
894
|
+
```
|
|
895
|
+
|
|
896
|
+
</Tab>
|
|
897
|
+
<Tab value='Compilateur Babel'>
|
|
898
|
+
|
|
899
|
+
Mettez à jour votre fichier `vite.config.ts` pour inclure le plugin `intlayerCompiler` :
|
|
900
|
+
|
|
901
|
+
```ts fileName="vite.config.ts"
|
|
902
|
+
import { defineConfig } from "vite";
|
|
903
|
+
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
904
|
+
|
|
905
|
+
export default defineConfig({
|
|
906
|
+
plugins: [
|
|
907
|
+
intlayer(),
|
|
908
|
+
intlayerCompiler(), // Ajoute le plugin du compilateur
|
|
909
|
+
],
|
|
910
|
+
});
|
|
911
|
+
```
|
|
912
|
+
|
|
913
|
+
```bash packageManager="npm"
|
|
914
|
+
npm run build # Ou npm run dev
|
|
915
|
+
```
|
|
916
|
+
|
|
917
|
+
```bash packageManager="pnpm"
|
|
918
|
+
pnpm run build # Ou pnpm run dev
|
|
919
|
+
```
|
|
920
|
+
|
|
921
|
+
```bash packageManager="yarn"
|
|
922
|
+
yarn build # Ou yarn dev
|
|
923
|
+
```
|
|
924
|
+
|
|
925
|
+
```bash packageManager="bun"
|
|
926
|
+
bun run build # Or bun run dev
|
|
927
|
+
```
|
|
928
|
+
|
|
929
|
+
</Tab>
|
|
930
|
+
</Tabs>
|
|
931
|
+
|
|
932
|
+
---
|
|
933
|
+
|
|
776
934
|
### Configuration Git
|
|
777
935
|
|
|
778
936
|
Il est recommandé d'ignorer les fichiers générés par Intlayer. Cela vous permet d'éviter de les committer dans votre dépôt Git.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-04-18
|
|
3
|
-
updatedAt:
|
|
3
|
+
updatedAt: 2026-03-12
|
|
4
4
|
title: Vite + Preact i18n - Comment traduire une application Preact en 2026
|
|
5
5
|
description: Découvrez comment rendre votre site Vite et Preact multilingue. Suivez la documentation pour internationaliser (i18n) et traduire votre site.
|
|
6
6
|
keywords:
|
|
@@ -24,12 +24,12 @@ history:
|
|
|
24
24
|
changes: Historique initial
|
|
25
25
|
---
|
|
26
26
|
|
|
27
|
-
# Traduire votre Vite
|
|
27
|
+
# Traduire votre Vite et Preact avec Intlayer | Internationalisation (i18n)
|
|
28
28
|
|
|
29
29
|
<Tabs defaultTab="video">
|
|
30
|
-
<Tab label="
|
|
30
|
+
<Tab label="Vidéo" value="video">
|
|
31
31
|
|
|
32
|
-
<iframe title="The best i18n solution for Vite
|
|
32
|
+
<iframe title="The best i18n solution for Vite et Preact? Discover 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/dS9L7uJeak4?si=VaKmrYMmXjo3xpk2"/>
|
|
33
33
|
|
|
34
34
|
</Tab>
|
|
35
35
|
<Tab label="Code" value="code">
|
|
@@ -37,7 +37,7 @@ history:
|
|
|
37
37
|
<iframe
|
|
38
38
|
src="https://stackblitz.com/github/aymericzip/intlayer-vite-preact-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
39
39
|
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
40
|
-
title="
|
|
40
|
+
title="Démo CodeSandbox - Comment internationaliser votre application avec Intlayer"
|
|
41
41
|
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
42
42
|
loading="lazy"
|
|
43
43
|
/>
|
|
@@ -308,7 +308,7 @@ const appContent = {
|
|
|
308
308
|
}),
|
|
309
309
|
|
|
310
310
|
readTheDocs: t({
|
|
311
|
-
en: "Click on the Vite
|
|
311
|
+
en: "Click on the Vite et Preact logos to learn more",
|
|
312
312
|
fr: "Cliquez sur les logos Vite et Preact pour en savoir plus",
|
|
313
313
|
es: "Haga clic en los logotipos de Vite et Preact pour obtenir plus d'informations",
|
|
314
314
|
}),
|
|
@@ -352,7 +352,7 @@ const appContent = {
|
|
|
352
352
|
}),
|
|
353
353
|
|
|
354
354
|
readTheDocs: t({
|
|
355
|
-
en: "Click on the Vite
|
|
355
|
+
en: "Click on the Vite et Preact logos to learn more",
|
|
356
356
|
fr: "Cliquez sur les logos Vite et Preact pour en savoir plus",
|
|
357
357
|
es: "Haga clic en los logotipos de Vite et Preact pour en savoir plus",
|
|
358
358
|
}),
|
|
@@ -410,7 +410,7 @@ module.exports = appContent;
|
|
|
410
410
|
"readTheDocs": {
|
|
411
411
|
"nodeType": "translation",
|
|
412
412
|
"translation": {
|
|
413
|
-
"en": "Click on the Vite
|
|
413
|
+
"en": "Click on the Vite et Preact logos to learn more",
|
|
414
414
|
"fr": "Cliquez sur les logos Vite et Preact pour en savoir plus",
|
|
415
415
|
"es": "Haga clic en los logotipos de Vite y Preact para obtenir plus d'informations"
|
|
416
416
|
}
|
|
@@ -1301,6 +1301,162 @@ return (
|
|
|
1301
1301
|
);
|
|
1302
1302
|
```
|
|
1303
1303
|
|
|
1304
|
+
### (Optionnel) Étape 12 : Extraire le contenu de vos composants
|
|
1305
|
+
|
|
1306
|
+
Si vous avez une base de code existante, transformer des milliers de fichiers peut prendre beaucoup de temps.
|
|
1307
|
+
|
|
1308
|
+
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.
|
|
1309
|
+
|
|
1310
|
+
Pour le configurer, vous pouvez ajouter une section `compiler` dans votre fichier `intlayer.config.ts` :
|
|
1311
|
+
|
|
1312
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
1313
|
+
import { type IntlayerConfig } from "intlayer";
|
|
1314
|
+
|
|
1315
|
+
const config: IntlayerConfig = {
|
|
1316
|
+
// ... Reste de votre configuration
|
|
1317
|
+
compiler: {
|
|
1318
|
+
/**
|
|
1319
|
+
* Indique si le compilateur doit être activé.
|
|
1320
|
+
*/
|
|
1321
|
+
enabled: true,
|
|
1322
|
+
|
|
1323
|
+
/**
|
|
1324
|
+
* Définit le chemin des fichiers de sortie
|
|
1325
|
+
*/
|
|
1326
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
1327
|
+
|
|
1328
|
+
/**
|
|
1329
|
+
* Indique si les composants doivent être sauvegardés après avoir été transformés. De cette façon, le compilateur peut être exécuté une seule fois pour transformer l'application, puis il peut être supprimé.
|
|
1330
|
+
*/
|
|
1331
|
+
saveComponents: false,
|
|
1332
|
+
|
|
1333
|
+
/**
|
|
1334
|
+
* Préfixe de clé de dictionnaire
|
|
1335
|
+
*/
|
|
1336
|
+
dictionaryKeyPrefix: "",
|
|
1337
|
+
},
|
|
1338
|
+
};
|
|
1339
|
+
|
|
1340
|
+
export default config;
|
|
1341
|
+
```
|
|
1342
|
+
|
|
1343
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
1344
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
1345
|
+
const config = {
|
|
1346
|
+
// ... Reste de votre configuration
|
|
1347
|
+
compiler: {
|
|
1348
|
+
/**
|
|
1349
|
+
* Indique si le compilateur doit être activé.
|
|
1350
|
+
*/
|
|
1351
|
+
enabled: true,
|
|
1352
|
+
|
|
1353
|
+
/**
|
|
1354
|
+
* Définit le chemin des fichiers de sortie
|
|
1355
|
+
*/
|
|
1356
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
1357
|
+
|
|
1358
|
+
/**
|
|
1359
|
+
* Indique si les composants doivent être sauvegardés après avoir été transformés. De cette façon, le compilateur peut être exécuté une seule fois pour transformer l'application, puis il peut être supprimé.
|
|
1360
|
+
*/
|
|
1361
|
+
saveComponents: false,
|
|
1362
|
+
|
|
1363
|
+
/**
|
|
1364
|
+
* Préfixe de clé de dictionnaire
|
|
1365
|
+
*/
|
|
1366
|
+
dictionaryKeyPrefix: "",
|
|
1367
|
+
},
|
|
1368
|
+
};
|
|
1369
|
+
|
|
1370
|
+
export default config;
|
|
1371
|
+
```
|
|
1372
|
+
|
|
1373
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
1374
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
1375
|
+
const config = {
|
|
1376
|
+
// ... Reste de votre configuration
|
|
1377
|
+
compiler: {
|
|
1378
|
+
/**
|
|
1379
|
+
* Indique si le compilateur doit être activé.
|
|
1380
|
+
*/
|
|
1381
|
+
enabled: true,
|
|
1382
|
+
|
|
1383
|
+
/**
|
|
1384
|
+
* Définit le chemin des fichiers de sortie
|
|
1385
|
+
*/
|
|
1386
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
1387
|
+
|
|
1388
|
+
/**
|
|
1389
|
+
* Indique si les composants doivent être sauvegardés après avoir été transformés. De cette façon, le compilateur peut être exécuté une seule fois pour transformer l'application, puis il peut être supprimé.
|
|
1390
|
+
*/
|
|
1391
|
+
saveComponents: false,
|
|
1392
|
+
|
|
1393
|
+
/**
|
|
1394
|
+
* Préfixe de clé de dictionnaire
|
|
1395
|
+
*/
|
|
1396
|
+
dictionaryKeyPrefix: "",
|
|
1397
|
+
},
|
|
1398
|
+
};
|
|
1399
|
+
|
|
1400
|
+
module.exports = config;
|
|
1401
|
+
```
|
|
1402
|
+
|
|
1403
|
+
<Tabs>
|
|
1404
|
+
<Tab value='Commande d'extraction'>
|
|
1405
|
+
|
|
1406
|
+
Exécutez l'extracteur pour transformer vos composants et extraire le contenu
|
|
1407
|
+
|
|
1408
|
+
```bash packageManager="npm"
|
|
1409
|
+
npx intlayer extract
|
|
1410
|
+
```
|
|
1411
|
+
|
|
1412
|
+
```bash packageManager="pnpm"
|
|
1413
|
+
pnpm intlayer extract
|
|
1414
|
+
```
|
|
1415
|
+
|
|
1416
|
+
```bash packageManager="yarn"
|
|
1417
|
+
yarn intlayer extract
|
|
1418
|
+
```
|
|
1419
|
+
|
|
1420
|
+
```bash packageManager="bun"
|
|
1421
|
+
bunx intlayer extract
|
|
1422
|
+
```
|
|
1423
|
+
|
|
1424
|
+
</Tab>
|
|
1425
|
+
<Tab value='Compilateur Babel'>
|
|
1426
|
+
|
|
1427
|
+
Mettez à jour votre fichier `vite.config.ts` pour inclure le plugin `intlayerCompiler` :
|
|
1428
|
+
|
|
1429
|
+
```ts fileName="vite.config.ts"
|
|
1430
|
+
import { defineConfig } from "vite";
|
|
1431
|
+
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
1432
|
+
|
|
1433
|
+
export default defineConfig({
|
|
1434
|
+
plugins: [
|
|
1435
|
+
intlayer(),
|
|
1436
|
+
intlayerCompiler(), // Ajoute le plugin du compilateur
|
|
1437
|
+
],
|
|
1438
|
+
});
|
|
1439
|
+
```
|
|
1440
|
+
|
|
1441
|
+
```bash packageManager="npm"
|
|
1442
|
+
npm run build # Ou npm run dev
|
|
1443
|
+
```
|
|
1444
|
+
|
|
1445
|
+
```bash packageManager="pnpm"
|
|
1446
|
+
pnpm run build # Ou pnpm run dev
|
|
1447
|
+
```
|
|
1448
|
+
|
|
1449
|
+
```bash packageManager="yarn"
|
|
1450
|
+
yarn build # Ou yarn dev
|
|
1451
|
+
```
|
|
1452
|
+
|
|
1453
|
+
```bash packageManager="bun"
|
|
1454
|
+
bun run build # Or bun run dev
|
|
1455
|
+
```
|
|
1456
|
+
|
|
1457
|
+
</Tab>
|
|
1458
|
+
</Tabs>
|
|
1459
|
+
|
|
1304
1460
|
### Configurer TypeScript
|
|
1305
1461
|
|
|
1306
1462
|
Intlayer utilise l'augmentation de module pour tirer parti de TypeScript et renforcer votre base de code.
|