feat(i18n): add Brazilian Portuguese (pt-BR) locale#171
feat(i18n): add Brazilian Portuguese (pt-BR) locale#171Sun-sunshine06 merged 6 commits intoOpenCoworkAI:mainfrom
Conversation
There was a problem hiding this comment.
Findings
- [Major]
pt-BRlocale is incomplete after being added as a selectable/apply-able locale, causing raw i18n keys to surface in provider-import/save-error UI paths instead of user-facing text. Evidence:packages/i18n/src/index.ts:22enablespt-BR, keys are consumed atapps/desktop/src/renderer/src/components/Settings.tsx:1027,apps/desktop/src/renderer/src/components/Settings.tsx:1032,apps/desktop/src/renderer/src/components/Settings.tsx:2234,apps/desktop/src/renderer/src/components/Settings.tsx:2235, but missing inpackages/i18n/src/locales/pt-BR.json:223andpackages/i18n/src/locales/pt-BR.json:285.
Suggested fix:{ "settings": { "providers": { "import": { "ollamaMenu": "Ollama (local)", "ollamaMenuDesc": "Adicionar provedor local localhost:11434", "ollamaDone": "Provedor Ollama adicionado" }, "toast": { "saveFailed": "Não foi possível salvar as alterações" } } } }
Questions
- None.
Summary
- Review mode: initial
- 1 issue found (major): incomplete
pt-BRkeyset introduces visible i18n regressions in changed locale behavior. docs/VISION.mdanddocs/PRINCIPLES.md: Not found in repo/docs in this checkout.
Testing
- Not run (automation). Suggested: add a Vitest parity check asserting
pt-BRcontains all keys fromen, and a renderer test for provider import menu/toast strings underpt-BR.
open-codesign Bot
| "switchToDropdown": "Escolher da lista", | ||
| "switchToManual": "Digitar manualmente" | ||
| }, | ||
| "import": { |
There was a problem hiding this comment.
[Major] Missing pt-BR keys used by Settings provider flows: settings.providers.import.ollamaMenu, settings.providers.import.ollamaMenuDesc, settings.providers.import.ollamaDone, and settings.providers.toast.saveFailed.
These keys are now reachable because pt-BR is enabled globally; missing keys will render fallback key text in UI.
Suggested fix:
"import": {
"ollamaMenu": "Ollama (local)",
"ollamaMenuDesc": "Adicionar provedor local localhost:11434",
"ollamaDone": "Provedor Ollama adicionado"
},
"toast": {
"saveFailed": "Não foi possível salvar as alterações"
}0b1e8f9 to
03619d3
Compare
03619d3 to
94f0b2f
Compare
|
Hey @DavidgFernandes! Thanks for this great work adding Brazilian Portuguese locale 🇧🇷 I've fixed the failing DCO check by adding to all commits (rebase done while preserving your original authorship for every commit). The DCO check should pass now. Review:This is a really high-quality contribution:
Everything looks ready to go! Welcome to the project contributor list 🎉 |
|
Hey @DavidgFernandes! Thanks for this great work adding Brazilian Portuguese locale 🇧🇷 I've fixed the failing DCO check by adding Review:This is a really high-quality contribution:
Everything looks ready to go! Welcome to the project contributor list 🎉 |
There was a problem hiding this comment.
Findings
- [Major] Auto-discovery can apply stale results from an older request after the user has already changed
baseUrl/apiKey/wire, which can populate the dropdown with wrong models and auto-select the wrong default model. Evidence:apps/desktop/src/renderer/src/components/AddCustomProviderModal.tsx:123,apps/desktop/src/renderer/src/components/AddCustomProviderModal.tsx:127,apps/desktop/src/renderer/src/components/AddCustomProviderModal.tsx:133.
Suggested fix:const discoveryReqId = useRef(0); async function runDiscovery(currentBaseUrl: string, currentApiKey: string, currentWire: WireApi) { if (!window.codesign?.config) return; const reqId = ++discoveryReqId.current; setDiscovery({ kind: 'discovering' }); try { const res = await window.codesign.config.testEndpoint({ wire: currentWire, baseUrl: currentBaseUrl.trim(), apiKey: currentApiKey.trim(), }); if (reqId !== discoveryReqId.current) return; // ignore stale response if (res.ok && res.models.length > 0) { setDiscovery({ kind: 'found', models: res.models }); if (!userPickedModel.current) setDefaultModel(pickBestModel(res.models)); } else { setDiscovery({ kind: 'failed' }); } } catch { if (reqId === discoveryReqId.current) setDiscovery({ kind: 'failed' }); } }
Questions
- None.
Summary
- Review mode: follow-up after new commits
- 1 issue found (major): async discovery race can surface stale model lists/defaults in the custom provider modal.
docs/VISION.mdanddocs/PRINCIPLES.md: Not found in repo/docs.
Testing
- Not run (automation). Suggested: add a Vitest/RTL test that simulates two overlapping discovery calls and asserts only the latest response updates
discoveryanddefaultModel.
open-codesign Bot
| apiKey: currentApiKey.trim(), | ||
| }); | ||
| if (res.ok && res.models.length > 0) { | ||
| setDiscovery({ kind: 'found', models: res.models }); |
There was a problem hiding this comment.
[Major] This async discovery path has no stale-response guard. If request A starts, user edits endpoint, then request B starts and finishes first, request A can still finish later and overwrite discovery/defaultModel with outdated models.
Suggested fix:
const discoveryReqId = useRef(0);
async function runDiscovery(currentBaseUrl: string, currentApiKey: string, currentWire: WireApi) {
const reqId = ++discoveryReqId.current;
// ... fetch
if (reqId !== discoveryReqId.current) return;
// apply state
}|
Thanks for the quick review and the DCO fix, @Sun-sunshine06! Really appreciate the welcome 🙏 One small thing to flag: I had pushed a 6th commit translating the 4 new Ollama strings from upstream #170 ( I'll re-push that commit now on top of your work, with |
- Add packages/i18n/src/locales/pt-BR.json (799 UI strings translated) - Register pt-BR in i18n index, normalizeLocale accepts pt/pt-BR/pt-* - Point pt-BR to enDemos/enExamples as fallback in templates registries - Add Português (BR) option to Settings language dropdown - Cycle LanguageToggle across en → zh-CN → pt-BR Signed-off-by: Sun-sunshine06 <Sun-sunshine06@users.noreply.github.com>
- Translate 36 new keys (ChatGPT login flow, CLIProxyAPI preset, add-context menu, etc.)
- Restructure diagnostics.report.error from string to {generic, notesTooLong}
- Drop keys removed upstream (diagnostics.toast, comingSoon, etc.)
- Refresh chatgptLogin copy now that the feature is shipping
Signed-off-by: Sun-sunshine06 <Sun-sunshine06@users.noreply.github.com>
- Add packages/templates/src/locales/pt-BR.ts (4 built-in demos fully translated incl. prompt)
- Add packages/templates/src/examples/locales/pt-BR.ts (21 hub examples translated)
- Wire pt-BR registries to the new files (no more en fallback)
- Translate starterPrompts.* (8 prompts injected on click)
- Translate demos.*.prompt in pt-BR.json
- Translate emptyState.starterDesc.* card descriptions
- Fix opencodeFound missing {{providers}} interpolation picked up from upstream
Signed-off-by: Sun-sunshine06 <Sun-sunshine06@users.noreply.github.com>
Terminology glossary applied consistently across 50+ strings:
- Standardize 'de novo' → 'novamente' everywhere
- Standardize 'não dá para' → 'não é possível' for errors
- Map 'sign in/out' → 'entrar/sair'; 'snapshot' → 'snapshot' (kept jargon)
- Fix 'redacted' mistranslated as 'redigido' → 'com dados sensíveis removidos'
- Refresh 'crashed' → 'travou'; 'break' semantics in error boundary
- 'Rode Testar' → 'Clique em Testar' (idiomatic)
- Replace 'guardada/guardadas' → 'armazenada/armazenadas' for keys
- Tighten Ollama/error messages; add missing articles
- 'per design' → 'em cada design' (resolves EN/PT ambiguity)
- Duplicate name template: 'X cópia' → 'X (cópia)'
- Fix CODEX_TOKEN_NOT_LOGGED_IN to read as login-first message
Copy tightening:
- 'Crie com IA' → 'Crie designs com IA' (preserves EN 'design' verb)
- 'sandbox' explained in parens
- 'referencia' verb → 'faz referência a' (more natural)
- 'em torno desse alvo' → 'focando nesse alvo'
- 'Só este elemento' → 'Apenas este elemento'
- 'Inícios rápidos' → 'Sugestões rápidas'
- 'nav interativa' → 'navegação interativa'
- 'conteúdo com cara de real' → 'conteúdo realista'
- 'num follow-up' → 'em uma versão futura'
- 'Nota fiscal' → 'Fatura' (accuracy — not Brazilian tax doc)
- 'pull quotes' → 'citações em destaque'
- 'sensação de lightbox' → 'visual de lightbox'
Also: opencodeFound already fixed to include {{providers}} var;
geminiBlocked rewritten to match updated upstream EN.
All 820 keys parity, 0 interpolation mismatches, 0 plural mismatches,
32 identical-to-EN strings all legitimate (marks/paths/units/jargon).
Signed-off-by: Sun-sunshine06 <Sun-sunshine06@users.noreply.github.com>
PT-BR descriptions exceed the line-length budget after translation; Biome auto-wraps them over two lines. Pure formatting — no content change. Signed-off-by: Sun-sunshine06 <Sun-sunshine06@users.noreply.github.com>
…rkAI#170 Upstream PR OpenCoworkAI#170 added 4 new keys when making Ollama opt-in: - settings.providers.import.ollamaMenu - settings.providers.import.ollamaMenuDesc - settings.providers.import.ollamaDone - settings.providers.toast.saveFailed Signed-off-by: David Fernandes <davidggffernandes@gmail.com>
94f0b2f to
3bfbe67
Compare
There was a problem hiding this comment.
Findings
- None.
Summary
- Review mode: follow-up after new commits
- No new issues found in the current diff.
docs/VISION.mdanddocs/PRINCIPLES.md: Not found in repo/docs.
Testing
- Not run (automation). Residual risk: no added Vitest/Playwright coverage for
pt-BRlocale selection/cycling and localized templates/examples rendering paths.
open-codesign Bot
Summary
enandzh-CN.pt-*system locales; users can also switch manually from the topbar toggle or Settings → Appearance → Language.DEFAULT_LOCALE) staysen; no behavior change for existing users.What's inside
packages/i18n/src/locales/pt-BR.json— 820 UI strings, full parity withen.jsonpackages/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— registerpt-BRinavailableLocales,resources,normalizeLocale(acceptspt,pt-BR,pt_br,pt-*)enfallback)Settings.tsxdropdown +LanguageToggle.tsxcycle now includept-BRlangPtBRlabel added toen.jsonandzh-CN.jsonso the dropdown works across all localesTranslation quality notes
{{interpolations}}and_one/_otherplural suffixes preservednovamente, fixedredacted → redigidobug,Nota fiscal → Faturafor semantic accuracy, etc.)Test plan