Skip to content

feat(desktop): add Brazilian Portuguese (pt-BR) locale for desktop i18n - #40439

Closed
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:feat/desktop-pt-br-locale
Closed

feat(desktop): add Brazilian Portuguese (pt-BR) locale for desktop i18n#40439
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:feat/desktop-pt-br-locale

Conversation

@liuhao1024

Copy link
Copy Markdown
Contributor

Summary

Add Brazilian Portuguese (pt-BR) as the third desktop locale alongside English and Chinese, covering all translatable string surfaces in the Translations interface.

This follows the same pattern established by the Chinese locale (PR #38241) and the recently submitted Russian locale (PR #40426).

Closes #40239

Changes

File Change Purpose
apps/desktop/src/i18n/pt-br.ts NEW (~795 lines) Full Brazilian Portuguese translations
apps/desktop/src/i18n/types.ts Add 'pt-br' to Locale union Type safety
apps/desktop/src/i18n/languages.ts Add to LOCALE_OPTIONS + LOCALE_ALIASES Language picker + system locale matching
apps/desktop/src/i18n/catalog.ts Import + register in TRANSLATIONS Runtime registration
apps/desktop/src/i18n/languages.test.ts Add pt-BR test cases Coverage for normalizeLocale, isLocale, isSupportedLocaleValue, localeConfigValue

Coverage

All 15 sections of the Translations interface are translated:

  • common, boot, notifications, titlebar, language
  • settings (nav, sections, search, mode options, appearance, about)
  • skills, agents, commandCenter, messaging
  • profiles, cron, artifacts, sidebar, composer

Locale aliases

The following aliases resolve to pt-br:

  • pt-br, pt_BR, pt, pt-brasil

How to test

  1. Open Hermes Desktop
  2. Go to SettingsAppearanceLanguage
  3. Select Português (Brasil)
  4. Verify all UI strings display in Brazilian Portuguese

Notes

  • FIELD_LABELS and FIELD_DESCRIPTIONS are imported from @/app/settings/constants (shared across locales, currently English-only) — not translated
  • Function-typed strings match parameter types exactly from the Translations interface
  • Array strings (newSessionPlaceholders, followUpPlaceholders) have all 7 entries translated

Add pt-BR as the third desktop locale alongside English and Chinese,
covering all translatable string surfaces in the Translations interface.

Files changed:
- apps/desktop/src/i18n/pt-br.ts       — NEW: full translations (~795 lines)
- apps/desktop/src/i18n/types.ts        — add 'pt-br' to Locale union
- apps/desktop/src/i18n/languages.ts    — add pt-br to LOCALE_OPTIONS + aliases
- apps/desktop/src/i18n/catalog.ts      — register pt-br in TRANSLATIONS
- apps/desktop/src/i18n/languages.test.ts — add pt-br test cases

Closes NousResearch#40239
@liuhao1024

Copy link
Copy Markdown
Contributor Author

Closing — locale files (catalog.ts, languages.ts, languages.test.ts) have been heavily modified on main since this PR was created, making rebase impractical. Will re-submit with fresh locale additions if needed.

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

Labels

P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add Portuguese (pt-BR) language support to the desktop app (i18n / localization)

2 participants