feat(desktop): add Brazilian Portuguese (pt-BR) locale (i18n) - #76863
feat(desktop): add Brazilian Portuguese (pt-BR) locale (i18n)#76863celsocba1 wants to merge 1 commit into
Conversation
Full pt-BR translation of en.ts: 2967 lines, complete key parity with main. Registers 'pt' in Locale union, LOCALE_OPTIONS (+aliases) and TRANSLATIONS. Untranslated future keys fall back to English via defineLocale pattern. i18n suite: 28/28 pass. Closes NousResearch#40239
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused pt-BR desktop locale contribution. The feature is still absent from current main: apps/desktop/src/i18n/types.ts:8, languages.ts:7-38, and catalog.ts:8-14 register no pt locale. The PR's wiring follows the existing defineLocale() fallback pattern.
Problems
- The new aliases and persisted
ptvalue lack regression coverage. Currentapps/desktop/src/i18n/languages.test.ts:6-46tests normalization, recognition, and config values for every existing locale, but this diff changes no tests. The comparable Arabic locale commit5b6990e7a056added those tests.
Suggested changes
- Add
pt/pt-BRalias normalization, exact-locale recognition, supported-config-alias, and persisted-config-value assertions toapps/desktop/src/i18n/languages.test.ts.
Automated hermes-sweeper review.
| العربية: 'ar' | ||
| العربية: 'ar', | ||
| pt: 'pt', | ||
| 'pt-br': 'pt', |
There was a problem hiding this comment.
Please add regression coverage in languages.test.ts for pt-BR normalization and the corresponding pt exact-id/config-value behavior. Existing locale additions, including Arabic in 5b6990e7a056, extend these tests.
|
I reviewed and tested this PR on top of It:
Patch (secret/unlisted Gist): https://gist.github.com/lucasmariano003-wq/bd5fbadc949faee701380e8301c01601 SHA-256: Verified to apply cleanly to PR head Validation:
The Gist contains a format-patch that can be applied with |
Summary
Adds complete Brazilian Portuguese (pt-BR) localization for the desktop app.
apps/desktop/src/i18n/pt.ts— full translation ofen.ts:2,967 lines / 2,003 keys, 100% parity with the current
mainen.ts(generated structurally from
en.ts, so every key exists — no missing orextra keys).
ptintypes.ts(Locale union),languages.ts(LOCALE_OPTIONS entry "Português" + aliases:
pt,pt-br,pt_br,pt-pt,pt_pt,portuguese,português), andcatalog.ts(TRANSLATIONS).(2,958-line
en.ts, 2,713 keys) and then re-synced against currentmain— including the 8 newer keys (terminalFont*,sshRemoteProfile*,openDirective).defineLocale()pattern — untranslated future keys fallback to English automatically.
Testing
vitest src/i18n/languages.test.ts— 4/4 passvitest run --project ui src/i18n/— 28/28 pass(languages, runtime, plugin-i18n, context — includes the new
ptlocale)npm run build— clean (11.2s), pt-BR strings present in bundleunder Settings → Language, persists across restarts (verified on v0.17.0)
Files changed (4)
apps/desktop/src/i18n/pt.tsapps/desktop/src/i18n/types.ts'pt'to Locale unionapps/desktop/src/i18n/languages.tsapps/desktop/src/i18n/catalog.tsptimport + TRANSLATIONS entryNote: previous attempts (#38846 — 15-language hybrid JSON+TS, 522 files; #40439 —
pt-BR) were closed unmerged. This is a minimal change matching the current
mainstructure (2-space indent,
Translationstype,LOCALE_OPTIONSwithenglishName).