@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 - Como traduzir uma aplicação React Router v7 em 2026
|
|
5
5
|
description: Aprenda como adicionar internacionalização (i18n) à sua aplicação React Router v7 usando Intlayer com roteamento baseado em sistema de arquivos. Siga este guia completo para tornar sua aplicação multilíngue com roteamento consciente de localidade.
|
|
6
6
|
keywords:
|
|
@@ -569,6 +569,230 @@ export const useI18nHTMLAttributes = () => {
|
|
|
569
569
|
|
|
570
570
|
Este hook já é usado no componente de layout (`root.tsx`) mostrado no Passo 5.
|
|
571
571
|
|
|
572
|
+
### (Opcional) Etapa 1 : Extrair o conteúdo dos seus componentes
|
|
573
|
+
|
|
574
|
+
Se você tiver uma base de código existente, transformar milhares de arquivos pode ser demorado.
|
|
575
|
+
|
|
576
|
+
Para facilitar esse processo, o Intlayer propõe um [compilador](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/compiler.md) / [extrator](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/cli/extract.md) para transformar seus componentes e extrair o conteúdo.
|
|
577
|
+
|
|
578
|
+
Para configurá-lo, você pode adicionar uma seção `compiler` no seu arquivo `intlayer.config.ts`:
|
|
579
|
+
|
|
580
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
581
|
+
import { type IntlayerConfig } from "intlayer";
|
|
582
|
+
|
|
583
|
+
const config: IntlayerConfig = {
|
|
584
|
+
// ... Resto da sua configuração
|
|
585
|
+
compiler: {
|
|
586
|
+
/**
|
|
587
|
+
* Indica se o compilador deve ser ativado.
|
|
588
|
+
*/
|
|
589
|
+
enabled: true,
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* Define o caminho dos arquivos de saída
|
|
593
|
+
*/
|
|
594
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* Indica se os componentes devem ser salvos após serem transformados. Dessa forma, o compilador pode ser executado apenas uma vez para transformar o aplicativo e depois removido.
|
|
598
|
+
*/
|
|
599
|
+
saveComponents: false,
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Prefixo da chave do dicionário
|
|
603
|
+
*/
|
|
604
|
+
dictionaryKeyPrefix: "",
|
|
605
|
+
},
|
|
606
|
+
};
|
|
607
|
+
|
|
608
|
+
export default config;
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
612
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
613
|
+
const config = {
|
|
614
|
+
// ... Resto da sua configuração
|
|
615
|
+
compiler: {
|
|
616
|
+
/**
|
|
617
|
+
* Indica se o compilador deve ser ativado.
|
|
618
|
+
*/
|
|
619
|
+
enabled: true,
|
|
620
|
+
|
|
621
|
+
/**
|
|
622
|
+
* Define o caminho dos arquivos de saída
|
|
623
|
+
*/
|
|
624
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* Indica se os componentes devem ser salvos após serem transformados. Dessa forma, o compilador pode ser executado apenas uma vez para transformar o aplicativo e depois removido.
|
|
628
|
+
*/
|
|
629
|
+
saveComponents: false,
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* Prefixo da chave do dicionário
|
|
633
|
+
*/
|
|
634
|
+
dictionaryKeyPrefix: "",
|
|
635
|
+
},
|
|
636
|
+
};
|
|
637
|
+
|
|
638
|
+
export default config;
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
642
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
643
|
+
const config = {
|
|
644
|
+
// ... Resto da sua configuração
|
|
645
|
+
compiler: {
|
|
646
|
+
/**
|
|
647
|
+
* Indica se o compilador deve ser ativado.
|
|
648
|
+
*/
|
|
649
|
+
enabled: true,
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* Define o caminho dos arquivos de saída
|
|
653
|
+
*/
|
|
654
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
* Indica se os componentes devem ser salvos após serem transformados. Dessa forma, o compilador pode ser executado apenas uma vez para transformar o aplicativo e depois removido.
|
|
658
|
+
*/
|
|
659
|
+
saveComponents: false,
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* Prefixo da chave do dicionário
|
|
663
|
+
*/
|
|
664
|
+
dictionaryKeyPrefix: "",
|
|
665
|
+
},
|
|
666
|
+
};
|
|
667
|
+
|
|
668
|
+
module.exports = config;
|
|
669
|
+
```
|
|
670
|
+
|
|
671
|
+
<Tabs>
|
|
672
|
+
<Tab value='Comando de extração'>
|
|
673
|
+
|
|
674
|
+
Execute o extrator para transformar seus componentes e extrair o conteúdo
|
|
675
|
+
|
|
676
|
+
```bash packageManager="npm"
|
|
677
|
+
npx intlayer extract
|
|
678
|
+
```
|
|
679
|
+
|
|
680
|
+
```bash packageManager="pnpm"
|
|
681
|
+
pnpm intlayer extract
|
|
682
|
+
```
|
|
683
|
+
|
|
684
|
+
```bash packageManager="yarn"
|
|
685
|
+
yarn intlayer extract
|
|
686
|
+
```
|
|
687
|
+
|
|
688
|
+
```bash packageManager="bun"
|
|
689
|
+
bunx intlayer extract
|
|
690
|
+
```
|
|
691
|
+
|
|
692
|
+
</Tab>
|
|
693
|
+
<Tab value='Compilador Babel'>
|
|
694
|
+
|
|
695
|
+
Atualize seu `vite.config.ts` para incluir o plugin `intlayerCompiler`:
|
|
696
|
+
|
|
697
|
+
```ts fileName="vite.config.ts"
|
|
698
|
+
import { defineConfig } from "vite";
|
|
699
|
+
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
700
|
+
|
|
701
|
+
export default defineConfig({
|
|
702
|
+
plugins: [
|
|
703
|
+
intlayer(),
|
|
704
|
+
intlayerCompiler(), // Adiciona o plugin do compilador
|
|
705
|
+
],
|
|
706
|
+
});
|
|
707
|
+
```
|
|
708
|
+
|
|
709
|
+
```bash packageManager="npm"
|
|
710
|
+
npm run build # Ou npm run dev
|
|
711
|
+
```
|
|
712
|
+
|
|
713
|
+
```bash packageManager="pnpm"
|
|
714
|
+
pnpm run build # Or pnpm run dev
|
|
715
|
+
```
|
|
716
|
+
|
|
717
|
+
```bash packageManager="yarn"
|
|
718
|
+
yarn build # Or yarn dev
|
|
719
|
+
```
|
|
720
|
+
|
|
721
|
+
```bash packageManager="bun"
|
|
722
|
+
bun run build # Or bun run dev
|
|
723
|
+
```
|
|
724
|
+
|
|
725
|
+
</Tab>
|
|
726
|
+
</Tabs>
|
|
727
|
+
|
|
728
|
+
---
|
|
729
|
+
|
|
730
|
+
## Configure TypeScript
|
|
731
|
+
|
|
732
|
+
Intlayer uses module augmentation to get benefits of TypeScript and make your codebase stronger.
|
|
733
|
+
|
|
734
|
+
Ensure your TypeScript configuration includes the autogenerated types:
|
|
735
|
+
|
|
736
|
+
```json5 fileName="tsconfig.json"
|
|
737
|
+
{
|
|
738
|
+
// ... your existing configurations
|
|
739
|
+
include: [
|
|
740
|
+
// ... your existing includes
|
|
741
|
+
".intlayer/**/*.ts", // Include the auto-generated types
|
|
742
|
+
],
|
|
743
|
+
}
|
|
744
|
+
```
|
|
745
|
+
|
|
746
|
+
---
|
|
747
|
+
|
|
748
|
+
## Git Configuration
|
|
749
|
+
|
|
750
|
+
It is recommended to ignore the files generated by Intlayer. This allows you to avoid committing them to your Git repository.
|
|
751
|
+
|
|
752
|
+
To do this, you can add the following instructions to your `.gitignore` file:
|
|
753
|
+
|
|
754
|
+
```plaintext fileName=".gitignore"
|
|
755
|
+
# Ignore the files generated by Intlayer
|
|
756
|
+
.intlayer
|
|
757
|
+
```
|
|
758
|
+
|
|
759
|
+
---
|
|
760
|
+
|
|
761
|
+
## VS Code Extension
|
|
762
|
+
|
|
763
|
+
To improve your development experience with Intlayer, you can install the official **Intlayer VS Code Extension**.
|
|
764
|
+
|
|
765
|
+
[Install from the VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
|
|
766
|
+
|
|
767
|
+
This extension provides:
|
|
768
|
+
|
|
769
|
+
- **Autocompletion** for translation keys.
|
|
770
|
+
- **Real-time error detection** for missing translations.
|
|
771
|
+
- **Inline previews** of translated content.
|
|
772
|
+
- **Quick actions** to easily create and update translations.
|
|
773
|
+
|
|
774
|
+
For more details on how to use the extension, refer to the [Intlayer VS Code Extension documentation](https://intlayer.org/doc/vs-code-extension).
|
|
775
|
+
|
|
776
|
+
---
|
|
777
|
+
|
|
778
|
+
## Go Further
|
|
779
|
+
|
|
780
|
+
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).
|
|
781
|
+
|
|
782
|
+
---
|
|
783
|
+
|
|
784
|
+
## Documentation References
|
|
785
|
+
|
|
786
|
+
- [Intlayer Documentation](https://intlayer.org)
|
|
787
|
+
- [React Router v7 Documentation](https://reactrouter.com/)
|
|
788
|
+
- [React Router fs-routes Documentation](https://reactrouter.com/how-to/file-route-conventions)
|
|
789
|
+
- [useIntlayer hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/react-intlayer/useIntlayer.md)
|
|
790
|
+
- [useLocale hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/react-intlayer/useLocale.md)
|
|
791
|
+
- [Content Declaration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md)
|
|
792
|
+
- [Configuration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/configuration.md)
|
|
793
|
+
|
|
794
|
+
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.
|
|
795
|
+
|
|
572
796
|
### Passo 10: Adicionar middleware (Opcional)
|
|
573
797
|
|
|
574
798
|
Você também pode usar o `intlayerProxy` para adicionar roteamento do lado do servidor à sua aplicação. Este plugin detectará automaticamente a localidade atual com base na URL e definirá o cookie de localidade apropriado. Se nenhuma localidade for especificada, o plugin determinará a localidade mais adequada com base nas preferências de idioma do navegador do usuário. Se nenhuma localidade for detectada, ele redirecionará para a localidade padrão.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-11-20
|
|
3
|
-
updatedAt:
|
|
3
|
+
updatedAt: 2026-03-12
|
|
4
4
|
title: SvelteKit i18n - Como traduzir uma aplicação SvelteKit em 2026
|
|
5
5
|
description: Descubra como tornar seu site SvelteKit multilíngue. Siga a documentação para internacionalizar (i18n) e traduzir usando Server-Side Rendering (SSR).
|
|
6
6
|
keywords:
|
|
@@ -187,7 +187,7 @@ Agora você pode usar a função `useIntlayer` em qualquer componente Svelte. El
|
|
|
187
187
|
|
|
188
188
|
> **Nota:** `useIntlayer` retorna uma store do Svelte, então você precisa usar o prefixo `---
|
|
189
189
|
> createdAt: 2025-11-20
|
|
190
|
-
> updatedAt:
|
|
190
|
+
> updatedAt: 2026-03-12
|
|
191
191
|
> title: Como traduzir sua aplicação SvelteKit – guia i18n 2026
|
|
192
192
|
> description: Descubra como tornar seu site SvelteKit multilíngue. Siga a documentação para internacionalizar (i18n) e traduzir usando Server-Side Rendering (SSR).
|
|
193
193
|
> keywords:
|
|
@@ -778,6 +778,162 @@ Para poder visualizar o seletor do editor intlayer, você terá que usar a sinta
|
|
|
778
778
|
|
|
779
779
|
---
|
|
780
780
|
|
|
781
|
+
### (Opcional) Etapa 1 : Extrair o conteúdo dos seus componentes
|
|
782
|
+
|
|
783
|
+
Se você tiver uma base de código existente, transformar milhares de arquivos pode ser demorado.
|
|
784
|
+
|
|
785
|
+
Para facilitar esse processo, o Intlayer propõe um [compilador](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/compiler.md) / [extrator](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/cli/extract.md) para transformar seus componentes e extrair o conteúdo.
|
|
786
|
+
|
|
787
|
+
Para configurá-lo, você pode adicionar uma seção `compiler` no seu arquivo `intlayer.config.ts`:
|
|
788
|
+
|
|
789
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
790
|
+
import { type IntlayerConfig } from "intlayer";
|
|
791
|
+
|
|
792
|
+
const config: IntlayerConfig = {
|
|
793
|
+
// ... Resto da sua configuração
|
|
794
|
+
compiler: {
|
|
795
|
+
/**
|
|
796
|
+
* Indica se o compilador deve ser ativado.
|
|
797
|
+
*/
|
|
798
|
+
enabled: true,
|
|
799
|
+
|
|
800
|
+
/**
|
|
801
|
+
* Define o caminho dos arquivos de saída
|
|
802
|
+
*/
|
|
803
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
804
|
+
|
|
805
|
+
/**
|
|
806
|
+
* Indica se os componentes devem ser salvos após serem transformados. Dessa forma, o compilador pode ser executado apenas uma vez para transformar o aplicativo e depois removido.
|
|
807
|
+
*/
|
|
808
|
+
saveComponents: false,
|
|
809
|
+
|
|
810
|
+
/**
|
|
811
|
+
* Prefixo da chave do dicionário
|
|
812
|
+
*/
|
|
813
|
+
dictionaryKeyPrefix: "",
|
|
814
|
+
},
|
|
815
|
+
};
|
|
816
|
+
|
|
817
|
+
export default config;
|
|
818
|
+
```
|
|
819
|
+
|
|
820
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
821
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
822
|
+
const config = {
|
|
823
|
+
// ... Resto da sua configuração
|
|
824
|
+
compiler: {
|
|
825
|
+
/**
|
|
826
|
+
* Indica se o compilador deve ser ativado.
|
|
827
|
+
*/
|
|
828
|
+
enabled: true,
|
|
829
|
+
|
|
830
|
+
/**
|
|
831
|
+
* Define o caminho dos arquivos de saída
|
|
832
|
+
*/
|
|
833
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* Indica se os componentes devem ser salvos após serem transformados. Dessa forma, o compilador pode ser executado apenas uma vez para transformar o aplicativo e depois removido.
|
|
837
|
+
*/
|
|
838
|
+
saveComponents: false,
|
|
839
|
+
|
|
840
|
+
/**
|
|
841
|
+
* Prefixo da chave do dicionário
|
|
842
|
+
*/
|
|
843
|
+
dictionaryKeyPrefix: "",
|
|
844
|
+
},
|
|
845
|
+
};
|
|
846
|
+
|
|
847
|
+
export default config;
|
|
848
|
+
```
|
|
849
|
+
|
|
850
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
851
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
852
|
+
const config = {
|
|
853
|
+
// ... Resto da sua configuração
|
|
854
|
+
compiler: {
|
|
855
|
+
/**
|
|
856
|
+
* Indica se o compilador deve ser ativado.
|
|
857
|
+
*/
|
|
858
|
+
enabled: true,
|
|
859
|
+
|
|
860
|
+
/**
|
|
861
|
+
* Define o caminho dos arquivos de saída
|
|
862
|
+
*/
|
|
863
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
864
|
+
|
|
865
|
+
/**
|
|
866
|
+
* Indica se os componentes devem ser salvos após serem transformados. Dessa forma, o compilador pode ser executado apenas uma vez para transformar o aplicativo e depois removido.
|
|
867
|
+
*/
|
|
868
|
+
saveComponents: false,
|
|
869
|
+
|
|
870
|
+
/**
|
|
871
|
+
* Prefixo da chave do dicionário
|
|
872
|
+
*/
|
|
873
|
+
dictionaryKeyPrefix: "",
|
|
874
|
+
},
|
|
875
|
+
};
|
|
876
|
+
|
|
877
|
+
module.exports = config;
|
|
878
|
+
```
|
|
879
|
+
|
|
880
|
+
<Tabs>
|
|
881
|
+
<Tab value='Comando de extração'>
|
|
882
|
+
|
|
883
|
+
Execute o extrator para transformar seus componentes e extrair o conteúdo
|
|
884
|
+
|
|
885
|
+
```bash packageManager="npm"
|
|
886
|
+
npx intlayer extract
|
|
887
|
+
```
|
|
888
|
+
|
|
889
|
+
```bash packageManager="pnpm"
|
|
890
|
+
pnpm intlayer extract
|
|
891
|
+
```
|
|
892
|
+
|
|
893
|
+
```bash packageManager="yarn"
|
|
894
|
+
yarn intlayer extract
|
|
895
|
+
```
|
|
896
|
+
|
|
897
|
+
```bash packageManager="bun"
|
|
898
|
+
bunx intlayer extract
|
|
899
|
+
```
|
|
900
|
+
|
|
901
|
+
</Tab>
|
|
902
|
+
<Tab value='Compilador Babel'>
|
|
903
|
+
|
|
904
|
+
Atualize seu `vite.config.ts` para incluir o plugin `intlayerCompiler`:
|
|
905
|
+
|
|
906
|
+
```ts fileName="vite.config.ts"
|
|
907
|
+
import { defineConfig } from "vite";
|
|
908
|
+
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
909
|
+
|
|
910
|
+
export default defineConfig({
|
|
911
|
+
plugins: [
|
|
912
|
+
intlayer(),
|
|
913
|
+
intlayerCompiler(), // Adiciona o plugin do compilador
|
|
914
|
+
],
|
|
915
|
+
});
|
|
916
|
+
```
|
|
917
|
+
|
|
918
|
+
```bash packageManager="npm"
|
|
919
|
+
npm run build # Ou npm run dev
|
|
920
|
+
```
|
|
921
|
+
|
|
922
|
+
```bash packageManager="pnpm"
|
|
923
|
+
pnpm run build # Or pnpm run dev
|
|
924
|
+
```
|
|
925
|
+
|
|
926
|
+
```bash packageManager="yarn"
|
|
927
|
+
yarn build # Or yarn dev
|
|
928
|
+
```
|
|
929
|
+
|
|
930
|
+
```bash packageManager="bun"
|
|
931
|
+
bun run build # Or bun run dev
|
|
932
|
+
```
|
|
933
|
+
|
|
934
|
+
</Tab>
|
|
935
|
+
</Tabs>
|
|
936
|
+
|
|
781
937
|
### Ir Além
|
|
782
938
|
|
|
783
939
|
- **Editor Visual**: Integre o [Editor Visual Intlayer](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/intlayer_visual_editor.md) para editar traduções diretamente pela interface.
|
|
@@ -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 - Como traduzir uma aplicação Tanstack Start em 2026
|
|
5
5
|
description: Aprenda como adicionar internacionalização (i18n) à sua aplicação Tanstack Start usando Intlayer. Siga este guia completo para tornar seu app multilíngue com roteamento sensível ao locale.
|
|
6
6
|
keywords:
|
|
@@ -774,6 +774,164 @@ Certifique-se de que sua configuração do TypeScript inclua os tipos gerados au
|
|
|
774
774
|
|
|
775
775
|
---
|
|
776
776
|
|
|
777
|
+
### (Opcional) Etapa 1 : Extrair o conteúdo dos seus componentes
|
|
778
|
+
|
|
779
|
+
Se você tiver uma base de código existente, transformar milhares de arquivos pode ser demorado.
|
|
780
|
+
|
|
781
|
+
Para facilitar esse processo, o Intlayer propõe um [compilador](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/compiler.md) / [extrator](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/cli/extract.md) para transformar seus componentes e extrair o conteúdo.
|
|
782
|
+
|
|
783
|
+
Para configurá-lo, você pode adicionar uma seção `compiler` no seu arquivo `intlayer.config.ts`:
|
|
784
|
+
|
|
785
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
786
|
+
import { type IntlayerConfig } from "intlayer";
|
|
787
|
+
|
|
788
|
+
const config: IntlayerConfig = {
|
|
789
|
+
// ... Resto da sua configuração
|
|
790
|
+
compiler: {
|
|
791
|
+
/**
|
|
792
|
+
* Indica se o compilador deve ser ativado.
|
|
793
|
+
*/
|
|
794
|
+
enabled: true,
|
|
795
|
+
|
|
796
|
+
/**
|
|
797
|
+
* Define o caminho dos arquivos de saída
|
|
798
|
+
*/
|
|
799
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
800
|
+
|
|
801
|
+
/**
|
|
802
|
+
* Indica se os componentes devem ser salvos após serem transformados. Dessa forma, o compilador pode ser executado apenas uma vez para transformar o aplicativo e depois removido.
|
|
803
|
+
*/
|
|
804
|
+
saveComponents: false,
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* Prefixo da chave do dicionário
|
|
808
|
+
*/
|
|
809
|
+
dictionaryKeyPrefix: "",
|
|
810
|
+
},
|
|
811
|
+
};
|
|
812
|
+
|
|
813
|
+
export default config;
|
|
814
|
+
```
|
|
815
|
+
|
|
816
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
817
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
818
|
+
const config = {
|
|
819
|
+
// ... Resto da sua configuração
|
|
820
|
+
compiler: {
|
|
821
|
+
/**
|
|
822
|
+
* Indica se o compilador deve ser ativado.
|
|
823
|
+
*/
|
|
824
|
+
enabled: true,
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* Define o caminho dos arquivos de saída
|
|
828
|
+
*/
|
|
829
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
830
|
+
|
|
831
|
+
/**
|
|
832
|
+
* Indica se os componentes devem ser salvos após serem transformados. Dessa forma, o compilador pode ser executado apenas uma vez para transformar o aplicativo e depois removido.
|
|
833
|
+
*/
|
|
834
|
+
saveComponents: false,
|
|
835
|
+
|
|
836
|
+
/**
|
|
837
|
+
* Prefixo da chave do dicionário
|
|
838
|
+
*/
|
|
839
|
+
dictionaryKeyPrefix: "",
|
|
840
|
+
},
|
|
841
|
+
};
|
|
842
|
+
|
|
843
|
+
export default config;
|
|
844
|
+
```
|
|
845
|
+
|
|
846
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
847
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
848
|
+
const config = {
|
|
849
|
+
// ... Resto da sua configuração
|
|
850
|
+
compiler: {
|
|
851
|
+
/**
|
|
852
|
+
* Indica se o compilador deve ser ativado.
|
|
853
|
+
*/
|
|
854
|
+
enabled: true,
|
|
855
|
+
|
|
856
|
+
/**
|
|
857
|
+
* Define o caminho dos arquivos de saída
|
|
858
|
+
*/
|
|
859
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
860
|
+
|
|
861
|
+
/**
|
|
862
|
+
* Indica se os componentes devem ser salvos após serem transformados. Dessa forma, o compilador pode ser executado apenas uma vez para transformar o aplicativo e depois removido.
|
|
863
|
+
*/
|
|
864
|
+
saveComponents: false,
|
|
865
|
+
|
|
866
|
+
/**
|
|
867
|
+
* Prefixo da chave do dicionário
|
|
868
|
+
*/
|
|
869
|
+
dictionaryKeyPrefix: "",
|
|
870
|
+
},
|
|
871
|
+
};
|
|
872
|
+
|
|
873
|
+
module.exports = config;
|
|
874
|
+
```
|
|
875
|
+
|
|
876
|
+
<Tabs>
|
|
877
|
+
<Tab value='Comando de extração'>
|
|
878
|
+
|
|
879
|
+
Execute o extrator para transformar seus componentes e extrair o conteúdo
|
|
880
|
+
|
|
881
|
+
```bash packageManager="npm"
|
|
882
|
+
npx intlayer extract
|
|
883
|
+
```
|
|
884
|
+
|
|
885
|
+
```bash packageManager="pnpm"
|
|
886
|
+
pnpm intlayer extract
|
|
887
|
+
```
|
|
888
|
+
|
|
889
|
+
```bash packageManager="yarn"
|
|
890
|
+
yarn intlayer extract
|
|
891
|
+
```
|
|
892
|
+
|
|
893
|
+
```bash packageManager="bun"
|
|
894
|
+
bunx intlayer extract
|
|
895
|
+
```
|
|
896
|
+
|
|
897
|
+
</Tab>
|
|
898
|
+
<Tab value='Compilador Babel'>
|
|
899
|
+
|
|
900
|
+
Atualize seu `vite.config.ts` para incluir o plugin `intlayerCompiler`:
|
|
901
|
+
|
|
902
|
+
```ts fileName="vite.config.ts"
|
|
903
|
+
import { defineConfig } from "vite";
|
|
904
|
+
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
905
|
+
|
|
906
|
+
export default defineConfig({
|
|
907
|
+
plugins: [
|
|
908
|
+
intlayer(),
|
|
909
|
+
intlayerCompiler(), // Adiciona o plugin do compilador
|
|
910
|
+
],
|
|
911
|
+
});
|
|
912
|
+
```
|
|
913
|
+
|
|
914
|
+
```bash packageManager="npm"
|
|
915
|
+
npm run build # Ou npm run dev
|
|
916
|
+
```
|
|
917
|
+
|
|
918
|
+
```bash packageManager="pnpm"
|
|
919
|
+
pnpm run build # Or pnpm run dev
|
|
920
|
+
```
|
|
921
|
+
|
|
922
|
+
```bash packageManager="yarn"
|
|
923
|
+
yarn build # Or yarn dev
|
|
924
|
+
```
|
|
925
|
+
|
|
926
|
+
```bash packageManager="bun"
|
|
927
|
+
bun run build # Or bun run dev
|
|
928
|
+
```
|
|
929
|
+
|
|
930
|
+
</Tab>
|
|
931
|
+
</Tabs>
|
|
932
|
+
|
|
933
|
+
---
|
|
934
|
+
|
|
777
935
|
### Configuração do Git
|
|
778
936
|
|
|
779
937
|
É recomendado ignorar os arquivos gerados pelo Intlayer. Isso permite evitar que eles sejam comitados no seu repositório Git.
|