feat(webui): add Brazilian Portuguese (pt-BR) locale

Translate the WebUI common.json to pt-BR, register the locale in
config.ts (with normalizeLocale rules for "pt", "pt-BR", "pt-PT", ...)
and index.ts resources, and add a Brazilian Portuguese overview
assertion in i18n.test.tsx.

Notes:
- Generic "pt" and any "pt-*" variant resolve to pt-BR. A future
  pt-PT locale can be added without affecting existing users.
- Universally borrowed technical terms (nanobot, BYOK, MCP, JSON,
  URL, Web, Apps when used as a product name, Skills) are kept in
  English, matching the pattern used by es/fr/ja/ko/vi/id.
- Empty-thread greetings, quick-action prompts, and slash command
  descriptions are translated; quick-action prompts are intentionally
  phrased so the agent still receives a clear task spec.

Verified with bun run test (536 passing), bun run lint (clean), and
bun run build (7.18s).
This commit is contained in:
bill-kopp-ai-dev
2026-07-13 23:28:19 +08:00
committed by chengyongru
parent 4a3818e03c
commit 1e7518a207
4 changed files with 1175 additions and 0 deletions
+14
View File
@@ -311,4 +311,18 @@ describe("webui i18n", () => {
expect(settings.overview.webSearch).toBe("网页搜索");
expect(settings.overview.workspace).toBe("工作区");
});
it("keeps Brazilian Portuguese settings overview copy localized", () => {
const settings = resources["pt-BR"].common.settings;
const sidebar = resources["pt-BR"].common.sidebar;
const chat = resources["pt-BR"].common.chat;
expect(sidebar.settings).toBe("Configurações");
expect(chat.newChat).toBe("Nova conversa");
expect(settings.nav.browser).toBe("Web");
expect(settings.sections.webSearch).toBe("Busca na web");
expect(settings.byok.tabs.webSearch).toBe("Busca na web");
expect(settings.overview.webSearch).toBe("Busca na web");
expect(settings.overview.workspace).toBe("Workspace");
});
});