Skip to content

feat(tui): add gettext language support with German and Greek - #30

Open
GiorgoLazaridis wants to merge 4 commits into
errhythm:mainfrom
GiorgoLazaridis:feat/tui-languages
Open

GiorgoLazaridis wants to merge 4 commits into
errhythm:mainfrom
GiorgoLazaridis:feat/tui-languages

Conversation

@GiorgoLazaridis

@GiorgoLazaridis GiorgoLazaridis commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The TUI's controls are English-only. Users need a language choice, and contributors need a standard way to translate complete UI messages without changing action identifiers or account logic.

Change

Add ui.language with English (en, the default), German (de) and Greek (el):

ccswap config set ui.language de
ccswap tui
# el: Greek; en: English

The Settings menu also cycles the language. Its label and confirmation explicitly require a dashboard restart; the running application's translator is kept stable.

  • Use Python's standard gettext catalogs per app, without installing a global _, changing the process locale, or following LANGUAGE from the environment. Missing messages, unavailable/corrupt catalogs and unsupported saved choices fall back to English.
  • Translate navigation, settings, footer labels, confirmation dialogs, token-entry forms, Watch/Auto controls, frontend notices and quota display wording. Backend action output/diagnostics remain in their original language; commands, account identities, model names, keyboard keys and stored policy values are unchanged.
  • Preserve stable menu/action IDs separately from display text. Pure display helpers receive an explicit translator with an English identity default. Quota window IDs stay canonical when their display labels are translated.
  • Localize binding descriptions lazily and once per instance, including under Textual's screen MRO. Empty descriptions remain empty (gettext("") is catalog metadata). Already translated dialog arguments are not translated a second time.
  • Include 176 translated messages per language, editable .po sources, compiled .mo files and an English .pot template. Babel is development-only; there is no new runtime dependency.
  • Use one language register for config validation and the Settings cycle. Contributor instructions explain adding a language, extracting/updating messages, preserving named placeholders and compiling catalogs.

The commits separate the translator/config foundation, catalog resources, navigation/settings wiring, and the remaining views/dialogs plus documentation. No changelog.

Validation

  • GitHub CI: Linux, Windows and macOS checks passed at ab9fa00.
  • Full Linux suite on Python 3.12: 4,615 passed, 13 skipped.
  • Full Linux suite on Python 3.13: 4,615 passed, 13 skipped.
  • Catalog tests check completeness, non-empty/non-fuzzy translations, named fields/format specifications, Babel validation and byte-for-byte .po → .mo consistency.
  • Fallback tests cover unsupported choices, missing/corrupt catalogs, environment independence and keeping German/Greek translators separate.
  • Pilot tests exercise both languages at 80 columns, preserve action/menu IDs, persist the selected language and masking without changing other settings, and cancel destructive actions. A deliberate translation-collision regression checks that confirmations translate once and y/n retain their original meaning using synthetic accounts only.
  • Rendering regression keeps the canonical Weekly window ID for threshold lookup while showing the translated label, including translated spend countdowns.
  • Built wheel includes both compiled catalogs; an isolated interpreter loaded German and Greek from the wheel successfully.
  • Independent read-only review and follow-up found no auth/confirmation blocker. Follow-up translation gaps, duplicate translation and window-ID issues were corrected and covered by regressions. Whitespace and secret scans completed before push.

Scope and limits

This is TUI localization, not translation of CLI/API output, third-party command output, provider diagnostics, macOS menu-bar text, account data or operating-system date/number conventions. Shortcuts keep their existing keys, including y/n; Enter on a focused button remains available with other keyboard layouts. Native Windows/macOS UI coverage is left to CI and subsequent user testing.

This PR is based directly on v0.43.0, independently of the pending warmup, reset-display and tooltip contributions. The combined local test build is separate; combining pending UI changes may require resolving overlapping rendering/test hunks and refreshing catalogs for newly added messages.

A combined local integration reference includes all four contributions plus catalog/rendering conflict resolutions. It passed 4,686 tests (13 skipped) on Linux/Python 3.13, including German/Greek hover help together with an urgent expiry. This is a test build with a local version suffix, not an additional upstream merge candidate.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-29T21:50:05.393530Z
We couldn’t complete this review. Comment @codex review to try again.
ab9fa00 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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