docs(i18n): keep the locale prefix on twelve links in the Chinese pages - #1599
Merged
Conversation
Twelve site-absolute `](/docs/…)` links inside `.zh-Hans.mdx` / `.zh-Hant.mdx` pages dropped the locale segment, so a Chinese reader clicking one landed silently on the English page. The docs site sets `hideLocale: 'default-locale'`, so only `/zh-Hans/docs/…` and `/zh-Hant/docs/…` open a translated page. All six link targets were checked to ship both `.zh-Hans.mdx` and `.zh-Hant.mdx` before rewriting, so no prefix turns a wrong-language landing into a 404. The links stay site-absolute — the established form here — and the English pages, which were already correct, are untouched. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018xtjdpZFjgWh4Ad9Wcx68J
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
os-steve
marked this pull request as ready for review
September 5, 2026 22:56
This was referenced Sep 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1592
Description
Twelve site-absolute links inside the translated documentation dropped the locale
segment, so a reader on a Chinese page clicked and landed silently on the English
page. The target existed, so nothing 404-ed and nothing reported it. The docs site
sets
hideLocale: 'default-locale'(apps/docs/lib/i18n.ts), so English lives at/docs/...and/zh-Hans/docs/...//zh-Hant/docs/...are the only spellingsthat open a translated page.
The links stay site-absolute — the established form here, 654 of them under
content/docsafter this change — and only gain the locale segment. The Englishpages were already correct and are untouched.
Type of Change
Changes Made
Every rewritten link, with the file the URL now resolves to. Each target was
checked to ship the page's own locale before rewriting: adding a prefix to a
target that does not ship that locale would turn a silent wrong-language landing
into a hard 404, which is strictly worse.
administration/sandbox-and-releases.zh-Hans.mdx:193/zh-Hans/docs/guides/email-and-calendarguides/email-and-calendar.zh-Hans.mdxadministration/sandbox-and-releases.zh-Hant.mdx:193/zh-Hant/docs/guides/email-and-calendarguides/email-and-calendar.zh-Hant.mdxreference/faq.zh-Hans.mdx:156/zh-Hans/docs/guides/integrationsguides/integrations.zh-Hans.mdxreference/faq.zh-Hant.mdx:156/zh-Hant/docs/guides/integrationsguides/integrations.zh-Hant.mdxsales/opportunities.zh-Hans.mdx:42/zh-Hans/docs/sales/quotessales/quotes.zh-Hans.mdxsales/opportunities.zh-Hans.mdx:44/zh-Hans/docs/analytics/dashboardsanalytics/dashboards.zh-Hans.mdxsales/opportunities.zh-Hant.mdx:42/zh-Hant/docs/sales/quotessales/quotes.zh-Hant.mdxsales/opportunities.zh-Hant.mdx:44/zh-Hant/docs/analytics/dashboardsanalytics/dashboards.zh-Hant.mdxservice/cases.zh-Hans.mdx:156/zh-Hans/docs/administration/sharing-and-securityadministration/sharing-and-security.zh-Hans.mdxservice/cases.zh-Hant.mdx:156/zh-Hant/docs/administration/sharing-and-securityadministration/sharing-and-security.zh-Hant.mdxservice/index.zh-Hans.mdx:39/zh-Hans/docs/service/casesservice/cases.zh-Hans.mdxservice/index.zh-Hant.mdx:39/zh-Hant/docs/service/casesservice/cases.zh-Hant.mdx12 of 12 targets ship the locale, so none of the twelve was left alone.
Plus
.changeset/chinese-docs-links-keep-their-locale.md. Diff: 10 files, 12insertions, 12 deletions, one line changed per link.
Measured, not recalled
Taken in this worktree at
origin/main=81a79ee, 2026-09-05T22:35Z, andre-taken after the fix at
329a881:](/docs/…)in.zh-Han{s,t}.mdx](/zh-Han{s,t}/docs/…), link occurrencesgrep -c)The card's control figure of 619 (317 + 302) is stale and is not quoted here.
⚠️ Note the two denominators are different measurements of the same tree: 642
counts link occurrences, 612 counts lines holding at least one such link (30
lines carry two or more). The numerator 12 is an occurrence count that happens
to also be 12 lines, so a
12 / 612ratio mixes the two units.Each edited line was checked mechanically to differ from its previous form by
the inserted locale segment and by nothing else — 12 line pairs, 12 prefixes
inserted, 0 mismatches.
Three-face parity was checked rather than assumed. The English face of all five
page families already spells these links correctly (
/docs/...is right for thedefault locale), so nothing here makes the three faces disagree in a new way. In
fact six of the twelve sites contradicted their own page:
reference/faq.zh-Hans.mdxlinks Integrations with the prefix on line 148 and without it on line 156.
Testing
pnpm verifychain, whole chain green in this worktree at329a881. What eachgreen actually establishes is stated, because most of them do not look at this
change at all:
pnpm validatesrc/metadatapnpm typecheck*.tspnpm lintsrc/metadatapnpm lint:i18n-gatesrc/translations/**lint issuespnpm hygienecontent/+.changeset/(its own line: "plus 460 under content, .changeset, docs, .github, .claude")pnpm hygiene:tokenssrc/**/*.tspnpm buildpnpm testcontent/docs, including these 10 files⛔ No green here is evidence that the links are correct. That was measured,
not assumed. With the defect fully restored on disk from
81a79ee(all 10 filesbyte-identical to their pre-fix blobs, verified by
git hash-objectagainst thebase blob hashes, 12 unprefixed links back on disk), the whole suite is still
green: 160 files, 3391 passed — and
pnpm hygieneis still green too. The treewas then restored to
HEADandgit diff HEADproved empty. So no gate in thisrepo can distinguish the defect from the fix, which is the card's own finding,
now measured rather than recalled.
What does stand behind the change is the per-link resolution table above: 654 of
654 prefixed links in localized pages now point at a localized page that exists
on disk (0 missing), and no English page carries a
zh-Han{s,t}prefix.Workflows this PR wakes
**/*.mdand**/*.mdx), but is configuredfile-extension: '.md', an exact match, withcheck-modified-files-only: yes.It therefore opens none of the 10
.mdxfiles and only the changeset. Itsown header records that it has no base URL and calls every site-absolute
/docs/…link dead, so a green from it is not evidence about these edits, anda red from it would be about the changeset. The changeset deliberately contains
no markdown links and no bare URLs.
content/docs/**and will build the docs app. It doesnot resolve markdown link targets.
skip-changesetlabel is needed or applied.
**.ts/.js/.mjs/.json/.yml/.yamland this diff has none of those (the changeset is
.md).main, pathsdocs/**+README.md).Scope
Exactly the 12 links plus the changeset. Two things this PR deliberately does
not do, per the seat ruling on the card:
from drifting back.
AGENTS.md§ 3. ⛔ Do not build platform-level tooling hererules it out: lint, validation, gates and diagnostics belong to the platform, and
tests here pin this repo's own business facts. A locale-prefix-on-links rule pins
no business fact of this repo. Precedent: [Decision] 要不要加一道注释量门禁?#1183 的棘轮按设计看不见 #1184 的工作,phase 2/3 目前没有仪表 #1423, where the comment-volume gate was
deliberately not built.
os lint --strictfirst, then retire the local re-implementations by family #1579 step 6 froze this family("no new docs-drift tests; no card; revisit when a platform doc-lint exists").
The candidate is recorded on Twelve links inside localized docs pages drop the locale prefix, so a Chinese reader clicking them lands on the English page #1592 for that revisit.
No
test/**file is touched. No out-of-scope defect was found while doing this:after the fix, 654 of 654 prefixed links resolve, and the only other site-absolute
paths in localized pages are three
/screenshots/...asset URLs, which arecorrectly unprefixed.
Generated by Claude Code