feat(cli): OS locale auto-detect + bump cli-3.5.0#61
Merged
Conversation
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>
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
Lswitcher, locale auto-detect)..devtrail/config.yml,devtrail explore/new/statusnow read\$LC_ALL/\$LANGand 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 explicitlanguage: enis treated as a deliberate user choice and never overridden by env vars.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.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 forparse_posix_localecovering zh-CN / Traditional unsupported / Spanish / English+pseudo / unsupported / charset+modifier stripping; 2 forresolve_languagecovering config wins over env, and config-absent +LANG=C→ "en").cargo check --all-targets— clean..devtrail/, runLANG=zh_CN.UTF-8 devtrail explore(after init) — should auto-detect Chinese;LANG=es_MX.UTF-8 devtrail exploreshould auto-detect Spanish;LANG=fr_FR.UTF-8should 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