Skip to content

feat: Add preview-only zh-CN locale - #238

Merged
Sherlock113 merged 1 commit into
modular:mainfrom
yaokaiy:l10n/preview-locale
Nov 23, 2026
Merged

Sherlock113 merged 1 commit into
modular:mainfrom
yaokaiy:l10n/preview-locale

Conversation

@yaokaiy

@yaokaiy yaokaiy commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Part of #237. This adds the preview-only zh-CN locale. The config is the snippet from Adding and launching a locale, unchanged.

#225 edits the same lines to turn zh-CN on for every build. Once this merges, that part of #225 should be dropped.

Tests

  • pnpm build without L10N_PREVIEW (what deploy.yml runs) builds English only. There are no /zh-CN/ pages and no zh-CN hreflang or sitemap entries. I compared it with a build of the main branch (fedad00). The main.<hash>.js bundle changes, because it embeds the site config and so now carries the zh-CN label. The only change in the HTML pages is that bundle's new file name. Every other file is byte-identical. If you rerun this, runtime~main.<hash>.js may also differ. Between my two builds of fedad00, it differed only in minified variable names.
  • L10N_PREVIEW=1 pnpm build builds en and zh-CN. /zh-CN/ has the same HTML files as English. The 58 docs pages, the search page and the 404 page have lang="zh-CN". They show the English text until they are translated.

I used an AI-assisted workflow (Claude Code) for this. I reviewed and tested all of it.

Build zh-CN only when L10N_PREVIEW is set, so the production build stays
English-only until the locale launches. The config is the snippet from
"Adding and launching a locale" in LOCALIZATION.md.

@Sherlock113 Sherlock113 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@Sherlock113
Sherlock113 merged commit b3a1c71 into modular:main Nov 23, 2026
2 checks passed
@yaokaiy
yaokaiy deleted the l10n/preview-locale branch November 23, 2026 07:55
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.

2 participants