docs: make translations best effort
Merged
KA
13d ago+109+109+012345678901234567890123456789-52-52-01234567890123456789
English docs are the source of truth. The Japanese and Chinese translations are now best effort: they may lag behind English, and a contributor never has to update a language they don't speak.
scripts/check-docs-translations.tswarns instead of failing when a translation drifts from its English page: the outline (headings,<Tab>,<Accordion>,id), a code block, or a navigation label. On GitHub Actions each warning is aStale translationannotation on the file. An outline warning says what drift costs on the site: the page gets ids of its own, so links to its anchors and the language switcher miss.- It still fails on what needs no language to fix: a translation whose English page is gone, a translation with no
title, a language with nonavigation.json.check-docs-anchors.tsis unchanged, so a renamed English anchor still means fixing the#anchorlinks to it in the translations. AGENTS.md, theauthoring-docsskill, anddocs/ja/README.md/docs/zh/README.mdsay translations are best effort. The checklist item "mirror a changed outline indocs/ja/anddocs/zh/" became "move or delete translations with their English page".- The DeepL review comments (
check-docs-translations-deepl.ts,deepl-review.ts,docs-translations.yml) no longer say the outline is guaranteed to match. A drifted page is still skipped there with a notice.
The site already copes with a stale translation (e2e-site lib/docs/remark-docs.ts: a page whose outline differs keeps its own ids; lib/docs/source.ts: a missing label falls back to English).
Verified
Ran it locally: yes
pnpm checkpasses; the translation check reports 162 of 162 pages in line.- Added a
##heading and a code block todocs/quickstart.mdxand a group todocs/docs.json, then ran the check. Exit 0, with warnings for both languages:
warning: docs/ja/quickstart.mdx: heading #8 is missing, the English page has h2 (8 vs 7 in all); until the outline matches, the site gives this page ids of its own, so links to its anchors and the language switcher miss
warning: docs/ja/quickstart.mdx: code block #17 differs from the English page's (17 vs 16 in all)
warning: docs/ja/navigation.json: no label in "groups" for "Brand new"
- The same with
GITHUB_ACTIONS=trueprints::warning file=docs/ja/quickstart.mdx::Stale translation: ...annotations. docs/ja/orphan.mdxwith no English page still exits 1.
Linear: ENG-1385