Skip to content

feat: add Brazilian Portuguese locale#1653

Open
Alcimerio wants to merge 5 commits into
getpaseo:mainfrom
Alcimerio:add-pt-br-locale
Open

feat: add Brazilian Portuguese locale#1653
Alcimerio wants to merge 5 commits into
getpaseo:mainfrom
Alcimerio:add-pt-br-locale

Conversation

@Alcimerio

@Alcimerio Alcimerio commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Linked issue

Closes #1639

Type of change

  • Bug fix
  • New feature (with prior issue + design alignment)
  • Refactor / code improvement
  • Docs

What does this PR do

Adds Brazilian Portuguese (pt-BR) as a supported client UI locale. System locales pt-BR and bare pt now resolve to Brazilian Portuguese, while non-Brazilian Portuguese regional locales such as pt-PT and pt-AO continue to fall back to English until dedicated resources exist.

How did you verify it

Manual web test:

  • Switched the app to Brazilian Portuguese and checked the main home screen.
home
  • Opened Settings → General and checked the language menu with Português brasileiro - Brazilian Portuguese.
settings

Not verified:

  • Desktop: I tried npm run dev:desktop, but Electron would not launch in my local checkout. Likely skill issue/local setup on my side.
  • iOS/Android: not tested because I did not have simulator/device access at the time.

Checklist

  • One focused change. Unrelated cleanups split out.
  • npm run typecheck passes
  • npm run lint passes
  • npm run format ran (Biome)
  • UI changes include screenshots or video for every affected platform tested
  • Tests added or updated where it made sense

@Alcimerio Alcimerio marked this pull request as ready for review June 22, 2026 00:22
@Alcimerio Alcimerio changed the title Add Brazilian Portuguese locale feat: add Brazilian Portuguese locale Jun 22, 2026
@greptile-apps

greptile-apps Bot commented Jun 22, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds Brazilian Portuguese (pt-BR) as a fully-supported client UI locale, covering all migrated translation surfaces with complete key parity to English.

  • New packages/app/src/i18n/resources/pt-BR.ts provides ~1,900 translated strings matching the English key shape exactly; the TypeScript type constraint (TranslationResources) and the key-parity test enforce this.
  • locales.ts registers pt-BR in the SupportedLocale type, LANGUAGE_OPTIONS, native-name maps, and resolveSupportedLocale; the resolver explicitly maps only \"pt\" (bare) and \"pt-br\" to pt-BR, leaving pt-PT/pt-AO and other regional variants falling back to English — fully tested and documented.
  • resources.test.ts adds ptBR to the key-parity, fallback-ratio (≤ 25% English strings), and interpolation-placeholder guards, and also fills in the pre-existing zhCN gap in the fallback-ratio test.

Confidence Score: 5/5

Safe to merge — adds a new locale with no changes to existing logic paths.

The change is additive: a new resource file, new entries in existing maps, and new test assertions. The TypeScript type system enforces key parity at compile time, the runtime key-parity and fallback-ratio tests guard translation completeness, and the locale-resolution tests explicitly cover the pt-PT/pt-AO exclusion. All existing locale paths are untouched.

No files require special attention.

Important Files Changed

Filename Overview
packages/app/src/i18n/resources/pt-BR.ts New complete pt-BR translation resource with full key parity to English; all interpolation placeholders preserved.
packages/app/src/i18n/locales.ts Adds pt-BR to SupportedLocale, LANGUAGE_OPTIONS, LANGUAGE_NATIVE_NAMES, and LANGUAGE_NAMES_BY_LOCALE; resolveSupportedLocale explicitly maps only "pt" and "pt-br" to pt-BR, leaving pt-PT/pt-AO as English fallbacks.
packages/app/src/i18n/locales.test.ts Good test coverage: explicit assertions for pt-BR explicit selection, system locale mapping (pt and pt-BR), and negative cases (pt-PT and pt-AO return "en").
packages/app/src/i18n/resources.test.ts ptBR added to key-parity, fallback-ratio (zhCN also now included closing the prior gap), and interpolation-placeholder guards; model count label pinned.
packages/app/src/i18n/i18next.ts ptBR resource registered under "pt-BR" key; straightforward and correct.
docs/i18n.md pt-BR added to locale list; parity-test description updated; Batch 5A progress note added.
packages/app/src/screens/settings-screen.tsx No logic changes; pt-BR flows through the LANGUAGE_OPTIONS import automatically.

Reviews (2): Last reviewed commit: "Test zh-CN translation fallback coverage" | Re-trigger Greptile

Comment thread packages/app/src/i18n/resources.test.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add Brazilian Portuguese app locale

1 participant