@intlayer/docs 5.5.9 → 5.5.10
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/ar/autoFill.md +1 -2
- package/ar/intlayer_with_create_react_app.md +1 -14
- package/ar/intlayer_with_nextjs_14.md +1 -14
- package/ar/intlayer_with_nextjs_15.md +1 -14
- package/ar/intlayer_with_nextjs_page_router.md +1 -13
- package/ar/intlayer_with_nuxt.md +792 -0
- package/ar/intlayer_with_react_native+expo.md +6 -3
- package/ar/intlayer_with_vite+preact.md +7 -18
- package/ar/intlayer_with_vite+react.md +7 -17
- package/ar/intlayer_with_vite+vue.md +25 -5
- package/ar/packages/nuxt-intlayer/index.md +29 -0
- package/ar/roadmap.md +11 -11
- package/de/autoFill.md +1 -2
- package/de/how_works_intlayer.md +1 -1
- package/de/intlayer_with_create_react_app.md +1 -14
- package/de/intlayer_with_nextjs_14.md +1 -14
- package/de/intlayer_with_nextjs_15.md +1 -14
- package/de/intlayer_with_nextjs_page_router.md +1 -13
- package/de/intlayer_with_nuxt.md +791 -0
- package/de/intlayer_with_react_native+expo.md +6 -3
- package/de/intlayer_with_vite+preact.md +7 -18
- package/de/intlayer_with_vite+react.md +7 -17
- package/de/intlayer_with_vite+vue.md +84 -62
- package/de/packages/nuxt-intlayer/index.md +29 -0
- package/de/roadmap.md +11 -11
- package/en/autoFill.md +1 -2
- package/en/how_works_intlayer.md +17 -3
- package/en/intlayer_with_angular.md +535 -6
- package/en/intlayer_with_create_react_app.md +1 -14
- package/en/intlayer_with_nextjs_14.md +193 -59
- package/en/intlayer_with_nextjs_15.md +192 -61
- package/en/intlayer_with_nextjs_page_router.md +396 -61
- package/en/intlayer_with_nuxt.md +737 -0
- package/en/intlayer_with_react_native+expo.md +6 -3
- package/en/intlayer_with_vite+preact.md +8 -27
- package/en/intlayer_with_vite+react.md +7 -17
- package/en/intlayer_with_vite+solid.md +6 -3
- package/en/intlayer_with_vite+svelte.md +6 -3
- package/en/intlayer_with_vite+vue.md +17 -6
- package/en/packages/nuxt-intlayer/index.md +31 -0
- package/en/roadmap.md +13 -13
- package/en/t.md +5 -5
- package/en-GB/how_works_intlayer.md +16 -4
- package/en-GB/intlayer_with_create_react_app.md +1 -14
- package/en-GB/intlayer_with_nextjs_14.md +1 -14
- package/en-GB/intlayer_with_nextjs_15.md +1 -14
- package/en-GB/intlayer_with_nextjs_page_router.md +1 -13
- package/en-GB/intlayer_with_nuxt.md +795 -0
- package/en-GB/intlayer_with_react_native+expo.md +6 -3
- package/en-GB/intlayer_with_vite+preact.md +7 -18
- package/en-GB/intlayer_with_vite+react.md +6 -9
- package/en-GB/intlayer_with_vite+vue.md +65 -59
- package/en-GB/packages/nuxt-intlayer/index.md +31 -0
- package/en-GB/roadmap.md +11 -11
- package/es/autoFill.md +1 -2
- package/es/how_works_intlayer.md +1 -1
- package/es/intlayer_with_create_react_app.md +1 -14
- package/es/intlayer_with_nextjs_14.md +1 -14
- package/es/intlayer_with_nextjs_15.md +1 -14
- package/es/intlayer_with_nextjs_page_router.md +1 -13
- package/es/intlayer_with_nuxt.md +731 -0
- package/es/intlayer_with_react_native+expo.md +6 -3
- package/es/intlayer_with_vite+preact.md +7 -18
- package/es/intlayer_with_vite+react.md +7 -17
- package/es/intlayer_with_vite+vue.md +64 -51
- package/es/packages/nuxt-intlayer/index.md +29 -0
- package/fr/autoFill.md +1 -2
- package/fr/how_works_intlayer.md +1 -1
- package/fr/intlayer_with_create_react_app.md +1 -14
- package/fr/intlayer_with_nextjs_14.md +1 -14
- package/fr/intlayer_with_nextjs_15.md +1 -14
- package/fr/intlayer_with_nextjs_page_router.md +1 -13
- package/fr/intlayer_with_nuxt.md +731 -0
- package/fr/intlayer_with_react_native+expo.md +6 -3
- package/fr/intlayer_with_vite+preact.md +7 -18
- package/fr/intlayer_with_vite+react.md +7 -17
- package/fr/intlayer_with_vite+vue.md +30 -15
- package/fr/packages/nuxt-intlayer/index.md +29 -0
- package/fr/roadmap.md +11 -11
- package/hi/autoFill.md +1 -2
- package/hi/how_works_intlayer.md +1 -1
- package/hi/intlayer_with_create_react_app.md +1 -14
- package/hi/intlayer_with_nextjs_14.md +1 -14
- package/hi/intlayer_with_nextjs_15.md +1 -14
- package/hi/intlayer_with_nextjs_page_router.md +1 -13
- package/hi/intlayer_with_nuxt.md +784 -0
- package/hi/intlayer_with_react_native+expo.md +6 -3
- package/hi/intlayer_with_vite+preact.md +7 -18
- package/hi/intlayer_with_vite+react.md +7 -17
- package/hi/intlayer_with_vite+vue.md +59 -47
- package/hi/packages/nuxt-intlayer/index.md +29 -0
- package/hi/roadmap.md +11 -11
- package/index.cjs +30 -0
- package/index.d.ts +2 -0
- package/it/autoFill.md +1 -2
- package/it/how_works_intlayer.md +1 -1
- package/it/intlayer_with_create_react_app.md +0 -6
- package/it/intlayer_with_nextjs_14.md +1 -14
- package/it/intlayer_with_nextjs_15.md +1 -14
- package/it/intlayer_with_nextjs_page_router.md +1 -13
- package/it/intlayer_with_nuxt.md +793 -0
- package/it/intlayer_with_react_native+expo.md +6 -3
- package/it/intlayer_with_vite+preact.md +7 -18
- package/it/intlayer_with_vite+react.md +7 -17
- package/it/intlayer_with_vite+vue.md +26 -17
- package/it/packages/nuxt-intlayer/index.md +29 -0
- package/it/roadmap.md +11 -11
- package/ja/autoFill.md +1 -2
- package/ja/how_works_intlayer.md +1 -1
- package/ja/intlayer_with_create_react_app.md +1 -14
- package/ja/intlayer_with_nextjs_14.md +1 -14
- package/ja/intlayer_with_nextjs_15.md +1 -14
- package/ja/intlayer_with_nextjs_page_router.md +1 -13
- package/ja/intlayer_with_nuxt.md +792 -0
- package/ja/intlayer_with_react_native+expo.md +6 -3
- package/ja/intlayer_with_vite+preact.md +7 -18
- package/ja/intlayer_with_vite+react.md +7 -17
- package/ja/intlayer_with_vite+vue.md +68 -63
- package/ja/packages/nuxt-intlayer/index.md +29 -0
- package/ja/roadmap.md +11 -11
- package/ko/autoFill.md +1 -2
- package/ko/how_works_intlayer.md +1 -1
- package/ko/intlayer_with_create_react_app.md +1 -14
- package/ko/intlayer_with_nextjs_14.md +1 -14
- package/ko/intlayer_with_nextjs_15.md +1 -14
- package/ko/intlayer_with_nextjs_page_router.md +1 -13
- package/ko/intlayer_with_nuxt.md +784 -0
- package/ko/intlayer_with_react_native+expo.md +6 -3
- package/ko/intlayer_with_vite+preact.md +7 -18
- package/ko/intlayer_with_vite+react.md +7 -17
- package/ko/intlayer_with_vite+vue.md +69 -59
- package/ko/packages/nuxt-intlayer/index.md +31 -0
- package/ko/roadmap.md +11 -11
- package/package.json +5 -5
- package/pt/autoFill.md +1 -2
- package/pt/how_works_intlayer.md +1 -1
- package/pt/intlayer_with_create_react_app.md +1 -14
- package/pt/intlayer_with_nextjs_14.md +1 -14
- package/pt/intlayer_with_nextjs_15.md +1 -14
- package/pt/intlayer_with_nextjs_page_router.md +1 -13
- package/pt/intlayer_with_nuxt.md +792 -0
- package/pt/intlayer_with_react_native+expo.md +6 -3
- package/pt/intlayer_with_vite+preact.md +7 -18
- package/pt/intlayer_with_vite+react.md +7 -17
- package/pt/intlayer_with_vite+vue.md +23 -19
- package/pt/packages/nuxt-intlayer/index.md +29 -0
- package/pt/roadmap.md +11 -11
- package/ru/autoFill.md +1 -2
- package/ru/how_works_intlayer.md +1 -1
- package/ru/intlayer_with_create_react_app.md +1 -14
- package/ru/intlayer_with_nextjs_14.md +1 -14
- package/ru/intlayer_with_nextjs_15.md +1 -14
- package/ru/intlayer_with_nextjs_page_router.md +1 -13
- package/ru/intlayer_with_nuxt.md +792 -0
- package/ru/intlayer_with_react_native+expo.md +6 -3
- package/ru/intlayer_with_vite+preact.md +7 -18
- package/ru/intlayer_with_vite+react.md +7 -17
- package/ru/intlayer_with_vite+vue.md +25 -17
- package/ru/packages/nuxt-intlayer/index.md +31 -0
- package/ru/roadmap.md +11 -11
- package/zh/autoFill.md +1 -2
- package/zh/intlayer_with_create_react_app.md +1 -14
- package/zh/intlayer_with_nextjs_14.md +1 -14
- package/zh/intlayer_with_nextjs_15.md +1 -14
- package/zh/intlayer_with_nextjs_page_router.md +1 -13
- package/zh/intlayer_with_nuxt.md +784 -0
- package/zh/intlayer_with_react_native+expo.md +6 -3
- package/zh/intlayer_with_vite+preact.md +7 -18
- package/zh/intlayer_with_vite+react.md +7 -17
- package/zh/intlayer_with_vite+vue.md +68 -57
- package/zh/packages/nuxt-intlayer/index.md +31 -0
- package/zh/roadmap.md +11 -11
|
@@ -0,0 +1,792 @@
|
|
|
1
|
+
# IntlayerとNuxtを使用した国際化(i18n)の開始
|
|
2
|
+
|
|
3
|
+
[アプリケーションテンプレート](https://github.com/aymericzip/intlayer-nuxt-template)をGitHubで確認してください。
|
|
4
|
+
|
|
5
|
+
## Intlayerとは?
|
|
6
|
+
|
|
7
|
+
**Intlayer**は、モダンなWebアプリケーションで多言語サポートを簡素化するために設計された革新的なオープンソースの国際化(i18n)ライブラリです。
|
|
8
|
+
|
|
9
|
+
Intlayerを使用すると、以下が可能です:
|
|
10
|
+
|
|
11
|
+
- **コンポーネントレベルで宣言的な辞書を使用して翻訳を簡単に管理**。
|
|
12
|
+
- **メタデータ、ルート、コンテンツを動的にローカライズ**。
|
|
13
|
+
- **自動生成された型でTypeScriptサポートを確保**し、オートコンプリートやエラー検出を向上。
|
|
14
|
+
- **動的なロケール検出と切り替え**などの高度な機能を活用。
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## NuxtアプリケーションでIntlayerをセットアップするためのステップバイステップガイド
|
|
19
|
+
|
|
20
|
+
### ステップ1: 依存関係のインストール
|
|
21
|
+
|
|
22
|
+
npmを使用して必要なパッケージをインストールします:
|
|
23
|
+
|
|
24
|
+
```bash packageManager="npm"
|
|
25
|
+
npm install intlayer vue-intlayer
|
|
26
|
+
npm install --save-dev nuxt-intlayer
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
```bash packageManager="pnpm"
|
|
30
|
+
pnpm add intlayer vue-intlayer
|
|
31
|
+
pnpm add --save-dev nuxt-intlayer
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```bash packageManager="yarn"
|
|
35
|
+
yarn add intlayer vue-intlayer
|
|
36
|
+
yarn add --save-dev nuxt-intlayer
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
- **intlayer**
|
|
40
|
+
|
|
41
|
+
設定管理、翻訳、[コンテンツ宣言](https://github.com/aymericzip/intlayer/blob/main/docs/ja/dictionary/get_started.md)、トランスパイル、および[CLIコマンド](https://github.com/aymericzip/intlayer/blob/main/docs/ja/intlayer_cli.md)のための国際化ツールを提供するコアパッケージ。
|
|
42
|
+
|
|
43
|
+
- **vue-intlayer**
|
|
44
|
+
IntlayerをVueアプリケーションと統合するためのパッケージ。Vueコンポーネント用のコンポーザブルを提供します。
|
|
45
|
+
|
|
46
|
+
- **nuxt-intlayer**
|
|
47
|
+
IntlayerをNuxtアプリケーションと統合するNuxtモジュール。自動セットアップ、ロケール検出のためのミドルウェア、クッキー管理、URLリダイレクションを提供します。
|
|
48
|
+
|
|
49
|
+
### ステップ2: プロジェクトの設定
|
|
50
|
+
|
|
51
|
+
アプリケーションの言語を設定するための設定ファイルを作成します:
|
|
52
|
+
|
|
53
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
54
|
+
import { Locales, type IntlayerConfig } from "intlayer";
|
|
55
|
+
|
|
56
|
+
const config: IntlayerConfig = {
|
|
57
|
+
internationalization: {
|
|
58
|
+
locales: [
|
|
59
|
+
Locales.ENGLISH,
|
|
60
|
+
Locales.FRENCH,
|
|
61
|
+
Locales.SPANISH,
|
|
62
|
+
// 他のロケール
|
|
63
|
+
],
|
|
64
|
+
defaultLocale: Locales.ENGLISH,
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export default config;
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
72
|
+
import { Locales } from "intlayer";
|
|
73
|
+
|
|
74
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
75
|
+
const config = {
|
|
76
|
+
internationalization: {
|
|
77
|
+
locales: [
|
|
78
|
+
Locales.ENGLISH,
|
|
79
|
+
Locales.FRENCH,
|
|
80
|
+
Locales.SPANISH,
|
|
81
|
+
// 他のロケール
|
|
82
|
+
],
|
|
83
|
+
defaultLocale: Locales.ENGLISH,
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export default config;
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
91
|
+
const { Locales } = require("intlayer");
|
|
92
|
+
|
|
93
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
94
|
+
const config = {
|
|
95
|
+
internationalization: {
|
|
96
|
+
locales: [
|
|
97
|
+
Locales.ENGLISH,
|
|
98
|
+
Locales.FRENCH,
|
|
99
|
+
Locales.SPANISH,
|
|
100
|
+
// 他のロケール
|
|
101
|
+
],
|
|
102
|
+
defaultLocale: Locales.ENGLISH,
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
module.exports = config;
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
> この設定ファイルを通じて、ローカライズされたURL、ミドルウェアリダイレクション、クッキー名、コンテンツ宣言の場所と拡張子、コンソールでのIntlayerログの無効化などを設定できます。利用可能なパラメータの完全なリストについては、[設定ドキュメント](https://github.com/aymericzip/intlayer/blob/main/docs/ja/configuration.md)を参照してください。
|
|
110
|
+
|
|
111
|
+
### ステップ3: Nuxt設定へのIntlayerの統合
|
|
112
|
+
|
|
113
|
+
IntlayerモジュールをNuxt設定に追加します:
|
|
114
|
+
|
|
115
|
+
```typescript fileName="nuxt.config.ts"
|
|
116
|
+
import { defineNuxtConfig } from "nuxt/config";
|
|
117
|
+
|
|
118
|
+
export default defineNuxtConfig({
|
|
119
|
+
// ... 既存のNuxt設定
|
|
120
|
+
modules: ["nuxt-intlayer"],
|
|
121
|
+
});
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
> `nuxt-intlayer`モジュールは、IntlayerとNuxtの統合を自動的に処理します。コンテンツ宣言のビルドを設定し、開発モードでファイルを監視し、ロケール検出のためのミドルウェアを提供し、ローカライズされたルーティングを管理します。
|
|
125
|
+
|
|
126
|
+
### ステップ4: コンテンツの宣言
|
|
127
|
+
|
|
128
|
+
翻訳を保存するためのコンテンツ宣言を作成および管理します:
|
|
129
|
+
|
|
130
|
+
```tsx fileName="components/helloWorld.content.ts" contentDeclarationFormat="typescript"
|
|
131
|
+
import { t, type Dictionary } from "intlayer";
|
|
132
|
+
|
|
133
|
+
const helloWorldContent = {
|
|
134
|
+
key: "helloworld",
|
|
135
|
+
content: {
|
|
136
|
+
count: t({
|
|
137
|
+
ja: "カウントは ",
|
|
138
|
+
en: "count is ",
|
|
139
|
+
fr: "le compte est ",
|
|
140
|
+
es: "el recuento es ",
|
|
141
|
+
}),
|
|
142
|
+
edit: t({
|
|
143
|
+
ja: "<code>components/HelloWorld.vue</code> を編集して保存し、HMRをテストしてください",
|
|
144
|
+
en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
145
|
+
fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
146
|
+
es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
|
|
147
|
+
}),
|
|
148
|
+
checkOut: t({
|
|
149
|
+
ja: "チェックアウト ",
|
|
150
|
+
en: "Check out ",
|
|
151
|
+
fr: "Vérifiez ",
|
|
152
|
+
es: "Compruebe ",
|
|
153
|
+
}),
|
|
154
|
+
nuxtIntlayer: t({
|
|
155
|
+
ja: "Nuxt Intlayer ドキュメント",
|
|
156
|
+
en: "Nuxt Intlayer documentation",
|
|
157
|
+
fr: "Documentation de Nuxt Intlayer",
|
|
158
|
+
es: "Documentación de Nuxt Intlayer",
|
|
159
|
+
}),
|
|
160
|
+
learnMore: t({
|
|
161
|
+
ja: "Nuxtについてさらに学ぶには ",
|
|
162
|
+
en: "Learn more about Nuxt in the ",
|
|
163
|
+
fr: "En savoir plus sur Nuxt dans la ",
|
|
164
|
+
es: "Aprenda más sobre Nuxt en la ",
|
|
165
|
+
}),
|
|
166
|
+
nuxtDocs: t({
|
|
167
|
+
ja: "Nuxt ドキュメント",
|
|
168
|
+
en: "Nuxt Documentation",
|
|
169
|
+
fr: "Documentation Nuxt",
|
|
170
|
+
es: "Documentación de Nuxt",
|
|
171
|
+
}),
|
|
172
|
+
readTheDocs: t({
|
|
173
|
+
ja: "Nuxtのロゴをクリックして詳細を確認",
|
|
174
|
+
en: "Click on the Nuxt logo to learn more",
|
|
175
|
+
fr: "Cliquez sur le logo Nuxt pour en savoir plus",
|
|
176
|
+
es: "Haga clic en el logotipo de Nuxt para obtener más información",
|
|
177
|
+
}),
|
|
178
|
+
},
|
|
179
|
+
} satisfies Dictionary;
|
|
180
|
+
|
|
181
|
+
export default helloWorldContent;
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
```javascript fileName="components/helloWorld.content.mjs" contentDeclarationFormat="esm"
|
|
185
|
+
import { t } from "intlayer";
|
|
186
|
+
|
|
187
|
+
/** @type {import('intlayer').Dictionary} */
|
|
188
|
+
const helloWorldContent = {
|
|
189
|
+
key: "helloworld",
|
|
190
|
+
content: {
|
|
191
|
+
count: t({
|
|
192
|
+
ja: "カウントは ",
|
|
193
|
+
en: "count is ",
|
|
194
|
+
fr: "le compte est ",
|
|
195
|
+
es: "el recuento es ",
|
|
196
|
+
}),
|
|
197
|
+
edit: t({
|
|
198
|
+
ja: "<code>components/HelloWorld.vue</code> を編集して保存し、HMRをテストしてください",
|
|
199
|
+
en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
200
|
+
fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
201
|
+
es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
|
|
202
|
+
}),
|
|
203
|
+
checkOut: t({
|
|
204
|
+
ja: "チェックアウト ",
|
|
205
|
+
en: "Check out ",
|
|
206
|
+
fr: "Vérifiez ",
|
|
207
|
+
es: "Compruebe ",
|
|
208
|
+
}),
|
|
209
|
+
nuxtIntlayer: t({
|
|
210
|
+
ja: "Nuxt Intlayer ドキュメント",
|
|
211
|
+
en: "Nuxt Intlayer documentation",
|
|
212
|
+
fr: "Documentation de Nuxt Intlayer",
|
|
213
|
+
es: "Documentación de Nuxt Intlayer",
|
|
214
|
+
}),
|
|
215
|
+
learnMore: t({
|
|
216
|
+
ja: "Nuxtについてさらに学ぶには ",
|
|
217
|
+
en: "Learn more about Nuxt in the ",
|
|
218
|
+
fr: "En savoir plus sur Nuxt dans la ",
|
|
219
|
+
es: "Aprenda más sobre Nuxt en la ",
|
|
220
|
+
}),
|
|
221
|
+
nuxtDocs: t({
|
|
222
|
+
ja: "Nuxt ドキュメント",
|
|
223
|
+
en: "Nuxt Documentation",
|
|
224
|
+
fr: "Documentation Nuxt",
|
|
225
|
+
es: "Documentación de Nuxt",
|
|
226
|
+
}),
|
|
227
|
+
readTheDocs: t({
|
|
228
|
+
ja: "Nuxtのロゴをクリックして詳細を確認",
|
|
229
|
+
en: "Click on the Nuxt logo to learn more",
|
|
230
|
+
fr: "Cliquez sur le logo Nuxt pour en savoir plus",
|
|
231
|
+
es: "Haga clic en el logotipo de Nuxt para obtener más información",
|
|
232
|
+
}),
|
|
233
|
+
},
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
export default helloWorldContent;
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
```javascript fileName="components/helloWorld.content.cjs" contentDeclarationFormat="commonjs"
|
|
240
|
+
const { t } = require("intlayer");
|
|
241
|
+
|
|
242
|
+
/** @type {import('intlayer').Dictionary} */
|
|
243
|
+
const helloWorldContent = {
|
|
244
|
+
key: "helloworld",
|
|
245
|
+
content: {
|
|
246
|
+
count: t({
|
|
247
|
+
ja: "カウントは ",
|
|
248
|
+
en: "count is ",
|
|
249
|
+
fr: "le compte est ",
|
|
250
|
+
es: "el recuento es ",
|
|
251
|
+
}),
|
|
252
|
+
edit: t({
|
|
253
|
+
ja: "<code>components/HelloWorld.vue</code> を編集して保存し、HMRをテストしてください",
|
|
254
|
+
en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
255
|
+
fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
256
|
+
es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
|
|
257
|
+
}),
|
|
258
|
+
checkOut: t({
|
|
259
|
+
ja: "チェックアウト ",
|
|
260
|
+
en: "Check out ",
|
|
261
|
+
fr: "Vérifiez ",
|
|
262
|
+
es: "Compruebe ",
|
|
263
|
+
}),
|
|
264
|
+
nuxtIntlayer: t({
|
|
265
|
+
ja: "Nuxt Intlayer ドキュメント",
|
|
266
|
+
en: "Nuxt Intlayer documentation",
|
|
267
|
+
fr: "Documentation de Nuxt Intlayer",
|
|
268
|
+
es: "Documentación de Nuxt Intlayer",
|
|
269
|
+
}),
|
|
270
|
+
learnMore: t({
|
|
271
|
+
ja: "Nuxtについてさらに学ぶには ",
|
|
272
|
+
en: "Learn more about Nuxt in the ",
|
|
273
|
+
fr: "En savoir plus sur Nuxt dans la ",
|
|
274
|
+
es: "Aprenda más sobre Nuxt en la ",
|
|
275
|
+
}),
|
|
276
|
+
nuxtDocs: t({
|
|
277
|
+
ja: "Nuxt ドキュメント",
|
|
278
|
+
en: "Nuxt Documentation",
|
|
279
|
+
fr: "Documentation Nuxt",
|
|
280
|
+
es: "Documentación de Nuxt",
|
|
281
|
+
}),
|
|
282
|
+
readTheDocs: t({
|
|
283
|
+
ja: "Nuxtのロゴをクリックして詳細を確認",
|
|
284
|
+
en: "Click on the Nuxt logo to learn more",
|
|
285
|
+
fr: "Cliquez sur le logo Nuxt pour en savoir plus",
|
|
286
|
+
es: "Haga clic en el logotipo de Nuxt para obtener más información",
|
|
287
|
+
}),
|
|
288
|
+
},
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
module.exports = helloWorldContent;
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
```json fileName="components/helloWorld.content.json" contentDeclarationFormat="json"
|
|
295
|
+
{
|
|
296
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
297
|
+
"key": "helloworld",
|
|
298
|
+
"content": {
|
|
299
|
+
"count": {
|
|
300
|
+
"nodeType": "translation",
|
|
301
|
+
"translation": {
|
|
302
|
+
"en": "count is ",
|
|
303
|
+
"fr": "le compte est ",
|
|
304
|
+
"es": "el recuento es ",
|
|
305
|
+
"ja": "カウントは "
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
"edit": {
|
|
309
|
+
"nodeType": "translation",
|
|
310
|
+
"translation": {
|
|
311
|
+
"en": "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
312
|
+
"fr": "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
313
|
+
"es": "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
|
|
314
|
+
"ja": "<code>components/HelloWorld.vue</code> を編集して保存し、HMRをテストしてください"
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
"checkOut": {
|
|
318
|
+
"nodeType": "translation",
|
|
319
|
+
"translation": {
|
|
320
|
+
"en": "Check out ",
|
|
321
|
+
"fr": "Vérifiez ",
|
|
322
|
+
"es": "Compruebe ",
|
|
323
|
+
"ja": "チェックアウト "
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
"nuxtIntlayer": {
|
|
327
|
+
"nodeType": "translation",
|
|
328
|
+
"translation": {
|
|
329
|
+
"en": "Nuxt Intlayer documentation",
|
|
330
|
+
"fr": "Documentation de Nuxt Intlayer",
|
|
331
|
+
"es": "Documentación de Nuxt Intlayer",
|
|
332
|
+
"ja": "Nuxt Intlayer ドキュメント"
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
"learnMore": {
|
|
336
|
+
"nodeType": "translation",
|
|
337
|
+
"translation": {
|
|
338
|
+
"en": "Learn more about Nuxt in the ",
|
|
339
|
+
"fr": "En savoir plus sur Nuxt dans la ",
|
|
340
|
+
"es": "Aprenda más sobre Nuxt en la ",
|
|
341
|
+
"ja": "Nuxt についてさらに学ぶには "
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
"nuxtDocs": {
|
|
345
|
+
"nodeType": "translation",
|
|
346
|
+
"translation": {
|
|
347
|
+
"en": "Nuxt Documentation",
|
|
348
|
+
"fr": "Documentation Nuxt",
|
|
349
|
+
"es": "Documentación de Nuxt",
|
|
350
|
+
"ja": "Nuxt ドキュメント"
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
"readTheDocs": {
|
|
354
|
+
"nodeType": "translation",
|
|
355
|
+
"translation": {
|
|
356
|
+
"en": "Click on the Nuxt logo to learn more",
|
|
357
|
+
"fr": "Cliquez sur le logo Nuxt pour en savoir plus",
|
|
358
|
+
"es": "Haga clic en el logotipo de Nuxt para obtener más información",
|
|
359
|
+
"ja": "Nuxt のロゴをクリックして詳細を確認してください"
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
> コンテンツ宣言は、アプリケーション内の任意の場所に定義できますが、`contentDir` ディレクトリ(デフォルトでは `./src`)に含まれている必要があります。また、コンテンツ宣言ファイルの拡張子(デフォルトでは `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`)と一致する必要があります。
|
|
367
|
+
|
|
368
|
+
> 詳細については、[コンテンツ宣言ドキュメント](https://github.com/aymericzip/intlayer/blob/main/docs/ja/dictionary/get_started.md)を参照してください。
|
|
369
|
+
|
|
370
|
+
### ステップ 5: コード内で Intlayer を利用する
|
|
371
|
+
|
|
372
|
+
`useIntlayer` コンポーザブルを使用して、Nuxt アプリケーション全体でコンテンツ辞書にアクセスします:
|
|
373
|
+
|
|
374
|
+
```vue fileName="components/HelloWorld.vue"
|
|
375
|
+
<script setup lang="ts">
|
|
376
|
+
import { ref } from "vue";
|
|
377
|
+
import { useIntlayer } from "vue-intlayer";
|
|
378
|
+
|
|
379
|
+
defineProps({
|
|
380
|
+
msg: String,
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
const {
|
|
384
|
+
count,
|
|
385
|
+
edit,
|
|
386
|
+
checkOut,
|
|
387
|
+
nuxtIntlayer,
|
|
388
|
+
learnMore,
|
|
389
|
+
nuxtDocs,
|
|
390
|
+
readTheDocs,
|
|
391
|
+
} = useIntlayer("helloworld");
|
|
392
|
+
const countRef = ref(0);
|
|
393
|
+
</script>
|
|
394
|
+
|
|
395
|
+
<template>
|
|
396
|
+
<h1>{{ msg }}</h1>
|
|
397
|
+
|
|
398
|
+
<div class="card">
|
|
399
|
+
<button type="button" @click="countRef++">
|
|
400
|
+
<count />
|
|
401
|
+
{{ countRef }}
|
|
402
|
+
</button>
|
|
403
|
+
<p v-html="edit"></p>
|
|
404
|
+
</div>
|
|
405
|
+
|
|
406
|
+
<p>
|
|
407
|
+
<checkOut />
|
|
408
|
+
<a href="https://nuxt.com/docs/getting-started/introduction" target="_blank"
|
|
409
|
+
>Nuxt</a
|
|
410
|
+
>, <nuxtIntlayer />
|
|
411
|
+
</p>
|
|
412
|
+
<p>
|
|
413
|
+
<learnMore />
|
|
414
|
+
<a href="https://nuxt.com" target="_blank"><nuxtDocs /></a>.
|
|
415
|
+
</p>
|
|
416
|
+
<p class="read-the-docs"><readTheDocs /></p>
|
|
417
|
+
<p class="read-the-docs">{{ readTheDocs }}</p>
|
|
418
|
+
</template>
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
#### Intlayer でのコンテンツアクセス
|
|
422
|
+
|
|
423
|
+
Intlayer は、コンテンツにアクセスするための 2 つの API を提供します:
|
|
424
|
+
|
|
425
|
+
- **コンポーネントベースの構文**(推奨):
|
|
426
|
+
`<myContent />` または `<Component :is="myContent" />` 構文を使用して、コンテンツを Intlayer ノードとしてレンダリングします。これは、[ビジュアルエディター](https://github.com/aymericzip/intlayer/blob/main/docs/ja/intlayer_visual_editor.md) および [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/ja/intlayer_CMS.md) とシームレスに統合されます。
|
|
427
|
+
|
|
428
|
+
- **文字列ベースの構文**:
|
|
429
|
+
`{{ myContent }}` を使用して、ビジュアルエディターのサポートなしにプレーンテキストとしてコンテンツをレンダリングします。
|
|
430
|
+
|
|
431
|
+
- **生のHTML構文**:
|
|
432
|
+
`<div v-html="myContent" />` を使用して、ビジュアルエディターのサポートなしに生のHTMLとしてコンテンツをレンダリングします。
|
|
433
|
+
|
|
434
|
+
- **デストラクチャリング構文**:
|
|
435
|
+
`useIntlayer` コンポーザブルは、コンテンツを含むプロキシを返します。このプロキシは、リアクティビティを維持しながらコンテンツにアクセスするためにデストラクチャリングできます。
|
|
436
|
+
- `const content = useIntlayer("myContent");` と `{{ content.myContent }}` / `<content.myContent />` を使用します。
|
|
437
|
+
- または、`const { myContent } = useIntlayer("myContent");` と `{{ myContent }}` / `<myContent />` を使用してコンテンツをデストラクチャリングします。
|
|
438
|
+
|
|
439
|
+
### (オプション)ステップ 6: コンテンツの言語を変更する
|
|
440
|
+
|
|
441
|
+
コンテンツの言語を変更するには、`useLocale` コンポーザブルによって提供される `setLocale` 関数を使用します。この関数を使用すると、アプリケーションのロケールを設定し、それに応じてコンテンツを更新できます。
|
|
442
|
+
|
|
443
|
+
言語を切り替えるコンポーネントを作成します:
|
|
444
|
+
|
|
445
|
+
```vue fileName="components/LocaleSwitcher.vue"
|
|
446
|
+
<template>
|
|
447
|
+
<div class="locale-switcher">
|
|
448
|
+
<select v-model="selectedLocale" @change="changeLocale">
|
|
449
|
+
<option v-for="loc in availableLocales" :key="loc" :value="loc">
|
|
450
|
+
{{ getLocaleName(loc) }}
|
|
451
|
+
</option>
|
|
452
|
+
</select>
|
|
453
|
+
</div>
|
|
454
|
+
</template>
|
|
455
|
+
|
|
456
|
+
<script setup lang="ts">
|
|
457
|
+
import { ref, watch } from "vue";
|
|
458
|
+
import { getLocaleName } from "intlayer";
|
|
459
|
+
import { useLocale } from "vue-intlayer";
|
|
460
|
+
|
|
461
|
+
// ロケール情報と setLocale 関数を取得
|
|
462
|
+
const { locale, availableLocales, setLocale } = useLocale();
|
|
463
|
+
|
|
464
|
+
// 選択されたロケールを ref で追跡
|
|
465
|
+
const selectedLocale = ref(locale.value);
|
|
466
|
+
|
|
467
|
+
// 選択が変更されたときにロケールを更新
|
|
468
|
+
const changeLocale = () => setLocale(selectedLocale.value);
|
|
469
|
+
|
|
470
|
+
// グローバルロケールと selectedLocale を同期
|
|
471
|
+
watch(
|
|
472
|
+
() => locale.value,
|
|
473
|
+
(newLocale) => {
|
|
474
|
+
selectedLocale.value = newLocale;
|
|
475
|
+
}
|
|
476
|
+
);
|
|
477
|
+
</script>
|
|
478
|
+
</template>
|
|
479
|
+
|
|
480
|
+
<style scoped>
|
|
481
|
+
.locale-switcher {
|
|
482
|
+
margin: 1rem 0;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
select {
|
|
486
|
+
padding: 0.5rem;
|
|
487
|
+
border-radius: 0.25rem;
|
|
488
|
+
border: 1px solid #ccc;
|
|
489
|
+
}
|
|
490
|
+
</style>
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
次に、このコンポーネントをページまたはレイアウトで使用します:
|
|
494
|
+
|
|
495
|
+
```vue fileName="app.vue"
|
|
496
|
+
<script setup lang="ts">
|
|
497
|
+
import { useIntlayer } from "vue-intlayer";
|
|
498
|
+
import LocaleSwitcher from "~/components/LocaleSwitcher.vue";
|
|
499
|
+
|
|
500
|
+
const content = useIntlayer("app"); // 関連する intlayer 宣言ファイルを作成
|
|
501
|
+
</script>
|
|
502
|
+
|
|
503
|
+
<template>
|
|
504
|
+
<div>
|
|
505
|
+
<header>
|
|
506
|
+
<LocaleSwitcher />
|
|
507
|
+
</header>
|
|
508
|
+
<main>
|
|
509
|
+
<NuxtPage />
|
|
510
|
+
</main>
|
|
511
|
+
</div>
|
|
512
|
+
</template>
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
### (オプション)ステップ 7: アプリケーションにローカライズされたルーティングを追加する
|
|
516
|
+
|
|
517
|
+
`nuxt-intlayer` モジュールを使用すると、Nuxt はローカライズされたルーティングを自動的に処理します。これにより、ページディレクトリ構造に基づいて各言語のルートが自動的に作成されます。
|
|
518
|
+
|
|
519
|
+
例:
|
|
520
|
+
|
|
521
|
+
```plaintext
|
|
522
|
+
pages/
|
|
523
|
+
├── index.vue → /, /fr, /es, /ja
|
|
524
|
+
├── about.vue → /about, /fr/about, /es/about, /ja/about
|
|
525
|
+
└── contact/
|
|
526
|
+
└── index.vue → /contact, /fr/contact, /es/contact, /ja/contact
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
ローカライズされたページを作成するには、`pages/` ディレクトリに Vue ファイルを作成するだけです:
|
|
530
|
+
|
|
531
|
+
```vue fileName="pages/about.vue"
|
|
532
|
+
<script setup lang="ts">
|
|
533
|
+
import { useIntlayer } from "vue-intlayer";
|
|
534
|
+
|
|
535
|
+
const content = useIntlayer("about");
|
|
536
|
+
</script>
|
|
537
|
+
|
|
538
|
+
<template>
|
|
539
|
+
<div>
|
|
540
|
+
<h1>{{ content.title }}</h1>
|
|
541
|
+
<p>{{ content.description }}</p>
|
|
542
|
+
</div>
|
|
543
|
+
</template>
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
`nuxt-intlayer` モジュールは自動的に以下を行います:
|
|
547
|
+
|
|
548
|
+
- ユーザーの優先ロケールを検出
|
|
549
|
+
- URL を介したロケール切り替えを処理
|
|
550
|
+
- 適切な `<html lang="">` 属性を設定
|
|
551
|
+
- ロケールクッキーを管理
|
|
552
|
+
- ユーザーを適切なローカライズされた URL にリダイレクト
|
|
553
|
+
|
|
554
|
+
### (オプション)ステップ 8: ローカライズされたリンクコンポーネントを作成する
|
|
555
|
+
|
|
556
|
+
アプリケーションのナビゲーションが現在のロケールを尊重するようにするには、カスタム `LocalizedLink` コンポーネントを作成できます。このコンポーネントは、内部 URL に現在の言語を自動的にプレフィックスします。
|
|
557
|
+
|
|
558
|
+
```vue fileName="components/LocalizedLink.vue"
|
|
559
|
+
<template>
|
|
560
|
+
<NuxtLink :to="localizedHref" v-bind="$attrs">
|
|
561
|
+
<slot />
|
|
562
|
+
</NuxtLink>
|
|
563
|
+
</template>
|
|
564
|
+
|
|
565
|
+
<script setup lang="ts">
|
|
566
|
+
import { computed } from "vue";
|
|
567
|
+
import { getLocalizedUrl } from "intlayer";
|
|
568
|
+
import { useLocale } from "vue-intlayer";
|
|
569
|
+
|
|
570
|
+
const props = defineProps({
|
|
571
|
+
to: {
|
|
572
|
+
type: String,
|
|
573
|
+
required: true,
|
|
574
|
+
},
|
|
575
|
+
});
|
|
576
|
+
|
|
577
|
+
const { locale } = useLocale();
|
|
578
|
+
|
|
579
|
+
// リンクが外部リンクかどうかを確認
|
|
580
|
+
const isExternalLink = computed(() => /^https?:\/\//.test(props.to || ""));
|
|
581
|
+
|
|
582
|
+
// 内部リンクのローカライズされた href を作成
|
|
583
|
+
const localizedHref = computed(() =>
|
|
584
|
+
isExternalLink.value ? props.to : getLocalizedUrl(props.to, locale.value)
|
|
585
|
+
);
|
|
586
|
+
</script>
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
次に、このコンポーネントをアプリケーション全体で使用します:
|
|
590
|
+
|
|
591
|
+
```vue fileName="pages/index.vue"
|
|
592
|
+
<template>
|
|
593
|
+
<div>
|
|
594
|
+
<LocalizedLink to="/about">
|
|
595
|
+
{{ content.aboutLink }}
|
|
596
|
+
</LocalizedLink>
|
|
597
|
+
|
|
598
|
+
<LocalizedLink to="/ja/contact">
|
|
599
|
+
{{ content.contactLink }}
|
|
600
|
+
</LocalizedLink>
|
|
601
|
+
</div>
|
|
602
|
+
</template>
|
|
603
|
+
|
|
604
|
+
<script setup lang="ts">
|
|
605
|
+
import { useIntlayer } from "vue-intlayer";
|
|
606
|
+
import LocalizedLink from "~/components/LocalizedLink.vue";
|
|
607
|
+
|
|
608
|
+
const content = useIntlayer("home");
|
|
609
|
+
</script>
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
### (オプション) ステップ9: メタデータとSEOの処理
|
|
613
|
+
|
|
614
|
+
Nuxtは優れたSEO機能を提供します。Intlayerを使用してローカライズされたメタデータを処理できます:
|
|
615
|
+
|
|
616
|
+
```vue fileName="pages/about.vue"
|
|
617
|
+
<script setup lang="ts">
|
|
618
|
+
import { useSeoMeta } from "nuxt/app";
|
|
619
|
+
import { getIntlayer } from "intlayer";
|
|
620
|
+
import { useLocale } from "vue-intlayer";
|
|
621
|
+
|
|
622
|
+
const { locale } = useLocale();
|
|
623
|
+
const content = getIntlayer("about-meta", locale.value);
|
|
624
|
+
|
|
625
|
+
useSeoMeta({
|
|
626
|
+
title: content.title,
|
|
627
|
+
description: content.description,
|
|
628
|
+
});
|
|
629
|
+
</script>
|
|
630
|
+
|
|
631
|
+
<template>
|
|
632
|
+
<div>
|
|
633
|
+
<h1>{{ content.pageTitle }}</h1>
|
|
634
|
+
<p>{{ content.pageContent }}</p>
|
|
635
|
+
</div>
|
|
636
|
+
</template>
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
対応するコンテンツ宣言を作成します:
|
|
640
|
+
|
|
641
|
+
```typescript fileName="pages/about-meta.content.ts" contentDeclarationFormat="typescript"
|
|
642
|
+
import { t, type Dictionary } from "intlayer";
|
|
643
|
+
import type { useSeoMeta } from "nuxt/app";
|
|
644
|
+
|
|
645
|
+
const aboutMetaContent = {
|
|
646
|
+
key: "about-meta",
|
|
647
|
+
content: {
|
|
648
|
+
title: t({
|
|
649
|
+
ja: "私たちについて - 私たちの会社",
|
|
650
|
+
en: "About Us - My Company",
|
|
651
|
+
fr: "À Propos - Ma Société",
|
|
652
|
+
es: "Acerca de Nosotros - Mi Empresa",
|
|
653
|
+
}),
|
|
654
|
+
description: t({
|
|
655
|
+
ja: "私たちの会社と使命についてもっと知る",
|
|
656
|
+
en: "Learn more about our company and our mission",
|
|
657
|
+
fr: "En savoir plus sur notre société et notre mission",
|
|
658
|
+
es: "Conozca más sobre nuestra empresa y nuestra misión",
|
|
659
|
+
}),
|
|
660
|
+
},
|
|
661
|
+
} satisfies Dictionary<Parameters<typeof useSeoMeta>[0]>;
|
|
662
|
+
|
|
663
|
+
export default aboutMetaContent;
|
|
664
|
+
```
|
|
665
|
+
|
|
666
|
+
```typescript fileName="pages/about-meta.content.mjs" contentDeclarationFormat="esm"
|
|
667
|
+
import { t } from "intlayer";
|
|
668
|
+
|
|
669
|
+
/** @type {import('intlayer').Dictionary} */
|
|
670
|
+
const aboutMetaContent = {
|
|
671
|
+
key: "about-meta",
|
|
672
|
+
content: {
|
|
673
|
+
title: t({
|
|
674
|
+
ja: "私たちについて - 私たちの会社",
|
|
675
|
+
en: "About Us - My Company",
|
|
676
|
+
fr: "À Propos - Ma Société",
|
|
677
|
+
es: "Acerca de Nosotros - Mi Empresa",
|
|
678
|
+
}),
|
|
679
|
+
description: t({
|
|
680
|
+
ja: "私たちの会社と使命についてもっと知る",
|
|
681
|
+
en: "Learn more about our company and our mission",
|
|
682
|
+
fr: "En savoir plus sur notre société et notre mission",
|
|
683
|
+
es: "Conozca más sobre nuestra empresa y nuestra misión",
|
|
684
|
+
}),
|
|
685
|
+
},
|
|
686
|
+
};
|
|
687
|
+
|
|
688
|
+
export default aboutMetaContent;
|
|
689
|
+
```
|
|
690
|
+
|
|
691
|
+
```typescript fileName="pages/about-meta.content.js" contentDeclarationFormat="cjs"
|
|
692
|
+
const { t } = require("intlayer");
|
|
693
|
+
|
|
694
|
+
/** @type {import('intlayer').Dictionary} */
|
|
695
|
+
const aboutMetaContent = {
|
|
696
|
+
key: "about-meta",
|
|
697
|
+
content: {
|
|
698
|
+
title: t({
|
|
699
|
+
ja: "私たちについて - 私たちの会社",
|
|
700
|
+
en: "About Us - My Company",
|
|
701
|
+
fr: "À Propos - Ma Société",
|
|
702
|
+
es: "Acerca de Nosotros - Mi Empresa",
|
|
703
|
+
}),
|
|
704
|
+
description: t({
|
|
705
|
+
ja: "私たちの会社と使命についてもっと知る",
|
|
706
|
+
en: "Learn more about our company and our mission",
|
|
707
|
+
fr: "En savoir plus sur notre société et notre mission",
|
|
708
|
+
es: "Conozca más sobre nuestra empresa y nuestra misión",
|
|
709
|
+
}),
|
|
710
|
+
},
|
|
711
|
+
};
|
|
712
|
+
|
|
713
|
+
module.exports = aboutMetaContent;
|
|
714
|
+
```
|
|
715
|
+
|
|
716
|
+
```json fileName="pages/about-meta.content.json" contentDeclarationFormat="json"
|
|
717
|
+
{
|
|
718
|
+
"key": "about-meta",
|
|
719
|
+
"content": {
|
|
720
|
+
"title": {
|
|
721
|
+
"nodeType": "translation",
|
|
722
|
+
"translations": {
|
|
723
|
+
"ja": "私たちについて - 私たちの会社",
|
|
724
|
+
"en": "About Us - My Company",
|
|
725
|
+
"fr": "À Propos - Ma Société",
|
|
726
|
+
"es": "Acerca de Nosotros - Mi Empresa"
|
|
727
|
+
}
|
|
728
|
+
},
|
|
729
|
+
"description": {
|
|
730
|
+
"nodeType": "translation",
|
|
731
|
+
"translations": {
|
|
732
|
+
"ja": "私たちの会社と使命についてもっと知る",
|
|
733
|
+
"en": "Learn more about our company and our mission",
|
|
734
|
+
"fr": "En savoir plus sur notre société et notre mission",
|
|
735
|
+
"es": "Conozca más sobre nuestra empresa y nuestra misión"
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
```
|
|
741
|
+
|
|
742
|
+
### TypeScriptの設定
|
|
743
|
+
|
|
744
|
+
Intlayerはモジュール拡張を使用して、TypeScriptの利点を活用し、コードベースを強化します。
|
|
745
|
+
|
|
746
|
+

|
|
747
|
+
|
|
748
|
+

|
|
749
|
+
|
|
750
|
+
TypeScriptの設定に自動生成された型を含めることを確認してください。
|
|
751
|
+
|
|
752
|
+
```json5 fileName="tsconfig.json"
|
|
753
|
+
{
|
|
754
|
+
// ... 既存のTypeScript設定
|
|
755
|
+
"include": [
|
|
756
|
+
// ... 既存のTypeScript設定
|
|
757
|
+
".intlayer/**/*.ts", // 自動生成された型を含める
|
|
758
|
+
],
|
|
759
|
+
}
|
|
760
|
+
```
|
|
761
|
+
|
|
762
|
+
### Gitの設定
|
|
763
|
+
|
|
764
|
+
Intlayerによって生成されたファイルを無視することをお勧めします。これにより、それらをGitリポジトリにコミットするのを避けることができます。
|
|
765
|
+
|
|
766
|
+
これを行うには、以下の指示を`.gitignore`ファイルに追加します:
|
|
767
|
+
|
|
768
|
+
```plaintext fileName=".gitignore"
|
|
769
|
+
# Intlayerによって生成されたファイルを無視
|
|
770
|
+
.intlayer
|
|
771
|
+
```
|
|
772
|
+
|
|
773
|
+
### VS Code拡張機能
|
|
774
|
+
|
|
775
|
+
Intlayerでの開発体験を向上させるために、公式の**Intlayer VS Code拡張機能**をインストールできます。
|
|
776
|
+
|
|
777
|
+
[VS Code Marketplaceからインストール](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
|
|
778
|
+
|
|
779
|
+
この拡張機能は以下を提供します:
|
|
780
|
+
|
|
781
|
+
- 翻訳キーの**オートコンプリート**。
|
|
782
|
+
- 翻訳の欠落に対する**リアルタイムエラー検出**。
|
|
783
|
+
- 翻訳されたコンテンツの**インラインプレビュー**。
|
|
784
|
+
- 翻訳を簡単に作成および更新するための**クイックアクション**。
|
|
785
|
+
|
|
786
|
+
拡張機能の使用方法の詳細については、[Intlayer VS Code拡張機能のドキュメント](https://intlayer.org/doc/vs-code-extension)を参照してください。
|
|
787
|
+
|
|
788
|
+
---
|
|
789
|
+
|
|
790
|
+
### さらに進む
|
|
791
|
+
|
|
792
|
+
## さらに進むために、[ビジュアルエディタ](https://github.com/aymericzip/intlayer/blob/main/docs/ja/intlayer_visual_editor.md)を実装するか、[CMS](https://github.com/aymericzip/intlayer/blob/main/docs/ja/intlayer_CMS.md)を使用してコンテンツを外部化できます。
|