You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cli): OS locale auto-detect + bump cli-3.5.0 (#61)
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>
Three changes that complete the language-aware `devtrail explore` work started in 3.4.0. Together they make the TUI feel native to non-English users instead of just "translated docs inside an English shell."
13
+
14
+
### Added (CLI)
15
+
-**Translated TUI shell**: navigation tree group/subgroup labels, sort hints, status-bar key hints, notifications, and the `?` help popup all render in `es` and `zh-CN` when the active language is non-English. Untranslated strings fall back to English silently. New module `cli/src/tui/i18n_strings.rs` is the single lookup point — extending to a new locale is one entry per call site.
16
+
-**Live language switcher**: press `L` inside `devtrail explore` to cycle the display language (`en → es → zh-CN → en`) without quitting. The doc index is rebuilt on the spot, the document body cache is dropped so the next open reads the localized file, and the status bar shows a translated notification (`Idioma: es`, `语言: zh-CN`). Documented in the help popup.
17
+
-**OS locale auto-detection**: 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`) to 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. Traditional Chinese (`zh_TW`, `zh_HK`) returns `None` because DevTrail only ships Simplified.
18
+
19
+
### Changed (CLI)
20
+
- New `DevTrailConfig::resolve_language(project_root)` is now the single entry point used by `explore`, `new`, and `status`, so all three commands agree on the effective language. Resolution order: `--lang` flag > `config.language` (when config file exists) > OS locale > `"en"`.
21
+
22
+
---
23
+
10
24
## CLI 3.4.1 — Code-Block Background No Longer Fragments on Narrow Panels
| CLI |`cli-`|`cli-3.4.1`| The `devtrail` binary |
52
+
| CLI |`cli-`|`cli-3.5.0`| The `devtrail` binary |
53
53
54
54
Framework and CLI are released independently. A framework update does not require a CLI update, and vice versa.
55
55
@@ -110,7 +110,7 @@ $ devtrail update
110
110
Updating framework...
111
111
✔ Framework updated to fw-4.3.0
112
112
Updating CLI...
113
-
✔ CLI updated to cli-3.4.1
113
+
✔ CLI updated to cli-3.5.0
114
114
```
115
115
116
116
---
@@ -143,11 +143,11 @@ Use `--method` to override auto-detection: `--method=github` or `--method=cargo`
143
143
144
144
```bash
145
145
$ devtrail update-cli
146
-
✔ CLI updated to cli-3.4.1
146
+
✔ CLI updated to cli-3.5.0
147
147
148
148
$ devtrail update-cli --method=cargo
149
149
Compiling from source, this may take a few minutes...
150
-
✔ CLI updated to cli-3.4.1
150
+
✔ CLI updated to cli-3.5.0
151
151
```
152
152
153
153
---
@@ -210,7 +210,7 @@ $ devtrail status
210
210
┌───────────┬──────────────────────────┐
211
211
│ Path │ /home/user/my-project │
212
212
│ Framework │ fw-4.3.0 │
213
-
│ CLI │ cli-3.4.1 │
213
+
│ CLI │ cli-3.5.0 │
214
214
│ Language │ en │
215
215
└───────────┴──────────────────────────┘
216
216
@@ -641,7 +641,14 @@ Browse and read DevTrail documentation interactively in a terminal UI.
641
641
642
642
| Flag | Default | Description |
643
643
|------|---------|-------------|
644
-
|`--lang <code>`|`language` from `.devtrail/config.yml`, else `en`| Display language for framework governance docs (`en`, `es`, `zh-CN`). Falls back silently to English when a translation is missing. |
644
+
|`--lang <code>`| resolved from project (see below) | Display language for the TUI shell and framework governance docs (`en`, `es`, `zh-CN`). Falls back silently to English when a translation is missing. |
645
+
646
+
**Language resolution order** (since cli-3.5.0):
647
+
648
+
1.`--lang <code>` flag, when provided
649
+
2.`language` field in `.devtrail/config.yml`, when the file exists (an explicit value — even `language: en` — is treated as a deliberate user choice)
650
+
3.`$LC_ALL` / `$LANG` env vars, mapped to a supported locale (e.g., `zh_CN.UTF-8` → `zh-CN`, `es_MX.UTF-8` → `es`). Traditional Chinese (`zh_TW` / `zh_HK`) and other unsupported locales fall through.
651
+
4.`en`
645
652
646
653
**Features:**
647
654
@@ -662,6 +669,7 @@ Browse and read DevTrail documentation interactively in a terminal UI.
0 commit comments