Add Simplified Chinese localization and language switching - #336
Closed
wututua wants to merge 1 commit into
Closed
Conversation
✅ Deploy Preview for web-check ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
lissy93
reviewed
Aug 25, 2026
lissy93
left a comment
Owner
There was a problem hiding this comment.
Thanks for the PR @wututua
But I cannot merge this. It's not maintainable.
I'll find a better system for internationalization, which doesn't involve any inline if statements. web-check is hand-written, so I won't merge an AI PR which is of poor quality.
Comment on lines
+106
to
119
| <Button>{isChinese ? '返回首页' : 'Go back Home'}</Button> | ||
| </Link> | ||
| <a target="_blank" rel="noreferrer" href="https://github.com/lissy93/web-check"> | ||
| <Button>View on GitHub</Button> | ||
| <Button>{isChinese ? '在 GitHub 查看' : 'View on GitHub'}</Button> | ||
| </a> | ||
| </HeaderLinkContainer> | ||
| </Nav> | ||
| <ErrorInner> | ||
| <Heading as="h1" size="medium" color={colors.primary}> | ||
| Something's gone wrong | ||
| {isChinese ? '出现了一些问题' : "Something's gone wrong"} | ||
| </Heading> | ||
| <Heading as="h2" size="small" color={colors.textColor}> | ||
| An unexpected error occurred. | ||
| {isChinese ? '发生了意外错误。' : 'An unexpected error occurred.'} | ||
| </Heading> |
Owner
There was a problem hiding this comment.
So, when we add new languages, the markup will have 10+ inline if statements for each language? 🤔️
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
This PR adds Simplified Chinese (
zh-CN) localization and an English/Chinese language switcher across Web Check.Changes
localStoragelangattributeAdditional Fix
While testing the production server locally on Windows, I found that absolute filesystem paths were passed directly to ESM
import()calls. This PR converts them to proper file URLs usingfileURLToPathandpathToFileURL, allowing the local production server and API routes to start correctly on Windows.Testing
yarn typecheckyarn lintyarn build/check,/check/about,/account,/web-check-api, and/self-hosted-setupNo new runtime dependencies were added.