@intlayer/docs 6.1.6-canary.0 → 6.1.6
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/blog/en/next-i18next_vs_next-intl_vs_intlayer.md +71 -80
- package/dist/cjs/generated/docs.entry.cjs +16 -0
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/esm/generated/docs.entry.mjs +16 -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_angular.md +2 -2
- package/docs/ar/intlayer_with_astro.md +246 -0
- package/docs/ar/intlayer_with_create_react_app.md +3 -2
- package/docs/ar/intlayer_with_express.md +2 -2
- package/docs/ar/intlayer_with_nestjs.md +2 -2
- package/docs/ar/intlayer_with_nextjs_14.md +2 -2
- package/docs/ar/intlayer_with_nextjs_15.md +2 -2
- package/docs/ar/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/ar/intlayer_with_nuxt.md +2 -2
- package/docs/ar/intlayer_with_react_native+expo.md +11 -20
- package/docs/ar/intlayer_with_react_router_v7.md +195 -241
- package/docs/ar/intlayer_with_tanstack.md +198 -272
- package/docs/ar/intlayer_with_vite+preact.md +9 -9
- package/docs/ar/intlayer_with_vite+react.md +7 -7
- package/docs/ar/intlayer_with_vite+vue.md +9 -9
- package/docs/de/intlayer_with_angular.md +2 -2
- package/docs/de/intlayer_with_astro.md +246 -0
- package/docs/de/intlayer_with_create_react_app.md +2 -2
- package/docs/de/intlayer_with_express.md +2 -2
- package/docs/de/intlayer_with_nestjs.md +2 -2
- package/docs/de/intlayer_with_nextjs_14.md +2 -2
- package/docs/de/intlayer_with_nextjs_15.md +2 -2
- package/docs/de/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/de/intlayer_with_nuxt.md +2 -2
- package/docs/de/intlayer_with_react_native+expo.md +11 -20
- package/docs/de/intlayer_with_react_router_v7.md +193 -242
- package/docs/de/intlayer_with_tanstack.md +194 -266
- package/docs/de/intlayer_with_vite+preact.md +9 -9
- package/docs/de/intlayer_with_vite+react.md +9 -9
- package/docs/de/intlayer_with_vite+vue.md +11 -11
- package/docs/de/packages/vite-intlayer/index.md +3 -3
- package/docs/en/how_works_intlayer.md +1 -1
- package/docs/en/index.md +1 -1
- package/docs/en/intlayer_cli.md +1 -1
- package/docs/en/intlayer_with_angular.md +4 -4
- package/docs/en/intlayer_with_astro.md +246 -0
- package/docs/en/intlayer_with_create_react_app.md +4 -4
- package/docs/en/intlayer_with_express.md +3 -3
- package/docs/en/intlayer_with_lynx+react.md +1 -1
- package/docs/en/intlayer_with_nestjs.md +2 -2
- package/docs/en/intlayer_with_nextjs_14.md +13 -4
- package/docs/en/intlayer_with_nextjs_15.md +13 -4
- package/docs/en/intlayer_with_nextjs_page_router.md +5 -5
- package/docs/en/intlayer_with_nuxt.md +4 -4
- package/docs/en/intlayer_with_react_native+expo.md +46 -24
- package/docs/en/intlayer_with_react_router_v7.md +164 -211
- package/docs/en/intlayer_with_tanstack.md +166 -241
- package/docs/en/intlayer_with_vite+preact.md +12 -12
- package/docs/en/intlayer_with_vite+react.md +12 -12
- package/docs/en/intlayer_with_vite+solid.md +2 -2
- package/docs/en/intlayer_with_vite+svelte.md +2 -2
- package/docs/en/intlayer_with_vite+vue.md +12 -12
- package/docs/en/introduction.md +1 -1
- package/docs/en/packages/next-intlayer/useDictionary.md +1 -1
- package/docs/en/packages/next-intlayer/useIntlayer.md +1 -1
- package/docs/en/packages/react-intlayer/useDictionary.md +1 -1
- package/docs/en/packages/react-intlayer/useI18n.md +1 -1
- package/docs/en/packages/react-intlayer/useIntlayer.md +1 -1
- package/docs/en/releases/v6.md +1 -0
- package/docs/en/roadmap.md +1 -1
- package/docs/en-GB/intlayer_with_angular.md +3 -3
- package/docs/en-GB/intlayer_with_astro.md +246 -0
- package/docs/en-GB/intlayer_with_create_react_app.md +5 -4
- package/docs/en-GB/intlayer_with_express.md +2 -2
- package/docs/en-GB/intlayer_with_nestjs.md +2 -2
- package/docs/en-GB/intlayer_with_nextjs_14.md +4 -4
- package/docs/en-GB/intlayer_with_nextjs_15.md +2 -2
- package/docs/en-GB/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/en-GB/intlayer_with_nuxt.md +2 -2
- package/docs/en-GB/intlayer_with_react_native+expo.md +11 -20
- package/docs/en-GB/intlayer_with_react_router_v7.md +171 -220
- package/docs/en-GB/intlayer_with_tanstack.md +174 -248
- package/docs/en-GB/intlayer_with_vite+preact.md +9 -9
- package/docs/en-GB/intlayer_with_vite+react.md +9 -9
- package/docs/en-GB/intlayer_with_vite+vue.md +11 -11
- package/docs/en-GB/packages/next-intlayer/useIntlayer.md +1 -1
- package/docs/en-GB/packages/react-intlayer/useIntlayer.md +1 -1
- package/docs/es/intlayer_with_angular.md +2 -2
- package/docs/es/intlayer_with_astro.md +246 -0
- package/docs/es/intlayer_with_create_react_app.md +3 -2
- package/docs/es/intlayer_with_express.md +2 -2
- package/docs/es/intlayer_with_nextjs_14.md +2 -2
- package/docs/es/intlayer_with_nextjs_15.md +2 -2
- package/docs/es/intlayer_with_react_native+expo.md +11 -20
- package/docs/es/intlayer_with_react_router_v7.md +188 -232
- package/docs/es/intlayer_with_tanstack.md +203 -273
- package/docs/es/intlayer_with_vite+preact.md +7 -7
- package/docs/es/intlayer_with_vite+react.md +7 -7
- package/docs/es/intlayer_with_vite+vue.md +9 -9
- package/docs/fr/intlayer_with_angular.md +2 -2
- package/docs/fr/intlayer_with_astro.md +246 -0
- package/docs/fr/intlayer_with_create_react_app.md +3 -2
- package/docs/fr/intlayer_with_express.md +2 -2
- package/docs/fr/intlayer_with_nestjs.md +2 -2
- package/docs/fr/intlayer_with_nextjs_14.md +2 -2
- package/docs/fr/intlayer_with_react_native+expo.md +11 -20
- package/docs/fr/intlayer_with_react_router_v7.md +188 -248
- package/docs/fr/intlayer_with_tanstack.md +192 -265
- package/docs/fr/intlayer_with_vite+preact.md +7 -7
- package/docs/fr/intlayer_with_vite+react.md +7 -7
- package/docs/fr/intlayer_with_vite+vue.md +9 -9
- package/docs/hi/intlayer_cli.md +1 -4
- package/docs/hi/intlayer_with_angular.md +2 -2
- package/docs/hi/intlayer_with_astro.md +246 -0
- package/docs/hi/intlayer_with_create_react_app.md +2 -2
- package/docs/hi/intlayer_with_express.md +2 -2
- package/docs/hi/intlayer_with_nestjs.md +2 -2
- package/docs/hi/intlayer_with_nextjs_14.md +2 -2
- package/docs/hi/intlayer_with_nextjs_15.md +2 -2
- package/docs/hi/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/hi/intlayer_with_nuxt.md +2 -2
- package/docs/hi/intlayer_with_react_native+expo.md +11 -20
- package/docs/hi/intlayer_with_react_router_v7.md +199 -243
- package/docs/hi/intlayer_with_tanstack.md +210 -285
- package/docs/hi/intlayer_with_vite+preact.md +9 -9
- package/docs/hi/intlayer_with_vite+react.md +9 -9
- package/docs/hi/intlayer_with_vite+solid.md +1 -1
- package/docs/hi/intlayer_with_vite+vue.md +11 -11
- package/docs/it/intlayer_with_angular.md +2 -2
- package/docs/it/intlayer_with_astro.md +246 -0
- package/docs/it/intlayer_with_create_react_app.md +3 -2
- package/docs/it/intlayer_with_express.md +2 -2
- package/docs/it/intlayer_with_nestjs.md +2 -2
- package/docs/it/intlayer_with_nextjs_14.md +2 -2
- package/docs/it/intlayer_with_nextjs_15.md +2 -2
- package/docs/it/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/it/intlayer_with_nuxt.md +2 -2
- package/docs/it/intlayer_with_react_native+expo.md +11 -21
- package/docs/it/intlayer_with_react_router_v7.md +195 -242
- package/docs/it/intlayer_with_tanstack.md +203 -267
- package/docs/it/intlayer_with_vite+preact.md +9 -9
- package/docs/it/intlayer_with_vite+react.md +13 -11
- package/docs/it/intlayer_with_vite+vue.md +11 -11
- package/docs/ja/intlayer_with_angular.md +2 -2
- package/docs/ja/intlayer_with_astro.md +246 -0
- package/docs/ja/intlayer_with_create_react_app.md +3 -2
- package/docs/ja/intlayer_with_express.md +2 -2
- package/docs/ja/intlayer_with_nestjs.md +2 -2
- package/docs/ja/intlayer_with_nextjs_14.md +2 -2
- package/docs/ja/intlayer_with_nextjs_15.md +2 -2
- package/docs/ja/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/ja/intlayer_with_nuxt.md +2 -2
- package/docs/ja/intlayer_with_react_native+expo.md +18 -29
- package/docs/ja/intlayer_with_react_router_v7.md +204 -250
- package/docs/ja/intlayer_with_tanstack.md +218 -286
- package/docs/ja/intlayer_with_vite+preact.md +9 -9
- package/docs/ja/intlayer_with_vite+react.md +11 -11
- package/docs/ja/intlayer_with_vite+vue.md +11 -11
- package/docs/ko/intlayer_with_angular.md +2 -2
- package/docs/ko/intlayer_with_astro.md +246 -0
- package/docs/ko/intlayer_with_create_react_app.md +3 -2
- package/docs/ko/intlayer_with_express.md +2 -2
- package/docs/ko/intlayer_with_nestjs.md +2 -2
- package/docs/ko/intlayer_with_nextjs_14.md +2 -2
- package/docs/ko/intlayer_with_nextjs_15.md +2 -2
- package/docs/ko/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/ko/intlayer_with_nuxt.md +2 -2
- package/docs/ko/intlayer_with_react_native+expo.md +19 -28
- package/docs/ko/intlayer_with_react_router_v7.md +190 -244
- package/docs/ko/intlayer_with_tanstack.md +200 -270
- package/docs/ko/intlayer_with_vite+preact.md +9 -9
- package/docs/ko/intlayer_with_vite+react.md +9 -9
- package/docs/ko/intlayer_with_vite+vue.md +11 -11
- package/docs/pt/intlayer_with_angular.md +2 -2
- package/docs/pt/intlayer_with_astro.md +246 -0
- package/docs/pt/intlayer_with_create_react_app.md +3 -2
- package/docs/pt/intlayer_with_express.md +2 -2
- package/docs/pt/intlayer_with_nestjs.md +2 -2
- package/docs/pt/intlayer_with_nextjs_14.md +2 -2
- package/docs/pt/intlayer_with_nextjs_15.md +2 -2
- package/docs/pt/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/pt/intlayer_with_nuxt.md +2 -2
- package/docs/pt/intlayer_with_react_native+expo.md +11 -20
- package/docs/pt/intlayer_with_react_router_v7.md +7 -13
- package/docs/pt/intlayer_with_tanstack.md +183 -258
- package/docs/pt/intlayer_with_vite+preact.md +9 -9
- package/docs/pt/intlayer_with_vite+react.md +9 -9
- package/docs/pt/intlayer_with_vite+vue.md +9 -9
- package/docs/ru/intlayer_with_angular.md +2 -2
- package/docs/ru/intlayer_with_astro.md +246 -0
- package/docs/ru/intlayer_with_create_react_app.md +3 -2
- package/docs/ru/intlayer_with_express.md +2 -2
- package/docs/ru/intlayer_with_nestjs.md +2 -2
- package/docs/ru/intlayer_with_nextjs_14.md +2 -2
- package/docs/ru/intlayer_with_nextjs_15.md +2 -2
- package/docs/ru/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/ru/intlayer_with_nuxt.md +2 -2
- package/docs/ru/intlayer_with_react_native+expo.md +11 -20
- package/docs/ru/intlayer_with_react_router_v7.md +192 -238
- package/docs/ru/intlayer_with_tanstack.md +197 -269
- package/docs/ru/intlayer_with_vite+preact.md +9 -9
- package/docs/ru/intlayer_with_vite+react.md +9 -9
- package/docs/ru/intlayer_with_vite+vue.md +11 -11
- package/docs/tr/how_works_intlayer.md +1 -1
- package/docs/tr/index.md +1 -1
- package/docs/tr/intlayer_cli.md +1 -1
- package/docs/tr/intlayer_with_angular.md +4 -4
- package/docs/tr/intlayer_with_astro.md +246 -0
- package/docs/tr/intlayer_with_create_react_app.md +4 -4
- package/docs/tr/intlayer_with_express.md +3 -3
- package/docs/tr/intlayer_with_lynx+react.md +1 -1
- package/docs/tr/intlayer_with_nestjs.md +2 -2
- package/docs/tr/intlayer_with_nextjs_14.md +2 -2
- package/docs/tr/intlayer_with_nextjs_15.md +4 -4
- package/docs/tr/intlayer_with_nextjs_page_router.md +5 -5
- package/docs/tr/intlayer_with_nuxt.md +4 -4
- package/docs/tr/intlayer_with_react_native+expo.md +12 -21
- package/docs/tr/intlayer_with_react_router_v7.md +222 -267
- package/docs/tr/intlayer_with_tanstack.md +400 -303
- package/docs/tr/intlayer_with_vite+preact.md +12 -12
- package/docs/tr/intlayer_with_vite+react.md +12 -12
- package/docs/tr/intlayer_with_vite+solid.md +2 -2
- package/docs/tr/intlayer_with_vite+svelte.md +2 -2
- package/docs/tr/intlayer_with_vite+vue.md +12 -12
- package/docs/tr/introduction.md +1 -1
- package/docs/tr/packages/react-intlayer/useDictionary.md +1 -1
- package/docs/tr/packages/react-intlayer/useI18n.md +1 -1
- package/docs/tr/roadmap.md +1 -1
- package/docs/zh/intlayer_with_angular.md +2 -2
- package/docs/zh/intlayer_with_astro.md +246 -0
- package/docs/zh/intlayer_with_create_react_app.md +3 -2
- package/docs/zh/intlayer_with_express.md +2 -2
- package/docs/zh/intlayer_with_nestjs.md +2 -2
- package/docs/zh/intlayer_with_nextjs_14.md +2 -2
- package/docs/zh/intlayer_with_nextjs_15.md +2 -2
- package/docs/zh/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/zh/intlayer_with_nuxt.md +2 -2
- package/docs/zh/intlayer_with_react_native+expo.md +19 -28
- package/docs/zh/intlayer_with_react_router_v7.md +200 -248
- package/docs/zh/intlayer_with_tanstack.md +208 -283
- package/docs/zh/intlayer_with_vite+preact.md +9 -9
- package/docs/zh/intlayer_with_vite+react.md +9 -9
- package/docs/zh/intlayer_with_vite+vue.md +9 -9
- package/package.json +11 -11
- package/src/generated/docs.entry.ts +16 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-09-04
|
|
3
|
-
updatedAt: 2025-
|
|
3
|
+
updatedAt: 2025-10-03
|
|
4
4
|
title: React Router v7에서 Intlayer로 시작하는 국제화(i18n)
|
|
5
|
-
description: Intlayer를 사용하여 React Router v7 애플리케이션에 국제화(i18n)를 추가하는 방법을 배우세요. 로케일 인식 라우팅으로 앱을
|
|
5
|
+
description: Intlayer를 사용하여 React Router v7 애플리케이션에 국제화(i18n)를 추가하는 방법을 배우세요. 로케일 인식 라우팅으로 앱을 다국어로 만드는 종합 가이드를 따르세요.
|
|
6
6
|
keywords:
|
|
7
7
|
- 국제화
|
|
8
8
|
- 문서
|
|
@@ -17,13 +17,12 @@ slugs:
|
|
|
17
17
|
- environment
|
|
18
18
|
- vite-and-react
|
|
19
19
|
- react-router-v7
|
|
20
|
-
applicationTemplate: https://github.com/
|
|
21
|
-
author: AydinTheFirst
|
|
20
|
+
applicationTemplate: https://github.com/aymericzip/intlayer-react-router-v7-template
|
|
22
21
|
---
|
|
23
22
|
|
|
24
23
|
# Intlayer와 React Router v7로 시작하는 국제화(i18n)
|
|
25
24
|
|
|
26
|
-
이 가이드는 React Router v7 프로젝트에서 로케일 인식 라우팅, TypeScript 지원 및 최신 개발 방식을 활용하여 **Intlayer**를 원활한 국제화(i18n)
|
|
25
|
+
이 가이드는 React Router v7 프로젝트에서 로케일 인식 라우팅, TypeScript 지원 및 최신 개발 방식을 활용하여 **Intlayer**를 통합해 원활한 국제화(i18n)를 구현하는 방법을 보여줍니다.
|
|
27
26
|
|
|
28
27
|
## Intlayer란 무엇인가요?
|
|
29
28
|
|
|
@@ -34,7 +33,7 @@ Intlayer를 사용하면 다음을 할 수 있습니다:
|
|
|
34
33
|
- **컴포넌트 수준에서 선언적 사전을 사용하여 번역을 쉽게 관리**할 수 있습니다.
|
|
35
34
|
- **메타데이터, 라우트 및 콘텐츠를 동적으로 현지화**할 수 있습니다.
|
|
36
35
|
- **자동 생성된 타입으로 TypeScript 지원을 보장**하여 자동 완성 및 오류 감지를 향상시킵니다.
|
|
37
|
-
- **동적 로케일 감지 및 전환과 같은 고급
|
|
36
|
+
- **동적 로케일 감지 및 전환과 같은 고급 기능을 활용**할 수 있습니다.
|
|
38
37
|
- **React Router v7의 구성 기반 라우팅 시스템을 사용하여 로케일 인식 라우팅 활성화**.
|
|
39
38
|
|
|
40
39
|
---
|
|
@@ -61,7 +60,7 @@ pnpm add vite-intlayer --save-dev
|
|
|
61
60
|
구성 관리, 번역, [콘텐츠 선언](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/dictionary/get_started.md), 트랜스파일링 및 [CLI 명령어](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/intlayer_cli.md)를 위한 국제화 도구를 제공하는 핵심 패키지입니다.
|
|
62
61
|
|
|
63
62
|
- **react-intlayer**
|
|
64
|
-
Intlayer를 React 애플리케이션과 통합하는
|
|
63
|
+
Intlayer를 React 애플리케이션과 통합하는 패키지로, React 국제화를 위한 컨텍스트 제공자와 훅을 제공합니다.
|
|
65
64
|
|
|
66
65
|
- **vite-intlayer**
|
|
67
66
|
Intlayer를 [Vite 번들러](https://vite.dev/guide/why.html#why-bundle-for-production)와 통합하기 위한 Vite 플러그인과, 사용자의 선호 로케일 감지, 쿠키 관리, URL 리디렉션 처리를 위한 미들웨어를 포함합니다.
|
|
@@ -75,11 +74,8 @@ import { type IntlayerConfig, Locales } from "intlayer";
|
|
|
75
74
|
|
|
76
75
|
const config: IntlayerConfig = {
|
|
77
76
|
internationalization: {
|
|
78
|
-
defaultLocale: Locales.ENGLISH,
|
|
79
|
-
locales: [Locales.ENGLISH, Locales.
|
|
80
|
-
},
|
|
81
|
-
middleware: {
|
|
82
|
-
prefixDefault: true, // URL에 항상 기본 로케일 접두사 추가
|
|
77
|
+
defaultLocale: Locales.ENGLISH, // 기본 로케일 설정
|
|
78
|
+
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH], // 지원하는 로케일 목록
|
|
83
79
|
},
|
|
84
80
|
};
|
|
85
81
|
|
|
@@ -92,11 +88,8 @@ import { Locales } from "intlayer";
|
|
|
92
88
|
/** @type {import('intlayer').IntlayerConfig} */
|
|
93
89
|
const config = {
|
|
94
90
|
internationalization: {
|
|
95
|
-
defaultLocale: Locales.ENGLISH,
|
|
96
|
-
locales: [Locales.ENGLISH, Locales.
|
|
97
|
-
},
|
|
98
|
-
middleware: {
|
|
99
|
-
prefixDefault: true,
|
|
91
|
+
defaultLocale: Locales.ENGLISH, // 기본 로케일 설정
|
|
92
|
+
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH], // 지원하는 로케일 목록
|
|
100
93
|
},
|
|
101
94
|
};
|
|
102
95
|
|
|
@@ -110,10 +103,7 @@ const { Locales } = require("intlayer");
|
|
|
110
103
|
const config = {
|
|
111
104
|
internationalization: {
|
|
112
105
|
defaultLocale: Locales.ENGLISH,
|
|
113
|
-
locales: [Locales.ENGLISH, Locales.
|
|
114
|
-
},
|
|
115
|
-
middleware: {
|
|
116
|
-
prefixDefault: true,
|
|
106
|
+
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
117
107
|
},
|
|
118
108
|
};
|
|
119
109
|
|
|
@@ -122,43 +112,37 @@ module.exports = config;
|
|
|
122
112
|
|
|
123
113
|
> 이 구성 파일을 통해 지역화된 URL, 미들웨어 리디렉션, 쿠키 이름, 콘텐츠 선언의 위치 및 확장자 설정, 콘솔에서 Intlayer 로그 비활성화 등 다양한 설정을 할 수 있습니다. 사용 가능한 모든 매개변수 목록은 [구성 문서](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/configuration.md)를 참조하세요.
|
|
124
114
|
|
|
125
|
-
### 3단계:
|
|
126
|
-
|
|
127
|
-
로케일 인식 라우트로 라우팅 구성을 설정하세요:
|
|
128
|
-
|
|
129
|
-
```typescript fileName="app/routes.ts" codeFormat="typescript"
|
|
130
|
-
import { layout, route, type RouteConfig } from "@react-router/dev/routes";
|
|
131
|
-
|
|
132
|
-
export default [
|
|
133
|
-
layout("routes/layout.tsx", [
|
|
134
|
-
route("/", "routes/page.tsx"), // 루트 페이지 - 로케일로 리디렉션
|
|
135
|
-
route("/:lang", "routes/[lang]/page.tsx"), // 로케일별 홈 페이지
|
|
136
|
-
route("/:lang/about", "routes/[lang]/about/page.tsx"), // 로케일별 소개 페이지
|
|
137
|
-
]),
|
|
138
|
-
] satisfies RouteConfig;
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
### 4단계: Vite 구성에 Intlayer 통합
|
|
115
|
+
### 3단계: Vite 구성에 Intlayer 통합하기
|
|
142
116
|
|
|
143
|
-
intlayer 플러그인을
|
|
117
|
+
구성에 intlayer 플러그인을 추가하세요:
|
|
144
118
|
|
|
145
|
-
```typescript fileName="vite.config.ts"
|
|
119
|
+
```typescript fileName="vite.config.ts"
|
|
146
120
|
import { reactRouter } from "@react-router/dev/vite";
|
|
147
121
|
import { defineConfig } from "vite";
|
|
148
|
-
import {
|
|
122
|
+
import { intlayer } from "vite-intlayer";
|
|
149
123
|
import tsconfigPaths from "vite-tsconfig-paths";
|
|
150
124
|
|
|
151
125
|
export default defineConfig({
|
|
152
|
-
plugins: [
|
|
153
|
-
reactRouter(),
|
|
154
|
-
tsconfigPaths(),
|
|
155
|
-
intlayer(),
|
|
156
|
-
intlayerMiddlewarePlugin(),
|
|
157
|
-
],
|
|
126
|
+
plugins: [reactRouter(), tsconfigPaths(), intlayer()],
|
|
158
127
|
});
|
|
159
128
|
```
|
|
160
129
|
|
|
161
|
-
> `intlayer()` Vite 플러그인은 Intlayer를 Vite와 통합하는 데 사용됩니다. 이 플러그인은 콘텐츠 선언
|
|
130
|
+
> `intlayer()` Vite 플러그인은 Intlayer를 Vite와 통합하는 데 사용됩니다. 이 플러그인은 콘텐츠 선언 파일의 빌드를 보장하고 개발 모드에서 이를 모니터링합니다. 또한 Vite 애플리케이션 내에서 Intlayer 환경 변수를 정의하며, 성능 최적화를 위한 별칭(alias)도 제공합니다.
|
|
131
|
+
|
|
132
|
+
### Step 4: React Router v7 라우트 구성
|
|
133
|
+
|
|
134
|
+
로케일 인식 라우트로 라우팅 구성을 설정하세요:
|
|
135
|
+
|
|
136
|
+
```typescript fileName="app/routes.ts"
|
|
137
|
+
import { layout, route, type RouteConfig } from "@react-router/dev/routes";
|
|
138
|
+
|
|
139
|
+
export default [
|
|
140
|
+
layout("routes/layout.tsx", [
|
|
141
|
+
route("/:lang?", "routes/page.tsx"), // 지역화된 홈 페이지
|
|
142
|
+
route("/:lang?/about", "routes/about/page.tsx"), // 지역화된 소개 페이지
|
|
143
|
+
]),
|
|
144
|
+
] satisfies RouteConfig;
|
|
145
|
+
```
|
|
162
146
|
|
|
163
147
|
### 5단계: 레이아웃 컴포넌트 생성
|
|
164
148
|
|
|
@@ -166,15 +150,17 @@ export default defineConfig({
|
|
|
166
150
|
|
|
167
151
|
#### 루트 레이아웃
|
|
168
152
|
|
|
169
|
-
```tsx fileName="app/routes/layout.tsx"
|
|
170
|
-
tsx fileName="app/routes/layout.tsx" codeFormat="typescript"
|
|
171
|
-
// app/routes/layout.tsx
|
|
172
|
-
import { Outlet } from "react-router";
|
|
153
|
+
```tsx fileName="app/routes/layout.tsx"
|
|
173
154
|
import { IntlayerProvider } from "react-intlayer";
|
|
155
|
+
import { Outlet } from "react-router";
|
|
156
|
+
|
|
157
|
+
import type { Route } from "./+types/layout";
|
|
158
|
+
|
|
159
|
+
export default function RootLayout({ params }: Route.ComponentProps) {
|
|
160
|
+
const { locale } = params;
|
|
174
161
|
|
|
175
|
-
export default function RootLayout() {
|
|
176
162
|
return (
|
|
177
|
-
<IntlayerProvider>
|
|
163
|
+
<IntlayerProvider locale={locale}>
|
|
178
164
|
<Outlet />
|
|
179
165
|
</IntlayerProvider>
|
|
180
166
|
);
|
|
@@ -185,7 +171,7 @@ export default function RootLayout() {
|
|
|
185
171
|
|
|
186
172
|
번역을 저장하기 위해 콘텐츠 선언을 생성하고 관리하세요:
|
|
187
173
|
|
|
188
|
-
```tsx fileName="app/routes/[lang]/page.content.ts"
|
|
174
|
+
```tsx fileName="app/routes/[lang]/page.content.ts"
|
|
189
175
|
import { t, type Dictionary } from "intlayer";
|
|
190
176
|
|
|
191
177
|
const pageContent = {
|
|
@@ -193,19 +179,23 @@ const pageContent = {
|
|
|
193
179
|
content: {
|
|
194
180
|
title: t({
|
|
195
181
|
en: "Welcome to React Router v7 + Intlayer",
|
|
196
|
-
|
|
182
|
+
es: "Bienvenido a React Router v7 + Intlayer",
|
|
183
|
+
fr: "Bienvenue sur React Router v7 + Intlayer",
|
|
197
184
|
}),
|
|
198
185
|
description: t({
|
|
199
186
|
en: "Build multilingual applications with ease using React Router v7 and Intlayer.",
|
|
200
|
-
|
|
187
|
+
es: "Cree aplicaciones multilingües fácilmente usando React Router v7 y Intlayer.",
|
|
188
|
+
fr: "Créez des applications multilingues facilement avec React Router v7 et Intlayer.",
|
|
201
189
|
}),
|
|
202
190
|
aboutLink: t({
|
|
203
191
|
en: "Learn About Us",
|
|
204
|
-
|
|
192
|
+
es: "Aprender Sobre Nosotros",
|
|
193
|
+
fr: "En savoir plus sur nous",
|
|
205
194
|
}),
|
|
206
195
|
homeLink: t({
|
|
207
196
|
en: "Home",
|
|
208
|
-
|
|
197
|
+
es: "Inicio",
|
|
198
|
+
fr: "Accueil",
|
|
209
199
|
}),
|
|
210
200
|
},
|
|
211
201
|
} satisfies Dictionary;
|
|
@@ -213,104 +203,91 @@ const pageContent = {
|
|
|
213
203
|
export default pageContent;
|
|
214
204
|
```
|
|
215
205
|
|
|
216
|
-
> 콘텐츠 선언은 애플리케이션 내
|
|
206
|
+
> 콘텐츠 선언은 애플리케이션 내 어디서든 정의할 수 있으며, `contentDir` 디렉토리(기본값: `./app`)에 포함되면 자동으로 인식됩니다. 또한 콘텐츠 선언 파일 확장자(기본값: `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`)와 일치해야 합니다.
|
|
217
207
|
|
|
218
208
|
> 자세한 내용은 [콘텐츠 선언 문서](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/dictionary/get_started.md)를 참조하세요.
|
|
219
209
|
|
|
220
210
|
### 7단계: 로케일 인식 컴포넌트 생성
|
|
221
211
|
|
|
222
|
-
로케일 인식 내비게이션을 위한 `LocalizedLink` 컴포넌트를
|
|
223
|
-
|
|
224
|
-
```tsx fileName="app/components/localized-link.tsx" codeFormat="typescript"
|
|
225
|
-
// app/components/localized-link.tsx
|
|
226
|
-
import { getLocalizedUrl } from "intlayer";
|
|
227
|
-
import { useLocale } from "react-intlayer";
|
|
228
|
-
import React from "react";
|
|
229
|
-
import { Link, useLocation } from "react-router";
|
|
212
|
+
로케일 인식 내비게이션을 위한 `LocalizedLink` 컴포넌트를 생성합니다:
|
|
230
213
|
|
|
231
|
-
|
|
214
|
+
```tsx fileName="app/components/localized-link.tsx"
|
|
215
|
+
import type { FC } from "react";
|
|
232
216
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
217
|
+
import { getLocalizedUrl, type LocalesValues } from "intlayer";
|
|
218
|
+
import { useLocale } from "react-intlayer";
|
|
219
|
+
import { Link, type LinkProps, type To } from "react-router";
|
|
236
220
|
|
|
237
|
-
|
|
238
|
-
/^([a-z][a-z0-9+.-]*:)?\/\//i.test(path) || path.startsWith("mailto:");
|
|
221
|
+
const isExternalLink = (to: string) => /^(https?:)?\/\//.test(to);
|
|
239
222
|
|
|
223
|
+
// 외부 링크인지 확인하는 함수
|
|
224
|
+
export const locacalizeTo = (to: To, locale: LocalesValues): To => {
|
|
240
225
|
if (typeof to === "string") {
|
|
241
|
-
if (
|
|
242
|
-
return
|
|
226
|
+
if (isExternalLink(to)) {
|
|
227
|
+
return to; // 외부 링크면 그대로 반환
|
|
243
228
|
}
|
|
244
|
-
|
|
229
|
+
|
|
230
|
+
return getLocalizedUrl(to, locale); // 내부 링크면 로케일에 맞게 변환
|
|
245
231
|
}
|
|
246
232
|
|
|
247
|
-
if (to
|
|
248
|
-
|
|
249
|
-
if (pathname && pathname.startsWith("/") && !isExternal(pathname)) {
|
|
250
|
-
return (
|
|
251
|
-
<Link
|
|
252
|
-
to={{ ...to, pathname: getLocalizedUrl(pathname, locale) }}
|
|
253
|
-
{...props}
|
|
254
|
-
/>
|
|
255
|
-
);
|
|
256
|
-
}
|
|
257
|
-
return <Link to={to} {...props} />;
|
|
233
|
+
if (isExternalLink(to.pathname ?? "")) {
|
|
234
|
+
return to; // 외부 링크면 그대로 반환
|
|
258
235
|
}
|
|
259
236
|
|
|
260
|
-
return
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
237
|
+
return {
|
|
238
|
+
...to,
|
|
239
|
+
pathname: getLocalizedUrl(to.pathname ?? "", locale), // 내부 경로를 로케일에 맞게 변환
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
export const LocalizedLink: FC<LinkProps> = (props) => {
|
|
244
|
+
const { locale } = useLocale();
|
|
268
245
|
|
|
269
|
-
|
|
246
|
+
return <Link {...props} to={locacalizeTo(props.to, locale)} />;
|
|
247
|
+
};
|
|
248
|
+
```
|
|
270
249
|
|
|
271
|
-
|
|
250
|
+
로컬라이즈된 경로로 이동하려는 경우, `useLocalizedNavigate` 훅을 사용할 수 있습니다:
|
|
272
251
|
|
|
273
|
-
|
|
252
|
+
```tsx fileName="app/hooks/useLocalizedNavigate.ts"
|
|
253
|
+
import { useLocale } from "intlayer";
|
|
254
|
+
import { type NavigateOptions, type To, useNavigate } from "react-router";
|
|
274
255
|
|
|
275
|
-
|
|
276
|
-
// app/routes/page.tsx
|
|
277
|
-
import { useLocale } from "react-intlayer";
|
|
278
|
-
import { Navigate } from "react-router";
|
|
256
|
+
import { locacalizeTo } from "~/components/localized-link";
|
|
279
257
|
|
|
280
|
-
export
|
|
258
|
+
export const useLocalizedNavigate = () => {
|
|
259
|
+
const navigate = useNavigate();
|
|
281
260
|
const { locale } = useLocale();
|
|
282
261
|
|
|
283
|
-
|
|
284
|
-
|
|
262
|
+
const localizedNavigate = (to: To, options?: NavigateOptions) => {
|
|
263
|
+
const localedTo = locacalizeTo(to, locale);
|
|
264
|
+
|
|
265
|
+
navigate(localedTo, options);
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
return localizedNavigate;
|
|
269
|
+
};
|
|
285
270
|
```
|
|
286
271
|
|
|
287
|
-
|
|
272
|
+
### 8단계: 페이지에서 Intlayer 활용하기
|
|
273
|
+
|
|
274
|
+
애플리케이션 전반에서 콘텐츠 사전을 액세스하세요:
|
|
288
275
|
|
|
289
|
-
|
|
276
|
+
#### 현지화된 홈 페이지
|
|
277
|
+
|
|
278
|
+
```tsx fileName="app/routes/[lang]/page.tsx"
|
|
290
279
|
import { useIntlayer } from "react-intlayer";
|
|
291
|
-
import LocalizedLink from "~/components/localized-link";
|
|
280
|
+
import { LocalizedLink } from "~/components/localized-link";
|
|
292
281
|
|
|
293
282
|
export default function Page() {
|
|
294
|
-
const
|
|
283
|
+
const { title, description, aboutLink } = useIntlayer("page");
|
|
295
284
|
|
|
296
285
|
return (
|
|
297
|
-
<div
|
|
298
|
-
<h1>{
|
|
299
|
-
<p>{
|
|
300
|
-
<nav
|
|
301
|
-
<LocalizedLink
|
|
302
|
-
to="/about"
|
|
303
|
-
style={{
|
|
304
|
-
display: "inline-block",
|
|
305
|
-
padding: "0.5rem 1rem",
|
|
306
|
-
backgroundColor: "#007bff",
|
|
307
|
-
color: "white",
|
|
308
|
-
textDecoration: "none",
|
|
309
|
-
borderRadius: "4px",
|
|
310
|
-
}}
|
|
311
|
-
>
|
|
312
|
-
{content.aboutLink}
|
|
313
|
-
</LocalizedLink>
|
|
286
|
+
<div>
|
|
287
|
+
<h1>{title}</h1>
|
|
288
|
+
<p>{description}</p>
|
|
289
|
+
<nav>
|
|
290
|
+
<LocalizedLink to="/about">{aboutLink}</LocalizedLink>
|
|
314
291
|
</nav>
|
|
315
292
|
</div>
|
|
316
293
|
);
|
|
@@ -319,47 +296,62 @@ export default function Page() {
|
|
|
319
296
|
|
|
320
297
|
> `useIntlayer` 훅에 대해 더 알아보려면 [문서](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/packages/react-intlayer/useIntlayer.md)를 참조하세요.
|
|
321
298
|
|
|
322
|
-
### 9단계: 로케일
|
|
299
|
+
### 9단계: 로케일 스위처 컴포넌트 만들기
|
|
323
300
|
|
|
324
|
-
사용자가 언어를 변경할 수 있도록 컴포넌트를
|
|
301
|
+
사용자가 언어를 변경할 수 있도록 컴포넌트를 만드세요:
|
|
325
302
|
|
|
326
|
-
```tsx fileName="app/components/locale-switcher.tsx"
|
|
327
|
-
import {
|
|
328
|
-
import { useLocale } from "react-intlayer";
|
|
329
|
-
import { useLocation, useNavigate } from "react-router";
|
|
303
|
+
```tsx fileName="app/components/locale-switcher.tsx"
|
|
304
|
+
import type { FC } from "react";
|
|
330
305
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
306
|
+
import {
|
|
307
|
+
getHTMLTextDir,
|
|
308
|
+
getLocaleName,
|
|
309
|
+
getLocalizedUrl,
|
|
310
|
+
getPathWithoutLocale,
|
|
311
|
+
} from "intlayer";
|
|
312
|
+
import { setLocaleCookie, useIntlayer, useLocale } from "react-intlayer";
|
|
313
|
+
import { Link, useLocation } from "react-router";
|
|
335
314
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
};
|
|
315
|
+
export const LocaleSwitcher: FC = () => {
|
|
316
|
+
const { localeSwitcherLabel } = useIntlayer("locale-switcher");
|
|
317
|
+
const { pathname } = useLocation();
|
|
318
|
+
|
|
319
|
+
const { availableLocales, locale } = useLocale();
|
|
320
|
+
|
|
321
|
+
const pathWithoutLocale = getPathWithoutLocale(pathname);
|
|
344
322
|
|
|
345
323
|
return (
|
|
346
|
-
<
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
324
|
+
<ol>
|
|
325
|
+
{availableLocales.map((localeItem) => (
|
|
326
|
+
<li key={localeItem}>
|
|
327
|
+
<Link
|
|
328
|
+
aria-current={localeItem === locale ? "page" : undefined}
|
|
329
|
+
aria-label={`${localeSwitcherLabel.value} ${getLocaleName(localeItem)}`}
|
|
330
|
+
onClick={() => setLocaleCookie(localeItem)}
|
|
331
|
+
to={getLocalizedUrl(pathWithoutLocale, localeItem)}
|
|
332
|
+
>
|
|
333
|
+
<span>
|
|
334
|
+
{/* 로케일 - 예: FR */}
|
|
335
|
+
{localeItem}
|
|
336
|
+
</span>
|
|
337
|
+
<span>
|
|
338
|
+
{/* 해당 로케일의 언어 - 예: Français */}
|
|
339
|
+
{getLocaleName(localeItem, locale)}
|
|
340
|
+
</span>
|
|
341
|
+
<span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
|
|
342
|
+
{/* 현재 로케일에서의 언어 - 예: 현재 로케일이 Locales.SPANISH일 때 Francés */}
|
|
343
|
+
{getLocaleName(localeItem)}
|
|
344
|
+
</span>
|
|
345
|
+
<span dir="ltr" lang={Locales.ENGLISH}>
|
|
346
|
+
{/* 영어로 된 언어 이름 - 예: French */}
|
|
347
|
+
{getLocaleName(localeItem, Locales.ENGLISH)}
|
|
348
|
+
</span>
|
|
349
|
+
</Link>
|
|
350
|
+
</li>
|
|
351
|
+
))}
|
|
352
|
+
</ol>
|
|
361
353
|
);
|
|
362
|
-
}
|
|
354
|
+
};
|
|
363
355
|
```
|
|
364
356
|
|
|
365
357
|
> `useLocale` 훅에 대해 더 알아보려면 [문서](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/packages/react-intlayer/useLocale.md)를 참조하세요.
|
|
@@ -368,8 +360,7 @@ export default function LocaleSwitcher() {
|
|
|
368
360
|
|
|
369
361
|
HTML의 lang 및 dir 속성을 관리하는 훅을 만듭니다:
|
|
370
362
|
|
|
371
|
-
```tsx fileName="app/hooks/useI18nHTMLAttributes.tsx"
|
|
372
|
-
// app/hooks/useI18nHTMLAttributes.tsx
|
|
363
|
+
```tsx fileName="app/hooks/useI18nHTMLAttributes.tsx"
|
|
373
364
|
import { getHTMLTextDir } from "intlayer";
|
|
374
365
|
import { useEffect } from "react";
|
|
375
366
|
import { useLocale } from "react-intlayer";
|
|
@@ -386,12 +377,11 @@ export const useI18nHTMLAttributes = () => {
|
|
|
386
377
|
|
|
387
378
|
그런 다음 루트 컴포넌트에서 사용하세요:
|
|
388
379
|
|
|
389
|
-
```tsx fileName="app/
|
|
390
|
-
// app/routes/layout.tsx
|
|
380
|
+
```tsx fileName="app/routes/layout.tsx"
|
|
391
381
|
import { Outlet } from "react-router";
|
|
392
382
|
import { IntlayerProvider } from "react-intlayer";
|
|
393
383
|
|
|
394
|
-
import { useI18nHTMLAttributes } from "app/hooks/useI18nHTMLAttributes"; // 훅을
|
|
384
|
+
import { useI18nHTMLAttributes } from "app/hooks/useI18nHTMLAttributes"; // 훅을 가져옵니다
|
|
395
385
|
|
|
396
386
|
export default function RootLayout() {
|
|
397
387
|
useI18nHTMLAttributes(); // 훅을 호출합니다
|
|
@@ -404,35 +394,26 @@ export default function RootLayout() {
|
|
|
404
394
|
}
|
|
405
395
|
```
|
|
406
396
|
|
|
407
|
-
### 11단계:
|
|
408
|
-
|
|
409
|
-
콘텐츠 사전을 빌드하고 애플리케이션을 실행하세요:
|
|
397
|
+
### 11단계: 미들웨어 추가 (선택 사항)
|
|
410
398
|
|
|
411
|
-
|
|
412
|
-
# Intlayer 사전 빌드
|
|
413
|
-
npm run intlayer:build
|
|
399
|
+
`intlayerMiddleware`를 사용하여 애플리케이션에 서버 사이드 라우팅을 추가할 수도 있습니다. 이 플러그인은 URL을 기반으로 현재 로케일을 자동으로 감지하고 적절한 로케일 쿠키를 설정합니다. 로케일이 지정되지 않은 경우, 플러그인은 사용자의 브라우저 언어 설정을 기반으로 가장 적합한 로케일을 결정합니다. 로케일이 감지되지 않으면 기본 로케일로 리디렉션합니다.
|
|
414
400
|
|
|
415
|
-
|
|
416
|
-
npm run dev
|
|
417
|
-
```
|
|
401
|
+
> `intlayerMiddleware`를 프로덕션 환경에서 사용하려면 `vite-intlayer` 패키지를 `devDependencies`에서 `dependencies`로 변경해야 합니다.
|
|
418
402
|
|
|
419
|
-
```
|
|
420
|
-
|
|
421
|
-
|
|
403
|
+
```typescript {3,7} fileName="vite.config.ts"
|
|
404
|
+
import { defineConfig } from "vite";
|
|
405
|
+
import react from "@vitejs/plugin-react-swc";
|
|
406
|
+
import { intlayer, intlayerMiddleware } from "vite-intlayer";
|
|
422
407
|
|
|
423
|
-
|
|
424
|
-
|
|
408
|
+
// https://vitejs.dev/config/
|
|
409
|
+
export default defineConfig({
|
|
410
|
+
plugins: [react(), intlayer(), intlayerMiddleware()],
|
|
411
|
+
});
|
|
425
412
|
```
|
|
426
413
|
|
|
427
|
-
|
|
428
|
-
# Intlayer 사전 빌드
|
|
429
|
-
yarn intlayer:build
|
|
430
|
-
|
|
431
|
-
# 개발 서버 시작
|
|
432
|
-
yarn dev
|
|
433
|
-
```
|
|
414
|
+
---
|
|
434
415
|
|
|
435
|
-
|
|
416
|
+
## TypeScript 구성
|
|
436
417
|
|
|
437
418
|
Intlayer는 모듈 확장을 사용하여 TypeScript의 이점을 활용하고 코드베이스를 더욱 견고하게 만듭니다.
|
|
438
419
|
|
|
@@ -440,15 +421,7 @@ TypeScript 구성에 자동 생성된 타입이 포함되어 있는지 확인하
|
|
|
440
421
|
|
|
441
422
|
```json5 fileName="tsconfig.json"
|
|
442
423
|
{
|
|
443
|
-
|
|
444
|
-
// ... 기존 TypeScript 구성
|
|
445
|
-
},
|
|
446
|
-
include: [
|
|
447
|
-
json5 fileName="tsconfig.json"
|
|
448
|
-
{
|
|
449
|
-
compilerOptions: {
|
|
450
|
-
// ... 기존 TypeScript 설정
|
|
451
|
-
},
|
|
424
|
+
// ... 기존 구성
|
|
452
425
|
include: [
|
|
453
426
|
// ... 기존 포함 항목
|
|
454
427
|
".intlayer/**/*.ts", // 자동 생성된 타입 포함
|
|
@@ -456,11 +429,13 @@ json5 fileName="tsconfig.json"
|
|
|
456
429
|
}
|
|
457
430
|
```
|
|
458
431
|
|
|
459
|
-
|
|
432
|
+
---
|
|
433
|
+
|
|
434
|
+
## Git 구성
|
|
460
435
|
|
|
461
|
-
Intlayer가
|
|
436
|
+
Intlayer가 생성한 파일은 Git 저장소에 커밋하지 않도록 무시하는 것이 좋습니다.
|
|
462
437
|
|
|
463
|
-
이를 위해 `.gitignore` 파일에 다음
|
|
438
|
+
이를 위해 `.gitignore` 파일에 다음 지침을 추가할 수 있습니다:
|
|
464
439
|
|
|
465
440
|
```plaintext fileName=".gitignore"
|
|
466
441
|
# Intlayer가 생성한 파일 무시
|
|
@@ -469,50 +444,20 @@ Intlayer가 생성하는 파일들은 Git 저장소에 커밋하지 않도록
|
|
|
469
444
|
|
|
470
445
|
---
|
|
471
446
|
|
|
472
|
-
##
|
|
473
|
-
|
|
474
|
-
애플리케이션을 배포할 때:
|
|
475
|
-
|
|
476
|
-
1. **애플리케이션 빌드:**
|
|
477
|
-
|
|
478
|
-
```bash
|
|
479
|
-
npm run build
|
|
480
|
-
```
|
|
481
|
-
|
|
482
|
-
2. **Intlayer 사전 빌드:**
|
|
483
|
-
|
|
484
|
-
```bash
|
|
485
|
-
npm run intlayer:build
|
|
486
|
-
```
|
|
487
|
-
|
|
488
|
-
3. **프로덕션에서 미들웨어를 사용할 경우 `vite-intlayer`를 dependencies로 이동:**
|
|
489
|
-
|
|
490
|
-
```bash
|
|
491
|
-
npm install vite-intlayer --save
|
|
492
|
-
```
|
|
493
|
-
|
|
494
|
-
귀하의 애플리케이션은 이제 다음을 지원합니다:
|
|
495
|
-
|
|
496
|
-
- **URL 구조**: `/en`, `/en/about`, `/tr`, `/tr/about`
|
|
497
|
-
- 브라우저 환경 설정에 따른 **자동 로케일 감지**
|
|
498
|
-
- React Router v7과 함께하는 **로케일 인식 라우팅**
|
|
499
|
-
- 자동 생성 타입을 통한 **TypeScript 지원**
|
|
500
|
-
- 적절한 로케일 처리를 포함한 **서버 사이드 렌더링**
|
|
501
|
-
|
|
502
|
-
## VS Code 확장 프로그램
|
|
447
|
+
## VS 코드 확장
|
|
503
448
|
|
|
504
|
-
Intlayer
|
|
449
|
+
Intlayer 개발 경험을 향상시키기 위해 공식 **Intlayer VS 코드 확장**을 설치할 수 있습니다.
|
|
505
450
|
|
|
506
|
-
[VS
|
|
451
|
+
[VS 코드 마켓플레이스에서 설치하기](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
|
|
507
452
|
|
|
508
|
-
이
|
|
453
|
+
이 확장은 다음 기능을 제공합니다:
|
|
509
454
|
|
|
510
|
-
- 번역 키에 대한 **자동
|
|
511
|
-
- 누락된 번역에 대한 **실시간 오류
|
|
512
|
-
- 번역된 콘텐츠의 **인라인
|
|
513
|
-
-
|
|
455
|
+
- 번역 키에 대한 **자동 완성**.
|
|
456
|
+
- 누락된 번역에 대한 **실시간 오류 감지**.
|
|
457
|
+
- 번역된 콘텐츠의 **인라인 미리보기**.
|
|
458
|
+
- 번역을 쉽게 생성하고 업데이트할 수 있는 **빠른 작업**.
|
|
514
459
|
|
|
515
|
-
확장
|
|
460
|
+
확장 사용 방법에 대한 자세한 내용은 [Intlayer VS 코드 확장 문서](https://intlayer.org/doc/vs-code-extension)를 참조하세요.
|
|
516
461
|
|
|
517
462
|
---
|
|
518
463
|
|
|
@@ -522,7 +467,7 @@ Intlayer와 함께 개발 경험을 향상시키기 위해 공식 **Intlayer VS
|
|
|
522
467
|
|
|
523
468
|
---
|
|
524
469
|
|
|
525
|
-
## 문서
|
|
470
|
+
## 문서 참조
|
|
526
471
|
|
|
527
472
|
- [Intlayer 문서](https://intlayer.org)
|
|
528
473
|
- [React Router v7 문서](https://reactrouter.com/)
|
|
@@ -531,10 +476,11 @@ Intlayer와 함께 개발 경험을 향상시키기 위해 공식 **Intlayer VS
|
|
|
531
476
|
- [콘텐츠 선언](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/dictionary/get_started.md)
|
|
532
477
|
- [설정](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/configuration.md)
|
|
533
478
|
|
|
534
|
-
이 포괄적인 가이드는 React Router v7과
|
|
479
|
+
이 포괄적인 가이드는 Intlayer를 React Router v7과 통합하여 로케일 인식 라우팅과 TypeScript 지원이 포함된 완전한 국제화 애플리케이션을 구축하는 데 필요한 모든 것을 제공합니다.
|
|
535
480
|
|
|
536
481
|
## 문서 이력
|
|
537
482
|
|
|
538
|
-
| 버전 | 날짜
|
|
539
|
-
| ----- |
|
|
540
|
-
|
|
|
483
|
+
| 버전 | 날짜 | 변경 사항 |
|
|
484
|
+
| ----- | ---------- | ------------------------- |
|
|
485
|
+
| 6.1.5 | 2025-10-03 | 문서 업데이트 |
|
|
486
|
+
| 5.8.2 | 2025-09-04 | React Router v7 지원 추가 |
|