feat(ui): internationalize the console with i18next (en + pt-BR) - #80
Merged
Conversation
Adds react-i18next + i18next with browser-locale detection, a LanguageSwitcher, and en/pt-BR translation bundles, wiring the auth screens, pages, and shared components through t().
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 free
to 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
Internationalizes the EmbedBase console with
i18next+react-i18next— English and Brazilian Portuguese (pt-BR), aLanguageSwitcherin the top bar, and browser-locale detection with a persisted choice.ui/src/i18n/— init (index.ts), locale detection + persistence (detect.ts), a translated API-error helper (apiError.ts→apiErrorMessage(e, t), used across the error paths), typed keys (i18next.d.ts), and a compile-time parity guard (parity.ts) that failstscif the two locales' key sets ever diverge.ui/src/i18n/locales/{en,pt-BR}/translation.json— the string catalogs (550 keys each).LanguageSwitcher.tsx(in theTopbar), plus ~44 screens / pages / components wired throught()/<Trans>.Provenance
This existed only as uncommitted stashed WIP (made on an older
main, before the recent MCP PRs). It's been applied onto currentmain— cleanly, zero git conflicts — and committed here. It was never in a prior PR, which is why the translation didn't appear on the deployed console.Verification
npm run build(tsc && vite build) green — 2962 modules transformed.tsc --noEmitgreen — and viaparity.tsthat also proves en/pt-BR key parity, confirmed independently: 550 / 550, nothing missing either way.mainchanged since the stash base —ui/src/components/settings/McpPanel.tsx— is i18n-only in the diff and preservesmain's LAN-address logic (theisLocal→ LAN-IP swap). The other 43 files are i18n on filesmainhadn't touched since the base, so nothing could be reverted.Caveat
Completeness is enforced for every key in use (the parity guard) and the screens I spot-checked render fully translated — but I did not exhaustively scan all 44 files for a stray hardcoded string the original i18n pass might have missed. A follow-up grep pass could close that.