feat: add Simplified Chinese localization and language switcher - #25
Merged
Merged
Conversation
Serve English at / and Simplified Chinese at /zh-CN from one optional [[lang=locale]] route. Copy moves to typed per-locale files keyed by the shared ids in site.ts, so both locales make the same claims; commands, repository names, and CLI output stay literal. - Header language menu (desktop popover, mobile sheet list) built on real links with hreflang/lang, keeping the current section on switch. - Per-locale lang, canonical, hreflang alternates, and og:locale. - CJK typography: no negative tracking, taller leading, SC font stack, headings wrap only between words. - English copy tightened into plainer wording; claims unchanged. - verify-build checks both pages' language metadata and literals. Closes #24
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wrightkit-dev | 41aa9df | Commit Preview URL Branch Preview URL |
Sep 27 2026, 02:21 PM |
Refine phrasing across zh-CN and en content files based on humanizer-zh principles. Eliminate translationese and awkward colloquialisms, align terminology with compiler and Workshop domain standards, and enhance fluency while strictly preserving all claims, constraints, and typographic invariants.
|
I went through b291bda. Most of it is wording only, but a few zh lines now claim more than the English, which #24 asks us to keep aligned:
Everything else reads as style. The |
- Drop kickers that restate their heading (tooling, agents, languages, install); keep the hero audience line and the ecosystem 'open source'. - Remove the decorative hero glow. - Render non-goals and compatibility criteria as plain lists, not pills. - Replace the terminal's oversized shadow with a tight one. - Copy: drop 'not just X' / 'X, not Y' constructions; return the zh copy to plain spoken Chinese and bring six zh lines back in line with the English claims (skill not built in, no 'first-time' promise, any LSP editor, control-flow hotspots, few false positives, design not gameplay). Co-authored-by: Indent <noreply@indent.com>
Eliminate remaining bureaucratic and translationese phrasing in zh-CN copy. Align with natural spoken developer language, plain phrasing conventions, and the English claims without synthetic fluff or awkward constructs.
Remove colon prompts and translation shells from zh-CN content while preserving exact meaning and workshop terminology.
- Hero: lead with the user outcome (catch bugs before loading the game). - Tooling: drop the implementation-background lead; describe lint and analyze with Workshop examples; CI card says what happens in Actions. - Agents: list what ships for coding agents (JSON output, stable codes, Agent Skill) and show planned features as "Coming soon" cards instead of the direction paragraph and five-step loop. - Languages: plain status lines; compatibility keeps the comparison list and drops the policy notes. - Trim install, ecosystem, and repo descriptions; zh-CN checked against the lieflat-less-ai-tone rules (no dense 、 lists).
Short headlines and one-line card bodies in the style of Apple product pages and CLI tool sites (ruff, Biome): lead with what the tool does, drop explanation. Claims unchanged; zh-CN rewritten natively, not translated.
- Hero terminal runs `wright lint rules.txt` on rules copied from the game. - New "Copy. Save. Check." section: the in-game editor to Wright path. - New "What it catches" section: four real findings (typo, While without Wait, 0.016 s loop, line of sight in a loop), each with a snippet in the page locale's game-client syntax. All captured from wright 0.2.40. - "More tools" keeps analyze, inspect, editor, and CI; editor copy says there is no VS Code extension yet. - Languages: one line per language; compatibility criteria removed. - Agents: shipped capabilities plus a single "Coming soon" line. - Remove the ecosystem section; repositories move to the footer. - Nav: Get started / Features / Languages / Install, plus Docs (desktop from lg) and GitHub. - zh code snippets keep a monospace face with a CJK fallback.
- Hero lead: lead with the value (catch errors and server-heavy code before players hit them) instead of skipping in-game testing. - Hero text staggers in, terminal output lines stream in one by one, sections and cards rise in as they scroll into view, and each example's finding appears after its code. - Hidden start state is gated on a `data-js` flag set by the boot script, so prerendered HTML never flashes; a 3 s CSS fallback shows everything if hydration fails. Reduced motion gets a short cross-fade only.
goal.md's success measure for developers is replacing manual guesswork with standard tooling (static stability warnings, diagnostics). The hero lead now opens on that instead of timing relative to players.
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.
Closes #24.
Summary
[[lang=locale]]route. English stays at/, Simplified Chinese is at/zh-CN, and both are prerendered./endoes not exist (the param matcher rejects the default locale). There is no browser-language redirect.site.tstosrc/lib/content/{en,zh-CN}.ts, typed bycontent/types.ts. Records keyed by the shared ids insite.tsplus fixed-length tuples mean a locale can't drop or add a claim without a type error.site.tsnow holds only data that isn't translated: URLs, commands, repo names, support tone, and the captured terminal output.LanguageSwitcher.svelte): a globe trigger in the desktop header opens a popover anchored to the trigger, and the mobile sheet has a list. It is built for N locales and only lists EN and 简体中文 today. Each option is a real<a>withhreflangandlang, so it works without JS, and switching keeps the current section (/#install→/zh-CN#install). It supports keyboard use (arrow keys, Home/End, Escape returns focus) and closes on an outside click or when focus leaves.hooks.server.tssets<html lang>per prerendered page, and the layout keeps it in sync after client-side switches. Each page gets its own canonical URL,hreflangalternates (en,zh-CN,x-default),og:locale, andog:locale:alternate.app.css): Chinese text drops the negative display tracking and gets taller leading, plus a Simplified Chinese font stack (also applied to the 简体中文 label on English pages). Chinese h1/h2 useword-break: keep-all, with\u200bhints in long headings so a line never breaks inside a word like 地图工坊. The zh theme label is 自动, which fits the segmented control and matches the platform convention.scripts/verify-build.mjsnow assertslang, canonical, and alternates on both pages, and asserts that install commands and terminal output appear untranslated on both.Why
#24 asks for a Chinese homepage without changing the English default. The switcher is designed for more than two locales now, so adding one later means adding a locale, a content file, and a prerender entry, with no UI changes.
Verification
pnpm check: 0 errors, 0 warnings.pnpm build:[verify-build] OK: installers and 2 localized pages verified.vite previewand checked in Chrome:scrollWidth == clientWidth) and the header fitting at 768 px./→/zh-CN#languageswithlang=zh-CNand the zh title, Escape returns focus to the trigger, and an outside click closes it./zh-CN.Tag
@indentto continue the conversation here.