Add Brazilian Portuguese (pt-BR) locale - #52
Closed
Mit0lenda wants to merge 1 commit into
Closed
Conversation
The existing 'pt' locale is European Portuguese (Portugal) — informal
"tu" verb forms, ecrã/telemóvel/ficheiro vocabulary, etc. This adds a
separate 'pt-BR' option rather than changing 'pt', so Portugal users
keep exactly what they have today.
pt-BR.js covers all 442 strings currently used by the app (verified
against every literal t('...') call site), converted to natural
Brazilian usage: "você"/imperative instead of "tu", vocabulary
(tela/celular/salvar/registrar/excluir/arquivo/compartilhar), and the
'pt' date-locale pattern extended with a pt-BR entry in DATE_LOCALES
so dates format the Brazilian way (dateLocale() in i18n.js).
No instruction pack exists for pt-BR (same situation as the existing
'pt' and 'de' entries), so exercise instructions fall back to English,
consistent with how those two already behave.
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey! 👋 Been using openGym daily and really enjoying it — thanks for building and open-sourcing it.
Noticed the existing
ptlocale is European Portuguese, which reads a bit off for us here in Brazil (different vocabulary, different verb forms). Instead of touching what's already there for Portugal users, I added a separatept-BRoption alongside it — so nothing changes for anyone currently usingpt.What's in this PR:
frontend/src/locales/pt-BR.js— covers every string the app currently uses (checked it against everyt('...')call site, so nothing should fall back to English)frontend/src/lib/i18n.js— registeredpt-BRinLANGSandDATE_LOCALES(so dates format the Brazilian way too)No instruction pack for
pt-BR(same aspt/detoday), so exercise instructions just fall back to English like they already do for those.Ran the existing test suite and a full build locally, both green. Happy to tweak wording if anything reads off to you — Portuguese has enough regional variety that I'm sure there's room for bikeshedding 🙂