@intlayer/docs 7.3.11 → 7.3.12
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 +305 -421
- 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 +296 -394
- 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 +242 -321
- 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 +262 -358
- 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 +284 -375
- 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 +288 -387
- 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 +318 -434
- 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 +275 -376
- 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 +312 -408
- 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 +319 -414
- 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 +307 -406
- 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 +282 -457
- 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 +288 -403
- 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 +300 -410
- 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 +327 -392
- 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 +282 -399
- 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 +311 -444
- 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 +6 -6
- 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,39 +9,74 @@ 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=IE3XWkZ6a5U
|
|
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
|
+
<iframe
|
|
50
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-nuxt-4-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
51
|
+
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
52
|
+
title="데모 CodeSandbox - Intlayer를 사용하여 애플리케이션을 국제화하는 방법"
|
|
53
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
54
|
+
loading="lazy"
|
|
55
|
+
/>
|
|
56
|
+
|
|
43
57
|
### 1단계: 의존성 설치
|
|
44
58
|
|
|
59
|
+
<Tab defaultTab="video">
|
|
60
|
+
<TabItem label="비디오" value="video">
|
|
61
|
+
|
|
62
|
+
<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/IE3XWkZ6a5U?autoplay=0&origin=http://intlayer.org&controls=0&rel=1"/>
|
|
63
|
+
|
|
64
|
+
</TabItem>
|
|
65
|
+
<TabItem label="코드" value="code">
|
|
66
|
+
|
|
67
|
+
<iframe
|
|
68
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-nuxt-4-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
69
|
+
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
70
|
+
title="데모 CodeSandbox - Intlayer를 사용하여 애플리케이션 국제화하기"
|
|
71
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
72
|
+
loading="lazy"
|
|
73
|
+
/>
|
|
74
|
+
|
|
75
|
+
</TabItem>
|
|
76
|
+
</Tab>
|
|
77
|
+
|
|
78
|
+
GitHub에서 [애플리케이션 템플릿](https://github.com/aymericzip/intlayer-nuxt-4-template)을 확인하세요.
|
|
79
|
+
|
|
45
80
|
npm을 사용하여 필요한 패키지를 설치하세요:
|
|
46
81
|
|
|
47
82
|
```bash packageManager="npm"
|
|
@@ -61,17 +96,17 @@ yarn add --save-dev nuxt-intlayer
|
|
|
61
96
|
|
|
62
97
|
- **intlayer**
|
|
63
98
|
|
|
64
|
-
구성 관리, 번역, [콘텐츠 선언](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/dictionary/
|
|
99
|
+
구성 관리, 번역, [콘텐츠 선언](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
100
|
|
|
66
101
|
- **vue-intlayer**
|
|
67
|
-
Intlayer를 Vue 애플리케이션과 통합하는
|
|
102
|
+
Intlayer를 Vue 애플리케이션과 통합하는 패키지입니다. Vue 컴포넌트를 위한 컴포저블을 제공합니다.
|
|
68
103
|
|
|
69
104
|
- **nuxt-intlayer**
|
|
70
105
|
Nuxt 애플리케이션과 Intlayer를 통합하는 Nuxt 모듈입니다. 자동 설정, 로케일 감지를 위한 미들웨어, 쿠키 관리 및 URL 리디렉션을 제공합니다.
|
|
71
106
|
|
|
72
107
|
### 2단계: 프로젝트 구성
|
|
73
108
|
|
|
74
|
-
애플리케이션의 언어를 구성하기 위한 설정 파일을
|
|
109
|
+
애플리케이션의 언어를 구성하기 위한 설정 파일을 만드세요:
|
|
75
110
|
|
|
76
111
|
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
77
112
|
import { Locales, type IntlayerConfig } from "intlayer";
|
|
@@ -86,9 +121,6 @@ const config: IntlayerConfig = {
|
|
|
86
121
|
],
|
|
87
122
|
defaultLocale: Locales.ENGLISH,
|
|
88
123
|
},
|
|
89
|
-
content: {
|
|
90
|
-
contentDir: ["."], // 기본적으로 Intlayer는 `./src` 디렉토리의 콘텐츠 선언 파일을 감시합니다
|
|
91
|
-
},
|
|
92
124
|
};
|
|
93
125
|
|
|
94
126
|
export default config;
|
|
@@ -108,9 +140,6 @@ const config = {
|
|
|
108
140
|
],
|
|
109
141
|
defaultLocale: Locales.ENGLISH,
|
|
110
142
|
},
|
|
111
|
-
content: {
|
|
112
|
-
contentDir: ["."],
|
|
113
|
-
},
|
|
114
143
|
};
|
|
115
144
|
|
|
116
145
|
export default config;
|
|
@@ -130,9 +159,6 @@ const config = {
|
|
|
130
159
|
],
|
|
131
160
|
defaultLocale: Locales.ENGLISH,
|
|
132
161
|
},
|
|
133
|
-
content: {
|
|
134
|
-
contentDir: ["."],
|
|
135
|
-
},
|
|
136
162
|
};
|
|
137
163
|
|
|
138
164
|
module.exports = config;
|
|
@@ -153,235 +179,46 @@ export default defineNuxtConfig({
|
|
|
153
179
|
});
|
|
154
180
|
```
|
|
155
181
|
|
|
156
|
-
> `nuxt-intlayer` 모듈은 Intlayer와 Nuxt의 통합을 자동으로 처리합니다.
|
|
182
|
+
> `nuxt-intlayer` 모듈은 Intlayer와 Nuxt의 통합을 자동으로 처리합니다. 콘텐츠 선언 빌드를 설정하고, 개발 모드에서 파일을 모니터링하며, 로케일 감지를 위한 미들웨어를 제공하고, 지역화된 라우팅을 관리합니다.
|
|
157
183
|
|
|
158
184
|
### 4단계: 콘텐츠 선언하기
|
|
159
185
|
|
|
160
|
-
번역을
|
|
186
|
+
번역을 저장하기 위해 콘텐츠 선언을 생성하고 관리하세요:
|
|
161
187
|
|
|
162
|
-
```tsx fileName="
|
|
163
|
-
import {
|
|
188
|
+
```tsx fileName="content/home-page.content.ts" contentDeclarationFormat="typescript"
|
|
189
|
+
import { type Dictionary, t } from "intlayer";
|
|
164
190
|
|
|
165
|
-
const
|
|
166
|
-
key: "
|
|
191
|
+
const content = {
|
|
192
|
+
key: "home-page",
|
|
167
193
|
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 ",
|
|
194
|
+
title: t({
|
|
195
|
+
en: "Hello world",
|
|
196
|
+
fr: "Bonjour le monde",
|
|
197
|
+
es: "Hola mundo",
|
|
191
198
|
}),
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
es: "Documentación de Nuxt",
|
|
199
|
+
metaTitle: t({
|
|
200
|
+
en: "Welcome | My Application",
|
|
201
|
+
fr: "Bienvenue | Mon Application",
|
|
202
|
+
es: "Bienvenido | Mi Aplicación",
|
|
197
203
|
}),
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
es: "Haga clic en el logotipo de Nuxt para obtener más información",
|
|
204
|
+
metaDescription: t({
|
|
205
|
+
en: "Discover your multilingual Nuxt app homepage powered by Intlayer.",
|
|
206
|
+
fr: "Découvrez la page d'accueil multilingue de votre application Nuxt propulsée par Intlayer.",
|
|
207
|
+
es: "Descubre la página de inicio multilingüe de tu aplicación Nuxt impulsada por Intlayer.",
|
|
203
208
|
}),
|
|
204
209
|
},
|
|
205
210
|
} satisfies Dictionary;
|
|
206
211
|
|
|
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;
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
```javascript fileName="components/helloWorld.content.cjs" contentDeclarationFormat="commonjs"
|
|
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
|
-
};
|
|
313
|
-
|
|
314
|
-
module.exports = helloWorldContent;
|
|
212
|
+
export default content;
|
|
315
213
|
```
|
|
316
214
|
|
|
317
|
-
|
|
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}`)와 일치해야 합니다.
|
|
215
|
+
> 콘텐츠 선언은 애플리케이션 내 어디서든 정의할 수 있으며, `contentDir` 디렉토리(기본값: `./src`)에 포함되어야 합니다. 또한 콘텐츠 선언 파일 확장자(기본값: `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`)와 일치해야 합니다.
|
|
379
216
|
|
|
380
|
-
> 자세한 내용은 [
|
|
217
|
+
> 자세한 내용은 [content 선언 문서](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/dictionary/content_file.md)를 참조하세요.
|
|
381
218
|
|
|
382
219
|
### 5단계: 코드에서 Intlayer 사용하기
|
|
383
220
|
|
|
384
|
-
`useIntlayer` 컴포저블을 사용하여 Nuxt 애플리케이션 전반에서 콘텐츠 사전을
|
|
221
|
+
`useIntlayer` 컴포저블을 사용하여 Nuxt 애플리케이션 전반에서 콘텐츠 사전을 접근할 수 있습니다:
|
|
385
222
|
|
|
386
223
|
```vue fileName="components/HelloWorld.vue"
|
|
387
224
|
<script setup lang="ts">
|
|
@@ -435,81 +272,71 @@ const countRef = ref(0);
|
|
|
435
272
|
Intlayer는 콘텐츠에 접근할 수 있는 다양한 API를 제공합니다:
|
|
436
273
|
|
|
437
274
|
- **컴포넌트 기반 문법** (권장):
|
|
438
|
-
`<myContent />` 또는 `<Component :is="myContent" />`
|
|
275
|
+
`<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
276
|
|
|
440
|
-
- **문자열 기반
|
|
441
|
-
`{{ myContent }}`를 사용하여
|
|
277
|
+
- **문자열 기반 구문**:
|
|
278
|
+
`{{ myContent }}`를 사용하여 Visual Editor 지원 없이 콘텐츠를 일반 텍스트로 렌더링합니다.
|
|
442
279
|
|
|
443
|
-
- **원시 HTML
|
|
444
|
-
`<div v-html="myContent" />`를 사용하여
|
|
280
|
+
- **원시 HTML 구문**:
|
|
281
|
+
`<div v-html="myContent" />`를 사용하여 Visual Editor 지원 없이 콘텐츠를 원시 HTML로 렌더링합니다.
|
|
445
282
|
|
|
446
|
-
- **구조 분해
|
|
447
|
-
`useIntlayer` 컴포저블은 콘텐츠가 포함된 Proxy를 반환합니다. 이 Proxy는 반응성을 유지하면서 콘텐츠에 접근하기 위해 구조
|
|
448
|
-
- `const content = useIntlayer("myContent");`를 사용하고 `{{ content.myContent }}` / `<content.myContent />`를 사용하세요.
|
|
449
|
-
- 또는 `const { myContent } = useIntlayer("myContent");`를 사용하고 `{{ myContent
|
|
283
|
+
- **구조 분해 구문**:
|
|
284
|
+
`useIntlayer` 컴포저블은 콘텐츠가 포함된 Proxy를 반환합니다. 이 Proxy는 반응성을 유지하면서 콘텐츠에 접근하기 위해 구조 분해할 수 있습니다.
|
|
285
|
+
- `const content = useIntlayer("myContent");`를 사용하고 `{{ content.myContent }}` / `<content.myContent />`를 사용하세요.
|
|
286
|
+
- 또는 `const { myContent } = useIntlayer("myContent");`를 사용하고 `{{ myContent}}` / `<myContent/>`를 사용하여 콘텐츠를 구조 분해 할당하세요.
|
|
450
287
|
|
|
451
288
|
### (선택 사항) 6단계: 콘텐츠의 언어 변경하기
|
|
452
289
|
|
|
453
|
-
콘텐츠의 언어를 변경하려면 `useLocale` 컴포저블에서 제공하는 `setLocale` 함수를 사용할 수 있습니다. 이 함수는 애플리케이션의 로케일을 설정하고
|
|
290
|
+
콘텐츠의 언어를 변경하려면 `useLocale` 컴포저블에서 제공하는 `setLocale` 함수를 사용할 수 있습니다. 이 함수는 애플리케이션의 로케일을 설정하고 그에 따라 콘텐츠를 업데이트할 수 있게 해줍니다.
|
|
454
291
|
|
|
455
|
-
언어를 전환하는 컴포넌트를
|
|
292
|
+
`NuxtLink`를 사용하여 언어를 전환하는 컴포넌트를 만드세요. **로케일 전환에 버튼 대신 링크를 사용하는 것은 SEO 및 페이지 검색 가능성 측면에서 모범 사례입니다.** 이는 검색 엔진이 모든 현지화된 페이지 버전을 크롤링하고 인덱싱할 수 있게 해주기 때문입니다.
|
|
456
293
|
|
|
457
294
|
```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
295
|
<script setup lang="ts">
|
|
469
|
-
import {
|
|
470
|
-
import { getLocaleName } from "intlayer";
|
|
296
|
+
import { getLocaleName, getLocalizedUrl } from "intlayer";
|
|
471
297
|
import { useLocale } from "vue-intlayer";
|
|
472
298
|
|
|
473
|
-
//
|
|
299
|
+
// Nuxt가 useRoute를 자동으로 임포트합니다
|
|
300
|
+
const route = useRoute();
|
|
474
301
|
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
302
|
</script>
|
|
303
|
+
|
|
304
|
+
<template>
|
|
305
|
+
<nav class="locale-switcher">
|
|
306
|
+
<NuxtLink
|
|
307
|
+
v-for="localeEl in availableLocales"
|
|
308
|
+
:key="localeEl"
|
|
309
|
+
:to="getLocalizedUrl(route.fullPath, localeEl)"
|
|
310
|
+
class="locale-link"
|
|
311
|
+
:class="{ 'active-locale': localeEl === locale }"
|
|
312
|
+
@click="setLocale(localeEl)"
|
|
313
|
+
>
|
|
314
|
+
{{ getLocaleName(localeEl) }}
|
|
315
|
+
</NuxtLink>
|
|
316
|
+
</nav>
|
|
490
317
|
</template>
|
|
318
|
+
```
|
|
491
319
|
|
|
492
|
-
|
|
493
|
-
.locale-switcher {
|
|
494
|
-
margin: 1rem 0;
|
|
495
|
-
}
|
|
320
|
+
> `NuxtLink`를 적절한 `href` 속성(`getLocalizedUrl`을 통해)과 함께 사용하면 검색 엔진이 페이지의 모든 언어 버전을 발견할 수 있습니다. 이는 검색 엔진 크롤러가 따라가지 못할 수 있는 JavaScript 전용 로케일 전환보다 바람직합니다.
|
|
496
321
|
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
322
|
+
그런 다음, `app.vue`를 설정하여 레이아웃을 사용합니다:
|
|
323
|
+
|
|
324
|
+
```vue fileName="app.vue"
|
|
325
|
+
<template>
|
|
326
|
+
<NuxtLayout>
|
|
327
|
+
<NuxtPage />
|
|
328
|
+
</NuxtLayout>
|
|
329
|
+
</template>
|
|
503
330
|
```
|
|
504
331
|
|
|
505
|
-
|
|
332
|
+
### (선택 사항) 6b단계: 내비게이션이 포함된 레이아웃 생성
|
|
506
333
|
|
|
507
|
-
|
|
334
|
+
Nuxt 레이아웃을 사용하면 페이지에 공통 구조를 정의할 수 있습니다. 로케일 스위처와 내비게이션을 포함하는 기본 레이아웃을 생성하세요:
|
|
335
|
+
|
|
336
|
+
```vue fileName="layouts/default.vue"
|
|
508
337
|
<script setup lang="ts">
|
|
509
|
-
import
|
|
338
|
+
import Links from "~/components/Links.vue";
|
|
510
339
|
import LocaleSwitcher from "~/components/LocaleSwitcher.vue";
|
|
511
|
-
|
|
512
|
-
const content = useIntlayer("app"); // 관련 intlayer 선언 파일 생성
|
|
513
340
|
</script>
|
|
514
341
|
|
|
515
342
|
<template>
|
|
@@ -518,15 +345,20 @@ const content = useIntlayer("app"); // 관련 intlayer 선언 파일 생성
|
|
|
518
345
|
<LocaleSwitcher />
|
|
519
346
|
</header>
|
|
520
347
|
<main>
|
|
521
|
-
<
|
|
348
|
+
<slot />
|
|
522
349
|
</main>
|
|
350
|
+
|
|
351
|
+
<Links href="/">홈</Links>
|
|
352
|
+
<Links href="/about">소개</Links>
|
|
523
353
|
</div>
|
|
524
354
|
</template>
|
|
525
355
|
```
|
|
526
356
|
|
|
527
|
-
|
|
357
|
+
`Links` 컴포넌트(아래에 표시됨)는 내부 내비게이션 링크가 자동으로 현지화되도록 보장합니다.
|
|
358
|
+
|
|
359
|
+
### (선택 사항) 7단계: 애플리케이션에 현지화된 라우팅 추가하기
|
|
528
360
|
|
|
529
|
-
Nuxt는 `nuxt-intlayer` 모듈을 사용할 때
|
|
361
|
+
Nuxt는 `nuxt-intlayer` 모듈을 사용할 때 현지화된 라우팅을 자동으로 처리합니다. 이는 페이지 디렉토리 구조를 기반으로 각 언어별 경로를 자동으로 생성합니다.
|
|
530
362
|
|
|
531
363
|
예시:
|
|
532
364
|
|
|
@@ -538,215 +370,286 @@ pages/
|
|
|
538
370
|
└── index.vue → /contact, /fr/contact, /es/contact
|
|
539
371
|
```
|
|
540
372
|
|
|
541
|
-
|
|
373
|
+
로컬라이즈된 페이지를 만들려면 `pages/` 디렉토리에 Vue 파일을 생성하면 됩니다. 다음은 두 가지 예제 페이지입니다:
|
|
542
374
|
|
|
543
|
-
|
|
375
|
+
**홈 페이지 (`pages/index.vue`):**
|
|
376
|
+
|
|
377
|
+
```vue fileName="pages/index.vue"
|
|
544
378
|
<script setup lang="ts">
|
|
545
379
|
import { useIntlayer } from "vue-intlayer";
|
|
546
380
|
|
|
547
|
-
const content = useIntlayer("
|
|
381
|
+
const content = useIntlayer("home-page");
|
|
382
|
+
|
|
383
|
+
useHead({
|
|
384
|
+
title: content.metaTitle.value,
|
|
385
|
+
meta: [
|
|
386
|
+
{
|
|
387
|
+
name: "description",
|
|
388
|
+
content: content.metaDescription.value,
|
|
389
|
+
},
|
|
390
|
+
],
|
|
391
|
+
});
|
|
548
392
|
</script>
|
|
549
393
|
|
|
550
394
|
<template>
|
|
551
|
-
<
|
|
552
|
-
<h1>{{ content.title }}</h1>
|
|
553
|
-
<p>{{ content.description }}</p>
|
|
554
|
-
</div>
|
|
395
|
+
<h1><content.title /></h1>
|
|
555
396
|
</template>
|
|
556
397
|
```
|
|
557
398
|
|
|
558
|
-
`
|
|
399
|
+
**소개 페이지 (`pages/about.vue`):**
|
|
559
400
|
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
- 로케일 쿠키를 관리합니다.
|
|
564
|
-
- 사용자를 적절한 로컬라이즈된 URL로 리디렉션합니다.
|
|
401
|
+
```vue fileName="pages/about.vue"
|
|
402
|
+
<script setup lang="ts">
|
|
403
|
+
import { useIntlayer } from "vue-intlayer";
|
|
565
404
|
|
|
566
|
-
|
|
405
|
+
const content = useIntlayer("about-page");
|
|
567
406
|
|
|
568
|
-
|
|
407
|
+
useHead({
|
|
408
|
+
title: content.metaTitle.raw, // 원시 문자열 접근을 위해 .raw 사용
|
|
409
|
+
meta: [
|
|
410
|
+
{
|
|
411
|
+
name: "description",
|
|
412
|
+
content: content.metaDescription.raw, // 원시 문자열 접근을 위해 .raw 사용
|
|
413
|
+
},
|
|
414
|
+
],
|
|
415
|
+
});
|
|
416
|
+
</script>
|
|
569
417
|
|
|
570
|
-
```vue fileName="components/LocalizedLink.vue"
|
|
571
418
|
<template>
|
|
572
|
-
<
|
|
573
|
-
<slot />
|
|
574
|
-
</NuxtLink>
|
|
419
|
+
<h1><content.title /></h1>
|
|
575
420
|
</template>
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
> 참고: `useHead`는 Nuxt에서 자동으로 import됩니다. 필요에 따라 `.value`(반응형) 또는 `.raw`(원시 문자열)를 사용하여 콘텐츠 값을 접근할 수 있습니다.
|
|
424
|
+
|
|
425
|
+
`nuxt-intlayer` 모듈은 자동으로 다음을 수행합니다:
|
|
426
|
+
|
|
427
|
+
- 사용자의 선호 로케일 감지
|
|
428
|
+
- URL을 통한 로케일 전환 처리
|
|
429
|
+
- 적절한 `<html lang="">` 속성 설정
|
|
430
|
+
- 로케일 쿠키 관리
|
|
431
|
+
- 사용자를 적절한 로컬라이즈된 URL로 리디렉션
|
|
432
|
+
|
|
433
|
+
### (선택 사항) 8단계: 로컬라이즈된 링크 컴포넌트 생성
|
|
576
434
|
|
|
435
|
+
애플리케이션의 내비게이션이 현재 로케일을 준수하도록 하려면, 커스텀 `Links` 컴포넌트를 생성할 수 있습니다. 이 컴포넌트는 내부 URL에 현재 언어를 자동으로 접두사로 붙여주며, 이는 **SEO 및 페이지 발견 가능성**에 필수적입니다.
|
|
436
|
+
|
|
437
|
+
```vue fileName="components/Links.vue"
|
|
577
438
|
<script setup lang="ts">
|
|
578
|
-
import { computed } from "vue";
|
|
579
439
|
import { getLocalizedUrl } from "intlayer";
|
|
580
440
|
import { useLocale } from "vue-intlayer";
|
|
581
441
|
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
442
|
+
interface Props {
|
|
443
|
+
href: string;
|
|
444
|
+
locale?: string;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
const props = defineProps<Props>();
|
|
448
|
+
|
|
449
|
+
const { locale: currentLocale } = useLocale();
|
|
588
450
|
|
|
589
|
-
|
|
451
|
+
// 최종 경로 계산
|
|
452
|
+
const finalPath = computed(() => {
|
|
453
|
+
// 1. 링크가 외부 링크인지 확인
|
|
454
|
+
const isExternal = /^https?:\/\//.test(props.href || "");
|
|
590
455
|
|
|
591
|
-
//
|
|
592
|
-
|
|
456
|
+
// 2. 외부 링크라면 그대로 반환 (NuxtLink가 <a> 태그 생성을 처리함)
|
|
457
|
+
if (isExternal) return props.href;
|
|
593
458
|
|
|
594
|
-
// 내부
|
|
595
|
-
const
|
|
596
|
-
|
|
597
|
-
);
|
|
459
|
+
// 3. 내부 링크인 경우 URL을 현지화합니다.
|
|
460
|
+
const targetLocale = props.locale || currentLocale.value;
|
|
461
|
+
return getLocalizedUrl(props.href, targetLocale);
|
|
462
|
+
});
|
|
598
463
|
</script>
|
|
464
|
+
|
|
465
|
+
<template>
|
|
466
|
+
<NuxtLink :to="finalPath" v-bind="$attrs">
|
|
467
|
+
<slot />
|
|
468
|
+
</NuxtLink>
|
|
469
|
+
</template>
|
|
599
470
|
```
|
|
600
471
|
|
|
601
|
-
그런 다음 애플리케이션
|
|
472
|
+
그런 다음 애플리케이션 전체에서 이 컴포넌트를 사용하세요:
|
|
473
|
+
|
|
474
|
+
```vue fileName="layouts/default.vue"
|
|
475
|
+
<script setup lang="ts">
|
|
476
|
+
import Links from "~/components/Links.vue";
|
|
477
|
+
import LocaleSwitcher from "~/components/LocaleSwitcher.vue";
|
|
478
|
+
</script>
|
|
602
479
|
|
|
603
|
-
```vue fileName="pages/index.vue"
|
|
604
480
|
<template>
|
|
605
481
|
<div>
|
|
606
|
-
<
|
|
607
|
-
|
|
608
|
-
</
|
|
609
|
-
<
|
|
610
|
-
|
|
611
|
-
</
|
|
482
|
+
<header>
|
|
483
|
+
<LocaleSwitcher />
|
|
484
|
+
</header>
|
|
485
|
+
<main>
|
|
486
|
+
<slot />
|
|
487
|
+
</main>
|
|
488
|
+
|
|
489
|
+
<Links href="/">홈</Links>
|
|
490
|
+
<Links href="/about">소개</Links>
|
|
612
491
|
</div>
|
|
613
492
|
</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
493
|
```
|
|
622
494
|
|
|
495
|
+
> `NuxtLink`를 지역화된 경로와 함께 사용하면 다음을 보장할 수 있습니다:
|
|
496
|
+
>
|
|
497
|
+
> - 검색 엔진이 모든 언어 버전의 페이지를 크롤링하고 인덱싱할 수 있습니다.
|
|
498
|
+
> - 사용자가 지역화된 URL을 직접 공유할 수 있습니다.
|
|
499
|
+
> - 브라우저 히스토리가 로케일 접두사가 붙은 URL에서 올바르게 작동합니다.
|
|
500
|
+
|
|
623
501
|
### (선택 사항) 9단계: 메타데이터 및 SEO 처리
|
|
624
502
|
|
|
625
|
-
Nuxt는 뛰어난 SEO 기능을 제공합니다. Intlayer를 사용하여 지역화된 메타데이터를 처리할 수 있습니다:
|
|
503
|
+
Nuxt는 `useHead` 컴포저블(자동 임포트)을 통해 뛰어난 SEO 기능을 제공합니다. Intlayer를 사용하여 `.raw` 또는 `.value` 접근자를 통해 원시 문자열 값을 얻어 지역화된 메타데이터를 처리할 수 있습니다:
|
|
626
504
|
|
|
627
505
|
```vue fileName="pages/about.vue"
|
|
628
506
|
<script setup lang="ts">
|
|
629
|
-
import {
|
|
630
|
-
import { getIntlayer } from "intlayer";
|
|
631
|
-
import { useLocale } from "vue-intlayer";
|
|
507
|
+
import { useIntlayer } from "vue-intlayer";
|
|
632
508
|
|
|
633
|
-
|
|
634
|
-
const content =
|
|
509
|
+
// useHead는 Nuxt에서 자동 임포트됩니다.
|
|
510
|
+
const content = useIntlayer("about-page");
|
|
635
511
|
|
|
636
|
-
|
|
637
|
-
title: content.
|
|
638
|
-
|
|
512
|
+
useHead({
|
|
513
|
+
title: content.metaTitle.raw, // 원시 문자열 접근을 위해 .raw 사용
|
|
514
|
+
meta: [
|
|
515
|
+
{
|
|
516
|
+
name: "description",
|
|
517
|
+
content: content.metaDescription.raw, // 원시 문자열 접근을 위해 .raw 사용
|
|
518
|
+
},
|
|
519
|
+
],
|
|
639
520
|
});
|
|
640
521
|
</script>
|
|
641
522
|
|
|
642
523
|
<template>
|
|
643
|
-
<
|
|
644
|
-
<h1>{{ content.pageTitle }}</h1>
|
|
645
|
-
<p>{{ content.pageContent }}</p>
|
|
646
|
-
</div>
|
|
524
|
+
<h1><content.title /></h1>
|
|
647
525
|
</template>
|
|
648
526
|
```
|
|
649
527
|
|
|
650
|
-
|
|
528
|
+
> 또는 `import { getIntlayer } from "intlayer"` 함수를 사용하여 Vue 반응성 없이 콘텐츠를 가져올 수 있습니다.
|
|
529
|
+
|
|
530
|
+
> **콘텐츠 값 접근 방법:**
|
|
531
|
+
>
|
|
532
|
+
> - 원시 문자열 값을 얻으려면 `.raw` 사용 (비반응성)
|
|
533
|
+
> - 반응성 값을 얻으려면 `.value` 사용
|
|
534
|
+
> - Visual Editor 지원을 위해 `<content.key />` 컴포넌트 문법 사용
|
|
535
|
+
|
|
536
|
+
해당 콘텐츠 선언을 생성하세요:
|
|
651
537
|
|
|
652
|
-
```ts fileName="pages/about-
|
|
538
|
+
```ts fileName="pages/about-page.content.ts" contentDeclarationFormat="typescript"
|
|
653
539
|
import { t, type Dictionary } from "intlayer";
|
|
654
|
-
import type { useSeoMeta } from "nuxt/app";
|
|
655
540
|
|
|
656
|
-
const
|
|
657
|
-
key: "about-
|
|
541
|
+
const aboutPageContent = {
|
|
542
|
+
key: "about-page",
|
|
658
543
|
content: {
|
|
659
|
-
|
|
544
|
+
metaTitle: t({
|
|
660
545
|
en: "About Us - My Company",
|
|
661
546
|
fr: "À Propos - Ma Société",
|
|
662
547
|
es: "Acerca de Nosotros - Mi Empresa",
|
|
663
548
|
}),
|
|
664
|
-
|
|
549
|
+
metaDescription: t({
|
|
550
|
+
ko: "우리 회사와 우리의 사명에 대해 자세히 알아보세요",
|
|
665
551
|
en: "Learn more about our company and our mission",
|
|
666
552
|
fr: "En savoir plus sur notre société et notre mission",
|
|
667
553
|
es: "Conozca más sobre nuestra empresa y nuestra misión",
|
|
668
554
|
}),
|
|
555
|
+
title: t({
|
|
556
|
+
ko: "회사 소개",
|
|
557
|
+
en: "About Us",
|
|
558
|
+
fr: "À Propos",
|
|
559
|
+
es: "Acerca de Nosotros",
|
|
560
|
+
}),
|
|
669
561
|
},
|
|
670
|
-
} satisfies Dictionary
|
|
562
|
+
} satisfies Dictionary;
|
|
671
563
|
|
|
672
|
-
export default
|
|
564
|
+
export default aboutPageContent;
|
|
673
565
|
```
|
|
674
566
|
|
|
675
|
-
```
|
|
567
|
+
```javascript fileName="pages/about-page.content.mjs" contentDeclarationFormat="esm"
|
|
676
568
|
import { t } from "intlayer";
|
|
677
569
|
|
|
678
570
|
/** @type {import('intlayer').Dictionary} */
|
|
679
|
-
const
|
|
680
|
-
key: "about-
|
|
571
|
+
const aboutPageContent = {
|
|
572
|
+
key: "about-page",
|
|
681
573
|
content: {
|
|
682
|
-
|
|
683
|
-
zh: "关于我们 - 我的公司",
|
|
574
|
+
metaTitle: t({
|
|
684
575
|
ko: "회사 소개 - 나의 회사",
|
|
685
576
|
en: "About Us - My Company",
|
|
686
577
|
fr: "À Propos - Ma Société",
|
|
687
578
|
es: "Acerca de Nosotros - Mi Empresa",
|
|
688
579
|
}),
|
|
689
|
-
|
|
690
|
-
zh: "了解更多关于我们公司和我们的使命",
|
|
691
|
-
ko: "우리 회사와 우리의 사명에 대해 자세히 알아보세요",
|
|
580
|
+
metaDescription: t({
|
|
692
581
|
en: "Learn more about our company and our mission",
|
|
693
582
|
fr: "En savoir plus sur notre société et notre mission",
|
|
694
583
|
es: "Conozca más sobre nuestra empresa y nuestra misión",
|
|
695
584
|
}),
|
|
585
|
+
title: t({
|
|
586
|
+
en: "About Us",
|
|
587
|
+
fr: "À Propos",
|
|
588
|
+
es: "Acerca de Nosotros",
|
|
589
|
+
}),
|
|
696
590
|
},
|
|
697
591
|
};
|
|
698
592
|
|
|
699
|
-
export default
|
|
593
|
+
export default aboutPageContent;
|
|
700
594
|
```
|
|
701
595
|
|
|
702
|
-
```
|
|
596
|
+
```javascript fileName="pages/about-page.content.cjs" contentDeclarationFormat="commonjs"
|
|
703
597
|
const { t } = require("intlayer");
|
|
704
598
|
|
|
705
599
|
/** @type {import('intlayer').Dictionary} */
|
|
706
|
-
const
|
|
707
|
-
key: "about-
|
|
600
|
+
const aboutPageContent = {
|
|
601
|
+
key: "about-page",
|
|
708
602
|
content: {
|
|
709
|
-
|
|
710
|
-
zh: "关于我们 - 我的公司",
|
|
711
|
-
ko: "회사 소개 - 나의 회사",
|
|
603
|
+
metaTitle: t({
|
|
712
604
|
en: "About Us - My Company",
|
|
713
605
|
fr: "À Propos - Ma Société",
|
|
714
606
|
es: "Acerca de Nosotros - Mi Empresa",
|
|
715
607
|
}),
|
|
716
|
-
|
|
717
|
-
zh: "了解更多关于我们公司和我们的使命",
|
|
608
|
+
metaDescription: t({
|
|
718
609
|
en: "Learn more about our company and our mission",
|
|
719
610
|
fr: "En savoir plus sur notre société et notre mission",
|
|
720
611
|
es: "Conozca más sobre nuestra empresa y nuestra misión",
|
|
721
|
-
|
|
612
|
+
}),
|
|
613
|
+
title: t({
|
|
614
|
+
en: "About Us",
|
|
615
|
+
fr: "À Propos",
|
|
616
|
+
es: "Acerca de Nosotros",
|
|
722
617
|
}),
|
|
723
618
|
},
|
|
724
619
|
};
|
|
725
620
|
|
|
726
|
-
module.exports =
|
|
621
|
+
module.exports = aboutPageContent;
|
|
727
622
|
```
|
|
728
623
|
|
|
729
|
-
```json fileName="pages/about-
|
|
624
|
+
```json fileName="pages/about-page.content.json" contentDeclarationFormat="json"
|
|
730
625
|
{
|
|
731
|
-
"
|
|
626
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
627
|
+
"key": "about-page",
|
|
732
628
|
"content": {
|
|
733
|
-
"
|
|
629
|
+
"metaTitle": {
|
|
734
630
|
"nodeType": "translation",
|
|
735
|
-
"
|
|
736
|
-
"zh": "关于我们 - 我的公司",
|
|
631
|
+
"translation": {
|
|
737
632
|
"en": "About Us - My Company",
|
|
738
633
|
"fr": "À Propos - Ma Société",
|
|
739
|
-
"es": "Acerca de Nosotros - Mi Empresa"
|
|
740
|
-
"ko": "회사 소개 - 우리 회사"
|
|
634
|
+
"es": "Acerca de Nosotros - Mi Empresa"
|
|
741
635
|
}
|
|
742
636
|
},
|
|
743
|
-
"
|
|
637
|
+
"metaDescription": {
|
|
744
638
|
"nodeType": "translation",
|
|
745
|
-
"
|
|
746
|
-
"zh": "了解更多关于我们公司和我们的使命",
|
|
639
|
+
"translation": {
|
|
747
640
|
"en": "Learn more about our company and our mission",
|
|
748
641
|
"fr": "En savoir plus sur notre société et notre mission",
|
|
749
|
-
"es": "Conozca más sobre nuestra empresa y nuestra misión"
|
|
642
|
+
"es": "Conozca más sobre nuestra empresa y nuestra misión",
|
|
643
|
+
"ko": "우리 회사와 우리의 사명에 대해 자세히 알아보세요"
|
|
644
|
+
}
|
|
645
|
+
},
|
|
646
|
+
"title": {
|
|
647
|
+
"nodeType": "translation",
|
|
648
|
+
"translation": {
|
|
649
|
+
"en": "About Us",
|
|
650
|
+
"fr": "À Propos",
|
|
651
|
+
"es": "Acerca de Nosotros",
|
|
652
|
+
"ko": "회사 소개"
|
|
750
653
|
}
|
|
751
654
|
}
|
|
752
655
|
}
|
|
@@ -755,17 +658,17 @@ module.exports = aboutMetaContent;
|
|
|
755
658
|
|
|
756
659
|
### TypeScript 구성
|
|
757
660
|
|
|
758
|
-
Intlayer는 모듈
|
|
661
|
+
Intlayer는 모듈 증강(module augmentation)을 사용하여 TypeScript의 이점을 활용하고 코드베이스를 더욱 견고하게 만듭니다.
|
|
759
662
|
|
|
760
|
-

|
|
761
664
|
|
|
762
665
|

|
|
763
666
|
|
|
764
|
-
TypeScript
|
|
667
|
+
TypeScript 설정에 자동 생성된 타입들이 포함되어 있는지 확인하세요.
|
|
765
668
|
|
|
766
669
|
```json5 fileName="tsconfig.json"
|
|
767
670
|
{
|
|
768
|
-
// ... 기존 TypeScript
|
|
671
|
+
// ... 기존 TypeScript 설정
|
|
769
672
|
"include": [
|
|
770
673
|
// ... 기존 TypeScript 설정
|
|
771
674
|
".intlayer/**/*.ts", // 자동 생성된 타입 포함
|
|
@@ -775,34 +678,32 @@ TypeScript 구성에 자동 생성된 타입이 포함되어 있는지 확인하
|
|
|
775
678
|
|
|
776
679
|
### Git 설정
|
|
777
680
|
|
|
778
|
-
Intlayer가
|
|
681
|
+
Intlayer가 생성하는 파일들은 Git 저장소에 커밋하지 않도록 무시하는 것이 권장됩니다.
|
|
779
682
|
|
|
780
|
-
이를 위해 `.gitignore` 파일에 다음
|
|
683
|
+
이를 위해 `.gitignore` 파일에 다음 내용을 추가할 수 있습니다:
|
|
781
684
|
|
|
782
685
|
```plaintext fileName=".gitignore"
|
|
783
686
|
# Intlayer가 생성한 파일 무시
|
|
784
687
|
.intlayer
|
|
785
688
|
```
|
|
786
689
|
|
|
787
|
-
### VS Code 확장
|
|
690
|
+
### VS Code 확장 프로그램
|
|
788
691
|
|
|
789
|
-
Intlayer
|
|
692
|
+
Intlayer 개발 경험을 향상시키기 위해 공식 **Intlayer VS Code 확장 프로그램**을 설치할 수 있습니다.
|
|
790
693
|
|
|
791
694
|
[VS Code 마켓플레이스에서 설치하기](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
|
|
792
695
|
|
|
793
|
-
이 확장
|
|
696
|
+
이 확장 프로그램은 다음을 제공합니다:
|
|
794
697
|
|
|
795
|
-
- 번역 키에 대한 **자동 완성**
|
|
796
|
-
-
|
|
797
|
-
-
|
|
798
|
-
-
|
|
698
|
+
- 번역 키에 대한 **자동 완성** 기능.
|
|
699
|
+
- 누락된 번역에 대한 **실시간 오류 감지**.
|
|
700
|
+
- 번역된 콘텐츠의 **인라인 미리보기**.
|
|
701
|
+
- 번역을 쉽게 생성하고 업데이트할 수 있는 **빠른 작업**.
|
|
799
702
|
|
|
800
|
-
확장
|
|
703
|
+
확장 프로그램 사용 방법에 대한 자세한 내용은 [Intlayer VS Code 확장 프로그램 문서](https://intlayer.org/doc/vs-code-extension)를 참조하세요.
|
|
801
704
|
|
|
802
705
|
---
|
|
803
706
|
|
|
804
707
|
### 더 나아가기
|
|
805
708
|
|
|
806
|
-
더
|
|
807
|
-
|
|
808
|
-
---
|
|
709
|
+
더 나아가려면, [비주얼 에디터](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)를 사용하여 콘텐츠를 외부화할 수 있습니다.
|