@intlayer/docs 5.5.8 → 5.5.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/ar/autoFill.md +1 -2
  2. package/ar/intlayer_with_create_react_app.md +1 -14
  3. package/ar/intlayer_with_nextjs_14.md +1 -14
  4. package/ar/intlayer_with_nextjs_15.md +1 -14
  5. package/ar/intlayer_with_nextjs_page_router.md +1 -13
  6. package/ar/intlayer_with_nuxt.md +792 -0
  7. package/ar/intlayer_with_react_native+expo.md +6 -3
  8. package/ar/intlayer_with_vite+preact.md +7 -18
  9. package/ar/intlayer_with_vite+react.md +7 -17
  10. package/ar/intlayer_with_vite+vue.md +25 -5
  11. package/ar/packages/nuxt-intlayer/index.md +29 -0
  12. package/ar/roadmap.md +11 -11
  13. package/de/autoFill.md +1 -2
  14. package/de/how_works_intlayer.md +1 -1
  15. package/de/intlayer_with_create_react_app.md +1 -14
  16. package/de/intlayer_with_nextjs_14.md +1 -14
  17. package/de/intlayer_with_nextjs_15.md +1 -14
  18. package/de/intlayer_with_nextjs_page_router.md +1 -13
  19. package/de/intlayer_with_nuxt.md +791 -0
  20. package/de/intlayer_with_react_native+expo.md +6 -3
  21. package/de/intlayer_with_vite+preact.md +7 -18
  22. package/de/intlayer_with_vite+react.md +7 -17
  23. package/de/intlayer_with_vite+vue.md +84 -62
  24. package/de/packages/nuxt-intlayer/index.md +29 -0
  25. package/de/roadmap.md +11 -11
  26. package/en/autoFill.md +1 -2
  27. package/en/how_works_intlayer.md +17 -3
  28. package/en/intlayer_with_angular.md +535 -6
  29. package/en/intlayer_with_create_react_app.md +1 -14
  30. package/en/intlayer_with_nextjs_14.md +193 -59
  31. package/en/intlayer_with_nextjs_15.md +192 -61
  32. package/en/intlayer_with_nextjs_page_router.md +396 -61
  33. package/en/intlayer_with_nuxt.md +737 -0
  34. package/en/intlayer_with_react_native+expo.md +6 -3
  35. package/en/intlayer_with_vite+preact.md +8 -27
  36. package/en/intlayer_with_vite+react.md +7 -17
  37. package/en/intlayer_with_vite+solid.md +6 -3
  38. package/en/intlayer_with_vite+svelte.md +6 -3
  39. package/en/intlayer_with_vite+vue.md +17 -6
  40. package/en/packages/nuxt-intlayer/index.md +31 -0
  41. package/en/roadmap.md +13 -13
  42. package/en/t.md +5 -5
  43. package/en-GB/how_works_intlayer.md +16 -4
  44. package/en-GB/intlayer_with_create_react_app.md +1 -14
  45. package/en-GB/intlayer_with_nextjs_14.md +1 -14
  46. package/en-GB/intlayer_with_nextjs_15.md +1 -14
  47. package/en-GB/intlayer_with_nextjs_page_router.md +1 -13
  48. package/en-GB/intlayer_with_nuxt.md +795 -0
  49. package/en-GB/intlayer_with_react_native+expo.md +6 -3
  50. package/en-GB/intlayer_with_vite+preact.md +7 -18
  51. package/en-GB/intlayer_with_vite+react.md +6 -9
  52. package/en-GB/intlayer_with_vite+vue.md +65 -59
  53. package/en-GB/packages/nuxt-intlayer/index.md +31 -0
  54. package/en-GB/roadmap.md +11 -11
  55. package/es/autoFill.md +1 -2
  56. package/es/how_works_intlayer.md +1 -1
  57. package/es/intlayer_with_create_react_app.md +1 -14
  58. package/es/intlayer_with_nextjs_14.md +1 -14
  59. package/es/intlayer_with_nextjs_15.md +1 -14
  60. package/es/intlayer_with_nextjs_page_router.md +1 -13
  61. package/es/intlayer_with_nuxt.md +731 -0
  62. package/es/intlayer_with_react_native+expo.md +6 -3
  63. package/es/intlayer_with_vite+preact.md +7 -18
  64. package/es/intlayer_with_vite+react.md +7 -17
  65. package/es/intlayer_with_vite+vue.md +64 -51
  66. package/es/packages/nuxt-intlayer/index.md +29 -0
  67. package/fr/autoFill.md +1 -2
  68. package/fr/how_works_intlayer.md +1 -1
  69. package/fr/intlayer_with_create_react_app.md +1 -14
  70. package/fr/intlayer_with_nextjs_14.md +1 -14
  71. package/fr/intlayer_with_nextjs_15.md +1 -14
  72. package/fr/intlayer_with_nextjs_page_router.md +1 -13
  73. package/fr/intlayer_with_nuxt.md +731 -0
  74. package/fr/intlayer_with_react_native+expo.md +6 -3
  75. package/fr/intlayer_with_vite+preact.md +7 -18
  76. package/fr/intlayer_with_vite+react.md +7 -17
  77. package/fr/intlayer_with_vite+vue.md +30 -15
  78. package/fr/packages/nuxt-intlayer/index.md +29 -0
  79. package/fr/roadmap.md +11 -11
  80. package/hi/autoFill.md +1 -2
  81. package/hi/how_works_intlayer.md +1 -1
  82. package/hi/intlayer_with_create_react_app.md +1 -14
  83. package/hi/intlayer_with_nextjs_14.md +1 -14
  84. package/hi/intlayer_with_nextjs_15.md +1 -14
  85. package/hi/intlayer_with_nextjs_page_router.md +1 -13
  86. package/hi/intlayer_with_nuxt.md +784 -0
  87. package/hi/intlayer_with_react_native+expo.md +6 -3
  88. package/hi/intlayer_with_vite+preact.md +7 -18
  89. package/hi/intlayer_with_vite+react.md +7 -17
  90. package/hi/intlayer_with_vite+vue.md +59 -47
  91. package/hi/packages/nuxt-intlayer/index.md +29 -0
  92. package/hi/roadmap.md +11 -11
  93. package/index.cjs +30 -0
  94. package/index.d.ts +2 -0
  95. package/it/autoFill.md +1 -2
  96. package/it/how_works_intlayer.md +1 -1
  97. package/it/intlayer_with_create_react_app.md +0 -6
  98. package/it/intlayer_with_nextjs_14.md +1 -14
  99. package/it/intlayer_with_nextjs_15.md +1 -14
  100. package/it/intlayer_with_nextjs_page_router.md +1 -13
  101. package/it/intlayer_with_nuxt.md +793 -0
  102. package/it/intlayer_with_react_native+expo.md +6 -3
  103. package/it/intlayer_with_vite+preact.md +7 -18
  104. package/it/intlayer_with_vite+react.md +7 -17
  105. package/it/intlayer_with_vite+vue.md +26 -17
  106. package/it/packages/nuxt-intlayer/index.md +29 -0
  107. package/it/roadmap.md +11 -11
  108. package/ja/autoFill.md +1 -2
  109. package/ja/how_works_intlayer.md +1 -1
  110. package/ja/intlayer_with_create_react_app.md +1 -14
  111. package/ja/intlayer_with_nextjs_14.md +1 -14
  112. package/ja/intlayer_with_nextjs_15.md +1 -14
  113. package/ja/intlayer_with_nextjs_page_router.md +1 -13
  114. package/ja/intlayer_with_nuxt.md +792 -0
  115. package/ja/intlayer_with_react_native+expo.md +6 -3
  116. package/ja/intlayer_with_vite+preact.md +7 -18
  117. package/ja/intlayer_with_vite+react.md +7 -17
  118. package/ja/intlayer_with_vite+vue.md +68 -63
  119. package/ja/packages/nuxt-intlayer/index.md +29 -0
  120. package/ja/roadmap.md +11 -11
  121. package/ko/autoFill.md +1 -2
  122. package/ko/how_works_intlayer.md +1 -1
  123. package/ko/intlayer_with_create_react_app.md +1 -14
  124. package/ko/intlayer_with_nextjs_14.md +1 -14
  125. package/ko/intlayer_with_nextjs_15.md +1 -14
  126. package/ko/intlayer_with_nextjs_page_router.md +1 -13
  127. package/ko/intlayer_with_nuxt.md +784 -0
  128. package/ko/intlayer_with_react_native+expo.md +6 -3
  129. package/ko/intlayer_with_vite+preact.md +7 -18
  130. package/ko/intlayer_with_vite+react.md +7 -17
  131. package/ko/intlayer_with_vite+vue.md +69 -59
  132. package/ko/packages/nuxt-intlayer/index.md +31 -0
  133. package/ko/roadmap.md +11 -11
  134. package/package.json +4 -4
  135. package/pt/autoFill.md +1 -2
  136. package/pt/how_works_intlayer.md +1 -1
  137. package/pt/intlayer_with_create_react_app.md +1 -14
  138. package/pt/intlayer_with_nextjs_14.md +1 -14
  139. package/pt/intlayer_with_nextjs_15.md +1 -14
  140. package/pt/intlayer_with_nextjs_page_router.md +1 -13
  141. package/pt/intlayer_with_nuxt.md +792 -0
  142. package/pt/intlayer_with_react_native+expo.md +6 -3
  143. package/pt/intlayer_with_vite+preact.md +7 -18
  144. package/pt/intlayer_with_vite+react.md +7 -17
  145. package/pt/intlayer_with_vite+vue.md +23 -19
  146. package/pt/packages/nuxt-intlayer/index.md +29 -0
  147. package/pt/roadmap.md +11 -11
  148. package/ru/autoFill.md +1 -2
  149. package/ru/how_works_intlayer.md +1 -1
  150. package/ru/intlayer_with_create_react_app.md +1 -14
  151. package/ru/intlayer_with_nextjs_14.md +1 -14
  152. package/ru/intlayer_with_nextjs_15.md +1 -14
  153. package/ru/intlayer_with_nextjs_page_router.md +1 -13
  154. package/ru/intlayer_with_nuxt.md +792 -0
  155. package/ru/intlayer_with_react_native+expo.md +6 -3
  156. package/ru/intlayer_with_vite+preact.md +7 -18
  157. package/ru/intlayer_with_vite+react.md +7 -17
  158. package/ru/intlayer_with_vite+vue.md +25 -17
  159. package/ru/packages/nuxt-intlayer/index.md +31 -0
  160. package/ru/roadmap.md +11 -11
  161. package/zh/autoFill.md +1 -2
  162. package/zh/intlayer_with_create_react_app.md +1 -14
  163. package/zh/intlayer_with_nextjs_14.md +1 -14
  164. package/zh/intlayer_with_nextjs_15.md +1 -14
  165. package/zh/intlayer_with_nextjs_page_router.md +1 -13
  166. package/zh/intlayer_with_nuxt.md +784 -0
  167. package/zh/intlayer_with_react_native+expo.md +6 -3
  168. package/zh/intlayer_with_vite+preact.md +7 -18
  169. package/zh/intlayer_with_vite+react.md +7 -17
  170. package/zh/intlayer_with_vite+vue.md +68 -57
  171. package/zh/packages/nuxt-intlayer/index.md +31 -0
  172. package/zh/roadmap.md +11 -11
@@ -0,0 +1,784 @@
1
+ # Intlayer와 Nuxt를 사용한 국제화(i18n) 시작하기
2
+
3
+ [애플리케이션 템플릿](https://github.com/aymericzip/intlayer-nuxt-template)을 GitHub에서 확인하세요.
4
+
5
+ ## Intlayer란 무엇인가요?
6
+
7
+ **Intlayer**는 현대 웹 애플리케이션에서 다국어 지원을 간소화하기 위해 설계된 혁신적이고 오픈 소스인 국제화(i18n) 라이브러리입니다.
8
+
9
+ Intlayer를 사용하면 다음을 수행할 수 있습니다:
10
+
11
+ - **컴포넌트 수준에서 선언적 사전을 사용하여 번역을 쉽게 관리**할 수 있습니다.
12
+ - **메타데이터, 라우트 및 콘텐츠를 동적으로 지역화**할 수 있습니다.
13
+ - **자동 생성된 타입을 통해 TypeScript 지원**을 보장하여 자동 완성과 오류 감지를 개선합니다.
14
+ - **동적 로케일 감지 및 전환**과 같은 고급 기능을 활용할 수 있습니다.
15
+
16
+ ---
17
+
18
+ ## Nuxt 애플리케이션에서 Intlayer 설정 단계별 가이드
19
+
20
+ ### 1단계: 종속성 설치
21
+
22
+ npm을 사용하여 필요한 패키지를 설치하세요:
23
+
24
+ ```bash packageManager="npm"
25
+ npm install intlayer vue-intlayer
26
+ npm install --save-dev nuxt-intlayer
27
+ ```
28
+
29
+ ```bash packageManager="pnpm"
30
+ pnpm add intlayer vue-intlayer
31
+ pnpm add --save-dev nuxt-intlayer
32
+ ```
33
+
34
+ ```bash packageManager="yarn"
35
+ yarn add intlayer vue-intlayer
36
+ yarn add --save-dev nuxt-intlayer
37
+ ```
38
+
39
+ - **intlayer**
40
+
41
+ 구성 관리, 번역, [콘텐츠 선언](https://github.com/aymericzip/intlayer/blob/main/docs/ko/dictionary/get_started.md), 트랜스파일링 및 [CLI 명령어](https://github.com/aymericzip/intlayer/blob/main/docs/ko/intlayer_cli.md)를 위한 국제화 도구를 제공하는 핵심 패키지입니다.
42
+
43
+ - **vue-intlayer**
44
+ Intlayer를 Vue 애플리케이션과 통합하는 패키지입니다. Vue 컴포넌트를 위한 composable을 제공합니다.
45
+
46
+ - **nuxt-intlayer**
47
+ Intlayer를 Nuxt 애플리케이션과 통합하는 Nuxt 모듈입니다. 자동 설정, 로케일 감지를 위한 미들웨어, 쿠키 관리 및 URL 리디렉션을 제공합니다.
48
+
49
+ ### 2단계: 프로젝트 구성
50
+
51
+ 애플리케이션의 언어를 구성하기 위한 설정 파일을 생성하세요:
52
+
53
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
54
+ import { Locales, type IntlayerConfig } from "intlayer";
55
+
56
+ const config: IntlayerConfig = {
57
+ internationalization: {
58
+ locales: [
59
+ Locales.ENGLISH,
60
+ Locales.FRENCH,
61
+ Locales.SPANISH,
62
+ // 다른 로케일 추가
63
+ ],
64
+ defaultLocale: Locales.ENGLISH,
65
+ },
66
+ };
67
+
68
+ export default config;
69
+ ```
70
+
71
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
72
+ import { Locales } from "intlayer";
73
+
74
+ /** @type {import('intlayer').IntlayerConfig} */
75
+ const config = {
76
+ internationalization: {
77
+ locales: [
78
+ Locales.ENGLISH,
79
+ Locales.FRENCH,
80
+ Locales.SPANISH,
81
+ // 다른 로케일 추가
82
+ ],
83
+ defaultLocale: Locales.ENGLISH,
84
+ },
85
+ };
86
+
87
+ export default config;
88
+ ```
89
+
90
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
91
+ const { Locales } = require("intlayer");
92
+
93
+ /** @type {import('intlayer').IntlayerConfig} */
94
+ const config = {
95
+ internationalization: {
96
+ locales: [
97
+ Locales.ENGLISH,
98
+ Locales.FRENCH,
99
+ Locales.SPANISH,
100
+ // 다른 로케일 추가
101
+ ],
102
+ defaultLocale: Locales.ENGLISH,
103
+ },
104
+ };
105
+
106
+ module.exports = config;
107
+ ```
108
+
109
+ > 이 구성 파일을 통해 로컬화된 URL, 미들웨어 리디렉션, 쿠키 이름, 콘텐츠 선언의 위치 및 확장자, 콘솔에서 Intlayer 로그 비활성화 등을 설정할 수 있습니다. 사용 가능한 매개변수의 전체 목록은 [구성 문서](https://github.com/aymericzip/intlayer/blob/main/docs/ko/configuration.md)를 참조하세요.
110
+
111
+ ### 3단계: Nuxt 구성에 Intlayer 통합
112
+
113
+ Nuxt 구성에 intlayer 모듈을 추가하세요:
114
+
115
+ ```typescript fileName="nuxt.config.ts"
116
+ import { defineNuxtConfig } from "nuxt/config";
117
+
118
+ export default defineNuxtConfig({
119
+ // ... 기존 Nuxt 구성
120
+ modules: ["nuxt-intlayer"],
121
+ });
122
+ ```
123
+
124
+ > `nuxt-intlayer` 모듈은 Intlayer와 Nuxt의 통합을 자동으로 처리합니다. 콘텐츠 선언 빌드 설정, 개발 모드에서 파일 모니터링, 로케일 감지를 위한 미들웨어 제공, 로컬화된 라우팅 관리 등을 수행합니다.
125
+
126
+ ### 4단계: 콘텐츠 선언
127
+
128
+ 번역을 저장하기 위해 콘텐츠 선언을 생성하고 관리하세요:
129
+
130
+ ```tsx fileName="components/helloWorld.content.ts" contentDeclarationFormat="typescript"
131
+ import { t, type Dictionary } from "intlayer";
132
+
133
+ const helloWorldContent = {
134
+ key: "helloworld",
135
+ content: {
136
+ count: t({
137
+ ko: "카운트는 ",
138
+ en: "count is ",
139
+ fr: "le compte est ",
140
+ es: "el recuento es ",
141
+ }),
142
+ edit: t({
143
+ ko: "<code>components/HelloWorld.vue</code>를 편집하고 저장하여 HMR을 테스트하세요",
144
+ en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
145
+ fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
146
+ es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
147
+ }),
148
+ checkOut: t({
149
+ ko: "확인하세요 ",
150
+ en: "Check out ",
151
+ fr: "Vérifiez ",
152
+ es: "Compruebe ",
153
+ }),
154
+ nuxtIntlayer: t({
155
+ ko: "Nuxt Intlayer 문서",
156
+ en: "Nuxt Intlayer documentation",
157
+ fr: "Documentation de Nuxt Intlayer",
158
+ es: "Documentación de Nuxt Intlayer",
159
+ }),
160
+ learnMore: t({
161
+ ko: "Nuxt에 대해 더 알아보세요 ",
162
+ en: "Learn more about Nuxt in the ",
163
+ fr: "En savoir plus sur Nuxt dans la ",
164
+ es: "Aprenda más sobre Nuxt en la ",
165
+ }),
166
+ nuxtDocs: t({
167
+ ko: "Nuxt 문서",
168
+ en: "Nuxt Documentation",
169
+ fr: "Documentation Nuxt",
170
+ es: "Documentación de Nuxt",
171
+ }),
172
+ readTheDocs: t({
173
+ ko: "Nuxt 로고를 클릭하여 자세히 알아보세요",
174
+ en: "Click on the Nuxt logo to learn more",
175
+ fr: "Cliquez sur le logo Nuxt pour en savoir plus",
176
+ es: "Haga clic en el logotipo de Nuxt para obtener más información",
177
+ }),
178
+ },
179
+ } satisfies Dictionary;
180
+
181
+ export default helloWorldContent;
182
+ ```
183
+
184
+ ```javascript fileName="components/helloWorld.content.mjs" contentDeclarationFormat="esm"
185
+ import { t } from "intlayer";
186
+
187
+ /** @type {import('intlayer').Dictionary} */
188
+ const helloWorldContent = {
189
+ key: "helloworld",
190
+ content: {
191
+ count: t({
192
+ ko: "카운트는 ",
193
+ en: "count is ",
194
+ fr: "le compte est ",
195
+ es: "el recuento es ",
196
+ }),
197
+ edit: t({
198
+ ko: "<code>components/HelloWorld.vue</code>를 편집하고 저장하여 HMR을 테스트하세요",
199
+ en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
200
+ fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
201
+ es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
202
+ }),
203
+ checkOut: t({
204
+ ko: "확인하세요 ",
205
+ en: "Check out ",
206
+ fr: "Vérifiez ",
207
+ es: "Compruebe ",
208
+ }),
209
+ nuxtIntlayer: t({
210
+ ko: "Nuxt Intlayer 문서",
211
+ en: "Nuxt Intlayer documentation",
212
+ fr: "Documentation de Nuxt Intlayer",
213
+ es: "Documentación de Nuxt Intlayer",
214
+ }),
215
+ learnMore: t({
216
+ ko: "Nuxt에 대해 더 알아보세요 ",
217
+ en: "Learn more about Nuxt in the ",
218
+ fr: "En savoir plus sur Nuxt dans la ",
219
+ es: "Aprenda más sobre Nuxt en la ",
220
+ }),
221
+ nuxtDocs: t({
222
+ ko: "Nuxt 문서",
223
+ en: "Nuxt Documentation",
224
+ fr: "Documentation Nuxt",
225
+ es: "Documentación de Nuxt",
226
+ }),
227
+ readTheDocs: t({
228
+ ko: "Nuxt 로고를 클릭하여 자세히 알아보세요",
229
+ en: "Click on the Nuxt logo to learn more",
230
+ fr: "Cliquez sur le logo Nuxt pour en savoir plus",
231
+ es: "Haga clic en el logotipo de Nuxt para obtener más información",
232
+ }),
233
+ },
234
+ };
235
+
236
+ export default helloWorldContent;
237
+ ```
238
+
239
+ ```javascript fileName="components/helloWorld.content.cjs" contentDeclarationFormat="commonjs"
240
+ const { t } = require("intlayer");
241
+
242
+ /** @type {import('intlayer').Dictionary} */
243
+ const helloWorldContent = {
244
+ key: "helloworld",
245
+ content: {
246
+ count: t({
247
+ ko: "카운트는 ",
248
+ en: "count is ",
249
+ fr: "le compte est ",
250
+ es: "el recuento es ",
251
+ }),
252
+ edit: t({
253
+ ko: "<code>components/HelloWorld.vue</code>를 편집하고 저장하여 HMR을 테스트하세요",
254
+ en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
255
+ fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
256
+ es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
257
+ }),
258
+ checkOut: t({
259
+ ko: "확인하세요 ",
260
+ en: "Check out ",
261
+ fr: "Vérifiez ",
262
+ es: "Compruebe ",
263
+ }),
264
+ nuxtIntlayer: t({
265
+ ko: "Nuxt Intlayer 문서",
266
+ en: "Nuxt Intlayer documentation",
267
+ fr: "Documentation de Nuxt Intlayer",
268
+ es: "Documentación de Nuxt Intlayer",
269
+ }),
270
+ learnMore: t({
271
+ ko: "Nuxt에 대해 더 알아보세요 ",
272
+ en: "Learn more about Nuxt in the ",
273
+ fr: "En savoir plus sur Nuxt dans la ",
274
+ es: "Aprenda más sobre Nuxt en la ",
275
+ }),
276
+ nuxtDocs: t({
277
+ ko: "Nuxt 문서",
278
+ en: "Nuxt Documentation",
279
+ fr: "Documentation Nuxt",
280
+ es: "Documentación de Nuxt",
281
+ }),
282
+ readTheDocs: t({
283
+ ko: "Nuxt 로고를 클릭하여 자세히 알아보세요",
284
+ en: "Click on the Nuxt logo to learn more",
285
+ fr: "Cliquez sur le logo Nuxt pour en savoir plus",
286
+ es: "Haga clic en el logotipo de Nuxt para obtener más información",
287
+ }),
288
+ },
289
+ };
290
+
291
+ module.exports = helloWorldContent;
292
+ ```
293
+
294
+ ```json fileName="components/helloWorld.content.json" contentDeclarationFormat="json"
295
+ {
296
+ "$schema": "https://intlayer.org/schema.json",
297
+ "key": "helloworld",
298
+ "content": {
299
+ "count": {
300
+ "nodeType": "translation",
301
+ "translation": {
302
+ "ko": "카운트는 ",
303
+ "en": "count is ",
304
+ "fr": "le compte est ",
305
+ "es": "el recuento es "
306
+ }
307
+ },
308
+ "edit": {
309
+ "nodeType": "translation",
310
+ "translation": {
311
+ "ko": "<code>components/HelloWorld.vue</code>를 편집하고 저장하여 HMR을 테스트하세요",
312
+ "en": "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
313
+ "fr": "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
314
+ "es": "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR"
315
+ }
316
+ },
317
+ "checkOut": {
318
+ "nodeType": "translation",
319
+ "translation": {
320
+ "ko": "확인하세요 ",
321
+ "en": "Check out ",
322
+ "fr": "Vérifiez ",
323
+ "es": "Compruebe "
324
+ }
325
+ },
326
+ "nuxtIntlayer": {
327
+ "nodeType": "translation",
328
+ "translation": {
329
+ "ko": "Nuxt Intlayer 문서",
330
+ "en": "Nuxt Intlayer documentation",
331
+ "fr": "Documentation de Nuxt Intlayer",
332
+ "es": "Documentación de Nuxt Intlayer"
333
+ }
334
+ },
335
+ "learnMore": {
336
+ "nodeType": "translation",
337
+ "translation": {
338
+ "ko": "Nuxt에 대해 더 알아보세요 ",
339
+ "en": "Learn more about Nuxt in the ",
340
+ "fr": "En savoir plus sur Nuxt dans la ",
341
+ "es": "Aprenda más sobre Nuxt en la "
342
+ }
343
+ },
344
+ "nuxtDocs": {
345
+ "nodeType": "translation",
346
+ "translation": {
347
+ "ko": "Nuxt 문서",
348
+ "en": "Nuxt Documentation",
349
+ "fr": "Documentation Nuxt",
350
+ "es": "Documentación de Nuxt"
351
+ }
352
+ },
353
+ "readTheDocs": {
354
+ "nodeType": "translation",
355
+ "translation": {
356
+ "ko": "Nuxt 로고를 클릭하여 자세히 알아보세요",
357
+ "en": "Click on the Nuxt logo to learn more",
358
+ "fr": "Cliquez sur le logo Nuxt pour en savoir plus",
359
+ "es": "Haga clic en el logotipo de Nuxt para obtener más información"
360
+ }
361
+ }
362
+ }
363
+ }
364
+ ```
365
+
366
+ > 콘텐츠 선언은 애플리케이션의 `contentDir` 디렉토리(기본값: `./src`)에 포함되기만 하면 어디에 정의되어도 됩니다. 콘텐츠 선언 파일 확장자(기본값: `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`)와 일치해야 합니다.
367
+
368
+ > 자세한 내용은 [콘텐츠 선언 문서](https://github.com/aymericzip/intlayer/blob/main/docs/ko/dictionary/get_started.md)를 참조하세요.
369
+
370
+ ### 5단계: 코드에서 Intlayer 활용하기
371
+
372
+ `useIntlayer` 컴포저블을 사용하여 Nuxt 애플리케이션 전반에서 콘텐츠 사전을 액세스하세요:
373
+
374
+ ```vue fileName="components/HelloWorld.vue"
375
+ <script setup lang="ts">
376
+ import { ref } from "vue";
377
+ import { useIntlayer } from "vue-intlayer";
378
+
379
+ defineProps({
380
+ msg: String,
381
+ });
382
+
383
+ const {
384
+ count,
385
+ edit,
386
+ checkOut,
387
+ nuxtIntlayer,
388
+ learnMore,
389
+ nuxtDocs,
390
+ readTheDocs,
391
+ } = useIntlayer("helloworld");
392
+ const countRef = ref(0);
393
+ </script>
394
+
395
+ <template>
396
+ <h1>{{ msg }}</h1>
397
+
398
+ <div class="card">
399
+ <button type="button" @click="countRef++">
400
+ <count />
401
+ {{ countRef }}
402
+ </button>
403
+ <p v-html="edit"></p>
404
+ </div>
405
+
406
+ <p>
407
+ <checkOut />
408
+ <a href="https://nuxt.com/docs/getting-started/introduction" target="_blank"
409
+ >Nuxt</a
410
+ >, <nuxtIntlayer />
411
+ </p>
412
+ <p>
413
+ <learnMore />
414
+ <a href="https://nuxt.com" target="_blank"><nuxtDocs /></a>.
415
+ </p>
416
+ <p class="read-the-docs"><readTheDocs /></p>
417
+ <p class="read-the-docs">{{ readTheDocs }}</p>
418
+ </template>
419
+ ```
420
+
421
+ #### Intlayer에서 콘텐츠 액세스하기
422
+
423
+ Intlayer는 콘텐츠에 액세스하기 위한 두 가지 API를 제공합니다:
424
+
425
+ - **컴포넌트 기반 문법** (권장):
426
+ `<myContent />` 문법을 사용하여 콘텐츠를 Intlayer 노드로 렌더링합니다. 이는 [비주얼 에디터](https://github.com/aymericzip/intlayer/blob/main/docs/ko/intlayer_visual_editor.md) 및 [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/ko/intlayer_CMS.md)와 원활하게 통합됩니다.
427
+
428
+ - **문자열 기반 문법**:
429
+ `{{ myContent }}`를 사용하여 콘텐츠를 상호작용 없이 일반 텍스트로 렌더링합니다.
430
+
431
+ ### (선택 사항) 6단계: 콘텐츠 언어 변경하기
432
+
433
+ `useLocale` 컴포저블에서 제공하는 `setLocale` 함수를 사용하여 콘텐츠의 언어를 변경할 수 있습니다. 이 함수는 애플리케이션의 로케일을 설정하고 콘텐츠를 업데이트합니다.
434
+
435
+ 언어를 전환하는 컴포넌트를 만드세요:
436
+
437
+ ```vue fileName="components/LocaleSwitcher.vue"
438
+ <template>
439
+ <div class="locale-switcher">
440
+ <select v-model="selectedLocale" @change="changeLocale">
441
+ <option v-for="loc in availableLocales" :key="loc" :value="loc">
442
+ {{ getLocaleName(loc) }}
443
+ </option>
444
+ </select>
445
+ </div>
446
+ </template>
447
+
448
+ <script setup lang="ts">
449
+ import { ref, watch } from "vue";
450
+ import { getLocaleName } from "intlayer";
451
+ import { useLocale } from "vue-intlayer";
452
+
453
+ // 로케일 정보 및 setLocale 함수 가져오기
454
+ const { locale, availableLocales, setLocale } = useLocale();
455
+
456
+ // 선택된 로케일을 ref로 추적
457
+ const selectedLocale = ref(locale.value);
458
+
459
+ // 선택이 변경될 때 로케일 업데이트
460
+ const changeLocale = () => setLocale(selectedLocale.value);
461
+
462
+ // 글로벌 로케일과 selectedLocale을 동기화
463
+ watch(
464
+ () => locale.value,
465
+ (newLocale) => {
466
+ selectedLocale.value = newLocale;
467
+ }
468
+ );
469
+ </script>
470
+ </template>
471
+
472
+ <style scoped>
473
+ .locale-switcher {
474
+ margin: 1rem 0;
475
+ }
476
+
477
+ select {
478
+ padding: 0.5rem;
479
+ border-radius: 0.25rem;
480
+ border: 1px solid #ccc;
481
+ }
482
+ </style>
483
+ ```
484
+
485
+ 그런 다음, 이 컴포넌트를 페이지나 레이아웃에서 사용하세요:
486
+
487
+ ```vue fileName="app.vue"
488
+ <script setup lang="ts">
489
+ import { useIntlayer } from "vue-intlayer";
490
+ import LocaleSwitcher from "~/components/LocaleSwitcher.vue";
491
+
492
+ const content = useIntlayer("app"); // 관련 Intlayer 선언 파일 생성
493
+ </script>
494
+
495
+ <template>
496
+ <div>
497
+ <header>
498
+ <LocaleSwitcher />
499
+ </header>
500
+ <main>
501
+ <NuxtPage />
502
+ </main>
503
+ </div>
504
+ </template>
505
+ ```
506
+
507
+ ### (선택 사항) 7단계: 애플리케이션에 로컬라이즈된 라우팅 추가하기
508
+
509
+ `nuxt-intlayer` 모듈을 사용할 때 Nuxt는 로컬라이즈된 라우팅을 자동으로 처리합니다. 이는 페이지 디렉토리 구조를 기반으로 각 언어에 대한 라우트를 자동으로 생성합니다.
510
+
511
+ 예시:
512
+
513
+ ```plaintext
514
+ pages/
515
+ ├── index.vue → /, /ko, /es
516
+ ├── about.vue → /about, /ko/about, /es/about
517
+ └── contact/
518
+ └── index.vue → /contact, /ko/contact, /es/contact
519
+ ```
520
+
521
+ 로컬라이즈된 페이지를 생성하려면 `pages/` 디렉토리에 Vue 파일을 생성하세요:
522
+
523
+ ```vue fileName="pages/about.vue"
524
+ <script setup lang="ts">
525
+ import { useIntlayer } from "vue-intlayer";
526
+
527
+ const content = useIntlayer("about");
528
+ </script>
529
+
530
+ <template>
531
+ <div>
532
+ <h1>{{ content.title }}</h1>
533
+ <p>{{ content.description }}</p>
534
+ </div>
535
+ </template>
536
+ ```
537
+
538
+ `nuxt-intlayer` 모듈은 자동으로 다음을 수행합니다:
539
+
540
+ - 사용자의 선호 로케일 감지
541
+ - URL을 통한 로케일 전환 처리
542
+ - 적절한 `<html lang="">` 속성 설정
543
+ - 로케일 쿠키 관리
544
+ - 사용자를 적절한 로컬라이즈된 URL로 리디렉션
545
+
546
+ ### (선택 사항) 8단계: 로컬라이즈된 링크 컴포넌트 생성
547
+
548
+ 애플리케이션의 네비게이션이 현재 로케일을 준수하도록 하려면 커스텀 `LocalizedLink` 컴포넌트를 생성할 수 있습니다. 이 컴포넌트는 내부 URL에 현재 언어를 자동으로 접두사로 추가합니다.
549
+
550
+ ```vue fileName="components/LocalizedLink.vue"
551
+ <template>
552
+ <NuxtLink :to="localizedHref" v-bind="$attrs">
553
+ <slot />
554
+ </NuxtLink>
555
+ </template>
556
+
557
+ <script setup lang="ts">
558
+ import { computed } from "vue";
559
+ import { getLocalizedUrl } from "intlayer";
560
+ import { useLocale } from "vue-intlayer";
561
+
562
+ const props = defineProps({
563
+ to: {
564
+ type: String,
565
+ required: true,
566
+ },
567
+ });
568
+
569
+ const { locale } = useLocale();
570
+
571
+ // 링크가 외부 링크인지 확인
572
+ const isExternalLink = computed(() => /^https?:\/\//.test(props.to || ""));
573
+
574
+ // 내부 링크에 대한 로컬라이즈된 href 생성
575
+ const localizedHref = computed(() =>
576
+ isExternalLink.value ? props.to : getLocalizedUrl(props.to, locale.value)
577
+ );
578
+ </script>
579
+ ```
580
+
581
+ 그런 다음 애플리케이션 전반에서 이 컴포넌트를 사용하세요:
582
+
583
+ ```vue fileName="pages/index.vue"
584
+ <template>
585
+ <div>
586
+ <LocalizedLink to="/about">
587
+ {{ content.aboutLink }}
588
+ </LocalizedLink>
589
+
590
+ <LocalizedLink to="/ko/contact">
591
+ {{ content.contactLink }}
592
+ </LocalizedLink>
593
+ </div>
594
+ </template>
595
+
596
+ <script setup lang="ts">
597
+ import { useIntlayer } from "vue-intlayer";
598
+ import LocalizedLink from "~/components/LocalizedLink.vue";
599
+
600
+ const content = useIntlayer("home");
601
+ </script>
602
+ ```
603
+
604
+ ### (선택 사항) 단계 9: 메타데이터 및 SEO 처리
605
+
606
+ Nuxt는 뛰어난 SEO 기능을 제공합니다. Intlayer를 사용하여 로컬라이즈된 메타데이터를 처리할 수 있습니다:
607
+
608
+ ```vue fileName="pages/about.vue"
609
+ <script setup lang="ts">
610
+ import { useSeoMeta } from "nuxt/app";
611
+ import { getIntlayer } from "intlayer";
612
+ import { useLocale } from "vue-intlayer";
613
+
614
+ const { locale } = useLocale();
615
+ const content = getIntlayer("about-meta", locale.value);
616
+
617
+ useSeoMeta({
618
+ title: content.title,
619
+ description: content.description,
620
+ });
621
+ </script>
622
+
623
+ <template>
624
+ <div>
625
+ <h1>{{ content.pageTitle }}</h1>
626
+ <p>{{ content.pageContent }}</p>
627
+ </div>
628
+ </template>
629
+ ```
630
+
631
+ 해당 콘텐츠 선언을 생성합니다:
632
+
633
+ ```typescript fileName="pages/about-meta.content.ts" contentDeclarationFormat="typescript"
634
+ import { t, type Dictionary } from "intlayer";
635
+ import type { useSeoMeta } from "nuxt/app";
636
+
637
+ const aboutMetaContent = {
638
+ key: "about-meta",
639
+ content: {
640
+ title: t({
641
+ ko: "회사 소개 - 우리 회사",
642
+ en: "About Us - My Company",
643
+ fr: "À Propos - Ma Société",
644
+ es: "Acerca de Nosotros - Mi Empresa",
645
+ }),
646
+ description: t({
647
+ ko: "우리 회사와 우리의 미션에 대해 더 알아보세요",
648
+ en: "Learn more about our company and our mission",
649
+ fr: "En savoir plus sur notre société et notre mission",
650
+ es: "Conozca más sobre nuestra empresa y nuestra misión",
651
+ }),
652
+ },
653
+ } satisfies Dictionary<Parameters<typeof useSeoMeta>[0]>;
654
+
655
+ export default aboutMetaContent;
656
+ ```
657
+
658
+ ```typescript fileName="pages/about-meta.content.mjs" contentDeclarationFormat="esm"
659
+ import { t } from "intlayer";
660
+
661
+ /** @type {import('intlayer').Dictionary} */
662
+ const aboutMetaContent = {
663
+ key: "about-meta",
664
+ content: {
665
+ title: t({
666
+ ko: "회사 소개 - 우리 회사",
667
+ en: "About Us - My Company",
668
+ fr: "À Propos - Ma Société",
669
+ es: "Acerca de Nosotros - Mi Empresa",
670
+ }),
671
+ description: t({
672
+ ko: "우리 회사와 우리의 미션에 대해 더 알아보세요",
673
+ en: "Learn more about our company and our mission",
674
+ fr: "En savoir plus sur notre société et notre mission",
675
+ es: "Conozca más sobre nuestra empresa y nuestra misión",
676
+ }),
677
+ },
678
+ };
679
+
680
+ export default aboutMetaContent;
681
+ ```
682
+
683
+ ```typescript fileName="pages/about-meta.content.js" contentDeclarationFormat="cjs"
684
+ const { t } = require("intlayer");
685
+
686
+ /** @type {import('intlayer').Dictionary} */
687
+ const aboutMetaContent = {
688
+ key: "about-meta",
689
+ content: {
690
+ title: t({
691
+ ko: "회사 소개 - 우리 회사",
692
+ en: "About Us - My Company",
693
+ fr: "À Propos - Ma Société",
694
+ es: "Acerca de Nosotros - Mi Empresa",
695
+ }),
696
+ description: t({
697
+ ko: "우리 회사와 우리의 미션에 대해 더 알아보세요",
698
+ en: "Learn more about our company and our mission",
699
+ fr: "En savoir plus sur notre société et notre mission",
700
+ es: "Conozca más sobre nuestra empresa y nuestra misión",
701
+ }),
702
+ },
703
+ };
704
+
705
+ module.exports = aboutMetaContent;
706
+ ```
707
+
708
+ ```json fileName="pages/about-meta.content.json" contentDeclarationFormat="json"
709
+ {
710
+ "key": "about-meta",
711
+ "content": {
712
+ "title": {
713
+ "nodeType": "translation",
714
+ "translations": {
715
+ "ko": "회사 소개 - 우리 회사",
716
+ "en": "About Us - My Company",
717
+ "fr": "À Propos - Ma Société",
718
+ "es": "Acerca de Nosotros - Mi Empresa"
719
+ }
720
+ },
721
+ "description": {
722
+ "nodeType": "translation",
723
+ "translations": {
724
+ "ko": "우리 회사와 우리의 미션에 대해 더 알아보세요",
725
+ "en": "Learn more about our company and our mission",
726
+ "fr": "En savoir plus sur notre société et notre mission",
727
+ "es": "Conozca más sobre nuestra empresa y nuestra misión"
728
+ }
729
+ }
730
+ }
731
+ }
732
+ ```
733
+
734
+ ### TypeScript 구성
735
+
736
+ Intlayer는 모듈 확장을 사용하여 TypeScript의 이점을 활용하고 코드베이스를 더욱 강력하게 만듭니다.
737
+
738
+ ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png)
739
+
740
+ ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png)
741
+
742
+ TypeScript 구성에 자동 생성된 타입을 포함하도록 설정하세요.
743
+
744
+ ```json5 fileName="tsconfig.json"
745
+ {
746
+ // ... 기존 TypeScript 구성
747
+ "include": [
748
+ // ... 기존 TypeScript 구성
749
+ ".intlayer/**/*.ts", // 자동 생성된 타입 포함
750
+ ],
751
+ }
752
+ ```
753
+
754
+ ### Git 구성
755
+
756
+ Intlayer가 생성한 파일을 무시하는 것이 좋습니다. 이를 통해 해당 파일을 Git 저장소에 커밋하지 않을 수 있습니다.
757
+
758
+ 이를 위해 `.gitignore` 파일에 다음 지침을 추가할 수 있습니다:
759
+
760
+ ```plaintext fileName=".gitignore"
761
+ # Intlayer가 생성한 파일 무시
762
+ .intlayer
763
+ ```
764
+
765
+ ### VS Code 확장 프로그램
766
+
767
+ Intlayer와 함께 개발 경험을 향상시키기 위해 공식 **Intlayer VS Code 확장 프로그램**을 설치할 수 있습니다.
768
+
769
+ [VS Code 마켓플레이스에서 설치](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
770
+
771
+ 이 확장 프로그램은 다음을 제공합니다:
772
+
773
+ - 번역 키에 대한 **자동 완성**.
774
+ - 누락된 번역에 대한 **실시간 오류 감지**.
775
+ - 번역된 콘텐츠의 **인라인 미리보기**.
776
+ - 번역을 쉽게 생성하고 업데이트할 수 있는 **빠른 작업**.
777
+
778
+ 확장 프로그램 사용 방법에 대한 자세한 내용은 [Intlayer VS Code 확장 프로그램 문서](https://intlayer.org/doc/vs-code-extension)를 참조하세요.
779
+
780
+ ---
781
+
782
+ ### 더 나아가기
783
+
784
+ ## 더 나아가려면 [시각적 편집기](https://github.com/aymericzip/intlayer/blob/main/docs/ko/intlayer_visual_editor.md)를 구현하거나 [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/ko/intlayer_CMS.md)를 사용하여 콘텐츠를 외부화할 수 있습니다.