[PR #10086] feat(i18n): add br locale support #13329

Closed
opened 2026-02-16 18:18:11 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/10086

State: closed
Merged: Yes


Closes #10085

Summary

  • Added Portuguese (Brazil) translations using br locale code
  • Implemented locale detection for pt/pt-br/pt-BR variants mapping to br
  • Updated all existing language files with br label
  • Follows the pattern established by recent i18n PRs (#10018, #9887, #9882, #9947)

Changes

  • Created packages/app/src/i18n/br.ts with 661 translation keys
  • Created packages/ui/src/i18n/br.ts with 93 translation keys
  • Updated packages/app/src/context/language.tsx:
    • Added br to Locale type and LOCALES array
    • Updated detectLocale() to map pt variants to br
    • Added br dictionary imports and merging
  • Added language.br key to all 13 existing translation files

Rationale for br locale code

Using br instead of pt-br for:

  • Consistency with other locale codes in the codebase (en, zh, ko, de, etc.)
  • Simplicity and brevity
  • Browser locale detection still works seamlessly (pt/pt-br/pt-BR → br)

Testing

  • All translation keys complete and verified
  • No references to old pt-br remain in codebase
  • Local testing pending (screenshots to be added after review)

Checklist

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/10086 **State:** closed **Merged:** Yes --- Closes #10085 ## Summary - Added Portuguese (Brazil) translations using `br` locale code - Implemented locale detection for pt/pt-br/pt-BR variants mapping to `br` - Updated all existing language files with br label - Follows the pattern established by recent i18n PRs (#10018, #9887, #9882, #9947) ## Changes - Created `packages/app/src/i18n/br.ts` with 661 translation keys - Created `packages/ui/src/i18n/br.ts` with 93 translation keys - Updated `packages/app/src/context/language.tsx`: - Added `br` to `Locale` type and `LOCALES` array - Updated `detectLocale()` to map pt variants to `br` - Added br dictionary imports and merging - Added `language.br` key to all 13 existing translation files ## Rationale for `br` locale code Using `br` instead of `pt-br` for: - Consistency with other locale codes in the codebase (en, zh, ko, de, etc.) - Simplicity and brevity - Browser locale detection still works seamlessly (pt/pt-br/pt-BR → br) ## Testing - [x] All translation keys complete and verified - [x] No references to old `pt-br` remain in codebase - [ ] Local testing pending (screenshots to be added after review) ## Checklist - [x] Code follows existing patterns - [x] All translation files updated - [x] Language detection works correctly - [x] Linked to issue #10085
yindo added the pull-request label 2026-02-16 18:18:11 -05:00
yindo closed this issue 2026-02-16 18:18:11 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13329