From d099062cc71bb806701efe07e995ef1643f005b4 Mon Sep 17 00:00:00 2001 From: JK Date: Sat, 24 Jan 2026 02:20:08 +0900 Subject: [PATCH 1/4] =?UTF-8?q?feat(confluence-mdx):=20=ED=95=9C=EA=B5=AD?= =?UTF-8?q?=EC=96=B4=20commit=20=EB=B3=80=EA=B2=BD=EC=82=AC=ED=95=AD?= =?UTF-8?q?=EC=9D=84=20=EC=98=81=EC=96=B4/=EC=9D=BC=EB=B3=B8=EC=96=B4?= =?UTF-8?q?=EC=97=90=20=EB=8F=99=EA=B8=B0=ED=99=94=ED=95=98=EB=8A=94=20?= =?UTF-8?q?=EB=8F=84=EA=B5=AC=EB=A5=BC=20=EC=B6=94=EA=B0=80=ED=95=A9?= =?UTF-8?q?=EB=8B=88=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - sync_ko_commit.py: 한국어 MDX commit의 변경사항을 영어/일본어 파일에 동기화 - 워크플로우: commit 분석 → 라인 덮어쓰기 → git diff 생성 → LLM 번역 - 한국어 변경 라인을 영어/일본어 파일의 같은 위치에 복사 - git diff를 통해 번역이 필요한 부분 식별 (마커 불필요) - dry-run 모드로 미리보기 지원 Co-Authored-By: Claude Opus 4.5 --- confluence-mdx/bin/sync_ko_commit.py | 326 +++++++++++++++++++++++++++ 1 file changed, 326 insertions(+) create mode 100755 confluence-mdx/bin/sync_ko_commit.py diff --git a/confluence-mdx/bin/sync_ko_commit.py b/confluence-mdx/bin/sync_ko_commit.py new file mode 100755 index 00000000..9e2bbfe2 --- /dev/null +++ b/confluence-mdx/bin/sync_ko_commit.py @@ -0,0 +1,326 @@ +#!/usr/bin/env python3 +""" +한국어 MDX 변경사항을 영어/일본어에 동기화하는 도구 + +## 배경 + +- 한국어 MDX는 Confluence XHTML에서 자동 변환됨 +- 영어/일본어 MDX는 한국어를 번역한 것 +- 한국어에 기술적 변경(이미지 태그, 테이블 속성 등)이 발생하면 영어/일본어도 동기화 필요 + +## 목표 + +한국어 commit의 변경사항을 영어/일본어 문서에 자동으로 동기화 + +## 워크플로우 + +``` +┌─────────────────────────────────────────────────────────────────┐ +│ Step 1: 한국어 commit 분석 │ +│ │ +│ 입력: commit hash (예: ae93da7e) │ +│ 출력: 변경된 파일 목록, 각 파일의 변경된 라인 번호 │ +└─────────────────────────────────────────────────────────────────┘ + │ + ▼ +┌─────────────────────────────────────────────────────────────────┐ +│ Step 2: 영어/일본어 파일에 한국어 라인 덮어쓰기 │ +│ │ +│ - ko 파일의 변경된 라인을 en/ja 파일의 같은 위치에 복사 │ +│ - working directory에만 적용 (commit하지 않음) │ +└─────────────────────────────────────────────────────────────────┘ + │ + ▼ +┌─────────────────────────────────────────────────────────────────┐ +│ Step 3: git diff로 번역 대상 식별 │ +│ │ +│ - git diff로 변경 전/후 비교 │ +│ - (-) 라인: 기존 영어/일본어 (번역 참고용) │ +│ - (+) 라인: 덮어쓴 한국어 (번역 대상) │ +│ - 컨텍스트: 주변 라인 │ +└─────────────────────────────────────────────────────────────────┘ + │ + ▼ +┌─────────────────────────────────────────────────────────────────┐ +│ Step 4: LLM 번역 │ +│ │ +│ - diff를 LLM에게 전달 │ +│ - (+) 라인의 한국어를 영어/일본어로 번역 │ +│ - 구조(태그, 속성, 경로)는 유지, 텍스트만 번역 │ +│ - translation.md 가이드 적용 │ +└─────────────────────────────────────────────────────────────────┘ + │ + ▼ +┌─────────────────────────────────────────────────────────────────┐ +│ Step 5: 번역 결과 적용 및 검증 │ +│ │ +│ - 번역된 라인으로 파일 업데이트 │ +│ - mdx_to_skeleton.py로 구조 일치 확인 │ +│ - npm run build로 빌드 확인 │ +└─────────────────────────────────────────────────────────────────┘ +``` + +## 사용법 + +```bash +# 기본 사용법 +$ python bin/sync_ko_commit.py ae93da7e + +# dry-run (미리보기) +$ python bin/sync_ko_commit.py ae93da7e --dry-run + +# 특정 언어만 +$ python bin/sync_ko_commit.py ae93da7e --lang en + +# 검증 +$ cd confluence-mdx && bin/mdx_to_skeleton.py --recursive --max-diff=10 +``` + +## 제약사항 및 가정 + +1. 라인 번호 일치: ko/en/ja 파일의 구조가 동일하다고 가정 +2. skeleton 일치: 동기화 전 skeleton이 일치해야 함 (번역 완료 상태) +3. LLM 번역 품질: translation.md 가이드로 품질 보장 +""" + +import argparse +import subprocess +import sys +from pathlib import Path +from dataclasses import dataclass +from typing import List, Dict, Tuple, Optional + + +@dataclass +class LineChange: + """변경된 라인 정보""" + line_number: int + old_content: Optional[str] # 삭제된 라인 (None if added) + new_content: Optional[str] # 추가된 라인 (None if deleted) + + +@dataclass +class FileChange: + """파일별 변경 정보""" + ko_path: str + changes: List[LineChange] + + +def get_repo_root() -> Path: + """git 저장소 루트 경로 반환""" + result = subprocess.run( + ['git', 'rev-parse', '--show-toplevel'], + capture_output=True, text=True, check=True + ) + return Path(result.stdout.strip()) + + +def get_commit_files(commit_hash: str) -> List[str]: + """commit에서 변경된 ko 파일 목록 추출""" + result = subprocess.run( + ['git', 'show', '--name-only', '--pretty=format:', commit_hash], + capture_output=True, text=True, check=True + ) + files = [f.strip() for f in result.stdout.strip().split('\n') if f.strip()] + # ko 파일만 필터링 + ko_files = [f for f in files if f.startswith('src/content/ko/') and f.endswith('.mdx')] + return ko_files + + +def parse_commit_diff(commit_hash: str, file_path: str) -> List[LineChange]: + """commit의 특정 파일 diff를 파싱하여 변경된 라인 정보 추출""" + result = subprocess.run( + ['git', 'show', '--unified=0', commit_hash, '--', file_path], + capture_output=True, text=True, check=True + ) + + changes = [] + current_line = 0 + + for line in result.stdout.split('\n'): + # @@ -old_start,old_count +new_start,new_count @@ 형식 파싱 + if line.startswith('@@'): + # +new_start 추출 + parts = line.split('+') + if len(parts) >= 2: + new_part = parts[1].split()[0] + if ',' in new_part: + current_line = int(new_part.split(',')[0]) + else: + current_line = int(new_part) + elif line.startswith('+') and not line.startswith('+++'): + # 추가된 라인 + changes.append(LineChange( + line_number=current_line, + old_content=None, + new_content=line[1:] # '+' 제거 + )) + current_line += 1 + elif line.startswith('-') and not line.startswith('---'): + # 삭제된 라인은 old_content로 기록 (라인 번호는 new 기준이므로 별도 처리) + pass + + return changes + + +def get_target_path(ko_path: str, lang: str) -> str: + """ko 경로를 en/ja 경로로 변환""" + return ko_path.replace('/ko/', f'/{lang}/') + + +def read_file_lines(file_path: Path) -> List[str]: + """파일을 라인 단위로 읽기""" + with open(file_path, 'r', encoding='utf-8') as f: + return f.readlines() + + +def write_file_lines(file_path: Path, lines: List[str]): + """라인 단위로 파일 쓰기""" + with open(file_path, 'w', encoding='utf-8') as f: + f.writelines(lines) + + +def overwrite_lines(ko_path: Path, target_path: Path, changes: List[LineChange], dry_run: bool = True) -> List[Tuple[int, str, str]]: + """ + ko 파일의 변경된 라인을 target 파일에 덮어쓰기 + + Returns: + List of (line_number, old_content, new_content) tuples + """ + if not target_path.exists(): + print(f" Warning: Target file does not exist: {target_path}") + return [] + + ko_lines = read_file_lines(ko_path) + target_lines = read_file_lines(target_path) + + overwrites = [] + + for change in changes: + line_idx = change.line_number - 1 # 0-based index + + if line_idx < 0 or line_idx >= len(ko_lines): + continue + if line_idx >= len(target_lines): + continue + + ko_line = ko_lines[line_idx] + target_line = target_lines[line_idx] + + if ko_line != target_line: + overwrites.append((change.line_number, target_line.rstrip('\n'), ko_line.rstrip('\n'))) + if not dry_run: + target_lines[line_idx] = ko_line + + if not dry_run and overwrites: + write_file_lines(target_path, target_lines) + + return overwrites + + +def generate_diff(target_path: Path) -> str: + """working directory의 변경사항에 대한 diff 생성""" + result = subprocess.run( + ['git', 'diff', '--unified=3', '--', str(target_path)], + capture_output=True, text=True + ) + return result.stdout + + +def analyze_commit(commit_hash: str) -> List[FileChange]: + """commit 분석하여 파일별 변경 정보 추출""" + ko_files = get_commit_files(commit_hash) + + file_changes = [] + for ko_file in ko_files: + changes = parse_commit_diff(commit_hash, ko_file) + if changes: + file_changes.append(FileChange(ko_path=ko_file, changes=changes)) + + return file_changes + + +def main(): + parser = argparse.ArgumentParser( + description='한국어 MDX 변경사항을 영어/일본어에 동기화' + ) + parser.add_argument('commit', help='동기화할 한국어 commit hash') + parser.add_argument('--lang', choices=['en', 'ja', 'all'], default='all', + help='대상 언어 (기본값: all)') + parser.add_argument('--dry-run', action='store_true', + help='실제 변경 없이 미리보기만') + parser.add_argument('--show-diff', action='store_true', + help='덮어쓰기 후 git diff 출력') + + args = parser.parse_args() + + repo_root = get_repo_root() + + # Step 1: commit 분석 + print(f"Analyzing commit {args.commit}...") + file_changes = analyze_commit(args.commit) + + if not file_changes: + print("No ko MDX files changed in this commit.") + return + + print(f"Found {len(file_changes)} changed ko files") + + # 대상 언어 결정 + target_langs = ['en', 'ja'] if args.lang == 'all' else [args.lang] + + # Step 2 & 3: 각 언어별로 덮어쓰기 및 diff 생성 + for lang in target_langs: + print(f"\n=== Processing {lang} ===") + + all_diffs = [] + + for fc in file_changes: + ko_path = repo_root / fc.ko_path + target_path = repo_root / get_target_path(fc.ko_path, lang) + + print(f"\n{fc.ko_path} -> {get_target_path(fc.ko_path, lang)}") + + # 덮어쓰기 + overwrites = overwrite_lines(ko_path, target_path, fc.changes, dry_run=args.dry_run) + + if overwrites: + print(f" {len(overwrites)} lines to overwrite:") + for line_num, old, new in overwrites[:5]: # 처음 5개만 표시 + print(f" Line {line_num}:") + print(f" - {old[:60]}{'...' if len(old) > 60 else ''}") + print(f" + {new[:60]}{'...' if len(new) > 60 else ''}") + if len(overwrites) > 5: + print(f" ... and {len(overwrites) - 5} more") + + # diff 생성 + if args.show_diff and not args.dry_run: + diff = generate_diff(target_path) + if diff: + all_diffs.append((target_path, diff)) + else: + print(" No changes needed (lines already match or file missing)") + + # diff 출력 + if args.show_diff and all_diffs: + print(f"\n=== Git diff for {lang} ===") + for path, diff in all_diffs: + print(f"\n--- {path} ---") + print(diff) + + # 안내 메시지 + if args.dry_run: + print("\n[Dry run] No files were modified.") + print("Run without --dry-run to apply changes.") + else: + print("\n[Done] Files have been modified in working directory.") + print("Next steps:") + print(" 1. Review changes: git diff src/content/en src/content/ja") + print(" 2. Translate Korean text in changed lines to English/Japanese") + print(" 3. Verify: cd confluence-mdx && bin/mdx_to_skeleton.py --recursive --max-diff=10") + print(" 4. Build: npm run build") + print(" 5. Commit: git add src/content/en src/content/ja && git commit") + + +if __name__ == '__main__': + main() From 7a6bcdb1dce0a02f1b70ad9b3198d4acd64bde4d Mon Sep 17 00:00:00 2001 From: JK Date: Sat, 24 Jan 2026 02:39:46 +0900 Subject: [PATCH 2/4] =?UTF-8?q?feat(confluence-mdx):=20git=20diff=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EA=B8=B0=EC=A1=B4=20alt=20=ED=85=8D=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=EB=A5=BC=20=EB=B3=B5=EC=9B=90=ED=95=98=EB=8A=94=20?= =?UTF-8?q?=EB=8F=84=EA=B5=AC=EB=A5=BC=20=EC=B6=94=EA=B0=80=ED=95=A9?= =?UTF-8?q?=EB=8B=88=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - restore_alt_from_diff.py: 한국어 덮어쓰기 후 기존 영어/일본어 alt 텍스트 복원 - sync_ko_commit.py와 함께 사용하여 번역 텍스트 보존 Co-Authored-By: Claude Opus 4.5 --- confluence-mdx/bin/restore_alt_from_diff.py | 152 ++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100755 confluence-mdx/bin/restore_alt_from_diff.py diff --git a/confluence-mdx/bin/restore_alt_from_diff.py b/confluence-mdx/bin/restore_alt_from_diff.py new file mode 100755 index 00000000..331970ec --- /dev/null +++ b/confluence-mdx/bin/restore_alt_from_diff.py @@ -0,0 +1,152 @@ +#!/usr/bin/env python3 +""" +git diff에서 기존 alt 텍스트를 추출하여 덮어쓴 파일에 복원 + +사용법: + python bin/restore_alt_from_diff.py --dry-run + python bin/restore_alt_from_diff.py --apply +""" + +import re +import subprocess +import sys +from pathlib import Path +from typing import Dict, List, Tuple + + +def get_diff_for_lang(lang: str) -> str: + """특정 언어의 git diff 가져오기""" + result = subprocess.run( + ['git', 'diff', f'src/content/{lang}/'], + capture_output=True, text=True + ) + return result.stdout + + +def parse_diff_for_alt_mapping(diff_content: str) -> Dict[str, Dict[str, str]]: + """ + diff에서 파일별 이미지 경로 → 기존 alt 텍스트 매핑 추출 + + Returns: + {file_path: {image_path: original_alt_text}} + """ + file_mappings = {} + current_file = None + + lines = diff_content.split('\n') + i = 0 + + while i < len(lines): + line = lines[i] + + # 파일 경로 추출 + if line.startswith('--- a/'): + current_file = line[6:] + if current_file not in file_mappings: + file_mappings[current_file] = {} + + # 삭제된 라인 (기존 Markdown 이미지) + elif line.startswith('-') and not line.startswith('---'): + # ![alt](path) 패턴 찾기 + match = re.search(r'!\[([^\]]*)\]\(([^)]+)\)', line) + if match and current_file: + alt_text = match.group(1) + img_path = match.group(2) + file_mappings[current_file][img_path] = alt_text + + i += 1 + + return file_mappings + + +def restore_alt_in_file(file_path: Path, alt_mapping: Dict[str, str], dry_run: bool = True) -> List[Tuple[int, str, str]]: + """ + 파일에서 한국어 alt를 기존 번역으로 복원 + + Returns: + List of (line_number, before, after) tuples + """ + content = file_path.read_text(encoding='utf-8') + lines = content.split('\n') + changes = [] + + for i, line in enumerate(lines): + # ... 패턴 찾기 + match = re.search(r' 50 else ''}\"") + print(f" + alt=\"{after_alt.group(1)[:50]}{'...' if len(after_alt.group(1)) > 50 else ''}\"") + if len(changes) > 3: + print(f" ... and {len(changes) - 3} more") + + print(f"\nTotal: {total_changes} alt texts {'would be' if dry_run else ''} restored for {lang}") + + if dry_run: + print("\n[Dry run] No files were modified.") + print("Run with --apply to apply changes.") + + +if __name__ == '__main__': + main() From c70c546e4438828a872641459a6fafb91a1a595b Mon Sep 17 00:00:00 2001 From: JK Date: Sat, 24 Jan 2026 02:51:25 +0900 Subject: [PATCH 3/4] fix whitespaces by JK fix whitespaces by claude --- confluence-mdx/bin/sync_ko_commit.py | 38 ++++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/confluence-mdx/bin/sync_ko_commit.py b/confluence-mdx/bin/sync_ko_commit.py index 9e2bbfe2..03d93424 100755 --- a/confluence-mdx/bin/sync_ko_commit.py +++ b/confluence-mdx/bin/sync_ko_commit.py @@ -16,47 +16,47 @@ ``` ┌─────────────────────────────────────────────────────────────────┐ -│ Step 1: 한국어 commit 분석 │ +│ Step 1: 한국어 commit 분석 │ │ │ │ 입력: commit hash (예: ae93da7e) │ -│ 출력: 변경된 파일 목록, 각 파일의 변경된 라인 번호 │ +│ 출력: 변경된 파일 목록, 각 파일의 변경된 라인 번호 │ └─────────────────────────────────────────────────────────────────┘ │ ▼ ┌─────────────────────────────────────────────────────────────────┐ -│ Step 2: 영어/일본어 파일에 한국어 라인 덮어쓰기 │ +│ Step 2: 영어/일본어 파일에 한국어 라인 덮어쓰기 │ │ │ -│ - ko 파일의 변경된 라인을 en/ja 파일의 같은 위치에 복사 │ -│ - working directory에만 적용 (commit하지 않음) │ +│ - ko 파일의 변경된 라인을 en/ja 파일의 같은 위치에 복사 │ +│ - working directory에만 적용 (commit하지 않음) │ └─────────────────────────────────────────────────────────────────┘ │ ▼ ┌─────────────────────────────────────────────────────────────────┐ -│ Step 3: git diff로 번역 대상 식별 │ +│ Step 3: git diff로 번역 대상 식별 │ │ │ -│ - git diff로 변경 전/후 비교 │ -│ - (-) 라인: 기존 영어/일본어 (번역 참고용) │ -│ - (+) 라인: 덮어쓴 한국어 (번역 대상) │ -│ - 컨텍스트: 주변 라인 │ +│ - git diff로 변경 전/후 비교 │ +│ - (-) 라인: 기존 영어/일본어 (번역 참고용) │ +│ - (+) 라인: 덮어쓴 한국어 (번역 대상) │ +│ - 컨텍스트: 주변 라인 │ └─────────────────────────────────────────────────────────────────┘ │ ▼ ┌─────────────────────────────────────────────────────────────────┐ -│ Step 4: LLM 번역 │ +│ Step 4: LLM 번역 │ │ │ -│ - diff를 LLM에게 전달 │ -│ - (+) 라인의 한국어를 영어/일본어로 번역 │ -│ - 구조(태그, 속성, 경로)는 유지, 텍스트만 번역 │ -│ - translation.md 가이드 적용 │ +│ - diff를 LLM에게 전달 │ +│ - (+) 라인의 한국어를 영어/일본어로 번역 │ +│ - 구조(태그, 속성, 경로)는 유지, 텍스트만 번역 │ +│ - translation.md 가이드 적용 │ └─────────────────────────────────────────────────────────────────┘ │ ▼ ┌─────────────────────────────────────────────────────────────────┐ -│ Step 5: 번역 결과 적용 및 검증 │ +│ Step 5: 번역 결과 적용 및 검증 │ │ │ -│ - 번역된 라인으로 파일 업데이트 │ -│ - mdx_to_skeleton.py로 구조 일치 확인 │ -│ - npm run build로 빌드 확인 │ +│ - 번역된 라인으로 파일 업데이트 │ +│ - mdx_to_skeleton.py로 구조 일치 확인 │ +│ - npm run build로 빌드 확인 │ └─────────────────────────────────────────────────────────────────┘ ``` From 672c3924dd40feeee5b1b8c6be1cb50a7e5f1dde Mon Sep 17 00:00:00 2001 From: JK Date: Sat, 24 Jan 2026 03:07:12 +0900 Subject: [PATCH 4/4] =?UTF-8?q?docs(.claude/skills):=20=ED=95=9C=EA=B5=AD?= =?UTF-8?q?=EC=96=B4=20MDX=20=EB=8F=99=EA=B8=B0=ED=99=94=20=EB=8F=84?= =?UTF-8?q?=EA=B5=AC=20=EC=82=AC=EC=9A=A9=EB=B2=95=20skill=EC=9D=84=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=ED=95=A9=EB=8B=88=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - sync_ko_commit.py와 restore_alt_from_diff.py 사용법 문서화 - 전체 워크플로우 및 예시 포함 Co-Authored-By: Claude Opus 4.5 --- .claude/skills/sync-ko-to-en-ja.md | 125 +++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 .claude/skills/sync-ko-to-en-ja.md diff --git a/.claude/skills/sync-ko-to-en-ja.md b/.claude/skills/sync-ko-to-en-ja.md new file mode 100644 index 00000000..fe6d2da0 --- /dev/null +++ b/.claude/skills/sync-ko-to-en-ja.md @@ -0,0 +1,125 @@ +# 한국어 MDX 변경사항을 영어/일본어에 동기화 + +## 개요 + +이 skill은 한국어 MDX 문서의 구조적 변경(이미지 태그, 테이블 속성 등)을 영어/일본어 문서에 동기화하는 워크플로우를 설명합니다. + +## 배경 + +- **한국어 MDX**: Confluence XHTML에서 자동 변환됨 (원본) +- **영어/일본어 MDX**: 한국어를 번역한 것 +- **문제**: 한국어에 기술적 변경이 발생하면 영어/일본어도 동기화 필요 + +## 도구 + +### 1. sync_ko_commit.py + +한국어 커밋의 변경사항을 영어/일본어 파일에 덮어쓰는 도구입니다. + +```bash +cd confluence-mdx + +# 기본 사용법 - 한국어 커밋 변경을 en/ja에 덮어쓰기 +python3 bin/sync_ko_commit.py + +# dry-run (미리보기) +python3 bin/sync_ko_commit.py --dry-run + +# 특정 언어만 적용 +python3 bin/sync_ko_commit.py --lang en +python3 bin/sync_ko_commit.py --lang ja +``` + +### 2. restore_alt_from_diff.py + +sync_ko_commit.py 실행 후, git diff에서 기존 영어/일본어 alt 텍스트를 추출하여 복원합니다. + +```bash +cd confluence-mdx + +# 미리보기 - 어떤 alt가 복원되는지 확인 +python3 bin/restore_alt_from_diff.py --dry-run + +# 실제 적용 +python3 bin/restore_alt_from_diff.py --apply + +# 특정 언어만 +python3 bin/restore_alt_from_diff.py --apply --lang en +``` + +## 전체 워크플로우 + +### Step 1: 한국어 커밋 확인 + +```bash +# 동기화할 한국어 커밋 확인 +git log --oneline src/content/ko/ | head -10 +``` + +### Step 2: 한국어 변경을 영어/일본어에 덮어쓰기 + +```bash +cd confluence-mdx +python3 bin/sync_ko_commit.py +``` + +이 단계에서 한국어 라인이 영어/일본어 파일의 같은 위치에 복사됩니다. + +### Step 3: 기존 번역 텍스트 복원 (이미지 alt 등) + +```bash +# git diff에서 기존 alt 텍스트 복원 +python3 bin/restore_alt_from_diff.py --dry-run # 미리보기 +python3 bin/restore_alt_from_diff.py --apply # 적용 +``` + +### Step 4: 나머지 한국어 텍스트 번역 + +git diff를 확인하여 아직 한국어로 남아있는 부분을 번역합니다: + +```bash +git diff src/content/en/ +git diff src/content/ja/ +``` + +번역 시 [translation.md](/docs/translation.md) 가이드를 따릅니다. + +### Step 5: 검증 + +```bash +# Skeleton 구조 일치 확인 +cd confluence-mdx +python3 bin/mdx_to_skeleton.py --recursive --max-diff=10 + +# 빌드 확인 +cd .. +npm run build +``` + +## 예시: 이미지 태그 width 동기화 + +한국어 커밋 `ae93da7e`가 이미지 태그에 width 속성을 추가한 경우: + +```bash +# 1. 한국어 변경 덮어쓰기 +cd confluence-mdx +python3 bin/sync_ko_commit.py ae93da7e + +# 2. 기존 영어/일본어 alt 텍스트 복원 +python3 bin/restore_alt_from_diff.py --apply + +# 3. 검증 +python3 bin/mdx_to_skeleton.py --recursive --max-diff=10 +``` + +## 주의사항 + +1. **라인 번호 일치 가정**: ko/en/ja 파일의 구조가 동일해야 함 +2. **skeleton 일치 필요**: 동기화 전 skeleton이 일치해야 함 (번역 완료 상태) +3. **커밋 전 검증**: 반드시 skeleton 비교와 빌드 확인 수행 + +## 관련 문서 + +- **번역 가이드**: [docs/translation.md](/docs/translation.md) +- **Skeleton 비교**: [.claude/skills/mdx-skeleton-comparison.md](/.claude/skills/mdx-skeleton-comparison.md) +- **Confluence MDX 변환**: [.claude/skills/confluence-mdx.md](/.claude/skills/confluence-mdx.md)