From 2b69d35fcf639b55aeabcc407cbab23b27770c7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Salavisa?= Date: Tue, 4 Aug 2026 00:08:04 +0200 Subject: [PATCH] feat(i18n): localize Configuration Chat and the last shared aria-labels (#2223) Co-authored-by: Kandev Agent Co-authored-by: Claude Opus 5 (1M context) --- apps/packages/ui/src/breadcrumb.tsx | 10 ++ .../config-chat/config-chat-copy.test.ts | 118 ++++++++++++++++++ .../config-chat/config-chat-panel.tsx | 17 +-- .../config-chat/config-chat-setup.tsx | 68 ++++++---- .../components/config-chat/use-config-chat.ts | 14 ++- apps/web/components/global-commands.tsx | 2 +- apps/web/components/page-topbar.tsx | 4 +- .../task/simple/OfficeSimplePane.tsx | 4 +- .../components/task/task-top-bar-title.tsx | 4 +- apps/web/eslint.i18n.options.mjs | 37 ++++++ apps/web/src/app-shell.tsx | 24 +++- apps/web/src/locales/en/common.json | 4 +- apps/web/src/locales/en/configChat.json | 21 ++++ apps/web/src/locales/pseudo/common.json | 4 +- apps/web/src/locales/pseudo/configChat.json | 21 ++++ docs/i18n.md | 31 ++++- 16 files changed, 337 insertions(+), 46 deletions(-) create mode 100644 apps/web/components/config-chat/config-chat-copy.test.ts create mode 100644 apps/web/src/locales/en/configChat.json create mode 100644 apps/web/src/locales/pseudo/configChat.json diff --git a/apps/packages/ui/src/breadcrumb.tsx b/apps/packages/ui/src/breadcrumb.tsx index 742e159850..4b1984f5be 100644 --- a/apps/packages/ui/src/breadcrumb.tsx +++ b/apps/packages/ui/src/breadcrumb.tsx @@ -4,6 +4,16 @@ import { Slot } from "radix-ui"; import { cn } from "./lib/utils"; import { IconChevronRight, IconDots } from "@tabler/icons-react"; +/** + * `aria-label` is an English default, not a fixed string: `{...props}` spreads + * AFTER it, so any consumer can pass a translated `aria-label` and win. + * + * Do NOT import an i18n runtime here. `@kandev/ui` must stay usable standalone + * and must not depend on the app's i18next instance, so localization happens at + * the call site — see docs/i18n.md ("How it's wired") and the app's three + * consumers (`page-topbar`, `task-top-bar-title`, `OfficeSimplePane`), which all + * pass `aria-label={t("common:breadcrumb")}`. + */ function Breadcrumb({ className, ...props }: React.ComponentProps<"nav">) { return (