Localize the TUI: replace hardcoded English strings with fluent translations #43
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
crates/bds-server/src/tui.rscontains roughly 89 hardcoded English UI strings: settings form field labels ("Project name", "Online endpoint URL", "Data folder", …), ~43 status-line messages ("Tag created", "Project switched", "Commit message is required.", "Airplane mode: configure a local AI endpoint first.", …), prompt titles, and confirmations. Only 5bds_core::i18n::translatecalls exist (section nav labels). This violates the AGENTS rule "no untranslated string constants" and hollows outspecs/tui.alliumruleServerSideLocale— when the server UI language changes, the TUI re-renders but most text stays English.Task
tui.rsto fluent keys resolved throughbds_core::i18n::translate(locale, key)with the TUI's current locale (self.locale). Group keys under atui-prefix consistent with the existing keys (seetui.settingThemenaming already referenced in the section-label mapping).locales/ui/*.ftlfiles (en, de, es, fr, it) with proper translations. For parametrized messages (counts, paths, tag names) use fluent placeables, notformat!concatenation of translated fragments.ServerSideLocaleend-to-end: changingui.languagein the settings panel re-renders the whole TUI in the new language, including form labels and subsequent status messages. Extend the existing TUI locale test to assert at least one settings field label and one status message change language.Definition of done
grepfor multi-word English literals intui.rsfinds no user-visible UI strings.cargo test --workspacepasses.Implemented in
49dc88c. Replaced the TUI user-visible English literals with 117 Fluent messages across all five UI locales, including sidebar headers, editor and settings labels, prompts and confirmations, task lifecycle text, Git and tag workflows, report bodies, image details, validation errors, and parameterized counts, paths, names, and output. Command-palette display names are localized while stable non-UI command IDs preserve dispatch behavior. A ui.language event now relocalizes existing sidebar data, open settings fields, command candidates, and open reports; the regression test proves an already-open field changes from English to German and the next status is German. Verified neutrally against the issue, bDS2 localization behavior, and the Allium ServerSideLocale rule with no completeness gaps found. Gates passed: allium check and analyse, five-locale catalog and variable completeness, untranslated-literal scan, changed-source rustfmt check, cargo machete --with-metadata, cargo outdated --workspace --root-deps-only --exit-code 1, cargo clippy --workspace --all-targets -- -D warnings, cargo build --workspace, cargo test --workspace, and git diff --check.