Uh oh!
There was an error while loading. Please reload this page.
feat(i18n): Portuguese localization for app chrome, cards, dialogs and pages - #185
Open
yanhenrique-dev wants to merge 2 commits into
Open
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an
localepreference (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: cleannode --test src/**/*.test.ts: 125/125 pass (incl. new locale + parity tests)X - https://x.com/Yanhenriqueofc