@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-12-07
|
|
3
|
-
updatedAt:
|
|
3
|
+
updatedAt: 2026-03-12
|
|
4
4
|
title: React Router v7 i18n - Come tradurre un'app React Router v7 nel 2026
|
|
5
5
|
description: Scopri come aggiungere l'internazionalizzazione (i18n) alla tua applicazione React Router v7 utilizzando Intlayer con routing basato sul file system. Segui questa guida completa per rendere la tua app multilingue con il routing consapevole della localizzazione.
|
|
6
6
|
keywords:
|
|
@@ -36,7 +36,7 @@ Questa guida dimostra come integrare **Intlayer** per un'internazionalizzazione
|
|
|
36
36
|
|
|
37
37
|
Per il routing lato client, fare riferimento alla guida [Intlayer con React Router v7](https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/intlayer_with_react_router_v7.md).
|
|
38
38
|
|
|
39
|
-
##
|
|
39
|
+
## Indice
|
|
40
40
|
|
|
41
41
|
<TOC/>
|
|
42
42
|
|
|
@@ -575,6 +575,230 @@ export const useI18nHTMLAttributes = () => {
|
|
|
575
575
|
|
|
576
576
|
Questo hook è già utilizzato nel componente di layout (`root.tsx`) mostrato nel Passo 5.
|
|
577
577
|
|
|
578
|
+
### (Opzionale) Passaggio 1 : Estrarre il contenuto dei tuoi componenti
|
|
579
|
+
|
|
580
|
+
Se hai una base di codice esistente, trasformare migliaia di file può richiedere molto tempo.
|
|
581
|
+
|
|
582
|
+
Per facilitare questo processo, Intlayer propone un [compilatore](https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/compiler.md) / [estrattore](https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/cli/extract.md) per trasformare i tuoi componenti ed estrarre il contenuto.
|
|
583
|
+
|
|
584
|
+
Per configurarlo, puoi aggiungere una sezione `compiler` nel tuo file `intlayer.config.ts`:
|
|
585
|
+
|
|
586
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
587
|
+
import { type IntlayerConfig } from "intlayer";
|
|
588
|
+
|
|
589
|
+
const config: IntlayerConfig = {
|
|
590
|
+
// ... Resto della tua configurazione
|
|
591
|
+
compiler: {
|
|
592
|
+
/**
|
|
593
|
+
* Indica se il compilatore deve essere abilitato.
|
|
594
|
+
*/
|
|
595
|
+
enabled: true,
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* Definisce il percorso dei file di output
|
|
599
|
+
*/
|
|
600
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Indica se i componenti devono essere salvati dopo essere stati trasformati. In questo modo, il compilatore può essere eseguito solo una volta per trasformare l'app e poi rimosso.
|
|
604
|
+
*/
|
|
605
|
+
saveComponents: false,
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* Prefisso chiave dizionario
|
|
609
|
+
*/
|
|
610
|
+
dictionaryKeyPrefix: "",
|
|
611
|
+
},
|
|
612
|
+
};
|
|
613
|
+
|
|
614
|
+
export default config;
|
|
615
|
+
```
|
|
616
|
+
|
|
617
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
618
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
619
|
+
const config = {
|
|
620
|
+
// ... Resto della tua configurazione
|
|
621
|
+
compiler: {
|
|
622
|
+
/**
|
|
623
|
+
* Indica se il compilatore deve essere abilitato.
|
|
624
|
+
*/
|
|
625
|
+
enabled: true,
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* Definisce il percorso dei file di output
|
|
629
|
+
*/
|
|
630
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* Indica se i componenti devono essere salvati dopo essere stati trasformati. In questo modo, il compilatore può essere eseguito solo una volta per trasformare l'app e poi rimosso.
|
|
634
|
+
*/
|
|
635
|
+
saveComponents: false,
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* Prefisso chiave dizionario
|
|
639
|
+
*/
|
|
640
|
+
dictionaryKeyPrefix: "",
|
|
641
|
+
},
|
|
642
|
+
};
|
|
643
|
+
|
|
644
|
+
export default config;
|
|
645
|
+
```
|
|
646
|
+
|
|
647
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
648
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
649
|
+
const config = {
|
|
650
|
+
// ... Resto della tua configurazione
|
|
651
|
+
compiler: {
|
|
652
|
+
/**
|
|
653
|
+
* Indica se il compilatore deve essere abilitato.
|
|
654
|
+
*/
|
|
655
|
+
enabled: true,
|
|
656
|
+
|
|
657
|
+
/**
|
|
658
|
+
* Definisce il percorso dei file di output
|
|
659
|
+
*/
|
|
660
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
661
|
+
|
|
662
|
+
/**
|
|
663
|
+
* Indica se i componenti devono essere salvati dopo essere stati trasformati. In questo modo, il compilatore può essere eseguito solo una volta per trasformare l'app e poi rimosso.
|
|
664
|
+
*/
|
|
665
|
+
saveComponents: false,
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* Prefisso chiave dizionario
|
|
669
|
+
*/
|
|
670
|
+
dictionaryKeyPrefix: "",
|
|
671
|
+
},
|
|
672
|
+
};
|
|
673
|
+
|
|
674
|
+
module.exports = config;
|
|
675
|
+
```
|
|
676
|
+
|
|
677
|
+
<Tabs>
|
|
678
|
+
<Tab value='Comando di estrazione'>
|
|
679
|
+
|
|
680
|
+
Esegui l'estrattore per trasformare i tuoi componenti ed estrarre il contenuto
|
|
681
|
+
|
|
682
|
+
```bash packageManager="npm"
|
|
683
|
+
npx intlayer extract
|
|
684
|
+
```
|
|
685
|
+
|
|
686
|
+
```bash packageManager="pnpm"
|
|
687
|
+
pnpm intlayer extract
|
|
688
|
+
```
|
|
689
|
+
|
|
690
|
+
```bash packageManager="yarn"
|
|
691
|
+
yarn intlayer extract
|
|
692
|
+
```
|
|
693
|
+
|
|
694
|
+
```bash packageManager="bun"
|
|
695
|
+
bunx intlayer extract
|
|
696
|
+
```
|
|
697
|
+
|
|
698
|
+
</Tab>
|
|
699
|
+
<Tab value='Compilatore Babel'>
|
|
700
|
+
|
|
701
|
+
Aggiorna il tuo `vite.config.ts` per includere il plugin `intlayerCompiler`:
|
|
702
|
+
|
|
703
|
+
```ts fileName="vite.config.ts"
|
|
704
|
+
import { defineConfig } from "vite";
|
|
705
|
+
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
706
|
+
|
|
707
|
+
export default defineConfig({
|
|
708
|
+
plugins: [
|
|
709
|
+
intlayer(),
|
|
710
|
+
intlayerCompiler(), // Aggiunge il plugin del compilatore
|
|
711
|
+
],
|
|
712
|
+
});
|
|
713
|
+
```
|
|
714
|
+
|
|
715
|
+
```bash packageManager="npm"
|
|
716
|
+
npm run build # Oppure npm run dev
|
|
717
|
+
```
|
|
718
|
+
|
|
719
|
+
```bash packageManager="pnpm"
|
|
720
|
+
pnpm run build # O pnpm run dev
|
|
721
|
+
```
|
|
722
|
+
|
|
723
|
+
```bash packageManager="yarn"
|
|
724
|
+
yarn build # O yarn dev
|
|
725
|
+
```
|
|
726
|
+
|
|
727
|
+
```bash packageManager="bun"
|
|
728
|
+
bun run build # Or bun run dev
|
|
729
|
+
```
|
|
730
|
+
|
|
731
|
+
</Tab>
|
|
732
|
+
</Tabs>
|
|
733
|
+
|
|
734
|
+
---
|
|
735
|
+
|
|
736
|
+
## Configure TypeScript
|
|
737
|
+
|
|
738
|
+
Intlayer uses module augmentation to get benefits of TypeScript and make your codebase stronger.
|
|
739
|
+
|
|
740
|
+
Ensure your TypeScript configuration includes the autogenerated types:
|
|
741
|
+
|
|
742
|
+
```json5 fileName="tsconfig.json"
|
|
743
|
+
{
|
|
744
|
+
// ... your existing configurations
|
|
745
|
+
include: [
|
|
746
|
+
// ... your existing includes
|
|
747
|
+
".intlayer/**/*.ts", // Include the auto-generated types
|
|
748
|
+
],
|
|
749
|
+
}
|
|
750
|
+
```
|
|
751
|
+
|
|
752
|
+
---
|
|
753
|
+
|
|
754
|
+
## Git Configuration
|
|
755
|
+
|
|
756
|
+
It is recommended to ignore the files generated by Intlayer. This allows you to avoid committing them to your Git repository.
|
|
757
|
+
|
|
758
|
+
To do this, you can add the following instructions to your `.gitignore` file:
|
|
759
|
+
|
|
760
|
+
```plaintext fileName=".gitignore"
|
|
761
|
+
# Ignora i file generati da Intlayer
|
|
762
|
+
.intlayer
|
|
763
|
+
```
|
|
764
|
+
|
|
765
|
+
---
|
|
766
|
+
|
|
767
|
+
## VS Code Extension
|
|
768
|
+
|
|
769
|
+
To improve your development experience with Intlayer, you can install the official **Intlayer VS Code Extension**.
|
|
770
|
+
|
|
771
|
+
[Install from the VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
|
|
772
|
+
|
|
773
|
+
This extension provides:
|
|
774
|
+
|
|
775
|
+
- **Autocompletion** for translation keys.
|
|
776
|
+
- **Real-time error detection** for missing translations.
|
|
777
|
+
- **Inline previews** of translated content.
|
|
778
|
+
- **Quick actions** to easily create and update translations.
|
|
779
|
+
|
|
780
|
+
For more details on how to use the extension, refer to the [Intlayer VS Code Extension documentation](https://intlayer.org/doc/vs-code-extension).
|
|
781
|
+
|
|
782
|
+
---
|
|
783
|
+
|
|
784
|
+
## Go Further
|
|
785
|
+
|
|
786
|
+
To go further, you can implement the [visual editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_visual_editor.md) or externalize your content using the [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_CMS.md).
|
|
787
|
+
|
|
788
|
+
---
|
|
789
|
+
|
|
790
|
+
## Documentation References
|
|
791
|
+
|
|
792
|
+
- [Intlayer Documentation](https://intlayer.org)
|
|
793
|
+
- [React Router v7 Documentation](https://reactrouter.com/)
|
|
794
|
+
- [React Router fs-routes Documentation](https://reactrouter.com/how-to/file-route-conventions)
|
|
795
|
+
- [useIntlayer hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/react-intlayer/useIntlayer.md)
|
|
796
|
+
- [useLocale hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/react-intlayer/useLocale.md)
|
|
797
|
+
- [Content Declaration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md)
|
|
798
|
+
- [Configuration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/configuration.md)
|
|
799
|
+
|
|
800
|
+
This comprehensive guide provides everything you need to integrate Intlayer with React Router v7 using file-system based routing for a fully internationalized application with locale-aware routing and TypeScript support.
|
|
801
|
+
|
|
578
802
|
### Passo 10: Aggiungere il middleware (Opzionale)
|
|
579
803
|
|
|
580
804
|
Puoi anche utilizzare `intlayerProxy` per aggiungere il routing lato server alla tua applicazione. Questo plugin rileverà automaticamente la lingua corrente basandosi sull'URL e imposterà il cookie della lingua appropriata. Se non viene specificata alcuna lingua, il plugin determinerà la lingua più adatta in base alle preferenze linguistiche del browser dell'utente. Se non viene rilevata alcuna lingua, verrà effettuato un reindirizzamento alla lingua predefinita.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-11-20
|
|
3
|
-
updatedAt:
|
|
3
|
+
updatedAt: 2026-03-12
|
|
4
4
|
title: SvelteKit i18n - Come tradurre un'app SvelteKit nel 2026
|
|
5
5
|
description: Scopri come rendere il tuo sito SvelteKit multilingue. Segui la documentazione per internazionalizzare (i18n) e tradurlo utilizzando il Server-Side Rendering (SSR).
|
|
6
6
|
keywords:
|
|
@@ -185,7 +185,7 @@ Ora puoi usare la funzione `useIntlayer` in qualsiasi componente Svelte. Essa re
|
|
|
185
185
|
|
|
186
186
|
> **Nota:** `useIntlayer` restituisce uno store Svelte, quindi devi usare il prefisso `---
|
|
187
187
|
> createdAt: 2025-11-20
|
|
188
|
-
> updatedAt:
|
|
188
|
+
> updatedAt: 2026-03-12
|
|
189
189
|
> title: Come tradurre la tua app SvelteKit – guida i18n 2026
|
|
190
190
|
> description: Scopri come rendere il tuo sito SvelteKit multilingue. Segui la documentazione per internazionalizzare (i18n) e tradurlo utilizzando il Server-Side Rendering (SSR).
|
|
191
191
|
> keywords:
|
|
@@ -776,6 +776,162 @@ Si consiglia di ignorare i file generati da Intlayer.
|
|
|
776
776
|
|
|
777
777
|
---
|
|
778
778
|
|
|
779
|
+
### (Opzionale) Passaggio 1 : Estrarre il contenuto dei tuoi componenti
|
|
780
|
+
|
|
781
|
+
Se hai una base di codice esistente, trasformare migliaia di file può richiedere molto tempo.
|
|
782
|
+
|
|
783
|
+
Per facilitare questo processo, Intlayer propone un [compilatore](https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/compiler.md) / [estrattore](https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/cli/extract.md) per trasformare i tuoi componenti ed estrarre il contenuto.
|
|
784
|
+
|
|
785
|
+
Per configurarlo, puoi aggiungere una sezione `compiler` nel tuo file `intlayer.config.ts`:
|
|
786
|
+
|
|
787
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
788
|
+
import { type IntlayerConfig } from "intlayer";
|
|
789
|
+
|
|
790
|
+
const config: IntlayerConfig = {
|
|
791
|
+
// ... Resto della tua configurazione
|
|
792
|
+
compiler: {
|
|
793
|
+
/**
|
|
794
|
+
* Indica se il compilatore deve essere abilitato.
|
|
795
|
+
*/
|
|
796
|
+
enabled: true,
|
|
797
|
+
|
|
798
|
+
/**
|
|
799
|
+
* Definisce il percorso dei file di output
|
|
800
|
+
*/
|
|
801
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
802
|
+
|
|
803
|
+
/**
|
|
804
|
+
* Indica se i componenti devono essere salvati dopo essere stati trasformati. In questo modo, il compilatore può essere eseguito solo una volta per trasformare l'app e poi rimosso.
|
|
805
|
+
*/
|
|
806
|
+
saveComponents: false,
|
|
807
|
+
|
|
808
|
+
/**
|
|
809
|
+
* Prefisso chiave dizionario
|
|
810
|
+
*/
|
|
811
|
+
dictionaryKeyPrefix: "",
|
|
812
|
+
},
|
|
813
|
+
};
|
|
814
|
+
|
|
815
|
+
export default config;
|
|
816
|
+
```
|
|
817
|
+
|
|
818
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
819
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
820
|
+
const config = {
|
|
821
|
+
// ... Resto della tua configurazione
|
|
822
|
+
compiler: {
|
|
823
|
+
/**
|
|
824
|
+
* Indica se il compilatore deve essere abilitato.
|
|
825
|
+
*/
|
|
826
|
+
enabled: true,
|
|
827
|
+
|
|
828
|
+
/**
|
|
829
|
+
* Definisce il percorso dei file di output
|
|
830
|
+
*/
|
|
831
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
832
|
+
|
|
833
|
+
/**
|
|
834
|
+
* Indica se i componenti devono essere salvati dopo essere stati trasformati. In questo modo, il compilatore può essere eseguito solo una volta per trasformare l'app e poi rimosso.
|
|
835
|
+
*/
|
|
836
|
+
saveComponents: false,
|
|
837
|
+
|
|
838
|
+
/**
|
|
839
|
+
* Prefisso chiave dizionario
|
|
840
|
+
*/
|
|
841
|
+
dictionaryKeyPrefix: "",
|
|
842
|
+
},
|
|
843
|
+
};
|
|
844
|
+
|
|
845
|
+
export default config;
|
|
846
|
+
```
|
|
847
|
+
|
|
848
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
849
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
850
|
+
const config = {
|
|
851
|
+
// ... Resto della tua configurazione
|
|
852
|
+
compiler: {
|
|
853
|
+
/**
|
|
854
|
+
* Indica se il compilatore deve essere abilitato.
|
|
855
|
+
*/
|
|
856
|
+
enabled: true,
|
|
857
|
+
|
|
858
|
+
/**
|
|
859
|
+
* Definisce il percorso dei file di output
|
|
860
|
+
*/
|
|
861
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
862
|
+
|
|
863
|
+
/**
|
|
864
|
+
* Indica se i componenti devono essere salvati dopo essere stati trasformati. In questo modo, il compilatore può essere eseguito solo una volta per trasformare l'app e poi rimosso.
|
|
865
|
+
*/
|
|
866
|
+
saveComponents: false,
|
|
867
|
+
|
|
868
|
+
/**
|
|
869
|
+
* Prefisso chiave dizionario
|
|
870
|
+
*/
|
|
871
|
+
dictionaryKeyPrefix: "",
|
|
872
|
+
},
|
|
873
|
+
};
|
|
874
|
+
|
|
875
|
+
module.exports = config;
|
|
876
|
+
```
|
|
877
|
+
|
|
878
|
+
<Tabs>
|
|
879
|
+
<Tab value='Comando di estrazione'>
|
|
880
|
+
|
|
881
|
+
Esegui l'estrattore per trasformare i tuoi componenti ed estrarre il contenuto
|
|
882
|
+
|
|
883
|
+
```bash packageManager="npm"
|
|
884
|
+
npx intlayer extract
|
|
885
|
+
```
|
|
886
|
+
|
|
887
|
+
```bash packageManager="pnpm"
|
|
888
|
+
pnpm intlayer extract
|
|
889
|
+
```
|
|
890
|
+
|
|
891
|
+
```bash packageManager="yarn"
|
|
892
|
+
yarn intlayer extract
|
|
893
|
+
```
|
|
894
|
+
|
|
895
|
+
```bash packageManager="bun"
|
|
896
|
+
bunx intlayer extract
|
|
897
|
+
```
|
|
898
|
+
|
|
899
|
+
</Tab>
|
|
900
|
+
<Tab value='Compilatore Babel'>
|
|
901
|
+
|
|
902
|
+
Aggiorna il tuo `vite.config.ts` per includere il plugin `intlayerCompiler`:
|
|
903
|
+
|
|
904
|
+
```ts fileName="vite.config.ts"
|
|
905
|
+
import { defineConfig } from "vite";
|
|
906
|
+
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
907
|
+
|
|
908
|
+
export default defineConfig({
|
|
909
|
+
plugins: [
|
|
910
|
+
intlayer(),
|
|
911
|
+
intlayerCompiler(), // Aggiunge il plugin del compilatore
|
|
912
|
+
],
|
|
913
|
+
});
|
|
914
|
+
```
|
|
915
|
+
|
|
916
|
+
```bash packageManager="npm"
|
|
917
|
+
npm run build # Oppure npm run dev
|
|
918
|
+
```
|
|
919
|
+
|
|
920
|
+
```bash packageManager="pnpm"
|
|
921
|
+
pnpm run build # O pnpm run dev
|
|
922
|
+
```
|
|
923
|
+
|
|
924
|
+
```bash packageManager="yarn"
|
|
925
|
+
yarn build # O yarn dev
|
|
926
|
+
```
|
|
927
|
+
|
|
928
|
+
```bash packageManager="bun"
|
|
929
|
+
bun run build # Or bun run dev
|
|
930
|
+
```
|
|
931
|
+
|
|
932
|
+
</Tab>
|
|
933
|
+
</Tabs>
|
|
934
|
+
|
|
779
935
|
### Vai oltre
|
|
780
936
|
|
|
781
937
|
- **Visual Editor**: integra il [Visual Editor di Intlayer](https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/intlayer_visual_editor.md) per modificare le traduzioni direttamente dall'interfaccia utente.
|
|
@@ -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 - Come tradurre un'app Tanstack Start nel 2026
|
|
5
5
|
description: Scopri come aggiungere l'internazionalizzazione (i18n) alla tua applicazione TanStack Start utilizzando Intlayer. Segui questa guida completa per rendere la tua app multilingue con il routing consapevole della localizzazione.
|
|
6
6
|
keywords:
|
|
@@ -773,6 +773,164 @@ Assicurati che la tua configurazione TypeScript includa i tipi generati automati
|
|
|
773
773
|
|
|
774
774
|
---
|
|
775
775
|
|
|
776
|
+
### (Opzionale) Passaggio 1 : Estrarre il contenuto dei tuoi componenti
|
|
777
|
+
|
|
778
|
+
Se hai una base di codice esistente, trasformare migliaia di file può richiedere molto tempo.
|
|
779
|
+
|
|
780
|
+
Per facilitare questo processo, Intlayer propone un [compilatore](https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/compiler.md) / [estrattore](https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/cli/extract.md) per trasformare i tuoi componenti ed estrarre il contenuto.
|
|
781
|
+
|
|
782
|
+
Per configurarlo, puoi aggiungere una sezione `compiler` nel tuo file `intlayer.config.ts`:
|
|
783
|
+
|
|
784
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
785
|
+
import { type IntlayerConfig } from "intlayer";
|
|
786
|
+
|
|
787
|
+
const config: IntlayerConfig = {
|
|
788
|
+
// ... Resto della tua configurazione
|
|
789
|
+
compiler: {
|
|
790
|
+
/**
|
|
791
|
+
* Indica se il compilatore deve essere abilitato.
|
|
792
|
+
*/
|
|
793
|
+
enabled: true,
|
|
794
|
+
|
|
795
|
+
/**
|
|
796
|
+
* Definisce il percorso dei file di output
|
|
797
|
+
*/
|
|
798
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
799
|
+
|
|
800
|
+
/**
|
|
801
|
+
* Indica se i componenti devono essere salvati dopo essere stati trasformati. In questo modo, il compilatore può essere eseguito solo una volta per trasformare l'app e poi rimosso.
|
|
802
|
+
*/
|
|
803
|
+
saveComponents: false,
|
|
804
|
+
|
|
805
|
+
/**
|
|
806
|
+
* Prefisso chiave dizionario
|
|
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
|
+
// ... Resto della tua configurazione
|
|
819
|
+
compiler: {
|
|
820
|
+
/**
|
|
821
|
+
* Indica se il compilatore deve essere abilitato.
|
|
822
|
+
*/
|
|
823
|
+
enabled: true,
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* Definisce il percorso dei file di output
|
|
827
|
+
*/
|
|
828
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
829
|
+
|
|
830
|
+
/**
|
|
831
|
+
* Indica se i componenti devono essere salvati dopo essere stati trasformati. In questo modo, il compilatore può essere eseguito solo una volta per trasformare l'app e poi rimosso.
|
|
832
|
+
*/
|
|
833
|
+
saveComponents: false,
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* Prefisso chiave dizionario
|
|
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
|
+
// ... Resto della tua configurazione
|
|
849
|
+
compiler: {
|
|
850
|
+
/**
|
|
851
|
+
* Indica se il compilatore deve essere abilitato.
|
|
852
|
+
*/
|
|
853
|
+
enabled: true,
|
|
854
|
+
|
|
855
|
+
/**
|
|
856
|
+
* Definisce il percorso dei file di output
|
|
857
|
+
*/
|
|
858
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
859
|
+
|
|
860
|
+
/**
|
|
861
|
+
* Indica se i componenti devono essere salvati dopo essere stati trasformati. In questo modo, il compilatore può essere eseguito solo una volta per trasformare l'app e poi rimosso.
|
|
862
|
+
*/
|
|
863
|
+
saveComponents: false,
|
|
864
|
+
|
|
865
|
+
/**
|
|
866
|
+
* Prefisso chiave dizionario
|
|
867
|
+
*/
|
|
868
|
+
dictionaryKeyPrefix: "",
|
|
869
|
+
},
|
|
870
|
+
};
|
|
871
|
+
|
|
872
|
+
module.exports = config;
|
|
873
|
+
```
|
|
874
|
+
|
|
875
|
+
<Tabs>
|
|
876
|
+
<Tab value='Comando di estrazione'>
|
|
877
|
+
|
|
878
|
+
Esegui l'estrattore per trasformare i tuoi componenti ed estrarre il contenuto
|
|
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='Compilatore Babel'>
|
|
898
|
+
|
|
899
|
+
Aggiorna il tuo `vite.config.ts` per includere il 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(), // Aggiunge il plugin del compilatore
|
|
909
|
+
],
|
|
910
|
+
});
|
|
911
|
+
```
|
|
912
|
+
|
|
913
|
+
```bash packageManager="npm"
|
|
914
|
+
npm run build # Oppure npm run dev
|
|
915
|
+
```
|
|
916
|
+
|
|
917
|
+
```bash packageManager="pnpm"
|
|
918
|
+
pnpm run build # O pnpm run dev
|
|
919
|
+
```
|
|
920
|
+
|
|
921
|
+
```bash packageManager="yarn"
|
|
922
|
+
yarn build # O 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
|
### Configurazione Git
|
|
777
935
|
|
|
778
936
|
Si consiglia di ignorare i file generati da Intlayer. Ciò consente di evitare di commetterli nel repository Git.
|