Skip to content

feat(cli): OS locale auto-detect + bump cli-3.5.0#61

Merged
montfort merged 1 commit into
mainfrom
feat/locale-detect-cli-3.5.0
Apr 26, 2026
Merged

feat(cli): OS locale auto-detect + bump cli-3.5.0#61
montfort merged 1 commit into
mainfrom
feat/locale-detect-cli-3.5.0

Conversation

@montfort
Copy link
Copy Markdown
Contributor

Summary

  • Pendiente (3) of 3 — and the bundled bump to cli-3.5.0 that ships all three pendientes from this session (translated TUI shell, live L switcher, locale auto-detect).
  • When a project has no .devtrail/config.yml, devtrail explore / new / status now read \$LC_ALL / \$LANG and map a POSIX locale (zh_CN.UTF-8, es_MX.UTF-8, etc.) to the nearest supported language. Projects with a config file are unaffected — an explicit language: en is treated as a deliberate user choice and never overridden by env vars.
  • New utils::detect_os_locale + parse_posix_locale (publicly exposed for testability). Traditional Chinese (zh_TW / zh_HK) returns None on purpose because DevTrail only ships Simplified.
  • New DevTrailConfig::resolve_language(project_root) is now the single entry point used by all three commands; resolution order is --lang > config.language (when file exists) > OS locale > "en".

Test plan

  • cargo test — 142 unit tests + 86 integration tests pass; 8 new tests (6 for parse_posix_locale covering zh-CN / Traditional unsupported / Spanish / English+pseudo / unsupported / charset+modifier stripping; 2 for resolve_language covering config wins over env, and config-absent + LANG=C → "en").
  • cargo check --all-targets — clean.
  • Manual smoke: in a directory without .devtrail/, run LANG=zh_CN.UTF-8 devtrail explore (after init) — should auto-detect Chinese; LANG=es_MX.UTF-8 devtrail explore should auto-detect Spanish; LANG=fr_FR.UTF-8 should fall back to English (silent).

CHANGELOG entry covers all three pendientes

This PR's CHANGELOG section bundles cli-3.5.0 as a single coherent minor: translated TUI shell + live switcher + locale auto-detect.

🤖 Generated with Claude Code

Closes the language-aware explore series started in 3.4.0. Adds the
final missing fallback: when a project has no .devtrail/config.yml,
devtrail explore / new / status now read \$LC_ALL / \$LANG and map a
POSIX locale (e.g. zh_CN.UTF-8, es_MX.UTF-8) onto the nearest supported
language. Existing projects with a config file are unaffected — an
explicit language: en is still treated as a deliberate user choice and
never overridden by env vars.

New utils::detect_os_locale + parse_posix_locale handle the parsing.
Traditional Chinese (zh_TW / zh_HK) returns None on purpose because
DevTrail only ships Simplified.

DevTrailConfig::resolve_language is now the single entry point used by
all three commands, so they agree on the effective language. Resolution
order: --lang > config.language (when file exists) > OS locale > "en".

Bumps version 3.4.1 → 3.5.0. CHANGELOG entry covers all three pendientes
shipped in this minor (translated TUI shell, live language switcher,
locale auto-detect). 6 docs updated: 3 README versioning tables and 3
CLI-REFERENCE.md (EN/ES/zh-CN) with the new resolution order and the L
keybind.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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