feat(cli): localize TUI Onboarding Wizard and Agents screen#6253
Conversation
PR Update: Full TUI Screen Localization & Scanner Test CoverageI have added several new commits to this branch that complete the TUI localization and update the i18n scanner test to be fully comprehensive. Currently, 100% of user-facing strings in the Key Changes in New Commits:
Commits Added:
Verification Results:
|
…i18n-new # Conflicts: # .secrets.baseline
# Conflicts: # .secrets.baseline
|
Merged latest |
houko
left a comment
There was a problem hiding this comment.
Thanks for the localization work — the Ukrainian and English locales are complete and the refactor cleanly routes the touched TUI strings through Fluent keys. One blocking issue before merge:
crates/librefang-cli/locales/zh-CN/main.ftl is missing the key tui-init-migrate-openclaw-skills, which is referenced at crates/librefang-cli/src/tui/screens/init_wizard.rs:1607. The key was added to en/main.ftl and uk/main.ftl but dropped from zh-CN (the zh-CN openclaw block jumps from ...-no-channels straight to ...-no-skills). Under the zh-CN locale the migration-offer screen will render the literal [tui-init-migrate-openclaw-skills] instead of the translated string, because i18n::get() returns [{key}] for a missing key. Please add the zh-CN translation for that key.
This slipped past CI because there is no cross-locale key-parity test — the new i18n_checks.rs only scans for hardcoded strings, not for missing keys per locale. Not asking you to add a parity test in this PR, but worth a follow-up issue.
Non-blocking: the diff is broader than the title/body suggests — it also localizes the extensions/memory/peers/sessions/skills/triggers/workflows screens, not just the Onboarding Wizard + Agents screen. That's fine as one i18n concern; just flagging so the description matches the scope.
|
I used this test to localize the entire module. I just ran it now because the whole module has been translated and the test no longer fails. |
|
done |
Missing zh-CN key and the cross-locale parity concern are fixed in the post-review commit (adds the key in all locales + English-fallback bundle + regression test). Re-reviewed and clean.
Type
Summary
This PR localizes the two major CLI TUI screens:
tui/screens/init_wizard.rs): Refactored the setup steps, provider selection (with localized environment keys and hints), API key verification, default model picker, smart routing configuration, and completion state launcher options.tui/screens/agents.rs): Localized the full agents list (with table headers), agent detail view, custom agent builder (inputs for name, description, system prompt, and tools checklists), and template picker.All user-facing text strings on these screens have been moved to Fluent-native localization files, supporting English, Ukrainian, and Simplified Chinese. In addition, both screens have been integrated into the
i18n_checkstest suite to prevent future localization regressions.Changes
Source Code Refactoring (
crates/librefang-cli/src/)[MODIFY] init_wizard.rs
ProviderInfoand staticPROVIDERSlist to use localizable Fluent keys for provider description hints (e.g.tui-init-hint-*).draw_*screens including migration detector, API key validation, model picker, smart routing tiers, and daemon launcher options.[MODIFY] agents.rs
draw_detail(e.g. ID, Name, State, Capabilities, Tags) and lists checklists (draw_checkbox_list).TOOL_OPTIONSstructure anddraw_tool_selectto dynamically fetch tool descriptions from Fluent translations.format!(" {}{:<16}", check, name)) to avoid having alphabetic letters in literals with spaces, passing the localization scanner.Localization Files (
crates/librefang-cli/locales/)[MODIFY] en/main.ftl
tui-init-*) and the agents screen (tui-agents-*).[MODIFY] uk/main.ftl
[MODIFY] zh-CN/main.ftl
Tests (
crates/librefang-cli/tests/)[MODIFY] i18n_checks.rs
tui/screens/agents.rsandtui/screens/init_wizard.rsto the scanned files list intest_no_untranslated_strings.Verification
Clippy Validation:
Result: Clean compilation with no warnings or errors.
Integration Test Suite:
cargo test -p librefang-cli --test i18n_checksResult: Test
test_no_untranslated_stringspassed successfully, verifying zero hardcoded strings.