@hua-labs/i18n-beginner 2.0.1 → 2.1.0-alpha.0.2
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/.turbo/turbo-build.log +1 -1
- package/DETAILED_GUIDE.md +76 -0
- package/README.md +11 -1
- package/package.json +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# @hua-labs/i18n-beginner Detailed Guide
|
|
2
|
+
|
|
3
|
+
Technical reference for integrating internationalization with minimal configuration.
|
|
4
|
+
최소한의 설정으로 다국어를 도입하기 위한 기술 명세입니다.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## English
|
|
9
|
+
|
|
10
|
+
### Functional Overview
|
|
11
|
+
- **Minimal Configuration**: Designed to work without complex loader definitions or initial state setup.
|
|
12
|
+
- **Built-in Translations**: Includes 80+ standard UI translation keys (welcome, save, cancel, etc.) for rapid development.
|
|
13
|
+
- **State Synchronization**: Integrates with standard React state patterns for language persistence.
|
|
14
|
+
|
|
15
|
+
### Implementation Guide
|
|
16
|
+
|
|
17
|
+
#### 1. Setup
|
|
18
|
+
Wrap the application root with the `SimpleI18n` provider.
|
|
19
|
+
```tsx
|
|
20
|
+
import { SimpleI18n } from '@hua-labs/i18n-beginner';
|
|
21
|
+
|
|
22
|
+
function Root() {
|
|
23
|
+
return <SimpleI18n>{/* components */}</SimpleI18n>;
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
#### 2. Component Integration
|
|
28
|
+
Access translation functions and state via the `useSimpleI18n` hook.
|
|
29
|
+
```tsx
|
|
30
|
+
const { t, language, setLanguage, toggleLanguage } = useSimpleI18n();
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Technical Customization
|
|
34
|
+
|
|
35
|
+
#### Dynamic Translation Injection
|
|
36
|
+
Add new keys or languages at runtime using the `addTranslation` utility.
|
|
37
|
+
```tsx
|
|
38
|
+
import { addTranslation } from '@hua-labs/i18n-beginner';
|
|
39
|
+
|
|
40
|
+
addTranslation('ja', 'welcome', 'ようこそ');
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
#### External Resource Loading
|
|
44
|
+
Manage translation data from external JSON or TypeScript files.
|
|
45
|
+
```tsx
|
|
46
|
+
const myTranslations = {
|
|
47
|
+
ko: { hello: '안녕' },
|
|
48
|
+
en: { hello: 'Hi' }
|
|
49
|
+
};
|
|
50
|
+
// Use with the useTranslationsFromFile hook to initialize data.
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Korean
|
|
56
|
+
|
|
57
|
+
### 기능 상세 사양
|
|
58
|
+
- **최소 설정**: 복잡한 로더 정의나 초기 상태 구성 없이 즉시 동작하도록 설계되었습니다.
|
|
59
|
+
- **표준 번역 내장**: 신속한 개발을 위해 80개 이상의 공통 UI 번역 키(환영, 저장, 취소 등)를 포함하고 있습니다.
|
|
60
|
+
- **상태 동기화**: 언어 상태 유지를 위해 표준 React 상태 관리 패턴과 연동됩니다.
|
|
61
|
+
|
|
62
|
+
### 구현 가이드
|
|
63
|
+
|
|
64
|
+
#### 1. 초기 구성
|
|
65
|
+
애플리케이션의 최상위 노드를 `SimpleI18n` 프로바이더로 감싸줍니다.
|
|
66
|
+
|
|
67
|
+
#### 2. 컴포넌트 통합
|
|
68
|
+
`useSimpleI18n` 훅을 통해 번역 함수 및 언어 상태에 접근할 수 있습니다.
|
|
69
|
+
|
|
70
|
+
### 기술적 커스텀
|
|
71
|
+
|
|
72
|
+
#### 런타임 번역 주입
|
|
73
|
+
`addTranslation` 유틸리티를 사용하여 실행 시점에 새로운 키나 언어를 추가할 수 있습니다.
|
|
74
|
+
|
|
75
|
+
#### 외부 리소스 로딩
|
|
76
|
+
외부 JSON 또는 TypeScript 파일에 정의된 번역 데이터를 관리할 수 있습니다. `useTranslationsFromFile` 훅을 사용하여 커스텀 데이터를 초기화합니다.
|
package/README.md
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
# @hua-labs/i18n-beginner
|
|
2
2
|
|
|
3
|
+
Beginner-friendly i18n SDK for React. Simple setup, no complexity.
|
|
4
|
+
초보자를 위한 React i18n SDK. 간단한 설정, 복잡함 없음.
|
|
5
|
+
|
|
6
|
+
[](https://www.npmjs.com/package/@hua-labs/i18n-beginner)
|
|
7
|
+
[](https://github.com/HUA-Labs/HUA-Labs-public/blob/main/LICENSE)
|
|
8
|
+
|
|
9
|
+
> **⚠️ Alpha Release**: This package is currently in alpha. APIs may change before the stable release.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
3
13
|
[한국어](#korean) | [English](./README_EN.md)
|
|
4
14
|
|
|
5
|
-
##
|
|
15
|
+
## 이 SDK는 초보자용입니다
|
|
6
16
|
|
|
7
17
|
> 데모 보기 | 기여는 [SDK 레포](https://github.com/HUA-Labs/HUA-Labs-public)에서
|
|
8
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hua-labs/i18n-beginner",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.1.0-alpha.0.2",
|
|
4
4
|
"description": "HUA Labs - Internationalization SDK for Beginners (Simple Setup) - Korean/English support out of the box, easy to add other languages",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"react": ">=16.8.0"
|
|
27
27
|
},
|
|
28
28
|
"keywords": [
|
|
29
|
+
"hua-labs",
|
|
29
30
|
"i18n",
|
|
30
31
|
"internationalization",
|
|
31
32
|
"localization",
|
|
@@ -35,7 +36,6 @@
|
|
|
35
36
|
"react",
|
|
36
37
|
"nextjs",
|
|
37
38
|
"typescript",
|
|
38
|
-
"korean",
|
|
39
39
|
"english",
|
|
40
40
|
"multilingual",
|
|
41
41
|
"translation"
|