Skip to content

feat(i18n): add complete pt-BR (Portuguese Brazil) translation catalog - #7974

Closed
eusoucarlosmedeiros wants to merge 1 commit into
stablyai:mainfrom
eusoucarlosmedeiros:feat/pt-br-translation
Closed

eusoucarlosmedeiros wants to merge 1 commit into
stablyai:mainfrom
eusoucarlosmedeiros:feat/pt-br-translation

Conversation

@eusoucarlosmedeiros

@eusoucarlosmedeiros eusoucarlosmedeiros commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add full Portuguese (Brazil) translation support across the Orca desktop app. All user-facing strings now pass through i18n so Portuguese displays correctly.

What's included

  • New pt.json catalog with 10349 keys fully translated (Brazilian Portuguese)
  • Registration of pt locale in i18n infrastructure (loaders, language picker, locale resolution)
  • Translation policy additions: BRAND_MISTRANSLATIONS (Agent/Agentes), phrase fixes, value overrides, and search-keyword overrides for pt
  • Fix hardcoded strings: Claude rate-limited error message and DevTools toast now use ranslate() instead of raw English
  • Locale catalog sync: en.json, es.json, ja.json, ko.json, zh.json synced via pnpm sync:localization-catalog

Verification

  • pnpm lint - 0 errors
  • pnpm typecheck - no errors
  • pnpm test - 42 locale/i18n tests pass
  • pnpm verify:localization-catalog - parity verified (10349 keys across all 6 locales)
  • pnpm verify:localization-coverage - 0 unlocalized candidates
  • pnpm build (Electron) - compiled successfully

Notes

Cross-platform, SSH, and multi-provider safe - locale files are completely agnostic to these concerns.

ELI5

Orca gains a full Brazilian Portuguese translation catalog and wires it into language selection. Portuguese-speaking users can run the desktop UI in pt-BR with complete string coverage.

Add full Portuguese (Brazil) translation support across the app:
- New pt.json catalog with 10349 keys fully translated
- Register pt locale in i18n infrastructure and language picker
- Add translation policy (BRAND_MISTRANSLATIONS, phrase/value/search-keyword overrides)
- Fix hardcoded strings: rate-limited Claude message and DevTools toast now use translate()
- Sync en.json and existing locale files via catalog sync

Includes all CONTRIBUTING.md verification: lint, typecheck, tests, build.
@coderabbitai

coderabbitai Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Portuguese is added as a supported UI language and locale, including shared language constants, normalization, locale resolution, language selection, and lazy loading. Catalog tooling gains Portuguese translations, phrase fixes, value overrides, search keywords, brand corrections, and menu-label repairs. Renderer locale files add Portuguese language labels and shared Claude and DevTools strings. DevTools toast descriptions and Claude usage errors now use localized translation keys.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately summarizes the main change: adding Portuguese (Brazil) i18n support.
Description check ✅ Passed It covers summary, changes, verification, and notes, but omits the screenshots, AI review, and security audit sections.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
config/scripts/locale-translation-policy.mjs (1)

627-641: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Nice consolidation of the zh/ko menu-label fixes into a generic locale-keyed lookup.

Minor nit: MENU_LABEL_FIXES is declared inline inside repairCatalog, so it's reconstructed on every call, unlike BRAND_MISTRANSLATIONS/NATIVE_PICKER_LABELS which live at module scope. Since this runs in a one-shot build script, the perf cost is negligible — purely a consistency/readability nit if you want to hoist it alongside the other locale tables.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b324157f-c9f0-4bb4-9657-13a1e08f2960

📥 Commits

Reviewing files that changed from the base of the PR and between 1b0febc and 9713ff6.

📒 Files selected for processing (21)
  • config/scripts/bootstrap-locale-catalog.mjs
  • config/scripts/locale-key-overrides.mjs
  • config/scripts/locale-phrase-fixes.mjs
  • config/scripts/locale-pt-phrase-fixes.mjs
  • config/scripts/locale-pt-value-overrides.mjs
  • config/scripts/locale-search-keyword-overrides.mjs
  • config/scripts/locale-translation-policy.mjs
  • config/scripts/locale-value-overrides.mjs
  • src/main/i18n/main-i18n.ts
  • src/renderer/src/components/settings/DevToolsPane.tsx
  • src/renderer/src/components/status-bar/usage-error-copy.ts
  • src/renderer/src/i18n/i18n.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/i18n/supported-languages.ts
  • src/shared/ui-language.ts
  • src/shared/ui-locale.ts

Comment on lines +133 to +136
return translate(
'auto.components.status.bar.tooltip.claudeRateLimited',
'Claude usage is rate limited right now.'
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use a 10-char hash key instead of claudeRateLimited.

Every other translation key in getProviderUsageErrorMessage uses a 10-character hex hash (e.g., 2c35eca8d4, 3d3c9c0c1f, a7517cccb6). The new key claudeRateLimited breaks this convention with a descriptive name. As per coding guidelines, settings/localizable strings should use hash-based locale keys with translate('auto.components.<Dir>.<ComponentFile>.<10-char-hash>', 'Default English text').

♻️ Suggested fix: use a 10-char hash key
       case 'missing-credentials':
       case 'rate-limited':
         return translate(
-          'auto.components.status.bar.tooltip.claudeRateLimited',
+          'auto.components.status.bar.tooltip.<10-char-hash>',
           'Claude usage is rate limited right now.'
         )

Generate the hash the same way other keys in this file were produced (e.g., via pnpm bootstrap:locale-catalog or the project's key-generation tooling), then update the locale catalogs accordingly.

Source: Learnings

@AmethystLiang

Copy link
Copy Markdown
Contributor

We'd love to add pt-BR support! Doing a refactoring of our i18n implementation now so give us a few days to land this PR

@nwparker nwparker added the enhancement New feature or request label Jul 27, 2026
@nwparker

nwparker commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

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.

@nwparker nwparker closed this Aug 4, 2026
@nwparker

nwparker commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

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:

  • a plugin manifest declares contributes.languagePacks: [{ locale, path }]
  • the pack is a plain catalog JSON with the same key shape as src/renderer/src/i18n/locales/en.json
  • packs are content-integrity verified and approval-gated at install, then registered into i18next at runtime
  • they appear in Settings → Appearance → Language next to the built-in locales
  • Intl formatting — dates, relative times, number formats — resolves through the locale tag the pack declares

The test fixture for that manifest contract uses pt-BR as its worked example, so this isn't hypothetical plumbing.

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 en.json, no re-sync story when English strings change, and the glossary/repair tooling we use for the built-in locales isn't exposed to pack authors. That's the work in front of us. I'm not going to give you a date I can't keep.

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.

@AmethystLiang

Copy link
Copy Markdown
Contributor

Thank you @eusoucarlosmedeiros for contributing to Brazilian Portuguese support! Brazilian Portuguese is now checked into main as a built-in UI language via #31627, which also includes migration from the legacy Portuguese plugin.

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants