Skip to content

feat(i18n): coordinate Brazilian Portuguese locale support - #22751

Open
Magaav wants to merge 11 commits into
NousResearch:mainfrom
Magaav:codex/pt-br-coordination
Open

feat(i18n): coordinate Brazilian Portuguese locale support#22751
Magaav wants to merge 11 commits into
NousResearch:mainfrom
Magaav:codex/pt-br-coordination

Conversation

@Magaav

@Magaav Magaav commented May 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Coordination PR for the overlapping Brazilian Portuguese / Portuguese localization work.

This branch intentionally merges the active pt-BR PR lanes into one maintainer-friendly branch while preserving contributor commits:

Why

#22063 was flagged as overlapping with #15737 and #20443. Rather than asking maintainers to manually reconcile the same locale across several PRs, this branch provides a single integration candidate that keeps the work separated by surface area:

  • Web UI locale: web/src/i18n/*, LanguageSwitcher
  • CLI/gateway locale catalogs: agent/i18n.py, locales/pt*.yaml, config docs/tests
  • Docs locale: README.pt-BR.md, Docusaurus pt-BR docs

Additional coordination polish

On top of the merged contributor branches, this PR adds a tiny compatibility layer from #22063:

  • shows PT-BR in the compact language switcher so Brazilian Portuguese is distinct from generic Portuguese
  • normalizes stored pt and lowercase pt-br locale values to pt-BR, which makes earlier Web UI attempts migrate cleanly

Maintainer path

If maintainers prefer smaller PRs, this PR can be used as the reference merge plan:

  1. Merge feat(i18n): add pt-BR web UI translations (salvage of #15737) #22182 for Web UI pt-BR, crediting feat(i18n): add Portuguese (pt-BR) language support #15737 and feat(i18n): add Brazilian Portuguese locale #22063.
  2. Merge feat(i18n): add Portuguese locale support #20443 for CLI/gateway Portuguese locale support.
  3. Merge docs: add Brazilian Portuguese README and documentation (pt-BR) #22178 for pt-BR docs.
  4. Carry over this PR's final compatibility commit if the smaller PR path is chosen.

If maintainers prefer one PR, this branch is the combined candidate.

Validation

  • git diff --check
  • python3 -m py_compile agent/i18n.py hermes_cli/config.py
  • uv run --extra dev pytest tests/agent/test_i18n.py -q → 31 passed
  • npm --prefix web ci → installed with Node engine warnings for the existing Node 18 environment
  • ./web/node_modules/.bin/tsc -b web/tsconfig.json

Notes

No secrets touched. This is intentionally a coordination PR; it preserves the original contributors' commits and should not erase their credit.

pedroborges and others added 11 commits May 5, 2026 18:59
Adds Portuguese and Brazilian Portuguese catalogs to the static-message i18n layer, with aliases that preserve pt-BR resolution before regional fallback.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Keeps the default display.language guidance in sync with the newly supported static-message locales.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Documents pt and pt_BR as supported display.language values so users can discover the new static-message translations.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…cale

Add native pt-BR translation of the main README plus bootstrap of the
Docusaurus pt-BR locale, complementing existing pt-BR work in flight.

- README.pt-BR.md: full native translation of README.md (mirrors the
  README.zh-CN.md structural template; not a machine translation).
- README.md / README.zh-CN.md: add bidirectional language badge to
  README.pt-BR.md.
- website/docusaurus.config.ts: register `pt-BR` alongside `en` and
  `zh-Hans` with localized label "Português (Brasil)".
- website/i18n/pt-BR/.../features/image-generation.md: seed translation
  of the image-generation guide to mirror the parity coverage that
  zh-Hans currently has (3 docs translated). Additional pages can be
  added incrementally without further config changes.

This contribution intentionally avoids overlap with the in-flight pt-BR
PRs:

- NousResearch#15737 (web/src/i18n/pt.ts)        -- Web UI strings
- NousResearch#20443 (locales/pt.yaml + agent/i18n.py) -- CLI runtime catalog
- NousResearch#22063 (web/src/i18n/pt-BR.ts)     -- Web UI strings

Surfaces here (root README + Docusaurus docs site i18n) are not touched
by any of the above.
)

Salvage of NousResearch#15737 by @carloshenriquecarniatto (CONFLICTING with main).
Completes the work with full key parity to en/zh + native pt-BR translations.

- Add `pt-BR` to Locale union in web/src/i18n/types.ts
- New web/src/i18n/pt-BR.ts mirroring en.ts structure (all 16 sections)
- Register `pt-BR` in TRANSLATIONS map + add isLocale type guard
- Refactor LanguageSwitcher from binary toggle to N-locale cycle
  via LOCALE_CONFIG map (EN -> ZH -> pt-BR -> EN)

Filename uses BCP-47 tag `pt-BR` (matching Docusaurus locale and PR NousResearch#22063)
rather than `pt.ts` to disambiguate Brazilian Portuguese from European.

Native translations, not machine output. Tech terms kept in English where
that is the pt-BR convention (Skills, Plugins, OAuth, etc.).
Addresses Copilot review on NousResearch#22178: image-generation.md (line 31) had
a relative link to `tool-gateway.md` that did not resolve in the pt-BR
locale. Translating tool-gateway.md fixes the link and matches the
zh-Hans precedent (NousResearch#20430), which translated the two docs as a pair
for the same reason.

Native pt-BR translation mirroring the en source structure 1:1 (matches
the sibling image-generation.md style already in this PR).
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery labels May 9, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for consolidating the overlapping contributor work and preserving attribution.

Problems

  • Current main has already superseded the CLI/gateway/dashboard implementation with the broader 16-locale change in c39168453: agent/i18n.py:74-77 canonicalizes pt-br to pt, and web/src/i18n/context.tsx:16-36 registers the shared pt dashboard catalog. This branch's separate pt_BR / pt-BR identities would conflict with that current design.
  • The remaining README and Docusaurus translations need a source refresh before salvage. Since this PR's base, the affected English sources changed substantially; e.g. website/docs/user-guide/features/image-generation.md:10-26 now documents eleven models, while this PR's translation documents nine.

Suggested changes

  • Salvage only refreshed documentation work if maintainers choose to add a pt-BR Docusaurus locale; do not reintroduce the superseded application-locale plumbing.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform area/i18n Localization, locales, translations labels Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/i18n Localization, locales, translations comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants