feat: add i18n support with Chinese (zh) translation#55
Open
Ethan-Tang wants to merge 1 commit into
Open
Conversation
mylee04
requested changes
Jul 3, 2026
mylee04
left a comment
Owner
There was a problem hiding this comment.
Thanks for the PR. The macOS/Linux Bash path looks promising, and I verified locally that cn lang zh, cn lang status, and translated notifier output work with a fake notifier. The existing suite also passes.
I do not think this is ready to merge yet because the feature is only partially wired and currently lacks regression coverage for the new behavior.
Requested changes:
- Move
langout of theSOUND COMMANDSsection inhelp.shand add it to the top-levelCOMMANDSlist. It is a top-level command, not a sound subcommand. - Add README/docs usage for
cn lang zh,cn lang en, andcn lang status, including where the language setting is stored. - Add a regression test such as
tests/test-lang.shthat verifies language persistence and notifier output translation, then wire it intoscripts/run_tests.sh. - Either add
cn langsupport to the Windows PowerShell runtime inscripts/install-windows.ps1, or explicitly document that language switching is currently unsupported on Windows. Right now npm Windows users run the PowerShell runtime, socn langwould not be available there.
Once those are addressed, this should be much safer to merge.
Owner
|
For visibility, here are the changes needed before this can be merged:
cn lang zh
cn lang en
cn lang statusAlso document where the language setting is stored.
Then wire it into
The macOS/Linux Bash path looks promising, but these gaps should be fixed first. |
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
Add i18n support, making all notification strings translatable. Ships with Chinese (zh) as the first non-English locale.
Changes
lang.sh— Translation engine, locale stored in~/.claude/notifications/langnotifier.sh— All hardcoded English strings replaced with$(t key)callsglobal.sh— Newcn langcommand + language in statusbin/code-notify— Added lang to command whitelisthelp.sh— Documented lang commandUsage
Design
~/.claude/notifications/config pattern