Skip to content

fix(dashboard): register pt-BR locale for browser language detection#164

Merged
telivity-otaip merged 1 commit into
mainfrom
cursor/fix-pt-br-locale-code-aa98
Jul 17, 2026
Merged

fix(dashboard): register pt-BR locale for browser language detection#164
telivity-otaip merged 1 commit into
mainfrom
cursor/fix-pt-br-locale-code-aa98

Conversation

@telivity-otaip

@telivity-otaip telivity-otaip commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes Brazilian Portuguese auto-detection after #155 merged with the non-standard locale code ptBR.

Problem

i18next could not match browser languages like pt-BR to the registered ptBR code, so Brazilian users fell back to English unless they manually selected the language from the header.

Changes

  • Register the canonical pt-BR locale code in SUPPORTED_LANGUAGES and resources
  • Also register pt (hidden from the switcher) so nonExplicitSupportedLngs can resolve pt-BR navigator values
  • Map date-fns formatting via the pt base language in getDateLocale()
  • Migrate legacy ptBR values stored in localStorage (haip.lang) to pt-BR

Verification

  • pnpm --filter @telivityhaip/dashboard typecheck passes
  • Dashboard tests pass (43/43)

The merged pt-BR localization used the non-standard code ptBR, which
i18next could not match when the browser reports pt-BR. Register the
canonical pt-BR code, alias pt for nonExplicitSupportedLngs resolution,
map date-fns to the pt base language, and migrate legacy ptBR values
from localStorage.

Co-authored-by: telivity-otaip <telivity-otaip@users.noreply.github.com>
@telivity-otaip telivity-otaip self-assigned this Jul 17, 2026
@telivity-otaip
telivity-otaip merged commit e845ffa into main Jul 17, 2026
5 checks passed
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