Repository navigation
feat: Add preview-only zh-CN locale - #238
Merged
Merged
Conversation
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.
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.
Part of #237. This adds the preview-only
zh-CNlocale. The config is the snippet from Adding and launching a locale, unchanged.#225 edits the same lines to turn
zh-CNon for every build. Once this merges, that part of #225 should be dropped.Tests
pnpm buildwithoutL10N_PREVIEW(whatdeploy.ymlruns) builds English only. There are no/zh-CN/pages and nozh-CNhreflang or sitemap entries. I compared it with a build of themainbranch (fedad00). Themain.<hash>.jsbundle changes, because it embeds the site config and so now carries thezh-CNlabel. 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>.jsmay also differ. Between my two builds offedad00, it differed only in minified variable names.L10N_PREVIEW=1 pnpm buildbuildsenandzh-CN./zh-CN/has the same HTML files as English. The 58 docs pages, the search page and the 404 page havelang="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.