Skip to content

feat(i18n): add Brazilian Portuguese (pt-BR) shell locale - #974

Merged
vastsa merged 7 commits into
vastsa:mainfrom
magisph:feat/pt-br-shell-locale
Sep 23, 2026
Merged

vastsa merged 7 commits into
vastsa:mainfrom
magisph:feat/pt-br-shell-locale

Conversation

@magisph

@magisph magisph commented Sep 23, 2026

Copy link
Copy Markdown

Summary

Introduces Brazilian Portuguese (pt-BR) as a supported shell locale for PI-Desktop, following ADR 0306 and Decision D605.

Brazil represents an active developer base. This addition delivers an idiomatic, native, and professionally audited Portuguese experience that respects established developer terminology and strict desktop UI density constraints.

Changes (25 files, +3,241 −14)

Localization Catalog (packages/i18n/src/locales/pt-BR/index.ts)

  • Full parity with the canonical English catalog (2,146 / 2,146 leaf keys translated).
  • Preservation of established developer jargon and brand identities (Anthropic, Together AI, Fireworks, Zhipu AI Coding Plan, OpenAI Chat Completions, OpenAI Responses, Anthropic Messages, Google Generative AI, macOS, Codex, Markdown, Tokens, Prompt, Pair).
  • Compact button labels and chip states to prevent UI clipping/overflow in narrow windows.
  • Zero Spanish/Portuñol false friends and zero unprompted parenthetical explanations.

Release History (packages/shared/src/changelog-pt-BR.ts)

  • All 77 shipped versions (from 0.1.0 through 0.15.6) synchronized 1:1 with changelog.ts.

Specifications & Governance

  • ADR 0306: Added in docs/adr/0306-portuguese-brazil-shell-locale.md and indexed in docs/adr/README.md.
  • Decision Log: Recorded under D605 in both docs/spec/08-meta/decisions-log.md and docs/zh-CN/spec/08-meta/decisions-log.md.
  • UX Specs: Updated docs/spec/04-ux/02-i18n-english-first.md and docs/zh-CN/spec/04-ux/02-i18n-english-first.md.

Runtime & IPC Integration

  • Preload and runtime language mappings resolve pt, pt-BR, pt_BR, and pt-PT to pt-BR.
  • Exported ptBR and ptBRDefault in @pi-desktop/i18n.

Verification & Test Results

  • TypeScript Compilation: tsc -p packages/i18n/tsconfig.json (exit 0)
  • Strict Typecheck: tsc -p packages/i18n/tsconfig.json --noEmit (exit 0)
  • i18n Catalogs: vitest run packages/i18n/test/catalogs.test.mjs (9/9 pass)
  • Monorepo Shared: vitest run --root packages/shared (84 files, 1,012/1,012 pass)
  • Changelog Tests: vitest run packages/shared/src/changelog.test.ts (4/4 pass)
  • Desktop Integration: node --test apps/desktop/test/settings-general.test.mjs ... (94/94 pass)
  • Release Gate: node scripts/check-release-docs.mjs (aligned with 0.15.6, exit 0)
  • PR Base Gate: node scripts/check-pr-base-main.mjs (origin/main ancestor check, exit 0)
  • E2E Scenarios: No protocol changes; zero regressions on existing shell flows.

Risk & Rollback

  • Breaking changes: None. The fallback default remains English (en).
  • Rollback: Safe and self-contained; locale selection is isolated within standard @pi-desktop/i18n resolution.

@vastsa
vastsa merged commit 46ac6cf into vastsa:main Sep 23, 2026
@vastsa

vastsa commented Sep 23, 2026

Copy link
Copy Markdown
Owner

Thanks for adding Brazilian Portuguese support. PR #974 was merged with a merge commit, preserving your original commit.

I added follow-up copy fixes on top: corrected mixed Spanish/Portuguese wording throughout the UI catalog and all 77 release-note entries; restored permission, clipboard, provider-credential, network, and retry-cost disclosures; fixed misleading action, keyboard, queue, and error copy; and added the two current-main catalog keys. I also added semantic copy assertions, pt-BR picker coverage in the Electron settings E2E, and updated the EN/ZH-CN E2E plan.

Validation: i18n tests 27/27; shared tests 1,012/1,012; desktop typecheck passed; all 108 targeted locale/plugin desktop tests passed; desktop build and pt-BR Electron picker E2E passed; release-docs and PR-base gates passed. GitHub reported no CI checks. The full desktop suite had one unrelated failure (2,743/2,744): test/context-compaction.test.mjs expects an old contextBudgetFor(input.model...) source shape; the failing test and implementation are identical to latest main.

@magisph

magisph commented Sep 23, 2026

Copy link
Copy Markdown
Author

Thanks for merging and polishing it up! Glad to have pt-BR supported.

@magisph
magisph deleted the feat/pt-br-shell-locale branch September 23, 2026 21:51
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.

2 participants