Repository navigation
feat(i18n): add Brazilian Portuguese (pt-BR) UI locale - #6526
janderson-fagner wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughPortuguese ( 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/shared/ui-language.ts (1)
7-25: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a short why comment for the canonical
ptkey.Using plain
pthere is a non-obvious product constraint: the UI exposes Brazilian Portuguese, while system locales likept-BRandpt-PTnormalize to this single catalog. A one-line comment here would make that contract much easier to preserve.Proposed diff
-export const UI_LANGUAGE_PORTUGUESE = 'pt' +// Why: Brazilian Portuguese ships under the canonical `pt` key, and +// `pt-BR`/`pt-PT` system locales normalize to this single catalog. +export const UI_LANGUAGE_PORTUGUESE = 'pt'As per coding guidelines,
**/*.{ts,tsx,js,jsx}files should add a short why comment when code is driven by a design doc or non-obvious constraint.Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: b1d00d1f-f091-4c70-a344-ecb23bc8626e
📥 Commits
Reviewing files that changed from the base of the PR and between 14f0096 and 4a633f750a0a398a6ed6927c338f3d1559d2f9af.
📒 Files selected for processing (12)
src/main/i18n/main-i18n.tssrc/renderer/src/i18n/i18n.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/pt.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/i18n/supported-languages.tssrc/shared/ui-language.tssrc/shared/ui-locale.test.tssrc/shared/ui-locale.ts
Add Portuguese (Brazil) as a selectable UI language, shown as "Português (Brasil)" in Settings > Appearance. - Register the `pt` locale across shared, renderer, and main i18n (ui-language, ui-locale, i18n.ts, main-i18n.ts, supported-languages). - Add `pt.json` translation catalog with full key parity against en.json (placeholders preserved; product names, CSS, and URLs left untranslated). - Add the `portuguese` language label key to all existing locale catalogs. - Cover the new locale in ui-locale.test.ts. The locale code stays a 2-letter `pt` to match the existing locales; normalizeSupportedUiLocale maps pt-BR/pt-PT system locales to `pt`.
4a633f7 to
b9c5708
Compare
|
Ready to review this PR? Stage has broken it down into 5 individual chapters for you: Chapters generated by Stage for commit b9c5708 on Jun 30, 2026 11:54pm UTC. |
|
Thank you for putting this together — and I am sorry it sat unanswered for so long, which is on us, not you. We are not taking on new UI locales right now. Orca ships en/es/ja/ko/zh, and each one carries ongoing cost beyond the initial catalog: every new English string has to be re-translated, the build-time repair policy needs per-locale glossary and override rules, and mistranslations reach users in surfaces nobody on the team can read. We are currently working through a backlog of correctness bugs in the five we already ship, and adding a sixth before that is under control would not be fair to the people using it. That is a decision about our capacity, not about the quality of your work. Closing so the queue reflects reality rather than leaving it open indefinitely — if that changes, this is easy to reopen and we will come back to the contributors who offered first. Thanks again for the time you put in. |
|
I'm sorry — I closed this, and that was the wrong call. Reopening it. The reasoning I gave (that we aren't taking on new built-in locales right now) is still true, but closing your PR was not the right way to act on it. You did the work, it sat for months without a reply, and then it got closed with an explanation of our constraints. That's a bad trade for you, and I apologize. Here's what's actually going on. We do want these locales. What we can't currently take on is maintaining them in-tree, where every new English string becomes translation debt across every catalog and a mistranslation ships to users in a surface nobody on the team can read. So the direction we're working toward is the one where that maintenance sits with the people who actually speak the language: plugin language packs. Most of that mechanism is already in the repo today:
The test fixture for that manifest contract uses What's not there yet is the part that would make this pleasant for you: there's no authoring guide, no scaffolding to generate a starter catalog from I'd rather leave this open and come back to you when that lands than close it and have you find out from a changelog. If you'd prefer to close it yourself in the meantime, that's entirely your call — but it should be yours, not mine. Thanks for the work, and sorry again for how I handled it. |
|
Thank you @janderson-fagner for contributing to Brazilian Portuguese support! Brazilian Portuguese is now checked into I verified that you are credited as a commit co-author in the merged commit. Closing this PR as superseded by the merged built-in support. Thank you for your work and patience! |
What this changes
Adds Brazilian Portuguese (pt-BR) as a selectable UI language. It appears as "Português (Brasil)" in Settings → Appearance → Language and switches the interface live, like the other locales.
Why
Orca already supports
en,es,ja,ko, andzh, but had no Portuguese option despite a sizeable Brazilian user base. This wiresptinto the existing i18n infrastructure with full key parity.Implementation
ptlocale across shared, renderer, and main i18n:shared/ui-language.ts,shared/ui-locale.ts,renderer/i18n/i18n.ts,main/i18n/main-i18n.ts,renderer/i18n/supported-languages.ts.src/renderer/src/i18n/locales/pt.jsontranslation catalog with full key parity againsten.json(same keys, same{{placeholders}}).portugueselanguage label key to every existing locale catalog.ui-locale.test.tsto cover the new locale.Design note: the locale code is the 2-letter
pt(consistent with the existing locales).normalizeSupportedUiLocalealready splits on-, so system localespt-BR/pt-PTresolve topt. Content is Brazilian Portuguese; the in-UI label disambiguates as "Português (Brasil)".Product names, CSS/keyframes, and URLs were intentionally left untranslated.
Visual change
Yes — a new entry in the language selector and the full UI in Portuguese when selected. Validated locally on Windows: selecting "Português (Brasil)" translates menus, the sidebar, Settings, and Source Control, with placeholders rendering correctly and proper accentuation. (Screenshots can be attached to the PR conversation.)
AI code review summary
Checks run
pnpm lint(incl.verify:localization-catalogparity +verify:localization-coverage),pnpm typecheck(node + web), and the i18n/locale test suite all pass.ELI5
Brazilian Portuguese (pt-BR) is a full UI language option under Settings → Appearance → Language, same as English, Spanish, Japanese, and others.