Skip to content

fix(cli): default the standards language to the OS language - #59

Merged
wxhou merged 3 commits into
mainfrom
fix/standards-language-os-default
Nov 18, 2026
Merged

wxhou merged 3 commits into
mainfrom
fix/standards-language-os-default

Conversation

@wxhou

@wxhou wxhou commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Standards language default follows the OS UI language on macOS (AppleLanguages → AppleLocale) and Windows (PreferredUILanguages → LocaleName) before the terminal locale, with env/Intl fallback.
  • update's self-restart forwards --lang instead of silently dropping it.
  • Pre-anchor Chinese blocks are detected by their ## 0. 适用范围 heading, so update no longer flips them to English.
  • READMEs, CLI --lang help and CHANGELOG updated.

Test plan

  • npm run lint — 0 errors
  • npm run typecheck
  • npm run build && npm run test:run — 1555 pass, 5 skipped
  • macOS: built module reads zh-Hans with LANG=en_US.UTF-8
  • update --lang zh probe: self-restart keeps the flag and switches the block to Chinese

macOS reads AppleLanguages/AppleLocale and Windows reads
PreferredUILanguages/LocaleName ahead of the terminal locale; update's
self-restart forwards --lang, and pre-anchor Chinese blocks fall back to
their §0 heading.

Tests: 1555 pass, 5 skipped. lint/typecheck clean. No version bump.
init keeps an installed block before falling back to the system language,
matching update; the resolveStandardsLanguage comment now names the OS-first
chain.

Tests: 1555 pass, 5 skipped. lint/typecheck clean. No version bump.
`## 一、代码质量` blocks now identify as Chinese before update can rewrite
them; wrapper-refresh tests pass an explicit lang so they no longer depend
on the host OS language.

Tests: 1556 pass, 5 skipped. lint/typecheck clean. No version bump.
@wxhou
wxhou merged commit e3e7810 into main Nov 18, 2026
3 checks passed
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.

1 participant