claude-code-kr 0.2.1 → 0.3.0

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/README.md CHANGED
@@ -94,15 +94,17 @@ claude-code-kr/
94
94
  │ └── cc-kr.js # CLI 진입점 (cckr 명령어)
95
95
  ├── lib/
96
96
  │ ├── patcher.js # 패치 엔진 (string + regex 매칭, 마커 스킵)
97
- │ ├── mappings.js # 한글 커맨드 매핑 51
97
+ │ ├── mappings.js # 한글 커맨드 매핑 52
98
98
  │ ├── hooks.js # SessionStart hook 관리
99
+ │ ├── locales/
100
+ │ │ └── ko.json # 번역 카탈로그 (145개 정적 문자열)
99
101
  │ └── patches/
100
- │ ├── stable.js # 정적 문자열 교체 (안정)
101
102
  │ ├── fragile.js # regex backreference (변수명 독립)
102
103
  │ └── structural.js # 코드 구조 변경 (tab completion 등)
103
104
  ├── scripts/
104
105
  │ ├── postinstall.js # npm install 시 자동 패치
105
- └── preuninstall.js # npm uninstall 시 자동 복원
106
+ ├── preuninstall.js # npm uninstall 시 자동 복원
107
+ │ └── extract.js # 번들 AST 파싱 → 번역 후보 추출 (devDep)
106
108
  ├── test/
107
109
  │ └── patcher.test.js # 패치 테스트 25개
108
110
  ├── index.js # 모듈 진입점
@@ -118,13 +120,22 @@ claude-code-kr/
118
120
 
119
121
  ### 패치 구조
120
122
 
121
- `lib/patches/`는 패치를 세 계층으로 관리합니다:
123
+ 패치를 세 계층으로 관리합니다:
122
124
 
123
- | 계층 | 안정성 | 매칭 방식 | CC 업데이트 시 |
124
- |------|--------|----------|----------------|
125
- | **안정 (stable)** | 높음 | 정적 문자열 (`"Yes"` → `"네"`) | Anthropic이 영어를 바꿀 때만 깨짐 |
126
- | **가변 (fragile)** | 중간 | **regex backreference** (`/return (\w+)\?\`Reading \$\{\1\}\`/`) | 구조가 크게 바뀔 때만 깨짐 |
127
- | **구조 (structural)** | 낮음 | 큰 코드 블록 (tab completion, autocomplete) | 함수 구조 변경 시 깨짐 |
125
+ | 계층 | 저장소 | 안정성 | 매칭 방식 | CC 업데이트 시 |
126
+ |------|--------|--------|----------|----------------|
127
+ | **안정 (stable)** | `lib/locales/ko.json` | 높음 | 정적 문자열 (`"Yes"` → `"네"`) | Anthropic이 영어를 바꿀 때만 깨짐 |
128
+ | **가변 (fragile)** | `lib/patches/fragile.js` | 중간 | **regex backreference** (`/return (\w+)\?\`Reading \$\{\1\}\`/`) | 구조가 크게 바뀔 때만 깨짐 |
129
+ | **구조 (structural)** | `lib/patches/structural.js` | 낮음 | 큰 코드 블록 (tab completion, autocomplete) | 함수 구조 변경 시 깨짐 |
130
+
131
+ **안정 패치는 카탈로그 기반**: `ko.json`에 `{"english": "한글"}` 한 줄만 추가하면 끝. regex 작성 불필요.
132
+
133
+ ```json
134
+ {
135
+ "\"Do you want to proceed?\"": "\"실행할까요?\"",
136
+ "label:\"Yes\",value:\"yes\"": "label:\"네\",value:\"yes\""
137
+ }
138
+ ```
128
139
 
129
140
  **가변 패치의 핵심 — regex backreference**:
130
141
 
@@ -240,6 +251,33 @@ claude-code-kr/
240
251
  - **CC 업데이트 시 가변 패치 깨질 수 있음** — `cckr apply -v`로 확인. 안정 패치는 유지됨.
241
252
  - **한글 autocomplete** — IME 조합 중에는 자동완성이 트리거되지 않을 수 있음. 조합 완료 후 동작.
242
253
 
254
+ ## 번역 추가 워크플로우 (contributor)
255
+
256
+ 새 영어 텍스트를 발견하면:
257
+
258
+ ```bash
259
+ # 1. 번들에서 해당 텍스트 검색 (AST 컨텍스트 포함)
260
+ npm run find "Do you want"
261
+
262
+ # 출력:
263
+ # right: "Do you want to proceed?" ✓ ← 이미 번역됨
264
+ # arguments: "Do you want to allow this" ← 미번역
265
+
266
+ # 2. lib/locales/ko.json 에 번역 추가
267
+ # {
268
+ # "\"Do you want to allow this\"": "\"이 작업을 허용할까요?\""
269
+ # }
270
+
271
+ # 3. 적용
272
+ cckr apply --force
273
+ ```
274
+
275
+ 전체 후보 추출:
276
+ ```bash
277
+ npm run extract
278
+ # → lib/locales/candidates.txt 에 1000+ 후보 저장
279
+ ```
280
+
243
281
  ## 원리
244
282
 
245
283
  Claude Code의 `cli.js` 번들을 문자열 매칭으로 패치합니다:
@@ -252,7 +290,7 @@ Claude Code의 `cli.js` 번들을 문자열 매칭으로 패치합니다:
252
290
  {name:"btw", aliases:["근데"], description:"대화 흐름을 끊지 않고 사이드 질문하기"}
253
291
  ```
254
292
 
255
- - 테스트 기준: Claude Code v2.1.98
293
+ - 테스트 기준: Claude Code v2.1.98 ~ v2.1.105
256
294
 
257
295
  ## License
258
296