Commit b2e4bfe
authored
feat(i18n): add Brazilian Portuguese (pt-BR) locale (#171)
## Summary
- Adds full Brazilian Portuguese translation (820/820 UI strings) as a
third supported locale next to `en` and `zh-CN`.
- Auto-detects `pt-*` system locales; users can also switch manually
from the topbar toggle or Settings → Appearance → Language.
- Default locale (`DEFAULT_LOCALE`) stays `en`; no behavior change for
existing users.
## What's inside
- `packages/i18n/src/locales/pt-BR.json` — 820 UI strings, full parity
with `en.json`
- `packages/templates/src/locales/pt-BR.ts` — 4 built-in demos (title,
description, prompt)
- `packages/templates/src/examples/locales/pt-BR.ts` — 21 hub examples
(title, description)
- `packages/i18n/src/index.ts` — register `pt-BR` in `availableLocales`,
`resources`, `normalizeLocale` (accepts `pt`, `pt-BR`, `pt_br`, `pt-*`)
- Templates registries pointed to the new pt-BR files (no `en` fallback)
- `Settings.tsx` dropdown + `LanguageToggle.tsx` cycle now include
`pt-BR`
- `langPtBR` label added to `en.json` and `zh-CN.json` so the dropdown
works across all locales
## Translation quality notes
- Terminology glossary applied consistently (tweaks → Ajustes, design
system → design system, snapshot → snapshot, etc.)
- `{{interpolations}}` and `_one`/`_other` plural suffixes preserved
- 32 strings kept identical to EN (product names, file paths, unit
suffixes, tech jargon) — no mistranslations
- Reviewed end-to-end for tone, grammar, and accuracy (standardized
`novamente`, fixed `redacted → redigido` bug, `Nota fiscal → Fatura` for
semantic accuracy, etc.)
## Test plan
- [ ] \`pnpm lint && pnpm typecheck && pnpm test\` all pass locally
(pre-push hook confirms)
- [ ] App boots with zero \`missing translation\` / \`unsupported
locale\` warnings
- [ ] Settings → Appearance → Language shows \`Português (BR)\`;
selection persists across restart
- [ ] Topbar globe toggle cycles \`EN → ZH → PT → EN\`
- [ ] System locale \`pt-BR\` auto-selects pt-BR on first launch
- [ ] Hub Examples gallery and built-in demos render in PT
- [ ] No UI clipping from longer PT strings (sidebar, settings,
onboarding)
---------
Signed-off-by: Sun-sunshine06 <Sun-sunshine06@users.noreply.github.com>
Signed-off-by: David Fernandes <davidggffernandes@gmail.com>1 parent a965e58 commit b2e4bfe
10 files changed
Lines changed: 1232 additions & 5 deletions
File tree
- apps/desktop/src/renderer/src/components
- packages
- i18n/src
- locales
- templates/src
- examples
- locales
- locales
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | | - | |
| 12 | + | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
14 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
15 | 20 | | |
16 | 21 | | |
17 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1719 | 1719 | | |
1720 | 1720 | | |
1721 | 1721 | | |
| 1722 | + | |
1722 | 1723 | | |
1723 | 1724 | | |
1724 | 1725 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | | - | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
43 | 48 | | |
44 | 49 | | |
45 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | | - | |
| 336 | + | |
| 337 | + | |
337 | 338 | | |
338 | 339 | | |
339 | 340 | | |
| |||
0 commit comments