forked from baron/baron-sso
common/locales 기반 i18n 스캐너와 문서 정리
This commit is contained in:
10
docs/i18n.md
10
docs/i18n.md
@@ -119,14 +119,18 @@ TOML에서는 `[Section]`을 사용하여 계층을 표현합니다.
|
||||
./scripts/sync_userfront_locales.sh
|
||||
```
|
||||
* 이 단계가 누락되면 루트 SoT와 UserFront 실제 표시 문구가 어긋날 수 있습니다.
|
||||
4. **React 공통 locale 레이어**:
|
||||
* React 계열 프런트(`adminfront`, `devfront`, `orgfront`)는 `common/locales/*.toml`을 공통 문구 레이어로 사용합니다.
|
||||
* 공통 key는 `ui.common.*`, `msg.common.*` 범위에만 둡니다.
|
||||
* 각 앱의 `src/locales/*.toml`은 앱 전용 문구를 유지하고, 로딩 시 `common locale -> app locale override` 순서로 merge 합니다.
|
||||
3. **CI 검증 (Verification)**:
|
||||
* **Level 1: 리소스 동기화 검사 (`template` vs `lang`)**
|
||||
* `template.toml`에 있는 모든 키가 `ko.toml`, `en.toml`에 존재하는지 재귀적으로 검사합니다.
|
||||
* `locales/*.toml`과 `common/locales/*.toml` 각각에 대해 `template.toml`에 있는 모든 키가 `ko.toml`, `en.toml`에 존재하는지 재귀적으로 검사합니다.
|
||||
* 누락 시 빌드 실패.
|
||||
* **Level 2: 코드 사용성 검사 (`code` vs `template`)**
|
||||
* 전체 프론트엔드 소스코드(`src/**/*.{ts,tsx}`, `lib/**/*.dart`)를 스캔하여 번역 함수(`t('key')`, `'key'.tr()`)에 사용된 키를 추출합니다.
|
||||
* **Missing Key**: 코드에는 있는데 `template.toml`에 없는 키를 검출하여 경고 또는 에러를 발생시킵니다.
|
||||
* **Unused Key**: `template.toml`에는 있는데 코드 어디에서도 쓰이지 않는 키를 리포트하여 정리할 수 있게 합니다.
|
||||
* **Missing Key**: 코드에는 있는데 해당 레이어의 `template.toml`에 없는 키를 검출하여 경고 또는 에러를 발생시킵니다.
|
||||
* **Unused Key**: 각 `template.toml`에는 있는데 코드 어디에서도 쓰이지 않는 키를 리포트하여 정리할 수 있게 합니다.
|
||||
|
||||
#### 5.2.3 React (Admin/Dev) 구현 가이드
|
||||
* **패키지 설치**:
|
||||
|
||||
Reference in New Issue
Block a user