@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.
- package/dist/cjs/generated/docs.entry.cjs +19 -0
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/esm/generated/docs.entry.mjs +19 -0
- package/dist/esm/generated/docs.entry.mjs.map +1 -1
- package/dist/types/generated/docs.entry.d.ts +1 -0
- package/dist/types/generated/docs.entry.d.ts.map +1 -1
- package/docs/ar/intlayer_with_nuxt.md +294 -438
- package/docs/ar/intlayer_with_react_router_v7.md +33 -4
- package/docs/ar/intlayer_with_react_router_v7_fs_routes.md +516 -0
- package/docs/ar/intlayer_with_tanstack.md +2 -12
- package/docs/ar/intlayer_with_vite+vue.md +1 -0
- package/docs/de/intlayer_with_nuxt.md +284 -410
- package/docs/de/intlayer_with_react_router_v7.md +33 -4
- package/docs/de/intlayer_with_react_router_v7_fs_routes.md +573 -0
- package/docs/de/intlayer_with_tanstack.md +1 -0
- package/docs/de/intlayer_with_vite+vue.md +1 -0
- package/docs/en/intlayer_with_nuxt.md +237 -341
- package/docs/en/intlayer_with_react_router_v7.md +24 -0
- package/docs/en/intlayer_with_react_router_v7_fs_routes.md +570 -0
- package/docs/en/intlayer_with_tanstack.md +2 -12
- package/docs/en/intlayer_with_vite+vue.md +49 -48
- package/docs/en-GB/intlayer_with_nuxt.md +254 -378
- package/docs/en-GB/intlayer_with_react_router_v7.md +33 -4
- package/docs/en-GB/intlayer_with_react_router_v7_fs_routes.md +513 -0
- package/docs/en-GB/intlayer_with_tanstack.md +2 -12
- package/docs/en-GB/intlayer_with_vite+vue.md +1 -0
- package/docs/es/intlayer_with_nuxt.md +271 -390
- package/docs/es/intlayer_with_react_router_v7.md +33 -4
- package/docs/es/intlayer_with_react_router_v7_fs_routes.md +575 -0
- package/docs/es/intlayer_with_tanstack.md +1 -0
- package/docs/es/intlayer_with_vite+vue.md +1 -2
- package/docs/fr/intlayer_with_nuxt.md +278 -405
- package/docs/fr/intlayer_with_react_router_v7.md +34 -5
- package/docs/fr/intlayer_with_react_router_v7_fs_routes.md +574 -0
- package/docs/fr/intlayer_with_tanstack.md +1 -0
- package/docs/fr/intlayer_with_vite+vue.md +1 -0
- package/docs/hi/intlayer_with_nuxt.md +303 -447
- package/docs/hi/intlayer_with_react_router_v7.md +33 -4
- package/docs/hi/intlayer_with_react_router_v7_fs_routes.md +518 -0
- package/docs/hi/intlayer_with_tanstack.md +2 -12
- package/docs/hi/intlayer_with_vite+vue.md +1 -0
- package/docs/id/intlayer_with_nuxt.md +266 -395
- package/docs/id/intlayer_with_react_router_v7.md +29 -4
- package/docs/id/intlayer_with_react_router_v7_fs_routes.md +521 -0
- package/docs/id/intlayer_with_tanstack.md +2 -12
- package/docs/id/intlayer_with_vite+vue.md +1 -0
- package/docs/it/intlayer_with_nuxt.md +299 -423
- package/docs/it/intlayer_with_react_router_v7.md +33 -4
- package/docs/it/intlayer_with_react_router_v7_fs_routes.md +574 -0
- package/docs/it/intlayer_with_tanstack.md +1 -0
- package/docs/ja/intlayer_with_nuxt.md +309 -432
- package/docs/ja/intlayer_with_react_router_v7.md +33 -4
- package/docs/ja/intlayer_with_react_router_v7_fs_routes.md +574 -0
- package/docs/ja/intlayer_with_tanstack.md +2 -12
- package/docs/ja/intlayer_with_vite+vue.md +1 -0
- package/docs/ko/intlayer_with_nuxt.md +295 -422
- package/docs/ko/intlayer_with_react_router_v7.md +33 -4
- package/docs/ko/intlayer_with_react_router_v7_fs_routes.md +515 -0
- package/docs/ko/intlayer_with_tanstack.md +2 -12
- package/docs/ko/intlayer_with_vite+vue.md +1 -0
- package/docs/pl/intlayer_with_nuxt.md +273 -476
- package/docs/pl/intlayer_with_react_router_v7.md +32 -5
- package/docs/pl/intlayer_with_react_router_v7_fs_routes.md +615 -0
- package/docs/pl/intlayer_with_tanstack.md +2 -12
- package/docs/pl/intlayer_with_vite+vue.md +1 -0
- package/docs/pt/intlayer_with_nuxt.md +277 -420
- package/docs/pt/intlayer_with_react_router_v7.md +28 -0
- package/docs/pt/intlayer_with_tanstack.md +1 -0
- package/docs/ru/intlayer_with_nuxt.md +287 -425
- package/docs/ru/intlayer_with_react_router_v7.md +33 -4
- package/docs/ru/intlayer_with_react_router_v7_fs_routes.md +574 -0
- package/docs/ru/intlayer_with_tanstack.md +1 -0
- package/docs/ru/intlayer_with_vite+vue.md +1 -0
- package/docs/tr/intlayer_with_nuxt.md +313 -406
- package/docs/tr/intlayer_with_react_router_v7.md +33 -4
- package/docs/tr/intlayer_with_react_router_v7_fs_routes.md +572 -0
- package/docs/tr/intlayer_with_tanstack.md +2 -12
- package/docs/tr/intlayer_with_vite+vue.md +1 -0
- package/docs/vi/intlayer_with_nuxt.md +273 -418
- package/docs/vi/intlayer_with_react_router_v7.md +29 -4
- package/docs/vi/intlayer_with_react_router_v7_fs_routes.md +523 -0
- package/docs/vi/intlayer_with_tanstack.md +2 -12
- package/docs/vi/intlayer_with_vite+vue.md +1 -0
- package/docs/zh/intlayer_with_nuxt.md +300 -461
- package/docs/zh/intlayer_with_react_router_v7.md +33 -4
- package/docs/zh/intlayer_with_react_router_v7_fs_routes.md +516 -0
- package/docs/zh/intlayer_with_tanstack.md +2 -12
- package/docs/zh/intlayer_with_vite+vue.md +1 -0
- package/package.json +10 -11
- package/src/generated/docs.entry.ts +19 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-06-18
|
|
3
|
-
updatedAt: 2025-
|
|
4
|
-
title: Nuxt
|
|
3
|
+
updatedAt: 2025-12-07
|
|
4
|
+
title: Nuxt 및 Vue 앱 번역 방법 – i18n 가이드 2025
|
|
5
5
|
description: Nuxt 및 Vue 웹사이트를 다국어로 만드는 방법을 알아보세요. 국제화(i18n) 및 번역을 위한 문서를 따라가세요.
|
|
6
6
|
keywords:
|
|
7
7
|
- 국제화
|
|
@@ -9,37 +9,64 @@ keywords:
|
|
|
9
9
|
- Intlayer
|
|
10
10
|
- Nuxt
|
|
11
11
|
- Vue
|
|
12
|
-
-
|
|
12
|
+
- JavaScript
|
|
13
13
|
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
|
-
changes: 초기
|
|
25
|
+
changes: 초기 기록
|
|
22
26
|
---
|
|
23
27
|
|
|
24
|
-
# Intlayer
|
|
28
|
+
# Intlayer를 사용하여 Nuxt 및 Vue 웹사이트 번역하기 | 국제화(i18n)
|
|
25
29
|
|
|
26
|
-
|
|
30
|
+
## 목차
|
|
27
31
|
|
|
28
|
-
|
|
32
|
+
<TOC/>
|
|
29
33
|
|
|
30
|
-
|
|
34
|
+
## Intlayer란 무엇인가?
|
|
35
|
+
|
|
36
|
+
**Intlayer**는 현대 웹 애플리케이션에서 다국어 지원을 간소화하기 위해 설계된 혁신적인 오픈 소스 국제화(i18n) 라이브러리입니다.
|
|
31
37
|
|
|
32
38
|
Intlayer를 사용하면 다음을 할 수 있습니다:
|
|
33
39
|
|
|
34
40
|
- **컴포넌트 수준에서 선언적 사전을 사용하여 번역을 쉽게 관리**할 수 있습니다.
|
|
35
41
|
- **메타데이터, 라우트 및 콘텐츠를 동적으로 현지화**할 수 있습니다.
|
|
36
|
-
- **자동 생성된 타입으로 TypeScript 지원을 보장**하여
|
|
42
|
+
- **자동 생성된 타입으로 TypeScript 지원을 보장**하여 자동완성 및 오류 감지를 향상시킵니다.
|
|
37
43
|
- **동적 로케일 감지 및 전환과 같은 고급 기능**을 활용할 수 있습니다.
|
|
38
44
|
|
|
39
45
|
---
|
|
40
46
|
|
|
41
47
|
## Nuxt 애플리케이션에서 Intlayer 설정 단계별 가이드
|
|
42
48
|
|
|
49
|
+
<Tab defaultTab="video">
|
|
50
|
+
<TabItem label="비디오" value="video">
|
|
51
|
+
|
|
52
|
+
<iframe title="Intlayer를 사용하여 Nuxt 및 Vue 앱을 번역하는 방법? 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&origin=http://intlayer.org&controls=0&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
|
+
/>
|
|
64
|
+
|
|
65
|
+
</TabItem>
|
|
66
|
+
</Tab>
|
|
67
|
+
|
|
68
|
+
GitHub에서 [애플리케이션 템플릿](https://github.com/aymericzip/intlayer-nuxt-4-template)을 확인하세요.
|
|
69
|
+
|
|
43
70
|
### 1단계: 의존성 설치
|
|
44
71
|
|
|
45
72
|
npm을 사용하여 필요한 패키지를 설치하세요:
|
|
@@ -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/ko/dictionary/
|
|
91
|
+
구성 관리, 번역, [콘텐츠 선언](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/dictionary/content_file.md), 트랜스파일링 및 [CLI 명령어](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/cli/index.md)를 위한 국제화 도구를 제공하는 핵심 패키지입니다.
|
|
65
92
|
|
|
66
93
|
- **vue-intlayer**
|
|
67
|
-
Intlayer를 Vue 애플리케이션과 통합하는
|
|
94
|
+
Intlayer를 Vue 애플리케이션과 통합하는 패키지입니다. Vue 컴포넌트를 위한 컴포저블을 제공합니다.
|
|
68
95
|
|
|
69
96
|
- **nuxt-intlayer**
|
|
70
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";
|
|
@@ -86,9 +113,6 @@ const config: IntlayerConfig = {
|
|
|
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,9 +151,6 @@ 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;
|
|
@@ -153,235 +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="
|
|
163
|
-
import {
|
|
180
|
+
```tsx fileName="content/home-page.content.ts" contentDeclarationFormat="typescript"
|
|
181
|
+
import { type Dictionary, t } from "intlayer";
|
|
164
182
|
|
|
165
|
-
const
|
|
166
|
-
key: "
|
|
183
|
+
const content = {
|
|
184
|
+
key: "home-page",
|
|
167
185
|
content: {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
|
|
173
|
-
}),
|
|
174
|
-
checkOut: t({
|
|
175
|
-
ko: "확인하세요 ",
|
|
176
|
-
en: "Check out ",
|
|
177
|
-
fr: "Vérifiez ",
|
|
178
|
-
es: "Compruebe ",
|
|
179
|
-
}),
|
|
180
|
-
nuxtIntlayer: t({
|
|
181
|
-
ko: "Nuxt Intlayer 문서",
|
|
182
|
-
en: "Nuxt Intlayer documentation",
|
|
183
|
-
fr: "Documentation de Nuxt Intlayer",
|
|
184
|
-
es: "Documentación de Nuxt Intlayer",
|
|
185
|
-
}),
|
|
186
|
-
learnMore: t({
|
|
187
|
-
ko: "Nuxt에 대해 자세히 알아보기 ",
|
|
188
|
-
en: "Learn more about Nuxt in the ",
|
|
189
|
-
fr: "En savoir plus sur Nuxt dans la ",
|
|
190
|
-
es: "Aprenda más sobre Nuxt en la ",
|
|
186
|
+
title: t({
|
|
187
|
+
en: "Hello world",
|
|
188
|
+
fr: "Bonjour le monde",
|
|
189
|
+
es: "Hola mundo",
|
|
191
190
|
}),
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
es: "Documentación de Nuxt",
|
|
191
|
+
metaTitle: t({
|
|
192
|
+
en: "Welcome | My Application",
|
|
193
|
+
fr: "Bienvenue | Mon Application",
|
|
194
|
+
es: "Bienvenido | Mi Aplicación",
|
|
197
195
|
}),
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
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.",
|
|
203
200
|
}),
|
|
204
201
|
},
|
|
205
202
|
} satisfies Dictionary;
|
|
206
203
|
|
|
207
|
-
export default
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
```javascript fileName="components/helloWorld.content.mjs" contentDeclarationFormat="esm"
|
|
211
|
-
import { t } from "intlayer";
|
|
212
|
-
|
|
213
|
-
/** @type {import('intlayer').Dictionary} */
|
|
214
|
-
const helloWorldContent = {
|
|
215
|
-
key: "helloworld",
|
|
216
|
-
content: {
|
|
217
|
-
count: t({
|
|
218
|
-
ko: "카운트는 ",
|
|
219
|
-
en: "count is ",
|
|
220
|
-
fr: "le compte est ",
|
|
221
|
-
es: "el recuento es ",
|
|
222
|
-
}),
|
|
223
|
-
edit: t({
|
|
224
|
-
ko: "<code>components/HelloWorld.vue</code>를 편집하고 저장하여 HMR을 테스트하세요",
|
|
225
|
-
en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
226
|
-
fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
227
|
-
es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
|
|
228
|
-
}),
|
|
229
|
-
checkOut: t({
|
|
230
|
-
ko: "확인하기 ",
|
|
231
|
-
en: "Check out ",
|
|
232
|
-
fr: "Vérifiez ",
|
|
233
|
-
es: "Compruebe ",
|
|
234
|
-
}),
|
|
235
|
-
nuxtIntlayer: t({
|
|
236
|
-
ko: "Nuxt Intlayer 문서",
|
|
237
|
-
en: "Nuxt Intlayer documentation",
|
|
238
|
-
fr: "Documentation de Nuxt Intlayer",
|
|
239
|
-
es: "Documentación de Nuxt Intlayer",
|
|
240
|
-
}),
|
|
241
|
-
learnMore: t({
|
|
242
|
-
ko: "Nuxt에 대해 자세히 알아보기 ",
|
|
243
|
-
en: "Learn more about Nuxt in the ",
|
|
244
|
-
fr: "En savoir plus sur Nuxt dans la ",
|
|
245
|
-
es: "Aprenda más sobre Nuxt en la ",
|
|
246
|
-
}),
|
|
247
|
-
nuxtDocs: t({
|
|
248
|
-
ko: "Nuxt 문서",
|
|
249
|
-
en: "Nuxt Documentation",
|
|
250
|
-
fr: "Documentation Nuxt",
|
|
251
|
-
es: "Documentación de Nuxt",
|
|
252
|
-
}),
|
|
253
|
-
readTheDocs: t({
|
|
254
|
-
ko: "Nuxt 로고를 클릭하여 자세히 알아보기",
|
|
255
|
-
en: "Click on the Nuxt logo to learn more",
|
|
256
|
-
fr: "Cliquez sur le logo Nuxt pour en savoir plus",
|
|
257
|
-
es: "Haga clic en el logotipo de Nuxt para obtener más información",
|
|
258
|
-
}),
|
|
259
|
-
},
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
export default helloWorldContent;
|
|
204
|
+
export default content;
|
|
263
205
|
```
|
|
264
206
|
|
|
265
|
-
|
|
266
|
-
const { t } = require("intlayer");
|
|
267
|
-
|
|
268
|
-
/** @type {import('intlayer').Dictionary} */
|
|
269
|
-
const helloWorldContent = {
|
|
270
|
-
key: "helloworld",
|
|
271
|
-
content: {
|
|
272
|
-
count: t({
|
|
273
|
-
ko: "카운트는 ",
|
|
274
|
-
en: "count is ",
|
|
275
|
-
fr: "le compte est ",
|
|
276
|
-
es: "el recuento es ",
|
|
277
|
-
}),
|
|
278
|
-
edit: t({
|
|
279
|
-
ko: "<code>components/HelloWorld.vue</code>를 편집하고 저장하여 HMR을 테스트하세요",
|
|
280
|
-
en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
281
|
-
fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
282
|
-
es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
|
|
283
|
-
}),
|
|
284
|
-
checkOut: t({
|
|
285
|
-
ko: "확인하세요 ",
|
|
286
|
-
en: "Check out ",
|
|
287
|
-
fr: "Vérifiez ",
|
|
288
|
-
es: "Compruebe ",
|
|
289
|
-
}),
|
|
290
|
-
nuxtIntlayer: t({
|
|
291
|
-
ko: "Nuxt Intlayer 문서",
|
|
292
|
-
en: "Nuxt Intlayer documentation",
|
|
293
|
-
fr: "Documentation de Nuxt Intlayer",
|
|
294
|
-
es: "Nuxt Intlayer 문서",
|
|
295
|
-
}),
|
|
296
|
-
learnMore: t({
|
|
297
|
-
en: "Nuxt에 대해 더 알아보기 ",
|
|
298
|
-
fr: "En savoir plus sur Nuxt dans la ",
|
|
299
|
-
es: "Aprenda más sobre Nuxt en la ",
|
|
300
|
-
}),
|
|
301
|
-
nuxtDocs: t({
|
|
302
|
-
en: "Nuxt 문서",
|
|
303
|
-
fr: "Documentation Nuxt",
|
|
304
|
-
es: "Documentación de Nuxt",
|
|
305
|
-
}),
|
|
306
|
-
readTheDocs: t({
|
|
307
|
-
en: "더 알아보려면 Nuxt 로고를 클릭하세요",
|
|
308
|
-
fr: "Cliquez sur le logo Nuxt pour en savoir plus",
|
|
309
|
-
es: "Haga clic en el logotipo de Nuxt para obtener más información",
|
|
310
|
-
}),
|
|
311
|
-
},
|
|
312
|
-
};
|
|
207
|
+
> 콘텐츠 선언은 애플리케이션 내 어디서든 정의할 수 있으며, `contentDir` 디렉토리(기본값: `./src`)에 포함되어야 합니다. 또한 콘텐츠 선언 파일 확장자(기본값: `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`)와 일치해야 합니다.
|
|
313
208
|
|
|
314
|
-
|
|
315
|
-
```
|
|
316
|
-
|
|
317
|
-
```json fileName="components/helloWorld.content.json" contentDeclarationFormat="json"
|
|
318
|
-
{
|
|
319
|
-
"$schema": "https://intlayer.org/schema.json",
|
|
320
|
-
"key": "helloworld",
|
|
321
|
-
"content": {
|
|
322
|
-
"count": {
|
|
323
|
-
"nodeType": "translation",
|
|
324
|
-
"translation": {
|
|
325
|
-
"ko": "카운트는 ",
|
|
326
|
-
"en": "count is ",
|
|
327
|
-
"fr": "le compte est ",
|
|
328
|
-
"es": "el recuento es "
|
|
329
|
-
}
|
|
330
|
-
},
|
|
331
|
-
"edit": {
|
|
332
|
-
"nodeType": "translation",
|
|
333
|
-
"translation": {
|
|
334
|
-
"ko": "HMR 테스트를 위해 <code>components/HelloWorld.vue</code>를 수정하고 저장하세요",
|
|
335
|
-
"en": "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
336
|
-
"fr": "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
337
|
-
"es": "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR"
|
|
338
|
-
}
|
|
339
|
-
},
|
|
340
|
-
"checkOut": {
|
|
341
|
-
"nodeType": "translation",
|
|
342
|
-
"translation": {
|
|
343
|
-
"ko": "다음 내용을 확인하세요 ",
|
|
344
|
-
"en": "Check out ",
|
|
345
|
-
"fr": "Vérifiez ",
|
|
346
|
-
"es": "Compruebe "
|
|
347
|
-
}
|
|
348
|
-
},
|
|
349
|
-
"nuxtIntlayer": {
|
|
350
|
-
"nodeType": "translation",
|
|
351
|
-
"translation": {
|
|
352
|
-
"ko": "Nuxt Intlayer 문서"
|
|
353
|
-
}
|
|
354
|
-
},
|
|
355
|
-
"learnMore": {
|
|
356
|
-
"nodeType": "translation",
|
|
357
|
-
"translation": {
|
|
358
|
-
"ko": "Nuxt에 대해 더 알아보기 "
|
|
359
|
-
}
|
|
360
|
-
},
|
|
361
|
-
"nuxtDocs": {
|
|
362
|
-
"nodeType": "translation",
|
|
363
|
-
"translation": {
|
|
364
|
-
"ko": "Nuxt 문서"
|
|
365
|
-
}
|
|
366
|
-
},
|
|
367
|
-
"readTheDocs": {
|
|
368
|
-
"nodeType": "translation",
|
|
369
|
-
"translation": {
|
|
370
|
-
"ko": "더 알아보려면 Nuxt 로고를 클릭하세요"
|
|
371
|
-
"es": "Haga clic en el logotipo de Nuxt para obtener más información"
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
```
|
|
377
|
-
|
|
378
|
-
> 귀하의 콘텐츠 선언은 애플리케이션 내 어디에서나 정의할 수 있으며, `contentDir` 디렉토리(기본값: `./src`)에 포함되어 있어야 합니다. 그리고 콘텐츠 선언 파일 확장자(기본값: `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`)와 일치해야 합니다.
|
|
379
|
-
|
|
380
|
-
> 자세한 내용은 [콘텐츠 선언 문서](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/dictionary/get_started.md)를 참조하세요.
|
|
209
|
+
> 자세한 내용은 [content 선언 문서](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/dictionary/content_file.md)를 참조하세요.
|
|
381
210
|
|
|
382
211
|
### 5단계: 코드에서 Intlayer 사용하기
|
|
383
212
|
|
|
384
|
-
`useIntlayer` 컴포저블을 사용하여 Nuxt 애플리케이션 전반에서 콘텐츠 사전을
|
|
213
|
+
`useIntlayer` 컴포저블을 사용하여 Nuxt 애플리케이션 전반에서 콘텐츠 사전을 접근할 수 있습니다:
|
|
385
214
|
|
|
386
215
|
```vue fileName="components/HelloWorld.vue"
|
|
387
216
|
<script setup lang="ts">
|
|
@@ -435,81 +264,71 @@ const countRef = ref(0);
|
|
|
435
264
|
Intlayer는 콘텐츠에 접근할 수 있는 다양한 API를 제공합니다:
|
|
436
265
|
|
|
437
266
|
- **컴포넌트 기반 문법** (권장):
|
|
438
|
-
`<myContent />` 또는 `<Component :is="myContent" />`
|
|
267
|
+
`<myContent />` 또는 `<Component :is="myContent" />` 구문을 사용하여 콘텐츠를 Intlayer Node로 렌더링합니다. 이는 [Visual Editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/intlayer_visual_editor.md) 및 [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/intlayer_CMS.md)와 원활하게 통합됩니다.
|
|
439
268
|
|
|
440
|
-
- **문자열 기반
|
|
441
|
-
`{{ myContent }}`를 사용하여
|
|
269
|
+
- **문자열 기반 구문**:
|
|
270
|
+
`{{ myContent }}`를 사용하여 Visual Editor 지원 없이 콘텐츠를 일반 텍스트로 렌더링합니다.
|
|
442
271
|
|
|
443
|
-
- **원시 HTML
|
|
444
|
-
`<div v-html="myContent" />`를 사용하여
|
|
272
|
+
- **원시 HTML 구문**:
|
|
273
|
+
`<div v-html="myContent" />`를 사용하여 Visual Editor 지원 없이 콘텐츠를 원시 HTML로 렌더링합니다.
|
|
445
274
|
|
|
446
|
-
- **구조 분해
|
|
447
|
-
`useIntlayer` 컴포저블은 콘텐츠가 포함된 Proxy를 반환합니다. 이 Proxy는 반응성을 유지하면서 콘텐츠에 접근하기 위해 구조
|
|
448
|
-
- `const content = useIntlayer("myContent");`를 사용하고 `{{ content.myContent }}` / `<content.myContent />`를 사용하세요.
|
|
449
|
-
- 또는 `const { myContent } = useIntlayer("myContent");`를 사용하고 `{{ myContent
|
|
275
|
+
- **구조 분해 구문**:
|
|
276
|
+
`useIntlayer` 컴포저블은 콘텐츠가 포함된 Proxy를 반환합니다. 이 Proxy는 반응성을 유지하면서 콘텐츠에 접근하기 위해 구조 분해할 수 있습니다.
|
|
277
|
+
- `const content = useIntlayer("myContent");`를 사용하고 `{{ content.myContent }}` / `<content.myContent />`를 사용하세요.
|
|
278
|
+
- 또는 `const { myContent } = useIntlayer("myContent");`를 사용하고 `{{ myContent}}` / `<myContent/>`를 사용하여 콘텐츠를 구조 분해 할당하세요.
|
|
450
279
|
|
|
451
280
|
### (선택 사항) 6단계: 콘텐츠의 언어 변경하기
|
|
452
281
|
|
|
453
|
-
콘텐츠의 언어를 변경하려면 `useLocale` 컴포저블에서 제공하는 `setLocale` 함수를 사용할 수 있습니다. 이 함수는 애플리케이션의 로케일을 설정하고
|
|
282
|
+
콘텐츠의 언어를 변경하려면 `useLocale` 컴포저블에서 제공하는 `setLocale` 함수를 사용할 수 있습니다. 이 함수는 애플리케이션의 로케일을 설정하고 그에 따라 콘텐츠를 업데이트할 수 있게 해줍니다.
|
|
454
283
|
|
|
455
|
-
언어를 전환하는 컴포넌트를
|
|
284
|
+
`NuxtLink`를 사용하여 언어를 전환하는 컴포넌트를 만드세요. **로케일 전환에 버튼 대신 링크를 사용하는 것은 SEO 및 페이지 검색 가능성 측면에서 모범 사례입니다.** 이는 검색 엔진이 모든 현지화된 페이지 버전을 크롤링하고 인덱싱할 수 있게 해주기 때문입니다.
|
|
456
285
|
|
|
457
286
|
```vue fileName="components/LocaleSwitcher.vue"
|
|
458
|
-
<template>
|
|
459
|
-
<div class="locale-switcher">
|
|
460
|
-
<select v-model="selectedLocale" @change="changeLocale">
|
|
461
|
-
<option v-for="loc in availableLocales" :key="loc" :value="loc">
|
|
462
|
-
{{ getLocaleName(loc) }}
|
|
463
|
-
</option>
|
|
464
|
-
</select>
|
|
465
|
-
</div>
|
|
466
|
-
</template>
|
|
467
|
-
|
|
468
287
|
<script setup lang="ts">
|
|
469
|
-
import {
|
|
470
|
-
import { getLocaleName } from "intlayer";
|
|
288
|
+
import { getLocaleName, getLocalizedUrl } from "intlayer";
|
|
471
289
|
import { useLocale } from "vue-intlayer";
|
|
472
290
|
|
|
473
|
-
//
|
|
291
|
+
// Nuxt가 useRoute를 자동으로 임포트합니다
|
|
292
|
+
const route = useRoute();
|
|
474
293
|
const { locale, availableLocales, setLocale } = useLocale();
|
|
475
|
-
|
|
476
|
-
// 선택된 로케일을 ref로 추적
|
|
477
|
-
const selectedLocale = ref(locale.value);
|
|
478
|
-
|
|
479
|
-
// 선택이 변경될 때 로케일 업데이트
|
|
480
|
-
const changeLocale = () => setLocale(selectedLocale.value);
|
|
481
|
-
|
|
482
|
-
// 전역 로케일과 selectedLocale 동기화 유지
|
|
483
|
-
watch(
|
|
484
|
-
() => locale.value,
|
|
485
|
-
(newLocale) => {
|
|
486
|
-
selectedLocale.value = newLocale;
|
|
487
|
-
}
|
|
488
|
-
);
|
|
489
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>
|
|
490
309
|
</template>
|
|
310
|
+
```
|
|
491
311
|
|
|
492
|
-
|
|
493
|
-
.locale-switcher {
|
|
494
|
-
margin: 1rem 0;
|
|
495
|
-
}
|
|
312
|
+
> `NuxtLink`를 적절한 `href` 속성(`getLocalizedUrl`을 통해)과 함께 사용하면 검색 엔진이 페이지의 모든 언어 버전을 발견할 수 있습니다. 이는 검색 엔진 크롤러가 따라가지 못할 수 있는 JavaScript 전용 로케일 전환보다 바람직합니다.
|
|
496
313
|
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
314
|
+
그런 다음, `app.vue`를 설정하여 레이아웃을 사용합니다:
|
|
315
|
+
|
|
316
|
+
```vue fileName="app.vue"
|
|
317
|
+
<template>
|
|
318
|
+
<NuxtLayout>
|
|
319
|
+
<NuxtPage />
|
|
320
|
+
</NuxtLayout>
|
|
321
|
+
</template>
|
|
503
322
|
```
|
|
504
323
|
|
|
505
|
-
|
|
324
|
+
### (선택 사항) 6b단계: 내비게이션이 포함된 레이아웃 생성
|
|
506
325
|
|
|
507
|
-
|
|
326
|
+
Nuxt 레이아웃을 사용하면 페이지에 공통 구조를 정의할 수 있습니다. 로케일 스위처와 내비게이션을 포함하는 기본 레이아웃을 생성하세요:
|
|
327
|
+
|
|
328
|
+
```vue fileName="layouts/default.vue"
|
|
508
329
|
<script setup lang="ts">
|
|
509
|
-
import
|
|
330
|
+
import Links from "~/components/Links.vue";
|
|
510
331
|
import LocaleSwitcher from "~/components/LocaleSwitcher.vue";
|
|
511
|
-
|
|
512
|
-
const content = useIntlayer("app"); // 관련 intlayer 선언 파일 생성
|
|
513
332
|
</script>
|
|
514
333
|
|
|
515
334
|
<template>
|
|
@@ -518,15 +337,20 @@ const content = useIntlayer("app"); // 관련 intlayer 선언 파일 생성
|
|
|
518
337
|
<LocaleSwitcher />
|
|
519
338
|
</header>
|
|
520
339
|
<main>
|
|
521
|
-
<
|
|
340
|
+
<slot />
|
|
522
341
|
</main>
|
|
342
|
+
|
|
343
|
+
<Links href="/">홈</Links>
|
|
344
|
+
<Links href="/about">소개</Links>
|
|
523
345
|
</div>
|
|
524
346
|
</template>
|
|
525
347
|
```
|
|
526
348
|
|
|
527
|
-
|
|
349
|
+
`Links` 컴포넌트(아래에 표시됨)는 내부 내비게이션 링크가 자동으로 현지화되도록 보장합니다.
|
|
350
|
+
|
|
351
|
+
### (선택 사항) 7단계: 애플리케이션에 현지화된 라우팅 추가하기
|
|
528
352
|
|
|
529
|
-
Nuxt는 `nuxt-intlayer` 모듈을 사용할 때
|
|
353
|
+
Nuxt는 `nuxt-intlayer` 모듈을 사용할 때 현지화된 라우팅을 자동으로 처리합니다. 이는 페이지 디렉토리 구조를 기반으로 각 언어별 경로를 자동으로 생성합니다.
|
|
530
354
|
|
|
531
355
|
예시:
|
|
532
356
|
|
|
@@ -538,271 +362,320 @@ pages/
|
|
|
538
362
|
└── index.vue → /contact, /fr/contact, /es/contact
|
|
539
363
|
```
|
|
540
364
|
|
|
541
|
-
|
|
365
|
+
로컬라이즈된 페이지를 만들려면 `pages/` 디렉토리에 Vue 파일을 생성하면 됩니다. 다음은 두 가지 예제 페이지입니다:
|
|
542
366
|
|
|
543
|
-
|
|
367
|
+
**홈 페이지 (`pages/index.vue`):**
|
|
368
|
+
|
|
369
|
+
```vue fileName="pages/index.vue"
|
|
544
370
|
<script setup lang="ts">
|
|
545
371
|
import { useIntlayer } from "vue-intlayer";
|
|
546
372
|
|
|
547
|
-
const content = useIntlayer("
|
|
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
|
+
});
|
|
548
384
|
</script>
|
|
549
385
|
|
|
550
386
|
<template>
|
|
551
|
-
<
|
|
552
|
-
<h1>{{ content.title }}</h1>
|
|
553
|
-
<p>{{ content.description }}</p>
|
|
554
|
-
</div>
|
|
387
|
+
<h1><content.title /></h1>
|
|
555
388
|
</template>
|
|
556
389
|
```
|
|
557
390
|
|
|
558
|
-
`
|
|
391
|
+
**소개 페이지 (`pages/about.vue`):**
|
|
559
392
|
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
- 로케일 쿠키를 관리합니다.
|
|
564
|
-
- 사용자를 적절한 로컬라이즈된 URL로 리디렉션합니다.
|
|
393
|
+
```vue fileName="pages/about.vue"
|
|
394
|
+
<script setup lang="ts">
|
|
395
|
+
import { useIntlayer } from "vue-intlayer";
|
|
565
396
|
|
|
566
|
-
|
|
397
|
+
const content = useIntlayer("about-page");
|
|
567
398
|
|
|
568
|
-
|
|
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>
|
|
569
409
|
|
|
570
|
-
```vue fileName="components/LocalizedLink.vue"
|
|
571
410
|
<template>
|
|
572
|
-
<
|
|
573
|
-
<slot />
|
|
574
|
-
</NuxtLink>
|
|
411
|
+
<h1><content.title /></h1>
|
|
575
412
|
</template>
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
> 참고: `useHead`는 Nuxt에서 자동으로 import됩니다. 필요에 따라 `.value`(반응형) 또는 `.raw`(원시 문자열)를 사용하여 콘텐츠 값을 접근할 수 있습니다.
|
|
576
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"
|
|
577
430
|
<script setup lang="ts">
|
|
578
|
-
import { computed } from "vue";
|
|
579
431
|
import { getLocalizedUrl } from "intlayer";
|
|
580
432
|
import { useLocale } from "vue-intlayer";
|
|
581
433
|
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
434
|
+
interface Props {
|
|
435
|
+
href: string;
|
|
436
|
+
locale?: string;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
const props = defineProps<Props>();
|
|
588
440
|
|
|
589
|
-
const { locale } = useLocale();
|
|
441
|
+
const { locale: currentLocale } = useLocale();
|
|
590
442
|
|
|
591
|
-
//
|
|
592
|
-
const
|
|
443
|
+
// 최종 경로 계산
|
|
444
|
+
const finalPath = computed(() => {
|
|
445
|
+
// 1. 링크가 외부 링크인지 확인
|
|
446
|
+
const isExternal = /^https?:\/\//.test(props.href || "");
|
|
593
447
|
|
|
594
|
-
//
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
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
|
+
});
|
|
598
455
|
</script>
|
|
456
|
+
|
|
457
|
+
<template>
|
|
458
|
+
<NuxtLink :to="finalPath" v-bind="$attrs">
|
|
459
|
+
<slot />
|
|
460
|
+
</NuxtLink>
|
|
461
|
+
</template>
|
|
599
462
|
```
|
|
600
463
|
|
|
601
|
-
그런 다음 애플리케이션
|
|
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>
|
|
602
471
|
|
|
603
|
-
```vue fileName="pages/index.vue"
|
|
604
472
|
<template>
|
|
605
473
|
<div>
|
|
606
|
-
<
|
|
607
|
-
|
|
608
|
-
</
|
|
609
|
-
<
|
|
610
|
-
|
|
611
|
-
</
|
|
474
|
+
<header>
|
|
475
|
+
<LocaleSwitcher />
|
|
476
|
+
</header>
|
|
477
|
+
<main>
|
|
478
|
+
<slot />
|
|
479
|
+
</main>
|
|
480
|
+
|
|
481
|
+
<Links href="/">홈</Links>
|
|
482
|
+
<Links href="/about">소개</Links>
|
|
612
483
|
</div>
|
|
613
484
|
</template>
|
|
614
|
-
|
|
615
|
-
<script setup lang="ts">
|
|
616
|
-
import { useIntlayer } from "vue-intlayer";
|
|
617
|
-
import LocalizedLink from "~/components/LocalizedLink.vue";
|
|
618
|
-
|
|
619
|
-
const content = useIntlayer("home");
|
|
620
|
-
</script>
|
|
621
485
|
```
|
|
622
486
|
|
|
487
|
+
> `NuxtLink`를 지역화된 경로와 함께 사용하면 다음을 보장할 수 있습니다:
|
|
488
|
+
>
|
|
489
|
+
> - 검색 엔진이 모든 언어 버전의 페이지를 크롤링하고 인덱싱할 수 있습니다.
|
|
490
|
+
> - 사용자가 지역화된 URL을 직접 공유할 수 있습니다.
|
|
491
|
+
> - 브라우저 히스토리가 로케일 접두사가 붙은 URL에서 올바르게 작동합니다.
|
|
492
|
+
|
|
623
493
|
### (선택 사항) 9단계: 메타데이터 및 SEO 처리
|
|
624
494
|
|
|
625
|
-
Nuxt는 뛰어난 SEO 기능을 제공합니다. Intlayer를 사용하여 지역화된 메타데이터를 처리할 수 있습니다:
|
|
495
|
+
Nuxt는 `useHead` 컴포저블(자동 임포트)을 통해 뛰어난 SEO 기능을 제공합니다. Intlayer를 사용하여 `.raw` 또는 `.value` 접근자를 통해 원시 문자열 값을 얻어 지역화된 메타데이터를 처리할 수 있습니다:
|
|
626
496
|
|
|
627
497
|
```vue fileName="pages/about.vue"
|
|
628
498
|
<script setup lang="ts">
|
|
629
|
-
import {
|
|
630
|
-
import { getIntlayer } from "intlayer";
|
|
631
|
-
import { useLocale } from "vue-intlayer";
|
|
499
|
+
import { useIntlayer } from "vue-intlayer";
|
|
632
500
|
|
|
633
|
-
|
|
634
|
-
const content =
|
|
501
|
+
// useHead는 Nuxt에서 자동 임포트됩니다.
|
|
502
|
+
const content = useIntlayer("about-page");
|
|
635
503
|
|
|
636
|
-
|
|
637
|
-
title: content.
|
|
638
|
-
|
|
504
|
+
useHead({
|
|
505
|
+
title: content.metaTitle.raw, // 원시 문자열 접근을 위해 .raw 사용
|
|
506
|
+
meta: [
|
|
507
|
+
{
|
|
508
|
+
name: "description",
|
|
509
|
+
content: content.metaDescription.raw, // 원시 문자열 접근을 위해 .raw 사용
|
|
510
|
+
},
|
|
511
|
+
],
|
|
639
512
|
});
|
|
640
513
|
</script>
|
|
641
514
|
|
|
642
515
|
<template>
|
|
643
|
-
<
|
|
644
|
-
<h1>{{ content.pageTitle }}</h1>
|
|
645
|
-
<p>{{ content.pageContent }}</p>
|
|
646
|
-
</div>
|
|
516
|
+
<h1><content.title /></h1>
|
|
647
517
|
</template>
|
|
648
518
|
```
|
|
649
519
|
|
|
650
|
-
|
|
520
|
+
> 또는 `import { getIntlayer } from "intlayer"` 함수를 사용하여 Vue 반응성 없이 콘텐츠를 가져올 수 있습니다.
|
|
521
|
+
|
|
522
|
+
> **콘텐츠 값 접근 방법:**
|
|
523
|
+
>
|
|
524
|
+
> - 원시 문자열 값을 얻으려면 `.raw` 사용 (비반응성)
|
|
525
|
+
> - 반응성 값을 얻으려면 `.value` 사용
|
|
526
|
+
> - Visual Editor 지원을 위해 `<content.key />` 컴포넌트 문법 사용
|
|
527
|
+
|
|
528
|
+
해당 콘텐츠 선언을 생성하세요:
|
|
651
529
|
|
|
652
|
-
```ts fileName="pages/about-
|
|
530
|
+
```ts fileName="pages/about-page.content.ts" contentDeclarationFormat="typescript"
|
|
653
531
|
import { t, type Dictionary } from "intlayer";
|
|
654
|
-
import type { useSeoMeta } from "nuxt/app";
|
|
655
532
|
|
|
656
|
-
const
|
|
657
|
-
key: "about-
|
|
533
|
+
const aboutPageContent = {
|
|
534
|
+
key: "about-page",
|
|
658
535
|
content: {
|
|
659
|
-
|
|
536
|
+
metaTitle: t({
|
|
660
537
|
en: "About Us - My Company",
|
|
661
538
|
fr: "À Propos - Ma Société",
|
|
662
539
|
es: "Acerca de Nosotros - Mi Empresa",
|
|
663
540
|
}),
|
|
664
|
-
|
|
541
|
+
metaDescription: t({
|
|
542
|
+
ko: "우리 회사와 우리의 사명에 대해 자세히 알아보세요",
|
|
665
543
|
en: "Learn more about our company and our mission",
|
|
666
544
|
fr: "En savoir plus sur notre société et notre mission",
|
|
667
545
|
es: "Conozca más sobre nuestra empresa y nuestra misión",
|
|
668
546
|
}),
|
|
547
|
+
title: t({
|
|
548
|
+
ko: "회사 소개",
|
|
549
|
+
en: "About Us",
|
|
550
|
+
fr: "À Propos",
|
|
551
|
+
es: "Acerca de Nosotros",
|
|
552
|
+
}),
|
|
669
553
|
},
|
|
670
|
-
} satisfies Dictionary
|
|
554
|
+
} satisfies Dictionary;
|
|
671
555
|
|
|
672
|
-
export default
|
|
556
|
+
export default aboutPageContent;
|
|
673
557
|
```
|
|
674
558
|
|
|
675
|
-
```
|
|
559
|
+
```javascript fileName="pages/about-page.content.mjs" contentDeclarationFormat="esm"
|
|
676
560
|
import { t } from "intlayer";
|
|
677
561
|
|
|
678
562
|
/** @type {import('intlayer').Dictionary} */
|
|
679
|
-
const
|
|
680
|
-
key: "about-
|
|
563
|
+
const aboutPageContent = {
|
|
564
|
+
key: "about-page",
|
|
681
565
|
content: {
|
|
682
|
-
|
|
683
|
-
zh: "关于我们 - 我的公司",
|
|
566
|
+
metaTitle: t({
|
|
684
567
|
ko: "회사 소개 - 나의 회사",
|
|
685
568
|
en: "About Us - My Company",
|
|
686
569
|
fr: "À Propos - Ma Société",
|
|
687
570
|
es: "Acerca de Nosotros - Mi Empresa",
|
|
688
571
|
}),
|
|
689
|
-
|
|
690
|
-
zh: "了解更多关于我们公司和我们的使命",
|
|
691
|
-
ko: "우리 회사와 우리의 사명에 대해 자세히 알아보세요",
|
|
572
|
+
metaDescription: t({
|
|
692
573
|
en: "Learn more about our company and our mission",
|
|
693
574
|
fr: "En savoir plus sur notre société et notre mission",
|
|
694
575
|
es: "Conozca más sobre nuestra empresa y nuestra misión",
|
|
695
576
|
}),
|
|
577
|
+
title: t({
|
|
578
|
+
en: "About Us",
|
|
579
|
+
fr: "À Propos",
|
|
580
|
+
es: "Acerca de Nosotros",
|
|
581
|
+
}),
|
|
696
582
|
},
|
|
697
583
|
};
|
|
698
584
|
|
|
699
|
-
export default
|
|
585
|
+
export default aboutPageContent;
|
|
700
586
|
```
|
|
701
587
|
|
|
702
|
-
```
|
|
588
|
+
```javascript fileName="pages/about-page.content.cjs" contentDeclarationFormat="commonjs"
|
|
703
589
|
const { t } = require("intlayer");
|
|
704
590
|
|
|
705
591
|
/** @type {import('intlayer').Dictionary} */
|
|
706
|
-
const
|
|
707
|
-
key: "about-
|
|
592
|
+
const aboutPageContent = {
|
|
593
|
+
key: "about-page",
|
|
708
594
|
content: {
|
|
709
|
-
|
|
710
|
-
zh: "关于我们 - 我的公司",
|
|
711
|
-
ko: "회사 소개 - 나의 회사",
|
|
595
|
+
metaTitle: t({
|
|
712
596
|
en: "About Us - My Company",
|
|
713
597
|
fr: "À Propos - Ma Société",
|
|
714
598
|
es: "Acerca de Nosotros - Mi Empresa",
|
|
715
599
|
}),
|
|
716
|
-
|
|
717
|
-
zh: "了解更多关于我们公司和我们的使命",
|
|
600
|
+
metaDescription: t({
|
|
718
601
|
en: "Learn more about our company and our mission",
|
|
719
602
|
fr: "En savoir plus sur notre société et notre mission",
|
|
720
603
|
es: "Conozca más sobre nuestra empresa y nuestra misión",
|
|
721
|
-
|
|
604
|
+
}),
|
|
605
|
+
title: t({
|
|
606
|
+
en: "About Us",
|
|
607
|
+
fr: "À Propos",
|
|
608
|
+
es: "Acerca de Nosotros",
|
|
722
609
|
}),
|
|
723
610
|
},
|
|
724
611
|
};
|
|
725
612
|
|
|
726
|
-
module.exports =
|
|
613
|
+
module.exports = aboutPageContent;
|
|
727
614
|
```
|
|
728
615
|
|
|
729
|
-
```json fileName="pages/about-
|
|
616
|
+
```json fileName="pages/about-page.content.json" contentDeclarationFormat="json"
|
|
730
617
|
{
|
|
731
|
-
"
|
|
618
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
619
|
+
"key": "about-page",
|
|
732
620
|
"content": {
|
|
733
|
-
"
|
|
621
|
+
"metaTitle": {
|
|
734
622
|
"nodeType": "translation",
|
|
735
|
-
"
|
|
736
|
-
"zh": "关于我们 - 我的公司",
|
|
623
|
+
"translation": {
|
|
737
624
|
"en": "About Us - My Company",
|
|
738
625
|
"fr": "À Propos - Ma Société",
|
|
739
|
-
"es": "Acerca de Nosotros - Mi Empresa"
|
|
740
|
-
"ko": "회사 소개 - 우리 회사"
|
|
626
|
+
"es": "Acerca de Nosotros - Mi Empresa"
|
|
741
627
|
}
|
|
742
628
|
},
|
|
743
|
-
"
|
|
629
|
+
"metaDescription": {
|
|
744
630
|
"nodeType": "translation",
|
|
745
|
-
"
|
|
746
|
-
"zh": "了解更多关于我们公司和我们的使命",
|
|
631
|
+
"translation": {
|
|
747
632
|
"en": "Learn more about our company and our mission",
|
|
748
633
|
"fr": "En savoir plus sur notre société et notre mission",
|
|
749
|
-
"es": "Conozca más sobre nuestra empresa y nuestra misión"
|
|
634
|
+
"es": "Conozca más sobre nuestra empresa y nuestra misión",
|
|
635
|
+
"ko": "우리 회사와 우리의 사명에 대해 자세히 알아보세요"
|
|
636
|
+
}
|
|
637
|
+
},
|
|
638
|
+
"title": {
|
|
639
|
+
"nodeType": "translation",
|
|
640
|
+
"translation": {
|
|
641
|
+
"en": "About Us",
|
|
642
|
+
"fr": "À Propos",
|
|
643
|
+
"es": "Acerca de Nosotros",
|
|
644
|
+
"ko": "회사 소개"
|
|
750
645
|
}
|
|
751
646
|
}
|
|
752
647
|
}
|
|
753
648
|
}
|
|
754
649
|
```
|
|
755
650
|
|
|
756
|
-
### TypeScript 구성
|
|
757
|
-
|
|
758
|
-
Intlayer는 모듈 확장을 사용하여 TypeScript의 이점을 활용하고 코드베이스를 더욱 견고하게 만듭니다.
|
|
759
|
-
|
|
760
|
-

|
|
761
|
-
|
|
762
|
-

|
|
763
|
-
|
|
764
|
-
TypeScript 구성에 자동 생성된 타입이 포함되어 있는지 확인하세요.
|
|
765
|
-
|
|
766
|
-
```json5 fileName="tsconfig.json"
|
|
767
|
-
{
|
|
768
|
-
// ... 기존 TypeScript 구성
|
|
769
|
-
"include": [
|
|
770
|
-
// ... 기존 TypeScript 설정
|
|
771
|
-
".intlayer/**/*.ts", // 자동 생성된 타입 포함
|
|
772
|
-
],
|
|
773
|
-
}
|
|
774
|
-
```
|
|
775
|
-
|
|
776
651
|
### Git 설정
|
|
777
652
|
|
|
778
|
-
Intlayer가
|
|
653
|
+
Intlayer가 생성하는 파일들은 Git 저장소에 커밋하지 않도록 무시하는 것이 권장됩니다.
|
|
779
654
|
|
|
780
|
-
이를 위해 `.gitignore` 파일에 다음
|
|
655
|
+
이를 위해 `.gitignore` 파일에 다음 내용을 추가할 수 있습니다:
|
|
781
656
|
|
|
782
657
|
```plaintext fileName=".gitignore"
|
|
783
658
|
# Intlayer가 생성한 파일 무시
|
|
784
659
|
.intlayer
|
|
785
660
|
```
|
|
786
661
|
|
|
787
|
-
### VS Code 확장
|
|
662
|
+
### VS Code 확장 프로그램
|
|
788
663
|
|
|
789
|
-
Intlayer
|
|
664
|
+
Intlayer 개발 경험을 향상시키기 위해 공식 **Intlayer VS Code 확장 프로그램**을 설치할 수 있습니다.
|
|
790
665
|
|
|
791
666
|
[VS Code 마켓플레이스에서 설치하기](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
|
|
792
667
|
|
|
793
|
-
이 확장
|
|
668
|
+
이 확장 프로그램은 다음을 제공합니다:
|
|
794
669
|
|
|
795
|
-
- 번역 키에 대한 **자동 완성**
|
|
796
|
-
-
|
|
797
|
-
-
|
|
798
|
-
-
|
|
670
|
+
- 번역 키에 대한 **자동 완성** 기능.
|
|
671
|
+
- 누락된 번역에 대한 **실시간 오류 감지**.
|
|
672
|
+
- 번역된 콘텐츠의 **인라인 미리보기**.
|
|
673
|
+
- 번역을 쉽게 생성하고 업데이트할 수 있는 **빠른 작업**.
|
|
799
674
|
|
|
800
|
-
확장
|
|
675
|
+
확장 프로그램 사용 방법에 대한 자세한 내용은 [Intlayer VS Code 확장 프로그램 문서](https://intlayer.org/doc/vs-code-extension)를 참조하세요.
|
|
801
676
|
|
|
802
677
|
---
|
|
803
678
|
|
|
804
679
|
### 더 나아가기
|
|
805
680
|
|
|
806
|
-
더
|
|
807
|
-
|
|
808
|
-
---
|
|
681
|
+
더 나아가려면, [비주얼 에디터](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/intlayer_visual_editor.md)를 구현하거나 [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/intlayer_CMS.md)를 사용하여 콘텐츠를 외부화할 수 있습니다.
|