ADR: translate adr-ko/ to Korean, fix ADR-0013 slug, refine Status check
Follow-up to the bilingual-structure commit: docs/adr-ko/ now holds only Korean versions (24 files translated from English placeholders), ADR-0013 slug uses kebab-case in both folders, and the verify tool allows translated parenthetical commentary in the Status block. - Translate 24 English files in docs/adr-ko/ to Korean. The previous bilingual-structure commit had left these as English copies because their source content was already English; this commit fulfills the policy that docs/adr-ko/ contains only Korean. - Rename ADR-0013 in both adr/ and adr-ko/ from ver-verification_strategy.md to ver-verification-strategy.md (kebab-case consistency with other ADRs). - CLAUDE.md (ADR Translation Discipline): clarify that only the Status lifecycle keyword (Accepted / Proposed / Stub / Draft / Superseded by ADR-NNNN / Merged into ADR-NNNN) must match across EN and KO; parenthetical commentary and trailing list items may be translated. - tools/verify_adr_lang_pairs.py: replace byte-equal Status check with normalize_status_keyword() which strips parenthetical commentary and takes only the first non-empty line. - tests/test_verify_adr_lang_pairs.py: update existing test names, add coverage for translated parenthetical, translated trailing list, and Superseded-by-NNNN keyword equality. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -10,8 +10,10 @@ Checks:
|
||||
- every docs/adr/<X>.md has a matching docs/adr-ko/<X>.md
|
||||
- every docs/adr-ko/<X>.md has a matching docs/adr/<X>.md (no orphans)
|
||||
- title line `# ADR-NNNN:` of each pair matches the filename's NNNN
|
||||
- `## Status` block content is byte-equal (after CRLF/LF normalization)
|
||||
between EN and KO
|
||||
- `## Status` keyword (e.g., Accepted / Proposed / Superseded by ADR-NNNN)
|
||||
matches between EN and KO. Parenthetical commentary and trailing
|
||||
list items in the Status block may differ in wording (e.g., be
|
||||
translated); only the leading lifecycle keyword is compared.
|
||||
|
||||
Exit code: 0 if all OK, 1 if any mismatch.
|
||||
"""
|
||||
@@ -70,6 +72,24 @@ def extract_status_block(text: str) -> str | None:
|
||||
return "\n".join(collected).strip()
|
||||
|
||||
|
||||
def normalize_status_keyword(block: str) -> str:
|
||||
"""Reduce a Status block to its lifecycle keyword for cross-language compare.
|
||||
|
||||
Drops parenthetical commentary (which is allowed to be translated)
|
||||
and trailing list items / extra lines, then strips trailing
|
||||
punctuation. e.g.:
|
||||
'Accepted' -> 'Accepted'
|
||||
'Accepted.' -> 'Accepted'
|
||||
'Accepted (Revision 2 - foo)' -> 'Accepted'
|
||||
'Accepted (supersedes ADR-0029)' -> 'Accepted'
|
||||
'Accepted.\\n\\n- VA model: ...' -> 'Accepted'
|
||||
'Superseded by ADR-0031' -> 'Superseded by ADR-0031'
|
||||
"""
|
||||
no_parens = re.sub(r"\([^)]*\)", "", block).strip()
|
||||
first_line = next((l for l in no_parens.splitlines() if l.strip()), "")
|
||||
return first_line.strip().rstrip(".,;:").strip()
|
||||
|
||||
|
||||
def verify(root: Path) -> list[str]:
|
||||
errors: list[str] = []
|
||||
en_dir = root / "docs" / "adr"
|
||||
@@ -110,12 +130,15 @@ def verify(root: Path) -> list[str]:
|
||||
errors.append(f"{name}: EN missing `## Status` section")
|
||||
if ko_status is None:
|
||||
errors.append(f"{name}: KO missing `## Status` section")
|
||||
if en_status is not None and ko_status is not None and en_status != ko_status:
|
||||
errors.append(
|
||||
f"{name}: Status block mismatch\n"
|
||||
f" EN: {en_status!r}\n"
|
||||
f" KO: {ko_status!r}"
|
||||
)
|
||||
if en_status is not None and ko_status is not None:
|
||||
en_kw = normalize_status_keyword(en_status)
|
||||
ko_kw = normalize_status_keyword(ko_status)
|
||||
if en_kw != ko_kw:
|
||||
errors.append(
|
||||
f"{name}: Status keyword mismatch\n"
|
||||
f" EN: {en_kw!r}\n"
|
||||
f" KO: {ko_kw!r}"
|
||||
)
|
||||
|
||||
return errors
|
||||
|
||||
|
||||
Reference in New Issue
Block a user