Skip to content

feat(native): whole-app i18n localization sweep and reactive menus (AP-I18N) - #456

Merged
rynfar merged 2 commits into
nativefrom
feat/native-i18n-sweep-441
Nov 20, 2026
Merged

rynfar merged 2 commits into
nativefrom
feat/native-i18n-sweep-441

Conversation

@rynfar

@rynfar rynfar commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Completes #441 Part B (AP-I18N: partial -> done), porting upstream whole-app UI localization (pingdotgg/t3code#37893, pingdotgg/t3code#38649, pingdotgg/t3code#39224, pingdotgg/t3code#39225, pingdotgg/t3code#37954) to the native GPUI client.

Summary

  1. Core & App i18n Runtime (crates/core/src/i18n/mod.rs, crates/app/src/i18n.rs):
    • Embedded both apps/web/src/i18n/translations/*.json and apps/desktop/src/i18n/translations/*.json for all 10 supported locales (en, de, es, fr, ja, ko, pt-BR, ru, sv, zh), plus CatalogEntry::Rich AST flattening fallback so rich catalog keys also translate.
    • Added ICU MessageFormat formatting (format_icu, translate_fmt, translate_menu_fmt, t_fmt) supporting {var} interpolation, {count, plural, ...} with CLDR cardinal plural categories for all 10 locales, # replacement, {kind, select, ...}, and ICU quoting rules (falling back to English plural rules for untranslated strings).
    • Wired active_locale_selection / active_formatting_locale and locale-aware integer grouping (format_integer, used in image dimension display in files/image.rs), preserving OS regional timestamp semantics in timestamp.rs.
  2. Reactive Native Menus (crates/app/src/menus.rs, crates/app/src/settings/store.rs, crates/app/src/context_menu.rs, pingdotgg/t3code#39224):
    • Localized macOS application menu bar items (File, Edit, View, Window, app menu) using exact desktop/web catalog keys and rebuilt menus reactively via menus::install(cx) on settings load and live language switches without requiring a restart.
    • Localized context menus (context_menu.rs, right_panel/tabs.rs, terminal/pane.rs, files/explorer_rows.rs, chat_header.rs).
  3. Whole-App UI Localization Sweep (pingdotgg/t3code#37893, pingdotgg/t3code#38649, pingdotgg/t3code#39225):
    • Sidebar & Dialogs: header/footer buttons, search & project filter, sections (Pinned, Active, Working, Snoozed, Settled), scratch No project folder/filter/breadcrumb (pingdotgg/t3code#38649), status badges, drafts, snooze dialog, update dialog.
    • Composer & Thread/Transcript/Details: placeholders, Send/Steer/Stop/Queue/Compact controls, model picker (Unavailable pingdotgg/t3code#39225), citations & quoted-response notices (pingdotgg/t3code#39225), home hero, chat header, new thread, transcript actions/timers/work log, thread details, lineage dialog, side chat.
    • Panels, Diffs & PRs: right-panel launcher/tabs, terminal controls/context menu, browser preview toolbar/menu/error overlays, files explorer/code find/image preview, device panel/setup, diff header/tree, pull requests toolbar/empty states/summary/link dialog/thread panel.
    • Settings, Palette, Usage & Chrome: shared settings controls (Button, Select, Row, InlineButton, DialogFrame, section, unavailable_group, folded_section), command palette placeholders/headings/items, confirm dialog, quit-hold overlay, GitHub star prompt, connect screen, theme editor, usage header/overview/limits/dialog.
  4. Tests & Ledger (pingdotgg/t3code#37954):
    • Added unit tests in crates/core/src/i18n/mod.rs covering desktop catalog parity, translate_fmt interpolation/pluralization across en/de/fr/pt-BR/ru/ja/sv, # substitution, select, ICU quoting, CatalogEntry::Rich lookup, format_integer, and core UI key coverage across all 9 non-English locales.
    • Added GPUI test menus::tests::reactive_language_switch_updates_i18n_and_rebuilds_menus verifying reactive en -> de -> sv -> ja language switches update active_locale, active_formatting_locale, i18n::t, and installed menus cleanly.
    • Updated AP-I18N in apps/native/parity/LEDGER.md from partial | #441 to done.

Verification

  • CARGO_INCREMENTAL=0 cargo clippy --manifest-path apps/native/Cargo.toml --workspace --all-targets -- -D warnings: pass (0 warnings)
  • CARGO_INCREMENTAL=0 cargo test --manifest-path apps/native/Cargo.toml -p t3-core -p t3-client -- --test-threads=1: t3-core 1855 unit + 8 conformance passed; t3-client 163 passed (0 failed)
  • T3_NATIVE_HOME=$(mktemp -d) CARGO_INCREMENTAL=0 cargo test --manifest-path apps/native/Cargo.toml -p t3-native -- --test-threads=1: 208 passed (0 failed)
  • CARGO_INCREMENTAL=0 cargo build --manifest-path apps/native/Cargo.toml -p t3-native: pass
  • vp fmt --check apps/native/parity/LEDGER.md: pass
  • node apps/native/scripts/gen-theme.ts --check: pass
  • node apps/native/conformance/generate.ts --check: pass
  • node --test apps/native/parity/sync.test.ts: 47 passed (0 failed)

Closes #441

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