Skip to content

Commit 393dcf2

Browse files
jsparkdevHiDeoo
andauthored
i18n(ko-KR): update i18n.mdx (#2674)
Co-authored-by: HiDeoo <494699+HiDeoo@users.noreply.github.com>
1 parent 5947f91 commit 393dcf2

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

‎docs/src/content/docs/ko/guides/i18n.mdx

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Starlight는 라우팅, 대체 콘텐츠 및 전체 RTL(오른쪽에서 왼쪽
6666

6767
</Steps>
6868

69-
고급 국제화 시나리오를 위해 Starlight는 [Astro의 `i18n` 구성](https://docs.astro.build/ko/guides/internationalization/#i18n-%EB%9D%BC%EC%9A%B0%ED%8C%85-%EA%B5%AC%EC%84%B1) 옵션을 사용하는 국제화 구성도 지원합니다.
69+
고급 국제화 시나리오를 위해 Starlight는 [Astro의 `i18n` 구성](https://docs.astro.build/ko/guides/internationalization/#i18n-라우팅-구성) 옵션을 사용하는 국제화 구성도 지원합니다.
7070

7171
### 루트 로케일 사용
7272

@@ -189,16 +189,16 @@ Starlight를 사용하면 번역된 콘텐츠 파일을 호스팅하는 것 외
189189

190190
<Steps>
191191

192-
1. 아직 구성되지 않은 경우 `src/content/config.ts`에서 `i18n` 데이터 컬렉션을 구성합니다.
192+
1. 아직 구성되지 않은 경우 `src/content.config.ts`에서 `i18n` 데이터 컬렉션을 구성합니다.
193193

194-
```diff lang="js" ins=/, (i18nSchema)/
195-
// src/content/config.ts
196-
import { defineCollection } from 'astro:content';
194+
```diff lang="js" ins=/, (i18nLoader|i18nSchema)/
195+
// src/content.config.ts
196+
import { docsLoader, i18nLoader } from '@astrojs/starlight/loaders';
197197
import { docsSchema, i18nSchema } from '@astrojs/starlight/schema';
198198

199199
export const collections = {
200-
docs: defineCollection({ schema: docsSchema() }),
201-
+ i18n: defineCollection({ type: 'data', schema: i18nSchema() }),
200+
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
201+
+ i18n: defineCollection({ loader: i18nLoader(), schema: i18nSchema() }),
202202
};
203203
```
204204

@@ -256,14 +256,15 @@ Starlight를 사용하면 번역된 콘텐츠 파일을 호스팅하는 것 외
256256
다음 예시에서는 기본 키에 새로운 선택적 `custom.label` 키가 추가됩니다.
257257

258258
```diff lang="js"
259-
// src/content/config.ts
259+
// src/content.config.ts
260260
import { defineCollection, z } from 'astro:content';
261+
import { docsLoader, i18nLoader } from '@astrojs/starlight/loaders';
261262
import { docsSchema, i18nSchema } from '@astrojs/starlight/schema';
262263

263264
export const collections = {
264-
docs: defineCollection({ schema: docsSchema() }),
265+
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
265266
i18n: defineCollection({
266-
type: 'data',
267+
loader: i18nLoader(),
267268
schema: i18nSchema({
268269
+ extend: z.object({
269270
+ 'custom.label': z.string().optional(),
@@ -273,22 +274,22 @@ export const collections = {
273274
};
274275
```
275276

276-
Astro 공식문서의 ["컬렉션 스키마 정의"](https://docs.astro.build/ko/guides/content-collections/#defining-a-collection-schema)에서 콘텐츠 컬렉션 스키마에 대해 자세히 알아보세요.
277+
Astro 공식문서의 ["컬렉션 스키마 정의"](https://docs.astro.build/ko/guides/content-collections/#컬렉션-스키마-정의)에서 콘텐츠 컬렉션 스키마에 대해 자세히 알아보세요.
277278

278279
## UI 번역 사용
279280

280281
Starlight의 [기본 제공 UI 문자열](/ko/guides/i18n/#starlight-ui-번역)[사용자 정의](/ko/guides/i18n/#번역-스키마-확장)[플러그인 제공](/ko/reference/plugins/#injecttranslations) UI 문자열에 액세스할 수 있는 통합 API는 [i18next](https://www.i18next.com/)로 구동됩니다.
281282
여기에는 [보간](https://www.i18next.com/translation-function/interpolation)[복수화](https://www.i18next.com/translation-function/plurals)와 같은 기능에 대한 지원이 포함됩니다.
282283

283-
Astro 컴포넌트에서 이 API는 [전역 `Astro` 객체](https://docs.astro.build/ko/reference/api-reference/#astrolocals)의 일부인 `Astro.locals.t`로 사용할 수 있습니다:
284+
Astro 컴포넌트에서 이 API는 [전역 `Astro` 객체](https://docs.astro.build/ko/reference/api-reference/#locals)의 일부인 `Astro.locals.t`로 사용할 수 있습니다:
284285

285286
```astro title="example.astro"
286287
<p dir={Astro.locals.t.dir()}>
287288
{Astro.locals.t('404.text')}
288289
</p>
289290
```
290291

291-
[엔드포인트](https://docs.astro.build/ko/guides/endpoints/)에서도 API를 사용할 수 있으며, 여기서 `locals` 객체는 [엔드포인트 컨텍스트](https://docs.astro.build/ko/reference/api-reference/#contextlocals)의 일부로 사용할 수 있습니다:
292+
[엔드포인트](https://docs.astro.build/ko/guides/endpoints/)에서도 API를 사용할 수 있으며, 여기서 `locals` 객체는 [엔드포인트 컨텍스트](https://docs.astro.build/ko/reference/api-reference/#locals)의 일부로 사용할 수 있습니다:
292293

293294
```ts title="src/pages/404.ts"
294295
export const GET = (context) => {
@@ -389,7 +390,7 @@ const arabicDirection = Astro.locals.t.dir('ar');
389390

390391
## 현재 로케일에 액세스
391392

392-
[`Astro.currentLocale`](https://docs.astro.build/ko/reference/api-reference/#astrocurrentlocale)을 사용하여 `.astro` 컴포넌트의 현재 로케일을 읽을 수 있습니다.
393+
[`Astro.currentLocale`](https://docs.astro.build/ko/reference/api-reference/#currentlocale)을 사용하여 `.astro` 컴포넌트의 현재 로케일을 읽을 수 있습니다.
393394

394395
다음 예시는 현재 로케일을 읽고 이를 [`getRelativeLocaleUrl()`](https://docs.astro.build/ko/reference/modules/astro-i18n/#getrelativelocaleurl) 헬퍼와 함께 사용하여 현재 언어로 된 소개 페이지 링크를 생성합니다:
395396

0 commit comments

Comments
 (0)