|
|
@@ -10,9 +10,11 @@ GitHub resolves repository Markdown links directly, without the documentation we
|
|
|
|
|
|
## Decision
|
|
|
|
|
|
-A repository-relative document link follows the source file's locale when the target has an English/Chinese sibling pair: English sources use the target `.md`, and Chinese sources use its `.zh.md`. Both sides retain the same semantic target and exact query/fragment suffix. External URLs, images, pure in-page fragments, and targets without a Chinese sibling remain unchanged. The language switcher is the explicit cross-locale exception.
|
|
|
+A repository-relative document link follows the source file's locale when the target belongs to the active bilingual corpus: English sources use the target `.md`, and Chinese sources use its `.zh.md`. Both sides retain the same semantic target and exact query/fragment suffix. A missing counterpart in that corpus is a pair-completeness error rather than a fallback; external URLs, images, pure in-page fragments, and targets outside the corpus remain unchanged. The language switcher is the explicit cross-locale exception.
|
|
|
|
|
|
-The pairing core resolves relative paths against the repository tree, including extensionless and directory-index aliases, and normalizes paired locale paths to one English-sibling identity for structural comparison. `verify-translation-pairing` separately rejects a wrong-locale target with the source file, line, actual URL, and expected URL. The merge driver and mechanical translation briefing use the same semantic comparison, so they accept locale-correct path differences without weakening any other structural requirement.
|
|
|
+Page-navigation links whose intended target is a tutorial landing page name `index.md` or `index.zh.md` explicitly, so GitHub opens the page rather than a directory listing. The audited basic, framework, and practice entries use those concrete targets; ordinary package, source, example, and manifest directory references remain valid, and no generic directory-link prohibition exists.
|
|
|
+
|
|
|
+The pairing core resolves relative paths against the repository tree, applies the active-scope and manifest-exclusion predicate, and normalizes paired locale paths to one English-sibling identity for structural comparison. `verify-translation-pairing` separately rejects a wrong-locale target with the source file, line, actual URL, and expected URL. The merge driver, mechanical translation briefing, and Cordis generator use the same scope predicate and semantic comparison, so they accept locale-correct path differences without weakening any other structural requirement.
|
|
|
|
|
|
The Cordis subsystem-region generator renders one catalog model, then projects paired document destinations for the Chinese output. Generated-region comparison normalizes only these paired locale paths; markers, prose, ordering, code, non-document URLs, and query/fragment suffixes remain byte-equal.
|
|
|
|
|
|
@@ -20,7 +22,7 @@ Existing active bilingual sources use the locale-correct target. A Chinese targe
|
|
|
|
|
|
## Verification
|
|
|
|
|
|
-Pairing tests cover English and Chinese locale selection, targets without a sibling, switcher exclusion, exact query/fragment retention, directory-index resolution, definitions, rewrites, and diagnostics. Merge-driver, translation-brief, Cordis generator, and documentation-site tests cover their respective consumers. Corpus checks require zero wrong-locale links, resolvable fragments, fresh generated regions, current pair records, and a successful documentation-site build.
|
|
|
+Pairing tests cover English and Chinese locale selection, out-of-scope targets with siblings, in-scope targets missing a counterpart, switcher exclusion, exact query/fragment retention, directory-index resolution, definitions, rewrites, and diagnostics. Documentation-site tests also pin the audited basic, framework, and practice entry links to explicit index pages in both locales. Merge-driver, translation-brief, and Cordis generator tests cover their respective consumers. Corpus checks require zero wrong-locale links, resolvable fragments, fresh generated regions, current pair records, and a successful documentation-site build.
|
|
|
|
|
|
## Alternatives considered
|
|
|
|
|
|
@@ -28,10 +30,10 @@ Pairing tests cover English and Chinese locale selection, targets without a sibl
|
|
|
|
|
|
**Use translated heading fragments.** Locale-specific fragments require each link producer to know a translated heading and create a second mapping whose lifecycle can drift. One shared suffix plus an explicit target alias keeps the stable identifier with the target document.
|
|
|
|
|
|
-**Maintain a locale-link manifest.** The file naming convention and repository tree already determine the target sibling. A second registry would duplicate identity and require updates for every move or new pair.
|
|
|
+**Maintain a locale-link manifest.** Pairing discovery, the exclusions-only manifest, and the sibling naming convention already determine whether a target belongs to the corpus and which paths form its pair. A second registry would duplicate identity and require updates for every move or new pair.
|
|
|
|
|
|
**Rewrite links only during publication.** The website already does this, but GitHub and other repository renderers consume the source files directly. Correct source paths are the user-visible behavior.
|
|
|
|
|
|
## Consequences
|
|
|
|
|
|
-GitHub readers remain in the language they selected when a translated target exists, and future regressions fail in the same corpus-wide pairing check that owns bilingual structure. Pair sides intentionally differ in paired document path spelling, while every other link property stays aligned. Stable English fragment aliases add small permanent identifiers to translated targets, and generators that own both outputs must project locale paths before recording the pair.
|
|
|
+GitHub readers remain in the language they selected when a target belongs to the active bilingual corpus, and future regressions fail in the same corpus-wide pairing check that owns bilingual structure. Pair sides intentionally differ in paired document path spelling, while every other link property stays aligned. Stable English fragment aliases add small permanent identifiers to translated targets, and generators that own both outputs must project locale paths before recording the pair.
|