@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 - React Router v7アプリの翻訳方法 2026
|
|
5
5
|
description: Intlayerを使用してReact Router v7アプリケーションにファイルシステムベースのルーティングで国際化(i18n)を追加する方法を学びます。ロケール対応ルーティングでアプリを多言語化するための包括的なガイドに従ってください。
|
|
6
6
|
keywords:
|
|
@@ -36,7 +36,7 @@ history:
|
|
|
36
36
|
|
|
37
37
|
クライアントサイドルーティングについては、[IntlayerとReact Router v7](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/intlayer_with_react_router_v7.md)ガイドを参照してください。
|
|
38
38
|
|
|
39
|
-
##
|
|
39
|
+
## 目次
|
|
40
40
|
|
|
41
41
|
<TOC/>
|
|
42
42
|
|
|
@@ -577,6 +577,230 @@ export const useI18nHTMLAttributes = () => {
|
|
|
577
577
|
|
|
578
578
|
このフックは、ステップ5で示したレイアウトコンポーネント(`root.tsx`)で既に使用されています。
|
|
579
579
|
|
|
580
|
+
### (オプション) ステップ 1 : コンポーネントのコンテンツを抽出する
|
|
581
|
+
|
|
582
|
+
既存のコードベースがある場合、数千のファイルを変換するのは時間がかかることがあります。
|
|
583
|
+
|
|
584
|
+
このプロセスを容易にするために、Intlayerは、コンポーネントを変換しコンテンツを抽出するための [コンパイラ](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/compiler.md) / [エクストラクタ](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/cli/extract.md) を提案しています。
|
|
585
|
+
|
|
586
|
+
セットアップするには、`intlayer.config.ts` ファイルに `compiler` セクションを追加します。
|
|
587
|
+
|
|
588
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
589
|
+
import { type IntlayerConfig } from "intlayer";
|
|
590
|
+
|
|
591
|
+
const config: IntlayerConfig = {
|
|
592
|
+
// ... 他の構成
|
|
593
|
+
compiler: {
|
|
594
|
+
/**
|
|
595
|
+
* コンパイラを有効にするかどうかを指定します。
|
|
596
|
+
*/
|
|
597
|
+
enabled: true,
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* 出力ファイルのパスを定義します。
|
|
601
|
+
*/
|
|
602
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* 変換後にコンポーネントを保存するかどうかを指定します。これにより、コンパイラを一度だけ実行してアプリを変換し、その後削除することができます。
|
|
606
|
+
*/
|
|
607
|
+
saveComponents: false,
|
|
608
|
+
|
|
609
|
+
/**
|
|
610
|
+
* 辞書キーの接頭辞
|
|
611
|
+
*/
|
|
612
|
+
dictionaryKeyPrefix: "",
|
|
613
|
+
},
|
|
614
|
+
};
|
|
615
|
+
|
|
616
|
+
export default config;
|
|
617
|
+
```
|
|
618
|
+
|
|
619
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
620
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
621
|
+
const config = {
|
|
622
|
+
// ... 他の構成
|
|
623
|
+
compiler: {
|
|
624
|
+
/**
|
|
625
|
+
* コンパイラを有効にするかどうかを指定します。
|
|
626
|
+
*/
|
|
627
|
+
enabled: true,
|
|
628
|
+
|
|
629
|
+
/**
|
|
630
|
+
* 出力ファイルのパスを定義します。
|
|
631
|
+
*/
|
|
632
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* 変換後にコンポーネントを保存するかどうかを指定します。これにより、コンパイラを一度だけ実行してアプリを変換し、その後削除することができます。
|
|
636
|
+
*/
|
|
637
|
+
saveComponents: false,
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* 辞書キーの接頭辞
|
|
641
|
+
*/
|
|
642
|
+
dictionaryKeyPrefix: "",
|
|
643
|
+
},
|
|
644
|
+
};
|
|
645
|
+
|
|
646
|
+
export default config;
|
|
647
|
+
```
|
|
648
|
+
|
|
649
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
650
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
651
|
+
const config = {
|
|
652
|
+
// ... 他の構成
|
|
653
|
+
compiler: {
|
|
654
|
+
/**
|
|
655
|
+
* コンパイラを有効にするかどうかを指定します。
|
|
656
|
+
*/
|
|
657
|
+
enabled: true,
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* 出力ファイルのパスを定義します。
|
|
661
|
+
*/
|
|
662
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* 変換後にコンポーネントを保存するかどうかを指定します。これにより、コンパイラを一度だけ実行してアプリを変換し、その後削除することができます。
|
|
666
|
+
*/
|
|
667
|
+
saveComponents: false,
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* 辞書キーの接頭辞
|
|
671
|
+
*/
|
|
672
|
+
dictionaryKeyPrefix: "",
|
|
673
|
+
},
|
|
674
|
+
};
|
|
675
|
+
|
|
676
|
+
module.exports = config;
|
|
677
|
+
```
|
|
678
|
+
|
|
679
|
+
<Tabs>
|
|
680
|
+
<Tab value='抽出コマンド'>
|
|
681
|
+
|
|
682
|
+
コンポーネントを変換してコンテンツを抽出するためにエクストラクタを実行します
|
|
683
|
+
|
|
684
|
+
```bash packageManager="npm"
|
|
685
|
+
npx intlayer extract
|
|
686
|
+
```
|
|
687
|
+
|
|
688
|
+
```bash packageManager="pnpm"
|
|
689
|
+
pnpm intlayer extract
|
|
690
|
+
```
|
|
691
|
+
|
|
692
|
+
```bash packageManager="yarn"
|
|
693
|
+
yarn intlayer extract
|
|
694
|
+
```
|
|
695
|
+
|
|
696
|
+
```bash packageManager="bun"
|
|
697
|
+
bunx intlayer extract
|
|
698
|
+
```
|
|
699
|
+
|
|
700
|
+
</Tab>
|
|
701
|
+
<Tab value='Babelコンパイラ'>
|
|
702
|
+
|
|
703
|
+
`vite.config.ts` を更新して `intlayerCompiler` プラグインを含めます。
|
|
704
|
+
|
|
705
|
+
```ts fileName="vite.config.ts"
|
|
706
|
+
import { defineConfig } from "vite";
|
|
707
|
+
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
708
|
+
|
|
709
|
+
export default defineConfig({
|
|
710
|
+
plugins: [
|
|
711
|
+
intlayer(),
|
|
712
|
+
intlayerCompiler(), // コンパイラプラグインを追加します
|
|
713
|
+
],
|
|
714
|
+
});
|
|
715
|
+
```
|
|
716
|
+
|
|
717
|
+
```bash packageManager="npm"
|
|
718
|
+
npm run build # または npm run dev
|
|
719
|
+
```
|
|
720
|
+
|
|
721
|
+
```bash packageManager="pnpm"
|
|
722
|
+
pnpm run build # または pnpm run dev
|
|
723
|
+
```
|
|
724
|
+
|
|
725
|
+
```bash packageManager="yarn"
|
|
726
|
+
yarn build # または yarn dev
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
```bash packageManager="bun"
|
|
730
|
+
bun run build # Or bun run dev
|
|
731
|
+
```
|
|
732
|
+
|
|
733
|
+
</Tab>
|
|
734
|
+
</Tabs>
|
|
735
|
+
|
|
736
|
+
---
|
|
737
|
+
|
|
738
|
+
## Configure TypeScript
|
|
739
|
+
|
|
740
|
+
Intlayer uses module augmentation to get benefits of TypeScript and make your codebase stronger.
|
|
741
|
+
|
|
742
|
+
Ensure your TypeScript configuration includes the autogenerated types:
|
|
743
|
+
|
|
744
|
+
```json5 fileName="tsconfig.json"
|
|
745
|
+
{
|
|
746
|
+
// ... your existing configurations
|
|
747
|
+
include: [
|
|
748
|
+
// ... your existing includes
|
|
749
|
+
".intlayer/**/*.ts", // Include the auto-generated types
|
|
750
|
+
],
|
|
751
|
+
}
|
|
752
|
+
```
|
|
753
|
+
|
|
754
|
+
---
|
|
755
|
+
|
|
756
|
+
## Git Configuration
|
|
757
|
+
|
|
758
|
+
It is recommended to ignore the files generated by Intlayer. This allows you to avoid committing them to your Git repository.
|
|
759
|
+
|
|
760
|
+
To do this, you can add the following instructions to your `.gitignore` file:
|
|
761
|
+
|
|
762
|
+
```plaintext fileName=".gitignore"
|
|
763
|
+
# Intlayerによって生成されたファイルを無視する
|
|
764
|
+
.intlayer
|
|
765
|
+
```
|
|
766
|
+
|
|
767
|
+
---
|
|
768
|
+
|
|
769
|
+
## VS Code Extension
|
|
770
|
+
|
|
771
|
+
To improve your development experience with Intlayer, you can install the official **Intlayer VS Code Extension**.
|
|
772
|
+
|
|
773
|
+
[Install from the VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
|
|
774
|
+
|
|
775
|
+
This extension provides:
|
|
776
|
+
|
|
777
|
+
- **Autocompletion** for translation keys.
|
|
778
|
+
- **Real-time error detection** for missing translations.
|
|
779
|
+
- **Inline previews** of translated content.
|
|
780
|
+
- **Quick actions** to easily create and update translations.
|
|
781
|
+
|
|
782
|
+
For more details on how to use the extension, refer to the [Intlayer VS Code Extension documentation](https://intlayer.org/doc/vs-code-extension).
|
|
783
|
+
|
|
784
|
+
---
|
|
785
|
+
|
|
786
|
+
## Go Further
|
|
787
|
+
|
|
788
|
+
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).
|
|
789
|
+
|
|
790
|
+
---
|
|
791
|
+
|
|
792
|
+
## Documentation References
|
|
793
|
+
|
|
794
|
+
- [Intlayer Documentation](https://intlayer.org)
|
|
795
|
+
- [React Router v7 Documentation](https://reactrouter.com/)
|
|
796
|
+
- [React Router fs-routes Documentation](https://reactrouter.com/how-to/file-route-conventions)
|
|
797
|
+
- [useIntlayer hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/react-intlayer/useIntlayer.md)
|
|
798
|
+
- [useLocale hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/react-intlayer/useLocale.md)
|
|
799
|
+
- [Content Declaration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md)
|
|
800
|
+
- [Configuration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/configuration.md)
|
|
801
|
+
|
|
802
|
+
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.
|
|
803
|
+
|
|
580
804
|
### ステップ10: ミドルウェアを追加する(オプション)
|
|
581
805
|
|
|
582
806
|
`intlayerProxy` を使用して、アプリケーションにサーバーサイドルーティングを追加することもできます。このプラグインは、URL に基づいて現在のロケールを自動的に検出し、適切なロケールクッキーを設定します。ロケールが指定されていない場合、プラグインはユーザーのブラウザの言語設定に基づいて最も適切なロケールを判断します。ロケールが検出されない場合は、デフォルトのロケールにリダイレクトします。
|