From b7e195a7e6edfb3932af44c780e243cc46ae915b Mon Sep 17 00:00:00 2001 From: pku-xht Date: Wed, 19 Aug 2026 03:01:11 +0800 Subject: [PATCH] fix(i18n): align translation briefing link rules --- scripts/translation-brief.spec.ts | 6 ++++-- scripts/translation-brief.ts | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/translation-brief.spec.ts b/scripts/translation-brief.spec.ts index b0458c387f..85a49a0179 100644 --- a/scripts/translation-brief.spec.ts +++ b/scripts/translation-brief.spec.ts @@ -215,7 +215,8 @@ describe('brief rendering', () => { expect(brief).toContain('## First-occurrence notes') expect(brief).toContain('agent(智能体)') expect(brief).toContain('首次出现 annotations attach to the document-wide first occurrence only') - expect(brief).toContain('use an existing `.zh.md` sibling for Chinese') + expect(brief).toContain('targets in the active bilingual corpus use `.zh.md` for Chinese') + expect(brief).toContain('a missing in-scope counterpart is an error') expect(brief).toContain('verify-translation-pairing --write docs/foo.md') }) @@ -267,7 +268,8 @@ describe('brief rendering', () => { scope: { kind: 'units', bundles: [bundle], firstOccurrenceNotes: [] }, }) expect(brief).toContain('exactly what the new Chinese states') - expect(brief).toContain('use the `.md` sibling for English when a pair exists') + expect(brief).toContain('targets in the active bilingual corpus use `.md` for English') + expect(brief).toContain('targets outside the corpus keep the authored path') expect(brief).toContain('verify-translation-pairing --write docs/foo.md') }) diff --git a/scripts/translation-brief.ts b/scripts/translation-brief.ts index 0cb7f12a77..1c76bccc31 100644 --- a/scripts/translation-brief.ts +++ b/scripts/translation-brief.ts @@ -386,7 +386,7 @@ const ZH_TARGET_DIGEST = [ '- Nothing added, nothing dropped: the Chinese must state exactly what the new English states.', '- Write natural institutional technical Chinese, not word-by-word gloss; terse stays terse.', '- Code fences byte-identical to the English side, comments included; inline code spans verbatim.', - '- Repository-relative document links keep the same semantic target and exact query/fragment; use an existing `.zh.md` sibling for Chinese, otherwise keep the original target. The switcher remains the cross-locale exception.', + '- Repository-relative document links keep the same semantic target and exact query/fragment; targets in the active bilingual corpus use `.zh.md` for Chinese, a missing in-scope counterpart is an error, and targets outside the corpus keep the authored path. The switcher remains the cross-locale exception.', '- Structure mirrors the counterpart: heading depths and order, list kinds and item counts, table rows and columns.', '- 首次出现 annotations attach to the document-wide first occurrence only; later occurrences use the bare form, and an empty 首次出现 cell means never gloss.', '- Typography: one half-width space between Chinese and Latin or digits; full-width punctuation in Chinese prose; 顿号 for enumerations; second person is 你.', @@ -398,7 +398,7 @@ const EN_TARGET_DIGEST = [ '- Nothing added, nothing dropped: the English must state exactly what the new Chinese states.', '- Write concise professional developer prose, not word-by-word gloss; terse stays terse.', '- Code fences byte-identical to the Chinese side, comments included; inline code spans verbatim.', - '- Repository-relative document links keep the same semantic target and exact query/fragment; use the `.md` sibling for English when a pair exists, otherwise keep the original target. The switcher remains the cross-locale exception.', + '- Repository-relative document links keep the same semantic target and exact query/fragment; targets in the active bilingual corpus use `.md` for English, a missing in-scope counterpart is an error, and targets outside the corpus keep the authored path. The switcher remains the cross-locale exception.', '- Structure mirrors the counterpart: heading depths and order, list kinds and item counts, table rows and columns.', '- One physical line per paragraph; exactly one trailing newline.', ]