@intlayer/docs 7.3.11 → 7.3.13

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.
Files changed (90) hide show
  1. package/dist/cjs/generated/docs.entry.cjs +19 -0
  2. package/dist/cjs/generated/docs.entry.cjs.map +1 -1
  3. package/dist/esm/generated/docs.entry.mjs +19 -0
  4. package/dist/esm/generated/docs.entry.mjs.map +1 -1
  5. package/dist/types/generated/docs.entry.d.ts +1 -0
  6. package/dist/types/generated/docs.entry.d.ts.map +1 -1
  7. package/docs/ar/intlayer_with_nuxt.md +294 -438
  8. package/docs/ar/intlayer_with_react_router_v7.md +33 -4
  9. package/docs/ar/intlayer_with_react_router_v7_fs_routes.md +516 -0
  10. package/docs/ar/intlayer_with_tanstack.md +2 -12
  11. package/docs/ar/intlayer_with_vite+vue.md +1 -0
  12. package/docs/de/intlayer_with_nuxt.md +284 -410
  13. package/docs/de/intlayer_with_react_router_v7.md +33 -4
  14. package/docs/de/intlayer_with_react_router_v7_fs_routes.md +573 -0
  15. package/docs/de/intlayer_with_tanstack.md +1 -0
  16. package/docs/de/intlayer_with_vite+vue.md +1 -0
  17. package/docs/en/intlayer_with_nuxt.md +237 -341
  18. package/docs/en/intlayer_with_react_router_v7.md +24 -0
  19. package/docs/en/intlayer_with_react_router_v7_fs_routes.md +570 -0
  20. package/docs/en/intlayer_with_tanstack.md +2 -12
  21. package/docs/en/intlayer_with_vite+vue.md +49 -48
  22. package/docs/en-GB/intlayer_with_nuxt.md +254 -378
  23. package/docs/en-GB/intlayer_with_react_router_v7.md +33 -4
  24. package/docs/en-GB/intlayer_with_react_router_v7_fs_routes.md +513 -0
  25. package/docs/en-GB/intlayer_with_tanstack.md +2 -12
  26. package/docs/en-GB/intlayer_with_vite+vue.md +1 -0
  27. package/docs/es/intlayer_with_nuxt.md +271 -390
  28. package/docs/es/intlayer_with_react_router_v7.md +33 -4
  29. package/docs/es/intlayer_with_react_router_v7_fs_routes.md +575 -0
  30. package/docs/es/intlayer_with_tanstack.md +1 -0
  31. package/docs/es/intlayer_with_vite+vue.md +1 -2
  32. package/docs/fr/intlayer_with_nuxt.md +278 -405
  33. package/docs/fr/intlayer_with_react_router_v7.md +34 -5
  34. package/docs/fr/intlayer_with_react_router_v7_fs_routes.md +574 -0
  35. package/docs/fr/intlayer_with_tanstack.md +1 -0
  36. package/docs/fr/intlayer_with_vite+vue.md +1 -0
  37. package/docs/hi/intlayer_with_nuxt.md +303 -447
  38. package/docs/hi/intlayer_with_react_router_v7.md +33 -4
  39. package/docs/hi/intlayer_with_react_router_v7_fs_routes.md +518 -0
  40. package/docs/hi/intlayer_with_tanstack.md +2 -12
  41. package/docs/hi/intlayer_with_vite+vue.md +1 -0
  42. package/docs/id/intlayer_with_nuxt.md +266 -395
  43. package/docs/id/intlayer_with_react_router_v7.md +29 -4
  44. package/docs/id/intlayer_with_react_router_v7_fs_routes.md +521 -0
  45. package/docs/id/intlayer_with_tanstack.md +2 -12
  46. package/docs/id/intlayer_with_vite+vue.md +1 -0
  47. package/docs/it/intlayer_with_nuxt.md +299 -423
  48. package/docs/it/intlayer_with_react_router_v7.md +33 -4
  49. package/docs/it/intlayer_with_react_router_v7_fs_routes.md +574 -0
  50. package/docs/it/intlayer_with_tanstack.md +1 -0
  51. package/docs/ja/intlayer_with_nuxt.md +309 -432
  52. package/docs/ja/intlayer_with_react_router_v7.md +33 -4
  53. package/docs/ja/intlayer_with_react_router_v7_fs_routes.md +574 -0
  54. package/docs/ja/intlayer_with_tanstack.md +2 -12
  55. package/docs/ja/intlayer_with_vite+vue.md +1 -0
  56. package/docs/ko/intlayer_with_nuxt.md +295 -422
  57. package/docs/ko/intlayer_with_react_router_v7.md +33 -4
  58. package/docs/ko/intlayer_with_react_router_v7_fs_routes.md +515 -0
  59. package/docs/ko/intlayer_with_tanstack.md +2 -12
  60. package/docs/ko/intlayer_with_vite+vue.md +1 -0
  61. package/docs/pl/intlayer_with_nuxt.md +273 -476
  62. package/docs/pl/intlayer_with_react_router_v7.md +32 -5
  63. package/docs/pl/intlayer_with_react_router_v7_fs_routes.md +615 -0
  64. package/docs/pl/intlayer_with_tanstack.md +2 -12
  65. package/docs/pl/intlayer_with_vite+vue.md +1 -0
  66. package/docs/pt/intlayer_with_nuxt.md +277 -420
  67. package/docs/pt/intlayer_with_react_router_v7.md +28 -0
  68. package/docs/pt/intlayer_with_tanstack.md +1 -0
  69. package/docs/ru/intlayer_with_nuxt.md +287 -425
  70. package/docs/ru/intlayer_with_react_router_v7.md +33 -4
  71. package/docs/ru/intlayer_with_react_router_v7_fs_routes.md +574 -0
  72. package/docs/ru/intlayer_with_tanstack.md +1 -0
  73. package/docs/ru/intlayer_with_vite+vue.md +1 -0
  74. package/docs/tr/intlayer_with_nuxt.md +313 -406
  75. package/docs/tr/intlayer_with_react_router_v7.md +33 -4
  76. package/docs/tr/intlayer_with_react_router_v7_fs_routes.md +572 -0
  77. package/docs/tr/intlayer_with_tanstack.md +2 -12
  78. package/docs/tr/intlayer_with_vite+vue.md +1 -0
  79. package/docs/vi/intlayer_with_nuxt.md +273 -418
  80. package/docs/vi/intlayer_with_react_router_v7.md +29 -4
  81. package/docs/vi/intlayer_with_react_router_v7_fs_routes.md +523 -0
  82. package/docs/vi/intlayer_with_tanstack.md +2 -12
  83. package/docs/vi/intlayer_with_vite+vue.md +1 -0
  84. package/docs/zh/intlayer_with_nuxt.md +300 -461
  85. package/docs/zh/intlayer_with_react_router_v7.md +33 -4
  86. package/docs/zh/intlayer_with_react_router_v7_fs_routes.md +516 -0
  87. package/docs/zh/intlayer_with_tanstack.md +2 -12
  88. package/docs/zh/intlayer_with_vite+vue.md +1 -0
  89. package/package.json +10 -11
  90. package/src/generated/docs.entry.ts +19 -0
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  createdAt: 2025-06-18
3
- updatedAt: 2025-06-29
4
- title: Nuxt and Vueアプリを翻訳する方法 – i18nガイド 2025
3
+ updatedAt: 2025-12-07
4
+ title: Nuxt Vue アプリを翻訳する方法 – i18n ガイド 2025
5
5
  description: Nuxt と Vue のウェブサイトを多言語対応にする方法を紹介します。国際化(i18n)と翻訳のためのドキュメントに従ってください。
6
6
  keywords:
7
7
  - 国際化
@@ -14,35 +14,62 @@ slugs:
14
14
  - doc
15
15
  - environment
16
16
  - nuxt-and-vue
17
- applicationTemplate: https://github.com/aymericzip/intlayer-nuxt-template
17
+ applicationTemplate: https://github.com/aymericzip/intlayer-nuxt-4-template
18
+ youtubeVideo: https://www.youtube.com/watch?v=nhUcUAVQ6eQ
18
19
  history:
20
+ - version: 7.3.11
21
+ date: 2025-12-07
22
+ changes: LocaleSwitcher、SEO、メタデータの更新
19
23
  - version: 5.5.10
20
24
  date: 2025-06-29
21
25
  changes: 履歴の初期化
22
26
  ---
23
27
 
24
- # IntlayerNuxt and Vueを翻訳する | 国際化(i18n)
28
+ # Intlayer を使って Nuxt Vue のウェブサイトを翻訳する | 国際化(i18n)
25
29
 
26
- GitHub の [アプリケーションテンプレート](https://github.com/aymericzip/intlayer-nuxt-template) を参照してください。
30
+ ## 目次
27
31
 
28
- ## Intlayer とは?
32
+ <TOC/>
33
+
34
+ ## Intlayerとは?
29
35
 
30
36
  **Intlayer** は、最新のウェブアプリケーションにおける多言語対応を簡素化するために設計された革新的なオープンソースの国際化(i18n)ライブラリです。
31
37
 
32
- Intlayer を使うことで、以下が可能になります:
38
+ Intlayerを使うことで、以下が可能になります:
33
39
 
34
40
  - **コンポーネントレベルで宣言的な辞書を使い、翻訳を簡単に管理**できます。
35
41
  - **メタデータ、ルート、コンテンツを動的にローカライズ**できます。
36
- - **自動生成された型により TypeScript サポートを確保し、オートコンプリートやエラー検出を向上**させます。
37
- - **動的なロケール検出や切り替えなどの高度な機能**を活用できます。
42
+ - **自動生成された型によりTypeScriptサポートを確保し、オートコンプリートやエラー検出を向上**させます。
43
+ - **動的なロケール検出や切り替えなどの高度な機能**を利用できます。
38
44
 
39
45
  ---
40
46
 
41
- ## Nuxt アプリケーションで Intlayer をセットアップするステップバイステップガイド
47
+ ## NuxtアプリケーションでIntlayerをセットアップするステップバイステップガイド
48
+
49
+ <Tab defaultTab="video">
50
+ <TabItem label="ビデオ" value="video">
51
+
52
+ <iframe title="NuxtとVueアプリをIntlayerで翻訳する方法?Intlayerを発見しよう" class="m-auto aspect-[16/9] w-full overflow-hidden rounded-lg border-0" allow="autoplay; gyroscope;" loading="lazy" width="1080" height="auto" src="https://www.youtube.com/embed/nhUcUAVQ6eQ?autoplay=0&amp;origin=http://intlayer.org&amp;controls=0&amp;rel=1"/>
53
+
54
+ </TabItem>
55
+ <TabItem label="コード" value="code">
56
+
57
+ <iframe
58
+ src="https://stackblitz.com/github/aymericzip/intlayer-nuxt-4-template?embed=1&ctl=1&file=intlayer.config.ts"
59
+ className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
60
+ title="デモ CodeSandbox - Intlayerを使ってアプリケーションを国際化する方法"
61
+ sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
62
+ loading="lazy"
63
+ />
42
64
 
43
- ### ステップ 1: 依存パッケージのインストール
65
+ </TabItem>
66
+ </Tab>
44
67
 
45
- npm を使って必要なパッケージをインストールします:
68
+ GitHubの[アプリケーションテンプレート](https://github.com/aymericzip/intlayer-nuxt-4-template)を参照してください。
69
+
70
+ ### ステップ1: 依存関係のインストール
71
+
72
+ npmを使って必要なパッケージをインストールします:
46
73
 
47
74
  ```bash packageManager="npm"
48
75
  npm install intlayer vue-intlayer
@@ -61,17 +88,17 @@ yarn add --save-dev nuxt-intlayer
61
88
 
62
89
  - **intlayer**
63
90
 
64
- 設定管理、翻訳、[コンテンツ宣言](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/dictionary/get_started.md)、トランスパイル、および[CLIコマンド](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/intlayer_cli.md)のための国際化ツールを提供するコアパッケージです。
91
+ 設定管理、翻訳、[コンテンツ宣言](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/dictionary/content_file.md)、トランスパイル、および[CLIコマンド](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/cli/index.md)のための国際化ツールを提供するコアパッケージです。
65
92
 
66
93
  - **vue-intlayer**
67
- IntlayerをVueアプリケーションに統合するパッケージです。Vueコンポーネント用のコンポーザブルを提供します。
94
+ IntlayerをVueアプリケーションに統合するパッケージです。Vueコンポーネント用のcomposablesを提供します。
68
95
 
69
96
  - **nuxt-intlayer**
70
- NuxtアプリケーションにIntlayerを統合するNuxtモジュールです。自動セットアップ、ロケール検出のためのミドルウェア、クッキー管理、URLリダイレクションを提供します。
97
+ NuxtアプリケーションとIntlayerを統合するNuxtモジュールです。自動セットアップ、ロケール検出のためのミドルウェア、クッキー管理、URLリダイレクトを提供します。
71
98
 
72
99
  ### ステップ2: プロジェクトの設定
73
100
 
74
- アプリケーションの言語を設定するための設定ファイルを作成します:
101
+ アプリケーションの言語を設定するための設定ファイルを作成します。
75
102
 
76
103
  ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
77
104
  import { Locales, type IntlayerConfig } from "intlayer";
@@ -82,13 +109,10 @@ const config: IntlayerConfig = {
82
109
  Locales.ENGLISH,
83
110
  Locales.FRENCH,
84
111
  Locales.SPANISH,
85
- // 他のロケールを追加
112
+ // 他のロケールをここに追加
86
113
  ],
87
114
  defaultLocale: Locales.ENGLISH,
88
115
  },
89
- content: {
90
- contentDir: ["."], // デフォルトではIntlayerは`./src`ディレクトリのコンテンツ宣言ファイルを監視します
91
- },
92
116
  };
93
117
 
94
118
  export default config;
@@ -108,9 +132,6 @@ const config = {
108
132
  ],
109
133
  defaultLocale: Locales.ENGLISH,
110
134
  },
111
- content: {
112
- contentDir: ["."],
113
- },
114
135
  };
115
136
 
116
137
  export default config;
@@ -130,19 +151,16 @@ const config = {
130
151
  ],
131
152
  defaultLocale: Locales.ENGLISH,
132
153
  },
133
- content: {
134
- contentDir: ["."],
135
- },
136
154
  };
137
155
 
138
156
  module.exports = config;
139
157
  ```
140
158
 
141
- > この設定ファイルを通じて、ローカライズされたURL、ミドルウェアのリダイレクション、クッキー名、コンテンツ宣言の場所と拡張子、コンソールでのIntlayerログの無効化などを設定できます。利用可能なパラメータの完全なリストについては、[設定ドキュメント](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/configuration.md)を参照してください。
159
+ > この設定ファイルを通じて、ローカライズされたURL、ミドルウェアのリダイレクション、クッキー名、コンテンツ宣言の場所と拡張子、Intlayerのコンソールログの無効化などを設定できます。利用可能なパラメータの完全なリストについては、[設定ドキュメント](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/configuration.md)を参照してください。
142
160
 
143
161
  ### ステップ3: Nuxt設定にIntlayerを統合する
144
162
 
145
- Nuxtの設定にintlayerモジュールを追加します:
163
+ Nuxtの設定にintlayerモジュールを追加します:
146
164
 
147
165
  ```typescript fileName="nuxt.config.ts"
148
166
  import { defineNuxtConfig } from "nuxt/config";
@@ -153,229 +171,46 @@ export default defineNuxtConfig({
153
171
  });
154
172
  ```
155
173
 
156
- > `nuxt-intlayer` モジュールは、Intlayer と Nuxt の統合を自動的に処理します。コンテンツ宣言の構築を設定し、開発モードでファイルを監視し、ロケール検出のためのミドルウェアを提供し、ローカライズされたルーティングを管理します。
174
+ > `nuxt-intlayer` モジュールは、Intlayer と Nuxt の統合を自動的に処理します。コンテンツ宣言のビルドを設定し、開発モードでファイルを監視し、ロケール検出のためのミドルウェアを提供し、ローカライズされたルーティングを管理します。
157
175
 
158
176
  ### ステップ 4: コンテンツを宣言する
159
177
 
160
178
  翻訳を格納するためのコンテンツ宣言を作成および管理します:
161
179
 
162
- ```tsx fileName="components/helloWorld.content.ts" contentDeclarationFormat="typescript"
163
- import { t, type Dictionary } from "intlayer";
180
+ ```tsx fileName="content/home-page.content.ts" contentDeclarationFormat="typescript"
181
+ import { type Dictionary, t } from "intlayer";
164
182
 
165
- const helloWorldContent = {
166
- key: "helloworld",
183
+ const content = {
184
+ key: "home-page",
167
185
  content: {
168
- count: t({ en: "count is ", fr: "le compte est ", es: "el recuento es " }),
169
- edit: t({
170
- en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
171
- fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
172
- es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
173
- }),
174
- checkOut: t({ en: "Check out ", fr: "Vérifiez ", es: "Compruebe " }),
175
- nuxtIntlayer: t({
176
- en: "Nuxt Intlayer documentation",
177
- fr: "Documentation de Nuxt Intlayer",
178
- es: "Documentación de Nuxt Intlayer",
179
- }),
180
- learnMore: t({
181
- en: "Learn more about Nuxt in the ",
182
- fr: "En savoir plus sur Nuxt dans la ",
183
- es: "Aprenda más sobre Nuxt en la ",
184
- }),
185
- nuxtDocs: t({
186
- en: "Nuxt Documentation",
187
- fr: "Documentation Nuxt",
188
- es: "Documentación de Nuxt",
186
+ title: t({
187
+ en: "Hello world",
188
+ fr: "Bonjour le monde",
189
+ es: "Hola mundo",
189
190
  }),
190
- readTheDocs: t({
191
- en: "Click on the Nuxt logo to learn more",
192
- ja: "詳細を知るにはNuxtのロゴをクリックしてください",
193
- fr: "Cliquez sur le logo Nuxt pour en savoir plus",
194
- es: "Haga clic en el logotipo de Nuxt para obtener más información",
191
+ metaTitle: t({
192
+ en: "Welcome | My Application",
193
+ fr: "Bienvenue | Mon Application",
194
+ es: "Bienvenido | Mi Aplicación",
195
195
  }),
196
- },
197
- } satisfies Dictionary;
198
-
199
- export default helloWorldContent;
200
- fr: "Cliquez sur le logo Nuxt pour en savoir plus",
201
- es: "Haga clic en el logotipo de Nuxt para obtener más información",
196
+ metaDescription: t({
197
+ en: "Discover your multilingual Nuxt app homepage powered by Intlayer.",
198
+ fr: "Découvrez la page d'accueil multilingue de votre application Nuxt propulsée par Intlayer.",
199
+ es: "Descubre la página de inicio multilingüe de tu aplicación Nuxt impulsada por Intlayer.",
202
200
  }),
203
201
  },
204
202
  } satisfies Dictionary;
205
203
 
206
- export default helloWorldContent;
207
- ```
208
-
209
- ```javascript fileName="components/helloWorld.content.mjs" contentDeclarationFormat="esm"
210
- import { t } from "intlayer";
211
-
212
- /** @type {import('intlayer').Dictionary} */
213
- const helloWorldContent = {
214
- key: "helloworld",
215
- content: {
216
- count: t({
217
- en: "count is ",
218
- ja: "カウントは ",
219
- fr: "le compte est ",
220
- es: "el recuento es ",
221
- }),
222
- edit: t({
223
- en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
224
- ja: "<code>components/HelloWorld.vue</code> を編集して保存し、HMRをテストしてください",
225
- fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
226
- es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
227
- }),
228
- checkOut: t({
229
- ja: "チェックしてください ",
230
- en: "Check out ",
231
- fr: "Vérifiez ",
232
- es: "Compruebe ",
233
- }),
234
- nuxtIntlayer: t({
235
- ja: "Nuxt Intlayer ドキュメント",
236
- en: "Nuxt Intlayer documentation",
237
- fr: "Documentation de Nuxt Intlayer",
238
- es: "Documentación de Nuxt Intlayer",
239
- }),
240
- learnMore: t({
241
- ja: "Nuxt について詳しくは ",
242
- en: "Learn more about Nuxt in the ",
243
- fr: "En savoir plus sur Nuxt dans la ",
244
- es: "Aprenda más sobre Nuxt en la ",
245
- }),
246
- nuxtDocs: t({
247
- ja: "Nuxt ドキュメント",
248
- en: "Nuxt Documentation",
249
- fr: "Documentation Nuxt",
250
- es: "Documentación de Nuxt",
251
- }),
252
- readTheDocs: t({
253
- ja: "Nuxt ロゴをクリックして詳細を確認してください",
254
- en: "Click on the Nuxt logo to learn more",
255
- fr: "Cliquez sur le logo Nuxt pour en savoir plus",
256
- es: "Haga clic en el logotipo de Nuxt para obtener más información",
257
- }),
258
- },
259
- };
260
-
261
- export default helloWorldContent;
204
+ export default content;
262
205
  ```
263
206
 
264
- ```javascript fileName="components/helloWorld.content.cjs" contentDeclarationFormat="commonjs"
265
- const { t } = require("intlayer");
266
-
267
- /** @type {import('intlayer').Dictionary} */
268
- const helloWorldContent = {
269
- key: "helloworld",
270
- content: {
271
- count: t({ ja: "カウントは ", en: "count is ", fr: "le compte est ", es: "el recuento es " }),
272
- edit: t({
273
- ja: "<code>components/HelloWorld.vue</code> を編集して保存し、HMRをテストしてください",
274
- en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
275
- fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
276
- es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
277
- }),
278
- checkOut: t({ ja: "チェックしてください ", en: "Check out ", fr: "Vérifiez ", es: "Compruebe " }),
279
- nuxtIntlayer: t({
280
- ja: "Nuxt Intlayer ドキュメント",
281
- en: "Nuxt Intlayer documentation",
282
- fr: "Documentation de Nuxt Intlayer",
283
- es: "Documentación de Nuxt Intlayer",
284
- }),
285
- es: "Nuxt Intlayerのドキュメント",
286
- }),
287
- learnMore: t({
288
- en: "Learn more about Nuxt in the ",
289
- fr: "En savoir plus sur Nuxt dans la ",
290
- es: "Aprenda más sobre Nuxt en la ",
291
- ja: "Nuxtについて詳しくは、",
292
- }),
293
- nuxtDocs: t({
294
- en: "Nuxt Documentation",
295
- fr: "Documentation Nuxt",
296
- es: "Documentación de Nuxt",
297
- ja: "Nuxtドキュメント",
298
- }),
299
- readTheDocs: t({
300
- en: "Click on the Nuxt logo to learn more",
301
- fr: "Cliquez sur le logo Nuxt pour en savoir plus",
302
- es: "Haga clic en el logotipo de Nuxt para obtener más información",
303
- ja: "Nuxtのロゴをクリックして詳細を確認してください",
304
- }),
305
- },
306
- };
207
+ > コンテンツ宣言は、`contentDir` ディレクトリ(デフォルトは `./src`)に含まれている限り、アプリケーションのどこにでも定義できます。また、コンテンツ宣言ファイルの拡張子(デフォルトは `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`)に一致している必要があります。
307
208
 
308
- module.exports = helloWorldContent;
309
- ```
310
-
311
- ```json fileName="components/helloWorld.content.json" contentDeclarationFormat="json"
312
- {
313
- "$schema": "https://intlayer.org/schema.json",
314
- "key": "helloworld",
315
- "content": {
316
- "count": {
317
- "nodeType": "translation",
318
- "translation": {
319
- "en": "count is ",
320
- "fr": "le compte est ",
321
- "es": "el recuento es ",
322
- "ja": "カウントは "
323
- }
324
- },
325
- "edit": {
326
- "nodeType": "translation",
327
- "translation": {
328
- "en": "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
329
- "fr": "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
330
- "es": "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
331
- "ja": "<code>components/HelloWorld.vue</code> を編集して保存し、HMRをテストしてください"
332
- }
333
- },
334
- "checkOut": {
335
- "nodeType": "translation",
336
- "translation": {
337
- "en": "Check out ",
338
- "fr": "Vérifiez ",
339
- "es": "Compruebe ",
340
- "ja": "チェックしてください "
341
- }
342
- },
343
- "nuxtIntlayer": {
344
- "nodeType": "translation",
345
- "translation": {
346
- "ja": "Nuxt Intlayer ドキュメント"
347
- }
348
- },
349
- "learnMore": {
350
- "nodeType": "translation",
351
- "translation": {
352
- "ja": "Nuxt について詳しくは "
353
- }
354
- },
355
- "nuxtDocs": {
356
- "nodeType": "translation",
357
- "translation": {
358
- "ja": "Nuxt ドキュメント"
359
- }
360
- },
361
- "readTheDocs": {
362
- "nodeType": "translation",
363
- "translation": {
364
- "ja": "Nuxt ロゴをクリックして詳細を確認してください"
365
- "es": "Haga clic en el logotipo de Nuxt para obtener más información"
366
- }
367
- }
368
- }
369
- }
370
- ```
371
-
372
- > あなたのコンテンツ宣言は、`contentDir` ディレクトリ(デフォルトは `./src`)内に含まれている限り、アプリケーションのどこにでも定義できます。また、コンテンツ宣言ファイルの拡張子(デフォルトは `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`)に一致している必要があります。
373
-
374
- > 詳細については、[コンテンツ宣言のドキュメント](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/dictionary/get_started.md)を参照してください。
209
+ > 詳細については、[コンテンツ宣言ドキュメント](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/dictionary/content_file.md)を参照してください。
375
210
 
376
211
  ### ステップ5: コード内でIntlayerを利用する
377
212
 
378
- `useIntlayer` コンポーザブルを使って、Nuxtアプリケーション全体でコンテンツ辞書にアクセスします:
213
+ `useIntlayer`コンポーザブルを使って、Nuxtアプリケーション全体でコンテンツ辞書にアクセスします:
379
214
 
380
215
  ```vue fileName="components/HelloWorld.vue"
381
216
  <script setup lang="ts">
@@ -413,97 +248,87 @@ const countRef = ref(0);
413
248
  <checkOut />
414
249
  <a href="https://nuxt.com/docs/getting-started/introduction" target="_blank"
415
250
  >Nuxt</a
416
- >, <nuxtIntlayer />
251
+ >、<nuxtIntlayer />
417
252
  </p>
418
253
  <p>
419
254
  <learnMore />
420
- <a href="https://nuxt.com" target="_blank"><nuxtDocs /></a>.
255
+ <a href="https://nuxt.com" target="_blank"><nuxtDocs /></a>。
421
256
  </p>
422
257
  <p class="read-the-docs"><readTheDocs /></p>
423
258
  <p class="read-the-docs">{{ readTheDocs }}</p>
424
259
  </template>
425
260
  ```
426
261
 
427
- #### Intlayerでのコンテンツへのアクセス
262
+ #### Intlayerでのコンテンツアクセス
428
263
 
429
- Intlayerは、コンテンツにアクセスするためのさまざまなAPIを提供しています。
264
+ IntlayerはコンテンツにアクセスするためのさまざまなAPIを提供しています:
430
265
 
431
266
  - **コンポーネントベースの構文**(推奨):
432
- `<myContent />` または `<Component :is="myContent" />` の構文を使用して、Intlayerノードとしてコンテンツをレンダリングします。これは[ビジュアルエディター](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/intlayer_visual_editor.md)[CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/intlayer_CMS.md)とシームレスに統合されます。
267
+ `<myContent />` または `<Component :is="myContent" />` の構文を使用して、コンテンツを Intlayer ノードとしてレンダリングします。これは [Visual Editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/intlayer_visual_editor.md) および [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/intlayer_CMS.md) とシームレスに統合されます。
433
268
 
434
- - **文字列ベースの構文**:
435
- `{{ myContent }}` を使用して、ビジュアルエディターのサポートなしにプレーンテキストとしてコンテンツをレンダリングします。
269
+ - **文字列ベースの構文**:
270
+ `{{ myContent }}` を使用して、Visual Editor のサポートなしにプレーンテキストとしてコンテンツをレンダリングします。
436
271
 
437
- - **生のHTML構文**:
438
- `<div v-html="myContent" />` を使用して、ビジュアルエディターのサポートなしに生のHTMLとしてコンテンツをレンダリングします。
272
+ - **生の HTML 構文**:
273
+ `<div v-html="myContent" />` を使用して、Visual Editor のサポートなしに生の HTML としてコンテンツをレンダリングします。
439
274
 
440
- - **分割代入構文**:
441
- `useIntlayer` コンポーザブルは、コンテンツを含む Proxy を返します。この Proxy はリアクティビティを維持しながらコンテンツにアクセスするために分割代入(デストラクチャリング)できます。
442
- - `const content = useIntlayer("myContent");` を使い、`{{ content.myContent }}` または `<content.myContent />` として使用します。
443
- - または `const { myContent } = useIntlayer("myContent");` を使い、`{{ myContent }}` または `<myContent/>` として分割代入して使用します。
275
+ - **分割代入構文**:
276
+ `useIntlayer` コンポーザブルはコンテンツを含む Proxy を返します。この Proxy はリアクティビティを保ちながらコンテンツにアクセスするために分割代入可能です。
277
+ - `const content = useIntlayer("myContent");` を使用し、`{{ content.myContent }}` / `<content.myContent />` としてレンダリングします。
278
+ - または、`const { myContent } = useIntlayer("myContent");` を使用してコンテンツを分割代入し、`{{ myContent }}` / `<myContent/>` としてレンダリングします。
444
279
 
445
280
  ### (オプション)ステップ6: コンテンツの言語を変更する
446
281
 
447
- コンテンツの言語を変更するには、`useLocale` コンポーザブルが提供する `setLocale` 関数を使用します。この関数を使うことで、アプリケーションのロケールを設定し、それに応じてコンテンツを更新できます。
282
+ コンテンツの言語を変更するには、`useLocale` コンポーザブルが提供する `setLocale` 関数を使用します。この関数により、アプリケーションのロケールを設定し、それに応じてコンテンツを更新できます。
448
283
 
449
- 言語を切り替えるコンポーネントを作成します:
284
+ `NuxtLink` を使用して言語を切り替えるコンポーネントを作成します。**ロケール切り替えにボタンではなくリンクを使うことは、SEOやページの発見性向上のベストプラクティスです**。これにより、検索エンジンがすべてのローカライズされたページをクロールしインデックス化できます。
450
285
 
451
286
  ```vue fileName="components/LocaleSwitcher.vue"
452
- <template>
453
- <div class="locale-switcher">
454
- <select v-model="selectedLocale" @change="changeLocale">
455
- <option v-for="loc in availableLocales" :key="loc" :value="loc">
456
- {{ getLocaleName(loc) }}
457
- </option>
458
- </select>
459
- </div>
460
- </template>
461
-
462
287
  <script setup lang="ts">
463
- import { ref, watch } from "vue";
464
- import { getLocaleName } from "intlayer";
288
+ import { getLocaleName, getLocalizedUrl } from "intlayer";
465
289
  import { useLocale } from "vue-intlayer";
466
290
 
467
- // ロケール情報と setLocale 関数を取得
291
+ // NuxtはuseRouteを自動インポートします
292
+ const route = useRoute();
468
293
  const { locale, availableLocales, setLocale } = useLocale();
469
-
470
- // ref で選択されたロケールを追跡
471
- const selectedLocale = ref(locale.value);
472
-
473
- // 選択が変更されたときにロケールを更新
474
- const changeLocale = () => setLocale(selectedLocale.value);
475
-
476
- // selectedLocale をグローバルロケールと同期させる
477
- watch(
478
- () => locale.value,
479
- (newLocale) => {
480
- selectedLocale.value = newLocale;
481
- }
482
- );
483
294
  </script>
295
+
296
+ <template>
297
+ <nav class="locale-switcher">
298
+ <NuxtLink
299
+ v-for="localeEl in availableLocales"
300
+ :key="localeEl"
301
+ :to="getLocalizedUrl(route.fullPath, localeEl)"
302
+ class="locale-link"
303
+ :class="{ 'active-locale': localeEl === locale }"
304
+ @click="setLocale(localeEl)"
305
+ >
306
+ {{ getLocaleName(localeEl) }}
307
+ </NuxtLink>
308
+ </nav>
484
309
  </template>
310
+ ```
485
311
 
486
- <style scoped>
487
- .locale-switcher {
488
- margin: 1rem 0;
489
- }
312
+ > `NuxtLink` を適切な `href` 属性(`getLocalizedUrl` 経由)と共に使用することで、検索エンジンがページのすべての言語バリアントを検出できるようになります。これは、検索エンジンクローラーが追跡しない可能性のあるJavaScriptのみのロケール切り替えよりも望ましい方法です。
490
313
 
491
- select {
492
- padding: 0.5rem;
493
- border-radius: 0.25rem;
494
- border: 1px solid #ccc;
495
- }
496
- </style>
314
+ 次に、`app.vue` を設定してレイアウトを使用します:
315
+
316
+ ```vue fileName="app.vue"
317
+ <template>
318
+ <NuxtLayout>
319
+ <NuxtPage />
320
+ </NuxtLayout>
321
+ </template>
497
322
  ```
498
323
 
499
- 次に、このコンポーネントをページやレイアウトで使用します:
324
+ ### (オプション)ステップ6b:ナビゲーション付きレイアウトの作成
500
325
 
501
- ```vue fileName="app.vue"
326
+ Nuxtのレイアウトを使うと、ページの共通構造を定義できます。ロケールスイッチャーとナビゲーションを含むデフォルトレイアウトを作成しましょう:
327
+
328
+ ```vue fileName="layouts/default.vue"
502
329
  <script setup lang="ts">
503
- import { useIntlayer } from "vue-intlayer";
330
+ import Links from "~/components/Links.vue";
504
331
  import LocaleSwitcher from "~/components/LocaleSwitcher.vue";
505
-
506
- const content = useIntlayer("app"); // 関連するintlayer宣言ファイルを作成
507
332
  </script>
508
333
 
509
334
  <template>
@@ -512,17 +337,22 @@ const content = useIntlayer("app"); // 関連するintlayer宣言ファイルを
512
337
  <LocaleSwitcher />
513
338
  </header>
514
339
  <main>
515
- <NuxtPage />
340
+ <slot />
516
341
  </main>
342
+
343
+ <Links href="/">ホーム</Links>
344
+ <Links href="/about">アバウト</Links>
517
345
  </div>
518
346
  </template>
519
347
  ```
520
348
 
521
- ### (オプション)ステップ7:アプリケーションにローカライズされたルーティングを追加する
349
+ `Links` コンポーネント(以下に示す)は、内部ナビゲーションリンクが自動的にローカライズされることを保証します。
350
+
351
+ ### (オプション)ステップ7: アプリケーションにローカライズされたルーティングを追加する
522
352
 
523
- Nuxtは、`nuxt-intlayer`モジュールを使用すると、自動的にローカライズされたルーティングを処理します。これにより、ページディレクトリ構造に基づいて各言語のルートが自動的に作成されます。
353
+ `nuxt-intlayer` モジュールを使用すると、Nuxtはローカライズされたルーティングを自動的に処理します。これは、ページのディレクトリ構造に基づいて各言語のルートを自動的に作成します。
524
354
 
525
- 例:
355
+ 例:
526
356
 
527
357
  ```plaintext
528
358
  pages/
@@ -532,273 +362,320 @@ pages/
532
362
  └── index.vue → /contact, /fr/contact, /es/contact
533
363
  ```
534
364
 
535
- ローカライズされたページを作成するには、単に`pages/`ディレクトリにVueファイルを作成します:
365
+ ローカライズされたページを作成するには、単に `pages/` ディレクトリに Vue ファイルを作成します。以下に2つの例を示します。
536
366
 
537
- ```vue fileName="pages/about.vue"
367
+ **ホームページ (`pages/index.vue`):**
368
+
369
+ ```vue fileName="pages/index.vue"
538
370
  <script setup lang="ts">
539
371
  import { useIntlayer } from "vue-intlayer";
540
372
 
541
- const content = useIntlayer("about");
373
+ const content = useIntlayer("home-page");
374
+
375
+ useHead({
376
+ title: content.metaTitle.value,
377
+ meta: [
378
+ {
379
+ name: "description",
380
+ content: content.metaDescription.value,
381
+ },
382
+ ],
383
+ });
542
384
  </script>
543
385
 
544
386
  <template>
545
- <div>
546
- <h1>{{ content.title }}</h1>
547
- <p>{{ content.description }}</p>
548
- </div>
387
+ <h1><content.title /></h1>
549
388
  </template>
550
389
  ```
551
390
 
552
- `nuxt-intlayer`モジュールは自動的に以下を行います:
391
+ **アバウトページ (`pages/about.vue`):**
553
392
 
554
- - ユーザーの優先ロケールを検出する
555
- - URLを介したロケール切り替えを処理する
556
- - 適切な `<html lang="">` 属性を設定する
557
- - ロケールクッキーを管理する
558
- - ユーザーを適切なローカライズされたURLにリダイレクトする
393
+ ```vue fileName="pages/about.vue"
394
+ <script setup lang="ts">
395
+ import { useIntlayer } from "vue-intlayer";
559
396
 
560
- ### (オプション)ステップ8:ローカライズされたリンクコンポーネントの作成
397
+ const content = useIntlayer("about-page");
561
398
 
562
- アプリケーションのナビゲーションが現在のロケールを尊重するようにするために、カスタムの `LocalizedLink` コンポーネントを作成できます。このコンポーネントは内部URLに自動的に現在の言語をプレフィックスとして付加します。
399
+ useHead({
400
+ title: content.metaTitle.raw, // プリミティブ文字列アクセスには .raw を使用
401
+ meta: [
402
+ {
403
+ name: "description",
404
+ content: content.metaDescription.raw, // プリミティブな文字列アクセスには .raw を使用
405
+ },
406
+ ],
407
+ });
408
+ </script>
563
409
 
564
- ```vue fileName="components/LocalizedLink.vue"
565
410
  <template>
566
- <NuxtLink :to="localizedHref" v-bind="$attrs">
567
- <slot />
568
- </NuxtLink>
411
+ <h1><content.title /></h1>
569
412
  </template>
413
+ ```
570
414
 
415
+ > 注意: `useHead` は Nuxt で自動インポートされます。コンテンツの値には `.value`(リアクティブ)または `.raw`(プリミティブ文字列)を用途に応じて使用できます。
416
+
417
+ `nuxt-intlayer` モジュールは自動的に以下を行います:
418
+
419
+ - ユーザーの優先ロケールを検出
420
+ - URL を介したロケール切り替えの処理
421
+ - 適切な `<html lang="">` 属性の設定
422
+ - ロケールクッキーの管理
423
+ - ユーザーを適切なローカライズされた URL にリダイレクト
424
+
425
+ ### (オプション)ステップ8:ローカライズされたリンクコンポーネントの作成
426
+
427
+ アプリケーションのナビゲーションが現在のロケールを尊重するようにするために、カスタムの `Links` コンポーネントを作成できます。このコンポーネントは内部URLに自動的に現在の言語をプレフィックスとして付加し、これは**SEOおよびページの発見性**に不可欠です。
428
+
429
+ ```vue fileName="components/Links.vue"
571
430
  <script setup lang="ts">
572
- import { computed } from "vue";
573
431
  import { getLocalizedUrl } from "intlayer";
574
432
  import { useLocale } from "vue-intlayer";
575
433
 
576
- const props = defineProps({
577
- to: {
578
- type: String,
579
- required: true,
580
- },
581
- });
434
+ interface Props {
435
+ href: string;
436
+ locale?: string;
437
+ }
438
+
439
+ const props = defineProps<Props>();
582
440
 
583
- const { locale } = useLocale();
441
+ const { locale: currentLocale } = useLocale();
584
442
 
585
- // リンクが外部リンクかどうかをチェック
586
- const isExternalLink = computed(() => /^https?:\/\//.test(props.to || ""));
443
+ // 最終的なパスを計算する
444
+ const finalPath = computed(() => {
445
+ // 1. リンクが外部かどうかをチェック
446
+ const isExternal = /^https?:\/\//.test(props.href || "");
587
447
 
588
- // 内部リンクの場合はローカライズされたhrefを作成
589
- const localizedHref = computed(() =>
590
- isExternalLink.value ? props.to : getLocalizedUrl(props.to, locale.value)
591
- );
448
+ // 2. 外部の場合はそのまま返す(NuxtLinkが<a>タグの生成を処理)
449
+ if (isExternal) return props.href;
450
+
451
+ // 3. 内部リンクの場合、URLをローカライズする
452
+ const targetLocale = props.locale || currentLocale.value;
453
+ return getLocalizedUrl(props.href, targetLocale);
454
+ });
592
455
  </script>
456
+
457
+ <template>
458
+ <NuxtLink :to="finalPath" v-bind="$attrs">
459
+ <slot />
460
+ </NuxtLink>
461
+ </template>
593
462
  ```
594
463
 
595
- 次に、このコンポーネントをアプリケーション全体で使用します:
464
+ 次に、このコンポーネントをアプリケーション全体で使用します:
465
+
466
+ ```vue fileName="layouts/default.vue"
467
+ <script setup lang="ts">
468
+ import Links from "~/components/Links.vue";
469
+ import LocaleSwitcher from "~/components/LocaleSwitcher.vue";
470
+ </script>
596
471
 
597
- ```vue fileName="pages/index.vue"
598
472
  <template>
599
473
  <div>
600
- <LocalizedLink to="/about">
601
- {{ content.aboutLink }}
602
- </LocalizedLink>
603
- <LocalizedLink to="/contact">
604
- {{ content.contactLink }}
605
- </LocalizedLink>
474
+ <header>
475
+ <LocaleSwitcher />
476
+ </header>
477
+ <main>
478
+ <slot />
479
+ </main>
480
+
481
+ <Links href="/">ホーム</Links>
482
+ <Links href="/about">アバウト</Links>
606
483
  </div>
607
484
  </template>
608
-
609
- <script setup lang="ts">
610
- import { useIntlayer } from "vue-intlayer";
611
- import LocalizedLink from "~/components/LocalizedLink.vue";
612
-
613
- const content = useIntlayer("home");
614
- </script>
615
485
  ```
616
486
 
487
+ > `NuxtLink` をローカライズされたパスで使用することで、以下を保証できます:
488
+ >
489
+ > - 検索エンジンがすべての言語バージョンのページをクロールおよびインデックスできる
490
+ > - ユーザーがローカライズされたURLを直接共有できる
491
+ > - ブラウザの履歴がロケール接頭辞付きURLで正しく動作する
492
+
617
493
  ### (オプション)ステップ9:メタデータとSEOの処理
618
494
 
619
- Nuxtは優れたSEO機能を提供します。Intlayerを使ってローカライズされたメタデータを管理できます:
495
+ Nuxtは `useHead` コンポーザブル(自動インポート)を通じて優れたSEO機能を提供します。Intlayerを使って、`.raw` または `.value` アクセサを用いてプリミティブな文字列値を取得し、ローカライズされたメタデータを扱うことができます:
620
496
 
621
497
  ```vue fileName="pages/about.vue"
622
498
  <script setup lang="ts">
623
- import { useSeoMeta } from "nuxt/app";
624
- import { getIntlayer } from "intlayer";
625
- import { useLocale } from "vue-intlayer";
499
+ import { useIntlayer } from "vue-intlayer";
626
500
 
627
- const { locale } = useLocale();
628
- const content = getIntlayer("about-meta", locale.value);
501
+ // useHeadはNuxtで自動インポートされます
502
+ const content = useIntlayer("about-page");
629
503
 
630
- useSeoMeta({
631
- title: content.title,
632
- description: content.description,
504
+ useHead({
505
+ title: content.metaTitle.raw, // プリミティブな文字列アクセスには .raw を使用
506
+ meta: [
507
+ {
508
+ name: "description",
509
+ content: content.metaDescription.raw, // プリミティブな文字列アクセスには .raw を使用
510
+ },
511
+ ],
633
512
  });
634
513
  </script>
635
514
 
636
515
  <template>
637
- <div>
638
- <h1>{{ content.pageTitle }}</h1>
639
- <p>{{ content.pageContent }}</p>
640
- </div>
516
+ <h1><content.title /></h1>
641
517
  </template>
642
518
  ```
643
519
 
644
- 対応するコンテンツ宣言を作成します:
520
+ > あるいは、Vueのリアクティビティなしでコンテンツを取得するために `import { getIntlayer } from "intlayer"` 関数を使用することもできます。
521
+
522
+ > **コンテンツ値へのアクセス方法:**
523
+ >
524
+ > - プリミティブな文字列値(非リアクティブ)を取得するには `.raw` を使用
525
+ > - リアクティブな値を取得するには `.value` を使用
526
+ > - Visual Editorサポートのために `<content.key />` コンポーネント構文を使用
645
527
 
646
- ```ts fileName="pages/about-meta.content.ts"
528
+ 対応するコンテンツ宣言を作成します:
529
+
530
+ ```ts fileName="pages/about-page.content.ts" contentDeclarationFormat="typescript"
647
531
  import { t, type Dictionary } from "intlayer";
648
- import type { useSeoMeta } from "nuxt/app";
649
532
 
650
- const aboutMetaContent = {
651
- key: "about-meta",
533
+ const aboutPageContent = {
534
+ key: "about-page",
652
535
  content: {
653
- title: t({
654
- ja: "私たちについて - 私の会社",
536
+ metaTitle: t({
655
537
  en: "About Us - My Company",
656
538
  fr: "À Propos - Ma Société",
657
539
  es: "Acerca de Nosotros - Mi Empresa",
658
540
  }),
659
- description: t({
660
- ja: "私たちの会社と使命についてもっと知る",
541
+ metaDescription: t({
542
+ ja: "私たちの会社とミッションについて詳しく知る",
661
543
  en: "Learn more about our company and our mission",
662
544
  fr: "En savoir plus sur notre société et notre mission",
663
545
  es: "Conozca más sobre nuestra empresa y nuestra misión",
664
546
  }),
547
+ title: t({
548
+ ja: "私たちについて",
549
+ en: "About Us",
550
+ fr: "À Propos",
551
+ es: "Acerca de Nosotros",
552
+ }),
665
553
  },
666
- } satisfies Dictionary<Parameters<typeof useSeoMeta>[0]>;
554
+ } satisfies Dictionary;
667
555
 
668
- export default aboutMetaContent;
556
+ export default aboutPageContent;
669
557
  ```
670
558
 
671
- ```typescript fileName="pages/about-meta.content.mjs" contentDeclarationFormat="esm"
559
+ ```javascript fileName="pages/about-page.content.mjs" contentDeclarationFormat="esm"
672
560
  import { t } from "intlayer";
673
561
 
674
562
  /** @type {import('intlayer').Dictionary} */
675
- const aboutMetaContent = {
676
- key: "about-meta",
563
+ const aboutPageContent = {
564
+ key: "about-page",
677
565
  content: {
678
- title: t({
679
- zh: "关于我们 - 我的公司",
566
+ metaTitle: t({
680
567
  ja: "私たちについて - 私の会社",
681
568
  en: "About Us - My Company",
682
569
  fr: "À Propos - Ma Société",
683
570
  es: "Acerca de Nosotros - Mi Empresa",
684
571
  }),
685
- description: t({
686
- zh: "了解更多关于我们公司和我们的使命",
687
- ja: "私たちの会社と使命について詳しく知る",
688
- en: "Learn more about our company and our mission",
572
+ metaDescription: t({
573
+ en: "私たちの会社とミッションについて詳しく知る",
689
574
  fr: "En savoir plus sur notre société et notre mission",
690
575
  es: "Conozca más sobre nuestra empresa y nuestra misión",
691
576
  }),
577
+ title: t({
578
+ en: "私たちについて",
579
+ fr: "À Propos",
580
+ es: "Acerca de Nosotros",
581
+ }),
692
582
  },
693
583
  };
694
584
 
695
- export default aboutMetaContent;
585
+ export default aboutPageContent;
696
586
  ```
697
587
 
698
- ```typescript fileName="pages/about-meta.content.js" contentDeclarationFormat="cjs"
588
+ ```javascript fileName="pages/about-page.content.cjs" contentDeclarationFormat="commonjs"
699
589
  const { t } = require("intlayer");
700
590
 
701
591
  /** @type {import('intlayer').Dictionary} */
702
- const aboutMetaContent = {
703
- key: "about-meta",
592
+ const aboutPageContent = {
593
+ key: "about-page",
704
594
  content: {
705
- title: t({
706
- zh: "关于我们 - 我的公司",
707
- ja: "私たちについて - 私の会社",
708
- en: "About Us - My Company",
595
+ metaTitle: t({
596
+ en: "私たちについて - マイカンパニー",
709
597
  fr: "À Propos - Ma Société",
710
598
  es: "Acerca de Nosotros - Mi Empresa",
711
599
  }),
712
- description: t({
713
- zh: "了解更多关于我们公司和我们的使命",
600
+ metaDescription: t({
714
601
  en: "Learn more about our company and our mission",
715
602
  fr: "En savoir plus sur notre société et notre mission",
716
603
  es: "Conozca más sobre nuestra empresa y nuestra misión",
717
- ja: "私たちの会社と使命についてもっと知る",
604
+ }),
605
+ title: t({
606
+ en: "About Us",
607
+ fr: "À Propos",
608
+ es: "Acerca de Nosotros",
718
609
  }),
719
610
  },
720
611
  };
721
612
 
722
- module.exports = aboutMetaContent;
613
+ module.exports = aboutPageContent;
723
614
  ```
724
615
 
725
- ```json fileName="pages/about-meta.content.json" contentDeclarationFormat="json"
616
+ ```json fileName="pages/about-page.content.json" contentDeclarationFormat="json"
726
617
  {
727
- "key": "about-meta",
618
+ "$schema": "https://intlayer.org/schema.json",
619
+ "key": "about-page",
728
620
  "content": {
729
- "title": {
621
+ "metaTitle": {
730
622
  "nodeType": "translation",
731
- "translations": {
732
- "zh": "关于我们 - 我的公司",
623
+ "translation": {
733
624
  "en": "About Us - My Company",
734
625
  "fr": "À Propos - Ma Société",
735
- "es": "Acerca de Nosotros - Mi Empresa",
736
- "ja": "私たちについて - 私の会社"
626
+ "es": "Acerca de Nosotros - Mi Empresa"
737
627
  }
738
628
  },
739
- "description": {
629
+ "metaDescription": {
740
630
  "nodeType": "translation",
741
- "translations": {
742
- "zh": "了解更多关于我们公司和我们的使命",
631
+ "translation": {
743
632
  "en": "Learn more about our company and our mission",
744
633
  "fr": "En savoir plus sur notre société et notre mission",
745
- "es": "Conozca más sobre nuestra empresa y nuestra misión"
634
+ "es": "Conozca más sobre nuestra empresa y nuestra misión",
635
+ "ja": "当社と当社のミッションについて詳しく知る"
636
+ }
637
+ },
638
+ "title": {
639
+ "nodeType": "translation",
640
+ "translation": {
641
+ "en": "About Us",
642
+ "fr": "À Propos",
643
+ "es": "Acerca de Nosotros",
644
+ "ja": "私たちについて"
746
645
  }
747
646
  }
748
647
  }
749
648
  }
750
649
  ```
751
650
 
752
- ### TypeScriptの設定
651
+ ### Gitの設定
753
652
 
754
- Intlayerはモジュール拡張を使用してTypeScriptの利点を活かし、コードベースをより強固にします。
653
+ Intlayerによって生成されたファイルは無視することを推奨します。これにより、Gitリポジトリへの不要なコミットを防ぐことができます。
755
654
 
756
- ![Autocompletion](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true)
757
-
758
- ![Translation error](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png?raw=true)
759
-
760
- TypeScriptの設定に自動生成された型が含まれていることを確認してください。
761
-
762
- ```json5 fileName="tsconfig.json"
763
- {
764
- // ... 既存のTypeScript設定
765
- "include": [
766
- // ... 既存の TypeScript 設定
767
- ".intlayer/**/*.ts", // 自動生成された型を含める
768
- ],
769
- }
770
- ```
771
-
772
- ### Git 設定
773
-
774
- Intlayer によって生成されたファイルは無視することを推奨します。これにより、Git リポジトリに誤ってコミットするのを防げます。
775
-
776
- これを行うには、`.gitignore` ファイルに以下の指示を追加してください。
655
+ これを行うには、`.gitignore`ファイルに以下の指示を追加してください。
777
656
 
778
657
  ```plaintext fileName=".gitignore"
779
- # Intlayer によって生成されたファイルを無視する
658
+ # Intlayerによって生成されたファイルを無視する
780
659
  .intlayer
781
660
  ```
782
661
 
783
- ### VS Code 拡張機能
662
+ ### VS Code拡張機能
784
663
 
785
- Intlayer を使った開発体験を向上させるために、公式の **Intlayer VS Code 拡張機能** をインストールできます。
664
+ Intlayerでの開発体験を向上させるために、公式の**Intlayer VS Code拡張機能**をインストールできます。
786
665
 
787
- [VS Code Marketplace からインストール](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
666
+ [VS Codeマーケットプレイスからインストール](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
788
667
 
789
668
  この拡張機能は以下を提供します:
790
669
 
791
- - 翻訳キーの **オートコンプリート**
792
- - **翻訳が不足している場合のリアルタイムエラー検出**。
793
- - **翻訳内容のインラインプレビュー**。
794
- - **翻訳の作成や更新を簡単に行うクイックアクション**。
670
+ - 翻訳キーの**オートコンプリート**。
671
+ - 欠落している翻訳の**リアルタイムエラー検出**。
672
+ - 翻訳されたコンテンツの**インラインプレビュー**。
673
+ - 翻訳を簡単に作成・更新できる**クイックアクション**。
795
674
 
796
675
  拡張機能の使い方の詳細については、[Intlayer VS Code拡張機能のドキュメント](https://intlayer.org/doc/vs-code-extension)を参照してください。
797
676
 
798
677
  ---
799
678
 
800
- ### さらに進むために
801
-
802
- さらに進むには、[ビジュアルエディター](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/intlayer_visual_editor.md)を実装するか、[CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/intlayer_CMS.md)を使用してコンテンツを外部化することができます。
679
+ ### さらに進む
803
680
 
804
- ---
681
+ さらに進めるには、[ビジュアルエディター](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/intlayer_visual_editor.md)を実装するか、[CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/intlayer_CMS.md)を使用してコンテンツを外部化することができます。