feat(i18n): add Simplified Chinese (/zh) versions of the whole website for Chinese indexing / 为全站新增简体中文 /zh 页面以支持中文搜索索引#523
Merged
Conversation
Every indexable page now has a hand-authored Chinese sibling under /zh so the site is crawled and indexed in Chinese as well as English: - /zh landing + 8 dashboard tabs (Chinese metadata + server-rendered SEO intro above the charts), about (incl. Chinese FAQ + FAQPage JSON-LD), quotes (all 45 supporter quotes translated), land-acknowledgement, and the compare / compare-per-dollar index pages - Chinese blog: content/blog/zh/<slug>.mdx pairs by filename; all 14 posts translated per the AGENTS.md quality bar; /zh/blog list + /zh/blog/[slug] pages; visibility gating derives from the English post - Bidirectional hreflang (en / zh-CN / x-default) on both trees via new helpers in src/lib/i18n.ts; sitemap emits EN+zh pairs; OG locale zh_CN - Locale-aware chrome: header nav + EN<->中文 toggle, dashboard TabNav labels/links, footer 中文版 link, zh 404 page, document lang fixup - Blog lib: CJK-aware reading time (400 chars/min) and Han-preserving slugify so Chinese headings get real anchor ids - AGENTS.md: new mandatory rule — every new page/tab/post ships its /zh version in the same PR; docs/i18n.md records the design rationale - Tests: i18n + tab-meta-zh unit tests, zh blog lib tests, zh-pages Cypress spec (10 tests) Not mirrored (documented): per-slug compare pages, /datasets, gated tabs, feed.xml/llms.txt; zh posts reuse the English OG image (Satori default font has no CJK glyphs). 中文:为全站新增简体中文 /zh 页面——首页、8 个仪表板标签页(中文元数据 与图表上方的服务器端中文简介)、关于页(含中文 FAQ 与 FAQPage 结构化 数据)、支持者页(45 条支持者评价全部翻译)、土地致谢页、GPU 对比索引 页,以及全部 14 篇博客文章翻译(content/blog/zh/,与英文原文按文件名 配对)。通过新的 i18n 辅助函数实现双向 hreflang,站点地图成对输出中英 URL;页眉新增 EN↔中文 切换,仪表板标签栏与页脚支持中文;博客库支持 CJK 阅读时长与中文标题锚点。AGENTS.md 新增强制规则:所有新页面、标签 页与博客文章必须在同一 PR 中提供中文版本;设计说明见 docs/i18n.md。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Round 2 of the Chinese site, addressing review feedback that /zh pages
still showed English chrome and links escaping the Chinese tree:
- Footer fully localized (client component + useLocale hook); internal
links stay under /zh; language link flips to "English" on zh pages
- New useLocale() + component-local STRINGS={en,zh} pattern applied to:
landing Quick Comparisons preset cards, TCO calculator (labels,
tooltips, toggles, table headers, chart title), inference chart
display/controls + shared selectors + disagg caveat banners,
evaluation + historical displays, reliability/gpu-specs/gpu-power/
submissions displays, all 9 nudges, MTP conflict toast, share
buttons, blog DashboardCTA. English output stays byte-identical.
- /zh/compare/[slug] + /zh/compare-per-dollar/[slug] fully mirrored:
Chinese narrative templates in compare-ssr-zh.ts (1:1 port reusing
compare-ssr.ts data helpers), localized page-clients, canonical zh
redirects, bidirectional hreflang on EN slug pages, zh index cards
now link within /zh, sitemap emits EN+zh pairs for every slug
- Cursor review fixes: gated tabs and header brand link no longer drop
the /zh prefix (localize only when a zh sibling exists)
- AGENTS.md + docs/i18n.md updated: chrome localization pattern is now
mandatory for new UI strings; compare-ssr-zh.ts sync rule added
中文:中文站第二轮改进——页脚全面本地化;通过 useLocale() 与组件内
STRINGS 字典将仪表板界面文案(计算器、推理、评估、历史趋势、可靠性、
GPU 规格、功耗、提交记录、提示弹窗、分享按钮、精选对比卡片)翻译为中
文,英文页面保持逐字节不变;新增 /zh/compare/[slug] 与
/zh/compare-per-dollar/[slug] 完整中文镜像(叙述模板位于
compare-ssr-zh.ts,与英文模板一一对应),站点地图成对输出全部对比页
URL;修复 Cursor 评审发现的两处 /zh 前缀丢失问题;AGENTS.md 新增界面
文案本地化与叙述模板同步规则。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ba03097. Configure here.
Four zh translations linked sibling posts via absolute English URLs (https://inferencex.semianalysis.com/blog/...); rewrite them to the /zh/blog/... siblings per the AGENTS.md translation rule, so readers and crawlers on the Chinese tree stay in it. Flagged by Cursor Bugbot. 中文:修复 4 篇中文博客译文中指向英文 /blog/ 绝对链接的交叉引用,改为 指向 /zh/blog/ 中文版本,使中文读者与爬虫停留在中文页面树内。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

Summary
Adds a complete Simplified Chinese sibling of the website under the
/zhroute prefix so every indexable page is crawled and indexed in Chinese as well as English, and makes the Chinese version mandatory for all future pages via AGENTS.md.New Chinese pages
//zhSTRINGSdict)/inference,/evaluation,/historical,/calculator,/reliability,/gpu-specs,/gpu-metrics,/submissions/zh/...<ZhTabIntro>) above the same interactive charts/about/zh/aboutFAQPageJSON-LD/quotes/zh/quotestextZhfield)/land-acknowledgement/zh/land-acknowledgement/compare,/compare-per-dollar/zh/compare,/zh/compare-per-dollar/compare/[slug],/compare-per-dollar/[slug]/zh/compare/[slug],/zh/compare-per-dollar/[slug]compare-ssr-zh.ts(1:1 port ofcompare-ssr.ts), canonical zh redirects, localized page-clients/blog,/blog/[slug]/zh/blog,/zh/blog/[slug]content/blog/zh/<same-slug>.mdxSEO / discovery plumbing
src/lib/i18n.ts:zhPath,enAlternates/zhAlternates(bidirectionalen/zh-CN/x-defaulthreflang on both trees),ZH_MIRRORED_ROUTES,switchLocalePathsitemap.tsemits EN+zh pairs withalternates.languages;/aboutadded to the sitemap (was missing)openGraph.locale: zh_CN, canonical to their own URL (/zh/inference→/zh, mirroring the English quirk), JSON-LDinLanguage: zh-CNdocument.documentElement.langfixup after hydrationgetAllPosts/getPostBySlug/getAdjacentPosts(zh visibility gates on the English post'spublishDate), CJK-aware reading time, Han-preservingslugifyfor Chinese heading anchorsAGENTS.md + docs
/zhversion in the same PR (missing translation = 🔴 BLOCKING); checklists for blog posts and new tabs updateddocs/i18n.mdrecords the design rationale (why hand-authored pages instead of a[locale]framework, html-lang workaround, OG-image CJK limitation, etc.)Localized UI chrome (round 2)
All shared/dashboard chrome renders in Chinese on /zh pages via a
useLocale()hook + component-localSTRINGS = { en, zh }dicts (English output stays byte-identical): footer, landing Quick Comparisons preset cards, TCO calculator (labels/tooltips/toggles/table headers/chart title), inference chart display + controls + shared selectors + disagg caveat banners, evaluation + historical displays, reliability/GPU-specs/PowerX/submissions displays, all 9 nudge popups, the MTP conflict toast, share buttons, and the blog DashboardCTA. Both Cursor review findings (gated tabs and header brand link dropping the /zh prefix) are fixed.Intentionally not mirrored (documented in AGENTS.md/docs)
/datasets, feature-gated tabs,feed.xml/llms.txt, per-post OG images (zh posts reuse the English image; thenext/ogSatori default font has no CJK glyphs), and chart-internal rendering (D3 axes/tooltips/legend series, CSV export) plus data-registry display values (model/GPU/framework/precision names), which stay English by design.Overlay-run support note
No chart-data feature is added or changed; /zh dashboard pages render the exact same chart components as the English tabs, so
?unofficialrun=overlays behave identically on both trees.Test plan
pnpm typecheck,pnpm lint,pnpm fmt— cleanpnpm test:unit— 2426 tests pass (new:i18n.test.ts,tab-meta-zh.test.tsincl. dictionary-completeness enforcement, zh blog-lib tests, CJK reading-time/slugify tests)zh-pages.cy.ts(10 tests) + existingblog.cy.ts— pass locally against the dev serverpnpm build— succeeds; all 14/zh/blog/[slug]pages + OG images statically generated中文说明
本 PR 为全站新增简体中文版本(
/zh路由前缀),使网站能够以中文被搜索引擎抓取与索引,并通过 AGENTS.md 将中文版本设为今后所有页面的强制要求。content/blog/zh/,与英文原文按文件名配对,发布时间以英文原文为准)en/zh-CN/x-default);站点地图成对输出中英 URL;中文页面设置og:locale=zh_CN与独立 canonical;页眉新增 EN↔中文 切换;博客库支持 CJK 阅读时长(每分钟 400 字)与中文标题锚点/zh中文版本,缺失翻译视为 🔴 阻塞性审查问题;设计说明见docs/i18n.md/zh/compare/[slug]、/zh/compare-per-dollar/[slug],中文叙述模板位于compare-ssr-zh.ts);页脚、仪表板界面文案(计算器、推理、评估、历史趋势、可靠性、GPU 规格、功耗、提交记录)、提示弹窗、分享按钮与精选对比卡片均通过useLocale()模式本地化,英文页面保持逐字节不变/datasets、功能门控标签页、feed.xml/llms.txt;中文文章复用英文 OG 图片(OG 渲染器默认字体不含中文字形);图表内部渲染(坐标轴/图例/悬浮提示)与数据注册表中的显示值(模型/GPU/框架/精度名称)按设计保留英文🤖 Generated with Claude Code
Note
Medium Risk
Large, cross-cutting SEO and routing surface with many translated pages to keep in sync; core benchmark paths are mostly reused, but hreflang/canonical mistakes or EN/zh content drift would affect indexing and review load.
Overview
Introduces a hand-authored Simplified Chinese site under
/zh(no i18n framework) so indexable English routes have Chinese siblings for crawlers—titles, meta, and server-rendered prose in zh-CN while interactive charts and registry names stay English.Infrastructure:
src/lib/i18n.tscentralizeszhPath, bidirectionalenAlternates/zhAlternates,ZH_MIRRORED_ROUTES, and the header EN↔中文 toggle; sitemap useslocalizedPair(); blog lib gains locale-aware listing, CJK reading time, and Han-preserving heading anchors; zh posts reuse English OG images.Content & UI: Mirrors landing, dashboard tabs (Chinese metadata +
<ZhTabIntro>), about/quotes/land-ack, compare index +compare-ssr-zh.tsslug narratives, and 14 blog posts incontent/blog/zh/. Shared chrome localizes viauseLocale()+STRINGS = { en, zh }without changing English byte-for-byte output.Process: New AGENTS.md section and
docs/i18n.mdmake/zh🔴 blocking for new pages, tabs, and blog posts; checklists for tabs and posts are updated accordingly.Reviewed by Cursor Bugbot for commit 37a4d82. Bugbot is set up for automated code reviews on this repo. Configure here.