Skip to content

feat(i18n): Portuguese localization for app chrome, cards, dialogs and pages - #185

Open
yanhenrique-dev wants to merge 2 commits into
OpenMouse-Project:control-panelfrom
yanhenrique-dev:feat/i18n-pt-chrome
Open

feat(i18n): Portuguese localization for app chrome, cards, dialogs and pages#185
yanhenrique-dev wants to merge 2 commits into
OpenMouse-Project:control-panelfrom
yanhenrique-dev:feat/i18n-pt-chrome

Conversation

@yanhenrique-dev

@yanhenrique-devyanhenrique-dev commented Sep 6, 2026

Copy link
Copy Markdown

What

Adds an locale preference (en/pt, persisted in the shared interface settings, browser-detected on first run) with a typed dictionary (src/i18n.ts) that falls back to English per key, plus a parity test.

UI: globe dropdown in the sidebar section-nav, Language card in Settings (reuses Segmented), and EN|PT toggles on landing, FAQ, device check, supported list, donate and admin. The stored choice travels across pages via the same localStorage key.

Coverage

Sidebar, Settings, workspace tabs, Overview, pending bar, toasts, all device cards (DPI, polling, lighting, MX, ATK-gated cards also compile), Logitech/Keychron editors, support/capture/share dialogs, landing, FAQ (also adopts the shared site-chrome), device check + scan notes (Discord summary stays English), supported list (incl. new tag/brand dropdowns), donate (pt-BR currency), admin (Intl dates/weekdays), offline banner, and controller status/error/throw messages translated at event time.

Deliberately untouched

Device-provided values, hardware-written option values (only display labels translate), server-bound select values (explicit English value=), pending-bar change shorthand, HID/firmware/network passthrough errors, and static <title> tags.

Verification

  • tsc --noEmit: clean
  • node --test src/**/*.test.ts: 125/125 pass (incl. new locale + parity tests)
  • Upstream features newer than the working copy were preserved/ported: ATK cards + pairing flow, Mchose clients, generic capability lookups, dpiStageColors, debounceOptions, per-brand processing labels, turbo/button-combo/long-range toggles, applyPowerMode/applyDeviceButtonMapping/applyProfileSelection/applyAngleTuning, site-chrome + FAQ page, supported tag/brand dropdowns.
image

X - https://x.com/Yanhenriqueofc

…d pages
Adds a locale preference (en/pt, persisted, browser-detected on first
run) with a shared dictionary and English fallback, a globe dropdown in
the sidebar plus a Language card in Settings, and EN|PT toggles on the
standalone pages.
Covers sidebar, settings, tabs, overview, pending bar, toasts, device
cards, Logitech/Keychron editors, support/capture/share dialogs, landing,
FAQ, device check, supported list, donate, admin console and controller
status/error messages. Device-provided values, hardware-written option
values and server-bound fields stay untouched.
The full en+pt dictionary pushed the JS aggregate ~82 kB over budget
(873 kB vs 790 kB). Split pt into its own chunk (i18n-pt-*.js) loaded on
demand: t() falls back to English until ensureLocale() resolves, locale
switches await the table before committing (no fallback flash), and a
stored non-English locale re-renders once after first paint. Raise the
JS budget to 885 kB with headroom for the remaining dictionary weight.
Sign up for freeto 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

@yanhenrique-dev