Skip to content

feat(openlogi-gui): expand UI to 19 fully-translated locales (+ asset & layout fixes)#24

Open
davidbudnick wants to merge 1 commit into
AprilNEA:masterfrom
davidbudnick:feat/expand-locales
Open

feat(openlogi-gui): expand UI to 19 fully-translated locales (+ asset & layout fixes)#24
davidbudnick wants to merge 1 commit into
AprilNEA:masterfrom
davidbudnick:feat/expand-locales

Conversation

@davidbudnick
Copy link
Copy Markdown
Contributor

@davidbudnick davidbudnick commented May 31, 2026

Expands i18n and fixes mouse-model label layout found while testing locales on a real MX Master 3S. Rebased on current master; cargo test -p openlogi-gui green (11/11), clippy + rustfmt clean.

The earlier display-name asset fallback (b034displayName) is no longer part of this PR — it already landed on master, so this branch defers to it.

i18n

  • Grow from the 6 locales master ships (en, ja, ru, zh-CN, zh-HK, zh-TW) to 20 — adds da, de, es, fr, it, nl, nb, pl, pt-PT, pt-BR, fi, sv, el, ko, with full coverage across every UI string (every tr!/t! literal has a catalog key in every locale).
  • Master stays the source of truth for the locales it already ships (en/ja/ru/zh-CN/zh-HK/zh-TW): this PR only adds the new locales and never overrides master's existing values. Picks up master's recent zh-TW locale and the extended empty-state hint (now translated into all 14 added locales too).
  • Locale dropdown instead of the chip row.
  • Localize the mouse-model button labels — they emitted raw English .label(), so the canvas labels stayed English after a language switch (the picker dropdown already localized them).

Agent files

  • Added CLAUDE.md at the root of the project.
  • Added AGENTS.md which symlinks to CLAUDE.md.

Layout

  • Dynamic label spacing — cards flow in a centered flex column with leader lines anchored to each card's measured centre, so long translations never overlap.

Screenshots

Screenshot 2026-06-02 at 10 23 19 AM Screenshot 2026-06-02 at 10 23 27 AM

@davidbudnick davidbudnick marked this pull request as draft May 31, 2026 23:25
Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — initial review of a tightly-scoped PR that bundles a 4→19 locale expansion, a layout/asset polish pass, and two new top-level docs.

  • Expand i18n::SUPPORTED to 19 locales with full catalog coverage — every one of the ~115 catalog entries in locales/app.yml gains a column for the 15 new locales, all double-quoted; match_supported folds ptpt-PT/pt-BR by region and collapses nb/nn/no onto nb, with tests for every new fold case.
  • Settings language picker switches from chip row to gpui_component::select::SelectSelectState is built lazily on first render (it needs the Window) and rebuilt when the active locale changes so "Follow system" re-localizes; window grew 360→560px and gained overflow_y_scroll so the Language section is never clipped.
  • Mouse-model labels relayout as a centered flex column — heights flow from wrapped text with a constant gap_4, MIN_LABEL_PITCH = 100. floors the slot pitch in geometry.rs, and each card records its measured centre into a shared Rc<RefCell<HashMap<ButtonId, Pixels>>> during prepaint that the leader-canvas reads during paint of the same frame.
  • Localize mouse-model button labelsLabelTrigger and the binding text now go through tr!(label.id.label()) / tr!(a.label()), matching what the picker dropdown already did.
  • Display-name fallback in asset::resolve_in_index — last-resort eq_ignore_ascii_case match against the registry's displayName, threaded through resolve(model, name) / sync(server, &[(model, Option<String>)]) / collect_models so an MX Master 3S on Bolt (PID b034, registry keys 3S on b043) no longer renders a blank silhouette.
  • Docs: adds CLAUDE.md plus AGENTS.md → CLAUDE.md, and updates AppSettings::language doc to point at i18n::SUPPORTED instead of listing codes inline.

Pullfrog  | View workflow run | Using Claude Opus𝕏

@davidbudnick davidbudnick force-pushed the feat/expand-locales branch from dcede19 to 01ef2c5 Compare May 31, 2026 23:31
@davidbudnick davidbudnick marked this pull request as ready for review May 31, 2026 23:37
Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — re-review after 01ef2c5 style(openlogi-gui): fmt + clippy landed on top of the previously approved tree. The new commit is purely mechanical and carries no behavioral change.

  • asset/mod.rs — reflow the display-name-fallback debug! macro across multiple lines; identical output.
  • mouse_model/view.rs — drop the duplicate #[allow(clippy::too_many_arguments)] attribute on label_card, rewrite its doc comment, and switch the leader-canvas paint closure pattern from |_, _, _, _| to |_, (), _, _| to destructure the unit prepaint result explicitly.
  • windows/settings.rs — reformat SelectState::new(...), try_global::<AppState>().map_or(...), and options.extend(...) to multi-line shape; add #[allow(clippy::unused_self)] to on_language_change since subscribe_in requires the &mut self handler signature even though the body never reads self.

The substantive 4→19 locale expansion, mouse-model relayout, display-name asset fallback, and settings dropdown were covered in the prior review at 91ef26b and remain unchanged. Mergeable.

Pullfrog  | View workflow run | Using Claude Opus𝕏

Copy link
Copy Markdown

@sanube sanube left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Native German speaker review of the de locale (115 strings)

Overall quality is high — the translation follows macOS German conventions throughout. Specifically:

Correctly uses macOS German UI conventions

  • "Widerrufen" for Undo (matches macOS Edit menu)
  • "Einsetzen" for Paste (matches macOS Edit menu)
  • "Sichern" for Save (matches macOS File menu)
  • "Im Dock ablegen" for Minimize (matches macOS Window menu)
  • "Bedienungshilfen" for Accessibility (matches System Settings)
  • "Bildschirmfoto" for Screenshot (matches macOS naming)
  • Correct German quotation marks „…" in the accessibility blurb

Consistent du-form throughout (appropriate for a developer/prosumer tool)

Technical terms handled wellHID++, DPI, SmartShift, Mission Control, App Exposé, Launchpad correctly left untranslated

Minor style notes (no blockers):

  • "koppele" (imperative of "koppeln") — both "koppele" and "kopple" are grammatically valid; "kopple" is slightly more natural in spoken German but "koppele" is acceptable in written UI text
  • "Eindrücken" for gesture "Click" — works, though "Klick" (noun) or "Drücken" would be more concise; all three are correct
  • "%{name} zuweisen" for "Bind %{name}" — good choice; "belegen" (keyboard shortcut term) is an equally valid alternative but "zuweisen" is more universally understood

None of these warrant changes — the translation is production-ready.

Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — re-review after 52c7a2c Merge upstream/master into feat/expand-locales landed on top of the previously approved 01ef2c5. The merge integrates master's v0.3.0 line (which itself shipped ru and a Select-based language picker via #38) into the PR branch.

  • Adopted master's windows/settings.rs implementation wholesale — the PR's LangOption / ensure_language_select / built_lang indirection is gone; SettingsView::new(window, cx) builds a SelectState<Vec<LanguageOption>> eagerly, and the "Follow system" entry sets localize_label = true so its title() calls rust_i18n::t! at render time, which re-localizes the placeholder on cx.refresh_windows() without rebuilding the state entity.
  • Integrated PR's display-name asset fallback with master's stable device ordering (#37) in state/devices.rscache.resolve(model, paired.codename.as_deref()) lives inside the per-paired-device loop, and the resulting list is then sorted by device_order_key. No conflict in behaviour.
  • Filled in ru columns left partial by master's #38 across all 115 entries in locales/app.yml; final file has no duplicate keys.
  • Picked up upstream BLE-direct HID++ enumeration (#28), settings scroll (#22), FUNDING.yml, and the v0.3.0 changelog / Cargo.toml bumps via merge — no semantic interaction with the PR's i18n work.
  • Preserved the PR's AppSettings::language doc rewrite (references i18n::SUPPORTED rather than inlining codes) over master's shorter codes-inline version.

The substantive 4→19 locale expansion, mouse-model relayout (anchors RefCell, MIN_LABEL_PITCH = 100., min_h cards), display-name asset fallback, and dropdown picker were covered in the prior reviews at 91ef26b / 01ef2c5 and remain unchanged. Settings window height is now master's 520×360 (not the PR's 560), but with overflow_y_scrollbar() the Language section is reachable; if the dropdown's expanded list ever overflows visibly, a small follow-up grow may be warranted — not blocking. Mergeable.

Pullfrog  | View workflow run | Using Claude Opus𝕏

@davidbudnick davidbudnick marked this pull request as draft June 1, 2026 14:18
@davidbudnick davidbudnick marked this pull request as ready for review June 1, 2026 14:36
@davidbudnick davidbudnick force-pushed the feat/expand-locales branch from 52c7a2c to a15166f Compare June 1, 2026 14:51
Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — re-review after the branch was rebased onto 0ca1442 (v0.3.0) and squashed into a single commit a15166f. Tree delta against the prior reviewed merge 52c7a2c is confined to windows/settings.rs — a small layout polish that closes the earlier "dropdown may overflow at 360" open question.

  • Settings window height grew 360→460 in windows::open — a middle ground between master's 360 and the PR's earlier 560, giving the Select's expanded list room without making the window feel tall.
  • Scroll container now properly bounded — the inner v_flex gained flex_1().min_h(px(0.)) so overflow_y_scrollbar() has a real height to scroll within instead of expanding to content size; this is the canonical flex-scroll fix and pairs cleanly with the existing outer size_full v_flex.
  • Language row's Select wrapped in a fixed-size shrink-0 boxdiv().flex_shrink_0().w(px(220.)).h_6() (matching the .small() input height) prevents Select's size_full root from claiming the whole row and starving the muted description into one char per line. A short comment in language_row documents the rationale.

The substantive 4→19 locale expansion, mouse-model relayout, display-name asset fallback, dropdown picker, and docs were covered in the prior reviews at 91ef26b / 01ef2c5 / 52c7a2c and remain unchanged by the rebase. Mergeable.

Pullfrog  | View workflow run | Using Claude Opus𝕏

@pullfrog
Copy link
Copy Markdown
Contributor

pullfrog Bot commented Jun 2, 2026

Pullfrog stalled

The agent stopped emitting events for 301s and was killed by the activity-timeout watchdog. 3627 events were processed before the failure.

Recent agent stderr
Performing one time database migration, may take a few minutes...
sqlite-migration:done
Database migration complete.

Pullfrog  | Rerun failed job ➔View workflow run | via Pullfrog | Using Big Pickle (free) (credentials for Anthropic not configured) | 𝕏

@davidbudnick davidbudnick force-pushed the feat/expand-locales branch from db3bb29 to 8bea020 Compare June 2, 2026 15:09
Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — incremental re-review after the branch was rebased and squashed into a single commit 8bea020. Tree is identical to the change set reviewed at a15166f; no material differences since the last Pullfrog review.

  • Locale expansion, settings dropdown, mouse-model relayout, asset fallback, and docs — all unchanged from the previously reviewed tree. The 9 files and 2076 added / 92 deleted lines match the prior review exactly.

Pullfrog  | View workflow run | Using Big Pickle (free) (credentials for Anthropic not configured) | 𝕏

@davidbudnick davidbudnick force-pushed the feat/expand-locales branch from 8bea020 to 9896bac Compare June 2, 2026 15:13
@pullfrog
Copy link
Copy Markdown
Contributor

pullfrog Bot commented Jun 2, 2026

Pullfrog stalled

The agent stopped emitting events for 301s and was killed by the activity-timeout watchdog. 3940 events were processed before the failure.

Recent agent stderr
Performing one time database migration, may take a few minutes...
sqlite-migration:done
Database migration complete.

Pullfrog  | Rerun failed job ➔View workflow run | via Pullfrog | Using Big Pickle (free) (credentials for Anthropic not configured) | 𝕏

@davidbudnick davidbudnick force-pushed the feat/expand-locales branch from 9896bac to 589cd67 Compare June 2, 2026 15:20
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.

2 participants