Skip to content

Fix: repair 139 broken relative links across the nine translations - #72

Merged
0xLeif merged 1 commit into
mainfrom
leif/i18n-link-repair
Aug 19, 2026
Merged

Fix: repair 139 broken relative links across the nine translations#72
0xLeif merged 1 commit into
mainfrom
leif/i18n-link-repair

Conversation

@0xLeif

@0xLeif 0xLeif commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

A user reported one broken link in a translated document. A repo-wide scan found 139.

Every translated document lives in docs/i18n/, two directories below the English source it was translated from. The relative paths were carried over verbatim, so each resolved two levels too shallow:

pattern count resolved to
](docs/X.md) in all 9 README.<lang>.md 54 docs/i18n/docs/X.md
](../X) in all 9 getting_started.<lang>.md 81 docs/X instead of the repo root
](i18n/X.pt-BR.md) in 4 files 4 docs/i18n/i18n/X.pt-BR.md

Same defect class as the License badge repaired earlier, which was fixed as a single symptom rather than generalised.

Repair policy

Links follow the reader rather than being mechanically re-rooted:

  • a document that has a translation โ†’ the translated sibling, so a reader who opened the Japanese page stays in Japanese
  • code, spec and example paths โ†’ the repo root via ../../
  • releasing.md โ†’ English, because it is deliberately untranslated as an internal maintainer doc

Three defects a path scan cannot see

Independent per-language review ran after the path repair, which is how it caught one this repair introduced:

  1. The repair introduced a text/target mismatch. In English, [docs/sessions.md](docs/sessions.md) has text equal to target. Retargeting left the visible text reading docs/sessions.md while the target became sessions.<lang>.md โ€” a working link with a lying label, in all 9 files.
  2. README.ru.md had a CommonMark bug unique to Russian โ€” --- sat directly under a paragraph with no blank line, making it a setext H2 underline rather than a horizontal rule. The paragraph rendered as a giant heading and the section rule vanished.
  3. Four stale one-language index blocks (pty_architecture.{ar,es,zh-CN}.md, sessions.fr.md) listed 1 of 9 languages, sent readers to the Portuguese document, and asserted the translation itself was authoritative โ€” contradicting line 1 of the same file. The path repair had turned these into working links to the wrong place.

Measured

  • 139 broken before โ†’ 0 broken across 296 links after (22 in-document anchors, 193 relative paths, 81 external)
  • All 8 external URLs return 200, including the shields.io ruby badge whose & needed separate handling
  • All 9 translated READMEs retain their 3 badges

The checker recomputes GitHub heading slugs and was validated against two known-working English anchors before being trusted against Arabic, Devanagari, CJK and Cyrillic headings โ€” a slug function wrong about non-ASCII would silently report every translated anchor as broken.

Left open deliberately

34 of 36 translated files carry no language index at all. Only the four English sources have the 9-language block, so a reader on a translated page cannot reach a sibling language. Two independent reviewers flagged it. That is a convention decision across 36 files, not a broken link, so it is not folded into a repair.

Untranslated link text also remains in README.hi.md (7 labels) and README.ru.md (4), where every target is correct โ€” translation completeness, not link breakage.

Test Plan

  • Link scan: 0 broken across 296
  • specsync change verify passed (4 commands)
  • specsync check: lifecycle valid, 32/32 file coverage, 7440/7440 LOC coverage
  • Full suite green (611 examples, 0 failures)

CHG-0075, accepted, documentation kind, no spec change.

๐Ÿค– Generated with Claude Code

https://claude.ai/code/session_018rf59AtQmJcodUJ6vXDZNY

A user reported one broken link in a translated document. A repo-wide
scan found 139.

Every translated document lives in docs/i18n/, two directories below the
English source it was translated from, and the relative paths were carried
over verbatim, so each resolved two levels too shallow:

  54  ](docs/X.md)          in all 9 README.<lang>.md
  81  ](../X)               in all 9 getting_started.<lang>.md
   4  ](i18n/X.pt-BR.md)    stray prefix

Same defect class as the License badge repaired earlier, which was fixed
as a single symptom rather than generalised.

Links now follow the reader: a document that has a translation points at
the translated sibling, code/spec/example paths point at the repo root via
../../, and releasing.md keeps pointing at English because it is
deliberately untranslated.

Independent per-language review then caught three things a path scan
cannot see, one of them introduced by this repair:

- Retargeting left the visible text reading "docs/sessions.md" while the
  target became sessions.<lang>.md -- a working link with a lying label,
  in all 9 files. Text agrees with target again, as in English.
- README.ru.md had a CommonMark bug unique to Russian: --- sat directly
  under a paragraph, making it a setext H2 underline rather than a rule.
- Four stale one-language index blocks sent readers to the Portuguese
  document and asserted the translation itself was authoritative,
  contradicting line 1 of the same file. Removed.

Measured: 139 broken before, 0 broken across 296 links after. All 8
external URLs return 200; all 9 translated READMEs retain their 3 badges.

Left open deliberately: 34 of 36 translated files carry no language index,
so a reader on a translated page cannot reach a sibling language. That is
a convention decision across 36 files, not a broken link.

CHG-0075, accepted, documentation kind, no spec change.
@0xLeif
0xLeif merged commit 8c4203b into main Aug 19, 2026
10 checks passed
@0xLeif
0xLeif deleted the leif/i18n-link-repair branch August 19, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant