Skip to content

feat(i18n): add Simplified Chinese (/zh) versions of the whole website for Chinese indexing / 为全站新增简体中文 /zh 页面以支持中文搜索索引#523

Merged
functionstackx merged 3 commits into
masterfrom
feat/zh-pages
Jul 4, 2026
Merged

feat(i18n): add Simplified Chinese (/zh) versions of the whole website for Chinese indexing / 为全站新增简体中文 /zh 页面以支持中文搜索索引#523
functionstackx merged 3 commits into
masterfrom
feat/zh-pages

Conversation

@functionstackx

@functionstackx functionstackx commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a complete Simplified Chinese sibling of the website under the /zh route 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

English Chinese Content
/ /zh Fully translated landing page (shared component + STRINGS dict)
/inference, /evaluation, /historical, /calculator, /reliability, /gpu-specs, /gpu-metrics, /submissions /zh/... Chinese metadata + server-rendered Chinese SEO intro (<ZhTabIntro>) above the same interactive charts
/about /zh/about Fully translated, incl. Chinese FAQ data + FAQPage JSON-LD
/quotes /zh/quotes All 45 supporter quotes translated (textZh field)
/land-acknowledgement /zh/land-acknowledgement Fully translated
/compare, /compare-per-dollar /zh/compare, /zh/compare-per-dollar Translated index pages
/compare/[slug], /compare-per-dollar/[slug] /zh/compare/[slug], /zh/compare-per-dollar/[slug] Fully mirrored programmatic pages — Chinese narrative templates in compare-ssr-zh.ts (1:1 port of compare-ssr.ts), canonical zh redirects, localized page-clients
/blog, /blog/[slug] /zh/blog, /zh/blog/[slug] All 14 posts translated under content/blog/zh/<same-slug>.mdx

SEO / discovery plumbing

  • New src/lib/i18n.ts: zhPath, enAlternates/zhAlternates (bidirectional en/zh-CN/x-default hreflang on both trees), ZH_MIRRORED_ROUTES, switchLocalePath
  • sitemap.ts emits EN+zh pairs with alternates.languages; /about added to the sitemap (was missing)
  • zh pages set openGraph.locale: zh_CN, canonical to their own URL (/zh/inference/zh, mirroring the English quirk), JSON-LD inLanguage: zh-CN
  • Header EN↔中文 toggle + localized nav, Chinese TabNav labels/links on /zh, footer 中文版 link, zh 404 page, document.documentElement.lang fixup after hydration
  • Blog lib: locale-aware getAllPosts/getPostBySlug/getAdjacentPosts (zh visibility gates on the English post's publishDate), CJK-aware reading time, Han-preserving slugify for Chinese heading anchors

AGENTS.md + docs

  • New “Chinese Website Pages (/zh) — Mandatory for All Indexable Surfaces” section: every new page, tab, or blog post must ship its /zh version in the same PR (missing translation = 🔴 BLOCKING); checklists for blog posts and new tabs updated
  • docs/i18n.md records 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-local STRINGS = { 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; the next/og Satori 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 — clean
  • pnpm test:unit — 2426 tests pass (new: i18n.test.ts, tab-meta-zh.test.ts incl. dictionary-completeness enforcement, zh blog-lib tests, CJK reading-time/slugify tests)
  • New Cypress spec zh-pages.cy.ts (10 tests) + existing blog.cy.ts — pass locally against the dev server
  • pnpm build — succeeds; all 14 /zh/blog/[slug] pages + OG images statically generated
  • Manually verified in dev: all 25 zh pages return 200 with Chinese titles/content; hreflang pairs render on both EN and zh pages; canonicals correct; numeric integrity of translations spot-checked by diffing digit multisets against the English sources (only benign diffs from “March 6” → “3 月 6 日” style date conversion)

中文说明

本 PR 为全站新增简体中文版本(/zh 路由前缀),使网站能够以中文被搜索引擎抓取与索引,并通过 AGENTS.md 将中文版本设为今后所有页面的强制要求。

  • 新增页面:中文首页(完整翻译的着陆页)、8 个仪表板标签页(中文元数据 + 图表上方的服务器端中文简介,交互式图表本身仍为英文)、关于页(含中文 FAQ 与 FAQPage 结构化数据)、支持者页(45 条评价全部翻译)、土地致谢页、GPU 对比索引页,以及全部 14 篇博客文章的中文翻译(content/blog/zh/,与英文原文按文件名配对,发布时间以英文原文为准)
  • SEO 基础设施:中英页面双向 hreflang(en/zh-CN/x-default);站点地图成对输出中英 URL;中文页面设置 og:locale=zh_CN 与独立 canonical;页眉新增 EN↔中文 切换;博客库支持 CJK 阅读时长(每分钟 400 字)与中文标题锚点
  • 规则更新:AGENTS.md 新增强制章节——所有新增页面、标签页或博客文章必须在同一 PR 中提供 /zh 中文版本,缺失翻译视为 🔴 阻塞性审查问题;设计说明见 docs/i18n.md
  • 第二轮:按 slug 的 GPU 对比详情页现已完整镜像(/zh/compare/[slug]/zh/compare-per-dollar/[slug],中文叙述模板位于 compare-ssr-zh.ts);页脚、仪表板界面文案(计算器、推理、评估、历史趋势、可靠性、GPU 规格、功耗、提交记录)、提示弹窗、分享按钮与精选对比卡片均通过 useLocale() 模式本地化,英文页面保持逐字节不变
  • 暂不镜像(已在文档中说明):/datasets、功能门控标签页、feed.xml/llms.txt;中文文章复用英文 OG 图片(OG 渲染器默认字体不含中文字形);图表内部渲染(坐标轴/图例/悬浮提示)与数据注册表中的显示值(模型/GPU/框架/精度名称)按设计保留英文
  • 测试:2426 个单元测试全部通过(含新增的字典完整性测试);新增 10 个 Cypress E2E 测试;生产构建成功,全部中文页面静态生成并人工验证渲染正常

🤖 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.ts centralizes zhPath, bidirectional enAlternates/zhAlternates, ZH_MIRRORED_ROUTES, and the header EN↔中文 toggle; sitemap uses localizedPair(); 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.ts slug narratives, and 14 blog posts in content/blog/zh/. Shared chrome localizes via useLocale() + STRINGS = { en, zh } without changing English byte-for-byte output.

Process: New AGENTS.md section and docs/i18n.md make /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.

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>
@vercel

vercel Bot commented Jul 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
inferencemax-app Ready Ready Preview, Comment Jul 4, 2026 7:27am

Request Review

Comment thread packages/app/src/components/tab-nav.tsx Outdated
Comment thread packages/app/src/components/header/header.tsx
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>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ 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>
@functionstackx functionstackx enabled auto-merge (squash) July 4, 2026 07:31
@functionstackx functionstackx merged commit 8a2095c into master Jul 4, 2026
25 checks passed
@functionstackx functionstackx deleted the feat/zh-pages branch July 4, 2026 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant