@intlayer/docs 7.0.5 → 7.0.7

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 (145) hide show
  1. package/blog/ar/intlayer_with_i18next.md +72 -19
  2. package/blog/ar/intlayer_with_next-i18next.md +61 -36
  3. package/blog/ar/intlayer_with_next-intl.md +61 -13
  4. package/blog/ar/intlayer_with_react-i18next.md +67 -18
  5. package/blog/ar/intlayer_with_react-intl.md +66 -13
  6. package/blog/ar/intlayer_with_vue-i18n.md +180 -0
  7. package/blog/de/intlayer_with_i18next.md +61 -26
  8. package/blog/de/intlayer_with_next-i18next.md +66 -17
  9. package/blog/de/intlayer_with_next-intl.md +62 -13
  10. package/blog/de/intlayer_with_react-i18next.md +66 -17
  11. package/blog/de/intlayer_with_react-intl.md +66 -14
  12. package/blog/de/intlayer_with_vue-i18n.md +178 -0
  13. package/blog/en/intlayer_with_i18next.md +53 -2
  14. package/blog/en/intlayer_with_next-i18next.md +52 -16
  15. package/blog/en/intlayer_with_next-intl.md +49 -0
  16. package/blog/en/intlayer_with_react-i18next.md +50 -1
  17. package/blog/en/intlayer_with_react-intl.md +53 -0
  18. package/blog/en/intlayer_with_vue-i18n.md +178 -0
  19. package/blog/en-GB/intlayer_with_i18next.md +58 -7
  20. package/blog/en-GB/intlayer_with_next-i18next.md +55 -9
  21. package/blog/en-GB/intlayer_with_next-intl.md +55 -6
  22. package/blog/en-GB/intlayer_with_react-i18next.md +55 -6
  23. package/blog/en-GB/intlayer_with_react-intl.md +56 -3
  24. package/blog/en-GB/intlayer_with_vue-i18n.md +180 -0
  25. package/blog/es/intlayer_with_i18next.md +69 -18
  26. package/blog/es/intlayer_with_next-i18next.md +70 -24
  27. package/blog/es/intlayer_with_next-intl.md +64 -13
  28. package/blog/es/intlayer_with_react-i18next.md +61 -12
  29. package/blog/es/intlayer_with_react-intl.md +65 -12
  30. package/blog/es/intlayer_with_vue-i18n.md +178 -0
  31. package/blog/fr/intlayer_with_i18next.md +77 -16
  32. package/blog/fr/intlayer_with_next-i18next.md +55 -31
  33. package/blog/fr/intlayer_with_next-intl.md +57 -7
  34. package/blog/fr/intlayer_with_react-i18next.md +64 -7
  35. package/blog/fr/intlayer_with_react-intl.md +63 -10
  36. package/blog/fr/intlayer_with_vue-i18n.md +178 -0
  37. package/blog/hi/intlayer_with_i18next.md +67 -16
  38. package/blog/hi/intlayer_with_next-i18next.md +69 -23
  39. package/blog/hi/intlayer_with_next-intl.md +61 -8
  40. package/blog/hi/intlayer_with_react-i18next.md +63 -14
  41. package/blog/hi/intlayer_with_react-intl.md +66 -13
  42. package/blog/hi/intlayer_with_vue-i18n.md +180 -0
  43. package/blog/id/intlayer_with_i18next.md +65 -14
  44. package/blog/id/intlayer_with_next-i18next.md +58 -12
  45. package/blog/id/intlayer_with_next-intl.md +60 -11
  46. package/blog/id/intlayer_with_react-i18next.md +59 -10
  47. package/blog/id/intlayer_with_react-intl.md +66 -13
  48. package/blog/id/intlayer_with_vue-i18n.md +178 -0
  49. package/blog/it/intlayer_with_i18next.md +70 -19
  50. package/blog/it/intlayer_with_next-i18next.md +68 -22
  51. package/blog/it/intlayer_with_next-intl.md +62 -12
  52. package/blog/it/intlayer_with_react-i18next.md +65 -16
  53. package/blog/it/intlayer_with_react-intl.md +67 -14
  54. package/blog/it/intlayer_with_vue-i18n.md +178 -0
  55. package/blog/ja/intlayer_with_i18next.md +74 -24
  56. package/blog/ja/intlayer_with_next-i18next.md +60 -37
  57. package/blog/ja/intlayer_with_next-intl.md +63 -15
  58. package/blog/ja/intlayer_with_react-i18next.md +70 -21
  59. package/blog/ja/intlayer_with_react-intl.md +73 -21
  60. package/blog/ja/intlayer_with_vue-i18n.md +180 -0
  61. package/blog/ko/intlayer_with_i18next.md +60 -29
  62. package/blog/ko/intlayer_with_next-i18next.md +59 -32
  63. package/blog/ko/intlayer_with_next-intl.md +52 -23
  64. package/blog/ko/intlayer_with_react-i18next.md +65 -16
  65. package/blog/ko/intlayer_with_react-intl.md +74 -22
  66. package/blog/ko/intlayer_with_vue-i18n.md +180 -0
  67. package/blog/pl/intlayer_with_i18next.md +63 -12
  68. package/blog/pl/intlayer_with_next-i18next.md +74 -17
  69. package/blog/pl/intlayer_with_next-intl.md +59 -8
  70. package/blog/pl/intlayer_with_react-i18next.md +59 -10
  71. package/blog/pl/intlayer_with_react-intl.md +65 -12
  72. package/blog/pl/intlayer_with_vue-i18n.md +180 -0
  73. package/blog/pt/intlayer_with_i18next.md +67 -16
  74. package/blog/pt/intlayer_with_next-i18next.md +65 -19
  75. package/blog/pt/intlayer_with_next-intl.md +62 -12
  76. package/blog/pt/intlayer_with_react-i18next.md +67 -18
  77. package/blog/pt/intlayer_with_react-intl.md +62 -10
  78. package/blog/pt/intlayer_with_vue-i18n.md +178 -0
  79. package/blog/ru/intlayer_with_i18next.md +68 -15
  80. package/blog/ru/intlayer_with_next-i18next.md +71 -25
  81. package/blog/ru/intlayer_with_next-intl.md +56 -7
  82. package/blog/ru/intlayer_with_react-i18next.md +65 -16
  83. package/blog/ru/intlayer_with_react-intl.md +69 -16
  84. package/blog/ru/intlayer_with_vue-i18n.md +180 -0
  85. package/blog/tr/intlayer_with_i18next.md +67 -16
  86. package/blog/tr/intlayer_with_next-i18next.md +78 -21
  87. package/blog/tr/intlayer_with_next-intl.md +69 -18
  88. package/blog/tr/intlayer_with_react-i18next.md +65 -16
  89. package/blog/tr/intlayer_with_react-intl.md +71 -19
  90. package/blog/tr/intlayer_with_vue-i18n.md +180 -0
  91. package/blog/vi/intlayer_with_i18next.md +64 -13
  92. package/blog/vi/intlayer_with_next-i18next.md +72 -26
  93. package/blog/vi/intlayer_with_next-intl.md +62 -11
  94. package/blog/vi/intlayer_with_react-i18next.md +66 -17
  95. package/blog/vi/intlayer_with_react-intl.md +70 -17
  96. package/blog/vi/intlayer_with_vue-i18n.md +180 -0
  97. package/blog/zh/intlayer_with_i18next.md +67 -17
  98. package/blog/zh/intlayer_with_next-i18next.md +67 -22
  99. package/blog/zh/intlayer_with_next-intl.md +61 -13
  100. package/blog/zh/intlayer_with_react-i18next.md +67 -18
  101. package/blog/zh/intlayer_with_react-intl.md +69 -17
  102. package/blog/zh/intlayer_with_vue-i18n.md +180 -0
  103. package/dist/cjs/generated/blog.entry.cjs +19 -0
  104. package/dist/cjs/generated/blog.entry.cjs.map +1 -1
  105. package/dist/esm/generated/blog.entry.mjs +19 -0
  106. package/dist/esm/generated/blog.entry.mjs.map +1 -1
  107. package/dist/types/generated/blog.entry.d.ts +1 -0
  108. package/dist/types/generated/blog.entry.d.ts.map +1 -1
  109. package/docs/ar/intlayer_with_nextjs_15.md +36 -9
  110. package/docs/ar/intlayer_with_nextjs_16.md +36 -9
  111. package/docs/de/intlayer_with_nextjs_15.md +36 -9
  112. package/docs/de/intlayer_with_nextjs_16.md +24 -6
  113. package/docs/en/intlayer_with_nextjs_14.md +37 -9
  114. package/docs/en/intlayer_with_nextjs_15.md +40 -10
  115. package/docs/en/intlayer_with_nextjs_16.md +40 -10
  116. package/docs/en/plugins/sync-json.md +152 -55
  117. package/docs/en/releases/v7.md +1 -1
  118. package/docs/en-GB/intlayer_with_nextjs_15.md +36 -9
  119. package/docs/en-GB/intlayer_with_nextjs_16.md +36 -9
  120. package/docs/en-GB/releases/v7.md +1 -1
  121. package/docs/es/intlayer_with_nextjs_15.md +36 -9
  122. package/docs/es/intlayer_with_nextjs_16.md +36 -9
  123. package/docs/fr/intlayer_with_nextjs_15.md +36 -9
  124. package/docs/fr/intlayer_with_nextjs_16.md +37 -24
  125. package/docs/hi/intlayer_with_nextjs_15.md +36 -9
  126. package/docs/hi/intlayer_with_nextjs_16.md +36 -9
  127. package/docs/id/intlayer_with_nextjs_16.md +36 -9
  128. package/docs/it/intlayer_with_nextjs_15.md +36 -9
  129. package/docs/it/intlayer_with_nextjs_16.md +36 -9
  130. package/docs/ja/intlayer_with_nextjs_15.md +36 -9
  131. package/docs/ja/intlayer_with_nextjs_16.md +36 -9
  132. package/docs/ko/intlayer_with_nextjs_15.md +36 -9
  133. package/docs/ko/intlayer_with_nextjs_16.md +36 -9
  134. package/docs/pl/intlayer_with_nextjs_16.md +36 -9
  135. package/docs/pt/intlayer_with_nextjs_15.md +36 -9
  136. package/docs/pt/intlayer_with_nextjs_16.md +36 -9
  137. package/docs/ru/intlayer_with_nextjs_15.md +36 -9
  138. package/docs/ru/intlayer_with_nextjs_16.md +36 -9
  139. package/docs/tr/intlayer_with_nextjs_15.md +36 -9
  140. package/docs/tr/intlayer_with_nextjs_16.md +39 -21
  141. package/docs/vi/intlayer_with_nextjs_16.md +36 -9
  142. package/docs/zh/intlayer_with_nextjs_15.md +36 -9
  143. package/docs/zh/intlayer_with_nextjs_16.md +36 -9
  144. package/package.json +14 -14
  145. package/src/generated/blog.entry.ts +19 -0
@@ -18,6 +18,9 @@ slugs:
18
18
  - blog
19
19
  - intlayer-with-react-i18next
20
20
  history:
21
+ - version: 7.0.6
22
+ date: 2025-11-01
23
+ changes: loadJSON 플러그인 추가
21
24
  - version: 7.0.0
22
25
  date: 2025-10-29
23
26
  changes: syncJSON 플러그인으로 변경
@@ -31,15 +34,16 @@ history:
31
34
 
32
35
  react-i18next와의 구체적인 비교는 저희 [react-i18next vs. react-intl vs. Intlayer](https://github.com/aymericzip/intlayer/blob/main/docs/blog/ko/react-i18next_vs_react-intl_vs_intlayer.md) 블로그 게시물을 참고하세요.
33
36
 
34
- ## 왜 Intlayer를 react-i18next와 결합해야 하나요?
37
+ ## 왜 Intlayer를 react-i18next와 결합해야 할까요?
35
38
 
36
39
  Intlayer는 훌륭한 독립형 i18n 솔루션을 제공하지만(자세한 내용은 저희 [React 통합 가이드](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/intlayer_with_vite+react.md)를 참조), 다음과 같은 여러 이유로 react-i18next와 결합하여 사용하고자 할 수 있습니다:
37
40
 
38
- 1. **기존 코드베이스**: 이미 구축된 react-i18next 구현이 있으며 Intlayer의 향상된 개발자 경험으로 점진적으로 이전하고자 할 때.
39
- 2. **레거시 요구사항**: 프로젝트가 기존 react-i18next 플러그인 또는 워크플로우와의 호환성을 필요로 할 때.
40
- 3. **팀 친숙도**: 팀이 react-i18next에 익숙하지만 더 나은 콘텐츠 관리를 원할 때.
41
+ 1. **기존 코드베이스**: 이미 구축된 react-i18next 구현이 있으며 Intlayer의 향상된 개발자 경험으로 점진적으로 마이그레이션하고자 합니다.
42
+ 2. **레거시 요구사항**: 프로젝트가 기존 react-i18next 플러그인 또는 워크플로우와의 호환성을 필요로 합니다.
43
+ 3. **팀 친숙도**: 팀이 react-i18next에 익숙하지만 더 나은 콘텐츠 관리를 원합니다.
44
+ 4. **Intlayer 기능 사용**: 콘텐츠 선언, 번역 자동화, 번역 테스트 등 Intlayer의 기능을 사용하고자 합니다.
41
45
 
42
- **이를 위해 Intlayer는 react-i18next의 어댑터로 구현되어 CLI 또는 CI/CD 파이프라인에서 JSON 번역 자동화, 번역 테스트 다양한 작업을 지원할 수 있습니다.**
46
+ **이를 위해 Intlayer는 react-i18next의 어댑터로 구현되어 CLI 또는 CI/CD 파이프라인에서 JSON 번역 자동화, 번역 테스트 등을 지원할 수 있습니다.**
43
47
 
44
48
  이 가이드는 react-i18next와의 호환성을 유지하면서 Intlayer의 우수한 콘텐츠 선언 시스템을 활용하는 방법을 보여줍니다.
45
49
 
@@ -65,14 +69,18 @@ pnpm add intlayer @intlayer/sync-json-plugin
65
69
  yarn add intlayer @intlayer/sync-json-plugin
66
70
  ```
67
71
 
72
+ ```bash packageManager="bun"
73
+ bun add intlayer @intlayer/sync-json-plugin
74
+ ```
75
+
68
76
  **패키지 설명:**
69
77
 
70
78
  - **intlayer**: 국제화 관리, 콘텐츠 선언 및 빌드를 위한 핵심 라이브러리
71
79
  - **@intlayer/sync-json-plugin**: Intlayer 콘텐츠 선언을 react-i18next 호환 JSON 형식으로 내보내는 플러그인
72
80
 
73
- ### 2단계: JSON을 감싸는 Intlayer 플러그인 구현
81
+ ### 2단계: JSON을 감싸기 위한 Intlayer 플러그인 구현
74
82
 
75
- 지원하는 로케일을 정의하는 Intlayer 구성 파일을 만드세요:
83
+ 지원하는 로케일을 정의하기 위해 Intlayer 구성 파일을 만듭니다:
76
84
 
77
85
  **react-i18next용 JSON 사전도 내보내고 싶다면**, `syncJSON` 플러그인을 추가하세요:
78
86
 
@@ -87,31 +95,72 @@ const config: IntlayerConfig = {
87
95
  },
88
96
  plugins: [
89
97
  syncJSON({
90
- source: ({ key, locale }) => `./messages/${locale}/${key}.json`,
98
+ source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
91
99
  }),
92
100
  ],
93
101
  };
94
102
 
95
- export default config;
103
+ `export default config;
96
104
  ```
97
105
 
98
106
  `syncJSON` 플러그인은 JSON을 자동으로 래핑합니다. 콘텐츠 구조를 변경하지 않고 JSON 파일을 읽고 씁니다.
99
107
 
100
108
  만약 JSON과 intlayer 콘텐츠 선언 파일(`.content` 파일)을 공존시키고 싶다면, Intlayer는 다음과 같이 처리합니다:
101
109
 
102
- 1. JSON과 콘텐츠 선언 파일을 모두 로드하여 Intlayer 사전으로 변환합니다.
103
- 2. JSON과 콘텐츠 선언 파일 간에 충돌이 있을 경우, Intlayer는 모든 사전을 병합합니다. 과정은 플러그인의 우선순위와 콘텐츠 선언 파일의 우선순위에 따라 결정됩니다(모두 구성 가능).
110
+ 1. JSON과 콘텐츠 선언 파일을 모두 로드하여 intlayer 사전(dictionary)으로 변환합니다.
111
+ 2. JSON과 콘텐츠 선언 파일 간에 충돌이 있을 경우, Intlayer는 모든 사전을 병합합니다. 이때 플러그인의 우선순위와 콘텐츠 선언 파일의 우선순위에 따라 처리됩니다(모두 구성 가능).
104
112
 
105
- CLI를 사용하여 JSON을 번역하거나 CMS를 통해 변경 사항이 발생하면, Intlayer는 새로운 번역으로 JSON 파일을 업데이트합니다.
113
+ CLI를 사용하여 JSON을 번역하거나 CMS를 통해 변경이 이루어지면, Intlayer는 새로운 번역으로 JSON 파일을 업데이트합니다.
106
114
 
107
115
  `syncJSON` 플러그인에 대한 자세한 내용은 [syncJSON 플러그인 문서](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/plugins/sync-json.md)를 참조하세요.
108
116
 
109
- ## Git 구성
117
+ ### (선택 사항) 3단계: 컴포넌트별 JSON 번역 구현
118
+
119
+ 기본적으로 Intlayer는 JSON 파일과 콘텐츠 선언 파일을 모두 로드, 병합 및 동기화합니다. 자세한 내용은 [콘텐츠 선언 문서](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/dictionary/content_file.md)를 참조하세요. 하지만 원한다면 Intlayer 플러그인을 사용하여 코드베이스 어디에서나 로컬라이즈된 JSON을 컴포넌트별로 관리할 수도 있습니다.
120
+
121
+ 이를 위해 `loadJSON` 플러그인을 사용할 수 있습니다.
122
+
123
+ ```ts fileName="intlayer.config.ts"
124
+ import { Locales, type IntlayerConfig } from "intlayer";
125
+ import { loadJSON, syncJSON } from "@intlayer/sync-json-plugin";
126
+
127
+ const config: IntlayerConfig = {
128
+ internationalization: {
129
+ locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
130
+ defaultLocale: Locales.ENGLISH,
131
+ },
132
+
133
+ // 현재 JSON 파일을 Intlayer 사전과 동기화 상태로 유지합니다
134
+ plugins: [
135
+ /**
136
+ * src 내에서 {key}.i18n.json 패턴과 일치하는 모든 JSON 파일을 로드합니다
137
+ */
138
+ loadJSON({
139
+ source: ({ key }) => `./src/**/${key}.i18n.json`,
140
+ locale: Locales.ENGLISH,
141
+ priority: 1, // 이 JSON 파일들이 `./locales/en/${key}.json` 파일보다 우선권을 갖도록 보장합니다
142
+ }),
143
+ /**
144
+ * locales 디렉토리 내 JSON 파일에 출력 및 번역을 다시 작성하고 로드합니다
145
+ */
146
+ syncJSON({
147
+ source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
148
+ priority: 0,
149
+ }),
150
+ ],
151
+ };
152
+
153
+ export default config;
154
+ ```
155
+
156
+ 이 설정은 `src` 디렉토리 내에서 `{key}.i18n.json` 패턴과 일치하는 모든 JSON 파일을 로드하여 Intlayer 사전으로 불러옵니다.
157
+
158
+ ## Git 설정
110
159
 
111
- 자동 생성된 Intlayer 파일은 무시하는 것이 권장됩니다:
160
+ 자동 생성되는 Intlayer 파일은 무시하는 것이 권장됩니다:
112
161
 
113
162
  ```plaintext fileName=".gitignore"
114
- # Intlayer에서 생성된 파일 무시하기
163
+ # Intlayer에서 생성된 파일 무시
115
164
  .intlayer
116
165
  ```
117
166
 
@@ -119,6 +168,6 @@ CLI를 사용하여 JSON을 번역하거나 CMS를 통해 변경 사항이 발
119
168
 
120
169
  ### VS Code 확장 프로그램
121
170
 
122
- 개발자 경험을 향상시키기 위해 공식 **Intlayer VS Code 확장 프로그램**을 설치하세요:
171
+ 개발자 경험 향상을 위해 공식 **Intlayer VS Code 확장 프로그램**을 설치하세요:
123
172
 
124
173
  [VS Code 마켓플레이스에서 설치하기](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
@@ -16,6 +16,9 @@ slugs:
16
16
  - blog
17
17
  - intlayer-with-react-intl
18
18
  history:
19
+ - version: 7.0.6
20
+ date: 2025-11-01
21
+ changes: loadJSON 플러그인 추가
19
22
  - version: 7.0.0
20
23
  date: 2025-10-29
21
24
  changes: syncJSON 플러그인으로 변경
@@ -23,21 +26,26 @@ history:
23
26
 
24
27
  # Intlayer를 사용하여 react-intl JSON 번역 자동화하는 방법
25
28
 
29
+ ## 목차
30
+
31
+ <TOC/>
32
+
26
33
  ## Intlayer란 무엇인가요?
27
34
 
28
- **Intlayer**는 전통적인 i18n 솔루션의 한계를 극복하기 위해 설계된 혁신적이고 오픈 소스 국제화 라이브러리입니다. React 애플리케이션에서 콘텐츠 관리를 위한 현대적인 접근 방식을 제공합니다.
35
+ **Intlayer**는 전통적인 i18n 솔루션의 한계를 해결하기 위해 설계된 혁신적이고 오픈 소스인 국제화 라이브러리입니다. React 애플리케이션에서 콘텐츠 관리를 위한 현대적인 접근 방식을 제공합니다.
29
36
 
30
- react-intl과의 구체적인 비교는 저희 [react-i18next vs. react-intl vs. Intlayer](https://github.com/aymericzip/intlayer/blob/main/docs/blog/ko/react-i18next_vs_react-intl_vs_intlayer.md) 블로그 게시물을 참고하세요.
37
+ react-intl과의 구체적인 비교는 저희 블로그 게시물 [react-i18next vs. react-intl vs. Intlayer](https://github.com/aymericzip/intlayer/blob/main/docs/blog/en/react-i18next_vs_react-intl_vs_intlayer.md)에서 확인할 있습니다.
31
38
 
32
- ## 왜 Intlayer react-intl 함께 사용해야 할까요?
39
+ ## 왜 Intlayer react-intl 함께 사용해야 할까요?
33
40
 
34
- Intlayer는 훌륭한 독립형 i18n 솔루션을 제공하지만(자세한 내용은 저희 [React 통합 가이드](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/intlayer_with_vite+react.md)를 참조), 다음과 같은 여러 이유로 react-intl과 함께 사용하고자 할 수 있습니다:
41
+ Intlayer는 훌륭한 독립형 i18n 솔루션을 제공하지만(자세한 내용은 [React 통합 가이드](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_vite+react.md)를 참조), 다음과 같은 여러 이유로 react-intl과 결합하여 사용하고자 할 수 있습니다:
35
42
 
36
- 1. **기존 코드베이스**: 이미 구축된 react-intl 구현이 있으며 Intlayer의 향상된 개발자 경험으로 점진적으로 이전하고자 할 때.
37
- 2. **레거시 요구사항**: 프로젝트가 기존 react-intl 플러그인 또는 워크플로우와의 호환성을 필요로 할 때.
38
- 3. **팀 친숙도**: 팀이 react-intl에 익숙하지만 더 나은 콘텐츠 관리를 원할 때.
43
+ 1. **기존 코드베이스**: 이미 구축된 react-intl 구현이 있으며 Intlayer의 향상된 개발자 경험으로 점진적으로 마이그레이션하고자 합니다.
44
+ 2. **레거시 요구사항**: 프로젝트가 기존 react-intl 플러그인 또는 워크플로우와의 호환성을 필요로 합니다.
45
+ 3. **팀 친숙도**: 팀이 react-intl에 익숙하지만 더 나은 콘텐츠 관리를 원합니다.
46
+ 4. **Intlayer 기능 사용**: 콘텐츠 선언, 번역 자동화, 번역 테스트 등 Intlayer의 기능을 활용하고자 합니다.
39
47
 
40
- **이를 위해 Intlayer는 react-intl의 어댑터로 구현되어 CLI 또는 CI/CD 파이프라인에서 JSON 번역 자동화, 번역 테스트 다양한 작업을 지원할 수 있습니다.**
48
+ **이를 위해 Intlayer는 react-intl의 어댑터로 구현되어 CLI 또는 CI/CD 파이프라인에서 JSON 번역 자동화, 번역 테스트 등을 지원할 수 있습니다.**
41
49
 
42
50
  이 가이드는 react-intl과의 호환성을 유지하면서 Intlayer의 우수한 콘텐츠 선언 시스템을 활용하는 방법을 보여줍니다.
43
51
 
@@ -45,7 +53,7 @@ Intlayer는 훌륭한 독립형 i18n 솔루션을 제공하지만(자세한 내
45
53
 
46
54
  <TOC/>
47
55
 
48
- ## react-intl과 함께 Intlayer 설정 단계별 가이드
56
+ ## react-intl과 함께 Intlayer 설정하는 단계별 가이드
49
57
 
50
58
  ### 1단계: 의존성 설치
51
59
 
@@ -63,6 +71,10 @@ pnpm add intlayer @intlayer/sync-json-plugin
63
71
  yarn add intlayer @intlayer/sync-json-plugin
64
72
  ```
65
73
 
74
+ ```bash packageManager="bun"
75
+ bun add intlayer @intlayer/sync-json-plugin
76
+ ```
77
+
66
78
  **패키지 설명:**
67
79
 
68
80
  - **intlayer**: 국제화 관리, 콘텐츠 선언 및 빌드를 위한 핵심 라이브러리
@@ -70,7 +82,7 @@ yarn add intlayer @intlayer/sync-json-plugin
70
82
 
71
83
  ### 2단계: JSON을 래핑하기 위한 Intlayer 플러그인 구현
72
84
 
73
- 지원하는 로케일을 정의하기 위해 Intlayer 구성 파일을 만드세요:
85
+ 지원하는 로케일을 정의하기 위해 Intlayer 구성 파일을 만듭니다:
74
86
 
75
87
  **react-intl용 JSON 사전도 내보내고 싶다면**, `syncJSON` 플러그인을 추가하세요:
76
88
 
@@ -90,34 +102,74 @@ const config: IntlayerConfig = {
90
102
  ],
91
103
  };
92
104
 
93
- export default config;
105
+ `export default config;
94
106
  ```
95
107
 
96
108
  `syncJSON` 플러그인은 JSON을 자동으로 래핑합니다. 콘텐츠 구조를 변경하지 않고 JSON 파일을 읽고 씁니다.
97
109
 
98
- JSON과 intlayer 콘텐츠 선언 파일(`.content` 파일)을 공존시키고 싶다면, Intlayer는 다음과 같이 처리합니다:
110
+ 만약 JSON과 intlayer 콘텐츠 선언 파일(`.content` 파일)을 공존시키고 싶다면, Intlayer는 다음과 같이 처리합니다:
111
+
112
+ 1. JSON과 콘텐츠 선언 파일을 모두 불러와서 intlayer 사전(dictionary)으로 변환합니다.
113
+ 2. JSON과 콘텐츠 선언 파일 간에 충돌이 있을 경우, Intlayer는 모든 사전을 병합합니다. 이때 플러그인의 우선순위와 콘텐츠 선언 파일의 우선순위에 따라 처리되며, 모두 설정 가능합니다.
114
+
115
+ CLI를 사용해 JSON을 번역하거나 CMS를 통해 변경이 이루어지면, Intlayer는 새로운 번역으로 JSON 파일을 업데이트합니다.
116
+
117
+ `syncJSON` 플러그인에 대한 자세한 내용을 보려면 [syncJSON 플러그인 문서](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/plugins/sync-json.md)를 참조하세요.
118
+
119
+ ### (선택 사항) 3단계: 컴포넌트별 JSON 번역 구현
120
+
121
+ 기본적으로 Intlayer는 JSON 파일과 콘텐츠 선언 파일을 모두 로드, 병합 및 동기화합니다. 자세한 내용은 [콘텐츠 선언 문서](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/dictionary/content_file.md)를 참조하세요. 하지만 원한다면 Intlayer 플러그인을 사용하여 코드베이스 어디에서나 지역화된 JSON을 컴포넌트별로 관리할 수도 있습니다.
122
+
123
+ 이를 위해 `loadJSON` 플러그인을 사용할 수 있습니다.
124
+
125
+ ```ts fileName="intlayer.config.ts"
126
+ import { Locales, type IntlayerConfig } from "intlayer";
127
+ import { loadJSON, syncJSON } from "@intlayer/sync-json-plugin";
99
128
 
100
- 1. JSON 파일과 콘텐츠 선언 파일을 모두 불러와 intlayer 사전(dictionary)으로 변환합니다.
129
+ const config: IntlayerConfig = {
130
+ internationalization: {
131
+ locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
132
+ defaultLocale: Locales.ENGLISH,
133
+ },
101
134
 
102
- 2. JSON 콘텐츠 선언 파일 간에 충돌이 있을 경우, Intlayer 모든 사전을 병합하는 과정을 진행합니다. 이는 플러그인의 우선순위와 콘텐츠 선언 파일의 우선순위에 따라 결정되며(모두 구성 가능함).
135
+ // 현재 JSON 파일을 Intlayer 사전과 동기화 상태로 유지합니다
136
+ plugins: [
137
+ /**
138
+ * src 내에서 {key}.i18n.json 패턴과 일치하는 모든 JSON 파일을 로드합니다
139
+ */
140
+ loadJSON({
141
+ source: ({ key }) => `./src/**/${key}.i18n.json`,
142
+ locale: Locales.ENGLISH,
143
+ priority: 1, // 이 JSON 파일들이 `./locales/en/${key}.json` 파일보다 우선하도록 보장합니다
144
+ }),
145
+ /**
146
+ * locales 디렉토리 내 JSON 파일에 출력 및 번역을 다시 기록하며 로드합니다
147
+ */
148
+ syncJSON({
149
+ source: ({ key, locale }) => `./messages/${locale}/${key}.json`,
150
+ priority: 0,
151
+ }),
152
+ ],
153
+ };
103
154
 
104
- CLI를 사용하여 JSON을 번역하거나 CMS를 통해 변경 사항이 발생하면, Intlayer는 새로운 번역으로 JSON 파일을 업데이트합니다.
155
+ export default config;
156
+ ```
105
157
 
106
- `syncJSON` 플러그인에 대한 자세한 내용은 [syncJSON 플러그인 문서](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/plugins/sync-json.md)를 참조하세요.
158
+ 이 설정은 `src` 디렉토리 내에서 `{key}.i18n.json` 패턴과 일치하는 모든 JSON 파일을 로드하여 Intlayer 사전으로 불러옵니다.
107
159
 
108
- ## Git 구성
160
+ ## Git 설정
109
161
 
110
- 자동 생성된 Intlayer 파일은 무시하는 것이 권장됩니다:
162
+ 자동 생성되는 Intlayer 파일은 무시하는 것이 권장됩니다:
111
163
 
112
164
  ```plaintext fileName=".gitignore"
113
165
  # Intlayer에서 생성된 파일 무시
114
166
  .intlayer
115
167
  ```
116
168
 
117
- 이 파일들은 빌드 과정 중에 다시 생성될 수 있으므로 버전 관리에 커밋할 필요가 없습니다.
169
+ 이 파일들은 빌드 과정에서 다시 생성될 수 있으므로 버전 관리에 커밋할 필요가 없습니다.
118
170
 
119
- ### VS 코드 확장
171
+ ### VS Code 확장 프로그램
120
172
 
121
- 개발자 경험을 향상시키기 위해 공식 **Intlayer VS 코드 확장**을 설치하세요:
173
+ 개발자 경험 향상을 위해 공식 **Intlayer VS Code 확장 프로그램**을 설치하세요:
122
174
 
123
- [VS 코드 마켓플레이스에서 설치하기](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
175
+ [VS Code 마켓플레이스에서 설치하기](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
@@ -0,0 +1,180 @@
1
+ ---
2
+ createdAt: 2025-08-23
3
+ updatedAt: 2025-10-29
4
+ title: Intlayer와 vue-i18n
5
+ description: 포괄적인 Vue.js 국제화 솔루션을 위해 Intlayer를 vue-i18n과 통합하기
6
+ keywords:
7
+ - vue-i18n
8
+ - Intlayer
9
+ - 국제화
10
+ - 블로그
11
+ - Vue.js
12
+ - Nuxt
13
+ - JavaScript
14
+ - Vue
15
+ slugs:
16
+ - blog
17
+ - intlayer-with-vue-i18n
18
+ history:
19
+ - version: 7.0.6
20
+ date: 2025-11-01
21
+ changes: loadJSON 플러그인 추가
22
+ - version: 7.0.0
23
+ date: 2025-10-29
24
+ changes: syncJSON 플러그인으로 변경 및 전면 개편
25
+ ---
26
+
27
+ # vue-i18n과 Intlayer를 활용한 Vue.js 국제화(i18n)
28
+
29
+ ## 목차
30
+
31
+ <TOC/>
32
+
33
+ ## Intlayer란 무엇인가?
34
+
35
+ **Intlayer**는 전통적인 i18n 솔루션의 한계를 극복하기 위해 설계된 혁신적이고 오픈 소스인 국제화 라이브러리입니다. Vue.js 및 Nuxt 애플리케이션에서 콘텐츠 관리를 위한 현대적인 접근 방식을 제공합니다.
36
+
37
+ vue-i18n과의 구체적인 비교는 저희 [vue-i18n vs. Intlayer](https://github.com/aymericzip/intlayer/blob/main/docs/blog/ko/vue-i18n_vs_intlayer.md) 블로그 게시물을 참고하세요.
38
+
39
+ ## 왜 Intlayer를 vue-i18n과 결합해야 할까요?
40
+
41
+ Intlayer는 훌륭한 독립형 i18n 솔루션을 제공하지만(자세한 내용은 저희 [Vue.js 통합 가이드](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/intlayer_with_vite+vue.md)를 참조), 다음과 같은 여러 이유로 vue-i18n과 결합하여 사용할 수 있습니다:
42
+
43
+ 1. **기존 코드베이스**: 이미 구축된 vue-i18n 구현이 있으며 Intlayer의 향상된 개발자 경험으로 점진적으로 마이그레이션하고자 합니다.
44
+ 2. **레거시 요구사항**: 프로젝트가 기존 vue-i18n 플러그인 또는 워크플로우와의 호환성을 필요로 합니다.
45
+ 3. **팀 친숙도**: 팀이 vue-i18n에 익숙하지만 더 나은 콘텐츠 관리를 원합니다.
46
+ 4. **Intlayer 기능 사용**: 콘텐츠 선언, 번역 자동화, 번역 테스트 등 Intlayer의 기능을 사용하고자 합니다.
47
+
48
+ **이를 위해 Intlayer는 vue-i18n의 어댑터로 구현되어 CLI 또는 CI/CD 파이프라인에서 JSON 번역 자동화, 번역 테스트 등을 지원할 수 있습니다.**
49
+
50
+ 이 가이드는 vue-i18n과의 호환성을 유지하면서 Intlayer의 우수한 콘텐츠 선언 시스템을 활용하는 방법을 보여줍니다.
51
+
52
+ ---
53
+
54
+ ## vue-i18n과 함께 Intlayer 설정 단계별 가이드
55
+
56
+ ### 1단계: 의존성 설치
57
+
58
+ 선호하는 패키지 관리자를 사용하여 필요한 패키지를 설치하세요:
59
+
60
+ ```bash packageManager="npm"
61
+ npm install intlayer @intlayer/sync-json-plugin
62
+ ```
63
+
64
+ ```bash packageManager="pnpm"
65
+ pnpm add intlayer @intlayer/sync-json-plugin
66
+ ```
67
+
68
+ ```bash packageManager="yarn"
69
+ yarn add intlayer @intlayer/sync-json-plugin
70
+ ```
71
+
72
+ ```bash packageManager="bun"
73
+ bun add intlayer @intlayer/sync-json-plugin
74
+ ```
75
+
76
+ **패키지 설명:**
77
+
78
+ - **intlayer**: 콘텐츠 선언 및 관리를 위한 핵심 라이브러리
79
+ /// **@intlayer/sync-json-plugin**: Intlayer 콘텐츠 선언을 vue-i18n JSON 형식과 동기화하는 플러그인
80
+
81
+ ### 2단계: JSON을 래핑하기 위한 Intlayer 플러그인 구현
82
+
83
+ 지원하는 로케일을 정의하기 위해 Intlayer 구성 파일을 만듭니다:
84
+
85
+ **vue-i18n용 JSON 사전도 내보내고 싶다면**, `syncJSON` 플러그인을 추가하세요:
86
+
87
+ ```typescript fileName="intlayer.config.ts"
88
+ import { Locales, type IntlayerConfig } from "intlayer";
89
+ import { syncJSON } from "@intlayer/sync-json-plugin";
90
+
91
+ const config: IntlayerConfig = {
92
+ internationalization: {
93
+ locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH], // 지원하는 로케일 목록
94
+ defaultLocale: Locales.ENGLISH, // 기본 로케일 설정
95
+ },
96
+ plugins: [
97
+ syncJSON({
98
+ source: ({ key, locale }) => `./src/locales/${locale}/${key}.json`, // JSON 파일 경로 지정
99
+ }),
100
+ ],
101
+ };
102
+
103
+ export default config;
104
+ ```
105
+
106
+ `syncJSON` 플러그인은 JSON을 자동으로 래핑합니다. 콘텐츠 구조를 변경하지 않고 JSON 파일을 읽고 씁니다.
107
+
108
+ 만약 JSON을 intlayer 콘텐츠 선언 파일(`.content` 파일)과 공존시키고 싶다면, Intlayer는 다음과 같이 처리합니다:
109
+
110
+ 1. JSON과 콘텐츠 선언 파일을 모두 로드하여 intlayer 사전으로 변환합니다.
111
+ 2. JSON과 콘텐츠 선언 파일 간에 충돌이 있을 경우, Intlayer는 모든 사전을 병합합니다. 이때 플러그인의 우선순위와 콘텐츠 선언 파일의 우선순위에 따라 처리됩니다(모두 설정 가능).
112
+
113
+ CLI를 사용하여 JSON을 번역하거나 CMS를 통해 변경이 이루어지면, Intlayer는 새로운 번역으로 JSON 파일을 업데이트합니다.
114
+
115
+ `syncJSON` 플러그인에 대한 자세한 내용은 [syncJSON 플러그인 문서](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/plugins/sync-json.md)를 참조하세요.
116
+
117
+ ---
118
+
119
+ ### (선택 사항) 3단계: 컴포넌트별 JSON 번역 구현
120
+
121
+ 기본적으로 Intlayer는 JSON 파일과 콘텐츠 선언 파일을 모두 로드, 병합 및 동기화합니다. 자세한 내용은 [콘텐츠 선언 문서](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/dictionary/content_file.md)를 참조하세요. 하지만 원한다면 Intlayer 플러그인을 사용하여 코드베이스 어디에서나 지역화된 JSON을 컴포넌트별로 관리할 수도 있습니다.
122
+
123
+ 이를 위해 `loadJSON` 플러그인을 사용할 수 있습니다.
124
+
125
+ ```ts fileName="intlayer.config.ts"
126
+ import { Locales, type IntlayerConfig } from "intlayer";
127
+ import { loadJSON, syncJSON } from "@intlayer/sync-json-plugin";
128
+
129
+ const config: IntlayerConfig = {
130
+ internationalization: {
131
+ locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
132
+ defaultLocale: Locales.ENGLISH,
133
+ },
134
+
135
+ // 현재 JSON 파일을 Intlayer 사전과 동기화 상태로 유지합니다
136
+ plugins: [
137
+ /**
138
+ * src 내에서 {key}.i18n.json 패턴에 맞는 모든 JSON 파일을 로드합니다
139
+ */
140
+ loadJSON({
141
+ source: ({ key }) => `./src/**/${key}.i18n.json`,
142
+ locale: Locales.ENGLISH,
143
+ priority: 1, // 이 JSON 파일들이 `./locales/en/${key}.json` 파일보다 우선권을 갖도록 합니다
144
+ }),
145
+ /**
146
+ * locales 디렉토리 내 JSON 파일에 출력 및 번역을 다시 작성하고 로드합니다
147
+ */
148
+ syncJSON({
149
+ source: ({ key, locale }) => `./src/locales/${locale}/${key}.json`,
150
+ priority: 0,
151
+ }),
152
+ ],
153
+ };
154
+
155
+ export default config;
156
+ ```
157
+
158
+ 이 설정은 `src` 디렉토리 내에서 `{key}.i18n.json` 패턴과 일치하는 모든 JSON 파일을 로드하여 Intlayer 사전으로 불러옵니다.
159
+
160
+ ---
161
+
162
+ ## Git 설정
163
+
164
+ 생성된 파일을 버전 관리에서 제외하세요:
165
+
166
+ ```plaintext fileName=".gitignore"
167
+ # Intlayer에서 생성된 파일 무시
168
+ .intlayer
169
+ intl
170
+ ```
171
+
172
+ 이 파일들은 빌드 과정에서 자동으로 다시 생성되므로 저장소에 커밋할 필요가 없습니다.
173
+
174
+ ### VS Code 확장 프로그램
175
+
176
+ 개발자 경험 향상을 위해 공식 **Intlayer VS Code 확장 프로그램**을 설치하세요:
177
+
178
+ [VS Code 마켓플레이스에서 설치하기](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
179
+
180
+ [VS Code 마켓플레이스에서 설치하기](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  createdAt: 2024-12-24
3
- updatedAt: 2025-10-29
3
+ updatedAt: 2025-11-01
4
4
  title: Jak zautomatyzować tłumaczenia JSON i18next za pomocą Intlayer
5
- description: Automatyzuj tłumaczenia JSON za pomocą Intlayer i i18next dla lepszej internacjonalizacji w aplikacjach JavaScript.
5
+ description: Automatyzuj swoje tłumaczenia JSON za pomocą Intlayer i i18next, aby poprawić internacjonalizację w aplikacjach JavaScript.
6
6
  keywords:
7
7
  - Intlayer
8
8
  - i18next
@@ -20,6 +20,9 @@ slugs:
20
20
  - blog
21
21
  - intlayer-with-i18next
22
22
  history:
23
+ - version: 7.0.6
24
+ date: 2025-11-01
25
+ changes: Dodano wtyczkę loadJSON
23
26
  - version: 7.0.0
24
27
  date: 2025-10-29
25
28
  changes: Zmiana na wtyczkę syncJSON
@@ -29,7 +32,7 @@ history:
29
32
 
30
33
  ## Czym jest Intlayer?
31
34
 
32
- **Intlayer** to innowacyjna, otwartoźródłowa biblioteka do internacjonalizacji, zaprojektowana w celu rozwiązania niedoskonałości tradycyjnych rozwiązań i18n. Oferuje nowoczesne podejście do zarządzania treścią w aplikacjach JavaScript.
35
+ **Intlayer** to innowacyjna, otwartoźródłowa biblioteka do internacjonalizacji, zaprojektowana, aby rozwiązać niedoskonałości tradycyjnych rozwiązań i18n. Oferuje nowoczesne podejście do zarządzania treścią w aplikacjach JavaScript.
33
36
 
34
37
  Zobacz konkretne porównanie z i18next w naszym wpisie na blogu [next-i18next vs. next-intl vs. Intlayer](https://github.com/aymericzip/intlayer/blob/main/docs/blog/pl/next-i18next_vs_next-intl_vs_intlayer.md).
35
38
 
@@ -40,18 +43,19 @@ Chociaż Intlayer zapewnia doskonałe, samodzielne rozwiązanie i18n (zobacz nas
40
43
  1. **Istniejąca baza kodu**: Masz już wdrożoną implementację i18next i chcesz stopniowo przejść na ulepszone doświadczenie deweloperskie Intlayer.
41
44
  2. **Wymagania dotyczące kompatybilności wstecznej**: Twój projekt wymaga zgodności z istniejącymi wtyczkami lub procesami i18next.
42
45
  3. **Znajomość zespołu**: Twój zespół dobrze zna i18next, ale chce lepszego zarządzania treścią.
46
+ 4. **Korzystanie z funkcji Intlayer**: Chcesz używać funkcji Intlayer, takich jak deklaracja treści, zarządzanie kluczami tłumaczeń, status tłumaczeń i inne.
43
47
 
44
- **W tym celu Intlayer może być zaimplementowany jako adapter dla i18next, aby pomóc w automatyzacji tłumaczeń JSON w CLI lub pipeline'ach CI/CD, testowaniu tłumaczeń i nie tylko.**
48
+ **W tym celu Intlayer może być zaimplementowany jako adapter dla i18next, aby pomóc w automatyzacji tłumaczeń JSON w CLI lub pipelineach CI/CD, testowaniu tłumaczeń i nie tylko.**
45
49
 
46
- Ten przewodnik pokazuje, jak wykorzystać zaawansowany system deklaracji treści Intlayer, jednocześnie zachowując kompatybilność z i18next.
50
+ Ten przewodnik pokazuje, jak wykorzystać zaawansowany system deklaracji treści Intlayer, zachowując jednocześnie kompatybilność z i18next.
47
51
 
48
52
  ## Spis treści
49
53
 
50
54
  <TOC/>
51
55
 
52
- ## Przewodnik krok po kroku, jak skonfigurować Intlayer z i18next
56
+ ## Przewodnik krok po kroku: Konfiguracja Intlayer z i18next
53
57
 
54
- ### Krok 1: Zainstaluj zależności
58
+ ### Krok 1: Instalacja zależności
55
59
 
56
60
  Zainstaluj niezbędne pakiety:
57
61
 
@@ -67,6 +71,10 @@ pnpm add intlayer @intlayer/sync-json-plugin
67
71
  yarn add intlayer @intlayer/sync-json-plugin
68
72
  ```
69
73
 
74
+ ```bash packageManager="bun"
75
+ bun add intlayer @intlayer/sync-json-plugin
76
+ ```
77
+
70
78
  **Opis pakietów:**
71
79
 
72
80
  - **intlayer**: Podstawowa biblioteka do zarządzania internacjonalizacją, deklaracji treści i budowania
@@ -89,7 +97,7 @@ const config: IntlayerConfig = {
89
97
  },
90
98
  plugins: [
91
99
  syncJSON({
92
- source: ({ key, locale }) => `./intl/messages/${locale}/${key}.json`,
100
+ source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
93
101
  }),
94
102
  ],
95
103
  };
@@ -102,10 +110,55 @@ Wtyczka `syncJSON` automatycznie opakuje JSON. Będzie odczytywać i zapisywać
102
110
  Jeśli chcesz, aby JSON współistniał z plikami deklaracji treści Intlayer (`.content`), Intlayer postąpi w następujący sposób:
103
111
 
104
112
  1. załaduje zarówno pliki JSON, jak i pliki deklaracji treści, a następnie przekształci je w słownik Intlayer.
105
- 2. jeśli wystąpią konflikty między plikami JSON a plikami deklaracji treści, Intlayer przeprowadzi scalanie wszystkich słowników. W zależności od priorytetu wtyczek oraz pliku deklaracji treści (wszystko jest konfigurowalne).
113
+ 2. jeśli wystąpią konflikty między plikami JSON a plikami deklaracji treści, Intlayer połączy wszystkie słowniki. W zależności od priorytetu wtyczek oraz pliku deklaracji treści (wszystko jest konfigurowalne).
106
114
 
107
115
  Jeśli zmiany zostaną wprowadzone za pomocą CLI do tłumaczenia JSON lub za pomocą CMS, Intlayer zaktualizuje plik JSON o nowe tłumaczenia.
108
116
 
117
+ Aby zobaczyć więcej szczegółów dotyczących wtyczki `syncJSON`, proszę zapoznać się z [dokumentacją wtyczki syncJSON](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pl/plugins/sync-json.md).
118
+
119
+ ### (Opcjonalny) Krok 3: Implementacja tłumaczeń JSON na poziomie komponentów
120
+
121
+ Domyślnie Intlayer załaduje, połączy i zsynchronizuje zarówno pliki JSON, jak i pliki deklaracji treści. Zobacz [dokumentację deklaracji treści](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pl/dictionary/content_file.md) po więcej szczegółów. Jednak jeśli wolisz, używając wtyczki Intlayer, możesz również zaimplementować zarządzanie tłumaczeniami JSON na poziomie poszczególnych komponentów, zlokalizowanych w dowolnym miejscu w Twojej bazie kodu.
122
+
123
+ Do tego możesz użyć wtyczki `loadJSON`.
124
+
125
+ ```ts fileName="intlayer.config.ts"
126
+ import { Locales, type IntlayerConfig } from "intlayer";
127
+ import { loadJSON, syncJSON } from "@intlayer/sync-json-plugin";
128
+
129
+ const config: IntlayerConfig = {
130
+ internationalization: {
131
+ locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
132
+ defaultLocale: Locales.ENGLISH,
133
+ },
134
+
135
+ // Synchronizuj swoje obecne pliki JSON ze słownikami Intlayer
136
+ plugins: [
137
+ /**
138
+ * Załaduje wszystkie pliki JSON w katalogu src, które pasują do wzoru {key}.i18n.json
139
+ */
140
+ loadJSON({
141
+ source: ({ key }) => `./src/**/${key}.i18n.json`,
142
+ locale: Locales.ENGLISH,
143
+ priority: 1, // Zapewnia, że te pliki JSON mają wyższy priorytet niż pliki w `./locales/en/${key}.json`
144
+ }),
145
+ /**
146
+ * Załaduje oraz zapisze wynik i tłumaczenia z powrotem do plików JSON w katalogu locales
147
+ */
148
+ syncJSON({
149
+ source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
150
+ priority: 0,
151
+ }),
152
+ ],
153
+ };
154
+
155
+ export default config;
156
+ ```
157
+
158
+ To spowoduje załadowanie wszystkich plików JSON w katalogu `src`, które pasują do wzoru `{key}.i18n.json` i załaduje je jako słowniki Intlayer.
159
+
160
+ ---
161
+
109
162
  ## Konfiguracja Git
110
163
 
111
164
  Zaleca się ignorowanie automatycznie generowanych plików Intlayer:
@@ -119,8 +172,6 @@ Te pliki mogą być ponownie wygenerowane podczas procesu budowania i nie muszą
119
172
 
120
173
  ### Rozszerzenie VS Code
121
174
 
122
- Dla lepszego doświadczenia deweloperskiego zainstaluj oficjalne **rozszerzenie Intlayer dla VS Code**:
175
+ Dla lepszego doświadczenia programistycznego zainstaluj oficjalne **rozszerzenie Intlayer dla VS Code**:
123
176
 
124
177
  [Zainstaluj z Marketplace VS Code](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
125
-
126
- [Zainstaluj z VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)