Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

feat(i18n): full rollout — 21 namespaces translated (en + zh-Hans) (#1853)

Naiyuan Qing3447764b03a3
diff --git a/CLAUDE.md b/CLAUDE.md
index 1718a86701..c2669747b3 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -2,6 +2,21 @@
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
+## Conventions reference
+
+The single source of truth for **code naming, the i18n translation glossary, and the Chinese voice guide** is the docs site:
+
+- **`apps/docs/content/docs/developers/conventions.mdx`** (English)
+- **`apps/docs/content/docs/developers/conventions.zh.mdx`** (Chinese)
+
+Read that page before:
+
+- Writing or editing translations (`packages/views/locales/`)
+- Naming a new route, package, file, DB column, or TS type
+- Writing Chinese product copy (UI strings, error messages, docs)
+
+The legacy `packages/views/locales/glossary.md` is now a stub redirecting to the docs page; do not rely on it.
+
## Project Context
Multica is an AI-native task management platform — like Linear, but with AI agents as first-class citizens.
diff --git a/apps/desktop/src/main/index.ts b/apps/desktop/src/main/index.ts
index 57ef427191..8af012260e 100644
--- a/apps/desktop/src/main/index.ts
+++ b/apps/desktop/src/main/index.ts
@@ -78,7 +78,25 @@ function handleDeepLink(url: string): void {
// --- Window creation -----------------------------------------------------
+// Tracks the OS-preferred language as last seen by the running process.
+// Updated on each window-focus check so we can emit a `locale:system-changed`
+// event to the renderer when the user changes their OS language without
+// quitting the app — without restart, app.getPreferredSystemLanguages()
+// would still report the boot value forever.
+let lastKnownSystemLocale = "en";
+
+function getSystemLocale(): string {
+ return app.getPreferredSystemLanguages()[0] ?? "en";
+}
+
function createWindow(): void {
+ // Pass the OS-preferred language to the renderer via additionalArguments
+ // instead of a sync IPC call. process.argv is available to the preload
+ // script before the first network request, so the renderer's i18next
+ // instance can initialize with the right locale on the very first paint.
+ const systemLocale = getSystemLocale();
+ lastKnownSystemLocale = systemLocale;
+
mainWindow = new BrowserWindow({
width: 1280,
height: 800,
@@ -95,6 +113,7 @@ function createWindow(): void {
preload: join(__dirname, "../preload/index.js"),
sandbox: false,
webSecurity: false,
+ additionalArguments: [`--multica-locale=${systemLocale}`],
},
});
@@ -112,6 +131,18 @@ function createWindow(): void {
mainWindow?.show();
});
+ // Detect OS language changes while the app is running. Electron has no
+ // dedicated event for this on any platform, so we poll on focus regain —
+ // catches the common case where users switch System Settings → Language
+ // and bring the app back. The renderer decides whether to act (it ignores
+ // the signal when the user has an explicit Settings choice).
+ mainWindow.on("focus", () => {
+ const current = getSystemLocale();
+ if (current === lastKnownSystemLocale) return;
+ lastKnownSystemLocale = current;
+ mainWindow?.webContents.send("locale:system-changed", current);
+ });
+
mainWindow.webContents.setWindowOpenHandler((details) => {
openExternalSafely(details.url);
return { action: "deny" };
diff --git a/apps/desktop/src/preload/index.d.ts b/apps/desktop/src/preload/index.d.ts
index f8525b6862..8e54ced451 100644
--- a/apps/desktop/src/preload/index.d.ts
+++ b/apps/desktop/src/preload/index.d.ts
@@ -7,6 +7,10 @@ interface DesktopAPI {
version: string;
os: "macos" | "windows" | "linux" | "unknown";
};
+ /** OS-preferred locale (BCP 47) injected by main via additionalArguments. */
+ systemLocale: string;
+ /** Subscribe to OS language changes detected after boot. Returns an unsubscribe function. */
+ onSystemLocaleChanged: (callback: (locale: string) => void) => () => void;
/** Validated runtime endpoint config, or a blocking config error. */
runtimeConfig: RuntimeConfigResult;
/** Listen for auth token delivered via deep link. Returns an unsubscribe function. */
diff --git a/apps/desktop/src/preload/index.ts b/apps/desktop/src/preload/index.ts
index ecadf16330..c67d32b58e 100644
--- a/apps/desktop/src/preload/index.ts
+++ b/apps/desktop/src/preload/index.ts
@@ -40,10 +40,33 @@ function fetchRuntimeConfig(): RuntimeConfigResult {
const appInfo = fetchAppInfo();
const runtimeConfig = fetchRuntimeConfig();
+// Read the OS-preferred locale that main injected via additionalArguments.
+// Zero IPC, zero blocking — process.argv is populated before preload runs.
+function fetchSystemLocale(): string {
+ const arg = process.argv.find((a) => a.startsWith("--multica-locale="));
+ return arg?.split("=")[1] ?? "en";
+}
+
+const systemLocale = fetchSystemLocale();
+
const desktopAPI = {
/** App version + normalized OS. Read once at preload time so the renderer
* can use it synchronously when initializing the API client. */
appInfo,
+ /** OS-preferred locale (BCP 47), passed from main via additionalArguments.
+ * Used by the renderer's LocaleAdapter as the system-preference signal. */
+ systemLocale,
+ /** Subscribe to OS language changes detected after boot. The renderer
+ * decides whether to act (no-op when the user has an explicit Settings
+ * choice). Returns an unsubscribe function. */
+ onSystemLocaleChanged: (callback: (locale: string) => void) => {
+ const handler = (_event: Electron.IpcRendererEvent, locale: string) =>
+ callback(locale);
+ ipcRenderer.on("locale:system-changed", handler);
+ return () => {
+ ipcRenderer.removeListener("locale:system-changed", handler);
+ };
+ },
/** Validated runtime endpoint config, or a blocking config error. */
runtimeConfig,
/** Listen for auth token delivered via deep link */
diff --git a/apps/desktop/src/renderer/src/App.tsx b/apps/desktop/src/renderer/src/App.tsx
index ddf1426bae..540bf7ea74 100644
--- a/apps/desktop/src/renderer/src/App.tsx
+++ b/apps/desktop/src/renderer/src/App.tsx
@@ -1,6 +1,7 @@
import { useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
import { useQuery, useQueryClient } from "@tanstack/react-query";
import { CoreProvider } from "@multica/core/platform";
+import { pickLocale } from "@multica/core/i18n";
import { useAuthStore } from "@multica/core/auth";
import { workspaceKeys, workspaceListOptions } from "@multica/core/workspace/queries";
import { api } from "@multica/core/api";
@@ -15,6 +16,8 @@ import { UpdateNotification } from "./components/update-notification";
import { useTabStore } from "./stores/tab-store";
import { useWindowOverlayStore } from "./stores/window-overlay-store";
import { useDaemonIPCBridge } from "./platform/daemon-ipc-bridge";
+import { createDesktopLocaleAdapter } from "./platform/i18n-adapter";
+import { RESOURCES } from "@multica/views/locales";
function AppContent() {
@@ -269,6 +272,7 @@ async function handleDaemonLogout() {
export default function App() {
const { version, os } = window.desktopAPI.appInfo;
+ const systemLocale = window.desktopAPI.systemLocale;
const runtimeConfigResult = window.desktopAPI.runtimeConfig;
// Stable identity reference so downstream effects (WS reconnect) don't
// tear down on every parent render.
@@ -276,6 +280,36 @@ export default function App() {
() => ({ platform: "desktop", version, os }),
[version, os],
);
+ // Locale resolution happens once at app boot. Switching language goes
+ // through window.location.reload() to avoid hydration mismatch.
+ const localeAdapter = useMemo(
+ () => createDesktopLocaleAdapter(systemLocale),
+ [systemLocale],
+ );
+ const locale = useMemo(() => pickLocale(localeAdapter), [localeAdapter]);
+ const resources = useMemo(
+ () => ({ [locale]: RESOURCES[locale] }),
+ [locale],
+ );
+
+ // React to OS-level language changes detected by main on focus regain.
+ // Only act when the user is following the system signal (no explicit
+ // Settings choice) — otherwise their preference wins. Cross-device sync
+ // for the explicit-choice case is handled inside CoreProvider.
+ useEffect(() => {
+ return window.desktopAPI.onSystemLocaleChanged((nextSystemLocale) => {
+ if (localeAdapter.getUserChoice()) return;
+ const next = pickLocale({
+ ...localeAdapter,
+ getSystemPreferences: () =>
+ nextSystemLocale ? [nextSystemLocale] : [],
+ });
+ if (next === locale) return;
+ localeAdapter.persist(next);
+ window.location.reload();
+ });
+ }, [localeAdapter, locale]);
+
return (
<ThemeProvider>
{runtimeConfigResult.ok ? (
@@ -284,6 +318,9 @@ export default function App() {
wsUrl={runtimeConfigResult.config.wsUrl}
onLogout={handleDaemonLogout}
identity={identity}
+ locale={locale}
+ resources={resources}
+ localeAdapter={localeAdapter}
>
<AppContent />
</CoreProvider>
diff --git a/apps/desktop/src/renderer/src/platform/i18n-adapter.ts b/apps/desktop/src/renderer/src/platform/i18n-adapter.ts
new file mode 100644
index 0000000000..3943c4a012
--- /dev/null
+++ b/apps/desktop/src/renderer/src/platform/i18n-adapter.ts
@@ -0,0 +1,31 @@
+import type { LocaleAdapter, SupportedLocale } from "@multica/core/i18n";
+
+const STORAGE_KEY = "multica-locale";
+
+// Desktop adapter:
+// - User choice: localStorage (set by Settings switcher).
+// - System preference: locale main injected via additionalArguments
+// (read from preload, exposed on window.desktopAPI.systemLocale).
+// - Persist: localStorage. The Settings switcher additionally PATCHes
+// /api/me when logged in so user.language follows the user across devices.
+export function createDesktopLocaleAdapter(systemLocale: string): LocaleAdapter {
+ return {
+ getUserChoice() {
+ try {
+ return window.localStorage.getItem(STORAGE_KEY);
+ } catch {
+ return null;
+ }
+ },
+ getSystemPreferences() {
+ return systemLocale ? [systemLocale] : [];
+ },
+ persist(locale: SupportedLocale) {
+ try {
+ window.localStorage.setItem(STORAGE_KEY, locale);
+ } catch {
+ // Best-effort
+ }
+ },
+ };
+}
diff --git a/apps/docs/content/docs/developers/conventions.mdx b/apps/docs/content/docs/developers/conventions.mdx
new file mode 100644
index 0000000000..157ee43ecb
--- /dev/null
+++ b/apps/docs/content/docs/developers/conventions.mdx
@@ -0,0 +1,292 @@
+---
+title: Conventions
+description: Single source of truth for code naming, i18n translation glossary, and Chinese voice guide.
+---
+
+This page is the single source of truth for code naming, the i18n translation glossary, and the Chinese voice guide. Anything that used to live in `packages/views/locales/glossary.md` or in scattered comments now lives here.
+
+If you write Multica code, change a translation, or write Chinese product copy, this is the page to reference.
+
+---
+
+## 1. Code naming
+
+### Routes
+
+Pre-workspace routes (the routes that exist before the user is in a workspace) MUST use either a single word or the `/{noun}/{verb}` pattern.
+
+- ✅ `/login`, `/inbox`, `/workspaces/new`
+- ❌ `/new-workspace`, `/create-team`, `/accept-invite`
+
+Hyphenated word groups at the root collide with user-chosen workspace slugs and force endless reserved-slug audits. Reserving the noun (`workspaces`) automatically protects the entire `/workspaces/*` subtree.
+
+### Workspace-scoped routes
+
+Always live under `/{slug}/{section}` — `/{slug}/issues`, `/{slug}/agents`, `/{slug}/settings`. Never duplicate workspace routing logic; use `useNavigation().push()` from shared code, never framework-specific link APIs.
+
+### Packages and modules
+
+The monorepo enforces strict package boundaries:
+
+| Package | May depend on | Must NOT depend on |
+| --- | --- | --- |
+| `packages/core` | nothing app-specific | `react-dom`, `localStorage`, `process.env`, `next/*`, UI libraries |
+| `packages/ui` | nothing | `@multica/core`, business logic |
+| `packages/views` | `core/`, `ui/` | `next/*`, `react-router-dom`, stores |
+| `apps/web/platform/` | `next/*` | other apps |
+| `apps/desktop/.../platform/` | `react-router-dom`, electron | other apps |
+
+If logic appears in both apps, it MUST be extracted to a shared package. There are no exceptions for "small" duplication.
+
+### Files and components
+
+- Files: `kebab-case.tsx` / `kebab-case.ts` (e.g. `agent-row-actions.tsx`)
+- Components: `PascalCase` (e.g. `AgentRowActions`)
+- Hooks: `useCamelCase` (e.g. `useWorkspaceId`)
+- Tests: colocated as `<file>.test.ts(x)`
+- Stores (Zustand): `<feature>-store.ts`, exported as `use<Feature>Store`
+
+### Database (Go + sqlc)
+
+- Tables: `snake_case` singular (`user`, `workspace`, `agent_runtime`)
+- Columns: `snake_case` (`workspace_id`, `created_at`, `last_seen_at`)
+- Foreign keys: `<table>_id`
+- Booleans: `is_<state>` or `<state>_at` (timestamp form preferred for state changes)
+- Migration files: `NNN_descriptive_name.up.sql` + `.down.sql` — always provide both directions
+
+### Go
+
+- Standard `gofmt` + `go vet`. No exceptions.
+- Handler files mirror domain: `agent.go`, `auth.go`, `runtime.go`
+- Tests: `<file>_test.go` colocated
+- For UUID parsing in handlers, follow the rule in the root `CLAUDE.md` — `parseUUIDOrBadRequest` for boundary input, `parseUUID` (panicking) for trusted round-trips, never `util.ParseUUID` directly without checking the error.
+
+### TypeScript
+
+- API responses on the wire are `snake_case`; the api client converts to `camelCase` at the boundary. Inside TS code, **always camelCase**.
+- Types: `PascalCase` (`Issue`, `AgentRuntime`); never `IPrefix`, never `_t` suffix.
+- Enums: prefer string literal unions; reserve `enum` for runtime-iterable cases.
+- TanStack Query keys: factory functions in `<feature>/queries.ts`, e.g. `issueKeys.detail(id)`.
+
+### Issue keys
+
+Every issue has a human-readable key like `MUL-123`: workspace `issue_prefix` (3 letters, uppercase) + sequence number. The prefix is set at workspace creation and is never changed afterward.
+
+### Comments in code
+
+English only. The repo enforces this for both Go and TypeScript. If you find a Chinese comment in code, it's a bug — replace it.
+
+### Commit messages
+
+Conventional format: `feat(scope)`, `fix(scope)`, `refactor(scope)`, `docs`, `test(scope)`, `chore(scope)`. Atomic commits grouped by intent.
+
+---
+
+## 2. i18n translation glossary
+
+This is the **mandatory** glossary for every translation PR. It used to live at `packages/views/locales/glossary.md`; that file is now a stub pointing here.
+
+### The core distinction: entity vs concept
+
+Multica's product nouns split into two categories:
+
+- **Entity** — has a URL, a database row, an API type. In Chinese text, render as **lowercase English** so it visually reads like a type name and signals "this is a Multica system entity".
+- **Concept** — generic noun, not a database entity. **Translate fully** so Chinese users don't see jagged English embedded in flowing text.
+
+This rule is aligned with `apps/docs/content/docs/*.zh.mdx` — the docs are the de facto Chinese voice standard and have been battle-tested across 20+ pages.
+
+### Don't translate — entities (lowercase English)
+
+| Term | Render in Chinese | Example |
+| --- | --- | --- |
+| Issue | `issue` (lowercase) | "把 issue 分配给智能体"、"创建子 issue" |
+| Skill | `skill` (lowercase) | "为智能体注入 skill" |
+| Task | `task` (lowercase) | "排队中的 task" |
+
+**Why `issue` / `skill` / `task` stay English while `project` / `autopilot` are translated**:
+
+- **`issue` / `task`**: dev teams talk in English. The Chinese candidates ("任务" — too vague, almost synonymous with "工作"; "工单" — IT ticket connotation; "议题" — GitHub-style but doesn't match the product feel) all read worse than `issue`.
+- **`skill`**: Multica-specific concept with no established Chinese term.
+- **`project` → "项目"**: settled mainstream Chinese word. Feishu / Tower / Teambition / PingCode / GitHub Projects — every Chinese product translates it. No product keeps `project` in Chinese context.
+- **`autopilot` → "自动化"**: in Chinese, "autopilot" associates with Tesla's "自动驾驶" and doesn't match what the feature does (run tasks on a schedule). Notion and Feishu both use "自动化"; that's the industry consensus.
+
+### Don't translate — brands and acronyms
+
+| Category | Terms |
+| --- | --- |
+| Brands | **Multica**, GitHub, Slack, Google, Anthropic, OpenAI, Claude, Codex, Cursor, Linear, Jira |
+| Acronyms | API, CLI, URL, SDK, OAuth, JWT, SSO, WebSocket, HTTP, JSON, YAML, SQL |
+
+### Translate fully — concepts
+
+| English | Chinese |
+| --- | --- |
+| Workspace | **工作区** |
+| Agent | **智能体** |
+| Project | **项目** |
+| Autopilot | **自动化** |
+| Daemon | **守护进程** |
+| Runtime | **运行时** |
+| Inbox | **收件箱** |
+| Comment | **评论** |
+| Reply | **回复** |
+| Notifications | **通知** |
+| Member | **成员** |
+| Label | **标签** |
+| Settings | **设置** |
+| Onboarding | **上手引导** |
+
+### Translate fully — generic UI words
+
+| English | Chinese |
+| --- | --- |
+| Invite / Invitation | 邀请 |
+| Search | 搜索 |
+| Email | 邮箱 (label) / 邮件 (action) |
+| Password | 密码 |
+| Sign in / Log in | 登录 |
+| Sign up | 注册 |
+| Sign out / Log out | 退出登录 |
+| Save / Cancel / Delete | 保存 / 取消 / 删除 |
+| Confirm / Continue / Back | 确认 / 继续 / 返回 |
+| Edit / New / Create / Add | 编辑 / 新建 / 创建 / 添加 |
+| Remove / Send / Open / Close | 移除 / 发送 / 打开 / 关闭 |
+| Done / Loading... | 完成 / 加载中... |
+| Profile / Account / Appearance | 个人资料 / 账号 / 外观 |
+| Theme / Language | 主题 / 语言 |
+| Light / Dark / System | 浅色 / 深色 / 跟随系统 |
+| Active / Archived | 活跃 (or 启用) / 已归档 |
+| Status / Priority | 状态 / 优先级 |
+| Assignee / Reporter | 负责人 / 报告人 |
+| Description / Title | 描述 / 标题 |
+| Date / Time | 日期 / 时间 |
+| Today / Yesterday / Tomorrow | 今天 / 昨天 / 明天 |
+| Empty / Failed / Success | 空 / 失败 / 成功 |
+| Error / Warning | 错误 / 警告 |
+
+### Roles and status enums (lowercase English, not translated)
+
+These are schema-level identifiers; render as lowercase English even in Chinese context.
+
+- Roles: `owner` / `admin` / `member`
+- Issue status: `backlog` / `todo` / `in_progress` / `in_review` / `done` / `blocked` / `cancelled`
+
+In UI, surface them in English (optionally `code-style` wrapped):
+
+- "你需要 owner 权限"
+- "已切换到 in_progress"
+
+### Word combination rules
+
+Always put **a single space** between an English word (entity / brand / acronym) and surrounding Chinese:
+
+- "Create new issue" → "新建 issue"
+- "Assign to agent" → "分配给智能体"
+- "Configure runtime" → "配置运行时"
+- "Stop daemon" → "停止守护进程"
+
+### Plurals and counts
+
+i18next uses `_one` / `_other`; Chinese has no grammatical number, only fill `_other`.
+
+```json
+// en/issues.json
+{
+ "issue_count_one": "{{count}} issue",
+ "issue_count_other": "{{count}} issues"
+}
+
+// zh-Hans/issues.json
+{
+ "issue_count_other": "{{count}} 个 issue"
+}
+```
+
+Common count formats:
+
+- `{{count}} issues` → `{{count}} 个 issue`
+- `{{count}} agents` → `{{count}} 个智能体`
+- `{{count}} workspaces` → `{{count}} 个工作区`
+- `{{count}} comments` → `{{count}} 条评论`
+- `{{count}} members` → `{{count}} 位成员`
+- `{{count}} skills` → `{{count}} 个 skill`
+
+### Interpolation
+
+Use `{{var}}`. Chinese translations may reorder for natural sentence flow.
+
+```json
+// en
+{ "welcome_message": "Welcome back, {{name}}!" }
+
+// zh-Hans
+{ "welcome_message": "欢迎回来,{{name}}!" }
+```
+
+### Translation key naming
+
+Three-level nesting: `feature.component.action`.
+
+```json
+{
+ "feature_or_component": {
+ "subcomponent_or_section": {
+ "action_or_label": "..."
+ }
+ }
+}
+```
+
+Examples:
+
+- `issues.toolbar.batch_update_success`
+- `issues.detail.comment_form.placeholder`
+- `inbox.empty.title`
+- `settings.appearance.language.title`
+
+### Web-only / desktop-only copy
+
+- Shared copy: top level of the namespace JSON
+- Web-only: `web` section
+- Desktop-only: `desktop` section
+
+See `auth.json` for the canonical example (the `web` section contains `prefer_desktop` / `desktop_handoff.*`).
+
+---
+
+## 3. Chinese voice and style
+
+### Punctuation
+
+- Full-width punctuation in Chinese: `,。:;!?`
+- Quotes: straight double quotes `"..."` to match the English source. Do not use `「」` or curly quotes.
+- Ellipsis: three dots `...` not the single character `…`. Match the English source.
+- Mixed Chinese-English: a single space on each side of the English word (see Word combination rules).
+
+### Style principles
+
+- **Concise and direct.** Avoid translation-ese: "对于 X 来说"、"作为 X"、"我们的"。
+- **Error messages**: gentle but clear. "无法保存修改" beats "保存修改失败了!".
+- **Buttons**: verb first, 2–4 characters. "取消"、"保存修改"、"立即同步".
+- **Tooltips**: full short sentence. "复制链接到剪贴板".
+- **Placeholders**: example-style. "输入 issue 标题...".
+
+### Where to look when in doubt
+
+When the glossary doesn't cover a term, look at:
+
+1. `apps/docs/content/docs/*.zh.mdx` — the de facto Chinese voice standard, 20+ pages of consistent translation
+2. `packages/views/locales/zh-Hans/auth.json` and `editor.json` — JSON structure + selector API patterns
+3. `packages/views/auth/login-page.tsx` — component-level selector API call site
+4. `packages/views/settings/components/appearance-tab.tsx` — language switcher reference
+
+---
+
+## Updating this page
+
+If you change a rule here, also:
+
+1. Apply it in the relevant locale JSONs / CLAUDE.md / docs page
+2. Note the change in the PR description so reviewers know to look for downstream sweep
+
+This page is the contract; nothing else overrides it.
diff --git a/apps/docs/content/docs/developers/conventions.zh.mdx b/apps/docs/content/docs/developers/conventions.zh.mdx
new file mode 100644
index 0000000000..84dbd33230
--- /dev/null
+++ b/apps/docs/content/docs/developers/conventions.zh.mdx
@@ -0,0 +1,292 @@
+---
+title: 规范
+description: 代码命名规范、i18n 翻译术语表、中文风格指南的唯一权威来源。
+---
+
+本页是代码命名规范、i18n 翻译术语表、中文风格指南的唯一权威来源。原本散落在 `packages/views/locales/glossary.md` 和各处注释里的规则现在都收拢到这里。
+
+写 Multica 代码、改翻译、写中文产品文案,都从这一页查。
+
+---
+
+## 1. 代码命名
+
+### 路由
+
+工作区前置路由(用户进入工作区之前能访问的路由)必须用单个单词,或者 `/{noun}/{verb}` 格式。
+
+- ✅ `/login`、`/inbox`、`/workspaces/new`
+- ❌ `/new-workspace`、`/create-team`、`/accept-invite`
+
+根目录的连字符词组会跟用户自选 workspace slug 冲突,逼着团队不停审保留字列表。把名词(`workspaces`)保留下来,整个 `/workspaces/*` 子树自动受保护。
+
+### 工作区路由
+
+永远用 `/{slug}/{section}` —— `/{slug}/issues`、`/{slug}/agents`、`/{slug}/settings`。共享代码不要复制路由逻辑,统一走 `useNavigation().push()`,不要直接用框架的 link API。
+
+### 包与模块
+
+monorepo 的包边界是硬约束:
+
+| 包 | 可依赖 | 不能依赖 |
+| --- | --- | --- |
+| `packages/core` | 仅平台无关基础库 | `react-dom`、`localStorage`、`process.env`、`next/*`、UI 库 |
+| `packages/ui` | 无业务依赖 | `@multica/core`、业务逻辑 |
+| `packages/views` | `core/`、`ui/` | `next/*`、`react-router-dom`、stores |
+| `apps/web/platform/` | `next/*` | 其他 app |
+| `apps/desktop/.../platform/` | `react-router-dom`、electron | 其他 app |
+
+两个 app 都有的逻辑,**必须**抽到共享包。"小段重复"也不算例外。
+
+### 文件与组件
+
+- 文件名:`kebab-case.tsx` / `kebab-case.ts`(如 `agent-row-actions.tsx`)
+- 组件:`PascalCase`(如 `AgentRowActions`)
+- Hook:`useCamelCase`(如 `useWorkspaceId`)
+- 测试:与源文件同目录,命名 `<file>.test.ts(x)`
+- Zustand store:`<feature>-store.ts`,导出名 `use<Feature>Store`
+
+### 数据库(Go + sqlc)
+
+- 表名:`snake_case` 单数(`user`、`workspace`、`agent_runtime`)
+- 字段:`snake_case`(`workspace_id`、`created_at`、`last_seen_at`)
+- 外键:`<table>_id`
+- 布尔:`is_<state>` 或者 `<state>_at`(状态变化优先用时间戳形式)
+- 迁移文件:`NNN_descriptive_name.up.sql` + `.down.sql`,**永远写双向**
+
+### Go
+
+- 标准 `gofmt` + `go vet`,无例外
+- Handler 文件按域命名:`agent.go`、`auth.go`、`runtime.go`
+- 测试:`<file>_test.go` 同目录
+- handler 里 UUID 解析遵守根 `CLAUDE.md` 的规则:边界输入用 `parseUUIDOrBadRequest`,可信回环用 `parseUUID`(panic 版),永远不要直接用 `util.ParseUUID` 不查 error
+
+### TypeScript
+
+- 网络上 API 响应是 `snake_case`,api client 在边界处转成 `camelCase`。**TS 代码内部一律 camelCase**
+- 类型:`PascalCase`(`Issue`、`AgentRuntime`),不加 `IPrefix`,不加 `_t` 后缀
+- 枚举:优先用 string literal union,需要 runtime 迭代时才用 `enum`
+- TanStack Query key:用 `<feature>/queries.ts` 里的工厂函数,例如 `issueKeys.detail(id)`
+
+### Issue 编号
+
+每个 issue 有人类可读的编号,比如 `MUL-123`:工作区 `issue_prefix`(3 个大写字母)+ 流水号。前缀在工作区创建时定,之后不可改。
+
+### 代码注释
+
+**只允许英文**。Go 和 TypeScript 都强制。如果在代码里看到中文注释,那就是 bug,替换掉。
+
+### Commit message
+
+Conventional 格式:`feat(scope)`、`fix(scope)`、`refactor(scope)`、`docs`、`test(scope)`、`chore(scope)`。按意图原子化分组。
+
+---
+
+## 2. i18n 翻译术语表
+
+这是每个翻译 PR 都必须遵守的术语表。原本在 `packages/views/locales/glossary.md`,那个文件现在是个 stub,指向这一页。
+
+### 核心区分:实体 vs 概念
+
+Multica 的产品名词分两类:
+
+- **实体(typed entity)** —— 有 URL、有数据库 row、是 API 响应里某种 type 的东西。中文里**用小写英文**呈现,视觉上像类型名,告诉读者"这是 Multica 系统里的特定实体"。
+- **概念(concept)** —— 不是数据库实体的普通名词。**完整翻译成中文**,CN 用户看不到生硬的英文。
+
+这套规则与 `apps/docs/content/docs/*.zh.mdx` 完全对齐 —— docs 是已经实战 20+ 篇的 CN voice 标准。
+
+### 不翻 —— 实体(小写英文)
+
+| 词 | 中文中的写法 | 例 |
+| --- | --- | --- |
+| Issue | `issue`(小写) | "把 issue 分配给智能体"、"创建子 issue" |
+| Skill | `skill`(小写) | "为智能体注入 skill" |
+| Task | `task`(小写) | "排队中的 task" |
+
+**为什么 `issue` / `skill` / `task` 不翻而 `project` / `autopilot` 翻**:
+
+- **`issue` / `task`**:dev 团队习惯说英文,"任务"在中文里和"工作"几乎同义太空泛,"工单"是 IT 工单语义,"议题"是 GitHub 风格但用户场景不匹配。三个候选都不如 `issue` 准确。
+- **`skill`**:Multica 特有概念,没有公认中文译法。
+- **`project` 翻成"项目"**:这是中文里早就稳定的日常词。飞书 / Tower / Teambition / PingCode / GitHub Projects 中文版 0 例外都翻译成"项目",没有产品保留 `project`。
+- **`autopilot` 翻成"自动化"**:autopilot 在中文里联想到特斯拉的"自动驾驶",跟产品功能(按周期跑 task)对应不上。Notion / 飞书都用"自动化",是行业共识。
+
+### 完整翻译 —— 概念词
+
+| 英 | 中 |
+| --- | --- |
+| Workspace | **工作区** |
+| Agent | **智能体** |
+| Project | **项目** |
+| Autopilot | **自动化** |
+| Daemon | **守护进程** |
+| Runtime | **运行时** |
+| Inbox | **收件箱** |
+| Comment | **评论** |
+| Reply | **回复** |
+| Notifications | **通知** |
+| Member | **成员** |
+| Label | **标签** |
+| Settings | **设置** |
+| Onboarding | **上手引导** |
+
+### 不翻 —— 品牌名 + 通用缩写
+
+| 类别 | 词 |
+| --- | --- |
+| 品牌 | **Multica**、GitHub、Slack、Google、Anthropic、OpenAI、Claude、Codex、Cursor、Linear、Jira |
+| 缩写 | API、CLI、URL、SDK、OAuth、JWT、SSO、WebSocket、HTTP、JSON、YAML、SQL |
+
+### 完整翻译 —— 通用 UI 词
+
+| 英 | 中 |
+| --- | --- |
+| Invite / Invitation | 邀请 |
+| Search | 搜索 |
+| Email | 邮箱(label)/ 邮件(action) |
+| Password | 密码 |
+| Sign in / Log in | 登录 |
+| Sign up | 注册 |
+| Sign out / Log out | 退出登录 |
+| Save / Cancel / Delete | 保存 / 取消 / 删除 |
+| Confirm / Continue / Back | 确认 / 继续 / 返回 |
+| Edit / New / Create / Add | 编辑 / 新建 / 创建 / 添加 |
+| Remove / Send / Open / Close | 移除 / 发送 / 打开 / 关闭 |
+| Done / Loading... | 完成 / 加载中... |
+| Profile / Account / Appearance | 个人资料 / 账号 / 外观 |
+| Theme / Language | 主题 / 语言 |
+| Light / Dark / System | 浅色 / 深色 / 跟随系统 |
+| Active / Archived | 活跃(或 启用)/ 已归档 |
+| Status / Priority | 状态 / 优先级 |
+| Assignee / Reporter | 负责人 / 报告人 |
+| Description / Title | 描述 / 标题 |
+| Date / Time | 日期 / 时间 |
+| Today / Yesterday / Tomorrow | 今天 / 昨天 / 明天 |
+| Empty / Failed / Success | 空 / 失败 / 成功 |
+| Error / Warning | 错误 / 警告 |
+
+### 角色名 + 状态名(小写英文,不翻)
+
+这些是 schema-level 标识符,中文环境也保持小写英文:
+
+- 角色:`owner` / `admin` / `member`
+- Issue 状态:`backlog` / `todo` / `in_progress` / `in_review` / `done` / `blocked` / `cancelled`
+
+UI 里展示这些值时保持英文(必要时用 code-style 包起来):
+
+- "你需要 owner 权限"
+- "已切换到 in_progress"
+
+### 词组组合规则
+
+英文词(实体名 + 品牌名 + 缩写)与中文之间**加单空格**:
+
+- "Create new issue" → "新建 issue"
+- "Assign to agent" → "分配给智能体"
+- "Configure runtime" → "配置运行时"
+- "Stop daemon" → "停止守护进程"
+
+### 复数与计数
+
+i18next 用 `_one` / `_other`;中文不区分语法单复数,只填 `_other`。
+
+```json
+// en/issues.json
+{
+ "issue_count_one": "{{count}} issue",
+ "issue_count_other": "{{count}} issues"
+}
+
+// zh-Hans/issues.json
+{
+ "issue_count_other": "{{count}} 个 issue"
+}
+```
+
+常见计数格式:
+
+- `{{count}} issues` → `{{count}} 个 issue`
+- `{{count}} agents` → `{{count}} 个智能体`
+- `{{count}} workspaces` → `{{count}} 个工作区`
+- `{{count}} comments` → `{{count}} 条评论`
+- `{{count}} members` → `{{count}} 位成员`
+- `{{count}} skills` → `{{count}} 个 skill`
+
+### 插值
+
+用 `{{var}}` 形式。中文翻译可以调整位置以符合中文语序。
+
+```json
+// en
+{ "welcome_message": "Welcome back, {{name}}!" }
+
+// zh-Hans
+{ "welcome_message": "欢迎回来,{{name}}!" }
+```
+
+### Key 命名约定
+
+3 层嵌套:`feature.component.action`。
+
+```json
+{
+ "feature_or_component": {
+ "subcomponent_or_section": {
+ "action_or_label": "..."
+ }
+ }
+}
+```
+
+实例:
+
+- `issues.toolbar.batch_update_success`
+- `issues.detail.comment_form.placeholder`
+- `inbox.empty.title`
+- `settings.appearance.language.title`
+
+### Web-only / Desktop-only 文案位置
+
+- 共享文案:放 namespace JSON 顶层
+- Web-only:放 `web` 段
+- Desktop-only:放 `desktop` 段
+
+参考 `auth.json`(`web` 段含 `prefer_desktop` / `desktop_handoff.*`)。
+
+---
+
+## 3. 中文风格
+
+### 标点
+
+- 中文用全角标点:`,。:;!?`
+- 引号:用 `"..."`(直引号),与英文 source 保持一致。**不要**用 `「」` 或弯引号
+- 省略号:用 `...`(三点)而非 `…`(单字符),与英文 source 保持一致
+- 中英混排:英文词左右各加 1 个空格(详见词组组合规则)
+
+### 风格原则
+
+- **简洁直白**:避免翻译腔,"对于 X 来说"、"作为 X"、"我们的"
+- **错误信息**:温和但明确,"无法保存修改" 优于 "保存修改失败了!"
+- **按钮**:动词开头,2-4 字最佳。"取消"、"保存修改"、"立即同步"
+- **Tooltip**:完整短句。"复制链接到剪贴板"
+- **placeholder**:示例性提示。"输入 issue 标题..."
+
+### 拿不准的时候去哪查
+
+术语表没覆盖的词,按这个顺序查:
+
+1. `apps/docs/content/docs/*.zh.mdx` —— CN voice 事实标准,20+ 篇高度一致
+2. `packages/views/locales/zh-Hans/auth.json` 和 `editor.json` —— JSON 结构 + selector API 用法参考
+3. `packages/views/auth/login-page.tsx` —— 组件层 selector API 调用参考
+4. `packages/views/settings/components/appearance-tab.tsx` —— 语言切换器参考
+
+---
+
+## 修改这一页时
+
+改本页规则的同时还要:
+
+1. 把规则在相关 locale JSON / CLAUDE.md / docs 页面里同步落地
+2. PR 描述里写明改了什么,方便 reviewer 检查下游是否跟着改了
+
+本页是契约,其他文档不能 override。
diff --git a/apps/docs/content/docs/developers/meta.json b/apps/docs/content/docs/developers/meta.json
new file mode 100644
index 0000000000..8aa9ab8c10
--- /dev/null
+++ b/apps/docs/content/docs/developers/meta.json
@@ -0,0 +1,4 @@
+{
+ "title": "Developers",
+ "pages": ["conventions"]
+}
diff --git a/apps/docs/content/docs/developers/meta.zh.json b/apps/docs/content/docs/developers/meta.zh.json
index bb9377400b..a3ecbd2741 100644
--- a/apps/docs/content/docs/developers/meta.zh.json
+++ b/apps/docs/content/docs/developers/meta.zh.json
@@ -1,4 +1,4 @@
{
"title": "Developers",
- "pages": ["contributing", "architecture"]
+ "pages": ["contributing", "architecture", "conventions"]
}
diff --git a/apps/docs/content/docs/meta.json b/apps/docs/content/docs/meta.json
index 3415e3463e..1cd140483c 100644
--- a/apps/docs/content/docs/meta.json
+++ b/apps/docs/content/docs/meta.json
@@ -33,6 +33,8 @@
"---Reference---",
"cli",
"auth-tokens",
- "desktop-app"
+ "desktop-app",
+ "---Developers---",
+ "developers"
]
}
diff --git a/apps/docs/content/docs/meta.zh.json b/apps/docs/content/docs/meta.zh.json
index 691a196a75..32f5f9a8d9 100644
--- a/apps/docs/content/docs/meta.zh.json
+++ b/apps/docs/content/docs/meta.zh.json
@@ -32,6 +32,8 @@
"---参考---",
"cli",
"auth-tokens",
- "desktop-app"
+ "desktop-app",
+ "---开发者---",
+ "developers"
]
}
diff --git a/apps/web/app/(auth)/login/page.test.tsx b/apps/web/app/(auth)/login/page.test.tsx
index 05ecd45c00..a033e984c1 100644
--- a/apps/web/app/(auth)/login/page.test.tsx
+++ b/apps/web/app/(auth)/login/page.test.tsx
@@ -2,12 +2,22 @@ import { describe, it, expect, vi, beforeEach } from "vitest";
import { render, screen, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
+import { I18nProvider } from "@multica/core/i18n/react";
+import enCommon from "@multica/views/locales/en/common.json";
+import enAuth from "@multica/views/locales/en/auth.json";
+import enSettings from "@multica/views/locales/en/settings.json";
import type { ReactNode } from "react";
+const TEST_RESOURCES = {
+ en: { common: enCommon, auth: enAuth, settings: enSettings },
+};
+
function createWrapper() {
const qc = new QueryClient({ defaultOptions: { queries: { retry: false } } });
return ({ children }: { children: ReactNode }) => (
- <QueryClientProvider client={qc}>{children}</QueryClientProvider>
+ <I18nProvider locale="en" resources={TEST_RESOURCES}>
+ <QueryClientProvider client={qc}>{children}</QueryClientProvider>
+ </I18nProvider>
);
}
diff --git a/apps/web/app/(auth)/login/page.tsx b/apps/web/app/(auth)/login/page.tsx
index 4fbbe9e1f2..c2c005e599 100644
--- a/apps/web/app/(auth)/login/page.tsx
+++ b/apps/web/app/(auth)/login/page.tsx
@@ -26,6 +26,7 @@ import { captureDownloadIntent } from "@multica/core/analytics";
import { setLoggedInCookie } from "@/features/auth/auth-cookie";
import Link from "next/link";
import { LoginPage, validateCliCallback } from "@multica/views/auth";
+import { useT } from "@multica/views/i18n";
/**
* Pick where a logged-in user with no explicit `?next=` should land.
@@ -56,6 +57,7 @@ async function resolveLoggedInDestination(
function LoginPageContent() {
const router = useRouter();
const qc = useQueryClient();
+ const { t } = useT("auth");
const googleClientId = useConfigStore((state) => state.googleClientId);
const user = useAuthStore((s) => s.user);
const isLoading = useAuthStore((s) => s.isLoading);
@@ -93,7 +95,9 @@ function LoginPageContent() {
})
.catch((err) => {
setDesktopError(
- err instanceof Error ? err.message : "Failed to prepare Desktop sign-in",
+ err instanceof Error
+ ? err.message
+ : t(($) => $.web.desktop_handoff.prepare_failed),
);
});
return;
@@ -140,7 +144,9 @@ function LoginPageContent() {
<div className="flex min-h-screen items-center justify-center">
<Card className="w-full max-w-sm">
<CardHeader className="text-center">
- <CardTitle className="text-2xl">Sign-in Failed</CardTitle>
+ <CardTitle className="text-2xl">
+ {t(($) => $.web.desktop_handoff.failed_title)}
+ </CardTitle>
<CardDescription>{desktopError}</CardDescription>
</CardHeader>
</Card>
@@ -151,11 +157,13 @@ function LoginPageContent() {
<div className="flex min-h-screen items-center justify-center">
<Card className="w-full max-w-sm">
<CardHeader className="text-center">
- <CardTitle className="text-2xl">Opening Multica</CardTitle>
+ <CardTitle className="text-2xl">
+ {t(($) => $.web.desktop_handoff.opening_title)}
+ </CardTitle>
<CardDescription>
{desktopToken
- ? "You should see a prompt to open the Multica desktop app. If nothing happens, click the button below."
- : "Preparing Desktop sign-in..."}
+ ? t(($) => $.web.desktop_handoff.opening_description)
+ : t(($) => $.web.desktop_handoff.preparing)}
</CardDescription>
</CardHeader>
<CardContent className="flex justify-center">
@@ -166,7 +174,7 @@ function LoginPageContent() {
window.location.href = `multica://auth/callback?token=${encodeURIComponent(desktopToken)}`;
}}
>
- Open Multica Desktop
+ {t(($) => $.web.desktop_handoff.open_button)}
</Button>
) : (
<Loader2 className="h-6 w-6 animate-spin text-muted-foreground" />
@@ -196,18 +204,14 @@ function LoginPageContent() {
}
onTokenObtained={setLoggedInCookie}
extra={
- // Web-only nudge toward the desktop app. Copy is hardcoded EN
- // for now because the login route sits outside the landing
- // group's LocaleProvider — if this page ever becomes
- // locale-aware, the strings live in positioning doc §3.3.
<span className="text-xs text-muted-foreground">
- Prefer the desktop app?{" "}
+ {t(($) => $.web.prefer_desktop)}{" "}
<Link
href="/download"
onClick={() => captureDownloadIntent("login")}
className="font-medium text-foreground underline decoration-foreground/30 underline-offset-4 hover:decoration-foreground/70"
>
- Download
+ {t(($) => $.web.download)}
</Link>
</span>
}
diff --git a/apps/web/app/(landing)/layout.tsx b/apps/web/app/(landing)/layout.tsx
index 9819a57df5..97a6b0608b 100644
--- a/apps/web/app/(landing)/layout.tsx
+++ b/apps/web/app/(landing)/layout.tsx
@@ -1,5 +1,6 @@
import { cookies, headers } from "next/headers";
import { Instrument_Serif, Noto_Serif_SC } from "next/font/google";
+import { LOCALE_COOKIE } from "@multica/core/i18n";
import { LocaleProvider } from "@/features/landing/i18n";
import type { Locale } from "@/features/landing/i18n";
@@ -43,7 +44,7 @@ const jsonLd = {
async function getInitialLocale(): Promise<Locale> {
// 1. User's explicit preference (cookie set when they switch language)
const cookieStore = await cookies();
- const stored = cookieStore.get("multica-locale")?.value;
+ const stored = cookieStore.get(LOCALE_COOKIE)?.value;
if (stored === "en" || stored === "zh") return stored;
// 2. Detect from Accept-Language header
diff --git a/apps/web/app/layout.tsx b/apps/web/app/layout.tsx
index 389057d389..d7cb63e7a0 100644
--- a/apps/web/app/layout.tsx
+++ b/apps/web/app/layout.tsx
@@ -1,10 +1,16 @@
import type { Metadata, Viewport } from "next";
+import { headers } from "next/headers";
import { Inter, Geist_Mono, Source_Serif_4 } from "next/font/google";
import { ThemeProvider } from "@/components/theme-provider";
import { Toaster } from "@multica/ui/components/ui/sonner";
import { cn } from "@multica/ui/lib/utils";
import { WebProviders } from "@/components/web-providers";
-import { LocaleSync } from "@/components/locale-sync";
+import {
+ DEFAULT_LOCALE,
+ SUPPORTED_LOCALES,
+ type SupportedLocale,
+} from "@multica/core/i18n";
+import { RESOURCES } from "@multica/views/locales";
import "./globals.css";
// Font stack: Inter for Latin UI text + system Chinese fonts for zh content.
@@ -97,21 +103,40 @@ export const metadata: Metadata = {
},
};
-export default function RootLayout({
+function isSupportedLocale(value: string | null): value is SupportedLocale {
+ return value !== null && (SUPPORTED_LOCALES as readonly string[]).includes(value);
+}
+
+// HTML lang attribute uses BCP-47 region tags that screen readers and font
+// stacks recognize widely. i18next keeps `zh-Hans` as its internal locale
+// (script subtag is what we actually translate against), but the html element
+// expects a region-flavoured tag for accessibility tooling and CJK fallback.
+const HTML_LANG: Record<SupportedLocale, string> = {
+ en: "en",
+ "zh-Hans": "zh-CN",
+};
+
+export default async function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
+ const h = await headers();
+ const headerLocale = h.get("x-multica-locale");
+ const locale: SupportedLocale = isSupportedLocale(headerLocale)
+ ? headerLocale
+ : DEFAULT_LOCALE;
+ const resources = { [locale]: RESOURCES[locale] };
+
return (
<html
- lang="en"
+ lang={HTML_LANG[locale]}
suppressHydrationWarning
className={cn("antialiased font-sans h-full", inter.variable, geistMono.variable, sourceSerif.variable)}
>
<body className="h-full overflow-hidden">
- <LocaleSync />
<ThemeProvider>
- <WebProviders>
+ <WebProviders locale={locale} resources={resources}>
{children}
</WebProviders>
<Toaster />
diff --git a/apps/web/components/locale-sync.tsx b/apps/web/components/locale-sync.tsx
deleted file mode 100644
index e223adb388..0000000000
--- a/apps/web/components/locale-sync.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-"use client";
-
-import { useEffect } from "react";
-
-/**
- * Reads the locale cookie on the client and updates <html lang>.
- * This avoids calling cookies() in the root Server Component layout,
- * which would mark the entire app as dynamic and disable the Router Cache.
- */
-export function LocaleSync() {
- useEffect(() => {
- const match = document.cookie.match(/(?:^|;\s*)multica-locale=(\w+)/);
- const locale = match?.[1];
- if (locale === "zh") {
- document.documentElement.lang = "zh";
- }
- }, []);
-
- return null;
-}
diff --git a/apps/web/components/web-providers.tsx b/apps/web/components/web-providers.tsx
index e3b8b5f996..c5832602c6 100644
--- a/apps/web/components/web-providers.tsx
+++ b/apps/web/components/web-providers.tsx
@@ -2,6 +2,8 @@
import { Suspense, useMemo } from "react";
import { CoreProvider } from "@multica/core/platform";
+import { createBrowserCookieLocaleAdapter } from "@multica/core/i18n/browser";
+import type { LocaleResources, SupportedLocale } from "@multica/core/i18n";
import packageJson from "../package.json";
import { WebNavigationProvider } from "@/platform/navigation";
import {
@@ -41,7 +43,15 @@ function deriveWsUrl(): string | undefined {
const WEB_VERSION =
process.env.NEXT_PUBLIC_APP_VERSION || packageJson.version || "dev";
-export function WebProviders({ children }: { children: React.ReactNode }) {
+export function WebProviders({
+ children,
+ locale,
+ resources,
+}: {
+ children: React.ReactNode;
+ locale: SupportedLocale;
+ resources: Record<string, LocaleResources>;
+}) {
const cookieAuth = !hasLegacyToken();
// Stable identity reference so downstream effects keyed on it don't see a
// new object on every parent render.
@@ -49,6 +59,7 @@ export function WebProviders({ children }: { children: React.ReactNode }) {
() => ({ platform: "web", version: WEB_VERSION }),
[],
);
+ const localeAdapter = useMemo(() => createBrowserCookieLocaleAdapter(), []);
return (
<CoreProvider
apiBaseUrl={process.env.NEXT_PUBLIC_API_URL}
@@ -57,6 +68,9 @@ export function WebProviders({ children }: { children: React.ReactNode }) {
onLogin={setLoggedInCookie}
onLogout={clearLoggedInCookie}
identity={identity}
+ locale={locale}
+ resources={resources}
+ localeAdapter={localeAdapter}
>
{/* Suspense boundary is required by Next.js for useSearchParams in
a client component mounted this high in the tree. */}
diff --git a/apps/web/features/landing/i18n/context.tsx b/apps/web/features/landing/i18n/context.tsx
index eb5e90669a..4407067404 100644
--- a/apps/web/features/landing/i18n/context.tsx
+++ b/apps/web/features/landing/i18n/context.tsx
@@ -2,6 +2,7 @@
import { createContext, useContext, useState, useCallback, useMemo } from "react";
import { useConfigStore } from "@multica/core/config";
+import { LOCALE_COOKIE } from "@multica/core/i18n";
import { createEnDict } from "./en";
import { createZhDict } from "./zh";
import type { LandingDict, Locale } from "./types";
@@ -11,7 +12,6 @@ const dictionaryFactories: Record<Locale, (allowSignup: boolean) => LandingDict>
zh: createZhDict,
};
-const COOKIE_NAME = "multica-locale";
const COOKIE_MAX_AGE = 60 * 60 * 24 * 365; // 1 year
type LocaleContextValue = {
@@ -38,7 +38,11 @@ export function LocaleProvider({
const setLocale = useCallback((l: Locale) => {
setLocaleState(l);
- document.cookie = `${COOKIE_NAME}=${l}; path=/; max-age=${COOKIE_MAX_AGE}; SameSite=Lax`;
+ const secure =
+ typeof location !== "undefined" && location.protocol === "https:"
+ ? "; Secure"
+ : "";
+ document.cookie = `${LOCALE_COOKIE}=${l}; path=/; max-age=${COOKIE_MAX_AGE}; SameSite=Lax${secure}`;
}, []);
return (
diff --git a/apps/web/next-env.d.ts b/apps/web/next-env.d.ts
index 9edff1c7ca..c4b7818fbb 100644
--- a/apps/web/next-env.d.ts
+++ b/apps/web/next-env.d.ts
@@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
-import "./.next/types/routes.d.ts";
+import "./.next/dev/types/routes.d.ts";
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
diff --git a/apps/web/proxy.ts b/apps/web/proxy.ts
index 3eb107c3fc..6debb341c2 100644
--- a/apps/web/proxy.ts
+++ b/apps/web/proxy.ts
@@ -1,4 +1,5 @@
import { NextResponse, type NextRequest } from "next/server";
+import { matchLocale, LOCALE_COOKIE } from "@multica/core/i18n";
// Old workspace-scoped route segments that existed before the URL refactor
// (pre-#1131). Any URL with these as the FIRST segment is a legacy URL that
@@ -16,7 +17,34 @@ const LEGACY_ROUTE_SEGMENTS = new Set([
"settings",
]);
-// Next.js 16 renamed `middleware` → `proxy`. The runtime API is identical.
+// Resolve the active locale per request. Cookie wins over Accept-Language;
+// matchLocale() falls back to DEFAULT_LOCALE when neither yields a match.
+function resolveLocale(req: NextRequest): string {
+ const cookieLocale = req.cookies.get(LOCALE_COOKIE)?.value;
+ const acceptLanguage = req.headers.get("accept-language") ?? "";
+ const candidates: string[] = [];
+ if (cookieLocale) candidates.push(cookieLocale);
+ for (const part of acceptLanguage.split(",")) {
+ const tag = part.split(";")[0]?.trim();
+ if (tag) candidates.push(tag);
+ }
+ return matchLocale(candidates);
+}
+
+// Forward the resolved locale to RSC layouts via the `x-multica-locale`
+// request header. layout.tsx reads it through `await headers()`. The
+// `request: { headers }` form is what makes the header land on the upstream
+// request — without it the value would only sit on the response.
+function nextWithLocale(req: NextRequest): NextResponse {
+ const headers = new Headers(req.headers);
+ headers.set("x-multica-locale", resolveLocale(req));
+ return NextResponse.next({ request: { headers } });
+}
+
+// Next.js 16 renamed `middleware` → `proxy`. API surface (NextRequest /
+// NextResponse / cookies / matcher) is identical; the only behavioral
+// change is the runtime — proxy is forced to nodejs and cannot opt into
+// edge.
export function proxy(req: NextRequest) {
const { pathname } = req.nextUrl;
const hasSession = req.cookies.has("multica_logged_in");
@@ -48,34 +76,21 @@ export function proxy(req: NextRequest) {
}
// --- Root path: redirect logged-in users to their last workspace ---
- if (pathname === "/") {
- if (!hasSession) return NextResponse.next();
-
- if (lastSlug) {
- const url = req.nextUrl.clone();
- url.pathname = `/${lastSlug}/issues`;
- return NextResponse.redirect(url);
- }
-
- // No last_workspace_slug cookie → let landing page pick the first workspace
- // client-side (features/landing/components/redirect-if-authenticated.tsx).
- return NextResponse.next();
+ if (pathname === "/" && hasSession && lastSlug) {
+ const url = req.nextUrl.clone();
+ url.pathname = `/${lastSlug}/issues`;
+ return NextResponse.redirect(url);
}
- return NextResponse.next();
+ // --- Default: forward locale header to RSC, no redirect/rewrite ---
+ // Covers logged-out root path, /login, /:slug/*, and everything else.
+ return nextWithLocale(req);
}
export const config = {
- matcher: [
- "/",
- "/issues/:path*",
- "/projects/:path*",
- "/agents/:path*",
- "/inbox/:path*",
- "/my-issues/:path*",
- "/autopilots/:path*",
- "/runtimes/:path*",
- "/skills/:path*",
- "/settings/:path*",
- ],
+ // i18n header must land on every page request, so we use the standard
+ // negative-lookahead pattern from Next's i18n guide: skip API routes
+ // (Go backend), Next internals, and any path with a file extension
+ // (favicons, sw.js, public/* assets).
+ matcher: ["/((?!api|_next/static|_next/image|favicon.ico|.*\\.).*)"],
};
diff --git a/apps/web/test/helpers.tsx b/apps/web/test/helpers.tsx
index 60148302e9..d9a004f89d 100644
--- a/apps/web/test/helpers.tsx
+++ b/apps/web/test/helpers.tsx
@@ -14,6 +14,7 @@ export const mockUser: User = {
// Matches real server behavior for anyone who onboarded before this
// field shipped — migration 054 backfills 'skipped_legacy'.
starter_content_state: "skipped_legacy",
+ language: null,
created_at: "2026-01-01T00:00:00Z",
updated_at: "2026-01-01T00:00:00Z",
};
diff --git a/packages/core/i18n/adapter-context.tsx b/packages/core/i18n/adapter-context.tsx
new file mode 100644
index 0000000000..91bd692f3d
--- /dev/null
+++ b/packages/core/i18n/adapter-context.tsx
@@ -0,0 +1,30 @@
+"use client";
+
+import { createContext, useContext, type ReactNode } from "react";
+import type { LocaleAdapter } from "./types";
+
+const LocaleAdapterContext = createContext<LocaleAdapter | null>(null);
+
+export function LocaleAdapterProvider({
+ adapter,
+ children,
+}: {
+ adapter: LocaleAdapter;
+ children: ReactNode;
+}) {
+ return (
+ <LocaleAdapterContext.Provider value={adapter}>
+ {children}
+ </LocaleAdapterContext.Provider>
+ );
+}
+
+export function useLocaleAdapter(): LocaleAdapter {
+ const ctx = useContext(LocaleAdapterContext);
+ if (!ctx) {
+ throw new Error(
+ "useLocaleAdapter must be used within <LocaleAdapterProvider>",
+ );
+ }
+ return ctx;
+}
diff --git a/packages/core/i18n/browser-cookie-adapter.test.ts b/packages/core/i18n/browser-cookie-adapter.test.ts
new file mode 100644
index 0000000000..1cee62e83b
--- /dev/null
+++ b/packages/core/i18n/browser-cookie-adapter.test.ts
@@ -0,0 +1,59 @@
+// @vitest-environment jsdom
+import { afterEach, beforeEach, describe, expect, it } from "vitest";
+import {
+ LOCALE_COOKIE,
+ createBrowserCookieLocaleAdapter,
+} from "./browser-cookie-adapter";
+
+function clearCookies() {
+ document.cookie
+ .split(";")
+ .map((c) => c.trim().split("=")[0])
+ .filter(Boolean)
+ .forEach((name) => {
+ document.cookie = `${name}=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT`;
+ });
+}
+
+describe("createBrowserCookieLocaleAdapter", () => {
+ beforeEach(clearCookies);
+ afterEach(clearCookies);
+
+ it("getUserChoice returns null when no cookie is set", () => {
+ const adapter = createBrowserCookieLocaleAdapter();
+ expect(adapter.getUserChoice()).toBe(null);
+ });
+
+ it("getUserChoice round-trips a persisted value", () => {
+ const adapter = createBrowserCookieLocaleAdapter();
+ adapter.persist("zh-Hans");
+ expect(adapter.getUserChoice()).toBe("zh-Hans");
+ });
+
+ it("getUserChoice decodes URI-encoded cookie values", () => {
+ document.cookie = `${LOCALE_COOKIE}=${encodeURIComponent("zh-Hans")}; path=/`;
+ expect(createBrowserCookieLocaleAdapter().getUserChoice()).toBe("zh-Hans");
+ });
+
+ it("getUserChoice ignores unrelated cookies that share a prefix", () => {
+ document.cookie = `${LOCALE_COOKIE}-other=should-not-match; path=/`;
+ expect(createBrowserCookieLocaleAdapter().getUserChoice()).toBe(null);
+ });
+
+ it("persist writes a cookie with SameSite=Lax", () => {
+ const adapter = createBrowserCookieLocaleAdapter();
+ adapter.persist("en");
+ expect(document.cookie).toContain(`${LOCALE_COOKIE}=en`);
+ });
+
+ it("getSystemPreferences mirrors navigator.languages", () => {
+ Object.defineProperty(navigator, "languages", {
+ value: ["zh-Hans-CN", "en-US"],
+ configurable: true,
+ });
+ expect(createBrowserCookieLocaleAdapter().getSystemPreferences()).toEqual([
+ "zh-Hans-CN",
+ "en-US",
+ ]);
+ });
+});
diff --git a/packages/core/i18n/browser-cookie-adapter.ts b/packages/core/i18n/browser-cookie-adapter.ts
new file mode 100644
index 0000000000..4079c89090
--- /dev/null
+++ b/packages/core/i18n/browser-cookie-adapter.ts
@@ -0,0 +1,35 @@
+import type { LocaleAdapter, SupportedLocale } from "./types";
+
+export const LOCALE_COOKIE = "multica-locale";
+const COOKIE_MAX_AGE = 60 * 60 * 24 * 365;
+
+// Web-only adapter: persists via document.cookie so the Next.js proxy can
+// read the active locale on the next request. Desktop has no server-side
+// proxy and must use createDesktopLocaleAdapter (apps/desktop/.../i18n-adapter)
+// which persists via window.localStorage instead.
+export function createBrowserCookieLocaleAdapter(): LocaleAdapter {
+ return {
+ getUserChoice() {
+ if (typeof document === "undefined") return null;
+ const m = document.cookie.match(
+ new RegExp(`(?:^|;\\s*)${LOCALE_COOKIE}=([^;]+)`),
+ );
+ const value = m?.[1];
+ return value ? decodeURIComponent(value) : null;
+ },
+ getSystemPreferences() {
+ if (typeof navigator === "undefined") return [];
+ return [...navigator.languages];
+ },
+ persist(locale: SupportedLocale) {
+ if (typeof document === "undefined") return;
+ const secure =
+ typeof location !== "undefined" && location.protocol === "https:"
+ ? ";Secure"
+ : "";
+ document.cookie =
+ `${LOCALE_COOKIE}=${encodeURIComponent(locale)};` +
+ `path=/;max-age=${COOKIE_MAX_AGE};SameSite=Lax${secure}`;
+ },
+ };
+}
diff --git a/packages/core/i18n/browser.ts b/packages/core/i18n/browser.ts
new file mode 100644
index 0000000000..5d72d89135
--- /dev/null
+++ b/packages/core/i18n/browser.ts
@@ -0,0 +1,8 @@
+// Browser-only entry: anything that touches `document` / `navigator` /
+// `window` lives here, so accidental imports from RSC, Edge middleware, or
+// nodejs proxy.ts crash at the import site instead of at first call.
+//
+// `LOCALE_COOKIE` (a plain string constant) is also exported from the
+// server-safe `@multica/core/i18n` entry — proxy.ts needs it to read the
+// cookie from a NextRequest. Only the adapter factory is browser-restricted.
+export { createBrowserCookieLocaleAdapter } from "./browser-cookie-adapter";
diff --git a/packages/core/i18n/create-i18n.ts b/packages/core/i18n/create-i18n.ts
new file mode 100644
index 0000000000..2f8988f6c5
--- /dev/null
+++ b/packages/core/i18n/create-i18n.ts
@@ -0,0 +1,23 @@
+import i18next, { type i18n as I18n } from "i18next";
+import { initReactI18next } from "react-i18next";
+import type { LocaleResources, SupportedLocale } from "./types";
+
+// Both server (RSC) and client must call this with the SAME locale + resources
+// to avoid hydration mismatch. `initAsync: false` forces synchronous init
+// (renamed from `initImmediate` in i18next v25+); `useSuspense: false`
+// prevents fallback rendering during hydration.
+export function createI18n(
+ locale: SupportedLocale,
+ resources: Record<string, LocaleResources>,
+): I18n {
+ const instance = i18next.createInstance();
+ instance.use(initReactI18next).init({
+ lng: locale,
+ fallbackLng: "en",
+ resources,
+ interpolation: { escapeValue: false },
+ initAsync: false,
+ react: { useSuspense: false },
+ });
+ return instance;
+}
diff --git a/packages/core/i18n/index.ts b/packages/core/i18n/index.ts
new file mode 100644
index 0000000000..0d4c1214f4
--- /dev/null
+++ b/packages/core/i18n/index.ts
@@ -0,0 +1,20 @@
+// Server-safe i18n entry: zero React imports + zero DOM/document/navigator
+// access anywhere in this transitive graph. Safe to import from proxy.ts /
+// RSC / Edge / nodejs middleware.
+//
+// React-side helpers (I18nProvider, useLocaleAdapter, createI18n) live in
+// "@multica/core/i18n/react" — split because Next.js gives RSC a vendored
+// React build that lacks createContext, and react-i18next's top-level
+// React.createContext() call would crash any non-client load of this file.
+//
+// Browser-only helpers (createBrowserCookieLocaleAdapter) live in
+// "@multica/core/i18n/browser" — they read document.cookie / navigator.languages
+// at construction time and would crash in any non-DOM context.
+export type {
+ LocaleAdapter,
+ LocaleResources,
+ SupportedLocale,
+} from "./types";
+export { DEFAULT_LOCALE, SUPPORTED_LOCALES } from "./types";
+export { matchLocale, pickLocale } from "./pick-locale";
+export { LOCALE_COOKIE } from "./browser-cookie-adapter";
diff --git a/packages/core/i18n/pick-locale.test.ts b/packages/core/i18n/pick-locale.test.ts
new file mode 100644
index 0000000000..bb7ad302fe
--- /dev/null
+++ b/packages/core/i18n/pick-locale.test.ts
@@ -0,0 +1,80 @@
+import { describe, expect, it } from "vitest";
+import { matchLocale, pickLocale } from "./pick-locale";
+import type { LocaleAdapter } from "./types";
+
+function makeAdapter(
+ overrides: Partial<LocaleAdapter> = {},
+): LocaleAdapter {
+ return {
+ getUserChoice: () => null,
+ getSystemPreferences: () => [],
+ persist: () => {},
+ ...overrides,
+ };
+}
+
+describe("matchLocale", () => {
+ it("returns DEFAULT_LOCALE when given an empty list", () => {
+ expect(matchLocale([])).toBe("en");
+ });
+
+ it("matches a clean supported tag", () => {
+ expect(matchLocale(["zh-Hans"])).toBe("zh-Hans");
+ expect(matchLocale(["en"])).toBe("en");
+ });
+
+ it("collapses region-tagged BCP-47 to the supported base", () => {
+ expect(matchLocale(["en-US"])).toBe("en");
+ expect(matchLocale(["zh-Hans-CN"])).toBe("zh-Hans");
+ });
+
+ it("falls back to DEFAULT_LOCALE when no candidate matches", () => {
+ expect(matchLocale(["fr", "ja", "ko"])).toBe("en");
+ });
+
+ it("zh-Hant (traditional) collapses to zh-Hans — same base subtag, better UX than English fallback", () => {
+ expect(matchLocale(["zh-Hant"])).toBe("zh-Hans");
+ });
+
+ it("uses the first supported candidate when multiple appear", () => {
+ expect(matchLocale(["fr", "zh-Hans", "en"])).toBe("zh-Hans");
+ });
+
+ it("returns DEFAULT_LOCALE for malformed BCP-47 tags rather than throwing", () => {
+ expect(matchLocale(["----"])).toBe("en");
+ expect(matchLocale(["x-private-only"])).toBe("en");
+ });
+});
+
+describe("pickLocale", () => {
+ it("prefers explicit user choice over system signal", () => {
+ const adapter = makeAdapter({
+ getUserChoice: () => "zh-Hans",
+ getSystemPreferences: () => ["en-US"],
+ });
+ expect(pickLocale(adapter)).toBe("zh-Hans");
+ });
+
+ it("falls back to system preferences when no user choice", () => {
+ const adapter = makeAdapter({
+ getSystemPreferences: () => ["zh-Hans-CN", "en-US"],
+ });
+ expect(pickLocale(adapter)).toBe("zh-Hans");
+ });
+
+ it("returns DEFAULT_LOCALE when neither choice nor preference yields a match", () => {
+ const adapter = makeAdapter({
+ getUserChoice: () => null,
+ getSystemPreferences: () => ["fr", "ja"],
+ });
+ expect(pickLocale(adapter)).toBe("en");
+ });
+
+ it("ignores empty-string user choice and falls through to system", () => {
+ const adapter = makeAdapter({
+ getUserChoice: () => "",
+ getSystemPreferences: () => ["zh-Hans"],
+ });
+ expect(pickLocale(adapter)).toBe("zh-Hans");
+ });
+});
diff --git a/packages/core/i18n/pick-locale.ts b/packages/core/i18n/pick-locale.ts
new file mode 100644
index 0000000000..c93c422cea
--- /dev/null
+++ b/packages/core/i18n/pick-locale.ts
@@ -0,0 +1,26 @@
+import { match } from "@formatjs/intl-localematcher";
+import {
+ DEFAULT_LOCALE,
+ SUPPORTED_LOCALES,
+ type LocaleAdapter,
+ type SupportedLocale,
+} from "./types";
+
+export function matchLocale(candidates: string[]): SupportedLocale {
+ if (candidates.length === 0) return DEFAULT_LOCALE;
+ try {
+ return match(
+ candidates,
+ SUPPORTED_LOCALES,
+ DEFAULT_LOCALE,
+ ) as SupportedLocale;
+ } catch {
+ return DEFAULT_LOCALE;
+ }
+}
+
+export function pickLocale(adapter: LocaleAdapter): SupportedLocale {
+ const choice = adapter.getUserChoice();
+ if (choice) return matchLocale([choice]);
+ return matchLocale(adapter.getSystemPreferences());
+}
diff --git a/packages/core/i18n/provider.tsx b/packages/core/i18n/provider.tsx
new file mode 100644
index 0000000000..bf824a91c0
--- /dev/null
+++ b/packages/core/i18n/provider.tsx
@@ -0,0 +1,24 @@
+"use client";
+
+import { useState, type ReactNode } from "react";
+import { I18nextProvider } from "react-i18next";
+import { createI18n } from "./create-i18n";
+import type { LocaleResources, SupportedLocale } from "./types";
+
+export interface I18nProviderProps {
+ locale: SupportedLocale;
+ resources: Record<string, LocaleResources>;
+ children: ReactNode;
+}
+
+export function I18nProvider({
+ locale,
+ resources,
+ children,
+}: I18nProviderProps) {
+ // Lazy init via useState so the instance survives re-renders.
+ // Locale + resources are determined at boot and never change at runtime —
+ // language switching goes through window.location.reload().
+ const [instance] = useState(() => createI18n(locale, resources));
+ return <I18nextProvider i18n={instance}>{children}</I18nextProvider>;
+}
diff --git a/packages/core/i18n/react.ts b/packages/core/i18n/react.ts
new file mode 100644
index 0000000000..b9f1aeff4b
--- /dev/null
+++ b/packages/core/i18n/react.ts
@@ -0,0 +1,9 @@
+// React-only i18n entry: depends on react-i18next, which calls
+// React.createContext() at module load. Importing this from a non-client
+// context (RSC / proxy.ts) will crash with "createContext is not a function"
+// because Next.js vendors a stripped React build for those contexts.
+// Always pair with "use client" or import only inside client trees.
+export { createI18n } from "./create-i18n";
+export { I18nProvider, type I18nProviderProps } from "./provider";
+export { LocaleAdapterProvider, useLocaleAdapter } from "./adapter-context";
+export { UserLocaleSync } from "./user-locale-sync";
diff --git a/packages/core/i18n/types.ts b/packages/core/i18n/types.ts
new file mode 100644
index 0000000000..92adb4b4a7
--- /dev/null
+++ b/packages/core/i18n/types.ts
@@ -0,0 +1,12 @@
+export type SupportedLocale = "en" | "zh-Hans";
+
+export const SUPPORTED_LOCALES: SupportedLocale[] = ["en", "zh-Hans"];
+export const DEFAULT_LOCALE: SupportedLocale = "en";
+
+export type LocaleResources = Record<string, Record<string, unknown>>;
+
+export interface LocaleAdapter {
+ getUserChoice(): string | null;
+ getSystemPreferences(): string[];
+ persist(locale: SupportedLocale): void;
+}
diff --git a/packages/core/i18n/user-locale-sync.tsx b/packages/core/i18n/user-locale-sync.tsx
new file mode 100644
index 0000000000..3d61fdb2ce
--- /dev/null
+++ b/packages/core/i18n/user-locale-sync.tsx
@@ -0,0 +1,36 @@
+"use client";
+
+import { useEffect } from "react";
+import { useTranslation } from "react-i18next";
+import { useAuthStore } from "../auth";
+import { useLocaleAdapter } from "./adapter-context";
+import { SUPPORTED_LOCALES, type SupportedLocale } from "./types";
+
+// Pulls the server-stored `user.language` into the local locale adapter on
+// login. Without this, switching device (macOS → Windows, browser → desktop)
+// loses the user's language preference: pickLocale only consults the local
+// adapter (cookie / localStorage), never user.language.
+//
+// Mounts inside CoreProvider so it has access to the auth store + locale
+// adapter + i18n instance. Renders nothing.
+//
+// Loop safety: reload only fires when user.language is a supported locale AND
+// differs from the active i18n.language. After reload, pickLocale reads the
+// freshly-persisted value from the adapter, locales match, effect no-ops.
+export function UserLocaleSync() {
+ const userLanguage = useAuthStore((s) => s.user?.language ?? null);
+ const adapter = useLocaleAdapter();
+ const { i18n } = useTranslation();
+
+ useEffect(() => {
+ if (!userLanguage) return;
+ if (!(SUPPORTED_LOCALES as readonly string[]).includes(userLanguage)) {
+ return;
+ }
+ if (userLanguage === i18n.language) return;
+ adapter.persist(userLanguage as SupportedLocale);
+ if (typeof window !== "undefined") window.location.reload();
+ }, [userLanguage, i18n.language, adapter]);
+
+ return null;
+}
diff --git a/packages/core/package.json b/packages/core/package.json
index d04c9b8059..443fed8919 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -79,12 +79,18 @@
"./utils": "./utils.ts",
"./constants/*": "./constants/*.ts",
"./platform": "./platform/index.ts",
- "./analytics": "./analytics/index.ts"
+ "./analytics": "./analytics/index.ts",
+ "./i18n": "./i18n/index.ts",
+ "./i18n/react": "./i18n/react.ts",
+ "./i18n/browser": "./i18n/browser.ts"
},
"dependencies": {
+ "@formatjs/intl-localematcher": "catalog:",
"@tanstack/react-query": "catalog:",
"@tanstack/react-query-devtools": "^5.96.2",
+ "i18next": "catalog:",
"posthog-js": "catalog:",
+ "react-i18next": "catalog:",
"zustand": "catalog:"
},
"peerDependencies": {
@@ -93,6 +99,7 @@
"devDependencies": {
"@multica/tsconfig": "workspace:*",
"@types/react": "catalog:",
+ "jsdom": "catalog:",
"typescript": "catalog:",
"vitest": "catalog:"
}
diff --git a/packages/core/platform/core-provider.tsx b/packages/core/platform/core-provider.tsx
index 219d1e48a4..a8b2b2990e 100644
--- a/packages/core/platform/core-provider.tsx
+++ b/packages/core/platform/core-provider.tsx
@@ -5,6 +5,11 @@ import { ApiClient } from "../api/client";
import { setApiInstance } from "../api";
import { createAuthStore, registerAuthStore } from "../auth";
import { createChatStore, registerChatStore } from "../chat";
+import {
+ I18nProvider,
+ LocaleAdapterProvider,
+ UserLocaleSync,
+} from "../i18n/react";
import { WSProvider } from "../realtime";
import { QueryProvider } from "../provider";
import { createLogger } from "../logger";
@@ -65,13 +70,19 @@ export function CoreProvider({
onLogin,
onLogout,
identity,
+ locale,
+ resources,
+ localeAdapter,
}: CoreProviderProps) {
// Initialize singletons on first render only. Dependencies are read-once:
// apiBaseUrl, storage, and callbacks are set at app boot and never change at runtime.
// eslint-disable-next-line react-hooks/exhaustive-deps
useMemo(() => initCore(apiBaseUrl, storage, onLogin, onLogout, cookieAuth, identity), []);
- return (
+ // I18nProvider wraps everything else: server and client must use the same
+ // (locale, resources) to avoid hydration mismatch. Language switching goes
+ // through window.location.reload(), never client-side changeLanguage.
+ const tree = (
<QueryProvider>
<AuthInitializer
onLogin={onLogin}
@@ -92,4 +103,21 @@ export function CoreProvider({
</AuthInitializer>
</QueryProvider>
);
+
+ // UserLocaleSync requires a LocaleAdapter to persist; only mount it when
+ // the host app provides one (web layout + desktop App both do).
+ const withAdapter = localeAdapter ? (
+ <LocaleAdapterProvider adapter={localeAdapter}>
+ <UserLocaleSync />
+ {tree}
+ </LocaleAdapterProvider>
+ ) : (
+ tree
+ );
+
+ return (
+ <I18nProvider locale={locale} resources={resources}>
+ {withAdapter}
+ </I18nProvider>
+ );
}
diff --git a/packages/core/platform/types.ts b/packages/core/platform/types.ts
index 55833ce7da..c5fd12d074 100644
--- a/packages/core/platform/types.ts
+++ b/packages/core/platform/types.ts
@@ -1,3 +1,8 @@
+import type {
+ LocaleAdapter,
+ LocaleResources,
+ SupportedLocale,
+} from "../i18n";
import type { StorageAdapter } from "../types/storage";
/** Identifies the calling client to the server. Threaded through to
@@ -28,4 +33,11 @@ export interface CoreProviderProps {
onLogout?: () => void;
/** Identifies the calling client (web/desktop + version + os) to the server. */
identity?: ClientIdentity;
+ /** Active locale, determined server-side (web) or at app boot (desktop). */
+ locale: SupportedLocale;
+ /** i18next resources, server-preloaded for the active locale. */
+ resources: Record<string, LocaleResources>;
+ /** Locale adapter for persisting user choice (used by Settings switcher).
+ * Optional because some shells (e.g. CLI auth pages) don't need switching. */
+ localeAdapter?: LocaleAdapter;
}
diff --git a/packages/core/types/api.ts b/packages/core/types/api.ts
index aa6e0bca9a..3b94696329 100644
--- a/packages/core/types/api.ts
+++ b/packages/core/types/api.ts
@@ -86,6 +86,7 @@ export interface SearchProjectsResponse {
export interface UpdateMeRequest {
name?: string;
avatar_url?: string;
+ language?: string;
}
export interface CreateMemberRequest {
diff --git a/packages/core/types/workspace.ts b/packages/core/types/workspace.ts
index 5ac8f3c6d3..a8ac884184 100644
--- a/packages/core/types/workspace.ts
+++ b/packages/core/types/workspace.ts
@@ -49,6 +49,8 @@ export interface User {
* 'retry_after_error') can be added without churning this type.
*/
starter_content_state: string | null;
+ /** Preferred UI language. null means "follow client/system". */
+ language: string | null;
created_at: string;
updated_at: string;
}
diff --git a/packages/views/agents/components/agent-columns.tsx b/packages/views/agents/components/agent-columns.tsx
index 96fd562466..ee29cd2944 100644
--- a/packages/views/agents/components/agent-columns.tsx
+++ b/packages/views/agents/components/agent-columns.tsx
@@ -18,6 +18,7 @@ import { ActorAvatar } from "../../common/actor-avatar";
import { availabilityConfig, workloadConfig } from "../presence";
import { AgentRowActions } from "./agent-row-actions";
import { Sparkline } from "./sparkline";
+import { useT } from "../../i18n";
// Per-row data shape. We assemble agent + runtime + presence + activity +
// run count into one struct at the page level so the column cells just
@@ -65,22 +66,32 @@ const COL_WIDTHS = {
actions: 60,
} as const;
+type ColumnHeaderT = ReturnType<typeof useT<"agents">>["t"];
+
+function makeHeaderRenderer(t: ColumnHeaderT, key: "agent" | "status" | "workload" | "runtime" | "activity_7d" | "runs") {
+ return key === "runs"
+ ? () => <div className="text-right">{t(($) => $.columns.runs)}</div>
+ : () => t(($) => $.columns[key]);
+}
+
export function createAgentColumns({
onDuplicate,
+ t,
}: {
onDuplicate: (agent: Agent) => void;
+ t: ColumnHeaderT;
}): ColumnDef<AgentRow>[] {
return [
{
id: "agent",
- header: "Agent",
+ header: makeHeaderRenderer(t, "agent"),
size: COL_WIDTHS.agent,
meta: { grow: true },
cell: ({ row }) => <AgentNameCell row={row.original} />,
},
{
id: "status",
- header: "Status",
+ header: makeHeaderRenderer(t, "status"),
size: COL_WIDTHS.status,
cell: ({ row }) => {
if (row.original.agent.archived_at) {
@@ -91,7 +102,7 @@ export function createAgentColumns({
},
{
id: "workload",
- header: "Workload",
+ header: makeHeaderRenderer(t, "workload"),
size: COL_WIDTHS.workload,
cell: ({ row }) => {
if (row.original.agent.archived_at) {
@@ -102,20 +113,20 @@ export function createAgentColumns({
},
{
id: "runtime",
- header: "Runtime",
+ header: makeHeaderRenderer(t, "runtime"),
size: COL_WIDTHS.runtime,
meta: { grow: true },
cell: ({ row }) => <RuntimeCell row={row.original} />,
},
{
id: "activity",
- header: "Activity (7d)",
+ header: makeHeaderRenderer(t, "activity_7d"),
size: COL_WIDTHS.activity,
cell: ({ row }) => <ActivityCell row={row.original} />,
},
{
id: "runs",
- header: () => <div className="text-right">Runs</div>,
+ header: makeHeaderRenderer(t, "runs"),
size: COL_WIDTHS.runs,
cell: ({ row }) => (
<div className="text-right font-mono text-xs tabular-nums text-muted-foreground">
@@ -154,6 +165,7 @@ export function createAgentColumns({
// ---------------------------------------------------------------------------
function AgentNameCell({ row }: { row: AgentRow }) {
+ const { t } = useT("agents");
const { agent, ownerIdToShow, isOwnedByMe } = row;
const isArchived = !!agent.archived_at;
const isPrivate = agent.visibility === "private";
@@ -190,7 +202,7 @@ function AgentNameCell({ row }: { row: AgentRow }) {
)}
{isOwnedByMe && !ownerIdToShow && (
<span className="shrink-0 rounded bg-muted px-1 text-[10px] font-medium text-muted-foreground">
- You
+ {t(($) => $.row.you)}
</span>
)}
{ownerIdToShow && (
@@ -202,7 +214,7 @@ function AgentNameCell({ row }: { row: AgentRow }) {
)}
{isArchived && (
<span className="shrink-0 rounded-md bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground">
- Archived
+ {t(($) => $.row.archived)}
</span>
)}
</div>
@@ -213,7 +225,7 @@ function AgentNameCell({ row }: { row: AgentRow }) {
: "italic text-muted-foreground/50"
}`}
>
- {agent.description || "No description"}
+ {agent.description || t(($) => $.row.no_description)}
</div>
</div>
</div>
@@ -225,6 +237,7 @@ function AvailabilityCell({
}: {
presence: AgentPresenceDetail | null | undefined;
}) {
+ const { t } = useT("agents");
if (!presence) {
return (
<span className="inline-flex h-3 w-16 animate-pulse rounded bg-muted/60" />
@@ -234,7 +247,7 @@ function AvailabilityCell({
return (
<span className="inline-flex items-center gap-1.5">
<span className={`h-1.5 w-1.5 shrink-0 rounded-full ${av.dotClass}`} />
- <span className={`text-xs ${av.textClass}`}>{av.label}</span>
+ <span className={`text-xs ${av.textClass}`}>{t(($) => $.availability[presence.availability])}</span>
</span>
);
}
@@ -244,6 +257,7 @@ function WorkloadCell({
}: {
presence: AgentPresenceDetail | null | undefined;
}) {
+ const { t } = useT("agents");
if (!presence) {
return (
<span className="inline-flex h-3 w-20 animate-pulse rounded bg-muted/60" />
@@ -286,7 +300,7 @@ function WorkloadCell({
className={`h-3 w-3 shrink-0 ${labelTone} ${isWorking ? "animate-spin" : ""}`}
/>
)}
- <span className={`shrink-0 ${labelTone}`}>{wl.label}</span>
+ <span className={`shrink-0 ${labelTone}`}>{t(($) => $.workload[presence.workload])}</span>
{counts && (
<span className="truncate text-muted-foreground">{counts}</span>
)}
@@ -295,10 +309,11 @@ function WorkloadCell({
}
function RuntimeCell({ row }: { row: AgentRow }) {
+ const { t } = useT("agents");
const { agent, runtime } = row;
const isCloud = agent.runtime_mode === "cloud";
const RuntimeIcon = isCloud ? Cloud : Monitor;
- const runtimeLabel = runtime?.name ?? (isCloud ? "Cloud" : "Local");
+ const runtimeLabel = runtime?.name ?? (isCloud ? t(($) => $.row.fallback_runtime_cloud) : t(($) => $.row.fallback_runtime_local));
return (
<div className="flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground">
@@ -346,24 +361,31 @@ function ActivityCell({ row }: { row: AgentRow }) {
}
function ActivityTooltipBody({ activity }: { activity: AgentActivity }) {
+ const { t } = useT("agents");
const summary = summarizeActivityWindow(activity, 7);
const { totalRuns, totalFailed } = summary;
const { daysSinceCreated } = activity;
const isPartial = daysSinceCreated < 7;
const headerText = isPartial
- ? `Created ${daysSinceCreated === 0 ? "today" : `${daysSinceCreated} day${daysSinceCreated === 1 ? "" : "s"} ago`}`
- : "Last 7 days";
+ ? daysSinceCreated === 0
+ ? t(($) => $.activity_tooltip.created_today)
+ : t(($) => $.activity_tooltip.created_days_ago, { count: daysSinceCreated })
+ : t(($) => $.activity_tooltip.last_7_days);
let bodyText: string;
if (totalRuns === 0) {
- bodyText = "No activity";
+ bodyText = t(($) => $.activity_tooltip.no_activity);
} else {
+ const runsText = t(($) => $.activity_tooltip.runs, { count: totalRuns });
const failedFragment =
totalFailed > 0
- ? ` · ${totalFailed} failed (${Math.round((totalFailed / totalRuns) * 100)}%)`
+ ? t(($) => $.activity_tooltip.failed_suffix, {
+ count: totalFailed,
+ percent: Math.round((totalFailed / totalRuns) * 100),
+ })
: "";
- bodyText = `${totalRuns} run${totalRuns === 1 ? "" : "s"}${failedFragment}`;
+ bodyText = `${runsText}${failedFragment}`;
}
return (
diff --git a/packages/views/agents/components/agent-detail-inspector.tsx b/packages/views/agents/components/agent-detail-inspector.tsx
index 1718a7da0b..7979904880 100644
--- a/packages/views/agents/components/agent-detail-inspector.tsx
+++ b/packages/views/agents/components/agent-detail-inspector.tsx
@@ -38,6 +38,7 @@ import {
import { PropRow } from "../../common/prop-row";
import { availabilityConfig } from "../presence";
import { CharCounter } from "./char-counter";
+import { useT } from "../../i18n";
import { ConcurrencyPicker } from "./inspector/concurrency-picker";
import { ModelPicker } from "./inspector/model-picker";
import { RuntimePicker } from "./inspector/runtime-picker";
@@ -89,6 +90,7 @@ export function AgentDetailInspector({
canEdit,
onUpdate,
}: InspectorProps) {
+ const { t } = useT("agents");
const update = (data: Record<string, unknown>) => onUpdate(agent.id, data);
const isOnline = runtime?.status === "online";
@@ -108,8 +110,8 @@ export function AgentDetailInspector({
{/* Properties — editable when canEdit. When the current user lacks
permission, each picker self-renders a static read-only display so
the value is visible but not interactive. */}
- <Section label="Properties">
- <PropRow label="Runtime" interactive={false}>
+ <Section label={t(($) => $.inspector.section_properties)}>
+ <PropRow label={t(($) => $.inspector.prop_runtime)} interactive={false}>
<RuntimePicker
value={agent.runtime_id}
runtimes={runtimes}
@@ -119,7 +121,7 @@ export function AgentDetailInspector({
onChange={(id) => update({ runtime_id: id })}
/>
</PropRow>
- <PropRow label="Model" interactive={false}>
+ <PropRow label={t(($) => $.inspector.prop_model)} interactive={false}>
<ModelPicker
runtimeId={agent.runtime_id}
runtimeOnline={!!isOnline}
@@ -128,14 +130,14 @@ export function AgentDetailInspector({
onChange={(m) => update({ model: m })}
/>
</PropRow>
- <PropRow label="Visibility" interactive={false}>
+ <PropRow label={t(($) => $.inspector.prop_visibility)} interactive={false}>
<VisibilityPicker
value={agent.visibility}
canEdit={canEdit}
onChange={(v) => update({ visibility: v })}
/>
</PropRow>
- <PropRow label="Concurrency" interactive={false}>
+ <PropRow label={t(($) => $.inspector.prop_concurrency)} interactive={false}>
<ConcurrencyPicker
value={agent.max_concurrent_tasks}
canEdit={canEdit}
@@ -145,9 +147,9 @@ export function AgentDetailInspector({
</Section>
{/* Details — read-only (no hover, no chip styling — these aren't clickable) */}
- <Section label="Details">
+ <Section label={t(($) => $.inspector.section_details)}>
{owner && (
- <PropRow label="Owner" interactive={false}>
+ <PropRow label={t(($) => $.inspector.prop_owner)} interactive={false}>
<span className="flex min-w-0 items-center gap-1.5">
<ActorAvatar
actorType="member"
@@ -158,12 +160,12 @@ export function AgentDetailInspector({
</span>
</PropRow>
)}
- <PropRow label="Created" interactive={false}>
+ <PropRow label={t(($) => $.inspector.prop_created)} interactive={false}>
<span className="text-muted-foreground">
{timeAgo(agent.created_at)}
</span>
</PropRow>
- <PropRow label="Updated" interactive={false}>
+ <PropRow label={t(($) => $.inspector.prop_updated)} interactive={false}>
<span className="text-muted-foreground">
{timeAgo(agent.updated_at)}
</span>
@@ -174,7 +176,7 @@ export function AgentDetailInspector({
<div className="flex flex-col border-b px-5 py-4">
<div className="mb-2 flex items-center gap-2">
<span className="text-[10px] font-medium uppercase tracking-wider text-muted-foreground">
- Skills
+ {t(($) => $.inspector.section_skills)}
</span>
<span className="font-mono text-[10px] tabular-nums text-muted-foreground/70">
{agent.skills.length}
@@ -232,6 +234,7 @@ function AvatarEditor({
canEdit: boolean;
onUpdate: (data: Record<string, unknown>) => Promise<void>;
}) {
+ const { t } = useT("agents");
const fileInputRef = useRef<HTMLInputElement>(null);
const { upload, uploading } = useFileUpload(api);
@@ -256,9 +259,9 @@ function AvatarEditor({
const result = await upload(file);
if (!result) return;
await onUpdate({ avatar_url: result.link });
- toast.success("Avatar updated");
+ toast.success(t(($) => $.inspector.avatar_updated_toast));
} catch (err) {
- toast.error(err instanceof Error ? err.message : "Failed to upload avatar");
+ toast.error(err instanceof Error ? err.message : t(($) => $.inspector.avatar_upload_failed_toast));
}
};
@@ -271,7 +274,7 @@ function AvatarEditor({
className="group relative h-14 w-14 shrink-0 overflow-hidden rounded-lg bg-muted focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"
onClick={() => fileInputRef.current?.click()}
disabled={uploading}
- aria-label="Change avatar"
+ aria-label={t(($) => $.inspector.change_avatar_aria)}
>
<ActorAvatar
actorType="agent"
@@ -307,6 +310,7 @@ function NameAndDescription({
canEdit: boolean;
onUpdate: (data: Record<string, unknown>) => Promise<void>;
}) {
+ const { t } = useT("agents");
if (!canEdit) {
return (
<div className="flex flex-col gap-1">
@@ -319,7 +323,7 @@ function NameAndDescription({
</span>
) : (
<span className="text-xs italic leading-relaxed text-muted-foreground/50">
- No description
+ {t(($) => $.inspector.no_description_placeholder)}
</span>
)}
</div>
@@ -332,9 +336,9 @@ function NameAndDescription({
value={agent.name}
onSave={(v) => onUpdate({ name: v.trim() })}
kind="input"
- title="Rename agent"
- placeholder="Agent name"
- validate={(v) => (v.trim().length > 0 ? null : "Name is required")}
+ title={t(($) => $.inspector.rename_title)}
+ placeholder={t(($) => $.inspector.rename_placeholder)}
+ validate={(v) => (v.trim().length > 0 ? null : t(($) => $.inspector.rename_required))}
>
{(triggerProps) => (
<button
@@ -375,6 +379,7 @@ function DescriptionEditor({
value: string;
onSave: (next: string) => Promise<void>;
}) {
+ const { t } = useT("agents");
const [open, setOpen] = useState(false);
return (
@@ -387,7 +392,7 @@ function DescriptionEditor({
{value ? (
<span className="text-muted-foreground">{value}</span>
) : (
- <span className="italic text-muted-foreground/50">No description</span>
+ <span className="italic text-muted-foreground/50">{t(($) => $.inspector.no_description_placeholder)}</span>
)}
<Pencil className="mt-0.5 h-3 w-3 shrink-0 text-muted-foreground/0 transition-colors group-hover:text-muted-foreground" />
</button>
@@ -416,6 +421,7 @@ function DescriptionEditorBody({
onSave: (next: string) => Promise<void>;
onClose: () => void;
}) {
+ const { t } = useT("agents");
const [draft, setDraft] = useState(initialValue);
const [saving, setSaving] = useState(false);
@@ -439,14 +445,14 @@ function DescriptionEditorBody({
return (
<>
<DialogHeader>
- <DialogTitle>Edit description</DialogTitle>
+ <DialogTitle>{t(($) => $.inspector.edit_description_title)}</DialogTitle>
</DialogHeader>
<div className="flex flex-col gap-2">
<textarea
autoFocus
value={draft}
onChange={(e) => setDraft(e.target.value)}
- placeholder="What does this agent do?"
+ placeholder={t(($) => $.inspector.description_placeholder)}
rows={6}
onKeyDown={(e) => {
if (e.key === "Escape") onClose();
@@ -466,14 +472,14 @@ function DescriptionEditorBody({
onClick={onClose}
disabled={saving}
>
- Cancel
+ {t(($) => $.inspector.cancel)}
</Button>
<Button
size="sm"
onClick={() => void commit()}
disabled={saving || overLimit || !dirty}
>
- {saving ? <Loader2 className="h-3.5 w-3.5 animate-spin" /> : "Save"}
+ {saving ? <Loader2 className="h-3.5 w-3.5 animate-spin" /> : t(($) => $.inspector.save)}
</Button>
</DialogFooter>
</>
@@ -502,6 +508,7 @@ function InlineEditPopover({
onClick: (e: React.MouseEvent) => void;
}) => ReactNode;
}) {
+ const { t } = useT("agents");
const [open, setOpen] = useState(false);
const [draft, setDraft] = useState(value);
const [saving, setSaving] = useState(false);
@@ -591,7 +598,7 @@ function InlineEditPopover({
onClick={() => setOpen(false)}
disabled={saving}
>
- Cancel
+ {t(($) => $.inspector.cancel)}
</Button>
<Button
size="sm"
@@ -601,7 +608,7 @@ function InlineEditPopover({
{saving ? (
<Loader2 className="h-3.5 w-3.5 animate-spin" />
) : (
- "Save"
+ t(($) => $.inspector.save)
)}
</Button>
</div>
@@ -620,22 +627,20 @@ function PresenceBadge({
}: {
presence: AgentPresenceDetail | null | undefined;
}) {
+ const { t } = useT("agents");
if (!presence) {
return (
<span className="inline-flex h-5 w-20 animate-pulse rounded-md bg-muted" />
);
}
const av = availabilityConfig[presence.availability];
- // Last-task chip / failure copy intentionally omitted on the detail page
- // — the Recent work panel below shows the same data with full context.
-
return (
<div className="flex flex-wrap items-center gap-1.5">
<span
className={`inline-flex items-center gap-1.5 rounded-md border px-1.5 py-0.5 text-xs ${av.textClass}`}
>
<span className={`h-1.5 w-1.5 rounded-full ${av.dotClass}`} />
- {av.label}
+ {t(($) => $.availability[presence.availability])}
</span>
</div>
);
diff --git a/packages/views/agents/components/agent-detail-page.tsx b/packages/views/agents/components/agent-detail-page.tsx
index 79f3e89cf4..9aa5a80c40 100644
--- a/packages/views/agents/components/agent-detail-page.tsx
+++ b/packages/views/agents/components/agent-detail-page.tsx
@@ -47,12 +47,14 @@ import { PageHeader } from "../../layout/page-header";
import { availabilityConfig } from "../presence";
import { AgentDetailInspector } from "./agent-detail-inspector";
import { AgentOverviewPane } from "./agent-overview-pane";
+import { useT } from "../../i18n";
interface AgentDetailPageProps {
agentId: string;
}
export function AgentDetailPage({ agentId }: AgentDetailPageProps) {
+ const { t } = useT("agents");
const wsId = useWorkspaceId();
const paths = useWorkspacePaths();
const navigation = useNavigation();
@@ -88,9 +90,9 @@ export function AgentDetailPage({ agentId }: AgentDetailPageProps) {
try {
await api.updateAgent(id, data as UpdateAgentRequest);
qc.invalidateQueries({ queryKey: workspaceKeys.agents(wsId) });
- toast.success("Agent updated");
+ toast.success(t(($) => $.detail.agent_updated_toast));
} catch (e) {
- toast.error(e instanceof Error ? e.message : "Failed to update agent");
+ toast.error(e instanceof Error ? e.message : t(($) => $.detail.update_failed_toast));
throw e;
}
};
@@ -99,9 +101,9 @@ export function AgentDetailPage({ agentId }: AgentDetailPageProps) {
try {
await api.archiveAgent(id);
qc.invalidateQueries({ queryKey: workspaceKeys.agents(wsId) });
- toast.success("Agent archived");
+ toast.success(t(($) => $.detail.agent_archived_toast));
} catch (e) {
- toast.error(e instanceof Error ? e.message : "Failed to archive agent");
+ toast.error(e instanceof Error ? e.message : t(($) => $.detail.archive_failed_toast));
}
};
@@ -109,9 +111,9 @@ export function AgentDetailPage({ agentId }: AgentDetailPageProps) {
try {
await api.restoreAgent(id);
qc.invalidateQueries({ queryKey: workspaceKeys.agents(wsId) });
- toast.success("Agent restored");
+ toast.success(t(($) => $.detail.agent_restored_toast));
} catch (e) {
- toast.error(e instanceof Error ? e.message : "Failed to restore agent");
+ toast.error(e instanceof Error ? e.message : t(($) => $.detail.restore_failed_toast));
}
};
@@ -124,15 +126,15 @@ export function AgentDetailPage({ agentId }: AgentDetailPageProps) {
if (!agent) {
return (
<div className="flex flex-1 min-h-0 flex-col">
- <BackHeader paths={paths.agents()} title="Agents" />
+ <BackHeader paths={paths.agents()} title={t(($) => $.detail.back_to_agents)} />
<div className="flex flex-1 flex-col items-center justify-center gap-3 px-6 py-16 text-center">
<AlertCircle className="h-8 w-8 text-destructive" />
<div>
- <p className="text-sm font-medium">Agent not found</p>
+ <p className="text-sm font-medium">{t(($) => $.detail.not_found_title)}</p>
<p className="mt-1 text-xs text-muted-foreground">
{agentsError instanceof Error
? agentsError.message
- : "This agent may have been archived or deleted."}
+ : t(($) => $.detail.not_found_default)}
</p>
</div>
<div className="flex items-center gap-2">
@@ -142,14 +144,14 @@ export function AgentDetailPage({ agentId }: AgentDetailPageProps) {
size="sm"
onClick={() => refetchAgents()}
>
- Try again
+ {t(($) => $.detail.try_again)}
</Button>
<Button
type="button"
size="sm"
onClick={() => navigation.push(paths.agents())}
>
- Back to agents
+ {t(($) => $.detail.back_to_agents_full)}
</Button>
</div>
</div>
@@ -189,7 +191,7 @@ export function AgentDetailPage({ agentId }: AgentDetailPageProps) {
<div className="flex shrink-0 items-center gap-2 border-b bg-muted/50 px-6 py-2 text-xs text-muted-foreground">
<AlertCircle className="h-3.5 w-3.5 shrink-0" />
<span className="flex-1">
- This agent is archived. It cannot be assigned or mentioned.
+ {t(($) => $.detail.archived_banner)}
</span>
{canEdit.allowed && (
<Button
@@ -198,7 +200,7 @@ export function AgentDetailPage({ agentId }: AgentDetailPageProps) {
className="h-6 text-xs"
onClick={() => handleRestore(agent.id)}
>
- Restore
+ {t(($) => $.detail.restore)}
</Button>
)}
</div>
@@ -238,12 +240,10 @@ export function AgentDetailPage({ agentId }: AgentDetailPageProps) {
</div>
<DialogHeader className="flex-1 gap-1">
<DialogTitle className="text-sm font-semibold">
- Archive agent?
+ {t(($) => $.detail.archive_dialog_title)}
</DialogTitle>
<DialogDescription className="text-xs">
- &quot;{agent.name}&quot; will be archived. It won&apos;t be
- assignable or mentionable, but all history is preserved. You
- can restore it later.
+ {t(($) => $.detail.archive_dialog_description, { name: agent.name })}
</DialogDescription>
</DialogHeader>
</div>
@@ -252,7 +252,7 @@ export function AgentDetailPage({ agentId }: AgentDetailPageProps) {
variant="ghost"
onClick={() => setConfirmArchive(false)}
>
- Cancel
+ {t(($) => $.detail.archive_dialog_cancel)}
</Button>
<Button
variant="destructive"
@@ -262,7 +262,7 @@ export function AgentDetailPage({ agentId }: AgentDetailPageProps) {
navigation.push(paths.agents());
}}
>
- Archive
+ {t(($) => $.detail.archive_dialog_confirm)}
</Button>
</DialogFooter>
</DialogContent>
@@ -285,8 +285,11 @@ function DetailHeader({
canArchive: boolean;
onArchive: () => void;
}) {
+ const { t } = useT("agents");
const isArchived = !!agent.archived_at;
- const av = presence ? availabilityConfig[presence.availability] : null;
+ const av = presence
+ ? { ...availabilityConfig[presence.availability], label: t(($) => $.availability[presence.availability]) }
+ : null;
// Last-task state is intentionally not surfaced in the header — the
// Recent work section on this page already shows the same information
// (and richer: titles, timestamps, error messages). Showing "Completed"
@@ -300,7 +303,7 @@ function DetailHeader({
className="inline-flex h-7 items-center gap-1 rounded-md px-2 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"
>
<ArrowLeft className="h-3.5 w-3.5" />
- Agents
+ {t(($) => $.detail.back_to_agents)}
</AppLink>
<span className="text-muted-foreground/40">/</span>
<h1 className="truncate text-sm font-medium">{agent.name}</h1>
@@ -327,7 +330,7 @@ function DetailHeader({
onClick={onArchive}
>
<Trash2 className="h-3.5 w-3.5" />
- Archive Agent
+ {t(($) => $.detail.more_archive)}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
diff --git a/packages/views/agents/components/agent-overview-pane.tsx b/packages/views/agents/components/agent-overview-pane.tsx
index 1fc92ee969..508acb7d49 100644
--- a/packages/views/agents/components/agent-overview-pane.tsx
+++ b/packages/views/agents/components/agent-overview-pane.tsx
@@ -24,6 +24,7 @@ import { InstructionsTab } from "./tabs/instructions-tab";
import { SkillsTab } from "./tabs/skills-tab";
import { EnvTab } from "./tabs/env-tab";
import { CustomArgsTab } from "./tabs/custom-args-tab";
+import { useT } from "../../i18n";
type DetailTab =
| "activity"
@@ -32,16 +33,23 @@ type DetailTab =
| "env"
| "custom_args";
+const TAB_LABEL_KEY: Record<DetailTab, "activity" | "instructions" | "skills" | "environment" | "custom_args"> = {
+ activity: "activity",
+ instructions: "instructions",
+ skills: "skills",
+ env: "environment",
+ custom_args: "custom_args",
+};
+
const detailTabs: {
id: DetailTab;
- label: string;
icon: typeof FileText;
}[] = [
- { id: "activity", label: "Activity", icon: Activity },
- { id: "instructions", label: "Instructions", icon: FileText },
- { id: "skills", label: "Skills", icon: BookOpenText },
- { id: "env", label: "Environment", icon: KeyRound },
- { id: "custom_args", label: "Custom Args", icon: Terminal },
+ { id: "activity", icon: Activity },
+ { id: "instructions", icon: FileText },
+ { id: "skills", icon: BookOpenText },
+ { id: "env", icon: KeyRound },
+ { id: "custom_args", icon: Terminal },
];
interface AgentOverviewPaneProps {
@@ -77,6 +85,7 @@ export function AgentOverviewPane({
runtimes,
onUpdate,
}: AgentOverviewPaneProps) {
+ const { t } = useT("agents");
const [activeTab, setActiveTab] = useState<DetailTab>("activity");
const [activeDirty, setActiveDirty] = useState(false);
// Holds the destination when a tab change is intercepted by the dirty
@@ -122,7 +131,7 @@ export function AgentOverviewPane({
}`}
>
<tab.icon className="h-3.5 w-3.5" />
- {tab.label}
+ {t(($) => $.tabs[TAB_LABEL_KEY[tab.id]])}
</button>
))}
</div>
@@ -174,19 +183,18 @@ export function AgentOverviewPane({
>
<AlertDialogContent>
<AlertDialogHeader>
- <AlertDialogTitle>Discard unsaved changes?</AlertDialogTitle>
+ <AlertDialogTitle>{t(($) => $.tabs.discard_dialog_title)}</AlertDialogTitle>
<AlertDialogDescription>
- You have unsaved changes in this tab. Leaving now will discard
- them.
+ {t(($) => $.tabs.discard_dialog_description)}
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
- <AlertDialogCancel>Keep editing</AlertDialogCancel>
+ <AlertDialogCancel>{t(($) => $.tabs.discard_keep)}</AlertDialogCancel>
<AlertDialogAction
variant="destructive"
onClick={commitTabChange}
>
- Discard changes
+ {t(($) => $.tabs.discard_confirm)}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
diff --git a/packages/views/agents/components/agent-presence-indicator.tsx b/packages/views/agents/components/agent-presence-indicator.tsx
index b432c4685b..3da1ad37f1 100644
--- a/packages/views/agents/components/agent-presence-indicator.tsx
+++ b/packages/views/agents/components/agent-presence-indicator.tsx
@@ -3,6 +3,7 @@
import { Skeleton } from "@multica/ui/components/ui/skeleton";
import type { AgentPresenceDetail } from "@multica/core/agents";
import { availabilityConfig, workloadConfig } from "../presence";
+import { useT } from "../../i18n";
interface PresenceIndicatorProps {
// null/undefined = still loading. Caller passes the detail computed at
@@ -33,6 +34,7 @@ export function AgentPresenceIndicator({
detail,
compact,
}: PresenceIndicatorProps) {
+ const { t } = useT("agents");
if (!detail) {
return compact ? (
<Skeleton className="h-1.5 w-1.5 rounded-full" />
@@ -43,6 +45,8 @@ export function AgentPresenceIndicator({
const av = availabilityConfig[detail.availability];
const wl = workloadConfig[detail.workload];
+ const availabilityLabel = t(($) => $.availability[detail.availability]);
+ const workloadLabel = t(($) => $.workload[detail.workload]);
const isWorking = detail.workload === "working";
const isQueued = detail.workload === "queued";
const showQueueBadge = isWorking && detail.queuedCount > 0;
@@ -59,7 +63,7 @@ export function AgentPresenceIndicator({
return (
<span
className="inline-flex items-center"
- title={`${av.label}${detail.workload !== "idle" ? ` · ${wl.label}` : ""}`}
+ title={`${availabilityLabel}${detail.workload !== "idle" ? ` · ${workloadLabel}` : ""}`}
>
<span className={`h-1.5 w-1.5 shrink-0 rounded-full ${av.dotClass}`} />
</span>
@@ -71,7 +75,7 @@ export function AgentPresenceIndicator({
{/* Availability — dot + label. Single dimension, single colour. */}
<span className="inline-flex items-center gap-1.5">
<span className={`h-1.5 w-1.5 shrink-0 rounded-full ${av.dotClass}`} />
- <span className={`text-xs ${av.textClass}`}>{av.label}</span>
+ <span className={`text-xs ${av.textClass}`}>{availabilityLabel}</span>
</span>
{/* Workload — separator + label, with counts when working/queued.
@@ -86,7 +90,7 @@ export function AgentPresenceIndicator({
isQueued ? queuedTone : wl.textClass
}`}
>
- {wl.label}
+ {workloadLabel}
</span>
{isWorking && (
<span className="font-mono text-xs tabular-nums text-muted-foreground">
@@ -95,7 +99,7 @@ export function AgentPresenceIndicator({
)}
{showQueueBadge && (
<span className="rounded-md bg-muted px-1 py-0 text-xs font-medium text-muted-foreground">
- +{detail.queuedCount} queued
+ {t(($) => $.presence.queue_badge, { count: detail.queuedCount })}
</span>
)}
{/* Queued (no running) — show the queued count directly, since
diff --git a/packages/views/agents/components/agent-profile-card.tsx b/packages/views/agents/components/agent-profile-card.tsx
index c020128ca2..d717942d4f 100644
--- a/packages/views/agents/components/agent-profile-card.tsx
+++ b/packages/views/agents/components/agent-profile-card.tsx
@@ -17,12 +17,14 @@ import { AppLink } from "../../navigation";
import { HealthIcon } from "../../runtimes/components/shared";
import { availabilityConfig } from "../presence";
import { VisibilityBadge } from "./visibility-badge";
+import { useT } from "../../i18n";
interface AgentProfileCardProps {
agentId: string;
}
export function AgentProfileCard({ agentId }: AgentProfileCardProps) {
+ const { t } = useT("agents");
const wsId = useWorkspaceId();
const p = useWorkspacePaths();
const { data: agents = [], isLoading: agentsLoading } = useQuery(agentListOptions(wsId));
@@ -45,7 +47,7 @@ export function AgentProfileCard({ agentId }: AgentProfileCardProps) {
if (!agent) {
return (
- <div className="text-xs text-muted-foreground">Agent unavailable</div>
+ <div className="text-xs text-muted-foreground">{t(($) => $.profile_card.unavailable)}</div>
);
}
@@ -85,7 +87,7 @@ export function AgentProfileCard({ agentId }: AgentProfileCardProps) {
{!isArchived && <VisibilityBadge value={agent.visibility} compact />}
{isArchived && (
<span className="rounded-md bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground">
- Archived
+ {t(($) => $.row.archived)}
</span>
)}
</div>
@@ -98,7 +100,7 @@ export function AgentProfileCard({ agentId }: AgentProfileCardProps) {
href={p.agentDetail(agent.id)}
className="mr-1 mt-0.5 shrink-0 text-xs font-normal text-brand opacity-0 transition-opacity group-hover:opacity-100"
>
- Detail →
+ {t(($) => $.profile_card.detail_link)}
</AppLink>
)}
</div>
@@ -118,7 +120,7 @@ export function AgentProfileCard({ agentId }: AgentProfileCardProps) {
{agent.skills.length > 0 && (
<SkillsRow skills={agent.skills.map((s) => s.name)} />
)}
- {owner && <MetaRow label="Owner" value={owner.name} />}
+ {owner && <MetaRow label={t(($) => $.profile_card.owner_label)} value={owner.name} />}
</div>
</div>
);
@@ -135,6 +137,7 @@ function AgentAvailabilityLine({
wsId: string | undefined;
agentId: string;
}) {
+ const { t } = useT("agents");
const detail = useAgentPresenceDetail(wsId, agentId);
if (detail === "loading") {
return <Skeleton className="mt-0.5 h-3 w-16" />;
@@ -143,7 +146,7 @@ function AgentAvailabilityLine({
return (
<div className="mt-0.5 inline-flex items-center gap-1.5">
<span className={`h-1.5 w-1.5 rounded-full ${av.dotClass}`} />
- <span className={`text-xs ${av.textClass}`}>{av.label}</span>
+ <span className={`text-xs ${av.textClass}`}>{t(($) => $.availability[detail.availability])}</span>
</div>
);
}
@@ -162,16 +165,21 @@ function RuntimeRow({
agent: Agent;
runtime: AgentRuntime | null;
}) {
+ const { t } = useT("agents");
const isCloud = agent.runtime_mode === "cloud";
const health: RuntimeHealth = isCloud
? "online"
: runtime
? deriveRuntimeHealth(runtime, Date.now())
: "offline";
- const label = runtime?.name ?? (isCloud ? "Cloud" : "Unknown runtime");
+ const label =
+ runtime?.name ??
+ (isCloud
+ ? t(($) => $.row.fallback_runtime_cloud)
+ : t(($) => $.profile_card.unknown_runtime));
return (
<div className="flex items-center gap-1.5">
- <span className="w-12 shrink-0 text-muted-foreground">Runtime</span>
+ <span className="w-12 shrink-0 text-muted-foreground">{t(($) => $.profile_card.runtime_label)}</span>
<HealthIcon health={health} className="h-3 w-3 shrink-0" />
<span className="min-w-0 truncate" title={label}>
{label}
@@ -200,11 +208,12 @@ function MetaRow({
}
function SkillsRow({ skills }: { skills: string[] }) {
+ const { t } = useT("agents");
const visible = skills.slice(0, 3);
const overflow = skills.length - visible.length;
return (
<div className="flex items-center gap-1.5">
- <span className="w-12 shrink-0 text-muted-foreground">Skills</span>
+ <span className="w-12 shrink-0 text-muted-foreground">{t(($) => $.profile_card.skills_label)}</span>
<div className="flex min-w-0 flex-wrap gap-1">
{visible.map((s) => (
<span
diff --git a/packages/views/agents/components/agent-row-actions.tsx b/packages/views/agents/components/agent-row-actions.tsx
index 5d6c1d36e4..9ff1a78a6b 100644
--- a/packages/views/agents/components/agent-row-actions.tsx
+++ b/packages/views/agents/components/agent-row-actions.tsx
@@ -34,6 +34,7 @@ import {
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@multica/ui/components/ui/dropdown-menu";
+import { useT } from "../../i18n";
interface AgentRowActionsProps {
agent: Agent;
@@ -64,6 +65,7 @@ export function AgentRowActions({
canManage,
onDuplicate,
}: AgentRowActionsProps) {
+ const { t } = useT("agents");
const wsId = useWorkspaceId();
const qc = useQueryClient();
@@ -93,9 +95,9 @@ export function AgentRowActions({
try {
await api.archiveAgent(agent.id);
invalidateAgents();
- toast.success("Agent archived");
+ toast.success(t(($) => $.row_actions.agent_archived_toast));
} catch (e) {
- toast.error(e instanceof Error ? e.message : "Failed to archive agent");
+ toast.error(e instanceof Error ? e.message : t(($) => $.row_actions.archive_failed_toast));
}
};
@@ -103,27 +105,23 @@ export function AgentRowActions({
try {
await api.restoreAgent(agent.id);
invalidateAgents();
- toast.success("Agent restored");
+ toast.success(t(($) => $.row_actions.agent_restored_toast));
} catch (e) {
- toast.error(e instanceof Error ? e.message : "Failed to restore agent");
+ toast.error(e instanceof Error ? e.message : t(($) => $.row_actions.restore_failed_toast));
}
};
const handleCancelTasks = async () => {
try {
const { cancelled } = await api.cancelAgentTasks(agent.id);
- // Server broadcasts task:cancelled per row; useRealtimeSync will
- // invalidate the agent-task-snapshot cache for us. We still kick
- // agents in case the back-end's ReconcileAgentStatus changed
- // agent.status.
invalidateAgents();
toast.success(
cancelled === 0
- ? "No active tasks to cancel"
- : `Cancelled ${cancelled} task${cancelled === 1 ? "" : "s"}`,
+ ? t(($) => $.row_actions.no_tasks_to_cancel_toast)
+ : t(($) => $.row_actions.cancelled_tasks_toast, { count: cancelled }),
);
} catch (e) {
- toast.error(e instanceof Error ? e.message : "Failed to cancel tasks");
+ toast.error(e instanceof Error ? e.message : t(($) => $.row_actions.cancel_failed_toast));
}
};
@@ -139,7 +137,7 @@ export function AgentRowActions({
<Button
variant="ghost"
size="icon-sm"
- aria-label="Row actions"
+ aria-label={t(($) => $.row.actions_aria)}
onClick={(e) => e.stopPropagation()}
onKeyDown={(e) => e.stopPropagation()}
/>
@@ -159,19 +157,19 @@ export function AgentRowActions({
onClick={() => setConfirmCancel(true)}
>
<Square className="h-3.5 w-3.5" />
- Cancel all tasks
+ {t(($) => $.row_actions.cancel_all_tasks)}
</DropdownMenuItem>
)}
{showDuplicate && (
<DropdownMenuItem onClick={() => onDuplicate(agent)}>
<Copy className="h-3.5 w-3.5" />
- Duplicate
+ {t(($) => $.row_actions.duplicate)}
</DropdownMenuItem>
)}
{showRestore && (
<DropdownMenuItem onClick={handleRestore}>
<RotateCcw className="h-3.5 w-3.5" />
- Restore
+ {t(($) => $.row_actions.restore)}
</DropdownMenuItem>
)}
{showArchive && (
@@ -182,7 +180,7 @@ export function AgentRowActions({
onClick={() => setConfirmArchive(true)}
>
<Trash2 className="h-3.5 w-3.5" />
- Archive
+ {t(($) => $.row_actions.archive)}
</DropdownMenuItem>
</>
)}
@@ -202,20 +200,16 @@ export function AgentRowActions({
>
<AlertDialogHeader>
<AlertDialogTitle>
- Cancel all tasks for &ldquo;{agent.name}&rdquo;?
+ {t(($) => $.row_actions.cancel_dialog_title, { name: agent.name })}
</AlertDialogTitle>
<AlertDialogDescription>
- {describeCancelImpact(runningCount, queuedCount)}
- {runningCount > 0 && (
- <>
- {" "}Running tasks may take up to 5 seconds to fully halt.
- </>
- )}{" "}
- Cancelled tasks cannot be resumed.
+ {describeCancelImpact(runningCount, queuedCount, t)}
+ {runningCount > 0 && t(($) => $.row_actions.cancel_dialog_running_note)}
+ {t(($) => $.row_actions.cancel_dialog_irreversible)}
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
- <AlertDialogCancel>Keep them</AlertDialogCancel>
+ <AlertDialogCancel>{t(($) => $.row_actions.cancel_dialog_keep)}</AlertDialogCancel>
<AlertDialogAction
variant="destructive"
onClick={() => {
@@ -223,7 +217,7 @@ export function AgentRowActions({
void handleCancelTasks();
}}
>
- Cancel all tasks
+ {t(($) => $.row_actions.cancel_dialog_confirm)}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
@@ -245,18 +239,16 @@ export function AgentRowActions({
</div>
<div className="flex-1">
<AlertDialogTitle>
- Archive &ldquo;{agent.name}&rdquo;?
+ {t(($) => $.row_actions.archive_dialog_title, { name: agent.name })}
</AlertDialogTitle>
<AlertDialogDescription>
- The agent won&apos;t be assignable or mentionable, and any
- active tasks will be cancelled. All history is preserved
- and you can restore it later.
+ {t(($) => $.row_actions.archive_dialog_description)}
</AlertDialogDescription>
</div>
</div>
</AlertDialogHeader>
<AlertDialogFooter>
- <AlertDialogCancel>Cancel</AlertDialogCancel>
+ <AlertDialogCancel>{t(($) => $.row_actions.archive_dialog_cancel)}</AlertDialogCancel>
<AlertDialogAction
variant="destructive"
onClick={() => {
@@ -264,7 +256,7 @@ export function AgentRowActions({
void handleArchive();
}}
>
- Archive
+ {t(($) => $.row_actions.archive_dialog_confirm)}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
@@ -274,16 +266,17 @@ export function AgentRowActions({
);
}
-function describeCancelImpact(running: number, queued: number): string {
- // Both zero shouldn't happen — the menu item is gated on hasActiveWork —
- // but guarding anyway so the copy never reads "stop 0 tasks and 0 tasks".
+type AgentsT = ReturnType<typeof useT<"agents">>["t"];
+
+function describeCancelImpact(running: number, queued: number, t: AgentsT): string {
if (running === 0 && queued === 0) {
- return "There are no active tasks to cancel.";
+ return t(($) => $.row_actions.cancel_dialog_no_tasks);
}
const parts: string[] = [];
- if (running > 0) parts.push(`${running} running`);
- if (queued > 0) parts.push(`${queued} queued`);
- return `This will cancel ${parts.join(" and ")} ${
- running + queued === 1 ? "task" : "tasks"
- }.`;
+ if (running > 0) parts.push(t(($) => $.row_actions.cancel_dialog_running, { count: running }));
+ if (queued > 0) parts.push(t(($) => $.row_actions.cancel_dialog_queued, { count: queued }));
+ return t(($) => $.row_actions.cancel_dialog_impact, {
+ summary: parts.join(" + "),
+ count: running + queued,
+ });
}
diff --git a/packages/views/agents/components/agents-page.tsx b/packages/views/agents/components/agents-page.tsx
index 526f3dbb66..00feec51cc 100644
--- a/packages/views/agents/components/agents-page.tsx
+++ b/packages/views/agents/components/agents-page.tsx
@@ -45,6 +45,7 @@ import { PageHeader } from "../../layout/page-header";
import { availabilityConfig, availabilityOrder } from "../presence";
import { CreateAgentDialog } from "./create-agent-dialog";
import { type AgentRow, createAgentColumns } from "./agent-columns";
+import { useT } from "../../i18n";
// Filter axes:
//
@@ -63,14 +64,15 @@ type AvailabilityFilter = "all" | AgentAvailability;
type SortKey = "recent" | "name" | "runs" | "created";
const SORT_KEYS: SortKey[] = ["recent", "name", "runs", "created"];
-const SORT_LABEL: Record<SortKey, string> = {
- recent: "Recent activity",
- name: "Name",
- runs: "Most runs",
- created: "Recently created",
+const SORT_LABEL_KEY: Record<SortKey, "label_recent" | "label_name" | "label_runs" | "label_created"> = {
+ recent: "label_recent",
+ name: "label_name",
+ runs: "label_runs",
+ created: "label_created",
};
export function AgentsPage() {
+ const { t } = useT("agents");
const wsId = useWorkspaceId();
const paths = useWorkspacePaths();
const navigation = useNavigation();
@@ -351,8 +353,8 @@ export function AgentsPage() {
]);
const columns = useMemo(
- () => createAgentColumns({ onDuplicate: handleDuplicate }),
- [handleDuplicate],
+ () => createAgentColumns({ onDuplicate: handleDuplicate, t }),
+ [handleDuplicate, t],
);
const table = useReactTable({
@@ -394,30 +396,7 @@ export function AgentsPage() {
// ---- List request error ----
if (listError) {
- return (
- <div className="flex flex-1 min-h-0 flex-col">
- <PageHeaderBar totalCount={0} onCreate={() => setShowCreate(true)} />
- <div className="flex flex-1 flex-col items-center justify-center gap-3 px-6 py-16 text-center">
- <AlertCircle className="h-8 w-8 text-destructive" />
- <div>
- <p className="text-sm font-medium">Couldn&rsquo;t load agents</p>
- <p className="mt-1 text-xs text-muted-foreground">
- {listError instanceof Error
- ? listError.message
- : "Something went wrong fetching the agent list."}
- </p>
- </div>
- <Button
- type="button"
- variant="outline"
- size="sm"
- onClick={() => refetchList()}
- >
- Try again
- </Button>
- </div>
- </div>
- );
+ return <ListError onCreate={() => setShowCreate(true)} listError={listError} onRetry={refetchList} />;
}
const showEmpty = totalActiveCount === 0 && archivedCount === 0;
@@ -510,41 +489,74 @@ function PageHeaderBar({
totalCount: number;
onCreate: () => void;
}) {
+ const { t } = useT("agents");
return (
<PageHeader className="justify-between px-5">
<div className="flex items-center gap-2">
<Bot className="h-4 w-4 text-muted-foreground" />
- <h1 className="text-sm font-medium">Agents</h1>
+ <h1 className="text-sm font-medium">{t(($) => $.page.title)}</h1>
{totalCount > 0 && (
<span className="font-mono text-xs tabular-nums text-muted-foreground/70">
{totalCount}
</span>
)}
- {/* Tagline next to the title — mirrors Runtimes / Skills. Single
- sentence + docs link, hidden below md so it never collides with
- the title on narrow screens. The presence chip row below carries
- the state-legend job, so the tagline only needs to anchor what
- an agent IS, not what each colour means. */}
+ {/* Tagline next to the title — mirrors Runtimes / Skills. */}
<p className="ml-2 hidden text-xs text-muted-foreground md:block">
- AI teammates that pick up issues, comment, and update status.{" "}
+ {t(($) => $.page.tagline)}{" "}
<a
href="https://multica.ai/docs/agents"
target="_blank"
rel="noopener noreferrer"
className="underline decoration-muted-foreground/30 underline-offset-4 transition-colors hover:text-foreground"
>
- Learn more →
+ {t(($) => $.page.learn_more)}
</a>
</p>
</div>
<Button type="button" size="sm" onClick={onCreate}>
<Plus className="h-3 w-3" />
- New agent
+ {t(($) => $.page.new_agent)}
</Button>
</PageHeader>
);
}
+function ListError({
+ onCreate,
+ listError,
+ onRetry,
+}: {
+ onCreate: () => void;
+ listError: unknown;
+ onRetry: () => void;
+}) {
+ const { t } = useT("agents");
+ return (
+ <div className="flex flex-1 min-h-0 flex-col">
+ <PageHeaderBar totalCount={0} onCreate={onCreate} />
+ <div className="flex flex-1 flex-col items-center justify-center gap-3 px-6 py-16 text-center">
+ <AlertCircle className="h-8 w-8 text-destructive" />
+ <div>
+ <p className="text-sm font-medium">{t(($) => $.page.list_load_failed)}</p>
+ <p className="mt-1 text-xs text-muted-foreground">
+ {listError instanceof Error
+ ? listError.message
+ : t(($) => $.page.list_load_failed_default)}
+ </p>
+ </div>
+ <Button
+ type="button"
+ variant="outline"
+ size="sm"
+ onClick={onRetry}
+ >
+ {t(($) => $.page.try_again)}
+ </Button>
+ </div>
+ </div>
+ );
+}
+
// ---------------------------------------------------------------------------
// Active view — Layer 1: scope segment + sort + search + archived link + live
// ---------------------------------------------------------------------------
@@ -574,11 +586,7 @@ function ActiveToolbarRow({
archivedCount: number;
onShowArchived: () => void;
}) {
- // Layout: [Search] [Mine|All] ......... [Show archived] [N of M] [Sort ▼]
- // Filter chips were removed (status / workload chips on a small team
- // gain less than they cost), so the toolbar collapses to a single row.
- // Visible/total count and the archived link inherit their old position
- // from the deleted PresenceFilterRows.
+ const { t } = useT("agents");
return (
<div className="flex h-12 shrink-0 items-center gap-3 border-b px-4">
<div className="relative">
@@ -586,7 +594,7 @@ function ActiveToolbarRow({
<Input
value={search}
onChange={(e) => setSearch(e.target.value)}
- placeholder="Search agents…"
+ placeholder={t(($) => $.page.search_placeholder)}
className="h-8 w-64 pl-8 text-sm"
/>
</div>
@@ -598,11 +606,11 @@ function ActiveToolbarRow({
onClick={onShowArchived}
className="text-xs text-muted-foreground transition-colors hover:text-foreground"
>
- Show archived ({archivedCount}) →
+ {t(($) => $.page.show_archived, { count: archivedCount })}
</button>
)}
<span className="font-mono text-xs tabular-nums text-muted-foreground/70">
- {visibleCount} of {totalCount}
+ {t(($) => $.page.of_total, { visible: visibleCount, total: totalCount })}
</span>
<SortDropdown sort={sort} setSort={setSort} />
</div>
@@ -619,19 +627,18 @@ function ScopeSegment({
setScope: (v: Scope) => void;
counts: { all: number; mine: number };
}) {
- // Mine first — that's the more frequent scope (your own agents) and
- // also the default selection, so it lives in the leading slot.
+ const { t } = useT("agents");
return (
<div className="flex items-center gap-0.5 rounded-md bg-muted p-0.5">
<ScopeButton
active={scope === "mine"}
- label="Mine"
+ label={t(($) => $.scope.mine)}
count={counts.mine}
onClick={() => setScope("mine")}
/>
<ScopeButton
active={scope === "all"}
- label="All"
+ label={t(($) => $.scope.all)}
count={counts.all}
onClick={() => setScope("all")}
/>
@@ -679,6 +686,7 @@ function SortDropdown({
sort: SortKey;
setSort: (v: SortKey) => void;
}) {
+ const { t } = useT("agents");
return (
<DropdownMenu>
<DropdownMenuTrigger
@@ -691,7 +699,7 @@ function SortDropdown({
}
>
<ArrowUpDown className="h-3 w-3" />
- {SORT_LABEL[sort]}
+ {t(($) => $.sort[SORT_LABEL_KEY[sort]])}
</DropdownMenuTrigger>
<DropdownMenuContent align="start" className="w-auto">
{SORT_KEYS.map((k) => (
@@ -700,7 +708,7 @@ function SortDropdown({
onClick={() => setSort(k)}
className="text-xs"
>
- {SORT_LABEL[k]}
+ {t(($) => $.sort[SORT_LABEL_KEY[k]])}
</DropdownMenuItem>
))}
</DropdownMenuContent>
@@ -724,12 +732,13 @@ function AvailabilityFilterRow({
counts: Record<AgentAvailability, number>;
totalCount: number;
}) {
+ const { t } = useT("agents");
return (
<div className="flex h-11 shrink-0 items-center gap-2 border-b px-4">
<AvailabilityChip
active={value === "all"}
onClick={() => onChange("all")}
- label="All"
+ label={t(($) => $.availability.all)}
count={totalCount}
/>
{availabilityOrder.map((a) => {
@@ -739,7 +748,7 @@ function AvailabilityFilterRow({
key={a}
active={value === a}
onClick={() => onChange(a)}
- label={cfg.label}
+ label={t(($) => $.availability[a])}
count={counts[a]}
dotClass={cfg.dotClass}
/>
@@ -798,6 +807,7 @@ function ArchivedToolbarRow({
sort: SortKey;
setSort: (v: SortKey) => void;
}) {
+ const { t } = useT("agents");
return (
<div className="flex h-12 shrink-0 items-center gap-3 border-b px-4">
<button
@@ -806,10 +816,10 @@ function ArchivedToolbarRow({
className="inline-flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground"
>
<ArrowLeft className="h-3 w-3" />
- Active agents
+ {t(($) => $.archived.active_link)}
</button>
<span className="text-muted-foreground/40">/</span>
- <span className="text-xs font-medium">Archived agents</span>
+ <span className="text-xs font-medium">{t(($) => $.archived.title)}</span>
<span className="font-mono text-xs tabular-nums text-muted-foreground/70">
{archivedCount}
</span>
@@ -825,19 +835,19 @@ function ArchivedToolbarRow({
// ---------------------------------------------------------------------------
function EmptyState({ onCreate }: { onCreate: () => void }) {
+ const { t } = useT("agents");
return (
<div className="flex flex-1 flex-col items-center justify-center px-6 py-16 text-center">
<div className="flex h-12 w-12 items-center justify-center rounded-full bg-muted">
<Bot className="h-6 w-6 text-muted-foreground" />
</div>
- <h2 className="mt-4 text-base font-semibold">No agents yet</h2>
+ <h2 className="mt-4 text-base font-semibold">{t(($) => $.empty.title)}</h2>
<p className="mt-1 max-w-md text-sm text-muted-foreground">
- Create an agent and assign it issues, like any teammate. Local agents
- run on your machine; cloud agents run on Multica&rsquo;s runtime.
+ {t(($) => $.empty.description)}
</p>
<Button type="button" onClick={onCreate} size="sm" className="mt-5">
<Plus className="h-3 w-3" />
- New agent
+ {t(($) => $.page.new_agent)}
</Button>
</div>
);
@@ -852,27 +862,27 @@ function NoMatches({
search: string;
scope: Scope;
}) {
+ const { t } = useT("agents");
const hasSearch = search.length > 0;
- // "mine" is the only remaining narrowing dimension after chip filters
- // were dropped — keep the wording aware of it so an empty Mine view
- // doesn't suggest the workspace itself is empty.
const hasFilter = scope === "mine";
let body: string;
if (view === "archived") {
body = hasSearch
- ? `No archived agents match "${search}".`
- : "No archived agents yet.";
+ ? t(($) => $.no_matches.search_archived, { query: search })
+ : t(($) => $.no_matches.no_archived);
} else if (hasSearch) {
- body = `No agents match "${search}"${hasFilter ? " in this filter" : ""}.`;
+ body = hasFilter
+ ? t(($) => $.no_matches.search_active_filtered, { query: search })
+ : t(($) => $.no_matches.search_active, { query: search });
} else {
- body = "No agents match this filter.";
+ body = t(($) => $.no_matches.no_filter_match);
}
return (
<div className="flex flex-1 flex-col items-center justify-center gap-2 px-4 py-16 text-center text-muted-foreground">
<Search className="h-8 w-8 text-muted-foreground/40" />
- <p className="text-sm">No matches</p>
+ <p className="text-sm">{t(($) => $.no_matches.title)}</p>
<p className="max-w-xs text-xs">{body}</p>
</div>
);
diff --git a/packages/views/agents/components/char-counter.tsx b/packages/views/agents/components/char-counter.tsx
index 64eace0c1c..cebdebf659 100644
--- a/packages/views/agents/components/char-counter.tsx
+++ b/packages/views/agents/components/char-counter.tsx
@@ -1,8 +1,13 @@
+"use client";
+
+import { useT } from "../../i18n";
+
// Soft warn at 90 % of the cap, hard error past it. Shared between the
// description editor (modal) and the create-agent dialog so both surfaces
// read the same way. Renders a single inline line so it can sit under any
// textarea / input without disturbing surrounding spacing.
export function CharCounter({ length, max }: { length: number; max: number }) {
+ const { t } = useT("agents");
const over = length > max;
const near = !over && length >= Math.floor(max * 0.9);
const tone = over
@@ -13,7 +18,7 @@ export function CharCounter({ length, max }: { length: number; max: number }) {
return (
<div className={`text-right text-xs tabular-nums ${tone}`}>
{length} / {max}
- {over && ` · ${length - max} over limit`}
+ {over && t(($) => $.char_counter.over_limit, { count: length - max })}
</div>
);
}
diff --git a/packages/views/agents/components/create-agent-dialog.tsx b/packages/views/agents/components/create-agent-dialog.tsx
index 4f1de8c7c0..86c26a20f8 100644
--- a/packages/views/agents/components/create-agent-dialog.tsx
+++ b/packages/views/agents/components/create-agent-dialog.tsx
@@ -35,6 +35,7 @@ import {
VISIBILITY_LABEL,
} from "@multica/core/agents";
import { CharCounter } from "./char-counter";
+import { useT } from "../../i18n";
type RuntimeFilter = "mine" | "all";
@@ -62,9 +63,10 @@ export function CreateAgentDialog({
onClose: () => void;
onCreate: (data: CreateAgentRequest) => Promise<void>;
}) {
+ const { t } = useT("agents");
const isDuplicate = !!template;
const [name, setName] = useState(
- template ? `${template.name} (Copy)` : "",
+ template ? `${template.name}${t(($) => $.create_dialog.duplicate_copy_suffix)}` : "",
);
const [description, setDescription] = useState(template?.description ?? "");
const [visibility, setVisibility] = useState<AgentVisibility>(
@@ -141,7 +143,7 @@ export function CreateAgentDialog({
await onCreate(data);
onClose();
} catch (err) {
- toast.error(err instanceof Error ? err.message : "Failed to create agent");
+ toast.error(err instanceof Error ? err.message : t(($) => $.create_dialog.create_failed_toast));
setCreating(false);
}
};
@@ -151,36 +153,36 @@ export function CreateAgentDialog({
<DialogContent className="sm:max-w-md">
<DialogHeader>
<DialogTitle>
- {isDuplicate ? "Duplicate Agent" : "Create Agent"}
+ {isDuplicate ? t(($) => $.create_dialog.title_duplicate) : t(($) => $.create_dialog.title_create)}
</DialogTitle>
<DialogDescription>
{isDuplicate
- ? `Create a new agent based on "${template!.name}". Instructions, env, and skills are copied for you.`
- : "Create a new AI agent for your workspace."}
+ ? t(($) => $.create_dialog.description_duplicate, { name: template!.name })
+ : t(($) => $.create_dialog.description_create)}
</DialogDescription>
</DialogHeader>
<div className="space-y-4 min-w-0">
<div>
- <Label className="text-xs text-muted-foreground">Name</Label>
+ <Label className="text-xs text-muted-foreground">{t(($) => $.create_dialog.name_label)}</Label>
<Input
autoFocus
type="text"
value={name}
onChange={(e) => setName(e.target.value)}
- placeholder="e.g. Deep Research Agent"
+ placeholder={t(($) => $.create_dialog.name_placeholder)}
className="mt-1"
onKeyDown={(e) => e.key === "Enter" && handleSubmit()}
/>
</div>
<div>
- <Label className="text-xs text-muted-foreground">Description</Label>
+ <Label className="text-xs text-muted-foreground">{t(($) => $.create_dialog.description_label)}</Label>
<Input
type="text"
value={description}
onChange={(e) => setDescription(e.target.value)}
- placeholder="What does this agent do?"
+ placeholder={t(($) => $.create_dialog.description_placeholder)}
maxLength={AGENT_DESCRIPTION_MAX_LENGTH}
className="mt-1"
/>
@@ -193,7 +195,7 @@ export function CreateAgentDialog({
</div>
<div>
- <Label className="text-xs text-muted-foreground">Visibility</Label>
+ <Label className="text-xs text-muted-foreground">{t(($) => $.create_dialog.visibility_label)}</Label>
<div className="mt-1.5 flex gap-2">
<button
type="button"
@@ -234,7 +236,7 @@ export function CreateAgentDialog({
<div className="min-w-0">
<div className="flex items-center justify-between">
- <Label className="text-xs text-muted-foreground">Runtime</Label>
+ <Label className="text-xs text-muted-foreground">{t(($) => $.create_dialog.runtime_label)}</Label>
{hasOtherRuntimes && (
<div className="flex items-center gap-0.5 rounded-md bg-muted p-0.5">
<button
@@ -246,7 +248,7 @@ export function CreateAgentDialog({
: "text-muted-foreground hover:text-foreground"
}`}
>
- Mine
+ {t(($) => $.create_dialog.runtime_filter_mine)}
</button>
<button
type="button"
@@ -257,7 +259,7 @@ export function CreateAgentDialog({
: "text-muted-foreground hover:text-foreground"
}`}
>
- All
+ {t(($) => $.create_dialog.runtime_filter_all)}
</button>
</div>
)}
@@ -277,18 +279,18 @@ export function CreateAgentDialog({
<div className="min-w-0 flex-1">
<div className="flex items-center gap-2">
<span className="truncate font-medium">
- {runtimesLoading ? "Loading runtimes..." : (selectedRuntime?.name ?? "No runtime available")}
+ {runtimesLoading ? t(($) => $.create_dialog.runtime_loading) : (selectedRuntime?.name ?? t(($) => $.create_dialog.runtime_none))}
</span>
{selectedRuntime?.runtime_mode === "cloud" && (
<span className="shrink-0 rounded bg-info/10 px-1.5 py-0.5 text-xs font-medium text-info">
- Cloud
+ {t(($) => $.create_dialog.runtime_cloud_badge)}
</span>
)}
</div>
<div className="truncate text-xs text-muted-foreground">
{selectedRuntime
? (getOwnerMember(selectedRuntime.owner_id)?.name ?? selectedRuntime.device_info)
- : "Register a runtime before creating an agent"}
+ : t(($) => $.create_dialog.runtime_register_first)}
</div>
</div>
<ChevronDown className={`h-4 w-4 shrink-0 text-muted-foreground transition-transform ${runtimeOpen ? "rotate-180" : ""}`} />
@@ -313,7 +315,7 @@ export function CreateAgentDialog({
<span className="truncate font-medium">{device.name}</span>
{device.runtime_mode === "cloud" && (
<span className="shrink-0 rounded bg-info/10 px-1.5 py-0.5 text-xs font-medium text-info">
- Cloud
+ {t(($) => $.create_dialog.runtime_cloud_badge)}
</span>
)}
</div>
@@ -351,13 +353,13 @@ export function CreateAgentDialog({
<DialogFooter>
<Button variant="ghost" onClick={onClose}>
- Cancel
+ {t(($) => $.create_dialog.cancel)}
</Button>
<Button
onClick={handleSubmit}
disabled={creating || !name.trim() || !selectedRuntime}
>
- {creating ? "Creating..." : "Create"}
+ {creating ? t(($) => $.create_dialog.creating) : t(($) => $.create_dialog.create)}
</Button>
</DialogFooter>
</DialogContent>
diff --git a/packages/views/agents/components/inspector/concurrency-picker.tsx b/packages/views/agents/components/inspector/concurrency-picker.tsx
index 96550ad047..419ba2b030 100644
--- a/packages/views/agents/components/inspector/concurrency-picker.tsx
+++ b/packages/views/agents/components/inspector/concurrency-picker.tsx
@@ -5,6 +5,7 @@ import { Button } from "@multica/ui/components/ui/button";
import { Input } from "@multica/ui/components/ui/input";
import { PropertyPicker } from "../../../issues/components/pickers";
import { CHIP_CLASS } from "./chip";
+import { useT } from "../../../i18n";
const MIN = 1;
const MAX = 50;
@@ -19,9 +20,19 @@ export function ConcurrencyPicker({
canEdit?: boolean;
onChange: (next: number) => Promise<void> | void;
}) {
+ const { t } = useT("agents");
const [open, setOpen] = useState(false);
const [draft, setDraft] = useState(String(value));
+ // Reset draft from authoritative value whenever the popover (re-)opens or
+ // the prop changes from elsewhere — protects against stale draft state if
+ // the user closes mid-edit and reopens later. Hook MUST run unconditionally
+ // (before the !canEdit early return) to keep call order stable across
+ // renders where canEdit may flip.
+ useEffect(() => {
+ if (open) setDraft(String(value));
+ }, [open, value]);
+
if (!canEdit) {
return (
<span className="font-mono text-xs tabular-nums text-muted-foreground">
@@ -30,13 +41,6 @@ export function ConcurrencyPicker({
);
}
- // Reset draft from authoritative value whenever the popover (re-)opens or
- // the prop changes from elsewhere — protects against stale draft state if
- // the user closes mid-edit and reopens later.
- useEffect(() => {
- if (open) setDraft(String(value));
- }, [open, value]);
-
const commit = async () => {
const n = Number(draft);
if (!Number.isFinite(n) || n < MIN || n > MAX) return;
@@ -44,7 +48,7 @@ export function ConcurrencyPicker({
if (n !== value) await onChange(n);
};
- const tooltip = `Concurrency · ${value} max concurrent tasks`;
+ const tooltip = t(($) => $.pickers.concurrency_tooltip, { value });
return (
<PropertyPicker
@@ -62,7 +66,7 @@ export function ConcurrencyPicker({
>
<div className="space-y-2 p-2">
<p className="text-xs text-muted-foreground">
- Max concurrent tasks ({MIN}–{MAX})
+ {t(($) => $.pickers.concurrency_range, { min: MIN, max: MAX })}
</p>
<div className="flex items-center gap-2">
<Input
@@ -81,7 +85,7 @@ export function ConcurrencyPicker({
className="h-8 w-20 font-mono text-xs"
/>
<Button size="sm" onClick={() => void commit()}>
- Save
+ {t(($) => $.inspector.save)}
</Button>
</div>
</div>
diff --git a/packages/views/agents/components/inspector/model-picker.tsx b/packages/views/agents/components/inspector/model-picker.tsx
index 013bf65456..56d0d07eb5 100644
--- a/packages/views/agents/components/inspector/model-picker.tsx
+++ b/packages/views/agents/components/inspector/model-picker.tsx
@@ -10,6 +10,7 @@ import {
PropertyPicker,
} from "../../../issues/components/pickers";
import { CHIP_CLASS } from "./chip";
+import { useT } from "../../../i18n";
/**
* Inline model picker for the agent inspector. Lighter cousin of
@@ -36,6 +37,7 @@ export function ModelPicker({
canEdit?: boolean;
onChange: (next: string) => Promise<void> | void;
}) {
+ const { t } = useT("agents");
const [open, setOpen] = useState(false);
const [search, setSearch] = useState("");
@@ -66,6 +68,9 @@ export function ModelPicker({
);
const canCreate = trimmedSearch.length > 0 && !exactMatch;
+ const triggerLabel = value || t(($) => $.pickers.model_default);
+ const triggerTitle = t(($) => $.pickers.model_tooltip, { value: triggerLabel });
+
const select = async (id: string) => {
setOpen(false);
setSearch("");
@@ -75,14 +80,11 @@ export function ModelPicker({
if (!supported && !modelsQuery.isLoading) {
return (
<span className="truncate italic text-muted-foreground">
- Managed by runtime
+ {t(($) => $.pickers.model_managed_by_runtime)}
</span>
);
}
- const triggerLabel = value || "Default";
- const triggerTitle = `Model · ${triggerLabel}`;
-
if (!canEdit) {
return (
<span
@@ -117,7 +119,7 @@ export function ModelPicker({
<div className="p-1.5">
<Input
autoFocus
- placeholder="Search or type a model ID"
+ placeholder={t(($) => $.pickers.model_search_placeholder)}
value={search}
onChange={(e) => setSearch(e.target.value)}
className="h-7 text-xs"
@@ -128,7 +130,7 @@ export function ModelPicker({
{modelsQuery.isLoading && (
<div className="flex items-center gap-2 p-3 text-xs text-muted-foreground">
<Loader2 className="h-3 w-3 animate-spin" />
- Discovering models…
+ {t(($) => $.pickers.model_discovering)}
</div>
)}
@@ -148,7 +150,7 @@ export function ModelPicker({
<span className="truncate font-medium">{m.label}</span>
{m.default && (
<span className="shrink-0 rounded bg-primary/10 px-1 text-[10px] font-medium text-primary">
- default
+ {t(($) => $.pickers.model_default_badge)}
</span>
)}
</div>
@@ -163,7 +165,7 @@ export function ModelPicker({
{!modelsQuery.isLoading && filtered.length === 0 && !canCreate && (
<p className="px-3 py-3 text-center text-xs text-muted-foreground">
- No models available
+ {t(($) => $.pickers.model_empty)}
</p>
)}
@@ -171,11 +173,11 @@ export function ModelPicker({
<PickerItem
selected={false}
onClick={() => void select(trimmedSearch)}
- tooltip={`Use “${trimmedSearch}” as a custom model id`}
+ tooltip={t(($) => $.pickers.model_custom_tooltip, { value: trimmedSearch })}
>
<Plus className="h-3.5 w-3.5 shrink-0 text-primary" />
<span className="truncate text-primary">
- Use &ldquo;{trimmedSearch}&rdquo;
+ {t(($) => $.pickers.model_custom_use, { value: trimmedSearch })}
</span>
</PickerItem>
)}
@@ -185,9 +187,9 @@ export function ModelPicker({
type="button"
onClick={() => void select("")}
className="mt-1 flex w-full items-center border-t px-3 py-2 text-left text-xs text-muted-foreground transition-colors hover:bg-accent/50"
- title="Clear and fall back to the runtime's provider default"
+ title={t(($) => $.pickers.model_clear_title)}
>
- Clear (use provider default)
+ {t(($) => $.pickers.model_clear)}
</button>
)}
</PropertyPicker>
diff --git a/packages/views/agents/components/inspector/runtime-picker.tsx b/packages/views/agents/components/inspector/runtime-picker.tsx
index fbf2fec121..5664ccfb6e 100644
--- a/packages/views/agents/components/inspector/runtime-picker.tsx
+++ b/packages/views/agents/components/inspector/runtime-picker.tsx
@@ -10,6 +10,7 @@ import {
} from "../../../issues/components/pickers";
import { ProviderLogo } from "../../../runtimes/components/provider-logo";
import { CHIP_CLASS } from "./chip";
+import { useT } from "../../../i18n";
type Filter = "mine" | "all";
@@ -35,19 +36,36 @@ export function RuntimePicker({
canEdit?: boolean;
onChange: (runtimeId: string) => Promise<void> | void;
}) {
+ const { t } = useT("agents");
const [open, setOpen] = useState(false);
const [filter, setFilter] = useState<Filter>("mine");
const selected = runtimes.find((r) => r.id === value) ?? null;
const Icon = selected?.runtime_mode === "cloud" ? Cloud : Monitor;
+ // Compute filtered list unconditionally — the early `!canEdit` return
+ // below would otherwise re-order this hook across renders.
+ const filtered = useMemo(() => {
+ const list =
+ filter === "mine" && currentUserId
+ ? runtimes.filter((r) => r.owner_id === currentUserId)
+ : runtimes;
+ return [...list].sort((a, b) => {
+ if (a.owner_id === currentUserId && b.owner_id !== currentUserId)
+ return -1;
+ if (a.owner_id !== currentUserId && b.owner_id === currentUserId)
+ return 1;
+ return 0;
+ });
+ }, [runtimes, filter, currentUserId]);
+
if (!canEdit) {
const isOnline = selected?.status === "online";
return (
<span className="inline-flex min-w-0 items-center gap-1.5 px-1.5 py-0.5 text-xs text-muted-foreground">
<Icon className="h-3 w-3 shrink-0" />
<span className="min-w-0 truncate font-mono">
- {selected?.name ?? "No runtime"}
+ {selected?.name ?? t(($) => $.pickers.runtime_none)}
</span>
{selected && (
<span
@@ -64,30 +82,17 @@ export function RuntimePicker({
// deliberately do NOT append `device_info` to the tooltip — that string
// also leads with the host and would just repeat what's already in name,
// producing the "Claude (host) (host · 2.1.121 (Claude Code))" mess.
- // device_info still shows on each row in the popover (small mono line),
- // which is the right place for system detail.
- const triggerLabel = selected?.name ?? "No runtime";
+ const triggerLabel = selected?.name ?? t(($) => $.pickers.runtime_none);
const isOnline = selected?.status === "online";
const triggerTitle = selected
- ? `Runtime · ${selected.name} · ${isOnline ? "online" : "offline"}`
- : "Runtime · none selected";
+ ? t(($) => $.pickers.runtime_tooltip, {
+ name: selected.name,
+ status: isOnline ? t(($) => $.pickers.runtime_online) : t(($) => $.pickers.runtime_offline),
+ })
+ : t(($) => $.pickers.runtime_tooltip_none);
const hasOtherRuntimes = runtimes.some((r) => r.owner_id !== currentUserId);
- const filtered = useMemo(() => {
- const list =
- filter === "mine" && currentUserId
- ? runtimes.filter((r) => r.owner_id === currentUserId)
- : runtimes;
- return [...list].sort((a, b) => {
- if (a.owner_id === currentUserId && b.owner_id !== currentUserId)
- return -1;
- if (a.owner_id !== currentUserId && b.owner_id === currentUserId)
- return 1;
- return 0;
- });
- }, [runtimes, filter, currentUserId]);
-
const getOwner = (id: string | null) =>
id ? members.find((m) => m.user_id === id) ?? null : null;
@@ -131,13 +136,13 @@ export function RuntimePicker({
active={filter === "mine"}
onClick={() => setFilter("mine")}
>
- Mine
+ {t(($) => $.scope.mine)}
</FilterButton>
<FilterButton
active={filter === "all"}
onClick={() => setFilter("all")}
>
- All
+ {t(($) => $.scope.all)}
</FilterButton>
</div>
</div>
@@ -146,20 +151,16 @@ export function RuntimePicker({
>
{filtered.length === 0 ? (
<p className="px-2 py-3 text-center text-xs text-muted-foreground">
- No runtimes
+ {t(($) => $.pickers.runtime_empty)}
</p>
) : (
filtered.map((rt) => {
const owner = getOwner(rt.owner_id);
const rtOnline = rt.status === "online";
- // Tooltip echoes the chip's structure: name + owner + status. Skip
- // device_info because rt.name already embeds the host (it'd just
- // repeat), and the row visually shows device_info on its second
- // line anyway for users who do need that detail.
const tooltip = [
rt.name,
- owner ? `owned by ${owner.name}` : null,
- rtOnline ? "online" : "offline",
+ owner ? t(($) => $.pickers.runtime_owned_by, { name: owner.name }) : null,
+ rtOnline ? t(($) => $.pickers.runtime_online) : t(($) => $.pickers.runtime_offline),
]
.filter(Boolean)
.join(" · ");
@@ -181,7 +182,7 @@ export function RuntimePicker({
</span>
{rt.runtime_mode === "cloud" && (
<span className="shrink-0 rounded bg-info/10 px-1 text-[10px] font-medium text-info">
- Cloud
+ {t(($) => $.create_dialog.runtime_cloud_badge)}
</span>
)}
</div>
@@ -210,7 +211,7 @@ export function RuntimePicker({
className={`h-1.5 w-1.5 shrink-0 rounded-full ${
rtOnline ? "bg-success" : "bg-muted-foreground/40"
}`}
- aria-label={rtOnline ? "online" : "offline"}
+ aria-label={rtOnline ? t(($) => $.pickers.runtime_online) : t(($) => $.pickers.runtime_offline)}
/>
</PickerItem>
);
diff --git a/packages/views/agents/components/inspector/skill-attach.tsx b/packages/views/agents/components/inspector/skill-attach.tsx
index 7391815003..8a9783e54e 100644
--- a/packages/views/agents/components/inspector/skill-attach.tsx
+++ b/packages/views/agents/components/inspector/skill-attach.tsx
@@ -7,6 +7,7 @@ import type { Agent } from "@multica/core/types";
import { useWorkspaceId } from "@multica/core/hooks";
import { skillListOptions } from "@multica/core/workspace/queries";
import { SkillAddDialog } from "../skill-add-dialog";
+import { useT } from "../../../i18n";
/**
* Inline "+ Attach" trigger for the inspector's Skills row. The trigger is
@@ -25,6 +26,7 @@ export function SkillAttach({
/** When false, hide the attach trigger entirely. */
canEdit?: boolean;
}) {
+ const { t } = useT("agents");
const wsId = useWorkspaceId();
const { data: workspaceSkills = [] } = useQuery(skillListOptions(wsId));
const [open, setOpen] = useState(false);
@@ -41,12 +43,12 @@ export function SkillAttach({
<button
type="button"
onClick={() => setOpen(true)}
- aria-label="Attach a workspace skill"
- title="Attach a workspace skill"
+ aria-label={t(($) => $.skill_attach.trigger_aria)}
+ title={t(($) => $.skill_attach.trigger_aria)}
className="inline-flex cursor-pointer items-center gap-0.5 rounded-md border border-dashed border-muted-foreground/30 px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground/70 transition-colors hover:border-muted-foreground/60 hover:bg-accent/50 hover:text-muted-foreground"
>
<Plus className="h-2.5 w-2.5" />
- Attach
+ {t(($) => $.skill_attach.trigger_label)}
</button>
<SkillAddDialog agent={agent} open={open} onOpenChange={setOpen} />
</>
diff --git a/packages/views/agents/components/model-dropdown.tsx b/packages/views/agents/components/model-dropdown.tsx
index 5a3592538d..a657acc7d9 100644
--- a/packages/views/agents/components/model-dropdown.tsx
+++ b/packages/views/agents/components/model-dropdown.tsx
@@ -12,6 +12,7 @@ import {
} from "@multica/ui/components/ui/popover";
import { Input } from "@multica/ui/components/ui/input";
import { Label } from "@multica/ui/components/ui/label";
+import { useT } from "../../i18n";
// ModelDropdown renders a searchable, creatable model picker for an agent.
// It fetches the supported-model catalog from the selected runtime — the
@@ -33,6 +34,7 @@ export function ModelDropdown({
onChange: (value: string) => void;
disabled?: boolean;
}) {
+ const { t } = useT("agents");
const [open, setOpen] = useState(false);
const [search, setSearch] = useState("");
@@ -41,7 +43,12 @@ export function ModelDropdown({
);
const supported = modelsQuery.data?.supported ?? true;
- const models = modelsQuery.data?.models ?? [];
+ // Stable reference for the model list — `?? []` would mint a fresh
+ // array each render and force every downstream useMemo to invalidate.
+ const models = useMemo(
+ () => modelsQuery.data?.models ?? [],
+ [modelsQuery.data],
+ );
const grouped = useMemo(() => groupByProvider(models), [models]);
// When the selected runtime reports it doesn't support per-agent
@@ -83,25 +90,21 @@ export function ModelDropdown({
const triggerLabel =
value ||
(disabled
- ? "Select a runtime first"
+ ? t(($) => $.model_dropdown.select_runtime_first)
: runtimeOnline
- ? "Default (provider)"
- : "Runtime offline — enter manually");
+ ? t(($) => $.model_dropdown.default_provider)
+ : t(($) => $.model_dropdown.runtime_offline_manual));
if (!supported && !modelsQuery.isLoading) {
- // Provider doesn't honour per-agent model selection — show a
- // clearly-disabled state so the user knows why the control is
- // inert. (Hermes reads its model from ~/.hermes/.env.)
return (
<div className="min-w-0">
- <Label className="text-xs text-muted-foreground">Model</Label>
+ <Label className="text-xs text-muted-foreground">{t(($) => $.model_dropdown.label)}</Label>
<div className="mt-1.5 flex items-start gap-2 rounded-lg border border-dashed border-border bg-muted/30 px-3 py-2.5 text-sm text-muted-foreground">
<Info className="mt-0.5 h-4 w-4 shrink-0" />
<div className="min-w-0">
- <div>Model selection is managed by this runtime.</div>
+ <div>{t(($) => $.model_dropdown.managed_by_runtime_title)}</div>
<div className="mt-0.5 text-xs">
- Configure the model on the runtime host (e.g. Hermes reads it
- from its own config file).
+ {t(($) => $.model_dropdown.managed_by_runtime_hint)}
</div>
</div>
</div>
@@ -112,9 +115,9 @@ export function ModelDropdown({
return (
<div className="min-w-0">
<div className="flex items-center justify-between">
- <Label className="text-xs text-muted-foreground">Model</Label>
+ <Label className="text-xs text-muted-foreground">{t(($) => $.model_dropdown.label)}</Label>
{modelsQuery.isError && (
- <span className="text-xs text-muted-foreground">discovery failed</span>
+ <span className="text-xs text-muted-foreground">{t(($) => $.model_dropdown.discovery_failed)}</span>
)}
</div>
<Popover open={open} onOpenChange={setOpen}>
@@ -144,7 +147,7 @@ export function ModelDropdown({
<div className="border-b border-border p-2">
<Input
autoFocus
- placeholder="Search or type a model ID"
+ placeholder={t(($) => $.pickers.model_search_placeholder)}
value={search}
onChange={(e) => setSearch(e.target.value)}
className="h-8"
@@ -154,7 +157,7 @@ export function ModelDropdown({
{modelsQuery.isLoading && (
<div className="flex items-center gap-2 px-3 py-6 text-sm text-muted-foreground">
<Loader2 className="h-4 w-4 animate-spin" />
- Discovering models…
+ {t(($) => $.pickers.model_discovering)}
</div>
)}
@@ -179,7 +182,7 @@ export function ModelDropdown({
<span className="truncate font-medium">{m.label}</span>
{m.default && (
<span className="shrink-0 rounded bg-primary/10 px-1.5 py-0.5 text-xs font-medium text-primary">
- default
+ {t(($) => $.pickers.model_default_badge)}
</span>
)}
</div>
@@ -201,7 +204,7 @@ export function ModelDropdown({
Object.keys(filtered).length === 0 &&
!canCreate && (
<div className="px-3 py-6 text-center text-sm text-muted-foreground">
- No models available.
+ {t(($) => $.pickers.model_empty_with_dot)}
</div>
)}
@@ -212,7 +215,7 @@ export function ModelDropdown({
>
<Plus className="h-4 w-4 shrink-0" />
<span className="truncate">
- Use “{trimmedSearch}”
+ {t(($) => $.pickers.model_custom_use, { value: trimmedSearch })}
</span>
</button>
)}
@@ -222,7 +225,7 @@ export function ModelDropdown({
onClick={() => select("")}
className="mt-1 flex w-full items-center gap-2 border-t border-border px-3 py-2 text-left text-xs text-muted-foreground transition-colors hover:bg-accent/50"
>
- Clear selection (use provider default)
+ {t(($) => $.model_dropdown.clear_full)}
</button>
)}
</div>
diff --git a/packages/views/agents/components/skill-add-dialog.tsx b/packages/views/agents/components/skill-add-dialog.tsx
index 455d78163d..6a14495a6a 100644
--- a/packages/views/agents/components/skill-add-dialog.tsx
+++ b/packages/views/agents/components/skill-add-dialog.tsx
@@ -20,6 +20,7 @@ import {
DialogHeader,
DialogTitle,
} from "@multica/ui/components/ui/dialog";
+import { useT } from "../../i18n";
/**
* Single source of truth for "attach a workspace skill to this agent".
@@ -40,6 +41,7 @@ export function SkillAddDialog({
open: boolean;
onOpenChange: (v: boolean) => void;
}) {
+ const { t } = useT("agents");
const wsId = useWorkspaceId();
const qc = useQueryClient();
const { data: workspaceSkills = [] } = useQuery(skillListOptions(wsId));
@@ -58,7 +60,7 @@ export function SkillAddDialog({
qc.invalidateQueries({ queryKey: workspaceKeys.agents(wsId) });
onOpenChange(false);
} catch (e) {
- toast.error(e instanceof Error ? e.message : "Failed to add skill");
+ toast.error(e instanceof Error ? e.message : t(($) => $.tab_body.skills.add_failed_toast));
} finally {
setSaving(false);
}
@@ -68,9 +70,9 @@ export function SkillAddDialog({
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="max-w-md">
<DialogHeader>
- <DialogTitle className="text-sm">Add skill</DialogTitle>
+ <DialogTitle className="text-sm">{t(($) => $.tab_body.skills.add_dialog_title)}</DialogTitle>
<DialogDescription className="text-xs">
- Select a workspace skill to assign to this agent.
+ {t(($) => $.tab_body.skills.add_dialog_description)}
</DialogDescription>
</DialogHeader>
<div className="max-h-64 space-y-1 overflow-y-auto">
@@ -94,13 +96,13 @@ export function SkillAddDialog({
))}
{availableSkills.length === 0 && (
<p className="py-6 text-center text-xs text-muted-foreground">
- All workspace skills are already assigned.
+ {t(($) => $.tab_body.skills.add_dialog_empty)}
</p>
)}
</div>
<DialogFooter>
<Button variant="ghost" onClick={() => onOpenChange(false)}>
- Cancel
+ {t(($) => $.tab_body.skills.add_dialog_cancel)}
</Button>
</DialogFooter>
</DialogContent>
diff --git a/packages/views/agents/components/tabs/activity-tab.tsx b/packages/views/agents/components/tabs/activity-tab.tsx
index b9ee64e1a0..5d146691c5 100644
--- a/packages/views/agents/components/tabs/activity-tab.tsx
+++ b/packages/views/agents/components/tabs/activity-tab.tsx
@@ -40,6 +40,7 @@ import { TranscriptButton } from "../../../common/task-transcript";
import { taskStatusConfig } from "../../config";
import { failureReasonLabel } from "./task-failure";
import { Sparkline } from "../sparkline";
+import { useT } from "../../../i18n";
const THIRTY_DAYS_MS = 30 * 24 * 60 * 60 * 1000;
// Recent work pagination: small initial cohort to keep the section
@@ -177,17 +178,18 @@ function NowSection({
issueMap: Map<string, Issue>;
agent: Agent;
}) {
+ const { t } = useT("agents");
return (
<Section
- title="Now"
+ title={t(($) => $.tab_body.activity.section_now)}
subtitle={
tasks.length === 0
- ? "No active work"
- : `${tasks.length} active task${tasks.length === 1 ? "" : "s"}`
+ ? t(($) => $.tab_body.activity.subtitle_no_active)
+ : t(($) => $.tab_body.activity.subtitle_active, { count: tasks.length })
}
>
{tasks.length === 0 ? (
- <EmptyText>This agent isn&apos;t running anything right now.</EmptyText>
+ <EmptyText>{t(($) => $.tab_body.activity.empty_now)}</EmptyText>
) : (
<TaskList
tasks={tasks}
@@ -207,6 +209,7 @@ function Last30dSection({
activity: AgentActivity | undefined;
avgDurationMs: number;
}) {
+ const { t } = useT("agents");
const summary = summarizeActivityWindow(activity, 30);
const { totalRuns, totalFailed } = summary;
const successPct =
@@ -215,17 +218,10 @@ function Last30dSection({
: 100;
return (
- <Section title="Last 30 days" subtitle="Performance">
+ <Section title={t(($) => $.tab_body.activity.section_last_30d)} subtitle={t(($) => $.tab_body.activity.subtitle_performance)}>
{totalRuns === 0 ? (
- <EmptyText>No completions in the last 30 days.</EmptyText>
+ <EmptyText>{t(($) => $.tab_body.activity.empty_30d)}</EmptyText>
) : (
- // Layout: number is the hero, sparkline is a garnish on the
- // right. Reversed from "chart hero + tiny number" because at
- // detail-page sample sizes (often <30 over the window) a wide
- // sparkline reads as mostly-empty space, which looks broken;
- // the headline number stays legible at any sample size and
- // anchors the section. Stripe / Vercel / Shopify metric cards
- // all follow this pattern for the same reason.
<div className="flex items-end justify-between gap-5">
<div className="flex min-w-0 flex-col gap-1">
<div className="flex items-baseline gap-1.5">
@@ -233,22 +229,22 @@ function Last30dSection({
{totalRuns}
</span>
<span className="text-sm text-muted-foreground">
- run{totalRuns === 1 ? "" : "s"}
+ {t(($) => $.tab_body.activity.runs, { count: totalRuns })}
</span>
</div>
<div className="text-xs text-muted-foreground">
- {successPct}% success
+ {t(($) => $.tab_body.activity.success_pct, { percent: successPct })}
{avgDurationMs > 0 && (
<>
<Sep />
- <span>avg {formatDurationMs(avgDurationMs)}</span>
+ <span>{t(($) => $.tab_body.activity.avg_duration, { value: formatDurationMs(avgDurationMs) })}</span>
</>
)}
{totalFailed > 0 && (
<>
<Sep />
<span className="text-destructive">
- {totalFailed} failed
+ {t(($) => $.tab_body.activity.failed_count, { count: totalFailed })}
</span>
</>
)}
@@ -285,21 +281,17 @@ function RecentWorkSection({
issueMap: Map<string, Issue>;
agent: Agent;
}) {
- // Subtitle phrasing: "5 of 47" once we know the total is bigger than
- // what we're rendering, otherwise "5 latest". Total comes from
- // recentTasksAll (already filtered for chat / terminals) so it
- // accurately reflects what would appear if the user kept clicking
- // "Show more" — not the raw on-the-wire row count.
+ const { t } = useT("agents");
const subtitle =
tasks.length === 0
- ? "Nothing finished yet"
+ ? t(($) => $.tab_body.activity.subtitle_no_recent)
: totalCount > tasks.length
- ? `${tasks.length} of ${totalCount}`
- : `${tasks.length} latest`;
+ ? t(($) => $.tab_body.activity.subtitle_recent_progress, { shown: tasks.length, total: totalCount })
+ : t(($) => $.tab_body.activity.subtitle_recent_latest, { count: tasks.length });
return (
- <Section title="Recent work" subtitle={subtitle}>
+ <Section title={t(($) => $.tab_body.activity.section_recent)} subtitle={subtitle}>
{tasks.length === 0 ? (
- <EmptyText>This agent hasn&apos;t completed anything yet.</EmptyText>
+ <EmptyText>{t(($) => $.tab_body.activity.empty_recent)}</EmptyText>
) : (
<>
<TaskList
@@ -314,7 +306,7 @@ function RecentWorkSection({
onClick={onShowMore}
className="mt-2 self-start rounded text-xs text-muted-foreground transition-colors hover:text-foreground"
>
- Show more →
+ {t(($) => $.tab_body.activity.show_more)}
</button>
)}
</>
@@ -360,6 +352,7 @@ function TaskRow({
timeMode: "active" | "completed";
agent: Agent;
}) {
+ const { t } = useT("agents");
const paths = useWorkspacePaths();
const [cancelling, setCancelling] = useState(false);
const cfg = taskStatusConfig[task.status] ?? taskStatusConfig.queued!;
@@ -387,16 +380,11 @@ function TaskRow({
// through useRealtimeSync's `task:` prefix path which already
// invalidates snapshot + per-agent + per-issue task lists.
} catch (e) {
- toast.error(e instanceof Error ? e.message : "Failed to cancel task");
+ toast.error(e instanceof Error ? e.message : t(($) => $.tab_body.activity.cancel_failed_toast));
setCancelling(false);
}
};
- // Terminal states never use active wording. The server links the new
- // issue back to a quick-create task on completion (so most successful
- // rows transition to kind=direct on next refetch), but rows whose link
- // write failed — or whose agent never created the issue at all — would
- // otherwise sit on "Creating issue" forever.
const isTerminalStatus =
task.status === "completed" ||
task.status === "failed" ||
@@ -404,19 +392,15 @@ function TaskRow({
const sourceFallback = !hasIssue
? task.kind === "quick_create"
? isTerminalStatus
- ? "Quick create"
- : "Creating issue"
+ ? t(($) => $.tab_body.activity.source_quick_create)
+ : t(($) => $.tab_body.activity.source_creating_issue)
: task.chat_session_id
- ? "Chat session"
+ ? t(($) => $.tab_body.activity.source_chat_session)
: task.autopilot_run_id
- ? "Autopilot run"
- : "Untracked"
+ ? t(($) => $.tab_body.activity.source_autopilot_run)
+ : t(($) => $.tab_body.activity.source_untracked)
: null;
- // Origin marker — issue / chat / autopilot / untracked. The issue
- // identifier alone is technically enough for the issue case, but
- // pairing it with a Hash icon keeps the four sources visually aligned
- // so the row reads at a glance instead of requiring a parse.
const SourceIcon = hasIssue
? Hash
: task.chat_session_id
@@ -425,16 +409,16 @@ function TaskRow({
? Workflow
: CircleHelp;
const sourceLabel = hasIssue
- ? "Issue"
+ ? t(($) => $.tab_body.activity.source_issue)
: task.chat_session_id
- ? "Chat"
+ ? t(($) => $.tab_body.activity.source_chat)
: task.autopilot_run_id
- ? "Autopilot"
- : "Untracked";
+ ? t(($) => $.tab_body.activity.source_autopilot)
+ : t(($) => $.tab_body.activity.source_untracked);
const timeText =
timeMode === "active"
- ? activeTaskTimeText(task)
+ ? activeTaskTimeText(task, t)
: task.completed_at
? timeAgo(task.completed_at)
: "—";
@@ -492,14 +476,14 @@ function TaskRow({
<span className="truncate text-sm">
{issue?.title ??
(hasIssue
- ? `Issue ${task.issue_id.slice(0, 8)}…`
- : (sourceFallback ?? "Untracked"))}
+ ? t(($) => $.tab_body.activity.issue_short_fallback, { prefix: task.issue_id.slice(0, 8) })
+ : (sourceFallback ?? t(($) => $.tab_body.activity.source_untracked)))}
</span>
}
/>
<TooltipContent className="max-w-md">
<div className="text-[10px] font-medium uppercase tracking-wider text-muted-foreground/80">
- Triggered by
+ {t(($) => $.tab_body.activity.triggered_by)}
</div>
<div className="mt-0.5 whitespace-pre-wrap text-xs">
{task.trigger_summary}
@@ -510,8 +494,8 @@ function TaskRow({
<span className="truncate text-sm">
{issue?.title ??
(hasIssue
- ? `Issue ${task.issue_id.slice(0, 8)}…`
- : (sourceFallback ?? "Untracked"))}
+ ? t(($) => $.tab_body.activity.issue_short_fallback, { prefix: task.issue_id.slice(0, 8) })
+ : (sourceFallback ?? t(($) => $.tab_body.activity.source_untracked)))}
</span>
)}
</div>
@@ -541,12 +525,12 @@ function TaskRow({
<Tooltip>
<TooltipTrigger
render={<AppLink href={paths.issueDetail(task.issue_id)} />}
- aria-label="Open issue"
+ aria-label={t(($) => $.tab_body.activity.open_issue_aria)}
className="flex items-center justify-center rounded p-1 text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors"
>
<ArrowUpRight className="h-3.5 w-3.5" />
</TooltipTrigger>
- <TooltipContent>Open issue</TooltipContent>
+ <TooltipContent>{t(($) => $.tab_body.activity.open_issue_tooltip)}</TooltipContent>
</Tooltip>
)}
{showTranscript && (
@@ -554,7 +538,7 @@ function TaskRow({
task={task}
agentName={agent.name}
isLive={isRunning}
- title="View transcript"
+ title={t(($) => $.tab_body.activity.transcript_tooltip)}
/>
)}
{showCancel && (
@@ -565,7 +549,7 @@ function TaskRow({
type="button"
onClick={handleCancel}
disabled={cancelling}
- aria-label="Cancel task"
+ aria-label={t(($) => $.tab_body.activity.cancel_task_aria)}
/>
}
className="flex items-center justify-center rounded p-1 text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive disabled:cursor-not-allowed disabled:opacity-50"
@@ -573,7 +557,7 @@ function TaskRow({
<X className="h-3.5 w-3.5" />
</TooltipTrigger>
<TooltipContent>
- {cancelling ? "Cancelling…" : "Cancel task"}
+ {cancelling ? t(($) => $.tab_body.activity.cancelling_tooltip) : t(($) => $.tab_body.activity.cancel_task_tooltip)}
</TooltipContent>
</Tooltip>
)}
@@ -615,14 +599,16 @@ function Sep() {
return <span className="mx-1 text-muted-foreground/40">·</span>;
}
-function activeTaskTimeText(task: AgentTask): string {
+type AgentsT = ReturnType<typeof useT<"agents">>["t"];
+
+function activeTaskTimeText(task: AgentTask, t: AgentsT): string {
if (task.status === "running" && task.started_at) {
- return `Started ${timeAgo(task.started_at)}`;
+ return t(($) => $.tab_body.activity.started_prefix, { when: timeAgo(task.started_at) });
}
if (task.status === "dispatched" && task.dispatched_at) {
- return `Dispatched ${timeAgo(task.dispatched_at)}`;
+ return t(($) => $.tab_body.activity.dispatched_prefix, { when: timeAgo(task.dispatched_at) });
}
- return `Queued ${timeAgo(task.created_at)}`;
+ return t(($) => $.tab_body.activity.queued_prefix, { when: timeAgo(task.created_at) });
}
/**
diff --git a/packages/views/agents/components/tabs/custom-args-tab.tsx b/packages/views/agents/components/tabs/custom-args-tab.tsx
index feedcad3c2..c33456c13b 100644
--- a/packages/views/agents/components/tabs/custom-args-tab.tsx
+++ b/packages/views/agents/components/tabs/custom-args-tab.tsx
@@ -7,6 +7,7 @@ import { createSafeId } from "@multica/core/utils";
import { Button } from "@multica/ui/components/ui/button";
import { Input } from "@multica/ui/components/ui/input";
import { toast } from "sonner";
+import { useT } from "../../../i18n";
interface ArgEntry {
id: string;
@@ -37,6 +38,7 @@ export function CustomArgsTab({
onSave: (updates: Partial<Agent>) => Promise<void>;
onDirtyChange?: (dirty: boolean) => void;
}) {
+ const { t } = useT("agents");
const [entries, setEntries] = useState<ArgEntry[]>(
argsToEntries(agent.custom_args ?? []),
);
@@ -68,9 +70,9 @@ export function CustomArgsTab({
setSaving(true);
try {
await onSave({ custom_args: currentArgs });
- toast.success("Custom arguments saved");
+ toast.success(t(($) => $.tab_body.custom_args.saved_toast));
} catch {
- toast.error("Failed to save custom arguments");
+ toast.error(t(($) => $.tab_body.custom_args.save_failed_toast));
} finally {
setSaving(false);
}
@@ -83,15 +85,13 @@ export function CustomArgsTab({
<div className="flex items-start justify-between gap-3">
<div className="space-y-1">
<p className="text-xs text-muted-foreground">
- Additional CLI arguments appended to the agent command at launch.
- Multi-token flags can share one row — they&apos;ll be split on
- whitespace before being passed to the CLI.
+ {t(($) => $.tab_body.custom_args.intro)}
</p>
{launchHeader && (
<p className="text-xs text-muted-foreground">
- Launch mode:{" "}
+ {t(($) => $.tab_body.custom_args.launch_mode_prefix)}
<code className="rounded bg-muted px-1 py-0.5 font-mono text-[11px]">
- {launchHeader} &lt;your args&gt;
+ {launchHeader} {t(($) => $.tab_body.custom_args.launch_mode_args_placeholder)}
</code>
</p>
)}
@@ -104,7 +104,7 @@ export function CustomArgsTab({
className="shrink-0"
>
<Plus className="h-3 w-3" />
- Add
+ {t(($) => $.tab_body.common.add)}
</Button>
</div>
@@ -115,7 +115,7 @@ export function CustomArgsTab({
<Input
value={entry.value}
onChange={(e) => updateEntry(index, e.target.value)}
- placeholder="--flag value"
+ placeholder={t(($) => $.tab_body.custom_args.input_placeholder)}
className="flex-1 font-mono text-xs"
/>
<Button
@@ -123,7 +123,7 @@ export function CustomArgsTab({
size="icon-sm"
onClick={() => removeEntry(index)}
className="text-muted-foreground hover:text-destructive"
- aria-label="Remove argument"
+ aria-label={t(($) => $.tab_body.custom_args.remove_aria)}
>
<Trash2 className="h-3.5 w-3.5" />
</Button>
@@ -134,7 +134,7 @@ export function CustomArgsTab({
<div className="flex items-center justify-end gap-3">
{dirty && (
- <span className="text-xs text-muted-foreground">Unsaved changes</span>
+ <span className="text-xs text-muted-foreground">{t(($) => $.tab_body.common.unsaved_changes)}</span>
)}
<Button onClick={handleSave} disabled={!dirty || saving} size="sm">
{saving ? (
@@ -142,7 +142,7 @@ export function CustomArgsTab({
) : (
<Save className="h-3.5 w-3.5" />
)}
- Save
+ {t(($) => $.tab_body.common.save)}
</Button>
</div>
</div>
diff --git a/packages/views/agents/components/tabs/env-tab.tsx b/packages/views/agents/components/tabs/env-tab.tsx
index 7637b6926e..82d344b7c2 100644
--- a/packages/views/agents/components/tabs/env-tab.tsx
+++ b/packages/views/agents/components/tabs/env-tab.tsx
@@ -14,6 +14,7 @@ import type { Agent } from "@multica/core/types";
import { Button } from "@multica/ui/components/ui/button";
import { Input } from "@multica/ui/components/ui/input";
import { toast } from "sonner";
+import { useT } from "../../../i18n";
let nextEnvId = 0;
@@ -55,6 +56,7 @@ export function EnvTab({
onSave: (updates: Partial<Agent>) => Promise<void>;
onDirtyChange?: (dirty: boolean) => void;
}) {
+ const { t } = useT("agents");
const [envEntries, setEnvEntries] = useState<EnvEntry[]>(
envMapToEntries(agent.custom_env ?? {}),
);
@@ -104,16 +106,16 @@ export function EnvTab({
const keys = envEntries.filter((e) => e.key.trim()).map((e) => e.key.trim());
const uniqueKeys = new Set(keys);
if (uniqueKeys.size < keys.length) {
- toast.error("Duplicate environment variable keys");
+ toast.error(t(($) => $.tab_body.env.duplicate_keys_toast));
return;
}
setSaving(true);
try {
await onSave({ custom_env: currentEnvMap });
- toast.success("Environment variables saved");
+ toast.success(t(($) => $.tab_body.env.saved_toast));
} catch {
- toast.error("Failed to save environment variables");
+ toast.error(t(($) => $.tab_body.env.save_failed_toast));
} finally {
setSaving(false);
}
@@ -123,8 +125,7 @@ export function EnvTab({
return (
<div className="space-y-4">
<p className="text-xs text-muted-foreground">
- Injected into the agent process at launch. Values are hidden — only
- the agent owner or workspace admin can view and edit them.
+ {t(($) => $.tab_body.env.intro_readonly)}
</p>
{envEntries.length > 0 ? (
<div className="space-y-2">
@@ -149,7 +150,7 @@ export function EnvTab({
</div>
) : (
<p className="text-xs italic text-muted-foreground">
- No environment variables configured.
+ {t(($) => $.tab_body.env.empty_readonly)}
</p>
)}
</div>
@@ -160,15 +161,15 @@ export function EnvTab({
<div className="space-y-4">
<div className="flex items-start justify-between gap-3">
<p className="text-xs text-muted-foreground">
- Injected into the agent process at launch (e.g.{" "}
+ {t(($) => $.tab_body.env.intro_prefix)}
<code className="rounded bg-muted px-1 py-0.5 font-mono text-[11px]">
- ANTHROPIC_API_KEY
+ {"ANTHROPIC_API_KEY"}
</code>
- ,{" "}
+ {t(($) => $.tab_body.env.intro_separator)}
<code className="rounded bg-muted px-1 py-0.5 font-mono text-[11px]">
- ANTHROPIC_BASE_URL
+ {"ANTHROPIC_BASE_URL"}
</code>
- ).
+ {t(($) => $.tab_body.env.intro_suffix)}
</p>
<Button
type="button"
@@ -178,7 +179,7 @@ export function EnvTab({
className="shrink-0"
>
<Plus className="h-3 w-3" />
- Add
+ {t(($) => $.tab_body.common.add)}
</Button>
</div>
@@ -189,7 +190,7 @@ export function EnvTab({
<Input
value={entry.key}
onChange={(e) => updateEnvEntry(index, "key", e.target.value)}
- placeholder="KEY"
+ placeholder={t(($) => $.tab_body.env.key_placeholder)}
className="w-[40%] font-mono text-xs"
/>
<div className="relative flex-1">
@@ -199,14 +200,14 @@ export function EnvTab({
onChange={(e) =>
updateEnvEntry(index, "value", e.target.value)
}
- placeholder="value"
+ placeholder={t(($) => $.tab_body.env.value_placeholder)}
className="pr-8 font-mono text-xs"
/>
<button
type="button"
onClick={() => toggleEnvVisibility(index)}
className="absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground"
- aria-label={entry.visible ? "Hide value" : "Show value"}
+ aria-label={entry.visible ? t(($) => $.tab_body.env.hide_value_aria) : t(($) => $.tab_body.env.show_value_aria)}
>
{entry.visible ? (
<EyeOff className="h-3.5 w-3.5" />
@@ -220,7 +221,7 @@ export function EnvTab({
size="icon-sm"
onClick={() => removeEnvEntry(index)}
className="text-muted-foreground hover:text-destructive"
- aria-label="Remove variable"
+ aria-label={t(($) => $.tab_body.env.remove_aria)}
>
<Trash2 className="h-3.5 w-3.5" />
</Button>
@@ -231,7 +232,7 @@ export function EnvTab({
<div className="flex items-center justify-end gap-3">
{dirty && (
- <span className="text-xs text-muted-foreground">Unsaved changes</span>
+ <span className="text-xs text-muted-foreground">{t(($) => $.tab_body.common.unsaved_changes)}</span>
)}
<Button onClick={handleSave} disabled={!dirty || saving} size="sm">
{saving ? (
@@ -239,7 +240,7 @@ export function EnvTab({
) : (
<Save className="h-3.5 w-3.5" />
)}
- Save
+ {t(($) => $.tab_body.common.save)}
</Button>
</div>
</div>
diff --git a/packages/views/agents/components/tabs/instructions-tab.tsx b/packages/views/agents/components/tabs/instructions-tab.tsx
index 890b9a3964..4b5cbf2a1f 100644
--- a/packages/views/agents/components/tabs/instructions-tab.tsx
+++ b/packages/views/agents/components/tabs/instructions-tab.tsx
@@ -5,20 +5,7 @@ import { Loader2, Save } from "lucide-react";
import type { Agent } from "@multica/core/types";
import { Button } from "@multica/ui/components/ui/button";
import { ContentEditor } from "../../../editor/content-editor";
-
-const INSTRUCTIONS_PLACEHOLDER = `Define this agent's role, expertise, and working style.
-
-# Example
-You are a frontend engineer specializing in React and TypeScript.
-
-## Working Style
-- Write small, focused PRs — one commit per logical change
-- Prefer composition over inheritance
-- Always add unit tests for new components
-
-## Constraints
-- Do not modify shared/ types without explicit approval
-- Follow the existing component patterns in features/`;
+import { useT } from "../../../i18n";
export function InstructionsTab({
agent,
@@ -29,6 +16,7 @@ export function InstructionsTab({
onSave: (instructions: string) => Promise<void>;
onDirtyChange?: (dirty: boolean) => void;
}) {
+ const { t } = useT("agents");
const [value, setValue] = useState(agent.instructions ?? "");
const [saving, setSaving] = useState(false);
const isDirty = value !== (agent.instructions ?? "");
@@ -60,8 +48,7 @@ export function InstructionsTab({
// the Save row scrolls off-screen as the user writes longer prompts.
<div className="flex h-full flex-col gap-4">
<p className="text-xs text-muted-foreground">
- Define this agent&apos;s identity and working style. Injected into the
- agent&apos;s context for every task. Markdown is supported.
+ {t(($) => $.tab_body.instructions.intro)}
</p>
<div
@@ -77,7 +64,7 @@ export function InstructionsTab({
key={agent.id}
defaultValue={value}
onUpdate={setValue}
- placeholder={INSTRUCTIONS_PLACEHOLDER}
+ placeholder={t(($) => $.tab_body.instructions.placeholder)}
debounceMs={150}
// Mention has no business meaning in agent system prompts — typing
// `@` would just confuse users with a member/agent picker.
@@ -92,7 +79,7 @@ export function InstructionsTab({
<div className="flex items-center justify-end gap-3">
{isDirty && (
- <span className="text-xs text-muted-foreground">Unsaved changes</span>
+ <span className="text-xs text-muted-foreground">{t(($) => $.tab_body.common.unsaved_changes)}</span>
)}
<Button
size="sm"
@@ -104,7 +91,7 @@ export function InstructionsTab({
) : (
<Save className="h-3.5 w-3.5" />
)}
- Save
+ {t(($) => $.tab_body.common.save)}
</Button>
</div>
</div>
diff --git a/packages/views/agents/components/tabs/skills-tab.test.tsx b/packages/views/agents/components/tabs/skills-tab.test.tsx
index 01b3d2b606..7874b2062b 100644
--- a/packages/views/agents/components/tabs/skills-tab.test.tsx
+++ b/packages/views/agents/components/tabs/skills-tab.test.tsx
@@ -4,6 +4,11 @@ import { describe, it, expect, vi, beforeEach } from "vitest";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { render, screen } from "@testing-library/react";
import type { Agent } from "@multica/core/types";
+import { I18nProvider } from "@multica/core/i18n/react";
+import enCommon from "../../../locales/en/common.json";
+import enAgents from "../../../locales/en/agents.json";
+
+const TEST_RESOURCES = { en: { common: enCommon, agents: enAgents } };
const mockListSkills = vi.hoisted(() => vi.fn());
@@ -62,9 +67,11 @@ function renderSkillsTab() {
});
return render(
- <QueryClientProvider client={queryClient}>
- <SkillsTab agent={agent} />
- </QueryClientProvider>,
+ <I18nProvider locale="en" resources={TEST_RESOURCES}>
+ <QueryClientProvider client={queryClient}>
+ <SkillsTab agent={agent} />
+ </QueryClientProvider>
+ </I18nProvider>,
);
}
diff --git a/packages/views/agents/components/tabs/skills-tab.tsx b/packages/views/agents/components/tabs/skills-tab.tsx
index 821c0d6f58..76f58173b3 100644
--- a/packages/views/agents/components/tabs/skills-tab.tsx
+++ b/packages/views/agents/components/tabs/skills-tab.tsx
@@ -13,12 +13,14 @@ import {
} from "@multica/core/workspace/queries";
import { Button } from "@multica/ui/components/ui/button";
import { SkillAddDialog } from "../skill-add-dialog";
+import { useT } from "../../../i18n";
export function SkillsTab({
agent,
}: {
agent: Agent;
}) {
+ const { t } = useT("agents");
const qc = useQueryClient();
const wsId = useWorkspaceId();
// Same query the SkillAddDialog uses (TanStack Query dedupes by key, so
@@ -42,7 +44,7 @@ export function SkillsTab({
await api.setAgentSkills(agent.id, { skill_ids: newIds });
qc.invalidateQueries({ queryKey: workspaceKeys.agents(wsId) });
} catch (e) {
- toast.error(e instanceof Error ? e.message : "Failed to remove skill");
+ toast.error(e instanceof Error ? e.message : t(($) => $.tab_body.skills.remove_failed_toast));
} finally {
setRemoving(false);
}
@@ -52,8 +54,7 @@ export function SkillsTab({
<div className="space-y-4">
<div className="flex items-start justify-between gap-3">
<p className="text-xs text-muted-foreground">
- Workspace skills assigned to this agent. Local runtime skills are
- always available automatically.
+ {t(($) => $.tab_body.skills.intro)}
</p>
<Button
variant="outline"
@@ -63,14 +64,14 @@ export function SkillsTab({
className="shrink-0"
>
<Plus className="h-3 w-3" />
- Add skill
+ {t(($) => $.tab_body.skills.add_action)}
</Button>
</div>
<div className="flex items-start gap-2 rounded-md border border-info/20 bg-info/5 px-3 py-2.5">
<Info className="mt-0.5 h-3.5 w-3.5 shrink-0 text-info" />
<p className="text-xs text-muted-foreground">
- Importing creates a workspace copy that your team can edit and reuse.
+ {t(($) => $.tab_body.skills.import_hint)}
</p>
</div>
@@ -78,10 +79,10 @@ export function SkillsTab({
<div className="flex flex-col items-center justify-center rounded-lg border border-dashed py-12">
<FileText className="h-8 w-8 text-muted-foreground/40" />
<p className="mt-3 text-sm text-muted-foreground">
- No skills assigned
+ {t(($) => $.tab_body.skills.empty_title)}
</p>
<p className="mt-1 max-w-xs text-center text-xs text-muted-foreground">
- Add workspace skills to share team knowledge with this agent.
+ {t(($) => $.tab_body.skills.empty_hint)}
</p>
{availableCount > 0 && (
<Button
@@ -90,7 +91,7 @@ export function SkillsTab({
className="mt-3"
>
<Plus className="h-3 w-3" />
- Add skill
+ {t(($) => $.tab_body.skills.add_action)}
</Button>
)}
</div>
diff --git a/packages/views/agents/components/visibility-badge.tsx b/packages/views/agents/components/visibility-badge.tsx
index 27b1a7949a..ec50e72e4a 100644
--- a/packages/views/agents/components/visibility-badge.tsx
+++ b/packages/views/agents/components/visibility-badge.tsx
@@ -1,12 +1,9 @@
"use client";
import { Globe, Lock } from "lucide-react";
-import {
- VISIBILITY_LABEL,
- VISIBILITY_TOOLTIP,
-} from "@multica/core/agents";
import type { AgentVisibility } from "@multica/core/types";
import { Tooltip, TooltipTrigger, TooltipContent } from "@multica/ui/components/ui/tooltip";
+import { useT } from "../../i18n";
/**
* Read-only visibility badge — used wherever a user should *see* an agent's
@@ -26,9 +23,10 @@ export function VisibilityBadge({
compact?: boolean;
className?: string;
}) {
+ const { t } = useT("agents");
const Icon = value === "private" ? Lock : Globe;
- const label = VISIBILITY_LABEL[value];
- const tooltip = VISIBILITY_TOOLTIP[value];
+ const label = t(($) => $.visibility[value].label);
+ const tooltip = t(($) => $.visibility[value].tooltip);
return (
<Tooltip>
diff --git a/packages/views/auth/login-page.test.tsx b/packages/views/auth/login-page.test.tsx
index 8e1bf64d5c..cc1d374e42 100644
--- a/packages/views/auth/login-page.test.tsx
+++ b/packages/views/auth/login-page.test.tsx
@@ -1,6 +1,27 @@
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
import { render, screen, waitFor, act } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
+import type { ReactElement, ReactNode } from "react";
+import { I18nProvider } from "@multica/core/i18n/react";
+import enCommon from "../locales/en/common.json";
+import enAuth from "../locales/en/auth.json";
+import enSettings from "../locales/en/settings.json";
+
+const TEST_RESOURCES = {
+ en: { common: enCommon, auth: enAuth, settings: enSettings },
+};
+
+function I18nWrapper({ children }: { children: ReactNode }) {
+ return (
+ <I18nProvider locale="en" resources={TEST_RESOURCES}>
+ {children}
+ </I18nProvider>
+ );
+}
+
+function renderWithI18n(ui: ReactElement) {
+ return render(ui, { wrapper: I18nWrapper });
+}
// ---------------------------------------------------------------------------
// Hoisted mocks
@@ -94,7 +115,7 @@ describe("LoginPage", () => {
// -------------------------------------------------------------------------
it("renders email form with 'Sign in to Multica' title", () => {
- render(<LoginPage onSuccess={onSuccess} />);
+ renderWithI18n(<LoginPage onSuccess={onSuccess} />);
expect(
screen.getByText(/sign in to multica/i),
).toBeInTheDocument();
@@ -112,7 +133,7 @@ describe("LoginPage", () => {
// -------------------------------------------------------------------------
it("shows error when submitting with empty email", async () => {
- render(<LoginPage onSuccess={onSuccess} />);
+ renderWithI18n(<LoginPage onSuccess={onSuccess} />);
// The Continue button is disabled when email is empty, so we submit the
// form programmatically the same way the component does — via form submit.
@@ -140,7 +161,7 @@ describe("LoginPage", () => {
it("calls sendCode on form submit with email", async () => {
mockSendCode.mockResolvedValueOnce(undefined);
- render(<LoginPage onSuccess={onSuccess} />);
+ renderWithI18n(<LoginPage onSuccess={onSuccess} />);
const user = userEvent.setup();
await user.type(screen.getByLabelText(/email/i), "[email protected]");
@@ -152,7 +173,7 @@ describe("LoginPage", () => {
it("shows 'Sending code...' while submitting", async () => {
// Never resolve so loading stays true
mockSendCode.mockReturnValueOnce(new Promise(() => {}));
- render(<LoginPage onSuccess={onSuccess} />);
+ renderWithI18n(<LoginPage onSuccess={onSuccess} />);
const user = userEvent.setup();
await user.type(screen.getByLabelText(/email/i), "[email protected]");
@@ -163,7 +184,7 @@ describe("LoginPage", () => {
it("transitions to code step after successful sendCode", async () => {
mockSendCode.mockResolvedValueOnce(undefined);
- render(<LoginPage onSuccess={onSuccess} />);
+ renderWithI18n(<LoginPage onSuccess={onSuccess} />);
const user = userEvent.setup();
await user.type(screen.getByLabelText(/email/i), "[email protected]");
@@ -179,7 +200,7 @@ describe("LoginPage", () => {
it("shows error when sendCode fails", async () => {
mockSendCode.mockRejectedValueOnce(new Error("Rate limited"));
- render(<LoginPage onSuccess={onSuccess} />);
+ renderWithI18n(<LoginPage onSuccess={onSuccess} />);
const user = userEvent.setup();
await user.type(screen.getByLabelText(/email/i), "[email protected]");
@@ -192,7 +213,7 @@ describe("LoginPage", () => {
it("shows generic error when sendCode throws non-Error", async () => {
mockSendCode.mockRejectedValueOnce("boom");
- render(<LoginPage onSuccess={onSuccess} />);
+ renderWithI18n(<LoginPage onSuccess={onSuccess} />);
const user = userEvent.setup();
await user.type(screen.getByLabelText(/email/i), "[email protected]");
@@ -214,7 +235,7 @@ describe("LoginPage", () => {
mockVerifyCode.mockResolvedValueOnce(undefined);
mockApiListWorkspaces.mockResolvedValueOnce([{ id: "ws-1" }]);
- render(<LoginPage onSuccess={onSuccess} />);
+ renderWithI18n(<LoginPage onSuccess={onSuccess} />);
const user = userEvent.setup();
// Step 1: email
@@ -251,7 +272,7 @@ describe("LoginPage", () => {
mockSendCode.mockResolvedValueOnce(undefined);
mockVerifyCode.mockRejectedValueOnce(new Error("Invalid code"));
- render(<LoginPage onSuccess={onSuccess} />);
+ renderWithI18n(<LoginPage onSuccess={onSuccess} />);
const user = userEvent.setup();
await user.type(screen.getByLabelText(/email/i), "[email protected]");
@@ -278,7 +299,7 @@ describe("LoginPage", () => {
it("disables resend button during cooldown", async () => {
mockSendCode.mockResolvedValue(undefined);
- render(<LoginPage onSuccess={onSuccess} />);
+ renderWithI18n(<LoginPage onSuccess={onSuccess} />);
const user = userEvent.setup();
await user.type(screen.getByLabelText(/email/i), "[email protected]");
@@ -298,7 +319,7 @@ describe("LoginPage", () => {
it("shows resend button with cooldown text after sending code", async () => {
mockSendCode.mockResolvedValue(undefined);
const user = userEvent.setup();
- render(<LoginPage onSuccess={onSuccess} />);
+ renderWithI18n(<LoginPage onSuccess={onSuccess} />);
await user.type(screen.getByLabelText(/email/i), "[email protected]");
await user.click(screen.getByRole("button", { name: /continue/i }));
@@ -313,7 +334,7 @@ describe("LoginPage", () => {
it("calls sendCode again when resend is clicked after cooldown", async () => {
mockSendCode.mockResolvedValue(undefined);
- render(<LoginPage onSuccess={onSuccess} />);
+ renderWithI18n(<LoginPage onSuccess={onSuccess} />);
const user = userEvent.setup({ advanceTimers: vi.advanceTimersByTime });
await user.type(screen.getByLabelText(/email/i), "[email protected]");
@@ -362,7 +383,7 @@ describe("LoginPage", () => {
});
it("hides Google OAuth button when google prop omitted", () => {
- render(<LoginPage onSuccess={onSuccess} />);
+ renderWithI18n(<LoginPage onSuccess={onSuccess} />);
expect(
screen.queryByRole("button", { name: /continue with google/i }),
).not.toBeInTheDocument();
@@ -594,7 +615,7 @@ describe("LoginPage", () => {
});
it("does not render logo placeholder when omitted", () => {
- render(<LoginPage onSuccess={onSuccess} />);
+ renderWithI18n(<LoginPage onSuccess={onSuccess} />);
expect(screen.queryByTestId("custom-logo")).not.toBeInTheDocument();
});
@@ -640,7 +661,7 @@ describe("LoginPage", () => {
it("back button returns to email step", async () => {
mockSendCode.mockResolvedValueOnce(undefined);
- render(<LoginPage onSuccess={onSuccess} />);
+ renderWithI18n(<LoginPage onSuccess={onSuccess} />);
const user = userEvent.setup();
await user.type(screen.getByLabelText(/email/i), "[email protected]");
diff --git a/packages/views/auth/login-page.tsx b/packages/views/auth/login-page.tsx
index 2808a10502..e3e99dea10 100644
--- a/packages/views/auth/login-page.tsx
+++ b/packages/views/auth/login-page.tsx
@@ -22,6 +22,7 @@ import { useAuthStore } from "@multica/core/auth";
import { workspaceKeys } from "@multica/core/workspace/queries";
import { api } from "@multica/core/api";
import type { User } from "@multica/core/types";
+import { useT } from "../i18n";
// ---------------------------------------------------------------------------
// Types
@@ -105,6 +106,7 @@ export function LoginPage({
onGoogleLogin,
extra,
}: LoginPageProps) {
+ const { t } = useT("auth");
const qc = useQueryClient();
const [step, setStep] = useState<"email" | "code" | "cli_confirm">("email");
const [email, setEmail] = useState("");
@@ -164,7 +166,7 @@ export function LoginPage({
async (e?: React.FormEvent) => {
e?.preventDefault();
if (!email) {
- setError("Email is required");
+ setError(t(($) => $.common.email_required));
return;
}
setLoading(true);
@@ -178,13 +180,13 @@ export function LoginPage({
setError(
err instanceof Error
? err.message
- : "Failed to send code. Make sure the server is running.",
+ : `${t(($) => $.errors.send_failed)} ${t(($) => $.errors.server_unreachable)}`,
);
} finally {
setLoading(false);
}
},
- [email],
+ [email, t],
);
const handleVerify = useCallback(
@@ -214,13 +216,15 @@ export function LoginPage({
onSuccess();
} catch (err) {
setError(
- err instanceof Error ? err.message : "Invalid or expired code",
+ err instanceof Error
+ ? err.message
+ : t(($) => $.errors.code_invalid),
);
setCode("");
setLoading(false);
}
},
- [email, onSuccess, cliCallback, onTokenObtained, qc],
+ [email, onSuccess, cliCallback, onTokenObtained, qc, t],
);
const handleResend = async () => {
@@ -231,7 +235,7 @@ export function LoginPage({
setCooldown(60);
} catch (err) {
setError(
- err instanceof Error ? err.message : "Failed to resend code",
+ err instanceof Error ? err.message : t(($) => $.errors.resend_failed),
);
}
};
@@ -257,7 +261,7 @@ export function LoginPage({
onTokenObtained?.();
redirectToCliCallback(cliCallback.url, token, cliCallback.state);
} catch {
- setError("Failed to authorize CLI. Please log in again.");
+ setError(t(($) => $.errors.cli_auth_failed));
setExistingUser(null);
setStep("email");
setLoading(false);
@@ -292,13 +296,11 @@ export function LoginPage({
<Card className="w-full max-w-sm">
<CardHeader className="text-center">
{logo && <div className="mx-auto mb-4">{logo}</div>}
- <CardTitle className="text-2xl">Authorize CLI</CardTitle>
+ <CardTitle className="text-2xl">
+ {t(($) => $.cli.title)}
+ </CardTitle>
<CardDescription>
- Allow the CLI to access Multica as{" "}
- <span className="font-medium text-foreground">
- {existingUser.email}
- </span>
- ?
+ {t(($) => $.cli.description, { email: existingUser.email })}
</CardDescription>
</CardHeader>
<CardContent className="flex flex-col gap-3">
@@ -308,7 +310,9 @@ export function LoginPage({
className="w-full"
size="lg"
>
- {loading ? "Authorizing..." : "Authorize"}
+ {loading
+ ? t(($) => $.cli.authorizing)
+ : t(($) => $.cli.authorize)}
</Button>
<Button
variant="ghost"
@@ -318,7 +322,7 @@ export function LoginPage({
setStep("email");
}}
>
- Use a different account
+ {t(($) => $.cli.different_account)}
</Button>
</CardContent>
</Card>
@@ -336,10 +340,11 @@ export function LoginPage({
<Card className="w-full max-w-sm">
<CardHeader className="text-center">
{logo && <div className="mx-auto mb-4">{logo}</div>}
- <CardTitle className="text-2xl">Check your email</CardTitle>
+ <CardTitle className="text-2xl">
+ {t(($) => $.verify.title)}
+ </CardTitle>
<CardDescription>
- We sent a verification code to{" "}
- <span className="font-medium text-foreground">{email}</span>
+ {t(($) => $.verify.description, { email })}
</CardDescription>
</CardHeader>
<CardContent className="flex flex-col items-center gap-4">
@@ -371,7 +376,9 @@ export function LoginPage({
disabled={cooldown > 0}
className="text-primary underline-offset-4 hover:underline disabled:text-muted-foreground disabled:no-underline disabled:cursor-not-allowed"
>
- {cooldown > 0 ? `Resend in ${cooldown}s` : "Resend code"}
+ {cooldown > 0
+ ? t(($) => $.verify.resend_cooldown, { seconds: cooldown })
+ : t(($) => $.verify.resend)}
</button>
</div>
</CardContent>
@@ -386,7 +393,7 @@ export function LoginPage({
setError("");
}}
>
- Back
+ {t(($) => $.common.back)}
</Button>
</CardFooter>
</Card>
@@ -403,19 +410,21 @@ export function LoginPage({
<Card className="w-full max-w-sm">
<CardHeader className="text-center">
{logo && <div className="mx-auto mb-4">{logo}</div>}
- <CardTitle className="text-2xl">Sign in to Multica</CardTitle>
+ <CardTitle className="text-2xl">
+ {t(($) => $.signin.title)}
+ </CardTitle>
<CardDescription>
- Enter your email to get a login code
+ {t(($) => $.signin.description)}
</CardDescription>
</CardHeader>
<CardContent>
<form id="login-form" onSubmit={handleSendCode} className="space-y-4">
<div className="space-y-2">
- <Label htmlFor="login-email">Email</Label>
+ <Label htmlFor="login-email">{t(($) => $.common.email)}</Label>
<Input
id="login-email"
type="email"
- placeholder="[email protected]"
+ placeholder={t(($) => $.common.email_placeholder)}
value={email}
onChange={(e) => setEmail(e.target.value)}
autoFocus
@@ -435,7 +444,9 @@ export function LoginPage({
size="lg"
disabled={!email || loading}
>
- {loading ? "Sending code..." : "Continue"}
+ {loading
+ ? t(($) => $.signin.sending)
+ : t(($) => $.signin.continue)}
</Button>
{(google || onGoogleLogin) && (
<>
@@ -444,7 +455,9 @@ export function LoginPage({
<span className="w-full border-t" />
</div>
<div className="relative flex justify-center text-xs uppercase">
- <span className="bg-card px-2 text-muted-foreground">or</span>
+ <span className="bg-card px-2 text-muted-foreground">
+ {t(($) => $.signin.divider)}
+ </span>
</div>
</div>
<Button
@@ -473,7 +486,7 @@ export function LoginPage({
fill="#EA4335"
/>
</svg>
- Continue with Google
+ {t(($) => $.signin.google)}
</Button>
</>
)}
diff --git a/packages/views/autopilots/components/autopilot-detail-page.tsx b/packages/views/autopilots/components/autopilot-detail-page.tsx
index 54862f7460..cd75f41736 100644
--- a/packages/views/autopilots/components/autopilot-detail-page.tsx
+++ b/packages/views/autopilots/components/autopilot-detail-page.tsx
@@ -48,6 +48,7 @@ import type { AgentTask } from "@multica/core/types/agent";
import { ReadonlyContent } from "../../editor";
import { TranscriptButton } from "../../common/task-transcript";
import { AutopilotDialog } from "./autopilot-dialog";
+import { useT } from "../../i18n";
function formatDate(date: string): string {
return new Date(date).toLocaleString(undefined, {
@@ -58,17 +59,21 @@ function formatDate(date: string): string {
});
}
-const RUN_STATUS_CONFIG: Record<string, { label: string; color: string; icon: typeof CheckCircle2; spin?: boolean }> = {
- issue_created: { label: "Issue Created", color: "text-blue-500", icon: Clock },
- running: { label: "Running", color: "text-blue-500", icon: Loader2, spin: true },
- completed: { label: "Completed", color: "text-emerald-500", icon: CheckCircle2 },
- failed: { label: "Failed", color: "text-destructive", icon: XCircle },
+type RunStatus = "issue_created" | "running" | "completed" | "failed";
+
+const RUN_VISUAL: Record<RunStatus, { color: string; icon: typeof CheckCircle2; spin?: boolean }> = {
+ issue_created: { color: "text-blue-500", icon: Clock },
+ running: { color: "text-blue-500", icon: Loader2, spin: true },
+ completed: { color: "text-emerald-500", icon: CheckCircle2 },
+ failed: { color: "text-destructive", icon: XCircle },
};
function RunRow({ run, agentId, agentName }: { run: AutopilotRun; agentId: string; agentName: string }) {
+ const { t } = useT("autopilots");
const wsPaths = useWorkspacePaths();
- const cfg = (RUN_STATUS_CONFIG[run.status] ?? RUN_STATUS_CONFIG["issue_created"])!;
- const StatusIcon = cfg.icon;
+ const status = (RUN_VISUAL[run.status as RunStatus] ? (run.status as RunStatus) : "issue_created");
+ const visual = RUN_VISUAL[status];
+ const StatusIcon = visual.icon;
// For runs with a task_id (run_only mode), build a minimal AgentTask so
// TranscriptButton can lazy-load the execution transcript.
@@ -95,12 +100,14 @@ function RunRow({ run, agentId, agentName }: { run: AutopilotRun; agentId: strin
const content = (
<>
- <StatusIcon className={cn("h-4 w-4 shrink-0", cfg.color, cfg.spin && "animate-spin")} />
- <span className={cn("w-24 shrink-0 text-xs font-medium", cfg.color)}>{cfg.label}</span>
+ <StatusIcon className={cn("h-4 w-4 shrink-0", visual.color, visual.spin && "animate-spin")} />
+ <span className={cn("w-24 shrink-0 text-xs font-medium", visual.color)}>
+ {t(($) => $.run_status[status])}
+ </span>
<span className="w-16 shrink-0 text-xs text-muted-foreground capitalize">{run.source}</span>
<span className="flex-1 min-w-0 text-xs text-muted-foreground truncate">
{run.issue_id ? (
- "Issue linked"
+ t(($) => $.run.issue_linked)
) : run.failure_reason ? (
<span className="text-destructive">{run.failure_reason}</span>
) : null}
@@ -113,7 +120,7 @@ function RunRow({ run, agentId, agentName }: { run: AutopilotRun; agentId: strin
task={syntheticTask}
agentName={agentName}
isLive={run.status === "running"}
- title="View execution log"
+ title={t(($) => $.run.view_log)}
/>
)}
</>
@@ -133,6 +140,7 @@ function RunRow({ run, agentId, agentName }: { run: AutopilotRun; agentId: strin
}
function TriggerRow({ trigger, autopilotId }: { trigger: AutopilotTrigger; autopilotId: string }) {
+ const { t } = useT("autopilots");
const deleteTrigger = useDeleteAutopilotTrigger();
const [confirmOpen, setConfirmOpen] = useState(false);
const [deleting, setDeleting] = useState(false);
@@ -141,10 +149,10 @@ function TriggerRow({ trigger, autopilotId }: { trigger: AutopilotTrigger; autop
setDeleting(true);
try {
await deleteTrigger.mutateAsync({ autopilotId, triggerId: trigger.id });
- toast.success("Trigger deleted");
+ toast.success(t(($) => $.trigger_row.toast_deleted));
setConfirmOpen(false);
} catch {
- toast.error("Failed to delete trigger");
+ toast.error(t(($) => $.trigger_row.toast_delete_failed));
} finally {
setDeleting(false);
}
@@ -160,7 +168,9 @@ function TriggerRow({ trigger, autopilotId }: { trigger: AutopilotTrigger; autop
<span className="text-xs text-muted-foreground">({trigger.label})</span>
)}
{!trigger.enabled && (
- <span className="text-xs bg-muted px-1.5 py-0.5 rounded">Disabled</span>
+ <span className="text-xs bg-muted px-1.5 py-0.5 rounded">
+ {t(($) => $.trigger_row.disabled_badge)}
+ </span>
)}
</div>
{trigger.cron_expression && (
@@ -171,7 +181,7 @@ function TriggerRow({ trigger, autopilotId }: { trigger: AutopilotTrigger; autop
)}
{trigger.next_run_at && (
<div className="text-xs text-muted-foreground">
- Next: {formatDate(trigger.next_run_at)}
+ {t(($) => $.trigger_row.next_label, { date: formatDate(trigger.next_run_at) })}
</div>
)}
</div>
@@ -186,19 +196,23 @@ function TriggerRow({ trigger, autopilotId }: { trigger: AutopilotTrigger; autop
<AlertDialog open={confirmOpen} onOpenChange={(v) => { if (!v && !deleting) setConfirmOpen(false); }}>
<AlertDialogContent>
<AlertDialogHeader>
- <AlertDialogTitle>Delete trigger</AlertDialogTitle>
+ <AlertDialogTitle>{t(($) => $.trigger_row.delete_dialog.title)}</AlertDialogTitle>
<AlertDialogDescription>
- This trigger will be removed and the autopilot will stop firing on this schedule. This action cannot be undone.
+ {t(($) => $.trigger_row.delete_dialog.description)}
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
- <AlertDialogCancel disabled={deleting}>Cancel</AlertDialogCancel>
+ <AlertDialogCancel disabled={deleting}>
+ {t(($) => $.trigger_row.delete_dialog.cancel)}
+ </AlertDialogCancel>
<AlertDialogAction
onClick={handleDelete}
disabled={deleting}
className="bg-destructive text-white hover:bg-destructive/90"
>
- {deleting ? "Deleting..." : "Delete"}
+ {deleting
+ ? t(($) => $.trigger_row.delete_dialog.deleting)
+ : t(($) => $.trigger_row.delete_dialog.confirm)}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
@@ -216,6 +230,7 @@ function AddTriggerDialog({
onOpenChange: (open: boolean) => void;
autopilotId: string;
}) {
+ const { t } = useT("autopilots");
const createTrigger = useCreateAutopilotTrigger();
const [config, setConfig] = useState<TriggerConfig>(getDefaultTriggerConfig);
const [label, setLabel] = useState("");
@@ -237,9 +252,9 @@ function AddTriggerDialog({
onOpenChange(false);
setConfig(getDefaultTriggerConfig());
setLabel("");
- toast.success("Trigger added");
+ toast.success(t(($) => $.add_trigger_dialog.toast_added));
} catch {
- toast.error("Failed to add trigger");
+ toast.error(t(($) => $.add_trigger_dialog.toast_add_failed));
} finally {
setSubmitting(false);
}
@@ -248,22 +263,26 @@ function AddTriggerDialog({
return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="max-w-sm">
- <DialogTitle>Add Trigger</DialogTitle>
+ <DialogTitle>{t(($) => $.add_trigger_dialog.title)}</DialogTitle>
<div className="space-y-4 pt-2">
<TriggerConfigSection config={config} onChange={setConfig} />
<div>
- <label className="text-xs font-medium text-muted-foreground">Label (optional)</label>
+ <label className="text-xs font-medium text-muted-foreground">
+ {t(($) => $.add_trigger_dialog.label_field)}
+ </label>
<input
type="text"
value={label}
onChange={(e) => setLabel(e.target.value)}
- placeholder="e.g. Weekday morning"
+ placeholder={t(($) => $.add_trigger_dialog.label_placeholder)}
className="mt-1 w-full rounded-md border bg-background px-3 py-2 text-sm outline-none focus:ring-1 focus:ring-ring"
/>
</div>
<div className="flex justify-end pt-1">
<Button size="sm" onClick={handleSubmit} disabled={submitting}>
- {submitting ? "Adding..." : "Add trigger"}
+ {submitting
+ ? t(($) => $.add_trigger_dialog.submitting)
+ : t(($) => $.add_trigger_dialog.submit)}
</Button>
</div>
</div>
@@ -273,6 +292,7 @@ function AddTriggerDialog({
}
export function AutopilotDetailPage({ autopilotId }: { autopilotId: string }) {
+ const { t } = useT("autopilots");
const wsId = useWorkspaceId();
const wsPaths = useWorkspacePaths();
const router = useNavigation();
@@ -331,7 +351,7 @@ export function AutopilotDetailPage({ autopilotId }: { autopilotId: string }) {
if (!data) {
return (
<div className="flex items-center justify-center h-full text-muted-foreground">
- Autopilot not found
+ {t(($) => $.detail.not_found)}
</div>
);
}
@@ -341,9 +361,9 @@ export function AutopilotDetailPage({ autopilotId }: { autopilotId: string }) {
const handleRunNow = async () => {
try {
await triggerAutopilot.mutateAsync(autopilotId);
- toast.success("Autopilot triggered");
+ toast.success(t(($) => $.detail.toast_triggered));
} catch (e: any) {
- toast.error(e?.message || "Failed to trigger autopilot");
+ toast.error(e?.message || t(($) => $.detail.toast_trigger_failed));
}
};
@@ -351,10 +371,10 @@ export function AutopilotDetailPage({ autopilotId }: { autopilotId: string }) {
setDeleting(true);
try {
await deleteAutopilot.mutateAsync(autopilotId);
- toast.success("Autopilot deleted");
+ toast.success(t(($) => $.detail.toast_deleted));
router.push(wsPaths.autopilots());
} catch {
- toast.error("Failed to delete autopilot");
+ toast.error(t(($) => $.detail.toast_delete_failed));
setDeleting(false);
}
};
@@ -379,26 +399,32 @@ export function AutopilotDetailPage({ autopilotId }: { autopilotId: string }) {
checked={autopilot.status === "active"}
onCheckedChange={handleToggleStatus}
disabled={autopilot.status === "archived"}
- aria-label={autopilot.status === "active" ? "Pause autopilot" : "Activate autopilot"}
+ aria-label={
+ autopilot.status === "active"
+ ? t(($) => $.detail.pause_aria)
+ : t(($) => $.detail.activate_aria)
+ }
/>
<span className={cn(
- "text-xs font-medium capitalize",
+ "text-xs font-medium",
autopilot.status === "active" ? "text-emerald-500" :
autopilot.status === "paused" ? "text-amber-500" :
"text-muted-foreground",
)}>
- {autopilot.status}
+ {t(($) => $.status[autopilot.status])}
</span>
</div>
</div>
<div className="flex items-center gap-2">
<Button size="sm" variant="outline" onClick={() => setEditDialogOpen(true)}>
<Pencil className="h-3.5 w-3.5 mr-1" />
- Edit
+ {t(($) => $.detail.edit)}
</Button>
<Button size="sm" onClick={handleRunNow} disabled={autopilot.status !== "active" || triggerAutopilot.isPending}>
<Play className="h-3.5 w-3.5 mr-1" />
- {triggerAutopilot.isPending ? "Running..." : "Run now"}
+ {triggerAutopilot.isPending
+ ? t(($) => $.detail.running)
+ : t(($) => $.detail.run_now)}
</Button>
</div>
</PageHeader>
@@ -407,24 +433,26 @@ export function AutopilotDetailPage({ autopilotId }: { autopilotId: string }) {
<div className="max-w-4xl mx-auto p-6 space-y-8">
{/* Properties */}
<section className="space-y-4">
- <h2 className="text-sm font-medium text-muted-foreground uppercase tracking-wider">Properties</h2>
+ <h2 className="text-sm font-medium text-muted-foreground uppercase tracking-wider">
+ {t(($) => $.detail.section_properties)}
+ </h2>
<div className="grid grid-cols-2 gap-4 text-sm">
<div>
- <label className="text-xs text-muted-foreground">Agent</label>
+ <label className="text-xs text-muted-foreground">{t(($) => $.detail.field_agent)}</label>
<div className="mt-1 flex items-center gap-2">
<ActorAvatar actorType="agent" actorId={autopilot.assignee_id} size={20} enableHoverCard showStatusDot />
<span className="cursor-pointer">{getActorName("agent", autopilot.assignee_id)}</span>
</div>
</div>
<div>
- <label className="text-xs text-muted-foreground">Output Mode</label>
+ <label className="text-xs text-muted-foreground">{t(($) => $.detail.field_output_mode)}</label>
<div className="mt-1">
- {autopilot.execution_mode === "create_issue" ? "Create Issue" : "Run Only"}
+ {t(($) => $.execution_mode[autopilot.execution_mode as AutopilotExecutionMode])}
</div>
</div>
{autopilot.description && (
<div className="col-span-2">
- <label className="text-xs text-muted-foreground">Prompt</label>
+ <label className="text-xs text-muted-foreground">{t(($) => $.detail.field_prompt)}</label>
<div className="mt-1">
<ReadonlyContent content={autopilot.description} />
</div>
@@ -436,20 +464,22 @@ export function AutopilotDetailPage({ autopilotId }: { autopilotId: string }) {
{/* Triggers */}
<section className="space-y-3">
<div className="flex items-center justify-between">
- <h2 className="text-sm font-medium text-muted-foreground uppercase tracking-wider">Triggers</h2>
+ <h2 className="text-sm font-medium text-muted-foreground uppercase tracking-wider">
+ {t(($) => $.detail.section_triggers)}
+ </h2>
<Button size="sm" variant="outline" onClick={() => setTriggerDialogOpen(true)}>
<Plus className="h-3.5 w-3.5 mr-1" />
- Add trigger
+ {t(($) => $.detail.add_trigger)}
</Button>
</div>
{triggers.length === 0 ? (
<div className="rounded-md border border-dashed p-4 text-center text-sm text-muted-foreground">
- No triggers configured. Add a schedule to run automatically.
+ {t(($) => $.detail.no_triggers)}
</div>
) : (
<div className="space-y-2">
- {triggers.map((t) => (
- <TriggerRow key={t.id} trigger={t} autopilotId={autopilotId} />
+ {triggers.map((trig) => (
+ <TriggerRow key={trig.id} trigger={trig} autopilotId={autopilotId} />
))}
</div>
)}
@@ -457,7 +487,9 @@ export function AutopilotDetailPage({ autopilotId }: { autopilotId: string }) {
{/* Run History */}
<section className="space-y-3">
- <h2 className="text-sm font-medium text-muted-foreground uppercase tracking-wider">Run History</h2>
+ <h2 className="text-sm font-medium text-muted-foreground uppercase tracking-wider">
+ {t(($) => $.detail.section_run_history)}
+ </h2>
{runsLoading ? (
<div className="space-y-1">
{Array.from({ length: 3 }).map((_, i) => (
@@ -466,7 +498,7 @@ export function AutopilotDetailPage({ autopilotId }: { autopilotId: string }) {
</div>
) : runs.length === 0 ? (
<div className="rounded-md border border-dashed p-4 text-center text-sm text-muted-foreground">
- No runs yet. Click &quot;Run now&quot; to trigger manually.
+ {t(($) => $.detail.no_runs)}
</div>
) : (
<div className="rounded-md border overflow-hidden">
@@ -479,10 +511,12 @@ export function AutopilotDetailPage({ autopilotId }: { autopilotId: string }) {
{/* Danger zone */}
<section className="space-y-3 pt-4 border-t">
- <h2 className="text-sm font-medium text-destructive uppercase tracking-wider">Danger Zone</h2>
+ <h2 className="text-sm font-medium text-destructive uppercase tracking-wider">
+ {t(($) => $.detail.section_danger)}
+ </h2>
<Button size="sm" variant="destructive" onClick={() => setDeleteConfirmOpen(true)}>
<Trash2 className="h-3.5 w-3.5 mr-1" />
- Delete autopilot
+ {t(($) => $.detail.delete_button)}
</Button>
</section>
</div>
@@ -514,19 +548,23 @@ export function AutopilotDetailPage({ autopilotId }: { autopilotId: string }) {
>
<AlertDialogContent>
<AlertDialogHeader>
- <AlertDialogTitle>Delete autopilot</AlertDialogTitle>
+ <AlertDialogTitle>{t(($) => $.detail.delete_dialog.title)}</AlertDialogTitle>
<AlertDialogDescription>
- This will permanently delete &ldquo;{autopilot.title}&rdquo;, along with its triggers and run history. This action cannot be undone.
+ {t(($) => $.detail.delete_dialog.description, { title: autopilot.title })}
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
- <AlertDialogCancel disabled={deleting}>Cancel</AlertDialogCancel>
+ <AlertDialogCancel disabled={deleting}>
+ {t(($) => $.detail.delete_dialog.cancel)}
+ </AlertDialogCancel>
<AlertDialogAction
onClick={handleDelete}
disabled={deleting}
className="bg-destructive text-white hover:bg-destructive/90"
>
- {deleting ? "Deleting..." : "Delete"}
+ {deleting
+ ? t(($) => $.detail.delete_dialog.deleting)
+ : t(($) => $.detail.delete_dialog.confirm)}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
diff --git a/packages/views/autopilots/components/autopilot-dialog.tsx b/packages/views/autopilots/components/autopilot-dialog.tsx
index afea38d0eb..447e93dccf 100644
--- a/packages/views/autopilots/components/autopilot-dialog.tsx
+++ b/packages/views/autopilots/components/autopilot-dialog.tsx
@@ -57,6 +57,7 @@ import {
type TriggerConfig,
type TriggerFrequency,
} from "./trigger-config";
+import { useT } from "../../i18n";
// ---------------------------------------------------------------------------
// Types
@@ -87,26 +88,26 @@ export type AutopilotDialogProps =
};
// ---------------------------------------------------------------------------
-// Static data
+// Static schema-level data (not user-visible)
// ---------------------------------------------------------------------------
-const FREQUENCY_OPTIONS: { value: TriggerFrequency; label: string }[] = [
- { value: "hourly", label: "Every hour" },
- { value: "daily", label: "Every day" },
- { value: "weekdays", label: "Every weekday" },
- { value: "weekly", label: "Every week" },
- { value: "custom", label: "Custom cron" },
+const FREQUENCY_KEYS: TriggerFrequency[] = [
+ "hourly",
+ "daily",
+ "weekdays",
+ "weekly",
+ "custom",
];
-const DAY_OPTIONS: { value: number; label: string; short: string }[] = [
- { value: 0, label: "Sunday", short: "Sun" },
- { value: 1, label: "Monday", short: "Mon" },
- { value: 2, label: "Tuesday", short: "Tue" },
- { value: 3, label: "Wednesday", short: "Wed" },
- { value: 4, label: "Thursday", short: "Thu" },
- { value: 5, label: "Friday", short: "Fri" },
- { value: 6, label: "Saturday", short: "Sat" },
-];
+const DAY_KEYS = [
+ "sunday",
+ "monday",
+ "tuesday",
+ "wednesday",
+ "thursday",
+ "friday",
+ "saturday",
+] as const;
const TIMEZONE_OPTIONS = [
"UTC",
@@ -129,25 +130,12 @@ const TIMEZONE_OPTIONS = [
"Pacific/Auckland",
];
-const OUTPUT_MODES: {
- value: AutopilotExecutionMode;
- label: string;
- description: string;
- Icon: typeof FilePlus2;
-}[] = [
- {
- value: "create_issue",
- label: "Create issue",
- description: "Each run creates a tracked issue",
- Icon: FilePlus2,
- },
- {
- value: "run_only",
- label: "Run only",
- description: "Silent run, no issue created",
- Icon: Play,
- },
-];
+const OUTPUT_MODE_KEYS: AutopilotExecutionMode[] = ["create_issue", "run_only"];
+
+const OUTPUT_MODE_ICONS: Record<AutopilotExecutionMode, typeof FilePlus2> = {
+ create_issue: FilePlus2,
+ run_only: Play,
+};
// ---------------------------------------------------------------------------
// Next-run computation (local approximation — server stores the authoritative value)
@@ -195,16 +183,19 @@ function computeNextRun(cfg: TriggerConfig, now: Date): Date | null {
}
}
-function formatCountdown(target: Date, now: Date): string {
- const diff = Math.max(0, target.getTime() - now.getTime());
- const seconds = Math.floor(diff / 1000);
- const days = Math.floor(seconds / 86400);
- const hours = Math.floor((seconds % 86400) / 3600);
- const minutes = Math.floor((seconds % 3600) / 60);
- if (days > 0) return `${days}d ${hours}h`;
- if (hours > 0) return `${hours}h ${minutes}m`;
- if (minutes > 0) return `${minutes}m`;
- return "<1m";
+function useFormatCountdown(): (target: Date, now: Date) => string {
+ const { t } = useT("autopilots");
+ return (target, now) => {
+ const diff = Math.max(0, target.getTime() - now.getTime());
+ const seconds = Math.floor(diff / 1000);
+ const days = Math.floor(seconds / 86400);
+ const hours = Math.floor((seconds % 86400) / 3600);
+ const minutes = Math.floor((seconds % 3600) / 60);
+ if (days > 0) return t(($) => $.trigger_config.countdown.days_hours, { days, hours });
+ if (hours > 0) return t(($) => $.trigger_config.countdown.hours_minutes, { hours, minutes });
+ if (minutes > 0) return t(($) => $.trigger_config.countdown.minutes, { minutes });
+ return t(($) => $.trigger_config.countdown.less_than_minute);
+ };
}
function formatNextRunAbsolute(date: Date, timezone: string): string {
@@ -241,6 +232,7 @@ function useNowTicker(intervalMs = 30_000): Date {
// ---------------------------------------------------------------------------
export function AutopilotDialog(props: AutopilotDialogProps) {
+ const { t } = useT("autopilots");
const { open, onOpenChange } = props;
const workspaceName = useCurrentWorkspace()?.name;
const wsId = useWorkspaceId();
@@ -322,8 +314,8 @@ export function AutopilotDialog(props: AutopilotDialogProps) {
scheduleOk = false;
}
onOpenChange(false);
- if (scheduleOk) toast.success("Autopilot created");
- else toast.error("Autopilot created, but schedule failed to save");
+ if (scheduleOk) toast.success(t(($) => $.dialog.toast_created));
+ else toast.error(t(($) => $.dialog.toast_create_partial));
} else {
await updateAutopilot.mutateAsync({
id: props.autopilotId,
@@ -356,11 +348,15 @@ export function AutopilotDialog(props: AutopilotDialogProps) {
}
}
onOpenChange(false);
- if (scheduleOk) toast.success("Autopilot updated");
- else toast.error("Autopilot updated, but schedule failed to save");
+ if (scheduleOk) toast.success(t(($) => $.dialog.toast_updated));
+ else toast.error(t(($) => $.dialog.toast_update_partial));
}
} catch {
- toast.error(isCreate ? "Failed to create autopilot" : "Failed to update autopilot");
+ toast.error(
+ isCreate
+ ? t(($) => $.dialog.toast_create_failed)
+ : t(($) => $.dialog.toast_update_failed),
+ );
} finally {
setSubmitting(false);
}
@@ -382,7 +378,7 @@ export function AutopilotDialog(props: AutopilotDialogProps) {
)}
>
<DialogTitle className="sr-only">
- {isCreate ? "New Autopilot" : "Edit Autopilot"}
+ {isCreate ? t(($) => $.dialog.sr_create) : t(($) => $.dialog.sr_edit)}
</DialogTitle>
{/* Header */}
@@ -393,11 +389,13 @@ export function AutopilotDialog(props: AutopilotDialogProps) {
<Rocket className="size-3" />
</span>
<span className="font-medium text-foreground">
- {isCreate ? "New autopilot" : "Edit autopilot"}
+ {isCreate
+ ? t(($) => $.dialog.header_create)
+ : t(($) => $.dialog.header_edit)}
</span>
</div>
<span className="text-muted-foreground/60">·</span>
- <span className="text-muted-foreground">A recurring AI task</span>
+ <span className="text-muted-foreground">{t(($) => $.dialog.subtitle)}</span>
{workspaceName && (
<>
<ChevronRight className="size-3 text-muted-foreground/40" />
@@ -417,7 +415,9 @@ export function AutopilotDialog(props: AutopilotDialogProps) {
</button>
}
/>
- <TooltipContent side="bottom">{isExpanded ? "Collapse" : "Expand"}</TooltipContent>
+ <TooltipContent side="bottom">
+ {isExpanded ? t(($) => $.dialog.collapse) : t(($) => $.dialog.expand)}
+ </TooltipContent>
</Tooltip>
<Tooltip>
<TooltipTrigger
@@ -430,7 +430,7 @@ export function AutopilotDialog(props: AutopilotDialogProps) {
</button>
}
/>
- <TooltipContent side="bottom">Close</TooltipContent>
+ <TooltipContent side="bottom">{t(($) => $.dialog.close)}</TooltipContent>
</Tooltip>
</div>
</div>
@@ -446,7 +446,7 @@ export function AutopilotDialog(props: AutopilotDialogProps) {
<TitleEditor
autoFocus={isCreate}
defaultValue={initial.title ?? ""}
- placeholder="Autopilot name"
+ placeholder={t(($) => $.dialog.title_placeholder)}
className="text-2xl font-semibold tracking-tight"
onChange={setTitle}
onSubmit={handleSubmit}
@@ -455,10 +455,10 @@ export function AutopilotDialog(props: AutopilotDialogProps) {
<div className="px-6 pb-2 shrink-0 flex items-baseline gap-2">
<span className="text-[11px] font-semibold tracking-[0.08em] text-muted-foreground uppercase">
- Runbook
+ {t(($) => $.dialog.runbook_label)}
</span>
<span className="text-xs text-muted-foreground/80">
- Read by the agent on every run
+ {t(($) => $.dialog.runbook_hint)}
</span>
</div>
@@ -466,7 +466,7 @@ export function AutopilotDialog(props: AutopilotDialogProps) {
<div className="h-full overflow-y-auto rounded-lg border border-border bg-background transition-colors focus-within:border-input px-4 py-3">
<ContentEditor
defaultValue={initial.description ?? ""}
- placeholder={`# Goal\nWhat should the agent accomplish?\n\n# Context\nWho is this for? Any constraints?\n\n# Steps\n1. …\n2. …`}
+ placeholder={t(($) => $.dialog.description_placeholder)}
onUpdate={setDescription}
debounceMs={300}
showBubbleMenu={false}
@@ -492,7 +492,7 @@ export function AutopilotDialog(props: AutopilotDialogProps) {
disabled={schedulePillDisabled}
disabledReason={
schedulePillDisabled
- ? "This autopilot has multiple schedules — edit them in the detail page."
+ ? t(($) => $.dialog.schedule_disabled_reason)
: undefined
}
/>
@@ -503,22 +503,20 @@ export function AutopilotDialog(props: AutopilotDialogProps) {
<div className="flex items-center justify-between gap-3 px-5 py-3 border-t shrink-0 bg-background">
<div className="flex items-center gap-1.5 text-xs text-muted-foreground min-w-0">
<Zap className="size-3.5 text-amber-500 shrink-0" />
- <span className="truncate">
- Once saved, runs automatically until paused.
- </span>
+ <span className="truncate">{t(($) => $.dialog.auto_run_hint)}</span>
</div>
<div className="flex items-center gap-2 shrink-0">
<Button size="sm" variant="outline" onClick={() => onOpenChange(false)}>
- Cancel
+ {t(($) => $.dialog.cancel)}
</Button>
<Button size="sm" onClick={handleSubmit} disabled={!canSubmit}>
{submitting
? isCreate
- ? "Creating..."
- : "Saving..."
+ ? t(($) => $.dialog.creating)
+ : t(($) => $.dialog.saving)
: isCreate
- ? "Create autopilot"
- : "Save"}
+ ? t(($) => $.dialog.create)
+ : t(($) => $.dialog.save)}
</Button>
</div>
</div>
@@ -550,9 +548,10 @@ function AgentSection({
selectedName?: string;
selectedDescription?: string;
}) {
+ const { t } = useT("autopilots");
return (
<div>
- <SectionLabel>Agent</SectionLabel>
+ <SectionLabel>{t(($) => $.dialog.section_agent)}</SectionLabel>
<AgentPicker
agentId={selectedId || null}
onChange={onChange}
@@ -579,7 +578,7 @@ function AgentSection({
)}
<span className="flex-1 min-w-0">
<span className="block text-sm font-medium truncate">
- {selectedName ?? "Select agent"}
+ {selectedName ?? t(($) => $.dialog.select_agent)}
</span>
{selectedDescription && (
<span className="block text-xs text-muted-foreground truncate">
@@ -602,17 +601,19 @@ function OutputModeSection({
mode: AutopilotExecutionMode;
onChange: (mode: AutopilotExecutionMode) => void;
}) {
+ const { t } = useT("autopilots");
return (
<div>
- <SectionLabel>Output mode</SectionLabel>
+ <SectionLabel>{t(($) => $.dialog.section_output_mode)}</SectionLabel>
<div className="space-y-1.5">
- {OUTPUT_MODES.map((o) => {
- const selected = o.value === mode;
+ {OUTPUT_MODE_KEYS.map((key) => {
+ const selected = key === mode;
+ const Icon = OUTPUT_MODE_ICONS[key];
return (
<button
- key={o.value}
+ key={key}
type="button"
- onClick={() => onChange(o.value)}
+ onClick={() => onChange(key)}
className={cn(
"w-full flex items-start gap-2.5 rounded-md border px-3 py-2 text-left cursor-pointer transition-colors",
selected
@@ -628,12 +629,18 @@ function OutputModeSection({
: "border-muted-foreground/40 bg-background",
)}
>
- {selected && <Check className="size-2.5" strokeWidth={3} />}
+ {selected ? (
+ <Check className="size-2.5" strokeWidth={3} />
+ ) : (
+ <Icon className="size-2.5 opacity-0" />
+ )}
</span>
<span className="flex-1 min-w-0">
- <span className="block text-sm font-medium">{o.label}</span>
+ <span className="block text-sm font-medium">
+ {t(($) => $.dialog.output_modes[key].label)}
+ </span>
<span className="block text-xs text-muted-foreground">
- {o.description}
+ {t(($) => $.dialog.output_modes[key].description)}
</span>
</span>
</button>
@@ -655,6 +662,8 @@ function ScheduleSection({
disabled?: boolean;
disabledReason?: string;
}) {
+ const { t } = useT("autopilots");
+ const formatCountdown = useFormatCountdown();
const now = useNowTicker();
const next = useMemo(() => computeNextRun(config, now), [config, now]);
const timezones = useMemo(() => {
@@ -667,7 +676,7 @@ function ScheduleSection({
return (
<div>
- <SectionLabel>Schedule</SectionLabel>
+ <SectionLabel>{t(($) => $.dialog.section_schedule)}</SectionLabel>
<div
className={cn(
"space-y-2",
@@ -686,9 +695,9 @@ function ScheduleSection({
<SelectValue />
</SelectTrigger>
<SelectContent>
- {FREQUENCY_OPTIONS.map((f) => (
- <SelectItem key={f.value} value={f.value}>
- {f.label}
+ {FREQUENCY_KEYS.map((freq) => (
+ <SelectItem key={freq} value={freq}>
+ {t(($) => $.dialog.frequency_long[freq])}
</SelectItem>
))}
</SelectContent>
@@ -704,9 +713,9 @@ function ScheduleSection({
<SelectValue />
</SelectTrigger>
<SelectContent>
- {DAY_OPTIONS.map((d) => (
- <SelectItem key={d.value} value={String(d.value)}>
- {d.label}
+ {DAY_KEYS.map((dayKey, i) => (
+ <SelectItem key={dayKey} value={String(i)}>
+ {t(($) => $.dialog.days[dayKey])}
</SelectItem>
))}
</SelectContent>
@@ -752,7 +761,7 @@ function ScheduleSection({
<div className="flex items-center gap-1.5 text-xs text-muted-foreground pt-1">
<Clock className="size-3 shrink-0" />
<span className="truncate">
- Next run:{" "}
+ {t(($) => $.dialog.next_run_label)}{" "}
<span className="text-foreground">
{formatNextRunAbsolute(next, config.timezone)}
</span>
diff --git a/packages/views/autopilots/components/autopilots-page.tsx b/packages/views/autopilots/components/autopilots-page.tsx
index 4faa33b8e7..05e785cddc 100644
--- a/packages/views/autopilots/components/autopilots-page.tsx
+++ b/packages/views/autopilots/components/autopilots-page.tsx
@@ -14,13 +14,24 @@ import { Skeleton } from "@multica/ui/components/ui/skeleton";
import { Button } from "@multica/ui/components/ui/button";
import { cn } from "@multica/ui/lib/utils";
import { AutopilotDialog } from "./autopilot-dialog";
-import type { Autopilot } from "@multica/core/types";
+import type { Autopilot, AutopilotStatus, AutopilotExecutionMode } from "@multica/core/types";
import type { TriggerFrequency } from "./trigger-config";
+import { useT } from "../../i18n";
+
+// Template-id keyed lookup for the i18n labels. Prompts stay raw English
+// because they're injected directly into the agent's task input — translating
+// them would also translate the agent's instructions.
+type TemplateId =
+ | "daily_news"
+ | "pr_review"
+ | "bug_triage"
+ | "weekly_progress"
+ | "dependency_audit"
+ | "documentation_check";
interface AutopilotTemplate {
- title: string;
+ id: TemplateId;
prompt: string;
- summary: string;
icon: typeof Zap;
frequency: TriggerFrequency;
time: string;
@@ -28,8 +39,7 @@ interface AutopilotTemplate {
const TEMPLATES: AutopilotTemplate[] = [
{
- title: "Daily news digest",
- summary: "Search and summarize today's news for the team",
+ id: "daily_news",
prompt: `1. Search the web for news and announcements published today only (strictly today's date)
2. Filter for topics relevant to our team and industry
3. For each item, write a short summary including: title, source, key takeaways
@@ -40,8 +50,7 @@ const TEMPLATES: AutopilotTemplate[] = [
time: "09:00",
},
{
- title: "PR review reminder",
- summary: "Flag stale pull requests that need review",
+ id: "pr_review",
prompt: `1. List all open pull requests in the repository
2. Identify PRs that have been open for more than 24 hours without a review
3. For each stale PR, note the author, age, and a one-line summary of the change
@@ -52,8 +61,7 @@ const TEMPLATES: AutopilotTemplate[] = [
time: "10:00",
},
{
- title: "Bug triage",
- summary: "Assess and prioritize new bug reports",
+ id: "bug_triage",
prompt: `1. List all issues with status "triage" or "backlog" that have not been prioritized
2. For each issue, read the description and any attached logs or screenshots
3. Assess severity (critical / high / medium / low) based on user impact and scope
@@ -64,8 +72,7 @@ const TEMPLATES: AutopilotTemplate[] = [
time: "09:00",
},
{
- title: "Weekly progress report",
- summary: "Compile a weekly summary of team progress",
+ id: "weekly_progress",
prompt: `1. Gather all issues completed (status "done") in the past 7 days
2. Gather all issues currently in progress
3. Identify any blocked issues and their blockers
@@ -77,8 +84,7 @@ const TEMPLATES: AutopilotTemplate[] = [
time: "17:00",
},
{
- title: "Dependency audit",
- summary: "Scan for security vulnerabilities and outdated packages",
+ id: "dependency_audit",
prompt: `1. Run dependency audit tools on the project (npm audit, go vuln check, etc.)
2. Identify any packages with known security vulnerabilities
3. List outdated packages that are more than 2 major versions behind
@@ -89,8 +95,7 @@ const TEMPLATES: AutopilotTemplate[] = [
time: "08:00",
},
{
- title: "Documentation check",
- summary: "Review recent changes for documentation gaps",
+ id: "documentation_check",
prompt: `1. List all code changes merged in the past 7 days (via git log)
2. For each significant change, check if related documentation was updated
3. Identify any new APIs, config options, or features missing documentation
@@ -102,32 +107,33 @@ const TEMPLATES: AutopilotTemplate[] = [
},
];
-function formatRelativeDate(date: string): string {
- const diff = Date.now() - new Date(date).getTime();
- const days = Math.floor(diff / (1000 * 60 * 60 * 24));
- if (days < 1) return "Today";
- if (days === 1) return "1d ago";
- if (days < 30) return `${days}d ago`;
- const months = Math.floor(days / 30);
- return `${months}mo ago`;
+// Hook returning a localized "1d ago / Today" formatter for the row's last_run cell.
+function useFormatRelativeDate(): (date: string) => string {
+ const { t } = useT("autopilots");
+ return (date: string) => {
+ const diff = Date.now() - new Date(date).getTime();
+ const days = Math.floor(diff / (1000 * 60 * 60 * 24));
+ if (days < 1) return t(($) => $.relative_date.today);
+ if (days === 1) return t(($) => $.relative_date.one_day_ago);
+ if (days < 30) return t(($) => $.relative_date.days_ago, { count: days });
+ const months = Math.floor(days / 30);
+ return t(($) => $.relative_date.months_ago, { count: months });
+ };
}
-const STATUS_CONFIG: Record<string, { label: string; color: string; icon: typeof Zap }> = {
- active: { label: "Active", color: "text-emerald-500", icon: Play },
- paused: { label: "Paused", color: "text-amber-500", icon: Pause },
- archived: { label: "Archived", color: "text-muted-foreground", icon: AlertCircle },
-};
-
-const EXECUTION_MODE_LABELS: Record<string, string> = {
- create_issue: "Create Issue",
- run_only: "Run Only",
+const STATUS_VISUAL: Record<AutopilotStatus, { color: string; icon: typeof Zap }> = {
+ active: { color: "text-emerald-500", icon: Play },
+ paused: { color: "text-amber-500", icon: Pause },
+ archived: { color: "text-muted-foreground", icon: AlertCircle },
};
function AutopilotRow({ autopilot }: { autopilot: Autopilot }) {
+ const { t } = useT("autopilots");
const { getActorName } = useActorName();
const wsPaths = useWorkspacePaths();
- const statusCfg = (STATUS_CONFIG[autopilot.status] ?? STATUS_CONFIG["active"])!;
- const StatusIcon = statusCfg.icon;
+ const formatRelativeDate = useFormatRelativeDate();
+ const visual = STATUS_VISUAL[autopilot.status as AutopilotStatus] ?? STATUS_VISUAL.active;
+ const StatusIcon = visual.icon;
return (
<div className="group/row flex flex-col gap-2 border-b px-4 py-3 text-sm transition-colors hover:bg-accent/40 sm:h-11 sm:flex-row sm:items-center sm:gap-2 sm:border-b-0 sm:px-5 sm:py-0">
@@ -150,18 +156,18 @@ function AutopilotRow({ autopilot }: { autopilot: Autopilot }) {
{/* Mode */}
<span className="text-muted-foreground sm:w-24 sm:shrink-0 sm:text-center">
- {EXECUTION_MODE_LABELS[autopilot.execution_mode] ?? autopilot.execution_mode}
+ {t(($) => $.execution_mode[autopilot.execution_mode as AutopilotExecutionMode])}
</span>
{/* Status */}
- <span className={cn("flex items-center gap-1 sm:w-20 sm:shrink-0 sm:justify-center", statusCfg.color)}>
+ <span className={cn("flex items-center gap-1 sm:w-20 sm:shrink-0 sm:justify-center", visual.color)}>
<StatusIcon className="h-3 w-3" />
- {statusCfg.label}
+ {t(($) => $.status[autopilot.status as AutopilotStatus])}
</span>
{/* Last run */}
<span className="text-muted-foreground tabular-nums sm:w-20 sm:shrink-0 sm:text-right">
- {autopilot.last_run_at ? formatRelativeDate(autopilot.last_run_at) : "--"}
+ {autopilot.last_run_at ? formatRelativeDate(autopilot.last_run_at) : t(($) => $.page.last_run_empty)}
</span>
</div>
</div>
@@ -169,6 +175,7 @@ function AutopilotRow({ autopilot }: { autopilot: Autopilot }) {
}
export function AutopilotsPage() {
+ const { t } = useT("autopilots");
const wsId = useWorkspaceId();
const { data: autopilots = [], isLoading } = useQuery(autopilotListOptions(wsId));
const [createOpen, setCreateOpen] = useState(false);
@@ -185,14 +192,14 @@ export function AutopilotsPage() {
<PageHeader className="justify-between px-5">
<div className="flex items-center gap-2">
<Zap className="h-4 w-4 text-muted-foreground" />
- <h1 className="text-sm font-medium">Autopilot</h1>
+ <h1 className="text-sm font-medium">{t(($) => $.page.title)}</h1>
{!isLoading && autopilots.length > 0 && (
<span className="text-xs text-muted-foreground tabular-nums">{autopilots.length}</span>
)}
</div>
<Button size="sm" variant="outline" onClick={() => openCreate()}>
<Plus className="h-3.5 w-3.5 mr-1" />
- New autopilot
+ {t(($) => $.page.new_autopilot)}
</Button>
</PageHeader>
@@ -217,24 +224,28 @@ export function AutopilotsPage() {
) : autopilots.length === 0 ? (
<div className="flex flex-col items-center py-16 px-5">
<Zap className="h-10 w-10 mb-3 text-muted-foreground opacity-30" />
- <p className="text-sm text-muted-foreground">No autopilots yet</p>
+ <p className="text-sm text-muted-foreground">{t(($) => $.page.empty.title)}</p>
<p className="text-xs text-muted-foreground mt-1 mb-6">
- Schedule recurring tasks for your AI agents. Pick a template or start from scratch.
+ {t(($) => $.page.empty.hint)}
</p>
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 w-full max-w-3xl">
- {TEMPLATES.map((t) => {
- const Icon = t.icon;
+ {TEMPLATES.map((tpl) => {
+ const Icon = tpl.icon;
return (
<button
- key={t.title}
+ key={tpl.id}
type="button"
className="flex items-start gap-3 rounded-lg border p-3 text-left transition-colors hover:bg-accent/40"
- onClick={() => openCreate(t)}
+ onClick={() => openCreate(tpl)}
>
<Icon className="h-5 w-5 shrink-0 text-muted-foreground mt-0.5" />
<div className="min-w-0">
- <div className="text-sm font-medium">{t.title}</div>
- <div className="text-xs text-muted-foreground mt-0.5 line-clamp-2">{t.summary}</div>
+ <div className="text-sm font-medium">
+ {t(($) => $.templates[tpl.id].title)}
+ </div>
+ <div className="text-xs text-muted-foreground mt-0.5 line-clamp-2">
+ {t(($) => $.templates[tpl.id].summary)}
+ </div>
</div>
</button>
);
@@ -242,7 +253,7 @@ export function AutopilotsPage() {
</div>
<Button size="sm" variant="outline" className="mt-4" onClick={() => openCreate()}>
<Plus className="h-3.5 w-3.5 mr-1" />
- Start from scratch
+ {t(($) => $.page.start_blank)}
</Button>
</div>
) : (
@@ -250,11 +261,11 @@ export function AutopilotsPage() {
{/* Column headers */}
<div className="sticky top-0 z-[1] hidden h-8 items-center gap-2 border-b bg-muted/30 px-5 text-xs font-medium text-muted-foreground sm:flex">
<span className="shrink-0 w-4" />
- <span className="min-w-0 flex-1">Name</span>
- <span className="w-32 shrink-0">Agent</span>
- <span className="w-24 text-center shrink-0">Mode</span>
- <span className="w-20 text-center shrink-0">Status</span>
- <span className="w-20 text-right shrink-0">Last run</span>
+ <span className="min-w-0 flex-1">{t(($) => $.page.table.name)}</span>
+ <span className="w-32 shrink-0">{t(($) => $.page.table.agent)}</span>
+ <span className="w-24 text-center shrink-0">{t(($) => $.page.table.mode)}</span>
+ <span className="w-20 text-center shrink-0">{t(($) => $.page.table.status)}</span>
+ <span className="w-20 text-right shrink-0">{t(($) => $.page.table.last_run)}</span>
</div>
{autopilots.map((autopilot) => (
<AutopilotRow key={autopilot.id} autopilot={autopilot} />
@@ -270,7 +281,13 @@ export function AutopilotsPage() {
onOpenChange={setCreateOpen}
initial={
selectedTemplate
- ? { title: selectedTemplate.title, description: selectedTemplate.prompt }
+ ? {
+ // Template title pulls from i18n so the user-visible default
+ // matches their locale, while the prompt body stays raw EN
+ // since it's injected directly into the agent task.
+ title: t(($) => $.templates[selectedTemplate.id].title),
+ description: selectedTemplate.prompt,
+ }
: undefined
}
initialTriggerConfig={
diff --git a/packages/views/autopilots/components/pickers/agent-picker.tsx b/packages/views/autopilots/components/pickers/agent-picker.tsx
index b4b42a1e59..2be2274e3c 100644
--- a/packages/views/autopilots/components/pickers/agent-picker.tsx
+++ b/packages/views/autopilots/components/pickers/agent-picker.tsx
@@ -11,6 +11,7 @@ import {
PickerItem,
PickerEmpty,
} from "../../../issues/components/pickers/property-picker";
+import { useT } from "../../../i18n";
export function AgentPicker({
agentId,
@@ -25,6 +26,7 @@ export function AgentPicker({
triggerRender?: React.ReactElement;
align?: "start" | "center" | "end";
}) {
+ const { t } = useT("autopilots");
const wsId = useWorkspaceId();
const [open, setOpen] = useState(false);
const [filter, setFilter] = useState("");
@@ -44,7 +46,7 @@ export function AgentPicker({
width="w-56"
align={align}
searchable
- searchPlaceholder="Filter agents..."
+ searchPlaceholder={t(($) => $.agent_picker.filter_placeholder)}
onSearchChange={setFilter}
triggerRender={triggerRender}
trigger={
@@ -58,7 +60,7 @@ export function AgentPicker({
) : (
<>
<Bot className="size-3" />
- <span>Select agent</span>
+ <span>{t(($) => $.agent_picker.select_agent)}</span>
</>
)}
</>
diff --git a/packages/views/autopilots/components/pickers/timezone-picker.tsx b/packages/views/autopilots/components/pickers/timezone-picker.tsx
index e4ee90ee8f..4272c25c46 100644
--- a/packages/views/autopilots/components/pickers/timezone-picker.tsx
+++ b/packages/views/autopilots/components/pickers/timezone-picker.tsx
@@ -7,6 +7,7 @@ import {
PropertyPicker,
PickerEmpty,
} from "../../../issues/components/pickers/property-picker";
+import { useT } from "../../../i18n";
export interface TimezonePickerProps {
value: string;
@@ -40,6 +41,7 @@ export function TimezonePicker({
disabled,
className,
}: TimezonePickerProps) {
+ const { t } = useT("autopilots");
const [open, setOpen] = useState(false);
const [filter, setFilter] = useState("");
@@ -65,7 +67,7 @@ export function TimezonePicker({
width="w-64"
align="start"
searchable
- searchPlaceholder="Search timezone..."
+ searchPlaceholder={t(($) => $.timezone_picker.search_placeholder)}
onSearchChange={setFilter}
triggerRender={
<button
diff --git a/packages/views/autopilots/components/trigger-config.tsx b/packages/views/autopilots/components/trigger-config.tsx
index 382e31c45a..41dde28b10 100644
--- a/packages/views/autopilots/components/trigger-config.tsx
+++ b/packages/views/autopilots/components/trigger-config.tsx
@@ -9,6 +9,7 @@ import {
SelectContent,
SelectItem,
} from "@multica/ui/components/ui/select";
+import { useT } from "../../i18n";
export type TriggerFrequency = "hourly" | "daily" | "weekdays" | "weekly" | "custom";
@@ -21,18 +22,18 @@ export interface TriggerConfig {
}
// ---------------------------------------------------------------------------
-// Constants
+// Constants — schema-level (not user-visible)
// ---------------------------------------------------------------------------
-const FREQUENCIES: { value: TriggerFrequency; label: string }[] = [
- { value: "hourly", label: "Hourly" },
- { value: "daily", label: "Daily" },
- { value: "weekdays", label: "Weekdays" },
- { value: "weekly", label: "Days" },
- { value: "custom", label: "Custom" },
+const FREQUENCY_KEYS: TriggerFrequency[] = [
+ "hourly",
+ "daily",
+ "weekdays",
+ "weekly",
+ "custom",
];
-const DAYS_OF_WEEK = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
+const DAY_SHORT_KEYS = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"] as const;
const COMMON_TIMEZONES = [
"UTC",
@@ -112,12 +113,6 @@ function sortedDays(days: number[]): number[] {
return [...new Set(days)].sort((a, b) => a - b);
}
-function formatDayList(days: number[]): string {
- const sorted = sortedDays(days);
- if (sorted.length === 0) return "—";
- return sorted.map((d) => DAYS_OF_WEEK[d]).join(", ");
-}
-
export function toCronExpression(cfg: TriggerConfig): string {
const [h, m] = cfg.time.split(":");
const hour = parseInt(h ?? "9", 10);
@@ -173,39 +168,80 @@ export function parseCronExpression(cron: string, timezone: string): TriggerConf
return { ...base, frequency: "custom" };
}
-export function summarizeTrigger(cfg: TriggerConfig): string {
- switch (cfg.frequency) {
- case "hourly": {
- const min = cfg.time.split(":")[1] ?? "00";
- return `Hourly · :${min}`;
+// ---------------------------------------------------------------------------
+// Hooks (i18n-aware)
+// ---------------------------------------------------------------------------
+
+// Hook returning a function that produces the compact "Hourly · :15 / Daily 09:00"
+// summary. Was a pure module-level function before i18n; converted to a hook so
+// the strings can flow through useT.
+export function useSummarizeTrigger(): (cfg: TriggerConfig) => string {
+ const { t } = useT("autopilots");
+ return (cfg) => {
+ switch (cfg.frequency) {
+ case "hourly": {
+ const min = cfg.time.split(":")[1] ?? "00";
+ return t(($) => $.trigger_config.summary.hourly, { min });
+ }
+ case "daily":
+ return t(($) => $.trigger_config.summary.daily, { time: cfg.time });
+ case "weekdays":
+ return t(($) => $.trigger_config.summary.weekdays, { time: cfg.time });
+ case "weekly":
+ return t(($) => $.trigger_config.summary.weekly, {
+ days: formatDayList(cfg.daysOfWeek, t),
+ time: cfg.time,
+ });
+ case "custom":
+ return t(($) => $.trigger_config.summary.custom);
}
- case "daily":
- return `Daily ${cfg.time}`;
- case "weekdays":
- return `Weekdays ${cfg.time}`;
- case "weekly":
- return `${formatDayList(cfg.daysOfWeek)} ${cfg.time}`;
- case "custom":
- return "Custom cron";
- }
+ };
}
-export function describeTrigger(cfg: TriggerConfig): string {
- const offset = getTimezoneOffset(cfg.timezone);
- switch (cfg.frequency) {
- case "hourly": {
- const min = parseInt(cfg.time.split(":")[1] ?? "0", 10);
- return `Runs every hour at :${min.toString().padStart(2, "0")}`;
+// Hook returning a function that produces the longer "Runs daily at 9:00 AM PDT"
+// description. Same rationale as useSummarizeTrigger.
+export function useDescribeTrigger(): (cfg: TriggerConfig) => string {
+ const { t } = useT("autopilots");
+ return (cfg) => {
+ const offset = getTimezoneOffset(cfg.timezone);
+ switch (cfg.frequency) {
+ case "hourly": {
+ const min = parseInt(cfg.time.split(":")[1] ?? "0", 10).toString().padStart(2, "0");
+ return t(($) => $.trigger_config.describe.hourly, { min });
+ }
+ case "daily":
+ return t(($) => $.trigger_config.describe.daily, {
+ time: formatTime12h(cfg.time),
+ offset,
+ });
+ case "weekdays":
+ return t(($) => $.trigger_config.describe.weekdays, {
+ time: formatTime12h(cfg.time),
+ offset,
+ });
+ case "weekly":
+ return t(($) => $.trigger_config.describe.weekly, {
+ days: formatDayList(cfg.daysOfWeek, t),
+ time: formatTime12h(cfg.time),
+ offset,
+ });
+ case "custom":
+ return t(($) => $.trigger_config.describe.custom, {
+ cron: cfg.cronExpression,
+ });
}
- case "daily":
- return `Runs daily at ${formatTime12h(cfg.time)} ${offset}`;
- case "weekdays":
- return `Runs weekdays at ${formatTime12h(cfg.time)} ${offset}`;
- case "weekly":
- return `Runs every ${formatDayList(cfg.daysOfWeek)} at ${formatTime12h(cfg.time)} ${offset}`;
- case "custom":
- return `Custom schedule: ${cfg.cronExpression}`;
- }
+ };
+}
+
+// Helper that resolves day-short labels through t() — extracted so the two
+// hooks above can share the join logic without each grabbing its own t.
+type AutopilotsT = ReturnType<typeof useT<"autopilots">>["t"];
+function formatDayList(days: number[], t: AutopilotsT): string {
+ const sorted = sortedDays(days);
+ if (sorted.length === 0) return t(($) => $.trigger_config.summary.no_days);
+ return sorted
+ .map((d) => t(($) => $.trigger_config.days_short[DAY_SHORT_KEYS[d]!]))
+ .join(", ");
}
// ---------------------------------------------------------------------------
@@ -219,6 +255,8 @@ export function TriggerConfigSection({
config: TriggerConfig;
onChange: (config: TriggerConfig) => void;
}) {
+ const { t } = useT("autopilots");
+ const describeTrigger = useDescribeTrigger();
const timezones = useMemo(() => {
const local = getLocalTimezone();
const set = new Set(COMMON_TIMEZONES);
@@ -229,19 +267,19 @@ export function TriggerConfigSection({
<div className="space-y-3">
{/* Frequency tabs */}
<div className="flex flex-wrap gap-1">
- {FREQUENCIES.map((f) => (
+ {FREQUENCY_KEYS.map((freq) => (
<button
- key={f.value}
+ key={freq}
type="button"
className={cn(
"rounded-md px-3 py-1.5 text-xs font-medium transition-colors",
- config.frequency === f.value
+ config.frequency === freq
? "bg-foreground text-background"
: "bg-muted text-muted-foreground hover:text-foreground",
)}
- onClick={() => onChange({ ...config, frequency: f.value })}
+ onClick={() => onChange({ ...config, frequency: freq })}
>
- {f.label}
+ {t(($) => $.trigger_config.frequencies[freq])}
</button>
))}
</div>
@@ -249,7 +287,9 @@ export function TriggerConfigSection({
{config.frequency === "custom" ? (
/* Custom cron input */
<div>
- <label className="text-xs text-muted-foreground">Cron Expression</label>
+ <label className="text-xs text-muted-foreground">
+ {t(($) => $.trigger_config.cron_label)}
+ </label>
<input
type="text"
value={config.cronExpression}
@@ -258,7 +298,7 @@ export function TriggerConfigSection({
className="mt-1 w-full rounded-md border bg-background px-3 py-2 text-sm font-mono outline-none focus:ring-1 focus:ring-ring"
/>
<p className="text-xs text-muted-foreground mt-1">
- Standard 5-field cron (min hour dom month dow)
+ {t(($) => $.trigger_config.cron_hint)}
</p>
</div>
) : (
@@ -267,7 +307,9 @@ export function TriggerConfigSection({
<div className="flex gap-3">
{config.frequency === "hourly" ? (
<div className="w-24">
- <label className="text-xs text-muted-foreground">Minute</label>
+ <label className="text-xs text-muted-foreground">
+ {t(($) => $.trigger_config.minute_label)}
+ </label>
<input
type="number"
min={0}
@@ -283,7 +325,9 @@ export function TriggerConfigSection({
) : (
<>
<div className="w-28">
- <label className="text-xs text-muted-foreground">Time</label>
+ <label className="text-xs text-muted-foreground">
+ {t(($) => $.trigger_config.time_label)}
+ </label>
<input
type="time"
value={config.time}
@@ -292,7 +336,9 @@ export function TriggerConfigSection({
/>
</div>
<div className="flex-1 min-w-0">
- <label className="text-xs text-muted-foreground">Timezone</label>
+ <label className="text-xs text-muted-foreground">
+ {t(($) => $.trigger_config.timezone_label)}
+ </label>
<Select
value={config.timezone}
onValueChange={(v) => v && onChange({ ...config, timezone: v })}
@@ -318,13 +364,15 @@ export function TriggerConfigSection({
{/* Day-of-week multi-selector for weekly */}
{config.frequency === "weekly" && (
<div>
- <label className="text-xs text-muted-foreground">Days</label>
+ <label className="text-xs text-muted-foreground">
+ {t(($) => $.trigger_config.days_label)}
+ </label>
<div className="flex gap-1 mt-1">
- {DAYS_OF_WEEK.map((day, i) => {
+ {DAY_SHORT_KEYS.map((dayKey, i) => {
const selected = config.daysOfWeek.includes(i);
return (
<button
- key={day}
+ key={dayKey}
type="button"
aria-pressed={selected}
className={cn(
@@ -344,7 +392,7 @@ export function TriggerConfigSection({
});
}}
>
- {day}
+ {t(($) => $.trigger_config.days_short[dayKey])}
</button>
);
})}
diff --git a/packages/views/chat/components/chat-fab.tsx b/packages/views/chat/components/chat-fab.tsx
index 797fca6496..2e17e11581 100644
--- a/packages/views/chat/components/chat-fab.tsx
+++ b/packages/views/chat/components/chat-fab.tsx
@@ -12,10 +12,12 @@ import {
TooltipTrigger,
TooltipContent,
} from "@multica/ui/components/ui/tooltip";
+import { useT } from "../../i18n";
const logger = createLogger("chat.ui");
export function ChatFab() {
+ const { t } = useT("chat");
const wsId = useWorkspaceId();
const isOpen = useChatStore((s) => s.isOpen);
const toggle = useChatStore((s) => s.toggle);
@@ -34,10 +36,10 @@ export function ChatFab() {
// Tooltip text communicates the state that isn't carried by the icon/badge.
const tooltip = isRunning
- ? "Multica is working..."
+ ? t(($) => $.fab.running)
: unreadSessionCount > 0
- ? `${unreadSessionCount} unread ${unreadSessionCount === 1 ? "chat" : "chats"}`
- : "Ask Multica";
+ ? t(($) => $.fab.unread, { count: unreadSessionCount })
+ : t(($) => $.fab.default);
return (
<Tooltip>
diff --git a/packages/views/chat/components/chat-input.tsx b/packages/views/chat/components/chat-input.tsx
index 8d3cc03291..e670aee33c 100644
--- a/packages/views/chat/components/chat-input.tsx
+++ b/packages/views/chat/components/chat-input.tsx
@@ -7,6 +7,7 @@ import { ContentEditor, type ContentEditorRef } from "../../editor";
import { SubmitButton } from "@multica/ui/components/common/submit-button";
import { useChatStore, DRAFT_NEW_SESSION } from "@multica/core/chat";
import { createLogger } from "@multica/core/logger";
+import { useT } from "../../i18n";
const logger = createLogger("chat.ui");
@@ -41,6 +42,7 @@ export function ChatInput({
rightAdornment,
topSlot,
}: ChatInputProps) {
+ const { t } = useT("chat");
const editorRef = useRef<ContentEditorRef>(null);
const activeSessionId = useChatStore((s) => s.activeSessionId);
const selectedAgentId = useChatStore((s) => s.selectedAgentId);
@@ -89,12 +91,12 @@ export function ChatInput({
};
const placeholder = noAgent
- ? "Create an agent to start chatting"
+ ? t(($) => $.input.placeholder_no_agent)
: disabled
- ? "This session is archived"
+ ? t(($) => $.input.placeholder_archived)
: agentName
- ? `Tell ${agentName} what to do…`
- : "Tell me what to do…";
+ ? t(($) => $.input.placeholder_named, { name: agentName })
+ : t(($) => $.input.placeholder_default);
return (
<div
diff --git a/packages/views/chat/components/chat-message-list.tsx b/packages/views/chat/components/chat-message-list.tsx
index 3f308f9d83..b7aa4e5558 100644
--- a/packages/views/chat/components/chat-message-list.tsx
+++ b/packages/views/chat/components/chat-message-list.tsx
@@ -20,6 +20,7 @@ import type { ChatTimelineItem } from "@multica/core/chat";
import { failureReasonLabel } from "../../agents/components/tabs/task-failure";
import { TaskStatusPill } from "./task-status-pill";
import { formatElapsedMs } from "../lib/format";
+import { useT } from "../../i18n";
// ─── Public component ────────────────────────────────────────────────────
@@ -193,7 +194,7 @@ function AssistantMessage({
</div>
)}
{message.elapsed_ms != null && (
- <ElapsedCaption verb="Replied in" elapsedMs={message.elapsed_ms} />
+ <ElapsedCaption variant="replied" elapsedMs={message.elapsed_ms} />
)}
</div>
);
@@ -205,17 +206,22 @@ function AssistantMessage({
// and devices. Skipped silently when null (legacy messages predating
// migration 063 + user messages).
function ElapsedCaption({
- verb,
+ variant,
elapsedMs,
className,
}: {
- verb: string;
+ variant: "replied" | "failed";
elapsedMs: number;
className?: string;
}) {
+ const { t } = useT("chat");
+ const text =
+ variant === "replied"
+ ? t(($) => $.message_list.replied_in, { elapsed: formatElapsedMs(elapsedMs) })
+ : t(($) => $.message_list.failed_after, { elapsed: formatElapsedMs(elapsedMs) });
return (
<div className={cn("text-[11px] text-muted-foreground/80", className)}>
- {verb} {formatElapsedMs(elapsedMs)}
+ {text}
</div>
);
}
@@ -231,12 +237,14 @@ function FailureBubble({
timeline: ChatTimelineItem[];
elapsedMs?: number | null;
}) {
+ const { t } = useT("chat");
const [open, setOpen] = useState(false);
// Map the back-end enum to copy via the shared label table; an unknown
// reason (e.g. a future enum value the front-end doesn't ship yet)
- // falls back to a generic "Task failed" so we never render a bare slug.
+ // falls back to a generic translated label.
const label =
- failureReasonLabel[reason as TaskFailureReason] ?? "Task failed";
+ failureReasonLabel[reason as TaskFailureReason] ??
+ t(($) => $.message_list.task_failed_fallback);
return (
<div className="w-full space-y-1.5">
@@ -257,7 +265,7 @@ function FailureBubble({
) : (
<ChevronRight className="size-3" />
)}
- <span>Show details</span>
+ <span>{t(($) => $.message_list.show_details)}</span>
</CollapsibleTrigger>
<CollapsibleContent>
<pre className="mt-1 max-h-40 overflow-auto rounded bg-muted/40 p-2 text-[11px] text-muted-foreground whitespace-pre-wrap break-all">
@@ -270,7 +278,7 @@ function FailureBubble({
</div>
{timeline.length > 0 && <TimelineView items={timeline} />}
{elapsedMs != null && (
- <ElapsedCaption verb="Failed after" elapsedMs={elapsedMs} />
+ <ElapsedCaption variant="failed" elapsedMs={elapsedMs} />
)}
</div>
);
@@ -346,9 +354,10 @@ function ToolGroupCollapsible({
items: ChatTimelineItem[];
defaultOpen?: boolean;
}) {
+ const { t } = useT("chat");
const [open, setOpen] = useState(defaultOpen ?? false);
const toolCount = items.filter((i) => i.type === "tool_use").length;
- const label = `${toolCount} ${toolCount === 1 ? "tool" : "tools"}`;
+ const label = t(($) => $.message_list.tools, { count: toolCount });
return (
<Collapsible open={open} onOpenChange={setOpen}>
@@ -443,11 +452,15 @@ function ToolCallRow({ item }: { item: ChatTimelineItem }) {
}
function ToolResultRow({ item }: { item: ChatTimelineItem }) {
+ const { t } = useT("chat");
const [open, setOpen] = useState(false);
const output = item.output ?? "";
if (!output) return null;
const preview = output.length > 120 ? output.slice(0, 120) + "..." : output;
+ const labelPrefix = item.tool
+ ? t(($) => $.message_list.tool_result_named, { tool: item.tool })
+ : t(($) => $.message_list.tool_result_unnamed);
return (
<Collapsible open={open} onOpenChange={setOpen}>
@@ -456,7 +469,7 @@ function ToolResultRow({ item }: { item: ChatTimelineItem }) {
className={cn("h-3 w-3 shrink-0 text-muted-foreground transition-transform mt-0.5", open && "rotate-90")}
/>
<span className="text-muted-foreground/70 truncate">
- {item.tool ? `${item.tool} result: ` : "result: "}{preview}
+ {labelPrefix}{preview}
</span>
</CollapsibleTrigger>
<CollapsibleContent>
diff --git a/packages/views/chat/components/chat-session-history.tsx b/packages/views/chat/components/chat-session-history.tsx
index 5b021c51fe..67a4febea8 100644
--- a/packages/views/chat/components/chat-session-history.tsx
+++ b/packages/views/chat/components/chat-session-history.tsx
@@ -24,10 +24,12 @@ import { useChatStore } from "@multica/core/chat";
import { useDeleteChatSession } from "@multica/core/chat/mutations";
import { createLogger } from "@multica/core/logger";
import type { ChatSession, Agent } from "@multica/core/types";
+import { useT } from "../../i18n";
const logger = createLogger("chat.ui");
export function ChatSessionHistory() {
+ const { t } = useT("chat");
const wsId = useWorkspaceId();
const setShowHistory = useChatStore((s) => s.setShowHistory);
const setActiveSession = useChatStore((s) => s.setActiveSession);
@@ -86,9 +88,9 @@ export function ChatSessionHistory() {
>
<ArrowLeft />
</TooltipTrigger>
- <TooltipContent side="bottom">Back</TooltipContent>
+ <TooltipContent side="bottom">{t(($) => $.session_history.back_tooltip)}</TooltipContent>
</Tooltip>
- <span className="text-sm font-medium">Chat History</span>
+ <span className="text-sm font-medium">{t(($) => $.session_history.header)}</span>
</div>
{/* Session list */}
@@ -96,7 +98,7 @@ export function ChatSessionHistory() {
{sessions.length === 0 ? (
<div className="flex flex-col items-center justify-center gap-2 py-12 text-muted-foreground">
<MessageSquare className="size-6" />
- <span className="text-sm">No chat sessions yet</span>
+ <span className="text-sm">{t(($) => $.session_history.empty)}</span>
</div>
) : (
<div>
@@ -122,22 +124,25 @@ export function ChatSessionHistory() {
>
<AlertDialogContent>
<AlertDialogHeader>
- <AlertDialogTitle>Delete chat session</AlertDialogTitle>
+ <AlertDialogTitle>{t(($) => $.session_history.delete_dialog.title)}</AlertDialogTitle>
<AlertDialogDescription>
{pendingDelete?.title
- ? `"${pendingDelete.title}" and its messages will be permanently removed.`
- : "This chat session and its messages will be permanently removed."}
- {" "}This action cannot be undone.
+ ? t(($) => $.session_history.delete_dialog.description_with_title, { title: pendingDelete.title })
+ : t(($) => $.session_history.delete_dialog.description_default)}
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
- <AlertDialogCancel disabled={deleteSession.isPending}>Cancel</AlertDialogCancel>
+ <AlertDialogCancel disabled={deleteSession.isPending}>
+ {t(($) => $.session_history.delete_dialog.cancel)}
+ </AlertDialogCancel>
<AlertDialogAction
onClick={handleConfirmDelete}
disabled={deleteSession.isPending}
className="bg-destructive text-white hover:bg-destructive/90"
>
- {deleteSession.isPending ? "Deleting..." : "Delete"}
+ {deleteSession.isPending
+ ? t(($) => $.session_history.delete_dialog.confirming)
+ : t(($) => $.session_history.delete_dialog.confirm)}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
@@ -146,6 +151,24 @@ export function ChatSessionHistory() {
);
}
+function useFormatTimeAgo(): (dateStr: string) => string {
+ const { t } = useT("chat");
+ return (dateStr: string) => {
+ const date = new Date(dateStr);
+ const now = new Date();
+ const diffMs = now.getTime() - date.getTime();
+ const diffMins = Math.floor(diffMs / 60000);
+ const diffHours = Math.floor(diffMs / 3600000);
+ const diffDays = Math.floor(diffMs / 86400000);
+
+ if (diffMins < 1) return t(($) => $.session_history.time.just_now);
+ if (diffMins < 60) return t(($) => $.session_history.time.minutes, { count: diffMins });
+ if (diffHours < 24) return t(($) => $.session_history.time.hours, { count: diffHours });
+ if (diffDays < 7) return t(($) => $.session_history.time.days, { count: diffDays });
+ return date.toLocaleDateString();
+ };
+}
+
function SessionItem({
session,
agent,
@@ -159,6 +182,8 @@ function SessionItem({
onSelect: () => void;
onRequestDelete: () => void;
}) {
+ const { t } = useT("chat");
+ const formatTimeAgo = useFormatTimeAgo();
const timeAgo = formatTimeAgo(session.updated_at);
return (
@@ -182,7 +207,7 @@ function SessionItem({
<div className="min-w-0 flex-1">
<div className="flex items-center gap-2">
<span className="truncate text-sm font-medium">
- {session.title || "Untitled"}
+ {session.title || t(($) => $.session_history.untitled)}
</span>
</div>
<div className="flex items-center gap-1.5 mt-0.5">
@@ -206,29 +231,14 @@ function SessionItem({
e.stopPropagation();
onRequestDelete();
}}
- aria-label="Delete chat session"
+ aria-label={t(($) => $.session_history.row_delete_aria)}
/>
}
>
<Trash2 className="size-3.5" />
</TooltipTrigger>
- <TooltipContent side="left">Delete</TooltipContent>
+ <TooltipContent side="left">{t(($) => $.session_history.row_delete_tooltip)}</TooltipContent>
</Tooltip>
</div>
);
}
-
-function formatTimeAgo(dateStr: string): string {
- const date = new Date(dateStr);
- const now = new Date();
- const diffMs = now.getTime() - date.getTime();
- const diffMins = Math.floor(diffMs / 60000);
- const diffHours = Math.floor(diffMs / 3600000);
- const diffDays = Math.floor(diffMs / 86400000);
-
- if (diffMins < 1) return "just now";
- if (diffMins < 60) return `${diffMins}m ago`;
- if (diffHours < 24) return `${diffHours}h ago`;
- if (diffDays < 7) return `${diffDays}d ago`;
- return date.toLocaleDateString();
-}
diff --git a/packages/views/chat/components/chat-window.tsx b/packages/views/chat/components/chat-window.tsx
index 5edc1aed21..b793b78296 100644
--- a/packages/views/chat/components/chat-window.tsx
+++ b/packages/views/chat/components/chat-window.tsx
@@ -47,11 +47,13 @@ import { ChatResizeHandles } from "./chat-resize-handles";
import { useChatResize } from "./use-chat-resize";
import { createLogger } from "@multica/core/logger";
import type { Agent, ChatMessage, ChatPendingTask, ChatSession } from "@multica/core/types";
+import { useT } from "../../i18n";
const uiLogger = createLogger("chat.ui");
const apiLogger = createLogger("chat.api");
export function ChatWindow() {
+ const { t } = useT("chat");
const wsId = useWorkspaceId();
const isOpen = useChatStore((s) => s.isOpen);
const activeSessionId = useChatStore((s) => s.activeSessionId);
@@ -397,7 +399,7 @@ export function ChatWindow() {
>
<Plus />
</TooltipTrigger>
- <TooltipContent side="top">New chat</TooltipContent>
+ <TooltipContent side="top">{t(($) => $.window.new_chat_tooltip)}</TooltipContent>
</Tooltip>
<SessionDropdown
sessions={sessions}
@@ -424,7 +426,7 @@ export function ChatWindow() {
<History />
</TooltipTrigger>
<TooltipContent side="top">
- {showHistory ? "Back to chat" : "Chat history"}
+ {showHistory ? t(($) => $.window.history_back_tooltip) : t(($) => $.window.history_show_tooltip)}
</TooltipContent>
</Tooltip>
<Tooltip>
@@ -441,7 +443,7 @@ export function ChatWindow() {
{isExpanded || isAtMax ? <Minimize2 /> : <Maximize2 />}
</TooltipTrigger>
<TooltipContent side="top">
- {isExpanded || isAtMax ? "Restore" : "Fullscreen"}
+ {isExpanded || isAtMax ? t(($) => $.window.restore_tooltip) : t(($) => $.window.expand_tooltip)}
</TooltipContent>
</Tooltip>
<Tooltip>
@@ -457,7 +459,7 @@ export function ChatWindow() {
>
<Minus />
</TooltipTrigger>
- <TooltipContent side="top">Minimize</TooltipContent>
+ <TooltipContent side="top">{t(($) => $.window.minimize_tooltip)}</TooltipContent>
</Tooltip>
</div>
</div>
@@ -543,6 +545,7 @@ function AgentDropdown({
userId: string | undefined;
onSelect: (agent: Agent) => void;
}) {
+ const { t } = useT("chat");
// Split into the user's own agents and everyone else so the menu groups
// them — matches the old AgentSelector layout.
const { mine, others } = useMemo(() => {
@@ -556,7 +559,7 @@ function AgentDropdown({
}, [agents, userId]);
if (!activeAgent) {
- return <span className="text-xs text-muted-foreground">No agents</span>;
+ return <span className="text-xs text-muted-foreground">{t(($) => $.window.no_agents)}</span>;
}
return (
@@ -575,7 +578,7 @@ function AgentDropdown({
<DropdownMenuContent align="start" side="top" className="max-h-80 w-auto max-w-64">
{mine.length > 0 && (
<DropdownMenuGroup>
- <DropdownMenuLabel>My agents</DropdownMenuLabel>
+ <DropdownMenuLabel>{t(($) => $.window.my_agents)}</DropdownMenuLabel>
{mine.map((agent) => (
<AgentMenuItem
key={agent.id}
@@ -589,7 +592,7 @@ function AgentDropdown({
{mine.length > 0 && others.length > 0 && <DropdownMenuSeparator />}
{others.length > 0 && (
<DropdownMenuGroup>
- <DropdownMenuLabel>Others</DropdownMenuLabel>
+ <DropdownMenuLabel>{t(($) => $.window.others)}</DropdownMenuLabel>
{others.map((agent) => (
<AgentMenuItem
key={agent.id}
@@ -650,10 +653,11 @@ function SessionDropdown({
activeSessionId: string | null;
onSelectSession: (session: ChatSession) => void;
}) {
+ const { t } = useT("chat");
const wsId = useWorkspaceId();
const agentById = useMemo(() => new Map(agents.map((a) => [a.id, a])), [agents]);
const activeSession = sessions.find((s) => s.id === activeSessionId);
- const title = activeSession?.title?.trim() || "New chat";
+ const title = activeSession?.title?.trim() || t(($) => $.window.untitled);
const triggerAgent = activeSession ? agentById.get(activeSession.agent_id) ?? null : null;
// Aggregate "which sessions have an in-flight task right now". Reuses
@@ -693,14 +697,14 @@ function SessionDropdown({
<span className="truncate text-sm font-medium">{title}</span>
{otherSessionRunning ? (
<span
- aria-label="Another chat is running"
- title="Another chat is running"
+ aria-label={t(($) => $.window.another_running)}
+ title={t(($) => $.window.another_running)}
className="size-1.5 shrink-0 rounded-full bg-amber-500 animate-pulse"
/>
) : otherSessionUnread ? (
<span
- aria-label="Another chat has unread replies"
- title="Another chat has unread replies"
+ aria-label={t(($) => $.window.another_unread)}
+ title={t(($) => $.window.another_unread)}
className="size-1.5 shrink-0 rounded-full bg-brand"
/>
) : null}
@@ -709,7 +713,7 @@ function SessionDropdown({
<DropdownMenuContent align="start" className="max-h-80 w-auto min-w-56 max-w-80">
{sessions.length === 0 ? (
<div className="px-2 py-1.5 text-xs text-muted-foreground">
- No previous chats
+ {t(($) => $.window.no_previous)}
</div>
) : (
sessions.map((session) => {
@@ -734,7 +738,7 @@ function SessionDropdown({
<span className="size-6 shrink-0" />
)}
<span className="truncate flex-1 text-sm">
- {session.title?.trim() || "New chat"}
+ {session.title?.trim() || t(($) => $.window.untitled)}
</span>
{/* Right-edge status pip: in-flight wins over unread because
* "still working" is more actionable than "has reply" — and
@@ -744,14 +748,14 @@ function SessionDropdown({
* amber + pulse to read as activity. */}
{isRunning ? (
<span
- aria-label="Running"
- title="Running"
+ aria-label={t(($) => $.window.running)}
+ title={t(($) => $.window.running)}
className="size-1.5 shrink-0 rounded-full bg-amber-500 animate-pulse"
/>
) : session.has_unread ? (
<span
- aria-label="Unread"
- title="Unread"
+ aria-label={t(($) => $.window.unread)}
+ title={t(($) => $.window.unread)}
className="size-1.5 shrink-0 rounded-full bg-brand"
/>
) : null}
@@ -765,16 +769,19 @@ function SessionDropdown({
);
}
-/**
- * Three starter prompts shown on the empty state. Tapping one sends it
- * immediately — ChatGPT-style — because the point is showing users what
- * this chat is for: operating on the workspace, not open-ended Q&A.
- */
-const STARTER_PROMPTS: { icon: string; text: string }[] = [
- { icon: "📋", text: "List my open tasks by priority" },
- { icon: "📝", text: "Summarize what I did today" },
- { icon: "💡", text: "Plan what to work on next" },
+// Three starter prompts shown on the empty state. Each is keyed into the
+// chat namespace so labels translate per locale; the icon stays raw since
+// emojis are locale-neutral.
+const STARTER_KEYS: ("list_open" | "summarize_today" | "plan_next")[] = [
+ "list_open",
+ "summarize_today",
+ "plan_next",
];
+const STARTER_ICONS: Record<(typeof STARTER_KEYS)[number], string> = {
+ list_open: "📋",
+ summarize_today: "📝",
+ plan_next: "💡",
+};
function EmptyState({
hasSessions,
@@ -785,27 +792,26 @@ function EmptyState({
agentName?: string;
onPickPrompt: (text: string) => void;
}) {
+ const { t } = useT("chat");
// First-time experience: the user has never started a chat in this
// workspace. Educate before suggesting actions — starter prompts
// presume the user already knows what chat is for.
- //
- // Independent of agent state: missing-agent feedback lives in the
- // banner above the input, not here. That keeps this surface focused
- // on "what is chat" rather than "what's broken right now".
if (!hasSessions) {
return (
<div className="flex flex-1 flex-col items-center justify-center gap-3 px-6 py-8">
<div className="text-center space-y-3">
- <h3 className="text-base font-semibold">Chat with your agents</h3>
+ <h3 className="text-base font-semibold">
+ {t(($) => $.empty_state.first_time_title)}
+ </h3>
<p className="text-sm text-muted-foreground">
- ✨ They know your workspace —{" "}
+ {t(($) => $.empty_state.first_time_intro)}{" "}
<span className="font-medium text-foreground">
- issues, projects, skills
+ {t(($) => $.empty_state.first_time_pillars)}
</span>
- .
+ {t(($) => $.empty_state.first_time_pillars_suffix)}
</p>
<p className="text-sm text-muted-foreground">
- Ask for a summary, plan your day, or hand off a quick task.
+ {t(($) => $.empty_state.first_time_actions)}
</p>
</div>
</div>
@@ -817,22 +823,29 @@ function EmptyState({
<div className="flex flex-1 flex-col items-center justify-center gap-5 px-6 py-8">
<div className="text-center space-y-1">
<h3 className="text-base font-semibold">
- {agentName ? `Hi, I'm ${agentName}` : "Welcome to Multica"}
+ {agentName
+ ? t(($) => $.empty_state.returning_title_named, { name: agentName })
+ : t(($) => $.empty_state.returning_title_default)}
</h3>
- <p className="text-sm text-muted-foreground">Try asking</p>
+ <p className="text-sm text-muted-foreground">
+ {t(($) => $.empty_state.returning_subtitle)}
+ </p>
</div>
<div className="w-full max-w-xs space-y-2">
- {STARTER_PROMPTS.map((prompt) => (
- <button
- key={prompt.text}
- type="button"
- onClick={() => onPickPrompt(prompt.text)}
- className="w-full rounded-lg border border-border bg-card px-3 py-2 text-left text-sm text-foreground transition-colors hover:bg-accent hover:border-brand/40"
- >
- <span className="mr-2">{prompt.icon}</span>
- {prompt.text}
- </button>
- ))}
+ {STARTER_KEYS.map((key) => {
+ const text = t(($) => $.starter_prompts[key]);
+ return (
+ <button
+ key={key}
+ type="button"
+ onClick={() => onPickPrompt(text)}
+ className="w-full rounded-lg border border-border bg-card px-3 py-2 text-left text-sm text-foreground transition-colors hover:bg-accent hover:border-brand/40"
+ >
+ <span className="mr-2">{STARTER_ICONS[key]}</span>
+ {text}
+ </button>
+ );
+ })}
</div>
</div>
);
diff --git a/packages/views/chat/components/context-anchor.tsx b/packages/views/chat/components/context-anchor.tsx
index 27c4f39c93..267563f529 100644
--- a/packages/views/chat/components/context-anchor.tsx
+++ b/packages/views/chat/components/context-anchor.tsx
@@ -18,6 +18,7 @@ import { IssueChip } from "../../issues/components/issue-chip";
import { ProjectChip } from "../../projects/components/project-chip";
import { AppLink, useNavigation } from "../../navigation";
import { useWorkspacePaths } from "@multica/core/paths";
+import { useT } from "../../i18n";
/**
* Format a derived ContextAnchor as the markdown prefix prepended to the
@@ -118,6 +119,7 @@ export function useRouteAnchorCandidate(wsId: string): {
* on + candidate → secondary (bright), clickable (→ turns off)
*/
export function ContextAnchorButton() {
+ const { t } = useT("chat");
const wsId = useWorkspaceId();
const { candidate, isResolving } = useRouteAnchorCandidate(wsId);
const focusMode = useChatStore((s) => s.focusMode);
@@ -128,12 +130,12 @@ export function ContextAnchorButton() {
const isBright = focusMode && hasAnchor;
const tooltipText = isDisabled
- ? "Nothing to share with Multica on this page"
+ ? t(($) => $.context_anchor.tooltip_disabled)
: focusMode && candidate
? candidate.type === "issue"
- ? `Multica knows you're viewing ${candidate.label} · Click to turn off`
- : `Multica knows you're viewing project "${candidate.label}" · Click to turn off`
- : "Let Multica know what you're viewing";
+ ? t(($) => $.context_anchor.tooltip_on_issue, { label: candidate.label })
+ : t(($) => $.context_anchor.tooltip_on_project, { label: candidate.label })
+ : t(($) => $.context_anchor.tooltip_off);
return (
<Tooltip>
@@ -146,7 +148,9 @@ export function ContextAnchorButton() {
onClick={() => setFocusMode(!focusMode)}
disabled={isDisabled}
aria-label={
- focusMode ? "Stop sharing current page" : "Share current page with Multica"
+ focusMode
+ ? t(($) => $.context_anchor.aria_stop)
+ : t(($) => $.context_anchor.aria_start)
}
aria-pressed={focusMode}
/>
@@ -165,6 +169,7 @@ export function ContextAnchorButton() {
* No dismiss affordance — use the button to leave focus mode.
*/
export function ContextAnchorCard() {
+ const { t } = useT("chat");
const wsId = useWorkspaceId();
const paths = useWorkspacePaths();
const { candidate } = useRouteAnchorCandidate(wsId);
@@ -179,8 +184,13 @@ export function ContextAnchorCard() {
const tooltipText =
candidate.type === "issue"
- ? `Multica knows you're viewing ${candidate.label}${candidate.subtitle ? ` — ${candidate.subtitle}` : ""}`
- : `Multica knows you're viewing project "${candidate.label}"`;
+ ? candidate.subtitle
+ ? t(($) => $.context_anchor.card_tooltip_issue_with_subtitle, {
+ label: candidate.label,
+ subtitle: candidate.subtitle,
+ })
+ : t(($) => $.context_anchor.card_tooltip_issue, { label: candidate.label })
+ : t(($) => $.context_anchor.card_tooltip_project, { label: candidate.label });
// Same pattern as IssueMentionCard: wrap the pure chip in an AppLink and
// layer cursor + hover affordance onto the chip. Makes the anchor feel
diff --git a/packages/views/chat/components/no-agent-banner.tsx b/packages/views/chat/components/no-agent-banner.tsx
index ac3d892591..14d42d6367 100644
--- a/packages/views/chat/components/no-agent-banner.tsx
+++ b/packages/views/chat/components/no-agent-banner.tsx
@@ -1,6 +1,7 @@
"use client";
import { Bot } from "lucide-react";
+import { useT } from "../../i18n";
// Sibling of ChatInput, occupying the same banner slot as OfflineBanner.
// Shown when the workspace has no agent the current user can chat with —
@@ -16,13 +17,12 @@ import { Bot } from "lucide-react";
// and ChatInput so the banner's edges line up with the input on every
// viewport size.
export function NoAgentBanner() {
+ const { t } = useT("chat");
return (
<div className="px-5 mb-1.5">
<div className="mx-auto flex w-full max-w-4xl items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs bg-muted text-muted-foreground ring-1 ring-border">
<Bot className="size-3.5 shrink-0" />
- <span className="truncate">
- You need an agent to start chatting.
- </span>
+ <span className="truncate">{t(($) => $.no_agent_banner)}</span>
</div>
</div>
);
diff --git a/packages/views/chat/components/offline-banner.tsx b/packages/views/chat/components/offline-banner.tsx
index bec9644f60..d4208c04c8 100644
--- a/packages/views/chat/components/offline-banner.tsx
+++ b/packages/views/chat/components/offline-banner.tsx
@@ -2,6 +2,7 @@
import { AlertCircle, WifiOff } from "lucide-react";
import type { AgentAvailability } from "@multica/core/agents";
+import { useT } from "../../i18n";
interface Props {
/** Display name shown in the banner copy. */
@@ -18,24 +19,18 @@ interface Props {
// reachable. Hides on `online`, `undefined`, or while presence is loading —
// users get the silent default behaviour and only see copy when there's a
// real-world implication for the message they're about to send.
-//
-// Sits outside the input card (sibling of ChatInput) so the hint reads as
-// a session-level signal rather than per-message context. The outer wrapper
-// (`px-5`) and the inner container (`mx-auto max-w-4xl`) mirror ChatInput's
-// own layout so the banner's edges line up with the input box on every
-// viewport size — without `max-w-4xl` the banner stretches wider than the
-// input on large screens and looks "loose".
export function OfflineBanner({ agentName, availability }: Props) {
+ const { t } = useT("chat");
if (availability !== "offline" && availability !== "unstable") return null;
- const name = agentName?.trim() || "the agent";
+ const name = agentName?.trim() || t(($) => $.offline_banner.fallback_name);
if (availability === "unstable") {
return (
<div className="px-5 mb-1.5">
<div className="mx-auto flex w-full max-w-4xl items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs bg-amber-50 dark:bg-amber-950/40 text-amber-900 dark:text-amber-200 ring-1 ring-amber-200/60 dark:ring-amber-900/40">
<AlertCircle className="size-3.5 shrink-0" />
<span className="truncate">
- {name}&apos;s connection is unstable — replies may be delayed.
+ {t(($) => $.offline_banner.unstable, { name })}
</span>
</div>
</div>
@@ -46,7 +41,7 @@ export function OfflineBanner({ agentName, availability }: Props) {
<div className="mx-auto flex w-full max-w-4xl items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs bg-muted text-muted-foreground ring-1 ring-border">
<WifiOff className="size-3.5 shrink-0" />
<span className="truncate">
- {name} is offline — your message will be delivered when they&apos;re back.
+ {t(($) => $.offline_banner.offline, { name })}
</span>
</div>
</div>
diff --git a/packages/views/chat/components/task-status-pill.tsx b/packages/views/chat/components/task-status-pill.tsx
index 7ec97e808b..fb83be3f22 100644
--- a/packages/views/chat/components/task-status-pill.tsx
+++ b/packages/views/chat/components/task-status-pill.tsx
@@ -6,6 +6,7 @@ import { UnicodeSpinner } from "@multica/ui/components/common/unicode-spinner";
import type { AgentAvailability } from "@multica/core/agents";
import type { ChatPendingTask, TaskMessagePayload } from "@multica/core/types";
import { formatElapsedSecs } from "../lib/format";
+import { useT } from "../../i18n";
interface Props {
/** Server-authoritative pending-task snapshot (`created_at` anchors the timer). */
@@ -17,70 +18,65 @@ interface Props {
}
interface Stage {
- /** Standalone label, capitalised so it reads as a complete short phrase
- * ("Searching the web · 14s") without needing a subject. Matches the
- * ChatGPT / Cursor / Claude style — the agent identity is already on
- * the chat header, so we don't repeat it inline. */
label: string;
- /** Stage represents a stable holding state (offline / waiting). When true,
- * the spinner is suppressed and the shimmer animation is disabled —
- * shimmer / spinning implies "the agent is actively doing something",
- * which a holding state isn't. */
static?: boolean;
}
-// Tool → label. Short, action-flavoured phrases — the daemon-reported tool
-// slug is meaningful but ugly ("ToolUse: read"); these are the user-facing
-// translations. Unknown tools fall back to "Working" rather than leaking
-// the raw slug.
-const TOOL_LABELS: Record<string, string> = {
- bash: "Running a command",
- exec: "Running a command",
- read: "Reading files",
- glob: "Reading files",
- grep: "Searching the code",
- write: "Making edits",
- edit: "Making edits",
- multi_edit: "Making edits",
- multiedit: "Making edits",
- web_search: "Searching the web",
- websearch: "Searching the web",
-};
+type StageKey =
+ | "offline"
+ | "reconnecting"
+ | "queued"
+ | "starting_up"
+ | "thinking"
+ | "typing";
+
+type ToolKey =
+ | "running_command"
+ | "reading_files"
+ | "searching_code"
+ | "making_edits"
+ | "searching_web"
+ | "fallback";
-const TOOL_FALLBACK = "Working";
+// Tool slug → translation key. Unknown tools fall back to "Working".
+const TOOL_KEY_BY_SLUG: Record<string, Exclude<ToolKey, "fallback">> = {
+ bash: "running_command",
+ exec: "running_command",
+ read: "reading_files",
+ glob: "reading_files",
+ grep: "searching_code",
+ write: "making_edits",
+ edit: "making_edits",
+ multi_edit: "making_edits",
+ multiedit: "making_edits",
+ web_search: "searching_web",
+ websearch: "searching_web",
+};
-// Pure stage decision. Two-tier signal: presence + status drive the
-// queued/wait copy, then taskMessages drive the running-state label.
-// Errors deliberately don't flip the pill — the timeline already renders
-// the error inline, and overwriting the label would mask whatever the
-// agent does next.
-function pickStage(
+// Pure stage decision returning translation keys. The hook below maps these
+// keys into localized labels — keeping the decision pure makes it easy to
+// follow the priority rules without translation noise.
+function pickStageKeys(
status: string | undefined,
taskMessages: readonly TaskMessagePayload[],
availability: AgentAvailability | undefined,
-): Stage {
+): { stageKey: StageKey; toolKey?: ToolKey; static?: boolean } {
if (
(status === "queued" || status === "dispatched") &&
availability === "offline"
) {
- return { label: "Offline", static: true };
+ return { stageKey: "offline", static: true };
}
if (
(status === "queued" || status === "dispatched") &&
availability === "unstable"
) {
- return { label: "Reconnecting" };
+ return { stageKey: "reconnecting" };
}
- if (status === "queued") return { label: "Queued" };
- if (status === "dispatched") return { label: "Starting up" };
+ if (status === "queued") return { stageKey: "queued" };
+ if (status === "dispatched") return { stageKey: "starting_up" };
- // running: latest meaningful message decides the label. We deliberately
- // skip both `error` rows (rendered inline by the timeline; flipping the
- // pill would mask the next real action) and `tool_result` rows
- // (tool_result is the completion event for a tool_use, not a new stage —
- // treating it as one made the pill flicker bash → Thinking → grep →
- // Thinking → web_search on every tool boundary, where reality is just
- // bash → grep → web_search).
+ // running: latest meaningful message decides the label.
let latest: TaskMessagePayload | null = null;
for (let i = taskMessages.length - 1; i >= 0; i--) {
const m = taskMessages[i];
@@ -90,14 +86,37 @@ function pickStage(
}
}
- if (!latest) return { label: "Thinking" };
- if (latest.type === "thinking") return { label: "Thinking" };
- if (latest.type === "text") return { label: "Typing" };
+ if (!latest) return { stageKey: "thinking" };
+ if (latest.type === "thinking") return { stageKey: "thinking" };
+ if (latest.type === "text") return { stageKey: "typing" };
if (latest.type === "tool_use") {
const tool = (latest.tool ?? "").toLowerCase();
- return { label: TOOL_LABELS[tool] ?? TOOL_FALLBACK };
+ const toolKey = TOOL_KEY_BY_SLUG[tool] ?? "fallback";
+ // tool_use is technically still "thinking + tool" — surface the tool
+ // label in the toolKey channel; main stage label uses the tool one.
+ return { stageKey: "thinking", toolKey };
}
- return { label: "Thinking" };
+ return { stageKey: "thinking" };
+}
+
+function useResolveStage(): (
+ status: string | undefined,
+ taskMessages: readonly TaskMessagePayload[],
+ availability: AgentAvailability | undefined,
+) => Stage {
+ const { t } = useT("chat");
+ return (status, taskMessages, availability) => {
+ const decision = pickStageKeys(status, taskMessages, availability);
+ if (decision.toolKey) {
+ return {
+ label: t(($) => $.status_pill.tools[decision.toolKey!]),
+ };
+ }
+ return {
+ label: t(($) => $.status_pill.stages[decision.stageKey]),
+ static: decision.static,
+ };
+ };
}
export function TaskStatusPill({
@@ -105,6 +124,7 @@ export function TaskStatusPill({
taskMessages,
availability,
}: Props) {
+ const resolveStage = useResolveStage();
// Anchor: locked on first render. Once set we never reassign — otherwise
// the timer would visibly snap backwards when an optimistic-seeded
// `Date.now()` anchor is later replaced by a server-side created_at that
@@ -128,12 +148,10 @@ export function TaskStatusPill({
// Effective status — defense-in-depth derive on top of the cache. If any
// task_message has streamed in, the daemon has by definition started
- // running; we trust that observation over a stale cache. Catches WS gaps,
- // reconnect windows, or out-of-order delivery where the cache hasn't been
- // writethrough'd yet.
+ // running; we trust that observation over a stale cache.
const status = taskMessages.length > 0 ? "running" : pendingTask.status;
const elapsedSecs = Math.max(0, Math.floor((now - anchor) / 1000));
- const stage = pickStage(status, taskMessages, availability);
+ const stage = resolveStage(status, taskMessages, availability);
return (
<div
diff --git a/packages/views/common/task-transcript/agent-transcript-dialog.tsx b/packages/views/common/task-transcript/agent-transcript-dialog.tsx
index 25d6e8731c..a315f7ae57 100644
--- a/packages/views/common/task-transcript/agent-transcript-dialog.tsx
+++ b/packages/views/common/task-transcript/agent-transcript-dialog.tsx
@@ -34,6 +34,7 @@ import { api } from "@multica/core/api";
import type { AgentTask, Agent, AgentRuntime } from "@multica/core/types/agent";
import { redactSecrets } from "./redact";
import type { TimelineItem } from "./build-timeline";
+import { useT } from "../../i18n";
interface AgentTranscriptDialogProps {
open: boolean;
@@ -162,6 +163,7 @@ export function AgentTranscriptDialog({
agentName,
isLive = false,
}: AgentTranscriptDialogProps) {
+ const { t } = useT("agents");
const [selectedSeq, setSelectedSeq] = useState<number | null>(null);
const [elapsed, setElapsed] = useState("");
const [copied, setCopied] = useState(false);
@@ -282,17 +284,17 @@ export function AgentTranscriptDialog({
const statusBadge = isLive ? (
<span className="inline-flex items-center gap-1 rounded-full bg-info/15 px-2 py-0.5 text-xs font-medium text-info">
<Loader2 className="h-3 w-3 animate-spin" />
- Running
+ {t(($) => $.transcript.status_running)}
</span>
) : task.status === "completed" ? (
<span className="inline-flex items-center gap-1 rounded-full bg-success/15 px-2 py-0.5 text-xs font-medium text-success">
<CheckCircle2 className="h-3 w-3" />
- Completed
+ {t(($) => $.transcript.status_completed)}
</span>
) : task.status === "failed" ? (
<span className="inline-flex items-center gap-1 rounded-full bg-destructive/15 px-2 py-0.5 text-xs font-medium text-destructive">
<XCircle className="h-3 w-3" />
- Failed
+ {t(($) => $.transcript.status_failed)}
</span>
) : (
<span className="inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground capitalize">
@@ -306,7 +308,7 @@ export function AgentTranscriptDialog({
className="!max-w-4xl !w-[calc(100vw-4rem)] !max-h-[calc(100vh-4rem)] !h-[calc(100vh-4rem)] flex flex-col !p-0 !gap-0 overflow-hidden"
showCloseButton={false}
>
- <DialogTitle className="sr-only">Agent Execution Transcript</DialogTitle>
+ <DialogTitle className="sr-only">{t(($) => $.transcript.dialog_title)}</DialogTitle>
{/* ── Header ─────────────────────────────────────────────── */}
<div className="border-b px-4 py-3 shrink-0 space-y-2">
@@ -337,7 +339,7 @@ export function AgentTranscriptDialog({
)}
>
<Filter className="h-3 w-3" />
- Filter
+ {t(($) => $.transcript.filter)}
{selectedTools.size > 0 && (
<span className="ml-0.5 rounded-full bg-blue-500/20 px-1.5 py-0 text-[10px] font-medium">
{selectedTools.size}
@@ -358,7 +360,7 @@ export function AgentTranscriptDialog({
<>
<DropdownMenuSeparator />
<DropdownMenuItem onClick={clearFilters} className="text-muted-foreground">
- Clear filters
+ {t(($) => $.transcript.clear_filters)}
</DropdownMenuItem>
</>
)}
@@ -370,7 +372,7 @@ export function AgentTranscriptDialog({
className="flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground hover:text-foreground hover:bg-accent transition-colors"
>
{copied ? <Check className="h-3 w-3" /> : <Copy className="h-3 w-3" />}
- {copied ? "Copied" : selectedTools.size > 0 ? "Copy filtered" : "Copy all"}
+ {copied ? t(($) => $.transcript.copied) : selectedTools.size > 0 ? t(($) => $.transcript.copy_filtered) : t(($) => $.transcript.copy_all)}
</button>
<button
onClick={() => onOpenChange(false)}
@@ -416,10 +418,12 @@ export function AgentTranscriptDialog({
{/* Event counts */}
{toolCount > 0 && (
- <MetadataChip>{toolCount} tool calls</MetadataChip>
+ <MetadataChip>{t(($) => $.transcript.tool_calls, { count: toolCount })}</MetadataChip>
)}
<MetadataChip>
- {selectedTools.size > 0 ? `${filteredItems.length} of ${items.length}` : items.length} events
+ {selectedTools.size > 0
+ ? t(($) => $.transcript.events_filtered, { shown: filteredItems.length, total: items.length })
+ : t(($) => $.transcript.events, { count: items.length })}
</MetadataChip>
{/* Created time */}
@@ -457,10 +461,10 @@ export function AgentTranscriptDialog({
{isLive ? (
<div className="flex items-center gap-2">
<Loader2 className="h-4 w-4 animate-spin" />
- Waiting for events...
+ {t(($) => $.transcript.waiting_events)}
</div>
) : (
- "No execution data recorded."
+ t(($) => $.transcript.no_data)
)}
</div>
) : (
diff --git a/packages/views/editor/bubble-menu.tsx b/packages/views/editor/bubble-menu.tsx
index 1fb38c42bd..a425872454 100644
--- a/packages/views/editor/bubble-menu.tsx
+++ b/packages/views/editor/bubble-menu.tsx
@@ -34,6 +34,7 @@ import { posToDOMRect } from "@tiptap/core";
import { NodeSelection } from "@tiptap/pm/state";
import { toast } from "sonner";
import { useCreateIssue } from "@multica/core/issues/mutations";
+import { useT } from "../i18n";
import { modKey } from "@multica/core/platform";
import { Toggle } from "@multica/ui/components/ui/toggle";
import { Separator } from "@multica/ui/components/ui/separator";
@@ -178,6 +179,7 @@ function LinkEditBar({
editor: Editor;
onClose: () => void;
}) {
+ const { t } = useT("editor");
const existingHref = editor.getAttributes("link").href as string | undefined;
const [url, setUrl] = useState(existingHref ?? "");
const inputRef = useRef<HTMLInputElement>(null);
@@ -209,7 +211,7 @@ function LinkEditBar({
value={url}
onChange={(e) => setUrl(e.target.value)}
placeholder="https://..."
- aria-label="URL"
+ aria-label={t(($) => $.bubble_menu.url_aria_label)}
className="h-7 flex-1 text-xs"
onKeyDown={(e) => {
if (e.key === "Enter") { e.preventDefault(); apply(); }
@@ -236,13 +238,14 @@ function LinkEditBar({
// ---------------------------------------------------------------------------
function HeadingDropdown({ editor, onOpenChange, activeLevel }: { editor: Editor; onOpenChange: (open: boolean) => void; activeLevel: number | undefined }) {
+ const { t } = useT("editor");
const [open, setOpen] = useState(false);
- const label = activeLevel ? `H${activeLevel}` : "Text";
+ const label = activeLevel ? `H${activeLevel}` : t(($) => $.bubble_menu.heading_dropdown.text);
const items = [
- { label: "Normal Text", icon: Type, active: !activeLevel, action: () => editor.chain().focus().setParagraph().run() },
- { label: "Heading 1", icon: Heading1, active: activeLevel === 1, action: () => editor.chain().focus().toggleHeading({ level: 1 }).run() },
- { label: "Heading 2", icon: Heading2, active: activeLevel === 2, action: () => editor.chain().focus().toggleHeading({ level: 2 }).run() },
- { label: "Heading 3", icon: Heading3, active: activeLevel === 3, action: () => editor.chain().focus().toggleHeading({ level: 3 }).run() },
+ { label: t(($) => $.bubble_menu.heading_dropdown.normal_text), icon: Type, active: !activeLevel, action: () => editor.chain().focus().setParagraph().run() },
+ { label: t(($) => $.bubble_menu.heading_dropdown.heading_1), icon: Heading1, active: activeLevel === 1, action: () => editor.chain().focus().toggleHeading({ level: 1 }).run() },
+ { label: t(($) => $.bubble_menu.heading_dropdown.heading_2), icon: Heading2, active: activeLevel === 2, action: () => editor.chain().focus().toggleHeading({ level: 2 }).run() },
+ { label: t(($) => $.bubble_menu.heading_dropdown.heading_3), icon: Heading3, active: activeLevel === 3, action: () => editor.chain().focus().toggleHeading({ level: 3 }).run() },
];
const handleOpenChange = useCallback((next: boolean) => {
@@ -292,6 +295,7 @@ function HeadingDropdown({ editor, onOpenChange, activeLevel }: { editor: Editor
// ---------------------------------------------------------------------------
function ListDropdown({ editor, onOpenChange, isBullet, isOrdered }: { editor: Editor; onOpenChange: (open: boolean) => void; isBullet: boolean; isOrdered: boolean }) {
+ const { t } = useT("editor");
const [open, setOpen] = useState(false);
const handleOpenChange = useCallback((next: boolean) => {
@@ -308,7 +312,7 @@ function ListDropdown({ editor, onOpenChange, isBullet, isOrdered }: { editor: E
<List className="size-3.5" />
<ChevronDown className="size-3" />
</TooltipTrigger>
- <TooltipContent side="top" sideOffset={8}>List</TooltipContent>
+ <TooltipContent side="top" sideOffset={8}>{t(($) => $.bubble_menu.list)}</TooltipContent>
</Tooltip>
<PopoverContent
side="bottom"
@@ -326,7 +330,7 @@ function ListDropdown({ editor, onOpenChange, isBullet, isOrdered }: { editor: E
handleOpenChange(false);
}}
>
- <List className="size-3.5" /> Bullet List
+ <List className="size-3.5" /> {t(($) => $.bubble_menu.list_dropdown.bullet_list)}
{isBullet && <Check className="ml-auto size-3.5" />}
</button>
<button
@@ -337,7 +341,7 @@ function ListDropdown({ editor, onOpenChange, isBullet, isOrdered }: { editor: E
handleOpenChange(false);
}}
>
- <ListOrdered className="size-3.5" /> Ordered List
+ <ListOrdered className="size-3.5" /> {t(($) => $.bubble_menu.list_dropdown.ordered_list)}
{isOrdered && <Check className="ml-auto size-3.5" />}
</button>
</PopoverContent>
@@ -362,6 +366,7 @@ function CreateSubIssueButton({
editor: Editor;
parentIssueId: string;
}) {
+ const { t } = useT("editor");
const createIssue = useCreateIssue();
const [pending, setPending] = useState(false);
@@ -400,13 +405,13 @@ function CreateSubIssueButton({
],
)
.run();
- toast.success(`Created ${newIssue.identifier}`);
+ toast.success(t(($) => $.bubble_menu.sub_issue.created, { identifier: newIssue.identifier }));
} catch {
- toast.error("Failed to create sub-issue");
+ toast.error(t(($) => $.bubble_menu.sub_issue.create_failed));
} finally {
setPending(false);
}
- }, [editor, parentIssueId, createIssue, pending]);
+ }, [editor, parentIssueId, createIssue, pending, t]);
return (
<Tooltip>
@@ -428,7 +433,7 @@ function CreateSubIssueButton({
)}
</TooltipTrigger>
<TooltipContent side="top" sideOffset={8}>
- Create sub-issue from selection
+ {t(($) => $.bubble_menu.sub_issue.tooltip)}
</TooltipContent>
</Tooltip>
);
@@ -445,6 +450,7 @@ function EditorBubbleMenu({
editor: Editor;
currentIssueId?: string;
}) {
+ const { t } = useT("editor");
const [visible, setVisible] = useState(false);
const [mode, setMode] = useState<"toolbar" | "link-edit">("toolbar");
const floatingRef = useRef<HTMLDivElement>(null);
@@ -574,10 +580,10 @@ function EditorBubbleMenu({
) : (
<TooltipProvider delay={300}>
<div className="bubble-menu">
- <MarkButton editor={editor} mark="bold" icon={Bold} label="Bold" shortcut={`${modKey}+B`} isActive={fmt.bold} />
- <MarkButton editor={editor} mark="italic" icon={Italic} label="Italic" shortcut={`${modKey}+I`} isActive={fmt.italic} />
- <MarkButton editor={editor} mark="strike" icon={Strikethrough} label="Strikethrough" shortcut={`${modKey}+Shift+S`} isActive={fmt.strike} />
- <MarkButton editor={editor} mark="code" icon={Code} label="Code" shortcut={`${modKey}+E`} isActive={fmt.code} />
+ <MarkButton editor={editor} mark="bold" icon={Bold} label={t(($) => $.bubble_menu.bold)} shortcut={`${modKey}+B`} isActive={fmt.bold} />
+ <MarkButton editor={editor} mark="italic" icon={Italic} label={t(($) => $.bubble_menu.italic)} shortcut={`${modKey}+I`} isActive={fmt.italic} />
+ <MarkButton editor={editor} mark="strike" icon={Strikethrough} label={t(($) => $.bubble_menu.strikethrough)} shortcut={`${modKey}+Shift+S`} isActive={fmt.strike} />
+ <MarkButton editor={editor} mark="code" icon={Code} label={t(($) => $.bubble_menu.code)} shortcut={`${modKey}+E`} isActive={fmt.code} />
<Separator orientation="vertical" className="mx-0.5 h-5" />
<Tooltip>
<TooltipTrigger render={
@@ -585,7 +591,7 @@ function EditorBubbleMenu({
}>
<Link2 className="size-3.5" />
</TooltipTrigger>
- <TooltipContent side="top" sideOffset={8}>Link</TooltipContent>
+ <TooltipContent side="top" sideOffset={8}>{t(($) => $.bubble_menu.link)}</TooltipContent>
</Tooltip>
<Separator orientation="vertical" className="mx-0.5 h-5" />
<HeadingDropdown editor={editor} onOpenChange={handleMenuOpenChange} activeLevel={fmt.heading1 ? 1 : fmt.heading2 ? 2 : fmt.heading3 ? 3 : undefined} />
@@ -596,7 +602,7 @@ function EditorBubbleMenu({
}>
<Quote className="size-3.5" />
</TooltipTrigger>
- <TooltipContent side="top" sideOffset={8}>Quote</TooltipContent>
+ <TooltipContent side="top" sideOffset={8}>{t(($) => $.bubble_menu.quote)}</TooltipContent>
</Tooltip>
{currentIssueId && (
<>
diff --git a/packages/views/editor/extensions/code-block-view.tsx b/packages/views/editor/extensions/code-block-view.tsx
index db274b84d6..0923e889d0 100644
--- a/packages/views/editor/extensions/code-block-view.tsx
+++ b/packages/views/editor/extensions/code-block-view.tsx
@@ -4,8 +4,10 @@ import { useState } from "react";
import { NodeViewWrapper, NodeViewContent } from "@tiptap/react";
import type { NodeViewProps } from "@tiptap/react";
import { Copy, Check } from "lucide-react";
+import { useT } from "../../i18n";
function CodeBlockView({ node }: NodeViewProps) {
+ const { t } = useT("editor");
const [copied, setCopied] = useState(false);
const language = node.attrs.language || "";
@@ -32,7 +34,7 @@ function CodeBlockView({ node }: NodeViewProps) {
type="button"
onClick={handleCopy}
className="flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground transition-colors"
- title="Copy code"
+ title={t(($) => $.code_block.copy_code)}
>
{copied ? (
<Check className="h-3.5 w-3.5" />
diff --git a/packages/views/editor/extensions/file-card.tsx b/packages/views/editor/extensions/file-card.tsx
index 4117b23445..dd00303d59 100644
--- a/packages/views/editor/extensions/file-card.tsx
+++ b/packages/views/editor/extensions/file-card.tsx
@@ -18,6 +18,7 @@ import { Node, mergeAttributes } from "@tiptap/core";
import { ReactNodeViewRenderer, NodeViewWrapper } from "@tiptap/react";
import type { NodeViewProps } from "@tiptap/react";
import { FileText, Loader2, Download } from "lucide-react";
+import { useT } from "../../i18n";
// ---------------------------------------------------------------------------
@@ -29,6 +30,7 @@ import { FileText, Loader2, Download } from "lucide-react";
// ---------------------------------------------------------------------------
function FileCardView({ node }: NodeViewProps) {
+ const { t } = useT("editor");
const href = (node.attrs.href as string) || "";
const filename = (node.attrs.filename as string) || "";
const uploading = node.attrs.uploading as boolean;
@@ -50,7 +52,7 @@ function FileCardView({ node }: NodeViewProps) {
<FileText className="size-4 shrink-0 text-muted-foreground" />
)}
<div className="min-w-0 flex-1">
- <p className="truncate text-sm">{uploading ? `Uploading ${filename}` : filename}</p>
+ <p className="truncate text-sm">{uploading ? t(($) => $.file_card.uploading, { filename }) : filename}</p>
</div>
{!uploading && href && (
<button
diff --git a/packages/views/editor/extensions/image-view.tsx b/packages/views/editor/extensions/image-view.tsx
index 5cc5304593..4ddf06700e 100644
--- a/packages/views/editor/extensions/image-view.tsx
+++ b/packages/views/editor/extensions/image-view.tsx
@@ -12,6 +12,7 @@ import {
} from "lucide-react";
import { toast } from "sonner";
import { cn } from "@multica/ui/lib/utils";
+import { useT } from "../../i18n";
// ---------------------------------------------------------------------------
// Lightbox — full-screen image preview (ESC or click backdrop to close)
@@ -55,6 +56,7 @@ function ImageLightbox({
// ---------------------------------------------------------------------------
function ImageView({ node, editor, selected, deleteNode }: NodeViewProps) {
+ const { t } = useT("editor");
const src = node.attrs.src as string;
const alt = (node.attrs.alt as string) || "";
const title = node.attrs.title as string | undefined;
@@ -75,9 +77,9 @@ function ImageView({ node, editor, selected, deleteNode }: NodeViewProps) {
const handleCopyLink = async () => {
try {
await navigator.clipboard.writeText(src);
- toast.success("Link copied");
+ toast.success(t(($) => $.image.link_copied));
} catch {
- toast.error("Failed to copy link");
+ toast.error(t(($) => $.image.copy_link_failed));
}
};
@@ -104,16 +106,16 @@ function ImageView({ node, editor, selected, deleteNode }: NodeViewProps) {
onMouseDown={(e) => e.stopPropagation()}
onClick={(e) => e.stopPropagation()}
>
- <button type="button" onClick={handleView} title="View image">
+ <button type="button" onClick={handleView} title={t(($) => $.image.view)}>
<Maximize2 className="size-3.5" />
</button>
- <button type="button" onClick={handleDownload} title="Download">
+ <button type="button" onClick={handleDownload} title={t(($) => $.image.download)}>
<Download className="size-3.5" />
</button>
<button
type="button"
onClick={handleCopyLink}
- title="Copy link"
+ title={t(($) => $.image.copy_link)}
>
<LinkIcon className="size-3.5" />
</button>
@@ -121,7 +123,7 @@ function ImageView({ node, editor, selected, deleteNode }: NodeViewProps) {
<button
type="button"
onClick={() => deleteNode()}
- title="Delete"
+ title={t(($) => $.image.delete)}
>
<Trash2 className="size-3.5" />
</button>
diff --git a/packages/views/editor/extensions/mention-suggestion.test.tsx b/packages/views/editor/extensions/mention-suggestion.test.tsx
index 87e4627264..e696c9a93d 100644
--- a/packages/views/editor/extensions/mention-suggestion.test.tsx
+++ b/packages/views/editor/extensions/mention-suggestion.test.tsx
@@ -1,10 +1,27 @@
import { render, screen, waitFor } from "@testing-library/react";
-import { createRef } from "react";
+import { createRef, type ReactNode } from "react";
import { describe, it, expect, vi, beforeEach } from "vitest";
import { workspaceKeys } from "@multica/core/workspace/queries";
import { issueKeys, PAGINATED_STATUSES } from "@multica/core/issues/queries";
+import { I18nProvider } from "@multica/core/i18n/react";
import type { IssueStatus, ListIssuesCache } from "@multica/core/types";
import type { QueryClient } from "@tanstack/react-query";
+import enCommon from "../../locales/en/common.json";
+import enAuth from "../../locales/en/auth.json";
+import enSettings from "../../locales/en/settings.json";
+import enEditor from "../../locales/en/editor.json";
+
+const TEST_RESOURCES = {
+ en: { common: enCommon, auth: enAuth, settings: enSettings, editor: enEditor },
+};
+
+function I18nWrapper({ children }: { children: ReactNode }) {
+ return (
+ <I18nProvider locale="en" resources={TEST_RESOURCES}>
+ {children}
+ </I18nProvider>
+ );
+}
// Mock the workspace id singleton — items() reads it imperatively.
vi.mock("@multica/core/platform", () => ({
@@ -107,7 +124,7 @@ describe("createMentionSuggestion", () => {
total: 1,
});
- render(<MentionList items={[]} query="协作" command={vi.fn()} />);
+ render(<I18nWrapper><MentionList items={[]} query="协作" command={vi.fn()} /></I18nWrapper>);
expect(screen.getByText("Searching...")).toBeInTheDocument();
@@ -125,7 +142,7 @@ describe("createMentionSuggestion", () => {
});
it("does not call searchIssues for an empty query", () => {
- render(<MentionList items={[]} query="" command={vi.fn()} />);
+ render(<I18nWrapper><MentionList items={[]} query="" command={vi.fn()} /></I18nWrapper>);
expect(searchIssuesMock).not.toHaveBeenCalled();
});
@@ -133,7 +150,7 @@ describe("createMentionSuggestion", () => {
it("captures Enter while the popup has no selectable items", () => {
const ref = createRef<MentionListRef>();
- render(<MentionList ref={ref} items={[]} query="协作" command={vi.fn()} />);
+ render(<I18nWrapper><MentionList ref={ref} items={[]} query="协作" command={vi.fn()} /></I18nWrapper>);
expect(
ref.current?.onKeyDown({ event: new KeyboardEvent("keydown", { key: "Enter" }) }),
diff --git a/packages/views/editor/extensions/mention-suggestion.tsx b/packages/views/editor/extensions/mention-suggestion.tsx
index d25d55e4f8..fd11507198 100644
--- a/packages/views/editor/extensions/mention-suggestion.tsx
+++ b/packages/views/editor/extensions/mention-suggestion.tsx
@@ -26,6 +26,7 @@ import type {
} from "@multica/core/types";
import { ActorAvatar } from "../../common/actor-avatar";
import { StatusIcon } from "../../issues/components/status-icon";
+import { useT } from "../../i18n";
import { Badge } from "@multica/ui/components/ui/badge";
import type { IssueStatus } from "@multica/core/types";
import type { SuggestionOptions, SuggestionProps } from "@tiptap/suggestion";
@@ -117,6 +118,7 @@ function mergeMentionItems(
export const MentionList = forwardRef<MentionListRef, MentionListProps>(
function MentionList({ items, query, command }, ref) {
+ const { t } = useT("editor");
const [selectedIndex, setSelectedIndex] = useState(0);
const [serverIssueItems, setServerIssueItems] = useState<MentionItem[]>([]);
const [isSearchingIssues, setIsSearchingIssues] = useState(false);
@@ -230,12 +232,19 @@ export const MentionList = forwardRef<MentionListRef, MentionListProps>(
return (
<div className="rounded-md border bg-popover p-2 text-xs text-muted-foreground shadow-md">
- {isWaitingForServer ? "Searching..." : "No results"}
+ {isWaitingForServer
+ ? t(($) => $.mention.searching)
+ : t(($) => $.mention.no_results)}
</div>
);
}
const groups = groupItems(displayItems);
+ const groupLabel = (label: string): string => {
+ if (label === "Users") return t(($) => $.mention.group_users);
+ if (label === "Issues") return t(($) => $.mention.group_issues);
+ return label;
+ };
// Build a flat index mapping: globalIndex → item
let globalIndex = 0;
@@ -245,7 +254,7 @@ export const MentionList = forwardRef<MentionListRef, MentionListProps>(
{groups.map((group) => (
<div key={group.label}>
<div className="px-3 py-1.5 text-xs font-medium text-muted-foreground">
- {group.label}
+ {groupLabel(group.label)}
</div>
{group.items.map((item) => {
const idx = globalIndex++;
@@ -281,6 +290,7 @@ function MentionRow({
onSelect: () => void;
buttonRef: (el: HTMLButtonElement | null) => void;
}) {
+ const { t } = useT("editor");
if (item.type === "issue") {
// Visually dim closed issues (done/cancelled) so they're distinguishable
// from active ones in the suggestion list — they're still selectable.
@@ -322,8 +332,12 @@ function MentionRow({
size={20}
showStatusDot
/>
- <span className="truncate font-medium">{item.label}</span>
+ <span className="truncate font-medium">
+ {item.type === "all" ? t(($) => $.mention.all_members) : item.label}
+ </span>
{item.type === "agent" && (
+ // "Agent" is a glossary-protected product term — kept un-translated.
+ // eslint-disable-next-line i18next/no-literal-string
<Badge variant="outline" className="ml-auto text-[10px] h-4 px-1.5">Agent</Badge>
)}
</button>
diff --git a/packages/views/editor/link-hover-card.tsx b/packages/views/editor/link-hover-card.tsx
index bd99e4570d..b0a0ec865d 100644
--- a/packages/views/editor/link-hover-card.tsx
+++ b/packages/views/editor/link-hover-card.tsx
@@ -16,6 +16,7 @@ import { ExternalLink, Copy } from "lucide-react";
import { toast } from "sonner";
import { Button } from "@multica/ui/components/ui/button";
import { useWorkspaceSlug } from "@multica/core/paths";
+import { useT } from "../i18n";
import { openLink, isMentionHref } from "./utils/link-handler";
function truncateUrl(url: string, max = 48): string {
@@ -135,6 +136,7 @@ function LinkHoverCard({
const [pos, setPos] = useState({ top: 0, left: 0 });
const [positioned, setPositioned] = useState(false);
const slug = useWorkspaceSlug();
+ const { t } = useT("editor");
// Position the card when the portal div is mounted (ref callback).
// Using useEffect would race with portal rendering — the div might
@@ -170,9 +172,9 @@ function LinkHoverCard({
e.preventDefault();
try {
await navigator.clipboard.writeText(href);
- toast.success("Link copied");
+ toast.success(t(($) => $.link_hover.link_copied));
} catch {
- toast.error("Failed to copy");
+ toast.error(t(($) => $.link_hover.copy_failed));
}
};
@@ -207,7 +209,7 @@ function LinkHoverCard({
variant="ghost"
className="text-muted-foreground"
onClick={handleCopy}
- title="Copy link"
+ title={t(($) => $.link_hover.copy_link)}
>
<Copy className="size-3.5" />
</Button>
@@ -216,7 +218,7 @@ function LinkHoverCard({
variant="ghost"
className="text-muted-foreground"
onClick={handleOpen}
- title="Open link"
+ title={t(($) => $.link_hover.open_link)}
>
<ExternalLink className="size-3.5" />
</Button>
diff --git a/packages/views/editor/readonly-content.tsx b/packages/views/editor/readonly-content.tsx
index 2e7815ef73..41bf77aba2 100644
--- a/packages/views/editor/readonly-content.tsx
+++ b/packages/views/editor/readonly-content.tsx
@@ -36,6 +36,7 @@ import { toast } from "sonner";
import { cn } from "@multica/ui/lib/utils";
import { useWorkspacePaths, useWorkspaceSlug } from "@multica/core/paths";
import { useNavigation } from "../navigation";
+import { useT } from "../i18n";
import { IssueMentionCard } from "../issues/components/issue-mention-card";
import { ImageLightbox } from "./extensions/image-view";
import { useLinkHover, LinkHoverCard } from "./link-hover-card";
@@ -437,6 +438,7 @@ const components: Partial<Components> = {
// Images — centered with toolbar + lightbox (matches Tiptap ImageView NodeView)
img: function ReadonlyImage({ src, alt }) {
+ const { t } = useT("editor");
const [lightbox, setLightbox] = useState(false);
const imgSrc = typeof src === "string" ? src : "";
const imgAlt = alt ?? "";
@@ -448,9 +450,9 @@ const components: Partial<Components> = {
const handleCopyLink = async () => {
try {
await navigator.clipboard.writeText(imgSrc);
- toast.success("Link copied");
+ toast.success(t(($) => $.image.link_copied));
} catch {
- toast.error("Failed to copy link");
+ toast.error(t(($) => $.image.copy_link_failed));
}
};
@@ -463,13 +465,13 @@ const components: Partial<Components> = {
onMouseDown={(e) => e.stopPropagation()}
onClick={(e) => e.stopPropagation()}
>
- <button type="button" onClick={handleView} title="View image">
+ <button type="button" onClick={handleView} title={t(($) => $.image.view)}>
<Maximize2 className="size-3.5" />
</button>
- <button type="button" onClick={handleDownload} title="Download">
+ <button type="button" onClick={handleDownload} title={t(($) => $.image.download)}>
<Download className="size-3.5" />
</button>
- <button type="button" onClick={handleCopyLink} title="Copy link">
+ <button type="button" onClick={handleCopyLink} title={t(($) => $.image.copy_link)}>
<LinkIcon className="size-3.5" />
</button>
</span>
diff --git a/packages/views/editor/title-editor.tsx b/packages/views/editor/title-editor.tsx
index 23b3ba8774..0dfad35e47 100644
--- a/packages/views/editor/title-editor.tsx
+++ b/packages/views/editor/title-editor.tsx
@@ -8,6 +8,7 @@ import { Paragraph } from "@tiptap/extension-paragraph";
import { Text } from "@tiptap/extension-text";
import Placeholder from "@tiptap/extension-placeholder";
import { cn } from "@multica/ui/lib/utils";
+import { useT } from "../i18n";
import "./title-editor.css";
// ---------------------------------------------------------------------------
@@ -80,6 +81,7 @@ const TitleEditor = forwardRef<TitleEditorRef, TitleEditorProps>(
},
ref,
) {
+ const { t } = useT("editor");
const onSubmitRef = useRef(onSubmit);
const onBlurRef = useRef(onBlur);
const onChangeRef = useRef(onChange);
@@ -108,7 +110,7 @@ const TitleEditor = forwardRef<TitleEditorRef, TitleEditorProps>(
class: cn("title-editor outline-none", className),
role: "textbox",
"aria-multiline": "false",
- "aria-label": placeholderText || "Title",
+ "aria-label": placeholderText || t(($) => $.title_editor.title_aria_label),
},
},
onUpdate: ({ editor: ed }) => {
diff --git a/packages/views/eslint.config.mjs b/packages/views/eslint.config.mjs
index 50da62496d..bd13bd9d97 100644
--- a/packages/views/eslint.config.mjs
+++ b/packages/views/eslint.config.mjs
@@ -1,3 +1,22 @@
import reactConfig from "@multica/eslint-config/react";
+import i18next from "eslint-plugin-i18next";
-export default [...reactConfig];
+// Global i18n protection. Every JSX text node in this package must pass
+// through useT() — raw strings become a build error. Scope of
+// `mode: "jsx-text-only"`: flags raw strings inside JSX children only;
+// attribute values and plain TS literals are allowed through.
+
+export default [
+ ...reactConfig,
+ {
+ files: ["**/*.tsx"],
+ ignores: ["**/*.test.tsx", "test/**"],
+ plugins: { i18next },
+ rules: {
+ "i18next/no-literal-string": [
+ "error",
+ { mode: "jsx-text-only" },
+ ],
+ },
+ },
+];
diff --git a/packages/views/i18n/index.ts b/packages/views/i18n/index.ts
new file mode 100644
index 0000000000..d1684b4a67
--- /dev/null
+++ b/packages/views/i18n/index.ts
@@ -0,0 +1 @@
+export { useT } from "./use-t";
diff --git a/packages/views/i18n/resources-types.ts b/packages/views/i18n/resources-types.ts
new file mode 100644
index 0000000000..71ab6d79d2
--- /dev/null
+++ b/packages/views/i18n/resources-types.ts
@@ -0,0 +1,60 @@
+import "i18next";
+import type common from "../locales/en/common.json";
+import type auth from "../locales/en/auth.json";
+import type settings from "../locales/en/settings.json";
+import type issues from "../locales/en/issues.json";
+import type agents from "../locales/en/agents.json";
+import type editor from "../locales/en/editor.json";
+import type onboarding from "../locales/en/onboarding.json";
+import type invite from "../locales/en/invite.json";
+import type labels from "../locales/en/labels.json";
+import type members from "../locales/en/members.json";
+import type myIssues from "../locales/en/my-issues.json";
+import type search from "../locales/en/search.json";
+import type inbox from "../locales/en/inbox.json";
+import type workspace from "../locales/en/workspace.json";
+import type projects from "../locales/en/projects.json";
+import type autopilots from "../locales/en/autopilots.json";
+import type skills from "../locales/en/skills.json";
+import type chat from "../locales/en/chat.json";
+import type modals from "../locales/en/modals.json";
+import type runtimes from "../locales/en/runtimes.json";
+import type layout from "../locales/en/layout.json";
+
+// Module augmentation enables i18next v26 selector API across the monorepo:
+// `t($ => $.signin.title)` resolves to the value in en/auth.json.
+// Apps don't need to redeclare this — the augmentation is global, pulled
+// into the compilation graph by `use-t.ts`'s side-effect import.
+//
+// Adding a namespace: drop a JSON file under en/ and zh-Hans/, then add
+// the matching `import type` + entry below. Type inference on `t($ => $)`
+// follows automatically.
+declare module "i18next" {
+ interface CustomTypeOptions {
+ defaultNS: "common";
+ resources: {
+ common: typeof common;
+ auth: typeof auth;
+ settings: typeof settings;
+ issues: typeof issues;
+ agents: typeof agents;
+ editor: typeof editor;
+ onboarding: typeof onboarding;
+ invite: typeof invite;
+ labels: typeof labels;
+ members: typeof members;
+ "my-issues": typeof myIssues;
+ search: typeof search;
+ inbox: typeof inbox;
+ workspace: typeof workspace;
+ projects: typeof projects;
+ autopilots: typeof autopilots;
+ skills: typeof skills;
+ chat: typeof chat;
+ modals: typeof modals;
+ runtimes: typeof runtimes;
+ layout: typeof layout;
+ };
+ enableSelector: true;
+ }
+}
diff --git a/packages/views/i18n/use-t.ts b/packages/views/i18n/use-t.ts
new file mode 100644
index 0000000000..7b9c8fbab9
--- /dev/null
+++ b/packages/views/i18n/use-t.ts
@@ -0,0 +1,9 @@
+// Side-effect import: pulls the i18next module augmentation into the
+// compilation graph. Without this, apps that consume @multica/views won't
+// see the resources types or the selector-API enablement, and their
+// typecheck would reject `t($ => $.foo.bar)` calls inside views.
+import "./resources-types";
+
+// Project alias for react-i18next's useTranslation hook.
+// Use the selector form when calling: t($ => $.signin.title)
+export { useTranslation as useT } from "react-i18next";
diff --git a/packages/views/inbox/components/inbox-detail-label.tsx b/packages/views/inbox/components/inbox-detail-label.tsx
index 80cd9f670f..7251de6a3d 100644
--- a/packages/views/inbox/components/inbox-detail-label.tsx
+++ b/packages/views/inbox/components/inbox-detail-label.tsx
@@ -5,27 +5,32 @@ import { useActorName } from "@multica/core/workspace/hooks";
import { StatusIcon, PriorityIcon } from "../../issues/components";
import type { InboxItem, InboxItemType, IssueStatus, IssuePriority } from "@multica/core/types";
import { getQuickCreateFailureDetail } from "./inbox-display";
+import { useT } from "../../i18n";
-const typeLabels: Record<InboxItemType, string> = {
- issue_assigned: "Assigned",
- unassigned: "Unassigned",
- assignee_changed: "Assignee changed",
- status_changed: "Status changed",
- priority_changed: "Priority changed",
- due_date_changed: "Due date changed",
- new_comment: "New comment",
- mentioned: "Mentioned",
- review_requested: "Review requested",
- task_completed: "Task completed",
- task_failed: "Task failed",
- agent_blocked: "Agent blocked",
- agent_completed: "Agent completed",
- reaction_added: "Reacted",
- quick_create_done: "Created with agent",
- quick_create_failed: "Create with agent failed",
-};
-
-export { typeLabels };
+// Hook returning the inbox-item type → human label map. Replaces the
+// previous static `typeLabels` const so the labels can flow through
+// i18next. Call sites keep the same `typeLabels[type]` access pattern.
+export function useTypeLabels(): Record<InboxItemType, string> {
+ const { t } = useT("inbox");
+ return {
+ issue_assigned: t(($) => $.types.issue_assigned),
+ unassigned: t(($) => $.types.unassigned),
+ assignee_changed: t(($) => $.types.assignee_changed),
+ status_changed: t(($) => $.types.status_changed),
+ priority_changed: t(($) => $.types.priority_changed),
+ due_date_changed: t(($) => $.types.due_date_changed),
+ new_comment: t(($) => $.types.new_comment),
+ mentioned: t(($) => $.types.mentioned),
+ review_requested: t(($) => $.types.review_requested),
+ task_completed: t(($) => $.types.task_completed),
+ task_failed: t(($) => $.types.task_failed),
+ agent_blocked: t(($) => $.types.agent_blocked),
+ agent_completed: t(($) => $.types.agent_completed),
+ reaction_added: t(($) => $.types.reaction_added),
+ quick_create_done: t(($) => $.types.quick_create_done),
+ quick_create_failed: t(($) => $.types.quick_create_failed),
+ };
+}
function shortDate(dateStr: string): string {
if (!dateStr) return "";
@@ -36,6 +41,8 @@ function shortDate(dateStr: string): string {
}
export function InboxDetailLabel({ item }: { item: InboxItem }) {
+ const { t } = useT("inbox");
+ const typeLabels = useTypeLabels();
const { getActorName } = useActorName();
const details = item.details ?? {};
@@ -45,7 +52,7 @@ export function InboxDetailLabel({ item }: { item: InboxItem }) {
const label = STATUS_CONFIG[details.to as IssueStatus]?.label ?? details.to;
return (
<span className="inline-flex items-center gap-1">
- Set status to
+ {t(($) => $.labels.set_status_to)}
<StatusIcon status={details.to as IssueStatus} className="h-3 w-3" />
{label}
</span>
@@ -56,7 +63,7 @@ export function InboxDetailLabel({ item }: { item: InboxItem }) {
const label = PRIORITY_CONFIG[details.to as IssuePriority]?.label ?? details.to;
return (
<span className="inline-flex items-center gap-1">
- Set priority to
+ {t(($) => $.labels.set_priority_to)}
<PriorityIcon priority={details.to as IssuePriority} className="h-3 w-3" />
{label}
</span>
@@ -64,21 +71,21 @@ export function InboxDetailLabel({ item }: { item: InboxItem }) {
}
case "issue_assigned": {
if (details.new_assignee_id) {
- return <span>Assigned to {getActorName(details.new_assignee_type ?? "member", details.new_assignee_id)}</span>;
+ return <span>{t(($) => $.labels.assigned_to, { name: getActorName(details.new_assignee_type ?? "member", details.new_assignee_id) })}</span>;
}
return <span>{typeLabels[item.type]}</span>;
}
case "unassigned":
- return <span>Removed assignee</span>;
+ return <span>{t(($) => $.labels.removed_assignee)}</span>;
case "assignee_changed": {
if (details.new_assignee_id) {
- return <span>Assigned to {getActorName(details.new_assignee_type ?? "member", details.new_assignee_id)}</span>;
+ return <span>{t(($) => $.labels.assigned_to, { name: getActorName(details.new_assignee_type ?? "member", details.new_assignee_id) })}</span>;
}
return <span>{typeLabels[item.type]}</span>;
}
case "due_date_changed": {
- if (details.to) return <span>Set due date to {shortDate(details.to)}</span>;
- return <span>Removed due date</span>;
+ if (details.to) return <span>{t(($) => $.labels.set_due_date_to, { date: shortDate(details.to) })}</span>;
+ return <span>{t(($) => $.labels.removed_due_date)}</span>;
}
case "new_comment": {
if (item.body) return <span>{item.body}</span>;
@@ -86,17 +93,17 @@ export function InboxDetailLabel({ item }: { item: InboxItem }) {
}
case "reaction_added": {
const emoji = details.emoji;
- if (emoji) return <span>Reacted {emoji} to your comment</span>;
+ if (emoji) return <span>{t(($) => $.labels.reacted_to_comment, { emoji })}</span>;
return <span>{typeLabels[item.type]}</span>;
}
case "quick_create_done": {
const identifier = details.identifier;
- if (identifier) return <span>Created with agent: {identifier}</span>;
+ if (identifier) return <span>{t(($) => $.labels.created_with_agent, { identifier })}</span>;
return <span>{typeLabels[item.type]}</span>;
}
case "quick_create_failed": {
const detail = getQuickCreateFailureDetail(item);
- if (detail) return <span>Failed: {detail}</span>;
+ if (detail) return <span>{t(($) => $.labels.failed_with_detail, { detail })}</span>;
return <span>{typeLabels[item.type]}</span>;
}
default:
diff --git a/packages/views/inbox/components/inbox-list-item.tsx b/packages/views/inbox/components/inbox-list-item.tsx
index 06e9b41543..24a1d82f49 100644
--- a/packages/views/inbox/components/inbox-list-item.tsx
+++ b/packages/views/inbox/components/inbox-list-item.tsx
@@ -6,20 +6,25 @@ import { Archive } from "lucide-react";
import type { InboxItem } from "@multica/core/types";
import { InboxDetailLabel } from "./inbox-detail-label";
import { getInboxDisplayTitle } from "./inbox-display";
+import { useT } from "../../i18n";
-function timeAgo(dateStr: string): string {
- const diff = Date.now() - new Date(dateStr).getTime();
- const minutes = Math.floor(diff / 60000);
- if (minutes < 1) return "just now";
- if (minutes < 60) return `${minutes}m`;
- const hours = Math.floor(minutes / 60);
- if (hours < 24) return `${hours}h`;
- const days = Math.floor(hours / 24);
- return `${days}d`;
+// Hook returning a localized relative-time formatter — the i18n equivalent
+// of the previous static `timeAgo` function. Returning a function (rather
+// than a string) keeps call-site usage identical: `timeAgo(dateStr)`.
+export function useTimeAgo() {
+ const { t } = useT("inbox");
+ return (dateStr: string): string => {
+ const diff = Date.now() - new Date(dateStr).getTime();
+ const minutes = Math.floor(diff / 60000);
+ if (minutes < 1) return t(($) => $.list.time.just_now);
+ if (minutes < 60) return t(($) => $.list.time.minutes, { count: minutes });
+ const hours = Math.floor(minutes / 60);
+ if (hours < 24) return t(($) => $.list.time.hours, { count: hours });
+ const days = Math.floor(hours / 24);
+ return t(($) => $.list.time.days, { count: days });
+ };
}
-export { timeAgo };
-
export function InboxListItem({
item,
isSelected,
@@ -31,6 +36,8 @@ export function InboxListItem({
onClick: () => void;
onArchive: () => void;
}) {
+ const { t } = useT("inbox");
+ const timeAgo = useTimeAgo();
const displayTitle = getInboxDisplayTitle(item);
return (
@@ -62,7 +69,7 @@ export function InboxListItem({
<span
role="button"
tabIndex={-1}
- title="Archive"
+ title={t(($) => $.list.archive_tooltip)}
onClick={(e) => {
e.stopPropagation();
onArchive();
diff --git a/packages/views/inbox/components/inbox-page.tsx b/packages/views/inbox/components/inbox-page.tsx
index 2d61f36dea..061fd3fe45 100644
--- a/packages/views/inbox/components/inbox-page.tsx
+++ b/packages/views/inbox/components/inbox-page.tsx
@@ -50,11 +50,13 @@ import {
} from "@multica/ui/components/ui/dropdown-menu";
import { useIsMobile } from "@multica/ui/hooks/use-mobile";
import { PageHeader } from "../../layout/page-header";
-import { InboxListItem, timeAgo } from "./inbox-list-item";
-import { typeLabels } from "./inbox-detail-label";
+import { InboxListItem, useTimeAgo } from "./inbox-list-item";
+import { useTypeLabels } from "./inbox-detail-label";
import { getInboxDisplayTitle } from "./inbox-display";
+import { useT } from "../../i18n";
export function InboxPage() {
+ const { t } = useT("inbox");
const { searchParams, replace } = useNavigation();
const urlIssue = searchParams.get("issue") ?? "";
const wsPaths = useWorkspacePaths();
@@ -118,6 +120,10 @@ export function InboxPage() {
const archiveAllMutation = useArchiveAllInbox();
const archiveAllReadMutation = useArchiveAllReadInbox();
const archiveCompletedMutation = useArchiveCompletedInbox();
+ const timeAgo = useTimeAgo();
+ const typeLabels = useTypeLabels();
+
+
// Auto-mark-read whenever a selected item is unread — covers both click-
// to-select and URL-param-select (e.g. OS notification click on desktop).
// The mutation flips `read: true` optimistically, so this effect settles
@@ -129,9 +135,9 @@ export function InboxPage() {
useEffect(() => {
if (!selectedId || selectedRead) return;
markReadMutate(selectedId, {
- onError: () => toast.error("Failed to mark as read"),
+ onError: () => toast.error(t(($) => $.errors.mark_read_failed)),
});
- }, [selectedId, selectedRead, markReadMutate]);
+ }, [selectedId, selectedRead, markReadMutate, t]);
const handleSelect = (item: InboxItem) => {
setSelectedKey(item.issue_id ?? item.id);
@@ -141,21 +147,21 @@ export function InboxPage() {
const archived = items.find((i) => i.id === id);
if (archived && (archived.issue_id ?? archived.id) === selectedKey) setSelectedKey("");
archiveMutation.mutate(id, {
- onError: () => toast.error("Failed to archive"),
+ onError: () => toast.error(t(($) => $.errors.archive_failed)),
});
};
// Batch operations
const handleMarkAllRead = () => {
markAllReadMutation.mutate(undefined, {
- onError: () => toast.error("Failed to mark all as read"),
+ onError: () => toast.error(t(($) => $.errors.mark_all_read_failed)),
});
};
const handleArchiveAll = () => {
setSelectedKey("");
archiveAllMutation.mutate(undefined, {
- onError: () => toast.error("Failed to archive all"),
+ onError: () => toast.error(t(($) => $.errors.archive_all_failed)),
});
};
@@ -163,14 +169,14 @@ export function InboxPage() {
const readKeys = items.filter((i) => i.read).map((i) => i.issue_id ?? i.id);
if (readKeys.includes(selectedKey)) setSelectedKey("");
archiveAllReadMutation.mutate(undefined, {
- onError: () => toast.error("Failed to archive read items"),
+ onError: () => toast.error(t(($) => $.errors.archive_all_read_failed)),
});
};
const handleArchiveCompleted = () => {
setSelectedKey("");
archiveCompletedMutation.mutate(undefined, {
- onError: () => toast.error("Failed to archive completed"),
+ onError: () => toast.error(t(($) => $.errors.archive_completed_failed)),
});
};
@@ -179,7 +185,7 @@ export function InboxPage() {
const listHeader = (
<PageHeader className="justify-between">
<div className="flex items-center gap-2">
- <h1 className="text-sm font-semibold">Inbox</h1>
+ <h1 className="text-sm font-semibold">{t(($) => $.page.title)}</h1>
{unreadCount > 0 && (
<span className="text-xs text-muted-foreground">
{unreadCount}
@@ -201,20 +207,20 @@ export function InboxPage() {
<DropdownMenuContent align="end" className="w-auto">
<DropdownMenuItem onClick={handleMarkAllRead}>
<CheckCheck className="h-4 w-4" />
- Mark all as read
+ {t(($) => $.menu.mark_all_read)}
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem onClick={handleArchiveAll}>
<Archive className="h-4 w-4" />
- Archive all
+ {t(($) => $.menu.archive_all)}
</DropdownMenuItem>
<DropdownMenuItem onClick={handleArchiveAllRead}>
<BookCheck className="h-4 w-4" />
- Archive all read
+ {t(($) => $.menu.archive_all_read)}
</DropdownMenuItem>
<DropdownMenuItem onClick={handleArchiveCompleted}>
<ListChecks className="h-4 w-4" />
- Archive completed
+ {t(($) => $.menu.archive_completed)}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
@@ -224,7 +230,7 @@ export function InboxPage() {
const listBody = items.length === 0 ? (
<div className="flex flex-col items-center justify-center py-16 text-muted-foreground">
<Inbox className="mb-3 h-8 w-8 text-muted-foreground/50" />
- <p className="text-sm">No notifications</p>
+ <p className="text-sm">{t(($) => $.list.empty)}</p>
</div>
) : (
<div>
@@ -261,7 +267,7 @@ export function InboxPage() {
onDone={() => {
setSelectedKey("");
archiveMutation.mutate(selected.id, {
- onError: () => toast.error("Failed to archive"),
+ onError: () => toast.error(t(($) => $.errors.archive_failed)),
});
}}
/>
@@ -278,7 +284,9 @@ export function InboxPage() {
)}
{selected.type === "quick_create_failed" && selected.details?.original_prompt && (
<div className="mt-4 rounded-md border bg-muted/40 p-3">
- <p className="text-xs font-medium text-muted-foreground">Original input</p>
+ <p className="text-xs font-medium text-muted-foreground">
+ {t(($) => $.detail.original_input)}
+ </p>
<p className="mt-1 whitespace-pre-wrap text-sm">{selected.details.original_prompt}</p>
</div>
)}
@@ -302,7 +310,7 @@ export function InboxPage() {
useModalStore.getState().open("create-issue");
}}
>
- Edit as advanced form
+ {t(($) => $.detail.edit_advanced)}
</Button>
)}
<Button
@@ -311,7 +319,7 @@ export function InboxPage() {
onClick={() => handleArchive(selected.id)}
>
<Archive className="mr-1.5 h-3.5 w-3.5" />
- Archive
+ {t(($) => $.detail.archive)}
</Button>
</div>
</div>
@@ -353,7 +361,7 @@ export function InboxPage() {
className="gap-1.5 text-muted-foreground"
>
<ArrowLeft className="h-4 w-4" />
- Inbox
+ {t(($) => $.page.back)}
</Button>
</div>
<div className="flex-1 min-h-0 overflow-y-auto">
@@ -426,8 +434,8 @@ export function InboxPage() {
<Inbox className="mb-3 h-10 w-10 text-muted-foreground/30" />
<p className="text-sm">
{items.length === 0
- ? "Your inbox is empty"
- : "Select a notification to view details"}
+ ? t(($) => $.detail.empty)
+ : t(($) => $.detail.select_prompt)}
</p>
</div>
)}
diff --git a/packages/views/invite/invite-page.tsx b/packages/views/invite/invite-page.tsx
index 4c236c8562..4a899faa2c 100644
--- a/packages/views/invite/invite-page.tsx
+++ b/packages/views/invite/invite-page.tsx
@@ -16,6 +16,7 @@ import {
import { useNavigation } from "../navigation";
import { useLogout } from "../auth";
import { DragStrip } from "../platform";
+import { useT } from "../i18n";
import { Button } from "@multica/ui/components/ui/button";
import { Card, CardContent } from "@multica/ui/components/ui/card";
import { Skeleton } from "@multica/ui/components/ui/skeleton";
@@ -40,6 +41,7 @@ export interface InvitePageProps {
* layered on by the desktop overlay; web just renders the page directly.
*/
export function InvitePage({ invitationId, onBack }: InvitePageProps) {
+ const { t } = useT("invite");
const { push } = useNavigation();
const qc = useQueryClient();
const [accepting, setAccepting] = useState(false);
@@ -84,7 +86,7 @@ export function InvitePage({ invitationId, onBack }: InvitePageProps) {
: fallbackDest;
setTimeout(() => push(dest), 1000);
} catch (e) {
- setError(e instanceof Error ? e.message : "Failed to accept invitation");
+ setError(e instanceof Error ? e.message : t(($) => $.errors.accept_failed));
} finally {
setAccepting(false);
}
@@ -98,7 +100,7 @@ export function InvitePage({ invitationId, onBack }: InvitePageProps) {
setDone("declined");
qc.invalidateQueries({ queryKey: workspaceKeys.myInvitations() });
} catch (e) {
- setError(e instanceof Error ? e.message : "Failed to decline invitation");
+ setError(e instanceof Error ? e.message : t(($) => $.errors.decline_failed));
} finally {
setDeclining(false);
}
@@ -127,12 +129,12 @@ export function InvitePage({ invitationId, onBack }: InvitePageProps) {
<div className="flex h-12 w-12 items-center justify-center rounded-full bg-muted">
<X className="h-6 w-6 text-muted-foreground" />
</div>
- <h2 className="text-lg font-semibold">Invitation not found</h2>
+ <h2 className="text-lg font-semibold">{t(($) => $.not_found.title)}</h2>
<p className="text-sm text-muted-foreground text-center">
- This invitation may have expired, been revoked, or doesn&apos;t belong to your account.
+ {t(($) => $.not_found.description)}
</p>
<Button variant="outline" onClick={() => push(fallbackDest)}>
- Go to dashboard
+ {t(($) => $.not_found.go_to_dashboard)}
</Button>
</CardContent>
</Card>
@@ -148,8 +150,12 @@ export function InvitePage({ invitationId, onBack }: InvitePageProps) {
<div className="flex h-12 w-12 items-center justify-center rounded-full bg-primary/10">
<Check className="h-6 w-6 text-primary" />
</div>
- <h2 className="text-lg font-semibold">You joined {invitation.workspace_name}!</h2>
- <p className="text-sm text-muted-foreground">Redirecting to workspace...</p>
+ <h2 className="text-lg font-semibold">
+ {t(($) => $.accepted.title, { workspace_name: invitation.workspace_name })}
+ </h2>
+ <p className="text-sm text-muted-foreground">
+ {t(($) => $.accepted.redirecting)}
+ </p>
</CardContent>
</Card>
</InviteShell>
@@ -161,10 +167,10 @@ export function InvitePage({ invitationId, onBack }: InvitePageProps) {
<InviteShell onBack={onBack}>
<Card className="w-full max-w-md">
<CardContent className="flex flex-col items-center gap-4 py-12">
- <h2 className="text-lg font-semibold">Invitation declined</h2>
- <p className="text-sm text-muted-foreground">You won&apos;t be added to this workspace.</p>
+ <h2 className="text-lg font-semibold">{t(($) => $.declined.title)}</h2>
+ <p className="text-sm text-muted-foreground">{t(($) => $.declined.description)}</p>
<Button variant="outline" onClick={() => push(fallbackDest)}>
- Go to dashboard
+ {t(($) => $.declined.go_to_dashboard)}
</Button>
</CardContent>
</Card>
@@ -185,21 +191,27 @@ export function InvitePage({ invitationId, onBack }: InvitePageProps) {
<div className="text-center space-y-2">
<h2 className="text-xl font-semibold">
- Join {invitation.workspace_name ?? "workspace"}
+ {t(($) => $.main.join_title, {
+ workspace_name: invitation.workspace_name ?? t(($) => $.main.fallback_workspace_name),
+ })}
</h2>
<p className="text-sm text-muted-foreground">
<strong>{invitation.inviter_name || invitation.inviter_email}</strong>{" "}
- invited you to join as {invitation.role === "admin" ? "an admin" : "a member"}.
+ {invitation.role === "admin"
+ ? t(($) => $.main.invited_role_admin)
+ : t(($) => $.main.invited_role_member)}
</p>
</div>
{isAlreadyHandled ? (
<div className="text-sm text-muted-foreground">
- This invitation has already been {invitation.status}.
+ {invitation.status === "accepted"
+ ? t(($) => $.main.already_handled_accepted)
+ : t(($) => $.main.already_handled_declined)}
</div>
) : isExpired ? (
<div className="text-sm text-muted-foreground">
- This invitation has expired.
+ {t(($) => $.main.expired)}
</div>
) : (
<div className="flex gap-3 w-full">
@@ -209,14 +221,14 @@ export function InvitePage({ invitationId, onBack }: InvitePageProps) {
onClick={handleDecline}
disabled={accepting || declining}
>
- {declining ? "Declining..." : "Decline"}
+ {declining ? t(($) => $.main.declining) : t(($) => $.main.decline)}
</Button>
<Button
className="flex-1"
onClick={handleAccept}
disabled={accepting || declining}
>
- {accepting ? "Joining..." : "Accept & Join"}
+ {accepting ? t(($) => $.main.joining) : t(($) => $.main.accept)}
</Button>
</div>
)}
@@ -242,6 +254,7 @@ function InviteShell({
onBack?: () => void;
children: ReactNode;
}) {
+ const { t } = useT("invite");
const logout = useLogout();
return (
<div className="relative flex min-h-svh flex-col bg-background">
@@ -254,7 +267,7 @@ function InviteShell({
onClick={onBack}
>
<ArrowLeft />
- Back
+ {t(($) => $.header.back)}
</Button>
)}
<Button
@@ -264,7 +277,7 @@ function InviteShell({
onClick={logout}
>
<LogOut />
- Log out
+ {t(($) => $.header.log_out)}
</Button>
<div className="flex flex-1 flex-col items-center justify-center px-6 pb-12">
{children}
diff --git a/packages/views/issues/actions/__tests__/issue-actions-menu.test.tsx b/packages/views/issues/actions/__tests__/issue-actions-menu.test.tsx
index a61027d696..d9dba5ac98 100644
--- a/packages/views/issues/actions/__tests__/issue-actions-menu.test.tsx
+++ b/packages/views/issues/actions/__tests__/issue-actions-menu.test.tsx
@@ -2,6 +2,11 @@ import { describe, it, expect, vi, beforeEach } from "vitest";
import { render, screen, fireEvent } from "@testing-library/react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import type { Issue } from "@multica/core/types";
+import { I18nProvider } from "@multica/core/i18n/react";
+import enCommon from "../../../locales/en/common.json";
+import enIssues from "../../../locales/en/issues.json";
+
+const TEST_RESOURCES = { en: { common: enCommon, issues: enIssues } };
// ---------------------------------------------------------------------------
// Mocks — same pattern as the issue-detail test suite.
@@ -115,7 +120,11 @@ function wrap(ui: React.ReactNode) {
const qc = new QueryClient({
defaultOptions: { queries: { retry: false } },
});
- return <QueryClientProvider client={qc}>{ui}</QueryClientProvider>;
+ return (
+ <I18nProvider locale="en" resources={TEST_RESOURCES}>
+ <QueryClientProvider client={qc}>{ui}</QueryClientProvider>
+ </I18nProvider>
+ );
}
beforeEach(() => {
diff --git a/packages/views/issues/actions/issue-actions-menu-items.tsx b/packages/views/issues/actions/issue-actions-menu-items.tsx
index 62c4bf14b8..f045a95bab 100644
--- a/packages/views/issues/actions/issue-actions-menu-items.tsx
+++ b/packages/views/issues/actions/issue-actions-menu-items.tsx
@@ -15,7 +15,6 @@ import {
import type { Issue } from "@multica/core/types";
import {
ALL_STATUSES,
- STATUS_CONFIG,
PRIORITY_ORDER,
PRIORITY_CONFIG,
} from "@multica/core/issues/config";
@@ -37,6 +36,7 @@ import {
ContextMenuSeparator,
} from "@multica/ui/components/ui/context-menu";
import type { UseIssueActionsResult } from "./use-issue-actions";
+import { useT } from "../../i18n";
// Both Dropdown and Context menu wrappers expose an API-compatible surface
// (variant, inset, onClick, etc.). We bundle the primitives we need into a
@@ -82,6 +82,7 @@ export function IssueActionsMenuItems({
primitives: P,
onDeletedNavigateTo,
}: IssueActionsMenuItemsProps) {
+ const { t } = useT("issues");
const {
members,
agents,
@@ -108,15 +109,15 @@ export function IssueActionsMenuItems({
<P.Sub>
<P.SubTrigger>
<StatusIcon status={issue.status} className="h-3.5 w-3.5" />
- Status
+ {t(($) => $.actions.status)}
</P.SubTrigger>
<P.SubContent>
{ALL_STATUSES.map((s) => (
<P.Item key={s} onClick={() => updateField({ status: s })}>
<StatusIcon status={s} className="h-3.5 w-3.5" />
- {STATUS_CONFIG[s].label}
+ {t(($) => $.status[s])}
{issue.status === s && (
- <span className="ml-auto text-xs text-muted-foreground">✓</span>
+ <span className="ml-auto text-xs text-muted-foreground">{"✓"}</span>
)}
</P.Item>
))}
@@ -127,7 +128,7 @@ export function IssueActionsMenuItems({
<P.Sub>
<P.SubTrigger>
<PriorityIcon priority={issue.priority} />
- Priority
+ {t(($) => $.actions.priority)}
</P.SubTrigger>
<P.SubContent>
{PRIORITY_ORDER.map((p) => (
@@ -136,10 +137,10 @@ export function IssueActionsMenuItems({
className={`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs font-medium ${PRIORITY_CONFIG[p].badgeBg} ${PRIORITY_CONFIG[p].badgeText}`}
>
<PriorityIcon priority={p} className="h-3 w-3" inheritColor />
- {PRIORITY_CONFIG[p].label}
+ {t(($) => $.priority[p])}
</span>
{issue.priority === p && (
- <span className="ml-auto text-xs text-muted-foreground">✓</span>
+ <span className="ml-auto text-xs text-muted-foreground">{"✓"}</span>
)}
</P.Item>
))}
@@ -150,7 +151,7 @@ export function IssueActionsMenuItems({
<P.Sub>
<P.SubTrigger>
<UserMinus className="h-3.5 w-3.5" />
- Assignee
+ {t(($) => $.actions.assignee)}
</P.SubTrigger>
<P.SubContent>
<P.Item
@@ -159,9 +160,9 @@ export function IssueActionsMenuItems({
}
>
<UserMinus className="h-3.5 w-3.5 text-muted-foreground" />
- Unassigned
+ {t(($) => $.actions.unassigned)}
{!issue.assignee_type && (
- <span className="ml-auto text-xs text-muted-foreground">✓</span>
+ <span className="ml-auto text-xs text-muted-foreground">{"✓"}</span>
)}
</P.Item>
{members.map((m) => (
@@ -175,7 +176,7 @@ export function IssueActionsMenuItems({
{m.name}
{issue.assignee_type === "member" &&
issue.assignee_id === m.user_id && (
- <span className="ml-auto text-xs text-muted-foreground">✓</span>
+ <span className="ml-auto text-xs text-muted-foreground">{"✓"}</span>
)}
</P.Item>
))}
@@ -189,7 +190,7 @@ export function IssueActionsMenuItems({
<ActorAvatar actorType="agent" actorId={a.id} size={16} />
{a.name}
{issue.assignee_type === "agent" && issue.assignee_id === a.id && (
- <span className="ml-auto text-xs text-muted-foreground">✓</span>
+ <span className="ml-auto text-xs text-muted-foreground">{"✓"}</span>
)}
</P.Item>
))}
@@ -200,23 +201,23 @@ export function IssueActionsMenuItems({
<P.Sub>
<P.SubTrigger>
<Calendar className="h-3.5 w-3.5" />
- Due date
+ {t(($) => $.actions.due_date)}
</P.SubTrigger>
<P.SubContent>
<P.Item onClick={() => updateField({ due_date: now().toISOString() })}>
- Today
+ {t(($) => $.actions.due_today)}
</P.Item>
<P.Item onClick={() => updateField({ due_date: inDays(1) })}>
- Tomorrow
+ {t(($) => $.actions.due_tomorrow)}
</P.Item>
<P.Item onClick={() => updateField({ due_date: inDays(7) })}>
- Next week
+ {t(($) => $.actions.due_next_week)}
</P.Item>
{issue.due_date && (
<>
<P.Separator />
<P.Item onClick={() => updateField({ due_date: null })}>
- Clear date
+ {t(($) => $.actions.due_clear)}
</P.Item>
</>
)}
@@ -231,11 +232,11 @@ export function IssueActionsMenuItems({
) : (
<Pin className="h-3.5 w-3.5" />
)}
- {isPinned ? "Unpin from sidebar" : "Pin to sidebar"}
+ {isPinned ? t(($) => $.actions.unpin_from_sidebar) : t(($) => $.actions.pin_to_sidebar)}
</P.Item>
<P.Item onClick={copyLink}>
<Link2 className="h-3.5 w-3.5" />
- Copy link
+ {t(($) => $.actions.copy_link)}
</P.Item>
<P.Separator />
@@ -245,20 +246,20 @@ export function IssueActionsMenuItems({
<P.Sub>
<P.SubTrigger>
<MoreHorizontal className="h-3.5 w-3.5" />
- More
+ {t(($) => $.actions.more)}
</P.SubTrigger>
<P.SubContent>
<P.Item onClick={openCreateSubIssue}>
<Plus className="h-3.5 w-3.5" />
- Create sub-issue
+ {t(($) => $.actions.create_sub_issue)}
</P.Item>
<P.Item onClick={openSetParent}>
<ArrowUp className="h-3.5 w-3.5" />
- Set parent issue...
+ {t(($) => $.actions.set_parent_issue)}
</P.Item>
<P.Item onClick={openAddChild}>
<ArrowDown className="h-3.5 w-3.5" />
- Add sub-issue...
+ {t(($) => $.actions.add_sub_issue)}
</P.Item>
</P.SubContent>
</P.Sub>
@@ -270,7 +271,7 @@ export function IssueActionsMenuItems({
onClick={() => openDeleteConfirm({ onDeletedNavigateTo })}
>
<Trash2 className="h-3.5 w-3.5" />
- Delete issue
+ {t(($) => $.actions.delete_issue)}
</P.Item>
</>
);
diff --git a/packages/views/issues/actions/use-issue-actions.ts b/packages/views/issues/actions/use-issue-actions.ts
index 1faa67fe8b..ee3493ae98 100644
--- a/packages/views/issues/actions/use-issue-actions.ts
+++ b/packages/views/issues/actions/use-issue-actions.ts
@@ -21,6 +21,7 @@ import {
import { pinListOptions, useCreatePin, useDeletePin } from "@multica/core/pins";
import { canAssignAgent } from "../components/pickers";
import { useNavigation } from "../../navigation";
+import { useT } from "../../i18n";
const BACKLOG_HINT_LS_KEY = "multica:backlog-agent-hint-dismissed";
@@ -45,6 +46,7 @@ export interface UseIssueActionsResult {
* `issue` is null.
*/
export function useIssueActions(issue: Issue | null): UseIssueActionsResult {
+ const { t } = useT("issues");
const wsId = useWorkspaceId();
const paths = useWorkspacePaths();
const navigation = useNavigation();
@@ -89,7 +91,7 @@ export function useIssueActions(issue: Issue | null): UseIssueActionsResult {
if (!issueId) return;
updateIssue.mutate(
{ id: issueId, ...updates },
- { onError: () => toast.error("Failed to update issue") },
+ { onError: () => toast.error(t(($) => $.detail.update_failed)) },
);
// Hint: assigning an agent to a backlog issue won't trigger execution
// until the issue is moved to an active status.
@@ -103,7 +105,7 @@ export function useIssueActions(issue: Issue | null): UseIssueActionsResult {
openModal("issue-backlog-agent-hint", { issueId });
}
},
- [issueId, issueStatus, updateIssue, openModal],
+ [issueId, issueStatus, updateIssue, openModal, t],
);
const togglePin = useCallback(() => {
@@ -125,11 +127,11 @@ export function useIssueActions(issue: Issue | null): UseIssueActionsResult {
: path;
try {
await navigator.clipboard.writeText(url);
- toast.success("Link copied");
+ toast.success(t(($) => $.detail.link_copied));
} catch {
- toast.error("Failed to copy link");
+ toast.error(t(($) => $.detail.link_copy_failed));
}
- }, [paths, issueId, navigation]);
+ }, [paths, issueId, navigation, t]);
const openCreateSubIssue = useCallback(() => {
if (!issueId) return;
diff --git a/packages/views/issues/components/agent-live-card.tsx b/packages/views/issues/components/agent-live-card.tsx
index c46f0e4382..85b010fd4a 100644
--- a/packages/views/issues/components/agent-live-card.tsx
+++ b/packages/views/issues/components/agent-live-card.tsx
@@ -14,6 +14,7 @@ import {
buildTimeline,
type TimelineItem,
} from "../../common/task-transcript";
+import { useT } from "../../i18n";
// AgentLiveCard renders a sticky banner at the top of the issue's main
// column for every active task. Each banner shows "agent X is working",
@@ -49,6 +50,7 @@ interface AgentLiveCardProps {
}
export function AgentLiveCard({ issueId }: AgentLiveCardProps) {
+ const { t } = useT("issues");
const { getActorName } = useActorName();
const [taskStates, setTaskStates] = useState<Map<string, TaskState>>(new Map());
const seenSeqs = useRef(new Set<string>());
@@ -185,7 +187,7 @@ export function AgentLiveCard({ issueId }: AgentLiveCardProps) {
task={firstEntry.task}
items={firstEntry.items}
issueId={issueId}
- agentName={firstEntry.task.agent_id ? getActorName("agent", firstEntry.task.agent_id) : "Agent"}
+ agentName={firstEntry.task.agent_id ? getActorName("agent", firstEntry.task.agent_id) : t(($) => $.agent_live.fallback_name)}
/>
</div>
{/* Additional agents — non-sticky, scroll with the page */}
@@ -197,7 +199,7 @@ export function AgentLiveCard({ issueId }: AgentLiveCardProps) {
task={task}
items={items}
issueId={issueId}
- agentName={task.agent_id ? getActorName("agent", task.agent_id) : "Agent"}
+ agentName={task.agent_id ? getActorName("agent", task.agent_id) : t(($) => $.agent_live.fallback_name)}
/>
))}
</div>
@@ -216,6 +218,7 @@ interface SingleAgentLiveCardProps {
}
function SingleAgentLiveCard({ task, items, issueId, agentName }: SingleAgentLiveCardProps) {
+ const { t } = useT("issues");
const [elapsed, setElapsed] = useState("");
const [cancelling, setCancelling] = useState(false);
@@ -234,10 +237,10 @@ function SingleAgentLiveCard({ task, items, issueId, agentName }: SingleAgentLiv
try {
await api.cancelTask(issueId, task.id);
} catch (e) {
- toast.error(e instanceof Error ? e.message : "Failed to cancel task");
+ toast.error(e instanceof Error ? e.message : t(($) => $.agent_live.cancel_failed));
setCancelling(false);
}
- }, [task.id, issueId, cancelling]);
+ }, [task.id, issueId, cancelling, t]);
const toolCount = items.filter((i) => i.type === "tool_use").length;
@@ -253,10 +256,10 @@ function SingleAgentLiveCard({ task, items, issueId, agentName }: SingleAgentLiv
)}
<div className="flex items-center gap-1.5 text-xs min-w-0">
<Loader2 className="h-3 w-3 animate-spin text-info shrink-0" />
- <span className="font-medium text-foreground truncate">{agentName} is working</span>
+ <span className="font-medium text-foreground truncate">{t(($) => $.agent_live.is_working, { name: agentName })}</span>
<span className="text-muted-foreground tabular-nums shrink-0">{elapsed}</span>
{toolCount > 0 && (
- <span className="text-muted-foreground shrink-0">{toolCount} tools</span>
+ <span className="text-muted-foreground shrink-0">{t(($) => $.agent_live.tool_count, { count: toolCount })}</span>
)}
</div>
<div className="ml-auto flex items-center gap-1 shrink-0">
@@ -265,16 +268,16 @@ function SingleAgentLiveCard({ task, items, issueId, agentName }: SingleAgentLiv
agentName={agentName}
items={items}
isLive
- title="View transcript"
+ title={t(($) => $.agent_live.transcript_button)}
/>
<button
onClick={handleCancel}
disabled={cancelling}
className="flex items-center gap-1 rounded px-1.5 py-0.5 text-xs text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors disabled:opacity-50"
- title="Stop agent"
+ title={t(($) => $.agent_live.stop_tooltip)}
>
{cancelling ? <Loader2 className="h-3 w-3 animate-spin" /> : <Square className="h-3 w-3" />}
- <span>Stop</span>
+ <span>{t(($) => $.agent_live.stop_button)}</span>
</button>
</div>
</div>
diff --git a/packages/views/issues/components/backlog-agent-hint-dialog.tsx b/packages/views/issues/components/backlog-agent-hint-dialog.tsx
index 13cb67fefc..20d63c3268 100644
--- a/packages/views/issues/components/backlog-agent-hint-dialog.tsx
+++ b/packages/views/issues/components/backlog-agent-hint-dialog.tsx
@@ -8,6 +8,7 @@ import {
} from "@multica/ui/components/ui/alert-dialog";
import { Button } from "@multica/ui/components/ui/button";
import { Checkbox } from "@multica/ui/components/ui/checkbox";
+import { useT } from "../../i18n";
interface BacklogAgentHintDialogProps {
open: boolean;
@@ -46,6 +47,7 @@ export function BacklogAgentHintContent({
onDismissPermanently,
onMoveToTodo,
}: BacklogAgentHintContentProps) {
+ const { t } = useT("issues");
const [dontShowAgain, setDontShowAgain] = useState(false);
const handleKeepInBacklog = () => {
@@ -67,11 +69,10 @@ export function BacklogAgentHintContent({
</div>
<div className="min-w-0">
<h2 className="text-base font-semibold">
- Agent is paused in Backlog
+ {t(($) => $.backlog_hint.title)}
</h2>
<p className="mt-1 text-sm leading-5 text-muted-foreground">
- This issue is parked, so the assigned agent will wait. Move it to
- Todo when you want the agent to start.
+ {t(($) => $.backlog_hint.description)}
</p>
</div>
</div>
@@ -79,13 +80,13 @@ export function BacklogAgentHintContent({
<div className="mt-4 grid gap-2 rounded-lg border bg-muted/35 p-3 text-sm">
<div className="flex items-center gap-2 text-muted-foreground">
<Archive className="size-4 shrink-0" />
- <span className="font-medium text-foreground">Backlog</span>
- <span className="text-muted-foreground">keeps the agent paused</span>
+ <span className="font-medium text-foreground">{t(($) => $.backlog_hint.row_backlog_label)}</span>
+ <span className="text-muted-foreground">{t(($) => $.backlog_hint.row_backlog_hint)}</span>
</div>
<div className="flex items-center gap-2 text-muted-foreground">
<ArrowRight className="size-4 shrink-0" />
- <span className="font-medium text-foreground">Todo</span>
- <span className="text-muted-foreground">starts the agent</span>
+ <span className="font-medium text-foreground">{t(($) => $.backlog_hint.row_todo_label)}</span>
+ <span className="text-muted-foreground">{t(($) => $.backlog_hint.row_todo_hint)}</span>
<CheckCircle2 className="ml-auto size-4 shrink-0 text-primary" />
</div>
</div>
@@ -98,7 +99,7 @@ export function BacklogAgentHintContent({
checked={dontShowAgain}
onCheckedChange={(next) => setDontShowAgain(next === true)}
/>
- <span className="truncate">Don&apos;t show this again</span>
+ <span className="truncate">{t(($) => $.backlog_hint.dont_show_again)}</span>
</label>
<div className="flex flex-col-reverse gap-2 sm:flex-row sm:justify-end">
<Button
@@ -107,14 +108,14 @@ export function BacklogAgentHintContent({
className="w-full sm:w-auto"
onClick={handleKeepInBacklog}
>
- Keep in Backlog
+ {t(($) => $.backlog_hint.keep_in_backlog)}
</Button>
<Button
type="button"
className="w-full sm:w-auto"
onClick={handleMoveToTodo}
>
- Move to Todo
+ {t(($) => $.backlog_hint.move_to_todo)}
</Button>
</div>
</div>
diff --git a/packages/views/issues/components/batch-action-toolbar.tsx b/packages/views/issues/components/batch-action-toolbar.tsx
index f58e0c7410..ac0fcb0d65 100644
--- a/packages/views/issues/components/batch-action-toolbar.tsx
+++ b/packages/views/issues/components/batch-action-toolbar.tsx
@@ -18,8 +18,10 @@ import type { UpdateIssueRequest } from "@multica/core/types";
import { useIssueSelectionStore } from "@multica/core/issues/stores/selection-store";
import { useBatchUpdateIssues, useBatchDeleteIssues } from "@multica/core/issues/mutations";
import { StatusPicker, PriorityPicker, AssigneePicker } from "./pickers";
+import { useT } from "../../i18n";
export function BatchActionToolbar() {
+ const { t } = useT("issues");
const selectedIds = useIssueSelectionStore((s) => s.selectedIds);
const clear = useIssueSelectionStore((s) => s.clear);
const count = selectedIds.size;
@@ -39,9 +41,9 @@ export function BatchActionToolbar() {
const handleBatchUpdate = async (updates: Partial<UpdateIssueRequest>) => {
try {
await batchUpdate.mutateAsync({ ids, updates });
- toast.success(`Updated ${count} issue${count > 1 ? "s" : ""}`);
+ toast.success(t(($) => $.batch.update_success, { count }));
} catch {
- toast.error("Failed to update issues");
+ toast.error(t(($) => $.batch.update_failed));
}
};
@@ -49,9 +51,9 @@ export function BatchActionToolbar() {
try {
await batchDelete.mutateAsync(ids);
clear();
- toast.success(`Deleted ${count} issue${count > 1 ? "s" : ""}`);
+ toast.success(t(($) => $.batch.delete_success, { count }));
} catch {
- toast.error("Failed to delete issues");
+ toast.error(t(($) => $.batch.delete_failed));
} finally {
setDeleteOpen(false);
}
@@ -61,7 +63,7 @@ export function BatchActionToolbar() {
<>
<div className="fixed bottom-6 left-1/2 -translate-x-1/2 z-50 flex items-center gap-1 rounded-lg border bg-background px-2 py-1.5 shadow-lg">
<div className="flex items-center gap-1.5 pl-1 pr-2 border-r mr-1">
- <span className="text-sm font-medium">{count} selected</span>
+ <span className="text-sm font-medium">{t(($) => $.batch.selected, { count })}</span>
<button
type="button"
onClick={clear}
@@ -78,7 +80,7 @@ export function BatchActionToolbar() {
open={statusOpen}
onOpenChange={setStatusOpen}
triggerRender={<Button variant="ghost" size="sm" disabled={loading} />}
- trigger="Status"
+ trigger={t(($) => $.batch.status)}
align="center"
/>
@@ -89,7 +91,7 @@ export function BatchActionToolbar() {
open={priorityOpen}
onOpenChange={setPriorityOpen}
triggerRender={<Button variant="ghost" size="sm" disabled={loading} />}
- trigger="Priority"
+ trigger={t(($) => $.batch.priority)}
align="center"
/>
@@ -101,7 +103,7 @@ export function BatchActionToolbar() {
open={assigneeOpen}
onOpenChange={setAssigneeOpen}
triggerRender={<Button variant="ghost" size="sm" disabled={loading} />}
- trigger="Assignee"
+ trigger={t(($) => $.batch.assignee)}
align="center"
/>
@@ -114,7 +116,7 @@ export function BatchActionToolbar() {
className="text-destructive hover:text-destructive"
>
<Trash2 className="size-3.5 mr-1" />
- Delete
+ {t(($) => $.batch.delete)}
</Button>
</div>
@@ -122,23 +124,22 @@ export function BatchActionToolbar() {
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>
- Delete {count} issue{count > 1 ? "s" : ""}?
+ {t(($) => $.batch.delete_dialog_title, { count })}
</AlertDialogTitle>
<AlertDialogDescription>
- This action cannot be undone. This will permanently delete the
- selected issue{count > 1 ? "s" : ""} and all associated data.
+ {t(($) => $.batch.delete_dialog_desc, { count })}
<span className="mt-2 block text-xs text-muted-foreground/80">
- Any workspace member can delete issues.
+ {t(($) => $.batch.delete_dialog_warning)}
</span>
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
- <AlertDialogCancel>Cancel</AlertDialogCancel>
+ <AlertDialogCancel>{t(($) => $.batch.cancel)}</AlertDialogCancel>
<AlertDialogAction
onClick={handleBatchDelete}
className="bg-destructive text-destructive-foreground hover:bg-destructive/90"
>
- Delete
+ {t(($) => $.batch.delete)}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
diff --git a/packages/views/issues/components/board-card.tsx b/packages/views/issues/components/board-card.tsx
index 5cd23565bb..11548c2619 100644
--- a/packages/views/issues/components/board-card.tsx
+++ b/packages/views/issues/components/board-card.tsx
@@ -23,6 +23,7 @@ import { ProgressRing } from "./progress-ring";
import type { ChildProgress } from "./list-row";
import { IssueActionsContextMenu } from "../actions";
import { LabelChip } from "../../labels/label-chip";
+import { useT } from "../../i18n";
function formatDate(date: string): string {
return new Date(date).toLocaleDateString("en-US", {
@@ -53,6 +54,7 @@ export const BoardCardContent = memo(function BoardCardContent({
editable?: boolean;
childProgress?: ChildProgress;
}) {
+ const { t } = useT("issues");
const storeProperties = useViewStore((s) => s.cardProperties);
const priorityCfg = PRIORITY_CONFIG[issue.priority];
const wsId = useWorkspaceId();
@@ -68,10 +70,10 @@ export const BoardCardContent = memo(function BoardCardContent({
(updates: Partial<UpdateIssueRequest>) => {
updateIssueMutation.mutate(
{ id: issue.id, ...updates },
- { onError: () => toast.error("Failed to update issue") },
+ { onError: () => toast.error(t(($) => $.card.update_failed)) },
);
},
- [issue.id, updateIssueMutation],
+ [issue.id, updateIssueMutation, t],
);
const showPriority = storeProperties.priority;
@@ -159,7 +161,7 @@ export const BoardCardContent = memo(function BoardCardContent({
trigger={
<span className={`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs font-medium ${priorityCfg.badgeBg} ${priorityCfg.badgeText}`}>
<PriorityIcon priority={issue.priority} className="h-3 w-3" inheritColor />
- {priorityCfg.label}
+ {t(($) => $.priority[issue.priority])}
</span>
}
/>
diff --git a/packages/views/issues/components/board-column.tsx b/packages/views/issues/components/board-column.tsx
index d425ef40e6..e6aa9b9104 100644
--- a/packages/views/issues/components/board-column.tsx
+++ b/packages/views/issues/components/board-column.tsx
@@ -19,6 +19,7 @@ import { useViewStoreApi } from "@multica/core/issues/stores/view-store-context"
import { StatusHeading } from "./status-heading";
import { DraggableBoardCard } from "./board-card";
import type { ChildProgress } from "./list-row";
+import { useT } from "../../i18n";
export function BoardColumn({
status,
@@ -38,6 +39,7 @@ export function BoardColumn({
const cfg = STATUS_CONFIG[status];
const { setNodeRef, isOver } = useDroppable({ id: status });
const viewStoreApi = useViewStoreApi();
+ const { t } = useT("issues");
// Resolve IDs to Issue objects, preserving parent-provided order
const resolvedIssues = useMemo(
@@ -67,7 +69,7 @@ export function BoardColumn({
<DropdownMenuContent align="end">
<DropdownMenuItem onClick={() => viewStoreApi.getState().hideStatus(status)}>
<EyeOff className="size-3.5" />
- Hide column
+ {t(($) => $.board.hide_column)}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
@@ -84,7 +86,7 @@ export function BoardColumn({
</Button>
}
/>
- <TooltipContent>Add issue</TooltipContent>
+ <TooltipContent>{t(($) => $.board.add_issue_tooltip)}</TooltipContent>
</Tooltip>
</div>
</div>
@@ -101,7 +103,7 @@ export function BoardColumn({
</SortableContext>
{issueIds.length === 0 && (
<p className="py-8 text-center text-xs text-muted-foreground">
- No issues
+ {t(($) => $.board.empty_column)}
</p>
)}
{footer}
diff --git a/packages/views/issues/components/board-view.tsx b/packages/views/issues/components/board-view.tsx
index 4cf96b1e67..6d21c8b245 100644
--- a/packages/views/issues/components/board-view.tsx
+++ b/packages/views/issues/components/board-view.tsx
@@ -26,7 +26,7 @@ import {
DropdownMenuContent,
DropdownMenuItem,
} from "@multica/ui/components/ui/dropdown-menu";
-import { ALL_STATUSES, STATUS_CONFIG } from "@multica/core/issues/config";
+import { ALL_STATUSES } from "@multica/core/issues/config";
import { useViewStoreApi, useViewStore } from "@multica/core/issues/stores/view-store-context";
import type { SortField, SortDirection } from "@multica/core/issues/stores/view-store";
import { sortIssues } from "../utils/sort";
@@ -35,6 +35,7 @@ import { BoardColumn } from "./board-column";
import { BoardCardContent } from "./board-card";
import { InfiniteScrollSentinel } from "./infinite-scroll-sentinel";
import type { ChildProgress } from "./list-row";
+import { useT } from "../../i18n";
const COLUMN_IDS = new Set<string>(ALL_STATUSES);
@@ -350,11 +351,12 @@ function HiddenColumnsPanel({
hiddenStatuses: IssueStatus[];
myIssuesOpts?: { scope: string; filter: MyIssuesFilter };
}) {
+ const { t } = useT("issues");
return (
<div className="flex w-[240px] shrink-0 flex-col">
<div className="mb-2 flex items-center gap-2 px-1">
<span className="text-sm font-medium text-muted-foreground">
- Hidden columns
+ {t(($) => $.board.hidden_columns_label)}
</span>
</div>
<div className="flex-1 space-y-0.5">
@@ -377,14 +379,14 @@ function HiddenColumnRow({
status: IssueStatus;
myIssuesOpts?: { scope: string; filter: MyIssuesFilter };
}) {
- const cfg = STATUS_CONFIG[status];
+ const { t } = useT("issues");
const viewStoreApi = useViewStoreApi();
const { total } = useLoadMoreByStatus(status, myIssuesOpts);
return (
<div className="flex items-center justify-between rounded-lg px-2.5 py-2 hover:bg-muted/50">
<div className="flex items-center gap-2">
<StatusIcon status={status} className="h-3.5 w-3.5" />
- <span className="text-sm">{cfg.label}</span>
+ <span className="text-sm">{t(($) => $.status[status])}</span>
</div>
<div className="flex items-center gap-1.5">
<span className="text-xs text-muted-foreground">{total}</span>
@@ -405,7 +407,7 @@ function HiddenColumnRow({
onClick={() => viewStoreApi.getState().showStatus(status)}
>
<Eye className="size-3.5" />
- Show column
+ {t(($) => $.board.show_column)}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
diff --git a/packages/views/issues/components/comment-card.tsx b/packages/views/issues/components/comment-card.tsx
index 5a1dfc83d7..266b7dc0d8 100644
--- a/packages/views/issues/components/comment-card.tsx
+++ b/packages/views/issues/components/comment-card.tsx
@@ -37,6 +37,7 @@ import { api } from "@multica/core/api";
import { ReplyInput } from "./reply-input";
import type { TimelineEntry, Attachment } from "@multica/core/types";
import { useCommentCollapseStore } from "@multica/core/issues/stores";
+import { useT } from "../../i18n";
// ---------------------------------------------------------------------------
// Types
@@ -78,21 +79,22 @@ function DeleteCommentDialog({
onConfirm: () => void;
hasReplies?: boolean;
}) {
+ const { t } = useT("issues");
return (
<AlertDialog open={open} onOpenChange={onOpenChange}>
<AlertDialogContent>
<AlertDialogHeader>
- <AlertDialogTitle>Delete comment</AlertDialogTitle>
+ <AlertDialogTitle>{t(($) => $.comment.delete_title)}</AlertDialogTitle>
<AlertDialogDescription>
{hasReplies
- ? "This comment and all its replies will be permanently deleted. This cannot be undone."
- : "This comment will be permanently deleted. This cannot be undone."}
+ ? t(($) => $.comment.delete_desc_with_replies)
+ : t(($) => $.comment.delete_desc)}
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
- <AlertDialogCancel>Cancel</AlertDialogCancel>
+ <AlertDialogCancel>{t(($) => $.comment.cancel_action)}</AlertDialogCancel>
<AlertDialogAction variant="destructive" onClick={onConfirm}>
- Delete
+ {t(($) => $.comment.delete_action)}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
@@ -174,6 +176,7 @@ function CommentRow({
onDelete: (commentId: string) => void;
onToggleReaction: (commentId: string, emoji: string) => void;
}) {
+ const { t } = useT("issues");
const { getActorName } = useActorName();
const [editing, setEditing] = useState(false);
const editEditorRef = useRef<ContentEditorRef>(null);
@@ -214,7 +217,7 @@ function CommentRow({
await onEdit(entry.id, trimmed);
setEditing(false);
} catch {
- toast.error("Failed to update comment");
+ toast.error(t(($) => $.comment.update_failed));
}
};
@@ -259,10 +262,10 @@ function CommentRow({
<DropdownMenuContent align="end">
<DropdownMenuItem onClick={() => {
copyMarkdown(entry.content ?? "");
- toast.success("Copied");
+ toast.success(t(($) => $.comment.copied_toast));
}}>
<Copy className="h-3.5 w-3.5" />
- Copy
+ {t(($) => $.comment.copy_action)}
</DropdownMenuItem>
{(canEditEntry || canDeleteEntry) && (
<>
@@ -270,14 +273,14 @@ function CommentRow({
{canEditEntry && (
<DropdownMenuItem onClick={startEdit}>
<Pencil className="h-3.5 w-3.5" />
- Edit
+ {t(($) => $.comment.edit_action)}
</DropdownMenuItem>
)}
{canEditEntry && canDeleteEntry && <DropdownMenuSeparator />}
{canDeleteEntry && (
<DropdownMenuItem onClick={() => setConfirmDelete(true)} variant="destructive">
<Trash2 className="h-3.5 w-3.5" />
- Delete
+ {t(($) => $.comment.delete_action)}
</DropdownMenuItem>
)}
</>
@@ -303,7 +306,7 @@ function CommentRow({
<ContentEditor
ref={editEditorRef}
defaultValue={entry.content ?? ""}
- placeholder="Edit comment..."
+ placeholder={t(($) => $.comment.edit_placeholder)}
onSubmit={saveEdit}
onUploadFile={(file) => uploadWithToast(file, { issueId })}
debounceMs={100}
@@ -316,8 +319,8 @@ function CommentRow({
onSelect={(file) => editEditorRef.current?.uploadFile(file)}
/>
<div className="flex items-center gap-2">
- <Button size="sm" variant="ghost" onClick={cancelEdit}>Cancel</Button>
- <Button size="sm" variant="outline" onClick={saveEdit}>Save</Button>
+ <Button size="sm" variant="ghost" onClick={cancelEdit}>{t(($) => $.comment.cancel_edit)}</Button>
+ <Button size="sm" variant="outline" onClick={saveEdit}>{t(($) => $.comment.save_action)}</Button>
</div>
</div>
{isDragOver && <FileDropOverlay />}
@@ -360,6 +363,7 @@ function CommentCardImpl({
onToggleReaction,
highlightedCommentId,
}: CommentCardProps) {
+ const { t } = useT("issues");
const { getActorName } = useActorName();
const { uploadWithToast } = useFileUpload(api);
const isCollapsed = useCommentCollapseStore((s) => s.isCollapsed(issueId, entry.id));
@@ -408,7 +412,7 @@ function CommentCardImpl({
await onEdit(entry.id, trimmed);
setEditing(false);
} catch {
- toast.error("Failed to update comment");
+ toast.error(t(($) => $.comment.update_failed));
}
};
@@ -464,7 +468,7 @@ function CommentCardImpl({
)}
{!open && replyCount > 0 && (
<span className="shrink-0 text-xs text-muted-foreground">
- {replyCount} {replyCount === 1 ? "reply" : "replies"}
+ {t(($) => $.comment.reply_count, { count: replyCount })}
</span>
)}
@@ -485,10 +489,10 @@ function CommentCardImpl({
<DropdownMenuContent align="end">
<DropdownMenuItem onClick={() => {
copyMarkdown(entry.content ?? "");
- toast.success("Copied");
+ toast.success(t(($) => $.comment.copied_toast));
}}>
<Copy className="h-3.5 w-3.5" />
- Copy
+ {t(($) => $.comment.copy_action)}
</DropdownMenuItem>
{(canEditEntry || canDeleteEntry) && (
<>
@@ -496,14 +500,14 @@ function CommentCardImpl({
{canEditEntry && (
<DropdownMenuItem onClick={startEdit}>
<Pencil className="h-3.5 w-3.5" />
- Edit
+ {t(($) => $.comment.edit_action)}
</DropdownMenuItem>
)}
{canEditEntry && canDeleteEntry && <DropdownMenuSeparator />}
{canDeleteEntry && (
<DropdownMenuItem onClick={() => setConfirmDelete(true)} variant="destructive">
<Trash2 className="h-3.5 w-3.5" />
- Delete
+ {t(($) => $.comment.delete_action)}
</DropdownMenuItem>
)}
</>
@@ -535,7 +539,7 @@ function CommentCardImpl({
<ContentEditor
ref={editEditorRef}
defaultValue={entry.content ?? ""}
- placeholder="Edit comment..."
+ placeholder={t(($) => $.comment.edit_placeholder)}
onSubmit={saveEdit}
onUploadFile={(file) => uploadWithToast(file, { issueId })}
debounceMs={100}
@@ -548,8 +552,8 @@ function CommentCardImpl({
onSelect={(file) => editEditorRef.current?.uploadFile(file)}
/>
<div className="flex items-center gap-2">
- <Button size="sm" variant="ghost" onClick={cancelEdit}>Cancel</Button>
- <Button size="sm" variant="outline" onClick={saveEdit}>Save</Button>
+ <Button size="sm" variant="ghost" onClick={cancelEdit}>{t(($) => $.comment.cancel_edit)}</Button>
+ <Button size="sm" variant="outline" onClick={saveEdit}>{t(($) => $.comment.save_action)}</Button>
</div>
</div>
{parentDragOver && <FileDropOverlay />}
@@ -593,7 +597,7 @@ function CommentCardImpl({
<div className="border-t border-border/50 px-4 py-2.5">
<ReplyInput
issueId={issueId}
- placeholder="Leave a reply..."
+ placeholder={t(($) => $.reply.placeholder)}
size="sm"
avatarType="member"
avatarId={currentUserId ?? ""}
diff --git a/packages/views/issues/components/comment-input.tsx b/packages/views/issues/components/comment-input.tsx
index daecb405a8..436b9495ea 100644
--- a/packages/views/issues/components/comment-input.tsx
+++ b/packages/views/issues/components/comment-input.tsx
@@ -9,6 +9,7 @@ import { ContentEditor, type ContentEditorRef, useFileDropZone, FileDropOverlay
import { FileUploadButton } from "@multica/ui/components/common/file-upload-button";
import { useFileUpload } from "@multica/core/hooks/use-file-upload";
import { api } from "@multica/core/api";
+import { useT } from "../../i18n";
interface CommentInputProps {
issueId: string;
@@ -16,6 +17,7 @@ interface CommentInputProps {
}
function CommentInput({ issueId, onSubmit }: CommentInputProps) {
+ const { t } = useT("issues");
const editorRef = useRef<ContentEditorRef>(null);
const [isEmpty, setIsEmpty] = useState(true);
const [submitting, setSubmitting] = useState(false);
@@ -64,7 +66,7 @@ function CommentInput({ issueId, onSubmit }: CommentInputProps) {
<div className="flex-1 min-h-0 overflow-y-auto px-3 py-2">
<ContentEditor
ref={editorRef}
- placeholder="Leave a comment..."
+ placeholder={t(($) => $.comment.leave_comment_placeholder)}
onUpdate={(md) => setIsEmpty(!md.trim())}
onSubmit={handleSubmit}
onUploadFile={handleUpload}
@@ -88,7 +90,7 @@ function CommentInput({ issueId, onSubmit }: CommentInputProps) {
</button>
}
/>
- <TooltipContent side="top">{isExpanded ? "Collapse" : "Expand"}</TooltipContent>
+ <TooltipContent side="top">{isExpanded ? t(($) => $.comment.collapse_tooltip) : t(($) => $.comment.expand_tooltip)}</TooltipContent>
</Tooltip>
<FileUploadButton
size="sm"
diff --git a/packages/views/issues/components/execution-log-section.tsx b/packages/views/issues/components/execution-log-section.tsx
index 93a2b3e31f..b1bdcf9007 100644
--- a/packages/views/issues/components/execution-log-section.tsx
+++ b/packages/views/issues/components/execution-log-section.tsx
@@ -16,6 +16,7 @@ import {
import { ActorAvatar } from "../../common/actor-avatar";
import { TranscriptButton } from "../../common/task-transcript";
import { failureReasonLabel } from "../../agents/components/tabs/task-failure";
+import { useT } from "../../i18n";
// Mask gradient that fades the trigger-summary text into transparency at
// the right edge. Mirrors the pattern used by the desktop tab bar
@@ -65,6 +66,7 @@ const PAST_STATUS_RANK: Record<string, number> = {
};
export function ExecutionLogSection({ issueId }: ExecutionLogSectionProps) {
+ const { t } = useT("issues");
const [open, setOpen] = useState(true);
const [showPast, setShowPast] = useState(false);
@@ -122,7 +124,7 @@ export function ExecutionLogSection({ issueId }: ExecutionLogSectionProps) {
}`}
onClick={() => setOpen(!open)}
>
- Execution log
+ {t(($) => $.execution_log.section)}
<ChevronRight
className={`!size-3 shrink-0 stroke-[2.5] text-muted-foreground transition-transform ${
open ? "rotate-90" : ""
@@ -156,7 +158,9 @@ export function ExecutionLogSection({ issueId }: ExecutionLogSectionProps) {
showPast ? "rotate-90" : ""
}`}
/>
- {showPast ? "Hide" : "Show"} past runs ({pastTasks.length})
+ {showPast
+ ? t(($) => $.execution_log.hide_past, { count: pastTasks.length })
+ : t(($) => $.execution_log.show_past, { count: pastTasks.length })}
</button>
{showPast && (
<div className="mt-0.5 space-y-0.5">
@@ -189,35 +193,16 @@ export function ExecutionLogSection({ issueId }: ExecutionLogSectionProps) {
// shipped, OR for sources we don't snapshot (direct assignment / chat):
// degrade to a short structural label by trigger source. New tasks
// (post-061 migration) almost always hit the snapshot path.
-function buildTriggerText(task: AgentTask): string {
- const isRetry = !!task.parent_task_id;
- const retryPrefix = isRetry
- ? task.attempt && task.attempt > 1
- ? `Retry #${task.attempt} · `
- : "Retry · "
- : "";
-
- if (task.trigger_summary) return retryPrefix + task.trigger_summary;
- if (isRetry) {
- return task.attempt && task.attempt > 1 ? `Retry #${task.attempt}` : "Retry";
- }
- if (task.autopilot_run_id) return "Autopilot run";
- if (task.trigger_comment_id) return "Comment trigger";
- return "Initial run";
-}
// ─── Row visual config ─────────────────────────────────────────────────────
-const STATUS_VISUAL: Record<
- AgentTask["status"],
- { label: string; tone: string }
-> = {
- queued: { label: "Queued", tone: "text-warning" },
- dispatched: { label: "Starting", tone: "text-warning" },
- running: { label: "Working", tone: "text-info" },
- completed: { label: "Completed", tone: "text-success" },
- failed: { label: "Failed", tone: "text-destructive" },
- cancelled: { label: "Cancelled", tone: "text-muted-foreground" },
+const STATUS_TONE: Record<AgentTask["status"], string> = {
+ queued: "text-warning",
+ dispatched: "text-warning",
+ running: "text-info",
+ completed: "text-success",
+ failed: "text-destructive",
+ cancelled: "text-muted-foreground",
};
// Time anchor depends on status. Active rows want "Started 2m ago" /
@@ -235,10 +220,44 @@ function activeTimeText(task: AgentTask): string {
// ─── Active row ────────────────────────────────────────────────────────────
+function useTriggerText(task: AgentTask): string {
+ const { t } = useT("issues");
+ const isRetry = !!task.parent_task_id;
+ const retryPrefix = isRetry
+ ? task.attempt && task.attempt > 1
+ ? t(($) => $.execution_log.trigger_retry_attempt_prefix, { attempt: task.attempt })
+ : t(($) => $.execution_log.trigger_retry_prefix)
+ : "";
+
+ if (task.trigger_summary) return retryPrefix + task.trigger_summary;
+ if (isRetry) {
+ return task.attempt && task.attempt > 1
+ ? t(($) => $.execution_log.trigger_retry_attempt, { attempt: task.attempt })
+ : t(($) => $.execution_log.trigger_retry);
+ }
+ if (task.autopilot_run_id) return t(($) => $.execution_log.trigger_autopilot);
+ if (task.trigger_comment_id) return t(($) => $.execution_log.trigger_comment);
+ return t(($) => $.execution_log.trigger_initial);
+}
+
+function useStatusLabel(status: AgentTask["status"]): string {
+ const { t } = useT("issues");
+ switch (status) {
+ case "queued": return t(($) => $.execution_log.status_queued);
+ case "dispatched": return t(($) => $.execution_log.status_dispatched);
+ case "running": return t(($) => $.execution_log.status_running);
+ case "completed": return t(($) => $.execution_log.status_completed);
+ case "failed": return t(($) => $.execution_log.status_failed);
+ case "cancelled": return t(($) => $.execution_log.status_cancelled);
+ }
+}
+
function ActiveRow({ task, issueId }: { task: AgentTask; issueId: string }) {
+ const { t } = useT("issues");
const [cancelling, setCancelling] = useState(false);
- const cfg = STATUS_VISUAL[task.status];
- const trigger = buildTriggerText(task);
+ const tone = STATUS_TONE[task.status];
+ const label = useStatusLabel(task.status);
+ const trigger = useTriggerText(task);
const time = activeTimeText(task);
// Transcript only meaningful once messages exist — pure-queued tasks
@@ -251,7 +270,7 @@ function ActiveRow({ task, issueId }: { task: AgentTask; issueId: string }) {
try {
await api.cancelTask(issueId, task.id);
} catch (e) {
- toast.error(e instanceof Error ? e.message : "Failed to cancel task");
+ toast.error(e instanceof Error ? e.message : t(($) => $.execution_log.cancel_failed));
setCancelling(false);
}
};
@@ -262,7 +281,7 @@ function ActiveRow({ task, issueId }: { task: AgentTask; issueId: string }) {
{/* Status + time always visible — actions append on hover, never
replace. Same pattern as desktop tab bar / sidebar pins. */}
<span className="shrink-0 whitespace-nowrap text-xs">
- <span className={cfg.tone}>{cfg.label}</span>
+ <span className={tone}>{label}</span>
<span className="text-muted-foreground"> · {time}</span>
</span>
<RowActions>
@@ -271,7 +290,7 @@ function ActiveRow({ task, issueId }: { task: AgentTask; issueId: string }) {
task={task}
agentName=""
isLive
- title="View transcript"
+ title={t(($) => $.execution_log.transcript_tooltip)}
/>
)}
<Tooltip>
@@ -281,7 +300,7 @@ function ActiveRow({ task, issueId }: { task: AgentTask; issueId: string }) {
type="button"
onClick={handleCancel}
disabled={cancelling}
- aria-label="Cancel task"
+ aria-label={t(($) => $.execution_log.cancel_task_aria)}
/>
}
className="flex items-center justify-center rounded p-1 text-destructive transition-colors hover:bg-destructive/10 disabled:cursor-not-allowed disabled:opacity-50"
@@ -292,7 +311,7 @@ function ActiveRow({ task, issueId }: { task: AgentTask; issueId: string }) {
<Square className="h-3.5 w-3.5" />
)}
</TooltipTrigger>
- <TooltipContent>Cancel task</TooltipContent>
+ <TooltipContent>{t(($) => $.execution_log.cancel_task_tooltip)}</TooltipContent>
</Tooltip>
</RowActions>
</RowShell>
@@ -302,8 +321,10 @@ function ActiveRow({ task, issueId }: { task: AgentTask; issueId: string }) {
// ─── Past row ──────────────────────────────────────────────────────────────
function PastRow({ task }: { task: AgentTask }) {
- const cfg = STATUS_VISUAL[task.status];
- const trigger = buildTriggerText(task);
+ const { t } = useT("issues");
+ const tone = STATUS_TONE[task.status];
+ const label = useStatusLabel(task.status);
+ const trigger = useTriggerText(task);
const time = task.completed_at ? timeAgo(task.completed_at) : "—";
const failureLabel =
task.status === "failed" && task.failure_reason
@@ -314,11 +335,11 @@ function PastRow({ task }: { task: AgentTask }) {
<RowShell task={task}>
<TriggerText text={trigger} />
<span className="shrink-0 whitespace-nowrap text-xs">
- <span className={cfg.tone}>{failureLabel ?? cfg.label}</span>
+ <span className={tone}>{failureLabel ?? label}</span>
<span className="text-muted-foreground"> · {time}</span>
</span>
<RowActions>
- <TranscriptButton task={task} agentName="" title="View transcript" />
+ <TranscriptButton task={task} agentName="" title={t(($) => $.execution_log.transcript_tooltip)} />
</RowActions>
</RowShell>
);
diff --git a/packages/views/issues/components/issue-detail.test.tsx b/packages/views/issues/components/issue-detail.test.tsx
index 691356326e..5f63783a91 100644
--- a/packages/views/issues/components/issue-detail.test.tsx
+++ b/packages/views/issues/components/issue-detail.test.tsx
@@ -3,6 +3,11 @@ import { describe, it, expect, vi, beforeEach } from "vitest";
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import type { Issue, TimelineEntry } from "@multica/core/types";
+import { I18nProvider } from "@multica/core/i18n/react";
+import enCommon from "../../locales/en/common.json";
+import enIssues from "../../locales/en/issues.json";
+
+const TEST_RESOURCES = { en: { common: enCommon, issues: enIssues } };
const mockViewport = vi.hoisted(() => ({ isMobile: false }));
@@ -358,9 +363,11 @@ function createTestQueryClient() {
function renderIssueDetail(issueId = "issue-1") {
const queryClient = createTestQueryClient();
return render(
- <QueryClientProvider client={queryClient}>
- <IssueDetail issueId={issueId} />
- </QueryClientProvider>,
+ <I18nProvider locale="en" resources={TEST_RESOURCES}>
+ <QueryClientProvider client={queryClient}>
+ <IssueDetail issueId={issueId} />
+ </QueryClientProvider>
+ </I18nProvider>,
);
}
diff --git a/packages/views/issues/components/issue-detail.tsx b/packages/views/issues/components/issue-detail.tsx
index a4e2bc79a3..9ce37aacb9 100644
--- a/packages/views/issues/components/issue-detail.tsx
+++ b/packages/views/issues/components/issue-detail.tsx
@@ -65,6 +65,7 @@ import { timeAgo } from "@multica/core/utils";
import { cn } from "@multica/ui/lib/utils";
import { ProgressRing } from "./progress-ring";
+import { useT } from "../../i18n";
function shortDate(date: string | null): string {
if (!date) return "—";
@@ -74,53 +75,67 @@ function shortDate(date: string | null): string {
});
}
-function statusLabel(status: string): string {
- return STATUS_CONFIG[status as IssueStatus]?.label ?? status;
+type ActivityT = ReturnType<typeof useT<"issues">>["t"];
+
+function statusLabel(status: string, t: ActivityT): string {
+ if (status in STATUS_CONFIG) {
+ return t(($) => $.status[status as IssueStatus]);
+ }
+ return status;
}
-function priorityLabel(priority: string): string {
- return PRIORITY_CONFIG[priority as IssuePriority]?.label ?? priority;
+function priorityLabel(priority: string, t: ActivityT): string {
+ if (priority in PRIORITY_CONFIG) {
+ return t(($) => $.priority[priority as IssuePriority]);
+ }
+ return priority;
}
function formatActivity(
entry: TimelineEntry,
+ t: ActivityT,
resolveActorName?: (type: string, id: string) => string,
): string {
const details = (entry.details ?? {}) as Record<string, string>;
switch (entry.action) {
case "created":
- return "created this issue";
+ return t(($) => $.activity.created);
case "status_changed":
- return `changed status from ${statusLabel(details.from ?? "?")} to ${statusLabel(details.to ?? "?")}`;
+ return t(($) => $.activity.status_changed, {
+ from: statusLabel(details.from ?? "?", t),
+ to: statusLabel(details.to ?? "?", t),
+ });
case "priority_changed":
- return `changed priority from ${priorityLabel(details.from ?? "?")} to ${priorityLabel(details.to ?? "?")}`;
+ return t(($) => $.activity.priority_changed, {
+ from: priorityLabel(details.from ?? "?", t),
+ to: priorityLabel(details.to ?? "?", t),
+ });
case "assignee_changed": {
const isSelfAssign = details.to_type === entry.actor_type && details.to_id === entry.actor_id;
- if (isSelfAssign) return "self-assigned this issue";
+ if (isSelfAssign) return t(($) => $.activity.self_assigned);
const toName = details.to_id && details.to_type && resolveActorName
? resolveActorName(details.to_type, details.to_id)
: null;
- if (toName) return `assigned to ${toName}`;
- if (details.from_id && !details.to_id) return "removed assignee";
- return "changed assignee";
+ if (toName) return t(($) => $.activity.assigned_to, { name: toName });
+ if (details.from_id && !details.to_id) return t(($) => $.activity.removed_assignee);
+ return t(($) => $.activity.changed_assignee);
}
case "due_date_changed": {
- if (!details.to) return "removed due date";
+ if (!details.to) return t(($) => $.activity.due_date_removed);
const formatted = new Date(details.to).toLocaleDateString("en-US", { month: "short", day: "numeric" });
- return `set due date to ${formatted}`;
+ return t(($) => $.activity.due_date_set, { date: formatted });
}
case "title_changed":
- return `renamed this issue from "${details.from ?? "?"}" to "${details.to ?? "?"}"`;
+ return t(($) => $.activity.title_renamed, {
+ from: details.from ?? "?",
+ to: details.to ?? "?",
+ });
case "description_updated":
- return "updated the description";
- case "task_completed": {
- const n = entry.coalesced_count ?? 1;
- return n > 1 ? `completed the task (${n} times)` : "completed the task";
- }
- case "task_failed": {
- const n = entry.coalesced_count ?? 1;
- return n > 1 ? `task failed (${n} times)` : "task failed";
- }
+ return t(($) => $.activity.description_updated);
+ case "task_completed":
+ return t(($) => $.activity.task_completed, { count: entry.coalesced_count ?? 1 });
+ case "task_failed":
+ return t(($) => $.activity.task_failed, { count: entry.coalesced_count ?? 1 });
default:
return entry.action ?? "";
}
@@ -157,6 +172,7 @@ interface IssueDetailProps {
// ---------------------------------------------------------------------------
export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = true, layoutId = "multica_issue_detail_layout", highlightCommentId }: IssueDetailProps) {
+ const { t } = useT("issues");
const id = issueId;
const router = useNavigation();
const user = useAuthStore((s) => s.user);
@@ -435,11 +451,11 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
if (!issue) {
return (
<div className="flex flex-1 min-h-0 flex-col items-center justify-center gap-3 text-sm text-muted-foreground">
- <p>This issue does not exist or has been deleted in this workspace.</p>
+ <p>{t(($) => $.detail.not_found)}</p>
{!onDelete && (
<Button variant="outline" size="sm" onClick={() => router.push(paths.issues())}>
<ChevronLeft className="mr-1 h-3.5 w-3.5" />
- Back to Issues
+ {t(($) => $.detail.back_to_issues)}
</Button>
)}
</div>
@@ -454,26 +470,26 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
className={`flex w-full items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors mb-2 hover:bg-accent/70 ${propertiesOpen ? "" : "text-muted-foreground hover:text-foreground"}`}
onClick={() => setPropertiesOpen(!propertiesOpen)}
>
- Properties
+ {t(($) => $.detail.section_properties)}
<ChevronRight className={`!size-3 shrink-0 stroke-[2.5] text-muted-foreground transition-transform ${propertiesOpen ? "rotate-90" : ""}`} />
</button>
{propertiesOpen && <div className="grid grid-cols-[auto_1fr] gap-x-2 gap-y-0.5 pl-2">
- <PropRow label="Status">
+ <PropRow label={t(($) => $.detail.prop_status)}>
<StatusPicker status={issue.status} onUpdate={handleUpdateField} align="start" />
</PropRow>
- <PropRow label="Priority">
+ <PropRow label={t(($) => $.detail.prop_priority)}>
<PriorityPicker priority={issue.priority} onUpdate={handleUpdateField} align="start" />
</PropRow>
- <PropRow label="Assignee">
+ <PropRow label={t(($) => $.detail.prop_assignee)}>
<AssigneePicker assigneeType={issue.assignee_type} assigneeId={issue.assignee_id} onUpdate={handleUpdateField} align="start" />
</PropRow>
- <PropRow label="Due date">
+ <PropRow label={t(($) => $.detail.prop_due_date)}>
<DueDatePicker dueDate={issue.due_date} onUpdate={handleUpdateField} />
</PropRow>
- <PropRow label="Project">
+ <PropRow label={t(($) => $.detail.prop_project)}>
<ProjectPicker projectId={issue.project_id} onUpdate={handleUpdateField} />
</PropRow>
- <PropRow label="Labels">
+ <PropRow label={t(($) => $.detail.prop_labels)}>
<LabelPicker issueId={issue.id} align="start" />
</PropRow>
</div>}
@@ -486,7 +502,7 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
className={`flex w-full items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors mb-2 hover:bg-accent/70 ${parentIssueOpen ? "" : "text-muted-foreground hover:text-foreground"}`}
onClick={() => setParentIssueOpen(!parentIssueOpen)}
>
- Parent issue
+ {t(($) => $.detail.section_parent_issue)}
<ChevronRight className={`!size-3 shrink-0 stroke-[2.5] text-muted-foreground transition-transform ${parentIssueOpen ? "rotate-90" : ""}`} />
</button>
{parentIssueOpen && <div className="pl-2">
@@ -508,18 +524,18 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
className={`flex w-full items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors mb-2 hover:bg-accent/70 ${detailsOpen ? "" : "text-muted-foreground hover:text-foreground"}`}
onClick={() => setDetailsOpen(!detailsOpen)}
>
- Details
+ {t(($) => $.detail.section_details)}
<ChevronRight className={`!size-3 shrink-0 stroke-[2.5] text-muted-foreground transition-transform ${detailsOpen ? "rotate-90" : ""}`} />
</button>
{detailsOpen && <div className="grid grid-cols-[auto_1fr] gap-x-2 gap-y-0.5 pl-2">
- <PropRow label="Created by">
+ <PropRow label={t(($) => $.detail.prop_created_by)}>
<ActorAvatar actorType={issue.creator_type} actorId={issue.creator_id} size={18} enableHoverCard />
<span className="cursor-pointer truncate">{getActorName(issue.creator_type, issue.creator_id)}</span>
</PropRow>
- <PropRow label="Created">
+ <PropRow label={t(($) => $.detail.prop_created)}>
<span className="text-muted-foreground">{shortDate(issue.created_at)}</span>
</PropRow>
- <PropRow label="Updated">
+ <PropRow label={t(($) => $.detail.prop_updated)}>
<span className="text-muted-foreground">{shortDate(issue.updated_at)}</span>
</PropRow>
</div>}
@@ -537,24 +553,27 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
className={`flex w-full items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors mb-2 hover:bg-accent/70 ${tokenUsageOpen ? "" : "text-muted-foreground hover:text-foreground"}`}
onClick={() => setTokenUsageOpen(!tokenUsageOpen)}
>
- Token usage
+ {t(($) => $.detail.section_token_usage)}
<ChevronRight className={`!size-3 shrink-0 stroke-[2.5] text-muted-foreground transition-transform ${tokenUsageOpen ? "rotate-90" : ""}`} />
</button>
{tokenUsageOpen && <div className="grid grid-cols-[auto_1fr] gap-x-2 gap-y-0.5 pl-2">
- <PropRow label="Input">
+ <PropRow label={t(($) => $.detail.prop_input)}>
<span className="text-muted-foreground">{formatTokenCount(usage.total_input_tokens)}</span>
</PropRow>
- <PropRow label="Output">
+ <PropRow label={t(($) => $.detail.prop_output)}>
<span className="text-muted-foreground">{formatTokenCount(usage.total_output_tokens)}</span>
</PropRow>
{(usage.total_cache_read_tokens > 0 || usage.total_cache_write_tokens > 0) && (
- <PropRow label="Cache">
+ <PropRow label={t(($) => $.detail.prop_cache)}>
<span className="text-muted-foreground">
- {formatTokenCount(usage.total_cache_read_tokens)} read / {formatTokenCount(usage.total_cache_write_tokens)} write
+ {t(($) => $.detail.prop_cache_value, {
+ read: formatTokenCount(usage.total_cache_read_tokens),
+ write: formatTokenCount(usage.total_cache_write_tokens),
+ })}
</span>
</PropRow>
)}
- <PropRow label="Runs">
+ <PropRow label={t(($) => $.detail.prop_runs)}>
<span className="text-muted-foreground">{usage.task_count}</span>
</PropRow>
</div>}
@@ -608,7 +627,7 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
</Button>
}
/>
- <TooltipContent side="bottom">Mark as done</TooltipContent>
+ <TooltipContent side="bottom">{t(($) => $.detail.mark_done_tooltip)}</TooltipContent>
</Tooltip>
)}
{onDone && issue.status === "done" && (
@@ -641,7 +660,7 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
</Button>
}
/>
- <TooltipContent side="bottom">{actions.isPinned ? "Unpin from sidebar" : "Pin to sidebar"}</TooltipContent>
+ <TooltipContent side="bottom">{actions.isPinned ? t(($) => $.detail.unpin_tooltip) : t(($) => $.detail.pin_tooltip)}</TooltipContent>
</Tooltip>
<IssueActionsDropdown
issue={issue}
@@ -668,7 +687,7 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
</Button>
}
/>
- <TooltipContent side="bottom">Toggle sidebar</TooltipContent>
+ <TooltipContent side="bottom">{t(($) => $.detail.sidebar_tooltip)}</TooltipContent>
</Tooltip>
</div>
</PageHeader>
@@ -679,7 +698,7 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
<TitleEditor
key={`title-${id}`}
defaultValue={issue.title}
- placeholder="Issue title"
+ placeholder={t(($) => $.detail.title_placeholder)}
className="w-full text-2xl font-bold leading-snug tracking-tight"
onBlur={(value) => {
const trimmed = value.trim();
@@ -692,7 +711,7 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
href={paths.issueDetail(parentIssue.id)}
className="mt-2 inline-flex max-w-full items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors group/parent"
>
- <span className="font-medium shrink-0">Sub-issue of</span>
+ <span className="font-medium shrink-0">{t(($) => $.detail.sub_issue_of)}</span>
<StatusIcon status={parentIssue.status} className="h-3.5 w-3.5 shrink-0" />
<span className="tabular-nums shrink-0">{parentIssue.identifier}</span>
<span className="truncate group-hover/parent:text-foreground">
@@ -717,7 +736,7 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
ref={descEditorRef}
key={id}
defaultValue={issue.description || ""}
- placeholder="Add description..."
+ placeholder={t(($) => $.detail.desc_placeholder)}
onUpdate={(md) => handleUpdateField({ description: md })}
onUploadFile={handleDescriptionUpload}
debounceMs={1500}
@@ -753,7 +772,7 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
}
>
<Plus className="h-3.5 w-3.5" />
- <span>Add sub-issues</span>
+ <span>{t(($) => $.detail.add_sub_issues)}</span>
</button>
</div>
)}
@@ -774,7 +793,7 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
subIssuesCollapsed && "-rotate-90",
)}
/>
- <span>Sub-issues</span>
+ <span>{t(($) => $.detail.sub_issues_label)}</span>
</button>
<div className="inline-flex items-center gap-1.5 rounded-full bg-muted/60 px-2 py-0.5">
<ProgressRing done={doneCount} total={childIssues.length} size={11} />
@@ -794,13 +813,13 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
parent_issue_identifier: issue.identifier,
})
}
- aria-label="Add sub-issue"
+ aria-label={t(($) => $.detail.add_sub_issue_aria)}
>
<Plus className="h-4 w-4" />
</button>
}
/>
- <TooltipContent side="bottom">Add sub-issue</TooltipContent>
+ <TooltipContent side="bottom">{t(($) => $.detail.add_sub_issue_tooltip)}</TooltipContent>
</Tooltip>
</div>
@@ -862,14 +881,14 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
<div>
<div className="flex items-center justify-between">
<div className="flex items-center gap-3">
- <h2 className="text-base font-semibold">Activity</h2>
+ <h2 className="text-base font-semibold">{t(($) => $.detail.activity_section)}</h2>
</div>
<div className="flex items-center gap-2">
<button
onClick={handleToggleSubscribe}
className="text-xs text-muted-foreground hover:text-foreground transition-colors"
>
- {isSubscribed ? "Unsubscribe" : "Subscribe"}
+ {isSubscribed ? t(($) => $.detail.unsubscribe) : t(($) => $.detail.subscribe)}
</button>
<Popover>
<PopoverTrigger className="cursor-pointer hover:opacity-80 transition-opacity">
@@ -896,11 +915,11 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
</PopoverTrigger>
<PopoverContent align="end" className="w-64 p-0">
<Command>
- <CommandInput placeholder="Change subscribers..." />
+ <CommandInput placeholder={t(($) => $.detail.change_subscribers_placeholder)} />
<CommandList className="max-h-64">
- <CommandEmpty>No results found</CommandEmpty>
+ <CommandEmpty>{t(($) => $.detail.no_subscribers_results)}</CommandEmpty>
{members.length > 0 && (
- <CommandGroup heading="Members">
+ <CommandGroup heading={t(($) => $.detail.members_group)}>
{members.filter((m, i, arr) => arr.findIndex((x) => x.user_id === m.user_id) === i).map((m) => {
const sub = subscribers.find((s) => s.user_type === "member" && s.user_id === m.user_id);
const isSubbed = !!sub;
@@ -920,7 +939,7 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
</CommandGroup>
)}
{agents.filter((a) => !a.archived_at).length > 0 && (
- <CommandGroup heading="Agents">
+ <CommandGroup heading={t(($) => $.detail.agents_group)}>
{agents.filter((a) => !a.archived_at).map((a) => {
const sub = subscribers.find((s) => s.user_type === "agent" && s.user_id === a.id);
const isSubbed = !!sub;
@@ -1003,7 +1022,7 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
</div>
<div className="flex min-w-0 flex-1 items-center gap-1">
<span className="shrink-0 font-medium">{getActorName(entry.actor_type, entry.actor_id)}</span>
- <span className="truncate">{formatActivity(entry, getActorName)}</span>
+ <span className="truncate">{formatActivity(entry, t, getActorName)}</span>
<Tooltip>
<TooltipTrigger
render={
diff --git a/packages/views/issues/components/issues-header.tsx b/packages/views/issues/components/issues-header.tsx
index 8d196ba8e0..283719a826 100644
--- a/packages/views/issues/components/issues-header.tsx
+++ b/packages/views/issues/components/issues-header.tsx
@@ -41,9 +41,7 @@ import {
import { Switch } from "@multica/ui/components/ui/switch";
import {
ALL_STATUSES,
- STATUS_CONFIG,
PRIORITY_ORDER,
- PRIORITY_CONFIG,
} from "@multica/core/issues/config";
import { StatusIcon, PriorityIcon } from ".";
import { useQuery } from "@tanstack/react-query";
@@ -66,6 +64,7 @@ import {
} from "@multica/core/issues/stores/issues-scope-store";
import { Tooltip, TooltipTrigger, TooltipContent } from "@multica/ui/components/ui/tooltip";
import type { Issue } from "@multica/core/types";
+import { useT } from "../../i18n";
// ---------------------------------------------------------------------------
// HoverCheck — shadcn official pattern (PR #6862)
@@ -155,11 +154,7 @@ function useIssueCounts(allIssues: Issue[]) {
// Scope config
// ---------------------------------------------------------------------------
-const SCOPES: { value: IssuesScope; label: string; description: string }[] = [
- { value: "all", label: "All", description: "All issues in this workspace" },
- { value: "members", label: "Members", description: "Issues assigned to team members" },
- { value: "agents", label: "Agents", description: "Issues assigned to AI agents" },
-];
+const SCOPE_VALUES: IssuesScope[] = ["all", "members", "agents"];
// ---------------------------------------------------------------------------
// Actor sub-menu content (shared between Assignee and Creator)
@@ -182,6 +177,7 @@ function ActorSubContent({
onToggleNoAssignee?: () => void;
noAssigneeCount?: number;
}) {
+ const { t } = useT("issues");
const [search, setSearch] = useState("");
const wsId = useWorkspaceId();
const { data: members = [] } = useQuery(memberListOptions(wsId));
@@ -204,7 +200,7 @@ function ActorSubContent({
type="text"
value={search}
onChange={(e) => setSearch(e.target.value)}
- placeholder="Filter..."
+ placeholder={t(($) => $.filters.placeholder)}
className="w-full bg-transparent text-sm placeholder:text-muted-foreground outline-none"
autoFocus
/>
@@ -220,7 +216,7 @@ function ActorSubContent({
>
<HoverCheck checked={includeNoAssignee ?? false} />
<UserMinus className="size-3.5 text-muted-foreground" />
- No assignee
+ {t(($) => $.filters.no_assignee)}
{(noAssigneeCount ?? 0) > 0 && (
<span className="ml-auto text-xs text-muted-foreground">
{noAssigneeCount}
@@ -231,7 +227,7 @@ function ActorSubContent({
{filteredMembers.length > 0 && (
<DropdownMenuGroup>
- <DropdownMenuLabel>Members</DropdownMenuLabel>
+ <DropdownMenuLabel>{t(($) => $.filters.members_group)}</DropdownMenuLabel>
{filteredMembers.map((m) => {
const checked = isSelected("member", m.user_id);
const count = counts.get(`member:${m.user_id}`) ?? 0;
@@ -260,7 +256,7 @@ function ActorSubContent({
{filteredAgents.length > 0 && (
<DropdownMenuGroup>
- <DropdownMenuLabel>Agents</DropdownMenuLabel>
+ <DropdownMenuLabel>{t(($) => $.filters.agents_group)}</DropdownMenuLabel>
{filteredAgents.map((a) => {
const checked = isSelected("agent", a.id);
const count = counts.get(`agent:${a.id}`) ?? 0;
@@ -289,7 +285,7 @@ function ActorSubContent({
{filteredMembers.length === 0 && filteredAgents.length === 0 && search && (
<div className="px-2 py-3 text-center text-sm text-muted-foreground">
- No results
+ {t(($) => $.filters.no_results)}
</div>
)}
</div>
@@ -316,6 +312,7 @@ function ProjectSubContent({
onToggleNoProject: () => void;
noProjectCount: number;
}) {
+ const { t } = useT("issues");
const [search, setSearch] = useState("");
const wsId = useWorkspaceId();
const { data: projects = [] } = useQuery(projectListOptions(wsId));
@@ -331,7 +328,7 @@ function ProjectSubContent({
type="text"
value={search}
onChange={(e) => setSearch(e.target.value)}
- placeholder="Filter..."
+ placeholder={t(($) => $.filters.placeholder)}
className="w-full bg-transparent text-sm placeholder:text-muted-foreground outline-none"
autoFocus
/>
@@ -346,7 +343,7 @@ function ProjectSubContent({
>
<HoverCheck checked={includeNoProject} />
<FolderMinus className="size-3.5 text-muted-foreground" />
- No project
+ {t(($) => $.filters.no_project)}
{noProjectCount > 0 && (
<span className="ml-auto text-xs text-muted-foreground">
{noProjectCount}
@@ -379,7 +376,7 @@ function ProjectSubContent({
{filtered.length === 0 && search && (
<div className="px-2 py-3 text-center text-sm text-muted-foreground">
- No results
+ {t(($) => $.filters.no_results)}
</div>
)}
</div>
@@ -400,6 +397,7 @@ function LabelSubContent({
selected: string[];
onToggle: (labelId: string) => void;
}) {
+ const { t } = useT("issues");
const [search, setSearch] = useState("");
const wsId = useWorkspaceId();
const { data: labels = [] } = useQuery(labelListOptions(wsId));
@@ -413,7 +411,7 @@ function LabelSubContent({
type="text"
value={search}
onChange={(e) => setSearch(e.target.value)}
- placeholder="Filter..."
+ placeholder={t(($) => $.filters.placeholder)}
className="w-full bg-transparent text-sm placeholder:text-muted-foreground outline-none"
autoFocus
/>
@@ -443,7 +441,7 @@ function LabelSubContent({
{filtered.length === 0 && (
<div className="px-2 py-3 text-center text-sm text-muted-foreground">
- {search ? "No results" : "No labels yet"}
+ {search ? t(($) => $.filters.no_results) : t(($) => $.filters.no_labels)}
</div>
)}
</div>
@@ -456,6 +454,7 @@ function LabelSubContent({
// ---------------------------------------------------------------------------
export function IssuesHeader({ scopedIssues }: { scopedIssues: Issue[] }) {
+ const { t } = useT("issues");
const scope = useIssuesScopeStore((s) => s.scope);
const setScope = useIssuesScopeStore((s) => s.setScope);
@@ -487,32 +486,57 @@ export function IssuesHeader({ scopedIssues }: { scopedIssues: Issue[] }) {
labelFilters,
}) > 0;
- const sortLabel =
- SORT_OPTIONS.find((o) => o.value === sortBy)?.label ?? "Manual";
+ const SORT_LABEL_KEY: Record<typeof SORT_OPTIONS[number]["value"], "sort_manual" | "sort_priority" | "sort_due_date" | "sort_created" | "sort_title"> = {
+ position: "sort_manual",
+ priority: "sort_priority",
+ due_date: "sort_due_date",
+ created_at: "sort_created",
+ title: "sort_title",
+ };
+ const CARD_PROPERTY_LABEL_KEY: Record<typeof CARD_PROPERTY_OPTIONS[number]["key"], "card_priority" | "card_description" | "card_assignee" | "card_due_date" | "card_project" | "card_labels" | "card_child_progress"> = {
+ priority: "card_priority",
+ description: "card_description",
+ assignee: "card_assignee",
+ dueDate: "card_due_date",
+ project: "card_project",
+ labels: "card_labels",
+ childProgress: "card_child_progress",
+ };
+ const sortLabel = t(($) => $.display[SORT_LABEL_KEY[sortBy]]);
+ const SCOPE_LABEL_KEY: Record<IssuesScope, "all_label" | "members_label" | "agents_label"> = {
+ all: "all_label",
+ members: "members_label",
+ agents: "agents_label",
+ };
+ const SCOPE_DESC_KEY: Record<IssuesScope, "all_description" | "members_description" | "agents_description"> = {
+ all: "all_description",
+ members: "members_description",
+ agents: "agents_description",
+ };
return (
<div className="flex h-12 shrink-0 items-center justify-between px-4">
{/* Left: scope buttons */}
<div className="flex items-center gap-1">
- {SCOPES.map((s) => (
- <Tooltip key={s.value}>
+ {SCOPE_VALUES.map((s) => (
+ <Tooltip key={s}>
<TooltipTrigger
render={
<Button
variant="outline"
size="sm"
className={
- scope === s.value
+ scope === s
? "bg-accent text-accent-foreground hover:bg-accent/80"
: "text-muted-foreground"
}
- onClick={() => setScope(s.value)}
+ onClick={() => setScope(s)}
>
- {s.label}
+ {t(($) => $.scope[SCOPE_LABEL_KEY[s]])}
</Button>
}
/>
- <TooltipContent side="bottom">{s.description}</TooltipContent>
+ <TooltipContent side="bottom">{t(($) => $.scope[SCOPE_DESC_KEY[s]])}</TooltipContent>
</Tooltip>
))}
</div>
@@ -536,14 +560,14 @@ export function IssuesHeader({ scopedIssues }: { scopedIssues: Issue[] }) {
/>
}
/>
- <TooltipContent side="bottom">Filter</TooltipContent>
+ <TooltipContent side="bottom">{t(($) => $.filters.tooltip)}</TooltipContent>
</Tooltip>
<DropdownMenuContent align="end" className="w-auto">
{/* Status */}
<DropdownMenuSub>
<DropdownMenuSubTrigger>
<CircleDot className="size-3.5" />
- <span className="flex-1">Status</span>
+ <span className="flex-1">{t(($) => $.filters.section_status)}</span>
{statusFilters.length > 0 && (
<span className="text-xs text-primary font-medium">
{statusFilters.length}
@@ -563,10 +587,10 @@ export function IssuesHeader({ scopedIssues }: { scopedIssues: Issue[] }) {
>
<HoverCheck checked={checked} />
<StatusIcon status={s} className="h-3.5 w-3.5" />
- {STATUS_CONFIG[s].label}
+ {t(($) => $.status[s])}
{count > 0 && (
<span className="ml-auto text-xs text-muted-foreground">
- {count} {count === 1 ? "issue" : "issues"}
+ {t(($) => $.filters.issue_count, { count })}
</span>
)}
</DropdownMenuCheckboxItem>
@@ -579,7 +603,7 @@ export function IssuesHeader({ scopedIssues }: { scopedIssues: Issue[] }) {
<DropdownMenuSub>
<DropdownMenuSubTrigger>
<SignalHigh className="size-3.5" />
- <span className="flex-1">Priority</span>
+ <span className="flex-1">{t(($) => $.filters.section_priority)}</span>
{priorityFilters.length > 0 && (
<span className="text-xs text-primary font-medium">
{priorityFilters.length}
@@ -599,10 +623,10 @@ export function IssuesHeader({ scopedIssues }: { scopedIssues: Issue[] }) {
>
<HoverCheck checked={checked} />
<PriorityIcon priority={p} />
- {PRIORITY_CONFIG[p].label}
+ {t(($) => $.priority[p])}
{count > 0 && (
<span className="ml-auto text-xs text-muted-foreground">
- {count} {count === 1 ? "issue" : "issues"}
+ {t(($) => $.filters.issue_count, { count })}
</span>
)}
</DropdownMenuCheckboxItem>
@@ -615,7 +639,7 @@ export function IssuesHeader({ scopedIssues }: { scopedIssues: Issue[] }) {
<DropdownMenuSub>
<DropdownMenuSubTrigger>
<User className="size-3.5" />
- <span className="flex-1">Assignee</span>
+ <span className="flex-1">{t(($) => $.filters.section_assignee)}</span>
{(assigneeFilters.length > 0 || includeNoAssignee) && (
<span className="text-xs text-primary font-medium">
{assigneeFilters.length + (includeNoAssignee ? 1 : 0)}
@@ -639,7 +663,7 @@ export function IssuesHeader({ scopedIssues }: { scopedIssues: Issue[] }) {
<DropdownMenuSub>
<DropdownMenuSubTrigger>
<UserPen className="size-3.5" />
- <span className="flex-1">Creator</span>
+ <span className="flex-1">{t(($) => $.filters.section_creator)}</span>
{creatorFilters.length > 0 && (
<span className="text-xs text-primary font-medium">
{creatorFilters.length}
@@ -659,7 +683,7 @@ export function IssuesHeader({ scopedIssues }: { scopedIssues: Issue[] }) {
<DropdownMenuSub>
<DropdownMenuSubTrigger>
<FolderKanban className="size-3.5" />
- <span className="flex-1">Project</span>
+ <span className="flex-1">{t(($) => $.filters.section_project)}</span>
{(projectFilters.length > 0 || includeNoProject) && (
<span className="text-xs text-primary font-medium">
{projectFilters.length + (includeNoProject ? 1 : 0)}
@@ -682,7 +706,7 @@ export function IssuesHeader({ scopedIssues }: { scopedIssues: Issue[] }) {
<DropdownMenuSub>
<DropdownMenuSubTrigger>
<Tag className="size-3.5" />
- <span className="flex-1">Label</span>
+ <span className="flex-1">{t(($) => $.filters.section_label)}</span>
{labelFilters.length > 0 && (
<span className="text-xs text-primary font-medium">
{labelFilters.length}
@@ -703,7 +727,7 @@ export function IssuesHeader({ scopedIssues }: { scopedIssues: Issue[] }) {
<>
<DropdownMenuSeparator />
<DropdownMenuItem onClick={act.clearFilters}>
- Reset all filters
+ {t(($) => $.filters.reset)}
</DropdownMenuItem>
</>
)}
@@ -724,12 +748,12 @@ export function IssuesHeader({ scopedIssues }: { scopedIssues: Issue[] }) {
/>
}
/>
- <TooltipContent side="bottom">Display settings</TooltipContent>
+ <TooltipContent side="bottom">{t(($) => $.display.tooltip)}</TooltipContent>
</Tooltip>
<PopoverContent align="end" className="w-64 p-0">
<div className="border-b px-3 py-2.5">
<span className="text-xs font-medium text-muted-foreground">
- Ordering
+ {t(($) => $.display.ordering_section)}
</span>
<div className="mt-2 flex items-center gap-1.5">
<DropdownMenu>
@@ -751,7 +775,7 @@ export function IssuesHeader({ scopedIssues }: { scopedIssues: Issue[] }) {
key={opt.value}
onClick={() => act.setSortBy(opt.value)}
>
- {opt.label}
+ {t(($) => $.display[SORT_LABEL_KEY[opt.value]])}
</DropdownMenuItem>
))}
</DropdownMenuContent>
@@ -762,7 +786,7 @@ export function IssuesHeader({ scopedIssues }: { scopedIssues: Issue[] }) {
onClick={() =>
act.setSortDirection(sortDirection === "asc" ? "desc" : "asc")
}
- title={sortDirection === "asc" ? "Ascending" : "Descending"}
+ title={sortDirection === "asc" ? t(($) => $.display.ascending_title) : t(($) => $.display.descending_title)}
>
{sortDirection === "asc" ? (
<ArrowUp className="size-3.5" />
@@ -775,7 +799,7 @@ export function IssuesHeader({ scopedIssues }: { scopedIssues: Issue[] }) {
<div className="px-3 py-2.5">
<span className="text-xs font-medium text-muted-foreground">
- Card properties
+ {t(($) => $.display.card_properties_section)}
</span>
<div className="mt-2 space-y-2">
{CARD_PROPERTY_OPTIONS.map((opt) => (
@@ -783,7 +807,7 @@ export function IssuesHeader({ scopedIssues }: { scopedIssues: Issue[] }) {
key={opt.key}
className="flex cursor-pointer items-center justify-between"
>
- <span className="text-sm">{opt.label}</span>
+ <span className="text-sm">{t(($) => $.display[CARD_PROPERTY_LABEL_KEY[opt.key]])}</span>
<Switch
size="sm"
checked={cardProperties[opt.key]}
@@ -815,19 +839,19 @@ export function IssuesHeader({ scopedIssues }: { scopedIssues: Issue[] }) {
}
/>
<TooltipContent side="bottom">
- {viewMode === "board" ? "Board view" : "List view"}
+ {viewMode === "board" ? t(($) => $.view.tooltip_board) : t(($) => $.view.tooltip_list)}
</TooltipContent>
</Tooltip>
<DropdownMenuContent align="end" className="w-auto">
<DropdownMenuGroup>
- <DropdownMenuLabel>View</DropdownMenuLabel>
+ <DropdownMenuLabel>{t(($) => $.view.section)}</DropdownMenuLabel>
<DropdownMenuItem onClick={() => act.setViewMode("board")}>
<Columns3 />
- Board
+ {t(($) => $.view.board)}
</DropdownMenuItem>
<DropdownMenuItem onClick={() => act.setViewMode("list")}>
<List />
- List
+ {t(($) => $.view.list)}
</DropdownMenuItem>
</DropdownMenuGroup>
</DropdownMenuContent>
diff --git a/packages/views/issues/components/issues-page.test.tsx b/packages/views/issues/components/issues-page.test.tsx
index 54db9e80b8..ae562c25ad 100644
--- a/packages/views/issues/components/issues-page.test.tsx
+++ b/packages/views/issues/components/issues-page.test.tsx
@@ -2,6 +2,11 @@ import { describe, it, expect, vi, beforeEach } from "vitest";
import { render, screen } from "@testing-library/react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import type { Issue } from "@multica/core/types";
+import { I18nProvider } from "@multica/core/i18n/react";
+import enCommon from "../../locales/en/common.json";
+import enIssues from "../../locales/en/issues.json";
+
+const TEST_RESOURCES = { en: { common: enCommon, issues: enIssues } };
vi.mock("@multica/core/hooks", () => ({
useWorkspaceId: () => "ws-1",
}));
@@ -338,9 +343,11 @@ function renderWithQuery(ui: React.ReactElement) {
},
});
return render(
- <QueryClientProvider client={qc}>
- {ui}
- </QueryClientProvider>,
+ <I18nProvider locale="en" resources={TEST_RESOURCES}>
+ <QueryClientProvider client={qc}>
+ {ui}
+ </QueryClientProvider>
+ </I18nProvider>,
);
}
diff --git a/packages/views/issues/components/issues-page.tsx b/packages/views/issues/components/issues-page.tsx
index 8946fba7e0..8bc813f1e3 100644
--- a/packages/views/issues/components/issues-page.tsx
+++ b/packages/views/issues/components/issues-page.tsx
@@ -22,8 +22,10 @@ import { IssuesHeader } from "./issues-header";
import { BoardView } from "./board-view";
import { ListView } from "./list-view";
import { BatchActionToolbar } from "./batch-action-toolbar";
+import { useT } from "../../i18n";
export function IssuesPage() {
+ const { t } = useT("issues");
const wsId = useWorkspaceId();
const { data: allIssues = [], isLoading: loading } = useQuery(issueListOptions(wsId));
@@ -84,10 +86,10 @@ export function IssuesPage() {
updateIssueMutation.mutate(
{ id: issueId, ...updates },
- { onError: () => toast.error("Failed to move issue") },
+ { onError: () => toast.error(t(($) => $.page.move_failed)) },
);
},
- [updateIssueMutation],
+ [updateIssueMutation, t],
);
if (loading) {
@@ -136,10 +138,10 @@ export function IssuesPage() {
<PageHeader className="gap-1.5">
<WorkspaceAvatar name={workspace?.name ?? "W"} size="sm" />
<span className="text-sm text-muted-foreground">
- {workspace?.name ?? "Workspace"}
+ {workspace?.name ?? t(($) => $.page.breadcrumb_workspace_fallback)}
</span>
<ChevronRight className="h-3 w-3 text-muted-foreground" />
- <span className="text-sm font-medium">Issues</span>
+ <span className="text-sm font-medium">{t(($) => $.page.breadcrumb_title)}</span>
</PageHeader>
<ViewStoreProvider store={useIssueViewStore}>
@@ -150,8 +152,8 @@ export function IssuesPage() {
{scopedIssues.length === 0 ? (
<div className="flex flex-1 min-h-0 flex-col items-center justify-center gap-2 text-muted-foreground">
<ListTodo className="h-10 w-10 text-muted-foreground/40" />
- <p className="text-sm">No issues yet</p>
- <p className="text-xs">Create an issue to get started.</p>
+ <p className="text-sm">{t(($) => $.page.empty_title)}</p>
+ <p className="text-xs">{t(($) => $.page.empty_hint)}</p>
</div>
) : (
<div className="flex flex-col flex-1 min-h-0">
diff --git a/packages/views/issues/components/labels-panel.tsx b/packages/views/issues/components/labels-panel.tsx
index ed05471d2d..4daf5e0f38 100644
--- a/packages/views/issues/components/labels-panel.tsx
+++ b/packages/views/issues/components/labels-panel.tsx
@@ -21,6 +21,7 @@ import { useWorkspaceId } from "@multica/core/hooks";
import { labelListOptions, useCreateLabel, useUpdateLabel, useDeleteLabel } from "@multica/core/labels";
import type { Label } from "@multica/core/types";
import { LabelChip } from "../../labels/label-chip";
+import { useT } from "../../i18n";
/** Default color for brand-new labels. Everything else goes through the native picker. */
const DEFAULT_COLOR_DEFAULT = "#3b82f6";
@@ -30,6 +31,7 @@ const DEFAULT_COLOR_DEFAULT = "#3b82f6";
* footer in the label picker.
*/
export function LabelsPanel() {
+ const { t } = useT("issues");
const wsId = useWorkspaceId();
const { data: labels = [], isLoading } = useQuery(labelListOptions(wsId));
@@ -58,7 +60,7 @@ export function LabelsPanel() {
setNewColor(DEFAULT_COLOR_DEFAULT);
},
onError: (err: unknown) => {
- toast.error(err instanceof Error ? err.message : "Failed to create label");
+ toast.error(err instanceof Error ? err.message : t(($) => $.labels_panel.create_failed));
},
},
);
@@ -84,7 +86,7 @@ export function LabelsPanel() {
// Surface the reason the save didn't happen — previously this was a
// silent no-op. Button is also disabled (below) but a visible message
// beats a greyed-out button for telling the user WHY.
- setEditError("Label name is required.");
+ setEditError(t(($) => $.labels_panel.name_required));
return;
}
setEditError("");
@@ -93,7 +95,7 @@ export function LabelsPanel() {
{
onSuccess: cancelEdit,
onError: (err: unknown) => {
- toast.error(err instanceof Error ? err.message : "Failed to update label");
+ toast.error(err instanceof Error ? err.message : t(($) => $.labels_panel.update_failed));
},
},
);
@@ -102,7 +104,7 @@ export function LabelsPanel() {
return (
<div className="space-y-6">
<p className="text-sm text-muted-foreground">
- Create and manage labels to categorize issues across your workspace.
+ {t(($) => $.labels_panel.intro)}
</p>
{/* Create form — color swatch, name, Add button all in one row */}
@@ -110,7 +112,7 @@ export function LabelsPanel() {
<ColorPalette value={newColor} onChange={setNewColor} compact />
<Input
id="label-new-name"
- placeholder="New label name…"
+ placeholder={t(($) => $.labels_panel.new_placeholder)}
value={newName}
onChange={(e) => setNewName(e.target.value)}
onKeyDown={(e) => {
@@ -118,19 +120,19 @@ export function LabelsPanel() {
}}
className="flex-1"
maxLength={32}
- aria-label="New label name"
+ aria-label={t(($) => $.labels_panel.new_aria)}
/>
<Button onClick={handleCreate} disabled={!newName.trim() || create.isPending}>
<Plus className="h-4 w-4 mr-1" />
- Add
+ {t(($) => $.labels_panel.add_action)}
</Button>
</div>
{/* List — scrolls when labels exceed viewport */}
<div className="space-y-2 max-h-[50vh] overflow-y-auto">
- {isLoading && <p className="text-sm text-muted-foreground">Loading…</p>}
+ {isLoading && <p className="text-sm text-muted-foreground">{t(($) => $.labels_panel.loading)}</p>}
{!isLoading && labels.length === 0 && (
- <p className="text-sm text-muted-foreground">No labels yet.</p>
+ <p className="text-sm text-muted-foreground">{t(($) => $.labels_panel.empty)}</p>
)}
{labels.map((label) => {
const isEditing = editingId === label.id;
@@ -169,11 +171,11 @@ export function LabelsPanel() {
variant="ghost"
onClick={() => saveEdit(label.id)}
disabled={editNameEmpty || update.isPending}
- aria-label="Save"
+ aria-label={t(($) => $.labels_panel.save_aria)}
>
<Check className="h-4 w-4" />
</Button>
- <Button size="sm" variant="ghost" onClick={cancelEdit} aria-label="Cancel">
+ <Button size="sm" variant="ghost" onClick={cancelEdit} aria-label={t(($) => $.labels_panel.cancel_aria)}>
<X className="h-4 w-4" />
</Button>
</>
@@ -191,7 +193,7 @@ export function LabelsPanel() {
size="sm"
variant="ghost"
onClick={() => startEdit(label)}
- aria-label={`Edit ${label.name}`}
+ aria-label={t(($) => $.labels_panel.edit_aria, { name: label.name })}
>
<Pencil className="h-4 w-4" />
</Button>
@@ -199,7 +201,7 @@ export function LabelsPanel() {
size="sm"
variant="ghost"
onClick={() => setPendingDeletion(label)}
- aria-label={`Delete ${label.name}`}
+ aria-label={t(($) => $.labels_panel.delete_aria, { name: label.name })}
>
<Trash2 className="h-4 w-4 text-destructive" />
</Button>
@@ -223,26 +225,25 @@ export function LabelsPanel() {
<AlertDialog open={!!pendingDeletion} onOpenChange={(o) => !o && setPendingDeletion(null)}>
<AlertDialogContent>
<AlertDialogHeader>
- <AlertDialogTitle>Delete label?</AlertDialogTitle>
+ <AlertDialogTitle>{t(($) => $.labels_panel.delete_dialog_title)}</AlertDialogTitle>
<AlertDialogDescription>
- The label <strong>{pendingDeletion?.name}</strong> will be removed from all
- issues. This cannot be undone.
+ {t(($) => $.labels_panel.delete_dialog_desc_prefix)}<strong>{pendingDeletion?.name}</strong>{t(($) => $.labels_panel.delete_dialog_desc_suffix)}
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
- <AlertDialogCancel>Cancel</AlertDialogCancel>
+ <AlertDialogCancel>{t(($) => $.labels_panel.delete_dialog_cancel)}</AlertDialogCancel>
<AlertDialogAction
onClick={() => {
if (!pendingDeletion) return;
del.mutate(pendingDeletion.id, {
onSuccess: () => setPendingDeletion(null),
onError: (err: unknown) => {
- toast.error(err instanceof Error ? err.message : "Failed to delete label");
+ toast.error(err instanceof Error ? err.message : t(($) => $.labels_panel.delete_failed));
},
});
}}
>
- Delete
+ {t(($) => $.labels_panel.delete_dialog_confirm)}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
@@ -265,14 +266,15 @@ function ColorPalette({
onChange: (c: string) => void;
compact?: boolean;
}) {
+ const { t } = useT("issues");
const size = compact ? "h-7 w-7" : "h-9 w-9";
return (
<div className={compact ? "flex items-center" : "flex items-center gap-3"}>
- {!compact && <UILabel className="text-xs text-muted-foreground">Color</UILabel>}
+ {!compact && <UILabel className="text-xs text-muted-foreground">{t(($) => $.labels_panel.color_label)}</UILabel>}
<label
className={`relative inline-flex ${size} cursor-pointer items-center justify-center rounded-full border border-border shadow-sm transition-transform hover:scale-105 focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-1 focus-within:ring-offset-background`}
style={{ backgroundColor: value }}
- aria-label="Pick a color"
+ aria-label={t(($) => $.labels_panel.pick_color_aria)}
title={value}
>
<input
diff --git a/packages/views/issues/components/list-view.tsx b/packages/views/issues/components/list-view.tsx
index d4d8f00bd0..af44de3d5f 100644
--- a/packages/views/issues/components/list-view.tsx
+++ b/packages/views/issues/components/list-view.tsx
@@ -15,6 +15,7 @@ import { sortIssues } from "../utils/sort";
import { StatusHeading } from "./status-heading";
import { ListRow, type ChildProgress } from "./list-row";
import { InfiniteScrollSentinel } from "./infinite-scroll-sentinel";
+import { useT } from "../../i18n";
const EMPTY_PROGRESS_MAP = new Map<string, ChildProgress>();
@@ -103,6 +104,7 @@ function StatusAccordionItem({
childProgressMap: Map<string, ChildProgress>;
myIssuesOpts?: { scope: string; filter: MyIssuesFilter };
}) {
+ const { t } = useT("issues");
const selectedIds = useIssueSelectionStore((s) => s.selectedIds);
const select = useIssueSelectionStore((s) => s.select);
const deselect = useIssueSelectionStore((s) => s.deselect);
@@ -158,7 +160,7 @@ function StatusAccordionItem({
>
<Plus className="size-3.5" />
</TooltipTrigger>
- <TooltipContent>Add issue</TooltipContent>
+ <TooltipContent>{t(($) => $.list.add_issue_tooltip)}</TooltipContent>
</Tooltip>
</div>
</Accordion.Header>
@@ -174,7 +176,7 @@ function StatusAccordionItem({
</>
) : (
<p className="py-6 text-center text-xs text-muted-foreground">
- No issues
+ {t(($) => $.list.empty_status)}
</p>
)}
</Accordion.Panel>
diff --git a/packages/views/issues/components/pickers/assignee-picker.tsx b/packages/views/issues/components/pickers/assignee-picker.tsx
index 418aa1e5be..11ba223477 100644
--- a/packages/views/issues/components/pickers/assignee-picker.tsx
+++ b/packages/views/issues/components/pickers/assignee-picker.tsx
@@ -16,6 +16,7 @@ import {
PickerSection,
PickerEmpty,
} from "./property-picker";
+import { useT } from "../../../i18n";
/**
* Legacy boolean shape kept around for callers (e.g. `use-issue-actions.ts`)
@@ -54,6 +55,7 @@ export function AssigneePicker({
onOpenChange?: (v: boolean) => void;
align?: "start" | "center" | "end";
}) {
+ const { t } = useT("issues");
const [internalOpen, setInternalOpen] = useState(false);
const open = controlledOpen ?? internalOpen;
const setOpen = controlledOnOpenChange ?? setInternalOpen;
@@ -93,7 +95,7 @@ export function AssigneePicker({
const triggerLabel =
assigneeType && assigneeId
? getActorName(assigneeType, assigneeId)
- : "Unassigned";
+ : t(($) => $.pickers.assignee.trigger_unassigned);
return (
<PropertyPicker
@@ -105,7 +107,7 @@ export function AssigneePicker({
width="w-52"
align={align}
searchable
- searchPlaceholder="Assign to..."
+ searchPlaceholder={t(($) => $.pickers.assignee.search_placeholder)}
onSearchChange={setFilter}
triggerRender={triggerRender}
trigger={
@@ -115,7 +117,7 @@ export function AssigneePicker({
<span className="truncate">{triggerLabel}</span>
</>
) : (
- <span className="text-muted-foreground">Unassigned</span>
+ <span className="text-muted-foreground">{t(($) => $.pickers.assignee.trigger_unassigned)}</span>
)
}
>
@@ -129,13 +131,13 @@ export function AssigneePicker({
}}
>
<UserMinus className="h-3.5 w-3.5 text-muted-foreground" />
- <span className="text-muted-foreground">Unassigned</span>
+ <span className="text-muted-foreground">{t(($) => $.pickers.assignee.trigger_unassigned)}</span>
</PickerItem>
)}
{/* Members */}
{filteredMembers.length > 0 && (
- <PickerSection label="Members">
+ <PickerSection label={t(($) => $.pickers.assignee.members_group)}>
{filteredMembers.map((m) => (
<PickerItem
key={m.user_id}
@@ -157,7 +159,7 @@ export function AssigneePicker({
{/* Agents */}
{filteredAgents.length > 0 && (
- <PickerSection label="Agents">
+ <PickerSection label={t(($) => $.pickers.assignee.agents_group)}>
{filteredAgents.map((a) => {
const decision = canAssignAgentToIssue(a, {
userId: user?.id ?? null,
diff --git a/packages/views/issues/components/pickers/due-date-picker.tsx b/packages/views/issues/components/pickers/due-date-picker.tsx
index baceb5a0d8..c9479e140e 100644
--- a/packages/views/issues/components/pickers/due-date-picker.tsx
+++ b/packages/views/issues/components/pickers/due-date-picker.tsx
@@ -10,6 +10,7 @@ import {
PopoverContent,
} from "@multica/ui/components/ui/popover";
import { Button } from "@multica/ui/components/ui/button";
+import { useT } from "../../../i18n";
export function DueDatePicker({
dueDate,
@@ -24,6 +25,7 @@ export function DueDatePicker({
triggerRender?: React.ReactElement;
align?: "start" | "center" | "end";
}) {
+ const { t } = useT("issues");
const [open, setOpen] = useState(false);
const date = dueDate ? new Date(dueDate) : undefined;
const isOverdue = date ? date < new Date() : false;
@@ -42,7 +44,7 @@ export function DueDatePicker({
{date.toLocaleDateString("en-US", { month: "short", day: "numeric" })}
</span>
) : (
- <span className="text-muted-foreground">Due date</span>
+ <span className="text-muted-foreground">{t(($) => $.pickers.due_date.trigger_label)}</span>
)}
</>
)}
@@ -67,7 +69,7 @@ export function DueDatePicker({
}}
className="text-muted-foreground hover:text-foreground"
>
- Clear date
+ {t(($) => $.pickers.due_date.clear_action)}
</Button>
</div>
)}
diff --git a/packages/views/issues/components/pickers/label-picker.tsx b/packages/views/issues/components/pickers/label-picker.tsx
index 55fc0e2556..eb6eacdcd8 100644
--- a/packages/views/issues/components/pickers/label-picker.tsx
+++ b/packages/views/issues/components/pickers/label-picker.tsx
@@ -20,6 +20,7 @@ import {
PickerItem,
PickerEmpty,
} from "./property-picker";
+import { useT } from "../../../i18n";
interface LabelPickerProps {
issueId: string;
@@ -67,6 +68,7 @@ export function LabelPicker({
onOpenChange,
align = "start",
}: LabelPickerProps) {
+ const { t } = useT("issues");
const [internalOpen, setInternalOpen] = useState(false);
const open = controlledOpen ?? internalOpen;
const setOpen = onOpenChange ?? setInternalOpen;
@@ -119,7 +121,7 @@ export function LabelPicker({
setFilter("");
},
onError: (err: unknown) => {
- toast.error(err instanceof Error ? err.message : "Failed to create label");
+ toast.error(err instanceof Error ? err.message : t(($) => $.pickers.label.create_failed));
},
onSettled: () => {
creatingRef.current = false;
@@ -146,7 +148,7 @@ export function LabelPicker({
width="w-80"
align={align}
searchable
- searchPlaceholder="Find or create a label…"
+ searchPlaceholder={t(($) => $.pickers.label.search_placeholder)}
onSearchChange={setFilter}
triggerRender={
hasLabels ? (
@@ -167,7 +169,7 @@ export function LabelPicker({
) : (
<>
<Tag className="h-3.5 w-3.5 text-muted-foreground" />
- <span className="text-muted-foreground">Add label</span>
+ <span className="text-muted-foreground">{t(($) => $.pickers.label.trigger_label)}</span>
</>
)
}
@@ -180,7 +182,7 @@ export function LabelPicker({
className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground hover:bg-accent transition-colors"
>
<Settings2 className="h-3.5 w-3.5" />
- <span>Manage labels…</span>
+ <span>{t(($) => $.pickers.label.manage_action)}</span>
</button>
}
>
@@ -206,7 +208,7 @@ export function LabelPicker({
<PickerItem selected={false} onClick={createAndAttach}>
<Plus className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />
<span className="truncate">
- Create <span className="font-medium">&ldquo;{query}&rdquo;</span>
+ {t(($) => $.pickers.label.create_action)} <span className="font-medium">&ldquo;{query}&rdquo;</span>
</span>
<span
className="ml-auto inline-block h-3 w-3 shrink-0 rounded-full"
@@ -219,7 +221,7 @@ export function LabelPicker({
<Dialog open={manageOpen} onOpenChange={setManageOpen}>
<DialogContent className="max-w-2xl">
- <DialogTitle className="text-lg font-semibold">Manage labels</DialogTitle>
+ <DialogTitle className="text-lg font-semibold">{t(($) => $.pickers.label.manage_dialog_title)}</DialogTitle>
<LabelsPanel />
</DialogContent>
</Dialog>
diff --git a/packages/views/issues/components/pickers/priority-picker.tsx b/packages/views/issues/components/pickers/priority-picker.tsx
index 4bafadae7b..0015767778 100644
--- a/packages/views/issues/components/pickers/priority-picker.tsx
+++ b/packages/views/issues/components/pickers/priority-picker.tsx
@@ -5,6 +5,7 @@ import type { IssuePriority, UpdateIssueRequest } from "@multica/core/types";
import { PRIORITY_ORDER, PRIORITY_CONFIG } from "@multica/core/issues/config";
import { PriorityIcon } from "../priority-icon";
import { PropertyPicker, PickerItem } from "./property-picker";
+import { useT } from "../../../i18n";
export function PriorityPicker({
priority,
@@ -26,7 +27,7 @@ export function PriorityPicker({
const [internalOpen, setInternalOpen] = useState(false);
const open = controlledOpen ?? internalOpen;
const setOpen = controlledOnOpenChange ?? setInternalOpen;
- const cfg = PRIORITY_CONFIG[priority];
+ const { t } = useT("issues");
return (
<PropertyPicker
@@ -39,7 +40,7 @@ export function PriorityPicker({
customTrigger ?? (
<>
<PriorityIcon priority={priority} className="shrink-0" />
- <span className="truncate">{cfg.label}</span>
+ <span className="truncate">{t(($) => $.priority[priority])}</span>
</>
)
}
@@ -57,7 +58,7 @@ export function PriorityPicker({
>
<span className={`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs font-medium ${c.badgeBg} ${c.badgeText}`}>
<PriorityIcon priority={p} className="h-3 w-3" inheritColor />
- {c.label}
+ {t(($) => $.priority[p])}
</span>
</PickerItem>
);
diff --git a/packages/views/issues/components/pickers/property-picker.tsx b/packages/views/issues/components/pickers/property-picker.tsx
index 8dbd926015..c27462c0c2 100644
--- a/packages/views/issues/components/pickers/property-picker.tsx
+++ b/packages/views/issues/components/pickers/property-picker.tsx
@@ -12,6 +12,7 @@ import {
TooltipContent,
TooltipTrigger,
} from "@multica/ui/components/ui/tooltip";
+import { useT } from "../../../i18n";
const HIGHLIGHT_CLASS = "bg-accent";
const ITEM_SELECTOR = "button[data-picker-item]:not(:disabled)";
@@ -28,7 +29,7 @@ export function PropertyPicker({
width = "w-48",
align = "end",
searchable = false,
- searchPlaceholder = "Filter...",
+ searchPlaceholder,
onSearchChange,
header,
tooltip,
@@ -42,7 +43,7 @@ export function PropertyPicker({
width?: string;
align?: "start" | "center" | "end";
searchable?: boolean;
- searchPlaceholder?: string;
+ searchPlaceholder?: string | undefined;
onSearchChange?: (query: string) => void;
/** Custom sticky header rendered above the scrollable list. Use for
* filter toggles, search inputs, or any UI that must stay visible while
@@ -62,6 +63,9 @@ export function PropertyPicker({
*/
footer?: React.ReactNode;
}) {
+ const { t } = useT("issues");
+ const placeholder = searchPlaceholder ?? t(($) => $.filters.placeholder);
+ const filterAria = t(($) => $.pickers.filter_options_aria);
const [query, setQuery] = useState("");
const [highlightedIndex, setHighlightedIndex] = useState(-1);
const [tooltipHover, setTooltipHover] = useState(false);
@@ -164,8 +168,8 @@ export function PropertyPicker({
onSearchChange?.(e.target.value);
}}
onKeyDown={handleKeyDown}
- placeholder={searchPlaceholder}
- aria-label="Filter options"
+ placeholder={placeholder}
+ aria-label={filterAria}
className="w-full bg-transparent text-sm placeholder:text-muted-foreground outline-none"
/>
</div>
@@ -260,9 +264,10 @@ export function PickerSection({
// ---------------------------------------------------------------------------
export function PickerEmpty() {
+ const { t } = useT("issues");
return (
<div className="px-2 py-3 text-center text-sm text-muted-foreground">
- No results
+ {t(($) => $.pickers.no_results)}
</div>
);
}
diff --git a/packages/views/issues/components/pickers/status-picker.tsx b/packages/views/issues/components/pickers/status-picker.tsx
index febec36efa..c293acdf12 100644
--- a/packages/views/issues/components/pickers/status-picker.tsx
+++ b/packages/views/issues/components/pickers/status-picker.tsx
@@ -5,6 +5,7 @@ import type { IssueStatus, UpdateIssueRequest } from "@multica/core/types";
import { ALL_STATUSES, STATUS_CONFIG } from "@multica/core/issues/config";
import { StatusIcon } from "../status-icon";
import { PropertyPicker, PickerItem } from "./property-picker";
+import { useT } from "../../../i18n";
export function StatusPicker({
status,
@@ -26,7 +27,7 @@ export function StatusPicker({
const [internalOpen, setInternalOpen] = useState(false);
const open = controlledOpen ?? internalOpen;
const setOpen = controlledOnOpenChange ?? setInternalOpen;
- const cfg = STATUS_CONFIG[status];
+ const { t } = useT("issues");
return (
<PropertyPicker
@@ -39,7 +40,7 @@ export function StatusPicker({
customTrigger ?? (
<>
<StatusIcon status={status} className="h-3.5 w-3.5 shrink-0" />
- <span className="truncate">{cfg.label}</span>
+ <span className="truncate">{t(($) => $.status[status])}</span>
</>
)
}
@@ -57,7 +58,7 @@ export function StatusPicker({
}}
>
<StatusIcon status={s} className="h-3.5 w-3.5" />
- <span>{c.label}</span>
+ <span>{t(($) => $.status[s])}</span>
</PickerItem>
);
})}
diff --git a/packages/views/issues/components/reply-input.tsx b/packages/views/issues/components/reply-input.tsx
index 5d4ed03731..cb105165e3 100644
--- a/packages/views/issues/components/reply-input.tsx
+++ b/packages/views/issues/components/reply-input.tsx
@@ -9,6 +9,7 @@ import { ActorAvatar } from "../../common/actor-avatar";
import { useFileUpload } from "@multica/core/hooks/use-file-upload";
import { api } from "@multica/core/api";
import { cn } from "@multica/ui/lib/utils";
+import { useT } from "../../i18n";
// ---------------------------------------------------------------------------
// Types
@@ -29,12 +30,14 @@ interface ReplyInputProps {
function ReplyInput({
issueId,
- placeholder = "Leave a reply...",
+ placeholder,
avatarType,
avatarId,
onSubmit,
size = "default",
}: ReplyInputProps) {
+ const { t } = useT("issues");
+ const placeholderText = placeholder ?? t(($) => $.reply.placeholder);
const editorRef = useRef<ContentEditorRef>(null);
const [isEmpty, setIsEmpty] = useState(true);
const [isExpanded, setIsExpanded] = useState(false);
@@ -95,7 +98,7 @@ function ReplyInput({
<div className="flex-1 min-h-0 overflow-y-auto">
<ContentEditor
ref={editorRef}
- placeholder={placeholder}
+ placeholder={placeholderText}
onUpdate={(md) => setIsEmpty(!md.trim())}
onSubmit={handleSubmit}
onUploadFile={handleUpload}
@@ -119,7 +122,7 @@ function ReplyInput({
</button>
}
/>
- <TooltipContent side="top">{isExpanded ? "Collapse" : "Expand"}</TooltipContent>
+ <TooltipContent side="top">{isExpanded ? t(($) => $.reply.collapse_tooltip) : t(($) => $.reply.expand_tooltip)}</TooltipContent>
</Tooltip>
<FileUploadButton
size="sm"
diff --git a/packages/views/issues/components/status-heading.tsx b/packages/views/issues/components/status-heading.tsx
index 32606013c1..cba157cf72 100644
--- a/packages/views/issues/components/status-heading.tsx
+++ b/packages/views/issues/components/status-heading.tsx
@@ -1,6 +1,6 @@
import type { IssueStatus } from "@multica/core/types";
-import { STATUS_CONFIG } from "@multica/core/issues/config";
import { StatusIcon } from "./status-icon";
+import { useT } from "../../i18n";
export function StatusHeading({
status,
@@ -9,12 +9,12 @@ export function StatusHeading({
status: IssueStatus;
count: number;
}) {
- const cfg = STATUS_CONFIG[status];
+ const { t } = useT("issues");
return (
<div className="flex items-center gap-2">
<span className="inline-flex items-center gap-1.5 text-xs font-semibold">
<StatusIcon status={status} className="h-3 w-3" />
- {cfg.label}
+ {t(($) => $.status[status])}
</span>
<span className="text-xs text-muted-foreground">{count}</span>
</div>
diff --git a/packages/views/issues/hooks/use-issue-timeline.ts b/packages/views/issues/hooks/use-issue-timeline.ts
index eea9bbe0e7..ae374f2366 100644
--- a/packages/views/issues/hooks/use-issue-timeline.ts
+++ b/packages/views/issues/hooks/use-issue-timeline.ts
@@ -21,6 +21,7 @@ import {
} from "@multica/core/issues/mutations";
import { useWSEvent, useWSReconnect } from "@multica/core/realtime";
import { toast } from "sonner";
+import { useT } from "../../i18n";
function commentToTimelineEntry(c: Comment): TimelineEntry {
return {
@@ -39,6 +40,7 @@ function commentToTimelineEntry(c: Comment): TimelineEntry {
}
export function useIssueTimeline(issueId: string, userId?: string) {
+ const { t } = useT("issues");
const qc = useQueryClient();
const { data: timeline = [], isLoading: loading } = useQuery(
issueTimelineOptions(issueId),
@@ -220,12 +222,12 @@ export function useIssueTimeline(issueId: string, userId?: string) {
try {
await createComment({ content, attachmentIds });
} catch {
- toast.error("Failed to send comment");
+ toast.error(t(($) => $.comment.send_failed));
} finally {
setSubmitting(false);
}
},
- [userId, submitting, createComment],
+ [userId, submitting, createComment, t],
);
const submitReply = useCallback(
@@ -239,10 +241,10 @@ export function useIssueTimeline(issueId: string, userId?: string) {
attachmentIds,
});
} catch {
- toast.error("Failed to send reply");
+ toast.error(t(($) => $.comment.send_reply_failed));
}
},
- [userId, createComment],
+ [userId, createComment, t],
);
const editComment = useCallback(
@@ -250,10 +252,10 @@ export function useIssueTimeline(issueId: string, userId?: string) {
try {
await updateComment({ commentId, content });
} catch {
- toast.error("Failed to update comment");
+ toast.error(t(($) => $.comment.update_failed));
}
},
- [updateComment],
+ [updateComment, t],
);
const deleteComment = useCallback(
@@ -261,10 +263,10 @@ export function useIssueTimeline(issueId: string, userId?: string) {
try {
await deleteCommentAsync(commentId);
} catch {
- toast.error("Failed to delete comment");
+ toast.error(t(($) => $.comment.delete_failed));
}
},
- [deleteCommentAsync],
+ [deleteCommentAsync, t],
);
// --- Optimistic UI derivation for comment reactions ---
diff --git a/packages/views/labels/label-chip.tsx b/packages/views/labels/label-chip.tsx
index 7e4c3c2a21..9fde4ba9ef 100644
--- a/packages/views/labels/label-chip.tsx
+++ b/packages/views/labels/label-chip.tsx
@@ -2,6 +2,7 @@
import type { Label } from "@multica/core/types";
import { X } from "lucide-react";
+import { useT } from "../i18n";
/**
* Map a label's `#rrggbb` color to a readable text color.
@@ -50,6 +51,7 @@ interface LabelChipProps {
* and the management dialog.
*/
export function LabelChip({ label, onRemove, className, fullName }: LabelChipProps) {
+ const { t } = useT("labels");
const textColor = contrastTextColor(label.color);
const nameClass = fullName ? "break-all" : "truncate max-w-[12rem]";
return (
@@ -73,7 +75,7 @@ export function LabelChip({ label, onRemove, className, fullName }: LabelChipPro
// visible on both light and dark chip backgrounds. hover:bg-black/10
// was invisible on darker chips (anything requiring light text).
className="flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full hover:bg-current/20 focus:outline-none focus:ring-1 focus:ring-current"
- aria-label={`Remove label ${label.name}`}
+ aria-label={t(($) => $.remove_label, { name: label.name })}
>
<X className="h-2.5 w-2.5" strokeWidth={2.5} />
</button>
diff --git a/packages/views/layout/app-sidebar.tsx b/packages/views/layout/app-sidebar.tsx
index 939700b786..1b8ac3a64b 100644
--- a/packages/views/layout/app-sidebar.tsx
+++ b/packages/views/layout/app-sidebar.tsx
@@ -76,6 +76,7 @@ import { projectDetailOptions } from "@multica/core/projects/queries";
import type { PinnedItem } from "@multica/core/types";
import { useLogout } from "../auth";
import { ProjectIcon } from "../projects/components/project-icon";
+import { useT } from "../i18n";
// Top-level nav items stay active when the user is on a child route
// (e.g. "Projects" stays lit on /:slug/projects/:id). Pinned items keep
@@ -109,22 +110,34 @@ type NavKey =
| "skills"
| "settings";
-const personalNav: { key: NavKey; label: string; icon: typeof Inbox }[] = [
- { key: "inbox", label: "Inbox", icon: Inbox },
- { key: "myIssues", label: "My Issues", icon: CircleUser },
+// Static schema (key + icon) — labels resolved at render via useT("layout").
+type NavLabelKey =
+ | "inbox"
+ | "my_issues"
+ | "issues"
+ | "projects"
+ | "autopilots"
+ | "agents"
+ | "runtimes"
+ | "skills"
+ | "settings";
+
+const personalNav: { key: NavKey; labelKey: NavLabelKey; icon: typeof Inbox }[] = [
+ { key: "inbox", labelKey: "inbox", icon: Inbox },
+ { key: "myIssues", labelKey: "my_issues", icon: CircleUser },
];
-const workspaceNav: { key: NavKey; label: string; icon: typeof Inbox }[] = [
- { key: "issues", label: "Issues", icon: ListTodo },
- { key: "projects", label: "Projects", icon: FolderKanban },
- { key: "autopilots", label: "Autopilot", icon: Zap },
- { key: "agents", label: "Agents", icon: Bot },
+const workspaceNav: { key: NavKey; labelKey: NavLabelKey; icon: typeof Inbox }[] = [
+ { key: "issues", labelKey: "issues", icon: ListTodo },
+ { key: "projects", labelKey: "projects", icon: FolderKanban },
+ { key: "autopilots", labelKey: "autopilots", icon: Zap },
+ { key: "agents", labelKey: "agents", icon: Bot },
];
-const configureNav: { key: NavKey; label: string; icon: typeof Inbox }[] = [
- { key: "runtimes", label: "Runtimes", icon: Monitor },
- { key: "skills", label: "Skills", icon: BookOpenText },
- { key: "settings", label: "Settings", icon: Settings },
+const configureNav: { key: NavKey; labelKey: NavLabelKey; icon: typeof Inbox }[] = [
+ { key: "runtimes", labelKey: "runtimes", icon: Monitor },
+ { key: "skills", labelKey: "skills", icon: BookOpenText },
+ { key: "settings", labelKey: "settings", icon: Settings },
];
function DraftDot() {
@@ -154,6 +167,7 @@ function SortablePinItem({
label: string;
iconNode: React.ReactNode;
}) {
+ const { t } = useT("layout");
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({ id: pin.id });
const wasDragged = useRef(false);
@@ -208,7 +222,7 @@ function SortablePinItem({
>
<X className="size-1" />
</TooltipTrigger>
- <TooltipContent side="top" sideOffset={4}>Unpin</TooltipContent>
+ <TooltipContent side="top" sideOffset={4}>{t(($) => $.sidebar.unpin_tooltip)}</TooltipContent>
</Tooltip>
</SidebarMenuButton>
</SidebarMenuItem>
@@ -317,6 +331,7 @@ interface AppSidebarProps {
}
export function AppSidebar({ topSlot, searchSlot, headerClassName, headerStyle }: AppSidebarProps = {}) {
+ const { t } = useT("layout");
const { pathname, push } = useNavigation();
const user = useAuthStore((s) => s.user);
const userId = useAuthStore((s) => s.user?.id);
@@ -486,7 +501,7 @@ export function AppSidebar({ topSlot, searchSlot, headerClassName, headerStyle }
<DropdownMenuSeparator />
<DropdownMenuGroup>
<DropdownMenuLabel className="text-xs text-muted-foreground">
- Workspaces
+ {t(($) => $.sidebar.workspaces_label)}
</DropdownMenuLabel>
{workspaces.map((ws) => (
<DropdownMenuItem
@@ -508,7 +523,7 @@ export function AppSidebar({ topSlot, searchSlot, headerClassName, headerStyle }
}
>
<Plus className="h-3.5 w-3.5" />
- Create workspace
+ {t(($) => $.sidebar.create_workspace)}
</DropdownMenuItem>
</DropdownMenuGroup>
{myInvitations.length > 0 && (
@@ -516,12 +531,12 @@ export function AppSidebar({ topSlot, searchSlot, headerClassName, headerStyle }
<DropdownMenuSeparator />
<DropdownMenuGroup>
<DropdownMenuLabel className="text-xs text-muted-foreground">
- Pending invitations
+ {t(($) => $.sidebar.pending_invitations_label)}
</DropdownMenuLabel>
{myInvitations.map((inv) => (
<div key={inv.id} className="flex items-center gap-2 px-2 py-1.5">
<WorkspaceAvatar name={inv.workspace_name ?? "W"} size="sm" />
- <span className="flex-1 truncate text-sm">{inv.workspace_name ?? "Workspace"}</span>
+ <span className="flex-1 truncate text-sm">{inv.workspace_name ?? t(($) => $.sidebar.invitation_workspace_fallback)}</span>
<button
type="button"
className="text-xs px-2 py-0.5 rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50"
@@ -531,7 +546,7 @@ export function AppSidebar({ topSlot, searchSlot, headerClassName, headerStyle }
acceptInvitationMut.mutate(inv.id);
}}
>
- Join
+ {t(($) => $.sidebar.invitation_join)}
</button>
<button
type="button"
@@ -542,7 +557,7 @@ export function AppSidebar({ topSlot, searchSlot, headerClassName, headerStyle }
declineInvitationMut.mutate(inv.id);
}}
>
- Decline
+ {t(($) => $.sidebar.invitation_decline)}
</button>
</div>
))}
@@ -553,7 +568,7 @@ export function AppSidebar({ topSlot, searchSlot, headerClassName, headerStyle }
<DropdownMenuGroup>
<DropdownMenuItem variant="destructive" onClick={logout}>
<LogOut className="h-3.5 w-3.5" />
- Log out
+ {t(($) => $.sidebar.log_out)}
</DropdownMenuItem>
</DropdownMenuGroup>
</DropdownMenuContent>
@@ -575,8 +590,8 @@ export function AppSidebar({ topSlot, searchSlot, headerClassName, headerStyle }
<SquarePen />
<DraftDot />
</span>
- <span>New Issue</span>
- <kbd className="pointer-events-none ml-auto inline-flex h-5 select-none items-center gap-0.5 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground">C</kbd>
+ <span>{t(($) => $.sidebar.new_issue)}</span>
+ <kbd className="pointer-events-none ml-auto inline-flex h-5 select-none items-center gap-0.5 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground">{t(($) => $.sidebar.new_issue_shortcut)}</kbd>
</SidebarMenuButton>
</SidebarMenuItem>
</SidebarMenu>
@@ -598,8 +613,8 @@ export function AppSidebar({ topSlot, searchSlot, headerClassName, headerStyle }
className="text-muted-foreground hover:not-data-active:bg-sidebar-accent/70 data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground"
>
<item.icon />
- <span>{item.label}</span>
- {item.label === "Inbox" && unreadCount > 0 && (
+ <span>{t(($) => $.nav[item.labelKey])}</span>
+ {item.key === "inbox" && unreadCount > 0 && (
<span className="ml-auto text-xs">
{unreadCount > 99 ? "99+" : unreadCount}
</span>
@@ -619,7 +634,7 @@ export function AppSidebar({ topSlot, searchSlot, headerClassName, headerStyle }
render={<CollapsibleTrigger />}
className="group/trigger cursor-pointer hover:bg-sidebar-accent/70 hover:text-sidebar-accent-foreground"
>
- <span>Pinned</span>
+ <span>{t(($) => $.sidebar.pinned_label)}</span>
<ChevronRight className="!size-3 ml-1 stroke-[2.5] transition-transform duration-200 group-data-[panel-open]/trigger:rotate-90" />
<span className="ml-auto text-[10px] text-muted-foreground opacity-0 transition-opacity group-hover/pinned:opacity-100">{localPinned.length}</span>
</SidebarGroupLabel>
@@ -648,7 +663,7 @@ export function AppSidebar({ topSlot, searchSlot, headerClassName, headerStyle }
)}
<SidebarGroup>
- <SidebarGroupLabel>Workspace</SidebarGroupLabel>
+ <SidebarGroupLabel>{t(($) => $.sidebar.workspace_group)}</SidebarGroupLabel>
<SidebarGroupContent>
<SidebarMenu className="gap-0.5">
{workspaceNav.map((item) => {
@@ -662,7 +677,7 @@ export function AppSidebar({ topSlot, searchSlot, headerClassName, headerStyle }
className="text-muted-foreground hover:not-data-active:bg-sidebar-accent/70 data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground"
>
<item.icon />
- <span>{item.label}</span>
+ <span>{t(($) => $.nav[item.labelKey])}</span>
</SidebarMenuButton>
</SidebarMenuItem>
);
@@ -672,7 +687,7 @@ export function AppSidebar({ topSlot, searchSlot, headerClassName, headerStyle }
</SidebarGroup>
<SidebarGroup>
- <SidebarGroupLabel>Configure</SidebarGroupLabel>
+ <SidebarGroupLabel>{t(($) => $.sidebar.configure_group)}</SidebarGroupLabel>
<SidebarGroupContent>
<SidebarMenu className="gap-0.5">
{configureNav.map((item) => {
@@ -686,8 +701,8 @@ export function AppSidebar({ topSlot, searchSlot, headerClassName, headerStyle }
className="text-muted-foreground hover:not-data-active:bg-sidebar-accent/70 data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground"
>
<item.icon />
- <span>{item.label}</span>
- {item.label === "Runtimes" && hasRuntimeUpdates && (
+ <span>{t(($) => $.nav[item.labelKey])}</span>
+ {item.key === "runtimes" && hasRuntimeUpdates && (
<span className="ml-auto size-1.5 rounded-full bg-destructive" />
)}
</SidebarMenuButton>
diff --git a/packages/views/layout/help-launcher.tsx b/packages/views/layout/help-launcher.tsx
index dee17c3a48..4f8464d5f7 100644
--- a/packages/views/layout/help-launcher.tsx
+++ b/packages/views/layout/help-launcher.tsx
@@ -8,16 +8,18 @@ import {
DropdownMenuTrigger,
} from "@multica/ui/components/ui/dropdown-menu";
import { useModalStore } from "@multica/core/modals";
+import { useT } from "../i18n";
const DOCS_URL = "https://multica.ai/docs";
const CHANGELOG_URL = "https://multica.ai/changelog";
export function HelpLauncher() {
+ const { t } = useT("layout");
return (
<DropdownMenu>
<DropdownMenuTrigger
- aria-label="Help"
- title="Help"
+ aria-label={t(($) => $.help.trigger)}
+ title={t(($) => $.help.trigger)}
className="inline-flex size-7 items-center justify-center rounded-full text-muted-foreground transition-colors cursor-pointer hover:bg-accent hover:text-foreground data-popup-open:bg-accent data-popup-open:text-foreground"
>
<CircleHelp className="size-4" />
@@ -34,7 +36,7 @@ export function HelpLauncher() {
}
>
<BookOpen className="h-3.5 w-3.5" />
- Docs
+ {t(($) => $.help.docs)}
<ArrowUpRight className="size-3 translate-y-px text-muted-foreground/50" />
</DropdownMenuItem>
<DropdownMenuItem
@@ -47,14 +49,14 @@ export function HelpLauncher() {
}
>
<History className="h-3.5 w-3.5" />
- Change log
+ {t(($) => $.help.changelog)}
<ArrowUpRight className="size-3 translate-y-px text-muted-foreground/50" />
</DropdownMenuItem>
<DropdownMenuItem
onClick={() => useModalStore.getState().open("feedback")}
>
<MessageCircle className="h-3.5 w-3.5" />
- Feedback
+ {t(($) => $.help.feedback)}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
diff --git a/packages/views/layout/workspace-loader.tsx b/packages/views/layout/workspace-loader.tsx
index 133f4b4c62..306f5a8de9 100644
--- a/packages/views/layout/workspace-loader.tsx
+++ b/packages/views/layout/workspace-loader.tsx
@@ -1,6 +1,7 @@
"use client";
import { MulticaIcon } from "@multica/ui/components/common/multica-icon";
+import { useT } from "../i18n";
/**
* Full-screen workspace loader. Renders IN PLACE OF the dashboard during:
@@ -13,6 +14,7 @@ import { MulticaIcon } from "@multica/ui/components/common/multica-icon";
* workspace have been freshly fetched.
*/
export function WorkspaceLoader({ name }: { name?: string | null }) {
+ const { t } = useT("layout");
return (
<div
className="flex h-svh w-full items-center justify-center bg-background"
@@ -23,10 +25,11 @@ export function WorkspaceLoader({ name }: { name?: string | null }) {
<MulticaIcon className="size-8 animate-pulse" />
{name ? (
<p className="text-sm text-muted-foreground">
- Loading <span className="font-medium text-foreground">{name}</span>…
+ {t(($) => $.workspace_loader.loading_named_prefix)}{" "}
+ <span className="font-medium text-foreground">{name}</span>…
</p>
) : (
- <p className="text-sm text-muted-foreground">Loading workspace…</p>
+ <p className="text-sm text-muted-foreground">{t(($) => $.workspace_loader.loading_workspace)}</p>
)}
</div>
</div>
diff --git a/packages/views/locales/en/agents.json b/packages/views/locales/en/agents.json
new file mode 100644
index 0000000000..900324c5e2
--- /dev/null
+++ b/packages/views/locales/en/agents.json
@@ -0,0 +1,357 @@
+{
+ "page": {
+ "title": "Agents",
+ "tagline": "AI teammates that pick up issues, comment, and update status.",
+ "learn_more": "Learn more →",
+ "new_agent": "New agent",
+ "search_placeholder": "Search agents…",
+ "show_archived": "Show archived ({{count}}) →",
+ "of_total": "{{visible}} of {{total}}",
+ "list_load_failed": "Couldn't load agents",
+ "list_load_failed_default": "Something went wrong fetching the agent list.",
+ "try_again": "Try again"
+ },
+ "scope": {
+ "mine": "Mine",
+ "all": "All"
+ },
+ "sort": {
+ "label_recent": "Recent activity",
+ "label_name": "Name",
+ "label_runs": "Most runs",
+ "label_created": "Recently created"
+ },
+ "availability": {
+ "all": "All",
+ "online": "Online",
+ "unstable": "Unstable",
+ "offline": "Offline"
+ },
+ "workload": {
+ "working": "Working",
+ "queued": "Queued",
+ "idle": "Idle"
+ },
+ "archived": {
+ "active_link": "Active agents",
+ "title": "Archived agents"
+ },
+ "empty": {
+ "title": "No agents yet",
+ "description": "Create an agent and assign it issues, like any teammate. Local agents run on your machine; cloud agents run on Multica's runtime."
+ },
+ "no_matches": {
+ "title": "No matches",
+ "search_archived": "No archived agents match \"{{query}}\".",
+ "no_archived": "No archived agents yet.",
+ "search_active": "No agents match \"{{query}}\".",
+ "search_active_filtered": "No agents match \"{{query}}\" in this filter.",
+ "no_filter_match": "No agents match this filter."
+ },
+ "columns": {
+ "agent": "Agent",
+ "status": "Status",
+ "workload": "Workload",
+ "runtime": "Runtime",
+ "activity_7d": "Activity (7d)",
+ "runs": "Runs"
+ },
+ "row": {
+ "you": "You",
+ "archived": "Archived",
+ "no_description": "No description",
+ "fallback_runtime_cloud": "Cloud",
+ "fallback_runtime_local": "Local",
+ "actions_aria": "Row actions"
+ },
+ "activity_tooltip": {
+ "created_today": "Created today",
+ "created_days_ago_one": "Created {{count}} day ago",
+ "created_days_ago_other": "Created {{count}} days ago",
+ "last_7_days": "Last 7 days",
+ "no_activity": "No activity",
+ "runs_one": "{{count}} run",
+ "runs_other": "{{count}} runs",
+ "failed_suffix": " · {{count}} failed ({{percent}}%)"
+ },
+ "row_actions": {
+ "cancel_all_tasks": "Cancel all tasks",
+ "duplicate": "Duplicate",
+ "restore": "Restore",
+ "archive": "Archive",
+ "agent_archived_toast": "Agent archived",
+ "archive_failed_toast": "Failed to archive agent",
+ "agent_restored_toast": "Agent restored",
+ "restore_failed_toast": "Failed to restore agent",
+ "no_tasks_to_cancel_toast": "No active tasks to cancel",
+ "cancelled_tasks_toast_one": "Cancelled {{count}} task",
+ "cancelled_tasks_toast_other": "Cancelled {{count}} tasks",
+ "cancel_failed_toast": "Failed to cancel tasks",
+ "cancel_dialog_title": "Cancel all tasks for \"{{name}}\"?",
+ "cancel_dialog_no_tasks": "There are no active tasks to cancel.",
+ "cancel_dialog_running_one": "{{count}} running",
+ "cancel_dialog_queued_one": "{{count}} queued",
+ "cancel_dialog_impact_one": "This will cancel {{summary}} task.",
+ "cancel_dialog_impact_other": "This will cancel {{summary}} tasks.",
+ "cancel_dialog_running_note": " Running tasks may take up to 5 seconds to fully halt.",
+ "cancel_dialog_irreversible": " Cancelled tasks cannot be resumed.",
+ "cancel_dialog_keep": "Keep them",
+ "cancel_dialog_confirm": "Cancel all tasks",
+ "archive_dialog_title": "Archive \"{{name}}\"?",
+ "archive_dialog_description": "The agent won't be assignable or mentionable, and any active tasks will be cancelled. All history is preserved and you can restore it later.",
+ "archive_dialog_cancel": "Cancel",
+ "archive_dialog_confirm": "Archive"
+ },
+ "detail": {
+ "back_to_agents": "Agents",
+ "back_to_agents_full": "Back to agents",
+ "not_found_title": "Agent not found",
+ "not_found_default": "This agent may have been archived or deleted.",
+ "try_again": "Try again",
+ "archived_banner": "This agent is archived. It cannot be assigned or mentioned.",
+ "restore": "Restore",
+ "archive_dialog_title": "Archive agent?",
+ "archive_dialog_description": "\"{{name}}\" will be archived. It won't be assignable or mentionable, but all history is preserved. You can restore it later.",
+ "archive_dialog_cancel": "Cancel",
+ "archive_dialog_confirm": "Archive",
+ "more_archive": "Archive Agent",
+ "agent_updated_toast": "Agent updated",
+ "update_failed_toast": "Failed to update agent",
+ "agent_archived_toast": "Agent archived",
+ "archive_failed_toast": "Failed to archive agent",
+ "agent_restored_toast": "Agent restored",
+ "restore_failed_toast": "Failed to restore agent"
+ },
+ "inspector": {
+ "section_properties": "Properties",
+ "section_details": "Details",
+ "section_skills": "Skills",
+ "prop_runtime": "Runtime",
+ "prop_model": "Model",
+ "prop_visibility": "Visibility",
+ "prop_concurrency": "Concurrency",
+ "prop_owner": "Owner",
+ "prop_created": "Created",
+ "prop_updated": "Updated",
+ "no_description_placeholder": "No description",
+ "change_avatar_aria": "Change avatar",
+ "avatar_updated_toast": "Avatar updated",
+ "avatar_upload_failed_toast": "Failed to upload avatar",
+ "rename_title": "Rename agent",
+ "rename_placeholder": "Agent name",
+ "rename_required": "Name is required",
+ "edit_description_title": "Edit description",
+ "description_placeholder": "What does this agent do?",
+ "save": "Save",
+ "cancel": "Cancel"
+ },
+ "skill_attach": {
+ "trigger_aria": "Attach a workspace skill",
+ "trigger_label": "Attach"
+ },
+ "pickers": {
+ "concurrency_tooltip": "Concurrency · {{value}} max concurrent tasks",
+ "concurrency_range": "Max concurrent tasks ({{min}}–{{max}})",
+ "runtime_none": "No runtime",
+ "runtime_tooltip": "Runtime · {{name}} · {{status}}",
+ "runtime_tooltip_none": "Runtime · none selected",
+ "runtime_online": "online",
+ "runtime_offline": "offline",
+ "runtime_owned_by": "owned by {{name}}",
+ "runtime_empty": "No runtimes",
+ "model_default": "Default",
+ "model_tooltip": "Model · {{value}}",
+ "model_managed_by_runtime": "Managed by runtime",
+ "model_search_placeholder": "Search or type a model ID",
+ "model_discovering": "Discovering models…",
+ "model_default_badge": "default",
+ "model_empty": "No models available",
+ "model_empty_with_dot": "No models available.",
+ "model_custom_tooltip": "Use \"{{value}}\" as a custom model id",
+ "model_custom_use": "Use \"{{value}}\"",
+ "model_clear": "Clear (use provider default)",
+ "model_clear_title": "Clear and fall back to the runtime's provider default"
+ },
+ "model_dropdown": {
+ "label": "Model",
+ "select_runtime_first": "Select a runtime first",
+ "default_provider": "Default (provider)",
+ "runtime_offline_manual": "Runtime offline — enter manually",
+ "managed_by_runtime_title": "Model selection is managed by this runtime.",
+ "managed_by_runtime_hint": "Configure the model on the runtime host (e.g. Hermes reads it from its own config file).",
+ "discovery_failed": "discovery failed",
+ "clear_full": "Clear selection (use provider default)"
+ },
+ "tabs": {
+ "activity": "Activity",
+ "instructions": "Instructions",
+ "skills": "Skills",
+ "environment": "Environment",
+ "custom_args": "Custom Args",
+ "discard_dialog_title": "Discard unsaved changes?",
+ "discard_dialog_description": "You have unsaved changes in this tab. Leaving now will discard them.",
+ "discard_keep": "Keep editing",
+ "discard_confirm": "Discard changes"
+ },
+ "create_dialog": {
+ "title_create": "Create Agent",
+ "title_duplicate": "Duplicate Agent",
+ "description_create": "Create a new AI agent for your workspace.",
+ "description_duplicate": "Create a new agent based on \"{{name}}\". Instructions, env, and skills are copied for you.",
+ "name_label": "Name",
+ "name_placeholder": "e.g. Deep Research Agent",
+ "description_label": "Description",
+ "description_placeholder": "What does this agent do?",
+ "visibility_label": "Visibility",
+ "runtime_label": "Runtime",
+ "runtime_filter_mine": "Mine",
+ "runtime_filter_all": "All",
+ "runtime_loading": "Loading runtimes...",
+ "runtime_none": "No runtime available",
+ "runtime_register_first": "Register a runtime before creating an agent",
+ "runtime_cloud_badge": "Cloud",
+ "duplicate_copy_suffix": " (Copy)",
+ "create": "Create",
+ "creating": "Creating...",
+ "cancel": "Cancel",
+ "create_failed_toast": "Failed to create agent"
+ },
+ "tab_body": {
+ "common": {
+ "save": "Save",
+ "add": "Add",
+ "unsaved_changes": "Unsaved changes"
+ },
+ "instructions": {
+ "intro": "Define this agent's identity and working style. Injected into the agent's context for every task. Markdown is supported.",
+ "placeholder": "Define this agent's role, expertise, and working style.\n\n# Example\nYou are a frontend engineer specializing in React and TypeScript.\n\n## Working Style\n- Write small, focused PRs — one commit per logical change\n- Prefer composition over inheritance\n- Always add unit tests for new components\n\n## Constraints\n- Do not modify shared/ types without explicit approval\n- Follow the existing component patterns in features/"
+ },
+ "env": {
+ "intro_readonly": "Injected into the agent process at launch. Values are hidden — only the agent owner or workspace admin can view and edit them.",
+ "empty_readonly": "No environment variables configured.",
+ "intro_prefix": "Injected into the agent process at launch (e.g. ",
+ "intro_separator": ", ",
+ "intro_suffix": ").",
+ "key_placeholder": "KEY",
+ "value_placeholder": "value",
+ "show_value_aria": "Show value",
+ "hide_value_aria": "Hide value",
+ "remove_aria": "Remove variable",
+ "duplicate_keys_toast": "Duplicate environment variable keys",
+ "saved_toast": "Environment variables saved",
+ "save_failed_toast": "Failed to save environment variables"
+ },
+ "custom_args": {
+ "intro": "Additional CLI arguments appended to the agent command at launch. Multi-token flags can share one row — they'll be split on whitespace before being passed to the CLI.",
+ "launch_mode_prefix": "Launch mode: ",
+ "launch_mode_args_placeholder": "<your args>",
+ "input_placeholder": "--flag value",
+ "remove_aria": "Remove argument",
+ "saved_toast": "Custom arguments saved",
+ "save_failed_toast": "Failed to save custom arguments"
+ },
+ "skills": {
+ "intro": "Workspace skills assigned to this agent. Local runtime skills are always available automatically.",
+ "add_action": "Add skill",
+ "import_hint": "Importing creates a workspace copy that your team can edit and reuse.",
+ "empty_title": "No skills assigned",
+ "empty_hint": "Add workspace skills to share team knowledge with this agent.",
+ "remove_failed_toast": "Failed to remove skill",
+ "add_dialog_title": "Add skill",
+ "add_dialog_description": "Select a workspace skill to assign to this agent.",
+ "add_dialog_empty": "All workspace skills are already assigned.",
+ "add_dialog_cancel": "Cancel",
+ "add_failed_toast": "Failed to add skill"
+ },
+ "activity": {
+ "section_now": "Now",
+ "section_last_30d": "Last 30 days",
+ "section_recent": "Recent work",
+ "subtitle_no_active": "No active work",
+ "subtitle_active_one": "{{count}} active task",
+ "subtitle_active_other": "{{count}} active tasks",
+ "subtitle_performance": "Performance",
+ "subtitle_no_recent": "Nothing finished yet",
+ "subtitle_recent_progress": "{{shown}} of {{total}}",
+ "subtitle_recent_latest": "{{count}} latest",
+ "empty_now": "This agent isn't running anything right now.",
+ "empty_30d": "No completions in the last 30 days.",
+ "empty_recent": "This agent hasn't completed anything yet.",
+ "show_more": "Show more →",
+ "runs_one": "run",
+ "runs_other": "runs",
+ "success_pct": "{{percent}}% success",
+ "avg_duration": "avg {{value}}",
+ "failed_count": "{{count}} failed",
+ "source_issue": "Issue",
+ "source_chat": "Chat",
+ "source_autopilot": "Autopilot",
+ "source_untracked": "Untracked",
+ "source_quick_create": "Quick create",
+ "source_creating_issue": "Creating issue",
+ "source_chat_session": "Chat session",
+ "source_autopilot_run": "Autopilot run",
+ "issue_short_fallback": "Issue {{prefix}}…",
+ "triggered_by": "Triggered by",
+ "open_issue_aria": "Open issue",
+ "open_issue_tooltip": "Open issue",
+ "transcript_tooltip": "View transcript",
+ "cancel_task_aria": "Cancel task",
+ "cancel_task_tooltip": "Cancel task",
+ "cancelling_tooltip": "Cancelling…",
+ "cancel_failed_toast": "Failed to cancel task",
+ "started_prefix": "Started {{when}}",
+ "dispatched_prefix": "Dispatched {{when}}",
+ "queued_prefix": "Queued {{when}}"
+ }
+ },
+ "char_counter": {
+ "over_limit": " · {{count}} over limit"
+ },
+ "presence": {
+ "queue_badge": "+{{count}} queued"
+ },
+ "visibility": {
+ "private": {
+ "label": "Personal",
+ "tooltip": "Personal · only you and workspace admins can use this agent"
+ },
+ "workspace": {
+ "label": "Workspace",
+ "tooltip": "Workspace · everyone in this workspace can use this agent"
+ }
+ },
+ "profile_card": {
+ "unavailable": "Agent unavailable",
+ "detail_link": "Detail →",
+ "runtime_label": "Runtime",
+ "skills_label": "Skills",
+ "owner_label": "Owner",
+ "unknown_runtime": "Unknown runtime"
+ },
+ "transcript": {
+ "dialog_title": "Agent Execution Transcript",
+ "status_running": "Running",
+ "status_completed": "Completed",
+ "status_failed": "Failed",
+ "filter": "Filter",
+ "clear_filters": "Clear filters",
+ "tool_calls_one": "{{count}} tool call",
+ "tool_calls_other": "{{count}} tool calls",
+ "events_one": "{{count}} events",
+ "events_other": "{{count}} events",
+ "events_filtered": "{{shown}} of {{total}} events",
+ "copy_all": "Copy all",
+ "copy_filtered": "Copy filtered",
+ "copied": "Copied",
+ "waiting_events": "Waiting for events...",
+ "no_data": "No execution data recorded."
+ },
+ "task_failure": {
+ "agent_error": "Agent execution error",
+ "timeout": "Task timed out",
+ "runtime_offline": "Daemon offline",
+ "runtime_recovery": "Daemon restarted",
+ "manual": "Cancelled by user"
+ }
+}
diff --git a/packages/views/locales/en/auth.json b/packages/views/locales/en/auth.json
new file mode 100644
index 0000000000..b10f4293b9
--- /dev/null
+++ b/packages/views/locales/en/auth.json
@@ -0,0 +1,48 @@
+{
+ "signin": {
+ "title": "Sign in to Multica",
+ "description": "Enter your email to get a login code",
+ "continue": "Continue",
+ "sending": "Sending code...",
+ "divider": "or",
+ "google": "Continue with Google"
+ },
+ "verify": {
+ "title": "Check your email",
+ "description": "We sent a verification code to {{email}}",
+ "resend": "Resend code",
+ "resend_cooldown": "Resend in {{seconds}}s"
+ },
+ "cli": {
+ "title": "Authorize CLI",
+ "description": "Allow the CLI to access Multica as {{email}}",
+ "authorize": "Authorize",
+ "authorizing": "Authorizing...",
+ "different_account": "Use a different account"
+ },
+ "common": {
+ "back": "Back",
+ "email": "Email",
+ "email_placeholder": "[email protected]",
+ "email_required": "Email is required"
+ },
+ "errors": {
+ "server_unreachable": "Make sure the server is running.",
+ "send_failed": "Failed to send code.",
+ "resend_failed": "Failed to resend code",
+ "code_invalid": "Invalid or expired code",
+ "cli_auth_failed": "Failed to authorize CLI. Please log in again."
+ },
+ "web": {
+ "prefer_desktop": "Prefer the desktop app?",
+ "download": "Download",
+ "desktop_handoff": {
+ "preparing": "Preparing Desktop sign-in...",
+ "opening_title": "Opening Multica",
+ "opening_description": "You should see a prompt to open the Multica desktop app. If nothing happens, click the button below.",
+ "open_button": "Open Multica Desktop",
+ "failed_title": "Sign-in Failed",
+ "prepare_failed": "Failed to prepare Desktop sign-in"
+ }
+ }
+}
diff --git a/packages/views/locales/en/autopilots.json b/packages/views/locales/en/autopilots.json
new file mode 100644
index 0000000000..53519d236d
--- /dev/null
+++ b/packages/views/locales/en/autopilots.json
@@ -0,0 +1,232 @@
+{
+ "page": {
+ "title": "Autopilot",
+ "new_autopilot": "New autopilot",
+ "start_blank": "Start from scratch",
+ "table": {
+ "name": "Name",
+ "agent": "Agent",
+ "mode": "Mode",
+ "status": "Status",
+ "last_run": "Last run"
+ },
+ "last_run_empty": "--",
+ "empty": {
+ "title": "No autopilots yet",
+ "hint": "Schedule recurring tasks for your AI agents. Pick a template or start from scratch."
+ }
+ },
+ "status": {
+ "active": "Active",
+ "paused": "Paused",
+ "archived": "Archived"
+ },
+ "execution_mode": {
+ "create_issue": "Create Issue",
+ "run_only": "Run Only"
+ },
+ "relative_date": {
+ "today": "Today",
+ "one_day_ago": "1d ago",
+ "days_ago": "{{count}}d ago",
+ "months_ago": "{{count}}mo ago"
+ },
+ "templates": {
+ "daily_news": {
+ "title": "Daily news digest",
+ "summary": "Search and summarize today's news for the team"
+ },
+ "pr_review": {
+ "title": "PR review reminder",
+ "summary": "Flag stale pull requests that need review"
+ },
+ "bug_triage": {
+ "title": "Bug triage",
+ "summary": "Assess and prioritize new bug reports"
+ },
+ "weekly_progress": {
+ "title": "Weekly progress report",
+ "summary": "Compile a weekly summary of team progress"
+ },
+ "dependency_audit": {
+ "title": "Dependency audit",
+ "summary": "Scan for security vulnerabilities and outdated packages"
+ },
+ "documentation_check": {
+ "title": "Documentation check",
+ "summary": "Review recent changes for documentation gaps"
+ }
+ },
+ "detail": {
+ "not_found": "Autopilot not found",
+ "pause_aria": "Pause autopilot",
+ "activate_aria": "Activate autopilot",
+ "edit": "Edit",
+ "run_now": "Run now",
+ "running": "Running...",
+ "toast_triggered": "Autopilot triggered",
+ "toast_trigger_failed": "Failed to trigger autopilot",
+ "section_properties": "Properties",
+ "section_triggers": "Triggers",
+ "section_run_history": "Run History",
+ "section_danger": "Danger Zone",
+ "field_agent": "Agent",
+ "field_output_mode": "Output Mode",
+ "field_prompt": "Prompt",
+ "add_trigger": "Add trigger",
+ "no_triggers": "No triggers configured. Add a schedule to run automatically.",
+ "no_runs": "No runs yet. Click \"Run now\" to trigger manually.",
+ "delete_button": "Delete autopilot",
+ "toast_deleted": "Autopilot deleted",
+ "toast_delete_failed": "Failed to delete autopilot",
+ "delete_dialog": {
+ "title": "Delete autopilot",
+ "description": "This will permanently delete \"{{title}}\", along with its triggers and run history. This action cannot be undone.",
+ "cancel": "Cancel",
+ "confirm": "Delete",
+ "deleting": "Deleting..."
+ }
+ },
+ "run_status": {
+ "issue_created": "Issue Created",
+ "running": "Running",
+ "completed": "Completed",
+ "failed": "Failed"
+ },
+ "run": {
+ "issue_linked": "Issue linked",
+ "view_log": "View execution log"
+ },
+ "trigger_row": {
+ "disabled_badge": "Disabled",
+ "next_label": "Next: {{date}}",
+ "toast_deleted": "Trigger deleted",
+ "toast_delete_failed": "Failed to delete trigger",
+ "delete_dialog": {
+ "title": "Delete trigger",
+ "description": "This trigger will be removed and the autopilot will stop firing on this schedule. This action cannot be undone.",
+ "cancel": "Cancel",
+ "confirm": "Delete",
+ "deleting": "Deleting..."
+ }
+ },
+ "add_trigger_dialog": {
+ "title": "Add Trigger",
+ "label_field": "Label (optional)",
+ "label_placeholder": "e.g. Weekday morning",
+ "submit": "Add trigger",
+ "submitting": "Adding...",
+ "toast_added": "Trigger added",
+ "toast_add_failed": "Failed to add trigger"
+ },
+ "dialog": {
+ "sr_create": "New Autopilot",
+ "sr_edit": "Edit Autopilot",
+ "header_create": "New autopilot",
+ "header_edit": "Edit autopilot",
+ "subtitle": "A recurring AI task",
+ "expand": "Expand",
+ "collapse": "Collapse",
+ "close": "Close",
+ "title_placeholder": "Autopilot name",
+ "runbook_label": "Runbook",
+ "runbook_hint": "Read by the agent on every run",
+ "description_placeholder": "# Goal\nWhat should the agent accomplish?\n\n# Context\nWho is this for? Any constraints?\n\n# Steps\n1. …\n2. …",
+ "auto_run_hint": "Once saved, runs automatically until paused.",
+ "cancel": "Cancel",
+ "create": "Create autopilot",
+ "save": "Save",
+ "creating": "Creating...",
+ "saving": "Saving...",
+ "toast_created": "Autopilot created",
+ "toast_create_partial": "Autopilot created, but schedule failed to save",
+ "toast_create_failed": "Failed to create autopilot",
+ "toast_updated": "Autopilot updated",
+ "toast_update_partial": "Autopilot updated, but schedule failed to save",
+ "toast_update_failed": "Failed to update autopilot",
+ "section_agent": "Agent",
+ "select_agent": "Select agent",
+ "section_output_mode": "Output mode",
+ "section_schedule": "Schedule",
+ "schedule_disabled_reason": "This autopilot has multiple schedules — edit them in the detail page.",
+ "next_run_label": "Next run:",
+ "output_modes": {
+ "create_issue": {
+ "label": "Create issue",
+ "description": "Each run creates a tracked issue"
+ },
+ "run_only": {
+ "label": "Run only",
+ "description": "Silent run, no issue created"
+ }
+ },
+ "frequency_long": {
+ "hourly": "Every hour",
+ "daily": "Every day",
+ "weekdays": "Every weekday",
+ "weekly": "Every week",
+ "custom": "Custom cron"
+ },
+ "days": {
+ "sunday": "Sunday",
+ "monday": "Monday",
+ "tuesday": "Tuesday",
+ "wednesday": "Wednesday",
+ "thursday": "Thursday",
+ "friday": "Friday",
+ "saturday": "Saturday"
+ }
+ },
+ "trigger_config": {
+ "frequencies": {
+ "hourly": "Hourly",
+ "daily": "Daily",
+ "weekdays": "Weekdays",
+ "weekly": "Days",
+ "custom": "Custom"
+ },
+ "days_short": {
+ "sun": "Sun",
+ "mon": "Mon",
+ "tue": "Tue",
+ "wed": "Wed",
+ "thu": "Thu",
+ "fri": "Fri",
+ "sat": "Sat"
+ },
+ "cron_label": "Cron Expression",
+ "cron_hint": "Standard 5-field cron (min hour dom month dow)",
+ "minute_label": "Minute",
+ "time_label": "Time",
+ "timezone_label": "Timezone",
+ "days_label": "Days",
+ "summary": {
+ "hourly": "Hourly · :{{min}}",
+ "daily": "Daily {{time}}",
+ "weekdays": "Weekdays {{time}}",
+ "weekly": "{{days}} {{time}}",
+ "custom": "Custom cron",
+ "no_days": "—"
+ },
+ "describe": {
+ "hourly": "Runs every hour at :{{min}}",
+ "daily": "Runs daily at {{time}} {{offset}}",
+ "weekdays": "Runs weekdays at {{time}} {{offset}}",
+ "weekly": "Runs every {{days}} at {{time}} {{offset}}",
+ "custom": "Custom schedule: {{cron}}"
+ },
+ "countdown": {
+ "days_hours": "{{days}}d {{hours}}h",
+ "hours_minutes": "{{hours}}h {{minutes}}m",
+ "minutes": "{{minutes}}m",
+ "less_than_minute": "<1m"
+ }
+ },
+ "agent_picker": {
+ "filter_placeholder": "Filter agents...",
+ "select_agent": "Select agent"
+ },
+ "timezone_picker": {
+ "search_placeholder": "Search timezone..."
+ }
+}
diff --git a/packages/views/locales/en/chat.json b/packages/views/locales/en/chat.json
new file mode 100644
index 0000000000..a02f37d3e2
--- /dev/null
+++ b/packages/views/locales/en/chat.json
@@ -0,0 +1,113 @@
+{
+ "fab": {
+ "running": "Multica is working...",
+ "unread_one": "{{count}} unread chat",
+ "unread_other": "{{count}} unread chats",
+ "default": "Ask Multica"
+ },
+ "input": {
+ "placeholder_no_agent": "Create an agent to start chatting",
+ "placeholder_archived": "This session is archived",
+ "placeholder_named": "Tell {{name}} what to do…",
+ "placeholder_default": "Tell me what to do…"
+ },
+ "message_list": {
+ "show_details": "Show details",
+ "replied_in": "Replied in {{elapsed}}",
+ "failed_after": "Failed after {{elapsed}}",
+ "task_failed_fallback": "Task failed",
+ "tools_one": "{{count}} tool",
+ "tools_other": "{{count}} tools",
+ "tool_result_named": "{{tool}} result: ",
+ "tool_result_unnamed": "result: "
+ },
+ "session_history": {
+ "back_tooltip": "Back",
+ "header": "Chat History",
+ "empty": "No chat sessions yet",
+ "untitled": "Untitled",
+ "time": {
+ "just_now": "just now",
+ "minutes": "{{count}}m ago",
+ "hours": "{{count}}h ago",
+ "days": "{{count}}d ago"
+ },
+ "row_delete_aria": "Delete chat session",
+ "row_delete_tooltip": "Delete",
+ "delete_dialog": {
+ "title": "Delete chat session",
+ "description_with_title": "\"{{title}}\" and its messages will be permanently removed. This action cannot be undone.",
+ "description_default": "This chat session and its messages will be permanently removed. This action cannot be undone.",
+ "cancel": "Cancel",
+ "confirm": "Delete",
+ "confirming": "Deleting..."
+ }
+ },
+ "window": {
+ "new_chat_tooltip": "New chat",
+ "restore_tooltip": "Restore",
+ "expand_tooltip": "Expand",
+ "minimize_tooltip": "Minimize",
+ "another_running": "Another chat is running",
+ "another_unread": "Another chat has unread replies",
+ "running": "Running",
+ "unread": "Unread",
+ "no_previous": "No previous chats",
+ "untitled": "New chat",
+ "my_agents": "My agents",
+ "others": "Others",
+ "no_agents": "No agents",
+ "history_show_tooltip": "Chat history",
+ "history_back_tooltip": "Back to chat"
+ },
+ "empty_state": {
+ "first_time_title": "Chat with your agents",
+ "first_time_intro": "✨ They know your workspace —",
+ "first_time_pillars": "issues, projects, skills",
+ "first_time_pillars_suffix": ".",
+ "first_time_actions": "Ask for a summary, plan your day, or hand off a quick task.",
+ "returning_title_named": "Hi, I'm {{name}}",
+ "returning_title_default": "Welcome to Multica",
+ "returning_subtitle": "Try asking"
+ },
+ "starter_prompts": {
+ "list_open": "List my open tasks by priority",
+ "summarize_today": "Summarize what I did today",
+ "plan_next": "Plan what to work on next"
+ },
+ "context_anchor": {
+ "tooltip_disabled": "Nothing to share with Multica on this page",
+ "tooltip_off": "Let Multica know what you're viewing",
+ "tooltip_on_issue": "Multica knows you're viewing {{label}} · Click to turn off",
+ "tooltip_on_project": "Multica knows you're viewing project \"{{label}}\" · Click to turn off",
+ "card_tooltip_issue_with_subtitle": "Multica knows you're viewing {{label}} — {{subtitle}}",
+ "card_tooltip_issue": "Multica knows you're viewing {{label}}",
+ "card_tooltip_project": "Multica knows you're viewing project \"{{label}}\"",
+ "aria_stop": "Stop sharing current page",
+ "aria_start": "Share current page with Multica"
+ },
+ "no_agent_banner": "You need an agent to start chatting.",
+ "offline_banner": {
+ "fallback_name": "the agent",
+ "unstable": "{{name}}'s connection is unstable — replies may be delayed.",
+ "offline": "{{name}} is offline — your message will be delivered when they're back."
+ },
+ "status_pill": {
+ "stages": {
+ "offline": "Offline",
+ "reconnecting": "Reconnecting",
+ "queued": "Queued",
+ "starting_up": "Starting up",
+ "thinking": "Thinking",
+ "typing": "Typing"
+ },
+ "tools": {
+ "running_command": "Running a command",
+ "reading_files": "Reading files",
+ "searching_code": "Searching the code",
+ "making_edits": "Making edits",
+ "searching_web": "Searching the web",
+ "fallback": "Working"
+ }
+ }
+}
diff --git a/packages/views/locales/en/common.json b/packages/views/locales/en/common.json
new file mode 100644
index 0000000000..cfdbc7e262
--- /dev/null
+++ b/packages/views/locales/en/common.json
@@ -0,0 +1,7 @@
+{
+ "save": "Save",
+ "cancel": "Cancel",
+ "delete": "Delete",
+ "confirm": "Confirm",
+ "loading": "Loading..."
+}
diff --git a/packages/views/locales/en/editor.json b/packages/views/locales/en/editor.json
new file mode 100644
index 0000000000..e276eac498
--- /dev/null
+++ b/packages/views/locales/en/editor.json
@@ -0,0 +1,58 @@
+{
+ "bubble_menu": {
+ "bold": "Bold",
+ "italic": "Italic",
+ "strikethrough": "Strikethrough",
+ "code": "Code",
+ "link": "Link",
+ "list": "List",
+ "quote": "Quote",
+ "url_aria_label": "URL",
+ "heading_dropdown": {
+ "text": "Text",
+ "normal_text": "Normal Text",
+ "heading_1": "Heading 1",
+ "heading_2": "Heading 2",
+ "heading_3": "Heading 3"
+ },
+ "list_dropdown": {
+ "bullet_list": "Bullet List",
+ "ordered_list": "Ordered List"
+ },
+ "sub_issue": {
+ "tooltip": "Create sub-issue from selection",
+ "created": "Created {{identifier}}",
+ "create_failed": "Failed to create sub-issue"
+ }
+ },
+ "image": {
+ "view": "View image",
+ "download": "Download",
+ "copy_link": "Copy link",
+ "delete": "Delete",
+ "link_copied": "Link copied",
+ "copy_link_failed": "Failed to copy link"
+ },
+ "link_hover": {
+ "copy_link": "Copy link",
+ "open_link": "Open link",
+ "link_copied": "Link copied",
+ "copy_failed": "Failed to copy"
+ },
+ "mention": {
+ "group_users": "Users",
+ "group_issues": "Issues",
+ "all_members": "All members",
+ "searching": "Searching...",
+ "no_results": "No results"
+ },
+ "code_block": {
+ "copy_code": "Copy code"
+ },
+ "file_card": {
+ "uploading": "Uploading {{filename}}"
+ },
+ "title_editor": {
+ "title_aria_label": "Title"
+ }
+}
diff --git a/packages/views/locales/en/inbox.json b/packages/views/locales/en/inbox.json
new file mode 100644
index 0000000000..e2be2cda71
--- /dev/null
+++ b/packages/views/locales/en/inbox.json
@@ -0,0 +1,68 @@
+{
+ "page": {
+ "title": "Inbox",
+ "back": "Inbox"
+ },
+ "menu": {
+ "mark_all_read": "Mark all as read",
+ "archive_all": "Archive all",
+ "archive_all_read": "Archive all read",
+ "archive_completed": "Archive completed"
+ },
+ "list": {
+ "empty": "No notifications",
+ "mark_done_tooltip": "Mark as done",
+ "archive_tooltip": "Archive",
+ "time": {
+ "just_now": "just now",
+ "minutes": "{{count}}m",
+ "hours": "{{count}}h",
+ "days": "{{count}}d"
+ }
+ },
+ "detail": {
+ "select_prompt": "Select a notification to view details",
+ "empty": "Your inbox is empty",
+ "original_input": "Original input",
+ "edit_advanced": "Edit as advanced form",
+ "archive": "Archive"
+ },
+ "types": {
+ "issue_assigned": "Assigned",
+ "unassigned": "Unassigned",
+ "assignee_changed": "Assignee changed",
+ "status_changed": "Status changed",
+ "priority_changed": "Priority changed",
+ "due_date_changed": "Due date changed",
+ "new_comment": "New comment",
+ "mentioned": "Mentioned",
+ "review_requested": "Review requested",
+ "task_completed": "Task completed",
+ "task_failed": "Task failed",
+ "agent_blocked": "Agent blocked",
+ "agent_completed": "Agent completed",
+ "reaction_added": "Reacted",
+ "quick_create_done": "Created with agent",
+ "quick_create_failed": "Create with agent failed"
+ },
+ "labels": {
+ "set_status_to": "Set status to",
+ "set_priority_to": "Set priority to",
+ "assigned_to": "Assigned to {{name}}",
+ "removed_assignee": "Removed assignee",
+ "set_due_date_to": "Set due date to {{date}}",
+ "removed_due_date": "Removed due date",
+ "reacted_to_comment": "Reacted {{emoji}} to your comment",
+ "created_with_agent": "Created with agent: {{identifier}}",
+ "failed_with_detail": "Failed: {{detail}}"
+ },
+ "errors": {
+ "mark_read_failed": "Failed to mark as read",
+ "archive_failed": "Failed to archive",
+ "mark_done_failed": "Failed to mark as done",
+ "mark_all_read_failed": "Failed to mark all as read",
+ "archive_all_failed": "Failed to archive all",
+ "archive_all_read_failed": "Failed to archive read items",
+ "archive_completed_failed": "Failed to archive completed"
+ }
+}
diff --git a/packages/views/locales/en/invite.json b/packages/views/locales/en/invite.json
new file mode 100644
index 0000000000..72e426fd95
--- /dev/null
+++ b/packages/views/locales/en/invite.json
@@ -0,0 +1,37 @@
+{
+ "header": {
+ "back": "Back",
+ "log_out": "Log out"
+ },
+ "not_found": {
+ "title": "Invitation not found",
+ "description": "This invitation may have expired, been revoked, or doesn't belong to your account.",
+ "go_to_dashboard": "Go to dashboard"
+ },
+ "accepted": {
+ "title": "You joined {{workspace_name}}!",
+ "redirecting": "Redirecting to workspace..."
+ },
+ "declined": {
+ "title": "Invitation declined",
+ "description": "You won't be added to this workspace.",
+ "go_to_dashboard": "Go to dashboard"
+ },
+ "main": {
+ "join_title": "Join {{workspace_name}}",
+ "fallback_workspace_name": "workspace",
+ "invited_role_admin": "invited you to join as an admin.",
+ "invited_role_member": "invited you to join as a member.",
+ "already_handled_accepted": "This invitation has already been accepted.",
+ "already_handled_declined": "This invitation has already been declined.",
+ "expired": "This invitation has expired.",
+ "decline": "Decline",
+ "declining": "Declining...",
+ "accept": "Accept & Join",
+ "joining": "Joining..."
+ },
+ "errors": {
+ "accept_failed": "Failed to accept invitation",
+ "decline_failed": "Failed to decline invitation"
+ }
+}
diff --git a/packages/views/locales/en/issues.json b/packages/views/locales/en/issues.json
new file mode 100644
index 0000000000..ba60cbb306
--- /dev/null
+++ b/packages/views/locales/en/issues.json
@@ -0,0 +1,305 @@
+{
+ "page": {
+ "breadcrumb_title": "Issues",
+ "breadcrumb_workspace_fallback": "Workspace",
+ "empty_title": "No issues yet",
+ "empty_hint": "Create an issue to get started.",
+ "move_failed": "Failed to move issue"
+ },
+ "status": {
+ "backlog": "Backlog",
+ "todo": "Todo",
+ "in_progress": "In Progress",
+ "in_review": "In Review",
+ "done": "Done",
+ "blocked": "Blocked",
+ "cancelled": "Cancelled"
+ },
+ "priority": {
+ "urgent": "Urgent",
+ "high": "High",
+ "medium": "Medium",
+ "low": "Low",
+ "none": "No priority"
+ },
+ "scope": {
+ "all_label": "All",
+ "all_description": "All issues in this workspace",
+ "members_label": "Members",
+ "members_description": "Issues assigned to team members",
+ "agents_label": "Agents",
+ "agents_description": "Issues assigned to AI agents"
+ },
+ "filters": {
+ "tooltip": "Filter",
+ "placeholder": "Filter...",
+ "no_results": "No results",
+ "no_labels": "No labels yet",
+ "no_assignee": "No assignee",
+ "no_project": "No project",
+ "section_status": "Status",
+ "section_priority": "Priority",
+ "section_assignee": "Assignee",
+ "section_creator": "Creator",
+ "section_project": "Project",
+ "section_label": "Label",
+ "members_group": "Members",
+ "agents_group": "Agents",
+ "issue_count_one": "{{count}} issue",
+ "issue_count_other": "{{count}} issues",
+ "reset": "Reset all filters"
+ },
+ "display": {
+ "tooltip": "Display settings",
+ "ordering_section": "Ordering",
+ "card_properties_section": "Card properties",
+ "ascending_title": "Ascending",
+ "descending_title": "Descending",
+ "sort_manual": "Manual",
+ "sort_priority": "Priority",
+ "sort_due_date": "Due date",
+ "sort_created": "Created date",
+ "sort_title": "Title",
+ "card_priority": "Priority",
+ "card_description": "Description",
+ "card_assignee": "Assignee",
+ "card_due_date": "Due date",
+ "card_project": "Project",
+ "card_labels": "Labels",
+ "card_child_progress": "Sub-issue progress"
+ },
+ "view": {
+ "tooltip_board": "Board view",
+ "tooltip_list": "List view",
+ "section": "View",
+ "board": "Board",
+ "list": "List"
+ },
+ "list": {
+ "empty_status": "No issues",
+ "add_issue_tooltip": "Add issue"
+ },
+ "board": {
+ "hidden_columns_label": "Hidden columns",
+ "hide_column": "Hide column",
+ "show_column": "Show column",
+ "add_issue_tooltip": "Add issue",
+ "empty_column": "No issues"
+ },
+ "detail": {
+ "not_found": "This issue does not exist or has been deleted in this workspace.",
+ "back_to_issues": "Back to Issues",
+ "title_placeholder": "Issue title",
+ "desc_placeholder": "Add description...",
+ "sub_issues_label": "Sub-issues",
+ "sub_issue_of": "Sub-issue of",
+ "add_sub_issues": "Add sub-issues",
+ "add_sub_issue_tooltip": "Add sub-issue",
+ "add_sub_issue_aria": "Add sub-issue",
+ "section_properties": "Properties",
+ "section_parent_issue": "Parent issue",
+ "section_details": "Details",
+ "section_token_usage": "Token usage",
+ "prop_status": "Status",
+ "prop_priority": "Priority",
+ "prop_assignee": "Assignee",
+ "prop_due_date": "Due date",
+ "prop_project": "Project",
+ "prop_labels": "Labels",
+ "prop_created_by": "Created by",
+ "prop_created": "Created",
+ "prop_updated": "Updated",
+ "prop_input": "Input",
+ "prop_output": "Output",
+ "prop_cache": "Cache",
+ "prop_cache_value": "{{read}} read / {{write}} write",
+ "prop_runs": "Runs",
+ "activity_section": "Activity",
+ "subscribe": "Subscribe",
+ "unsubscribe": "Unsubscribe",
+ "no_subscribers_results": "No results found",
+ "change_subscribers_placeholder": "Change subscribers...",
+ "members_group": "Members",
+ "agents_group": "Agents",
+ "mark_done_tooltip": "Mark as done",
+ "pin_tooltip": "Pin to sidebar",
+ "unpin_tooltip": "Unpin from sidebar",
+ "sidebar_tooltip": "Toggle sidebar",
+ "update_failed": "Failed to update issue",
+ "link_copied": "Link copied",
+ "link_copy_failed": "Failed to copy link"
+ },
+ "activity": {
+ "created": "created this issue",
+ "self_assigned": "self-assigned this issue",
+ "assigned_to": "assigned to {{name}}",
+ "removed_assignee": "removed assignee",
+ "changed_assignee": "changed assignee",
+ "status_changed": "changed status from {{from}} to {{to}}",
+ "priority_changed": "changed priority from {{from}} to {{to}}",
+ "due_date_set": "set due date to {{date}}",
+ "due_date_removed": "removed due date",
+ "title_renamed": "renamed this issue from \"{{from}}\" to \"{{to}}\"",
+ "description_updated": "updated the description",
+ "task_completed_one": "completed the task",
+ "task_completed_other": "completed the task ({{count}} times)",
+ "task_failed_one": "task failed",
+ "task_failed_other": "task failed ({{count}} times)"
+ },
+ "comment": {
+ "delete_title": "Delete comment",
+ "delete_desc": "This comment will be permanently deleted. This cannot be undone.",
+ "delete_desc_with_replies": "This comment and all its replies will be permanently deleted. This cannot be undone.",
+ "delete_action": "Delete",
+ "cancel_action": "Cancel",
+ "edit_placeholder": "Edit comment...",
+ "save_action": "Save",
+ "cancel_edit": "Cancel",
+ "copy_action": "Copy",
+ "copied_toast": "Copied",
+ "edit_action": "Edit",
+ "update_failed": "Failed to update comment",
+ "send_failed": "Failed to send comment",
+ "send_reply_failed": "Failed to send reply",
+ "delete_failed": "Failed to delete comment",
+ "reply_count_one": "{{count}} reply",
+ "reply_count_other": "{{count}} replies",
+ "leave_comment_placeholder": "Leave a comment...",
+ "expand_tooltip": "Expand",
+ "collapse_tooltip": "Collapse"
+ },
+ "reply": {
+ "placeholder": "Leave a reply...",
+ "expand_tooltip": "Expand",
+ "collapse_tooltip": "Collapse"
+ },
+ "agent_live": {
+ "is_working": "{{name}} is working",
+ "fallback_name": "Agent",
+ "tool_count_one": "{{count}} tool",
+ "tool_count_other": "{{count}} tools",
+ "transcript_button": "View transcript",
+ "stop_button": "Stop",
+ "stop_tooltip": "Stop agent",
+ "cancel_failed": "Failed to cancel task"
+ },
+ "execution_log": {
+ "section": "Execution log",
+ "show_past": "Show past runs ({{count}})",
+ "hide_past": "Hide past runs ({{count}})",
+ "cancel_task_tooltip": "Cancel task",
+ "cancel_task_aria": "Cancel task",
+ "transcript_tooltip": "View transcript",
+ "cancel_failed": "Failed to cancel task",
+ "trigger_retry": "Retry",
+ "trigger_retry_attempt": "Retry #{{attempt}}",
+ "trigger_retry_attempt_prefix": "Retry #{{attempt}} · ",
+ "trigger_retry_prefix": "Retry · ",
+ "trigger_autopilot": "Autopilot run",
+ "trigger_comment": "Comment trigger",
+ "trigger_initial": "Initial run",
+ "status_queued": "Queued",
+ "status_dispatched": "Starting",
+ "status_running": "Working",
+ "status_completed": "Completed",
+ "status_failed": "Failed",
+ "status_cancelled": "Cancelled"
+ },
+ "batch": {
+ "selected": "{{count}} selected",
+ "status": "Status",
+ "priority": "Priority",
+ "assignee": "Assignee",
+ "delete": "Delete",
+ "update_success_one": "Updated {{count}} issue",
+ "update_success_other": "Updated {{count}} issues",
+ "update_failed": "Failed to update issues",
+ "delete_success_one": "Deleted {{count}} issue",
+ "delete_success_other": "Deleted {{count}} issues",
+ "delete_failed": "Failed to delete issues",
+ "delete_dialog_title_one": "Delete {{count}} issue?",
+ "delete_dialog_title_other": "Delete {{count}} issues?",
+ "delete_dialog_desc_one": "This action cannot be undone. This will permanently delete the selected issue and all associated data.",
+ "delete_dialog_desc_other": "This action cannot be undone. This will permanently delete the selected issues and all associated data.",
+ "delete_dialog_warning": "Any workspace member can delete issues.",
+ "cancel": "Cancel"
+ },
+ "card": {
+ "update_failed": "Failed to update issue"
+ },
+ "actions": {
+ "status": "Status",
+ "priority": "Priority",
+ "assignee": "Assignee",
+ "due_date": "Due date",
+ "due_today": "Today",
+ "due_tomorrow": "Tomorrow",
+ "due_next_week": "Next week",
+ "due_clear": "Clear date",
+ "unassigned": "Unassigned",
+ "pin_to_sidebar": "Pin to sidebar",
+ "unpin_from_sidebar": "Unpin from sidebar",
+ "copy_link": "Copy link",
+ "more": "More",
+ "create_sub_issue": "Create sub-issue",
+ "set_parent_issue": "Set parent issue...",
+ "add_sub_issue": "Add sub-issue...",
+ "delete_issue": "Delete issue"
+ },
+ "pickers": {
+ "filter_options_aria": "Filter options",
+ "no_results": "No results",
+ "assignee": {
+ "trigger_unassigned": "Unassigned",
+ "search_placeholder": "Assign to...",
+ "members_group": "Members",
+ "agents_group": "Agents"
+ },
+ "due_date": {
+ "trigger_label": "Due date",
+ "clear_action": "Clear date"
+ },
+ "label": {
+ "trigger_label": "Add label",
+ "search_placeholder": "Find or create a label…",
+ "manage_action": "Manage labels…",
+ "manage_dialog_title": "Manage labels",
+ "create_action": "Create",
+ "create_failed": "Failed to create label"
+ }
+ },
+ "labels_panel": {
+ "intro": "Create and manage labels to categorize issues across your workspace.",
+ "new_placeholder": "New label name…",
+ "new_aria": "New label name",
+ "add_action": "Add",
+ "loading": "Loading…",
+ "empty": "No labels yet.",
+ "name_required": "Label name is required.",
+ "color_label": "Color",
+ "pick_color_aria": "Pick a color",
+ "edit_aria": "Edit {{name}}",
+ "delete_aria": "Delete {{name}}",
+ "save_aria": "Save",
+ "cancel_aria": "Cancel",
+ "delete_dialog_title": "Delete label?",
+ "delete_dialog_desc_prefix": "The label ",
+ "delete_dialog_desc_suffix": " will be removed from all issues. This cannot be undone.",
+ "delete_dialog_cancel": "Cancel",
+ "delete_dialog_confirm": "Delete",
+ "create_failed": "Failed to create label",
+ "update_failed": "Failed to update label",
+ "delete_failed": "Failed to delete label"
+ },
+ "backlog_hint": {
+ "title": "Agent is paused in Backlog",
+ "description": "This issue is parked, so the assigned agent will wait. Move it to Todo when you want the agent to start.",
+ "row_backlog_label": "Backlog",
+ "row_backlog_hint": "keeps the agent paused",
+ "row_todo_label": "Todo",
+ "row_todo_hint": "starts the agent",
+ "dont_show_again": "Don't show this again",
+ "keep_in_backlog": "Keep in Backlog",
+ "move_to_todo": "Move to Todo"
+ }
+}
diff --git a/packages/views/locales/en/labels.json b/packages/views/locales/en/labels.json
new file mode 100644
index 0000000000..76a91848e0
--- /dev/null
+++ b/packages/views/locales/en/labels.json
@@ -0,0 +1,3 @@
+{
+ "remove_label": "Remove label {{name}}"
+}
diff --git a/packages/views/locales/en/layout.json b/packages/views/locales/en/layout.json
new file mode 100644
index 0000000000..f3717cc048
--- /dev/null
+++ b/packages/views/locales/en/layout.json
@@ -0,0 +1,39 @@
+{
+ "nav": {
+ "inbox": "Inbox",
+ "my_issues": "My Issues",
+ "issues": "Issues",
+ "projects": "Projects",
+ "autopilots": "Autopilot",
+ "agents": "Agents",
+ "runtimes": "Runtimes",
+ "skills": "Skills",
+ "settings": "Settings"
+ },
+ "help": {
+ "trigger": "Help",
+ "docs": "Docs",
+ "changelog": "Change log",
+ "feedback": "Feedback"
+ },
+ "workspace_loader": {
+ "loading_workspace": "Loading workspace…",
+ "loading_named_prefix": "Loading"
+ },
+ "sidebar": {
+ "unpin_tooltip": "Unpin",
+ "workspaces_label": "Workspaces",
+ "create_workspace": "Create workspace",
+ "pending_invitations_label": "Pending invitations",
+ "invitation_workspace_fallback": "Workspace",
+ "invitation_join": "Join",
+ "invitation_decline": "Decline",
+ "log_out": "Log out",
+ "new_issue": "New Issue",
+ "new_issue_shortcut": "C",
+ "pinned_label": "Pinned",
+ "workspace_group": "Workspace",
+ "configure_group": "Configure",
+ "unread_overflow": "99+"
+ }
+}
diff --git a/packages/views/locales/en/members.json b/packages/views/locales/en/members.json
new file mode 100644
index 0000000000..a3b4daccc6
--- /dev/null
+++ b/packages/views/locales/en/members.json
@@ -0,0 +1,14 @@
+{
+ "role": {
+ "owner": "Owner",
+ "admin": "Admin",
+ "member": "Member"
+ },
+ "card": {
+ "unavailable": "Member unavailable",
+ "agents_section": "Agents ({{count}})",
+ "detail_link": "Detail →",
+ "more_agents_one": "and {{count}} other agent",
+ "more_agents_other": "and {{count}} other agents"
+ }
+}
diff --git a/packages/views/locales/en/modals.json b/packages/views/locales/en/modals.json
new file mode 100644
index 0000000000..8f657ccefa
--- /dev/null
+++ b/packages/views/locales/en/modals.json
@@ -0,0 +1,136 @@
+{
+ "common": {
+ "back": "Back",
+ "close": "Close",
+ "cancel": "Cancel",
+ "expand_tooltip": "Expand",
+ "collapse_tooltip": "Collapse"
+ },
+ "create_workspace": {
+ "title": "Create a new workspace",
+ "description": "Workspaces are shared environments where teams can work on projects and issues."
+ },
+ "delete_issue": {
+ "title": "Delete issue",
+ "description": "This will permanently delete this issue and all its comments. This action cannot be undone.",
+ "hint": "Any workspace member can delete issues.",
+ "cancel": "Cancel",
+ "confirm": "Delete",
+ "deleting": "Deleting...",
+ "toast_deleted": "Issue deleted",
+ "toast_delete_failed": "Failed to delete issue"
+ },
+ "feedback": {
+ "title": "Feedback",
+ "description": "We'd love to hear what's working, what isn't, or what you'd like to see next.",
+ "placeholder": "Tell us about your experience, bugs you've found, or features you'd like to see…",
+ "toast_uploading": "Please wait for uploads to finish…",
+ "toast_too_long": "Message is too long",
+ "toast_sent": "Thanks for the feedback!",
+ "toast_failed": "Failed to send feedback",
+ "send": "Send feedback",
+ "sending": "Sending…"
+ },
+ "issue_picker": {
+ "search_placeholder": "Search issues...",
+ "searching": "Searching...",
+ "no_results": "No issues found.",
+ "prompt_to_search": "Type to search issues"
+ },
+ "set_parent": {
+ "title": "Set parent issue",
+ "description": "Search for an issue to set as the parent of this issue",
+ "toast_failed": "Failed to update issue",
+ "toast_success": "Set {{identifier}} as parent issue"
+ },
+ "add_child": {
+ "title": "Add sub-issue",
+ "description": "Search for an issue to add as a sub-issue",
+ "toast_failed": "Failed to add sub-issue",
+ "toast_success": "Added {{identifier}} as sub-issue"
+ },
+ "backlog_hint": {
+ "toast_status_failed": "Failed to update status"
+ },
+ "create_project": {
+ "title": "New Project",
+ "title_breadcrumb": "New project",
+ "icon_tooltip": "Choose icon",
+ "title_placeholder": "Project title",
+ "description_placeholder": "Add description...",
+ "lead": "Lead",
+ "no_lead": "No lead",
+ "lead_placeholder": "Assign lead...",
+ "members_group": "Members",
+ "agents_group": "Agents",
+ "no_results": "No results",
+ "submit": "Create Project",
+ "submitting": "Creating...",
+ "toast_created": "Project created",
+ "toast_failed": "Failed to create project",
+ "repos_pill": "Repos",
+ "repos_pill_count_one": "{{count}} repo",
+ "repos_pill_count_other": "{{count}} repos",
+ "repos_heading": "Attach GitHub repos to this project",
+ "repos_empty": "No workspace-level repos yet. Paste a URL below to attach one ad-hoc.",
+ "repos_url_placeholder": "https://github.com/owner/repo",
+ "repos_add": "Add",
+ "repos_selected": "Selected"
+ },
+ "create_issue": {
+ "sr_manual": "New Issue",
+ "sr_agent": "Quick create issue",
+ "manual_breadcrumb": "Create manually",
+ "agent_breadcrumb": "Create with agent",
+ "title_placeholder": "Issue title",
+ "description_placeholder": "Add description...",
+ "more_options_aria": "More options",
+ "submit": "Create Issue",
+ "submitting": "Creating...",
+ "toast_created": "Issue created",
+ "view_issue": "View issue",
+ "toast_failed": "Failed to create issue",
+ "toast_link_subissues_all_failed": "Failed to link sub-issues",
+ "toast_link_subissues_partial": "Failed to link {{failed}} of {{total}} sub-issues",
+ "switch_to_agent": "Switch to Agent",
+ "switch_to_agent_tooltip": "Switch to create with agent — describe in one line and let the agent file it",
+ "switch_to_manual": "Switch to Manual",
+ "switch_to_manual_tooltip": "Switch to manual create — fill the fields yourself",
+ "create_another": "Create another",
+ "remove_parent_aria": "Remove parent",
+ "remove_subissue_aria": "Remove sub-issue {{identifier}}",
+ "subissue_of": "Sub-issue of {{identifier}}",
+ "subissue_chip": "Sub-issue: {{identifier}}",
+ "parent_with_id": "Parent: {{identifier}}",
+ "set_parent": "Set parent issue...",
+ "add_subissue": "Add sub-issue...",
+ "remove_parent": "Remove parent",
+ "set_parent_picker": {
+ "title": "Set parent issue",
+ "description": "Search for an issue to set as the parent of the new issue"
+ },
+ "add_subissue_picker": {
+ "title": "Add sub-issue",
+ "description": "Search for an issue to add as a sub-issue of the new issue"
+ },
+ "agent": {
+ "created_by": "Created by",
+ "select_agent_aria": "Select agent",
+ "pick_an_agent": "Pick an agent…",
+ "no_agents": "No agents available.",
+ "version_missing": "This agent's daemon doesn't report a CLI version. Create with agent needs multica CLI ≥ {{min}}. Upgrade the daemon and reconnect, or switch to manual create.",
+ "version_below": "This agent's daemon CLI is {{current}} — Create with agent needs ≥ {{min}}. Upgrade the daemon, or switch to manual create.",
+ "prompt_placeholder": "Tell the agent what to do, e.g. \"let Bohan fix the inbox loading slowness in the Web project\"",
+ "submit": "Create (⌘↵)",
+ "sending": "Sending…",
+ "uploading": "Uploading…",
+ "sent_label": "Sent",
+ "sent_count": "{{count}} sent",
+ "version_blocked_tooltip": "Daemon CLI must be ≥ {{min}}",
+ "toast_sent": "Sent to agent — you'll get an inbox notification when it's done",
+ "error_agent_unavailable_fallback": "Agent is unavailable. Pick another agent.",
+ "error_daemon_version": "This agent's daemon CLI ({{current}}) is below the required {{min}}. Upgrade the daemon to use Create with agent.",
+ "error_unknown": "Failed to submit. Try again."
+ }
+ }
+}
diff --git a/packages/views/locales/en/my-issues.json b/packages/views/locales/en/my-issues.json
new file mode 100644
index 0000000000..43d88fd4d7
--- /dev/null
+++ b/packages/views/locales/en/my-issues.json
@@ -0,0 +1,38 @@
+{
+ "page": {
+ "breadcrumb": "My Issues",
+ "workspace_fallback": "Workspace",
+ "empty_title": "No issues assigned to you",
+ "empty_description": "Issues you create or are assigned to will appear here."
+ },
+ "header": {
+ "scope": {
+ "assigned_label": "Assigned",
+ "assigned_description": "Issues assigned to me",
+ "created_label": "Created",
+ "created_description": "Issues I created",
+ "agents_label": "My Agents",
+ "agents_description": "Issues assigned to my agents"
+ },
+ "filter_button": "Filter",
+ "filter_status": "Status",
+ "filter_priority": "Priority",
+ "issue_count_one": "{{count}} issue",
+ "issue_count_other": "{{count}} issues",
+ "reset_filters": "Reset all filters",
+ "display_settings": "Display settings",
+ "ordering": "Ordering",
+ "ascending": "Ascending",
+ "descending": "Descending",
+ "card_properties": "Card properties",
+ "view_board": "Board view",
+ "view_list": "List view",
+ "view_label": "View",
+ "view_board_short": "Board",
+ "view_list_short": "List",
+ "sort_manual": "Manual"
+ },
+ "errors": {
+ "move_failed": "Failed to move issue"
+ }
+}
diff --git a/packages/views/locales/en/onboarding.json b/packages/views/locales/en/onboarding.json
new file mode 100644
index 0000000000..891d3ed063
--- /dev/null
+++ b/packages/views/locales/en/onboarding.json
@@ -0,0 +1,304 @@
+{
+ "step_header": {
+ "step_of": "Step {{current}} of {{total}}"
+ },
+ "welcome": {
+ "wordmark": "Welcome to Multica",
+ "headline_line1": "Your AI teammates,",
+ "headline_line2": "in",
+ "headline_emphasis": "one workspace.",
+ "lede": "Assign them work like you'd assign a colleague — they pick it up, update status, and comment when done.",
+ "lede_web": "Desktop bundles the runtime — nothing to install. Continue on web to connect your own CLI.",
+ "lede_desktop": "By the end, a real agent will be replying to your first issue.",
+ "download_desktop": "Download Desktop",
+ "continue_on_web": "Continue on web",
+ "start_exploring": "Start exploring",
+ "skip_existing": "I've done this before",
+ "illustration_caption": "Every issue, every thread, every decision — shared by your team and agents.",
+ "illustration": {
+ "card1_actor_name": "You",
+ "card1_actor_initial": "N",
+ "card1_body_prefix": " can you draft a short launch post? Pull from ",
+ "card1_body_suffix": "'s interview findings.",
+ "card1_mention_content": "@Content Agent",
+ "card1_mention_research": "@Research Agent",
+ "card2_actor_name": "Content Agent",
+ "card2_body": "On it. Pulling Research's quotes, drafting around the \"time saved\" angle…",
+ "card3_actor_name": "Research Agent",
+ "card3_body": "This week's user interviews summarized — 12 calls, 4 recurring themes, 3 pull-quotes.",
+ "card3_timestamp": "15 min ago",
+ "card4_actor_name": "Review Agent",
+ "card4_body": "Reviewed Monday's draft — left 4 notes on tone. Standing by for the new one.",
+ "card5_actor_name": "Coding Agent",
+ "card5_body_prefix": "Shipped the export feature ",
+ "card5_body_suffix": " flagged. Preview link in the PR.",
+ "card5_mention_you": "@you",
+ "card5_timestamp": "just now"
+ }
+ },
+ "common": {
+ "back": "Back",
+ "continue": "Continue"
+ },
+ "questionnaire": {
+ "eyebrow": "Before we start",
+ "headline": "Three questions to get to know you.",
+ "q1_question": "Who will use this workspace?",
+ "q1_solo": "Just me",
+ "q1_team": "My team (2–10 people)",
+ "q1_other_placeholder": "e.g. a small community I help run",
+ "q2_question": "What best describes you?",
+ "q2_developer": "Software developer",
+ "q2_product_lead": "Product or project lead",
+ "q2_writer": "Writer or content creator",
+ "q2_founder": "Founder or operator",
+ "q2_other_placeholder": "e.g. researcher, designer, ops lead",
+ "q3_question": "What do you want to do with Multica?",
+ "q3_coding": "Write and ship code",
+ "q3_planning": "Plan and manage projects",
+ "q3_writing_research": "Research or write",
+ "q3_explore": "I'm just exploring for now",
+ "q3_other_placeholder": "e.g. automate my weekly reports",
+ "answered_progress": "{{count}} of 3 answered",
+ "why_eyebrow": "Why three questions",
+ "why_headline": "So you land running.",
+ "what_eyebrow": "What you get",
+ "unlock_starter_title": "A starter project, tailored",
+ "unlock_starter_body": "A Getting Started checklist shaped by your answers.",
+ "unlock_agents_title": "A head start with agents",
+ "unlock_agents_body": "Connect a runtime and we'll pick a template for your role — plus write its first task.",
+ "learn_more": "Learn how agents work →"
+ },
+ "option_card": {
+ "other_label": "Other",
+ "other_aria": "Describe something else"
+ },
+ "runtime_aside": {
+ "what_eyebrow": "What's a runtime?",
+ "what_prefix": "A ",
+ "what_term": "runtime",
+ "what_suffix": " is a small background process that runs on your machine. It connects your workspace to AI coding tools like Claude Code or Codex, and executes the tasks your agents pick up.",
+ "good_eyebrow": "Good to know",
+ "swap_title": "Swap anytime",
+ "swap_body": "Each agent's runtime is just a setting. Change it whenever you want.",
+ "add_more_title": "Add more later",
+ "add_more_body": "You can connect a second runtime on another machine for a team, or a dedicated one per agent.",
+ "learn_more": "Learn about runtimes →"
+ },
+ "cli_install": {
+ "copy_aria": "Copy",
+ "intro": "You'll need an AI coding tool on this machine (Claude Code, Codex, Cursor, …) for the daemon to do real work. Also works on servers and remote dev boxes.",
+ "step1_label": "Install the Multica CLI",
+ "step2_label": "Start the daemon"
+ },
+ "starter_content": {
+ "title": "Welcome — add starter tasks?",
+ "description_prefix": "A ",
+ "description_term": "Getting Started",
+ "description_suffix": " project with short tasks that walk through how agents, issues, and context work in Multica.",
+ "dismiss_action": "Start blank workspace",
+ "import_action": "Add starter tasks",
+ "success_toast": "Starter tasks added — check your sidebar",
+ "import_failed": "Import failed — please retry",
+ "dismiss_failed": "Could not dismiss — please retry"
+ },
+ "cloud_waitlist": {
+ "intro_main": "Cloud runtimes aren't live yet. Leave your email and we'll reach out when they are.",
+ "intro_warning": "Heads-up: agents can't execute tasks without a runtime — if you hit Skip now, your workspace is read-only until you come back and install one.",
+ "email_label": "Email",
+ "email_placeholder": "[email protected]",
+ "reason_label": "Why cloud?",
+ "optional": "Optional",
+ "reason_placeholder": "e.g. we want agents running 24/7, or my team works across different devices.",
+ "join": "Join waitlist",
+ "on_list": "You're on the list",
+ "success_toast": "You're on the list. We'll email when cloud runtimes are live.",
+ "failed_toast": "Failed to join waitlist"
+ },
+ "first_issue": {
+ "error_title": "Something went wrong",
+ "retry": "Retry",
+ "retry_failed": "Retry failed",
+ "finishing": "Finishing up",
+ "opening": "Almost there — opening your workspace."
+ },
+ "step_agent": {
+ "eyebrow": "Your first agent",
+ "headline": "Meet your first teammate.",
+ "lede_prefix": "Your answers point to a ",
+ "lede_suffix": ". Pick whichever of the four fits you — each template ships ready to take its first issue. You can retune its instructions from the agent settings page later.",
+ "footer_hint": "One agent is enough to start. Add more from the sidebar later.",
+ "create_action": "Create {{name}}",
+ "create_failed": "Failed to create agent",
+ "recommended_badge": "Recommended",
+ "templates": {
+ "coding": {
+ "label": "Coding Agent",
+ "blurb": "Writes, refactors, and ships code. Reads your repo.",
+ "instructions": "You are a Coding Agent on a product team. Pick up coding issues — implement features, fix bugs, write tests, and open pull requests. Read the repository before you start, follow existing code conventions, and keep diffs focused. Ask for clarification when the acceptance criteria are ambiguous."
+ },
+ "planning": {
+ "label": "Planning Agent",
+ "blurb": "Breaks down work, drafts specs, keeps the board tidy.",
+ "instructions": "You are a Planning Agent. Turn loose ideas and open issues into scoped, ready-to-execute work: break them down into subtasks, write acceptance criteria, and propose owners and sequencing. Prefer clarity over speed. When blocked by missing context, ask one specific question rather than guessing."
+ },
+ "writing": {
+ "label": "Writing Agent",
+ "blurb": "Drafts, summarizes, researches. Long-form friendly.",
+ "instructions": "You are a Writing Agent. Draft documents, summarize long content, and research topics on the web when needed. Structure your output as finished prose a reader can use directly — not an outline. Cite sources when you draw from them. Match the tone the user establishes in the issue."
+ },
+ "assistant": {
+ "label": "Assistant",
+ "blurb": "General-purpose. Good default when the task is unclear.",
+ "instructions": "You are a general-purpose teammate. Handle varied tasks — light coding, writing, research, planning — and stay pragmatic about scope. When the task is ambiguous, ask one clarifying question before diving in. Default to short, useful outputs over exhaustive ones."
+ }
+ },
+ "about_eyebrow": "What's an agent",
+ "about_headline": "An AI teammate that lives in your workspace.",
+ "about_body": "Agents show up in every assignee picker, just like any other colleague — except they can work 24/7 on whatever runtime you give them.",
+ "ways_eyebrow": "Ways to work with an agent",
+ "way_assign_title": "Assign it an issue",
+ "way_assign_body": "It picks up the task and reports back in the thread.",
+ "way_mention_title": "@mention in a comment",
+ "way_mention_body": "Pull it into a conversation for a quick take.",
+ "way_chat_title": "Chat one-on-one",
+ "way_chat_body": "Ask quick questions without creating an issue.",
+ "way_autopilot_title": "Put it on Autopilot",
+ "way_autopilot_body": "Daily triage, weekly digest, monthly audit — on a schedule.",
+ "add_more_hint": "Add more agents anytime. A small team of specialized agents beats one jack-of-all-trades.",
+ "docs_link": "Creating your first agent →"
+ },
+ "step_workspace": {
+ "eyebrow_first": "Your first workspace",
+ "eyebrow_resume": "Pick up or start fresh",
+ "headline_first": "Name your workspace.",
+ "headline_resume": "Continue with {{name}}, or start another.",
+ "lede_first": "A workspace is where your issues, agents, and projects live. You can invite teammates or spin up more workspaces later.",
+ "lede_resume": "Resume setup with the workspace you already have, or create a new one alongside it — you can belong to any number of workspaces.",
+ "name_label": "Workspace name",
+ "name_placeholder": "Acme Inc, My Lab, Side Projects…",
+ "url_label": "URL",
+ "slug_placeholder": "acme",
+ "issue_prefix_label": "Issue prefix",
+ "issue_prefix_prefix": "Issues will look like ",
+ "issue_prefix_suffix": ". You can change this later in settings.",
+ "create_new_title": "Create a new workspace",
+ "create_new_subtitle": "Start fresh — a separate space for a different side of your work.",
+ "hint_opening": "Opening {{name}}.",
+ "hint_creating": "Creating {{name}}.",
+ "hint_creating_pending": "Creating {{name}}…",
+ "hint_creating_fallback": "your workspace",
+ "hint_name_first": "Name your workspace to create it.",
+ "hint_pick": "Pick your workspace or start a new one.",
+ "cta_open": "Open {{name}}",
+ "cta_create_named": "Create {{name}}",
+ "cta_create_workspace": "Create workspace",
+ "cta_creating": "Creating…",
+ "slug_conflict_toast": "Choose a different workspace URL",
+ "create_failed_toast": "Failed to create workspace",
+ "side_create_eyebrow": "What lives inside a workspace",
+ "side_existing_eyebrow": "Your workspace",
+ "side_things_eyebrow": "Things you'll do here",
+ "side_next_eyebrow": "What's next",
+ "side_preview_name": "Your workspace",
+ "side_preview_slug": "workspace",
+ "perk_assign": "Assign issues to agents like you would a teammate",
+ "perk_chat": "Chat with any agent without creating an issue",
+ "perk_invite": "Invite teammates — they see only this workspace",
+ "perk_switch": "Switch to other workspaces anytime from the top-left",
+ "next_runtime": "Connect a runtime so your agents have somewhere to run",
+ "next_agent": "Create your first agent matched to your role",
+ "next_starter": "Watch it pick up a starter task and reply",
+ "preview": {
+ "inbox_label": "Inbox",
+ "inbox_meta": "your notifications",
+ "issues_label": "Issues",
+ "issues_meta": "shared task board",
+ "agents_label": "Agents",
+ "agents_meta": "your AI teammates",
+ "projects_label": "Projects",
+ "projects_meta": "group related issues",
+ "autopilot_label": "Autopilot",
+ "autopilot_meta": "scheduled automation",
+ "runtimes_label": "Runtimes",
+ "runtimes_meta": "where agents run",
+ "skills_label": "Skills",
+ "skills_meta": "reusable playbooks",
+ "more_label": "And more",
+ "more_meta": "and more"
+ }
+ },
+ "step_runtime": {
+ "scanning_headline": "Looking for your tools…",
+ "scanning_lede_prefix": "Multica drives local AI coding tools like ",
+ "scanning_lede_suffix": ", and others. We're waiting to hear back from your machine about which ones are installed.",
+ "found_headline": "We found your runtimes.",
+ "found_lede": "We scanned your machine for AI coding tools you've already set up. Pick one for your first agent.",
+ "runtime_count_one": "{{count}} runtime",
+ "runtime_count_other": "{{count}} runtimes",
+ "status_all_online": "all online",
+ "status_none_online": "none online",
+ "status_n_online": "{{count}} online",
+ "online_label": "online",
+ "offline_label": "offline",
+ "empty_headline": "No supported tools detected.",
+ "empty_lede_prefix": "Multica drives local AI coding tools like ",
+ "empty_lede_suffix": ", and others — we didn't find any on this machine. Install one and come back, or pick a path below.",
+ "empty_skip_title": "Skip for now",
+ "empty_skip_subtitle": "Enter your workspace in read-only mode. Agents can't execute tasks until a runtime connects — but you can still browse, plan, and invite teammates.",
+ "empty_skip_action": "Skip",
+ "empty_waitlist_title": "Join the cloud runtime waitlist",
+ "empty_waitlist_subtitle": "We'll host the runtime for you — no local install, no setup. Not live yet; click to leave your email and get notified.",
+ "empty_waitlist_action": "Join waitlist",
+ "empty_waitlist_done": "On the waitlist",
+ "dialog_title": "Join the cloud runtime waitlist",
+ "dialog_description": "Cloud runtimes aren't live yet. Leave your email and we'll email you when they are.",
+ "dialog_close": "Close",
+ "dialog_cancel": "Cancel",
+ "skip": "Skip for now",
+ "hint_selected": "Selected: {{name}}",
+ "hint_pick": "Pick a runtime above to continue.",
+ "hint_waiting": "Waiting for the first result…",
+ "hint_waitlist_done": "You're on the waitlist — skip to keep exploring.",
+ "hint_skip_or_waitlist": "Skip to enter your workspace, or join the cloud waitlist above."
+ },
+ "step_platform": {
+ "eyebrow": "Step 3 · Runtime",
+ "headline": "Connect a runtime.",
+ "lede": "A runtime is what actually runs your agents' work. Pick how you'd like to set one up.",
+ "hint_default": "Pick a path above — or skip and configure a runtime later.",
+ "hint_downloaded": "Finish setup on the download page, then come back to this tab.",
+ "hint_waitlist": "You're on the waitlist — pick Skip to keep exploring.",
+ "download_title": "Download the desktop app",
+ "download_title_after": "Continuing on the download page…",
+ "download_subtitle": "Bundled daemon, zero setup. Pick your platform on the next page.",
+ "download_subtitle_after": "Opened in a new tab. Pick your installer there, then finish setup on desktop.",
+ "download_button": "Download",
+ "cli_title": "Install the CLI",
+ "cli_subtitle": "For servers, remote dev boxes, and headless setups. Terminal required.",
+ "cli_action": "Show steps",
+ "cloud_title": "Cloud runtime",
+ "cloud_subtitle": "We host the runtime. Not live yet — join the waitlist.",
+ "cloud_action": "Join waitlist",
+ "cloud_action_done": "On the list",
+ "cli_dialog_title": "Install the CLI",
+ "cli_dialog_description": "Same daemon as Desktop, installed via terminal. Use it when Desktop doesn't fit — servers, remote dev boxes, or headless setups.",
+ "cli_dialog_pick_hint": "Pick a runtime above.",
+ "cli_dialog_connect": "Connect & continue",
+ "runtimes_connected_one": "{{count}} runtime connected",
+ "runtimes_connected_other": "{{count}} runtimes connected",
+ "live_listening": "Live · Listening for your daemon",
+ "stage_normal_prefix": "Run the command above. As soon as ",
+ "stage_normal_suffix": " finishes browser sign-in and the daemon starts, your runtime will appear here automatically (usually 10–30 seconds).",
+ "stage_midway_prefix": "Still listening. Make sure you finished the browser tab that ",
+ "stage_midway_suffix": " opened — it needs you to approve the sign-in before the daemon can start.",
+ "stage_slow_prefix": "Taking longer than usual. Check the terminal where you ran ",
+ "stage_slow_suffix": " for errors.",
+ "stage_stalled_prefix": "Nothing coming through yet. If you're not comfortable with the terminal, ",
+ "stage_stalled_term": "Desktop",
+ "stage_stalled_suffix": " is the smoother path — it bundles the daemon. Close this dialog and pick Desktop, or hit Skip to continue."
+ },
+ "errors": {
+ "skip_failed": "Failed to finish onboarding"
+ }
+}
diff --git a/packages/views/locales/en/projects.json b/packages/views/locales/en/projects.json
new file mode 100644
index 0000000000..89b86a4922
--- /dev/null
+++ b/packages/views/locales/en/projects.json
@@ -0,0 +1,92 @@
+{
+ "page": {
+ "title": "Projects",
+ "new_project": "New project",
+ "empty": "No projects yet",
+ "create_first": "Create your first project"
+ },
+ "table": {
+ "name": "Name",
+ "priority": "Priority",
+ "status": "Status",
+ "progress": "Progress",
+ "lead": "Lead",
+ "created": "Created"
+ },
+ "status": {
+ "planned": "Planned",
+ "in_progress": "In Progress",
+ "paused": "Paused",
+ "completed": "Completed",
+ "cancelled": "Cancelled"
+ },
+ "priority": {
+ "urgent": "Urgent",
+ "high": "High",
+ "medium": "Medium",
+ "low": "Low",
+ "none": "No priority"
+ },
+ "lead": {
+ "no_lead": "No lead",
+ "assign_placeholder": "Assign lead...",
+ "members_group": "Members",
+ "agents_group": "Agents",
+ "no_results": "No results"
+ },
+ "relative_date": {
+ "today": "Today",
+ "one_day_ago": "1d ago",
+ "days_ago": "{{count}}d ago",
+ "months_ago": "{{count}}mo ago"
+ },
+ "detail": {
+ "not_found": "Project not found",
+ "breadcrumb_fallback": "Projects",
+ "title_placeholder": "Project title",
+ "icon_tooltip": "Change icon",
+ "pin_tooltip": "Pin to sidebar",
+ "unpin_tooltip": "Unpin from sidebar",
+ "sidebar_tooltip": "Toggle sidebar",
+ "copy_link": "Copy link",
+ "delete_action": "Delete project",
+ "section_properties": "Properties",
+ "section_progress": "Progress",
+ "section_description": "Description",
+ "description_placeholder": "Add description...",
+ "empty_issues_title": "No issues linked",
+ "empty_issues_hint": "Create a new issue or assign existing ones to this project.",
+ "empty_issues_new_button": "New Issue",
+ "toast_link_copied": "Link copied",
+ "toast_project_deleted": "Project deleted",
+ "toast_move_issue_failed": "Failed to move issue"
+ },
+ "resources": {
+ "section_header": "Resources",
+ "empty": "No resources attached.",
+ "add_button": "Add resource",
+ "popover_title": "Attach a GitHub repo",
+ "attached_badge": "attached",
+ "remove_tooltip": "Remove",
+ "url_placeholder": "https://github.com/owner/repo",
+ "url_submit": "Add",
+ "toast_attached": "Repository attached",
+ "toast_attach_failed": "Failed to attach",
+ "toast_removed": "Resource removed",
+ "toast_remove_failed": "Failed to remove resource"
+ },
+ "delete_dialog": {
+ "title": "Delete project",
+ "description": "This will delete the project. Issues will not be deleted but will be unlinked.",
+ "confirm": "Delete",
+ "cancel": "Cancel"
+ },
+ "picker": {
+ "no_project": "No project",
+ "remove": "Remove from project",
+ "empty": "No projects yet"
+ },
+ "chip": {
+ "fallback_label": "Project"
+ }
+}
diff --git a/packages/views/locales/en/runtimes.json b/packages/views/locales/en/runtimes.json
new file mode 100644
index 0000000000..c9d4575bf5
--- /dev/null
+++ b/packages/views/locales/en/runtimes.json
@@ -0,0 +1,197 @@
+{
+ "page": {
+ "title": "Runtimes",
+ "tagline": "Machines and cloud workers running CLI sessions for your agents.",
+ "learn_more": "Learn more →",
+ "connect_remote": "Connect remote machine",
+ "search_placeholder": "Search runtimes…",
+ "scope_mine": "Mine",
+ "scope_all": "All",
+ "live": "Live",
+ "live_tooltip": "Real-time updates · offline detection up to 75s",
+ "filter_all": "All",
+ "filter_all_description": "All runtimes in this view",
+ "empty": {
+ "title": "No runtimes yet",
+ "hint": "Desktop auto-scans your local machine. For AWS EC2 or other remote machines, connect them using the setup wizard."
+ },
+ "no_matches": {
+ "title": "No matches",
+ "with_query": "No runtimes match \"{{query}}\"{{filterSuffix}}.",
+ "with_query_filter_suffix": " in this filter",
+ "no_query": "No runtimes match this filter.",
+ "try_widening": " Try widening the scope or clearing filters."
+ },
+ "bootstrapping": {
+ "title": "Starting local runtime…",
+ "hint": "This usually takes a few seconds. Your daemon is registering with the workspace."
+ }
+ },
+ "health": {
+ "online": {
+ "label": "Online",
+ "description": "Heartbeat received in the last 45s. Ready to dispatch tasks."
+ },
+ "recently_lost": {
+ "label": "Recently lost",
+ "description": "Lost contact under 5 minutes ago — often a brief network blip."
+ },
+ "offline": {
+ "label": "Offline",
+ "description": "No heartbeat for 5+ minutes. Restart the daemon or investigate the host."
+ },
+ "about_to_gc": {
+ "label": "About to GC",
+ "description": "Offline 6+ days. Auto-deleted at 7 days unless it reconnects."
+ }
+ },
+ "detail": {
+ "all_runtimes": "All runtimes",
+ "read_only": "Read-only",
+ "delete_aria": "Delete runtime",
+ "delete_tooltip": "Delete runtime",
+ "delete_button": "Delete runtime",
+ "last_seen": "last seen {{when}}",
+ "fact_owner": "Owner",
+ "fact_device": "Device",
+ "fact_runtime": "Runtime",
+ "technical_details": "Technical details",
+ "fact_daemon_cli": "Daemon CLI",
+ "fact_daemon_id": "Daemon ID",
+ "serving_title": "Serving",
+ "serving_count_one": "{{count}} agent",
+ "serving_count_other": "{{count}} agents",
+ "no_agents": "No agents are bound to this runtime yet.",
+ "diagnostics_title": "Diagnostics",
+ "diagnostics_cli": "CLI",
+ "delete_dialog": {
+ "title": "Delete Runtime",
+ "description": "Are you sure you want to delete \"{{name}}\"? This action cannot be undone.",
+ "cancel": "Cancel",
+ "confirm": "Delete",
+ "deleting": "Deleting..."
+ },
+ "toast_deleted": "Runtime deleted",
+ "toast_delete_failed": "Failed to delete runtime",
+ "running_chip_one": "· {{count}} running",
+ "running_chip_other": "· {{count}} running",
+ "queued_chip_one": "· {{count}} queued",
+ "queued_chip_other": "· {{count}} queued"
+ },
+ "detail_page": {
+ "not_found_title": "Runtime not found",
+ "not_found_hint": "It may have been deleted or you may not have access."
+ },
+ "running_one": "{{count}} running",
+ "running_other": "{{count}} running",
+ "queued_one": "{{count}} queued",
+ "queued_other": "{{count}} queued",
+ "connect": {
+ "title": "Connect a remote machine",
+ "description": "Run these commands on your remote machine (e.g. AWS EC2) to install the Multica CLI and register it as a runtime.",
+ "step1": "1. Install the CLI",
+ "step2": "2. Configure",
+ "step3": "3. Login with a personal access token",
+ "step3_hint_prefix": "Create one in ",
+ "step3_hint_destination": "Settings → Tokens",
+ "step3_hint_suffix": ".",
+ "step4": "4. Start the daemon",
+ "security_label": "Security: ",
+ "security_body": "Use an EC2 IAM role or least-privilege credentials. Never put root keys into agent ",
+ "security_body_suffix": ". The daemon uses outbound connections only — no inbound ports needed.",
+ "troubleshooting": "Troubleshooting",
+ "trouble_check_status": "Check status: ",
+ "trouble_view_logs": "View logs: ",
+ "trouble_verify_provider": "Verify provider: ",
+ "trouble_remote_note_prefix": "Desktop auto-scans only your local machine. Remote machines must run ",
+ "trouble_remote_note_suffix": " separately.",
+ "cancel": "Cancel",
+ "started_daemon": "I've started the daemon",
+ "waiting_title": "Waiting for runtime…",
+ "waiting_description": "Listening for your remote daemon to register. This page updates automatically — no need to refresh.",
+ "waiting_hint_prefix": "Run ",
+ "waiting_hint_suffix": " on the remote machine to verify it's running.",
+ "back": "Back",
+ "success_title": "Runtime connected!",
+ "success_description": "Your remote machine has registered as a runtime. You can now create an agent that dispatches tasks to it.",
+ "view_runtime": "View runtime",
+ "create_agent": "Create an agent"
+ },
+ "update": {
+ "cli_version_label": "CLI Version:",
+ "version_unknown": "unknown",
+ "managed_by_desktop": "Managed by Desktop",
+ "managed_by_desktop_title": "The CLI binary is managed by Multica Desktop — update Desktop to upgrade the CLI.",
+ "latest": "Latest",
+ "available": "available",
+ "action": "Update",
+ "retry": "Retry",
+ "unknown_error": "Unknown error",
+ "initiate_failed": "Failed to initiate update",
+ "status": {
+ "pending": "Waiting for daemon...",
+ "running": "Updating...",
+ "completed": "Update complete. Daemon is restarting...",
+ "failed": "Update failed",
+ "timeout": "Timeout"
+ }
+ },
+ "charts": {
+ "heatmap_less": "Less",
+ "heatmap_more": "More"
+ },
+ "list": {
+ "col_runtime": "Runtime",
+ "col_health": "Health",
+ "col_owner": "Owner",
+ "col_agents": "Agents",
+ "col_workload": "Workload",
+ "col_cost": "Cost · 7d",
+ "col_cli": "CLI",
+ "cost_delta_flat": "flat",
+ "cli_managed_badge": "Desktop",
+ "cli_update_available_aria": "Update available",
+ "cli_update_available_tooltip": "Update available: {{version}}",
+ "row_actions_aria": "Row actions",
+ "delete_action": "Delete",
+ "delete_permission_hint": "Only the runtime owner and workspace admins can delete this runtime",
+ "delete_admin_hint": "Only the runtime owner and workspace admins can delete a runtime."
+ },
+ "usage": {
+ "period_label": "Period",
+ "kpi_cost_label": "Cost · {{days}}D",
+ "kpi_cost_delta": "{{sign}}{{pct}}% vs prev",
+ "kpi_cache_label": "Cache savings · {{days}}D",
+ "kpi_cache_hint": "{{pct}}% hit · {{reads}} reads",
+ "kpi_tokens_label": "Tokens · {{days}}D",
+ "kpi_tokens_hint": "in {{input}} · out {{output}}",
+ "when_title": "When this runtime spent",
+ "when_tab_daily": "Daily",
+ "when_tab_hourly": "Hourly",
+ "when_tab_heatmap": "Heatmap",
+ "heatmap_caption": "Last 26 weeks · daily $ intensity (period selector ignored here)",
+ "legend_input": "Input",
+ "legend_output": "Output",
+ "legend_cache_write": "Cache write",
+ "empty_no_usage": "No usage in this period.",
+ "empty_pricing_missing": "Tokens recorded but pricing missing for:",
+ "empty_pricing_hint": "Add to MODEL_PRICING in packages/views/runtimes/utils.ts",
+ "empty_zero_cost": "Tokens recorded but cost calculation returned $0.",
+ "cost_by_title_agent": "Cost by agent",
+ "cost_by_title_model": "Cost by model",
+ "cost_by_tab_agent": "By agent",
+ "cost_by_tab_model": "By model",
+ "cost_by_caption_agent_one": "{{count}} agent on this runtime",
+ "cost_by_caption_agent_other": "{{count}} agents on this runtime",
+ "cost_by_caption_model_one": "{{count}} model used",
+ "cost_by_caption_model_other": "{{count}} models used",
+ "daily_breakdown_toggle": "Daily breakdown table",
+ "table_date": "Date",
+ "table_model": "Model",
+ "table_input": "Input",
+ "table_output": "Output",
+ "table_cache_r": "Cache R",
+ "table_cache_w": "Cache W",
+ "no_data": "No usage data yet"
+ }
+}
diff --git a/packages/views/locales/en/search.json b/packages/views/locales/en/search.json
new file mode 100644
index 0000000000..5e3a2e9e11
--- /dev/null
+++ b/packages/views/locales/en/search.json
@@ -0,0 +1,44 @@
+{
+ "title": "Search",
+ "description": "Search pages, issues, and projects",
+ "placeholder": "Type a command or search...",
+ "groups": {
+ "pages": "Pages",
+ "commands": "Commands",
+ "switch_workspace": "Switch Workspace",
+ "projects": "Projects",
+ "issues": "Issues",
+ "recent": "Recent"
+ },
+ "pages": {
+ "inbox": "Inbox",
+ "my_issues": "My Issues",
+ "issues": "Issues",
+ "projects": "Projects",
+ "agents": "Agents",
+ "runtimes": "Runtimes",
+ "skills": "Skills",
+ "settings": "Settings"
+ },
+ "commands": {
+ "current_theme_aria": "Current theme",
+ "new_issue": "New Issue",
+ "new_project": "New Project",
+ "copy_issue_link": "Copy Issue Link",
+ "copy_identifier": "Copy Identifier ({{identifier}})",
+ "switch_to_light": "Switch to Light Theme",
+ "switch_to_dark": "Switch to Dark Theme",
+ "use_system_theme": "Use System Theme"
+ },
+ "toast": {
+ "link_copied": "Link copied",
+ "copied_identifier": "Copied {{identifier}}"
+ },
+ "empty": {
+ "no_results": "No results found.",
+ "type_to_search": "Type to search issues and projects"
+ },
+ "trigger": {
+ "label": "Search..."
+ }
+}
diff --git a/packages/views/locales/en/settings.json b/packages/views/locales/en/settings.json
new file mode 100644
index 0000000000..aa1636ce7d
--- /dev/null
+++ b/packages/views/locales/en/settings.json
@@ -0,0 +1,206 @@
+{
+ "appearance": {
+ "theme": {
+ "title": "Theme",
+ "light": "Light",
+ "dark": "Dark",
+ "system": "System"
+ },
+ "language": {
+ "title": "Language",
+ "english": "English",
+ "chinese": "中文",
+ "sync_failed": "Language saved on this device, but failed to sync to your account. Other devices may show the previous language."
+ }
+ },
+ "page": {
+ "title": "Settings",
+ "my_account": "My Account",
+ "workspace_fallback": "Workspace",
+ "tabs": {
+ "profile": "Profile",
+ "appearance": "Appearance",
+ "notifications": "Notifications",
+ "tokens": "API Tokens",
+ "general": "General",
+ "repositories": "Repositories",
+ "labs": "Labs",
+ "members": "Members"
+ }
+ },
+ "account": {
+ "section_profile": "Profile",
+ "click_avatar_hint": "Click to upload avatar",
+ "name_label": "Name",
+ "save": "Update Profile",
+ "saving": "Updating...",
+ "toast_avatar_updated": "Avatar updated",
+ "toast_avatar_failed": "Failed to upload avatar",
+ "toast_profile_updated": "Profile updated",
+ "toast_profile_failed": "Failed to update profile"
+ },
+ "notifications": {
+ "title": "Inbox Notifications",
+ "description": "Control which events generate inbox notifications. Muted event types are silently filtered — you can still see them by visiting the issue directly.",
+ "toast_failed": "Failed to update notification settings",
+ "groups": {
+ "assignments": {
+ "label": "Assignments",
+ "description": "When you are assigned or unassigned from an issue"
+ },
+ "status_changes": {
+ "label": "Status changes",
+ "description": "When an issue you follow changes status (e.g. todo, in progress, done)"
+ },
+ "comments": {
+ "label": "Comments & Mentions",
+ "description": "New comments on issues you follow, or when someone @mentions you"
+ },
+ "updates": {
+ "label": "Priority & Due date",
+ "description": "When priority or due date changes on issues you follow"
+ },
+ "agent_activity": {
+ "label": "Agent activity",
+ "description": "When an agent task completes or fails"
+ }
+ }
+ },
+ "tokens": {
+ "title": "API Tokens",
+ "description": "Personal access tokens allow the CLI and external integrations to authenticate with your account.",
+ "name_placeholder": "Token name (e.g. My CLI)",
+ "expiry": {
+ "30": "30 days",
+ "90": "90 days",
+ "365": "1 year",
+ "never": "No expiry"
+ },
+ "create": "Create",
+ "creating": "Creating...",
+ "toast_load_failed": "Failed to load tokens",
+ "toast_create_failed": "Failed to create token",
+ "toast_revoked": "Token revoked",
+ "toast_revoke_failed": "Failed to revoke token",
+ "metadata_prefix": "{{prefix}}... · Created {{created}} · {{lastUsed}}",
+ "last_used_with_date": "Last used {{date}}",
+ "last_used_never": "Never used",
+ "expires_with_date": " · Expires {{date}}",
+ "revoke_aria": "Revoke {{name}}",
+ "revoke_tooltip": "Revoke",
+ "revoke_dialog": {
+ "title": "Revoke token",
+ "description": "This token will be permanently revoked and can no longer be used. This cannot be undone.",
+ "cancel": "Cancel",
+ "confirm": "Revoke"
+ },
+ "created_dialog": {
+ "title": "Token created",
+ "description": "Copy your personal access token now. You won't be able to see it again.",
+ "copy_tooltip": "Copy token",
+ "done": "Done"
+ }
+ },
+ "workspace": {
+ "section_general": "General",
+ "name_label": "Name",
+ "description_label": "Description",
+ "description_placeholder": "What does this workspace focus on?",
+ "context_label": "Context",
+ "context_placeholder": "Background information and context for AI agents working in this workspace",
+ "slug_label": "Slug",
+ "save": "Save",
+ "saving": "Saving...",
+ "manage_hint": "Only admins and owners can update workspace settings.",
+ "toast_saved": "Workspace settings saved",
+ "toast_save_failed": "Failed to save workspace settings",
+ "danger_zone": "Danger Zone",
+ "leave_title": "Leave workspace",
+ "leave_sole_owner": "You're the only owner. Promote another member to owner first, or delete the workspace.",
+ "leave_sole_member": "You're the only member. Delete the workspace to leave.",
+ "leave_default": "Remove yourself from this workspace.",
+ "leave_button": "Leave workspace",
+ "leaving": "Leaving...",
+ "leave_confirm_title": "Leave workspace",
+ "leave_confirm_description": "Leave {{name}}? You will lose access until re-invited.",
+ "toast_leave_failed": "Failed to leave workspace",
+ "delete_title": "Delete workspace",
+ "delete_description": "Permanently delete this workspace and its data.",
+ "delete_button": "Delete workspace",
+ "deleting": "Deleting...",
+ "toast_delete_failed": "Failed to delete workspace",
+ "confirm_cancel": "Cancel",
+ "confirm_action": "Confirm"
+ },
+ "delete_workspace_dialog": {
+ "title": "Delete workspace",
+ "description": "This cannot be undone. All issues, agents, and data will be permanently removed.",
+ "type_to_confirm_prefix": "To confirm, type",
+ "type_to_confirm_suffix": " below.",
+ "cancel": "Cancel",
+ "confirm": "Delete workspace",
+ "deleting": "Deleting..."
+ },
+ "labs": {
+ "section_git": "Git",
+ "co_authored_by_label": "Co-authored-by trailer",
+ "co_authored_by_description_prefix": "Automatically add",
+ "co_authored_by_description_suffix": "to commits made by agents.",
+ "toast_failed": "Failed to update setting"
+ },
+ "repositories": {
+ "section_title": "Repositories",
+ "description": "Git repositories associated with this workspace. Agents use these to clone and work on code.",
+ "url_placeholder": "https://git.example.com/org/repo.git",
+ "description_placeholder": "Description (e.g. Go backend + Next.js frontend)",
+ "add": "Add repository",
+ "save": "Save",
+ "saving": "Saving...",
+ "manage_hint": "Only admins and owners can manage repositories.",
+ "toast_saved": "Repositories saved",
+ "toast_save_failed": "Failed to save repositories"
+ },
+ "members": {
+ "section_title": "Members ({{count}})",
+ "invite_title": "Invite member",
+ "invite_email_placeholder": "[email protected]",
+ "invite_button": "Invite",
+ "inviting": "Inviting...",
+ "toast_invitation_sent": "Invitation sent",
+ "toast_invitation_failed": "Failed to send invitation",
+ "no_members": "No members found.",
+ "pending_title": "Pending invitations ({{count}})",
+ "pending_status": "Pending",
+ "revoke_invitation_tooltip": "Revoke invitation",
+ "revoke_invitation_title": "Revoke invitation",
+ "revoke_invitation_description": "Revoke the invitation to {{email}}? They will no longer be able to join this workspace.",
+ "toast_invitation_revoked": "Invitation revoked",
+ "toast_invitation_revoke_failed": "Failed to revoke invitation",
+ "toast_role_updated": "Role updated",
+ "toast_role_failed": "Failed to update member",
+ "toast_member_removed": "Member removed",
+ "toast_member_remove_failed": "Failed to remove member",
+ "remove_member_title": "Remove {{name}}",
+ "remove_member_description": "Remove {{name}} from {{workspace}}? They will lose access to this workspace.",
+ "confirm_cancel": "Cancel",
+ "confirm_action": "Confirm",
+ "change_role": "Change role",
+ "remove_action": "Remove from workspace",
+ "cannot_demote_last_owner_title": "Promote another member to owner first — a workspace must keep at least one owner.",
+ "cannot_demote_last_owner": "Cannot demote the last owner",
+ "roles": {
+ "owner": {
+ "label": "Owner",
+ "description": "Full access, manage all settings"
+ },
+ "admin": {
+ "label": "Admin",
+ "description": "Manage members and settings"
+ },
+ "member": {
+ "label": "Member",
+ "description": "Create and work on issues"
+ }
+ }
+ }
+}
diff --git a/packages/views/locales/en/skills.json b/packages/views/locales/en/skills.json
new file mode 100644
index 0000000000..1526c330fa
--- /dev/null
+++ b/packages/views/locales/en/skills.json
@@ -0,0 +1,233 @@
+{
+ "page": {
+ "title": "Skills",
+ "tagline": "Instructions any agent in this workspace can use.",
+ "learn_more": "Learn more →",
+ "new_skill": "New skill",
+ "search_placeholder": "Search skills…",
+ "scopes": {
+ "all": { "label": "All", "description": "All skills in this workspace" },
+ "used": { "label": "In use", "description": "Skills assigned to at least one agent" },
+ "unused": { "label": "Unused", "description": "Skills not assigned to any agent" },
+ "mine": { "label": "Created by me", "description": "Skills you created" }
+ },
+ "empty": {
+ "title": "No skills yet",
+ "description": "Create your first skill, import one from a URL, or copy one from a connected runtime — and every agent in the workspace can use it."
+ },
+ "no_matches": {
+ "title": "No matches",
+ "with_query": "No skills match \"{{query}}\"{{filterSuffix}}.",
+ "with_query_filter_suffix": " in this filter",
+ "filter_only": "No skills match this filter.",
+ "try_different": " Try a different query."
+ },
+ "intro_banner": {
+ "title": "Shared with your workspace.",
+ "body": "Anyone can create a skill, import one from a URL, or copy one from their local runtime — and every agent can use it.",
+ "highlight": "Local runtime skills stay private until you copy one here."
+ },
+ "list_error": {
+ "title": "Couldn't load skills",
+ "fallback": "Something went wrong fetching the skill list.",
+ "retry": "Try again"
+ },
+ "supporting_data_warning": "Some workspace data failed to load. Creator attribution, runtime names, or edit permissions may appear incomplete."
+ },
+ "table": {
+ "name": "Name",
+ "used_by": "Used by",
+ "source": "Source · Added by",
+ "updated": "Updated",
+ "no_description": "No description",
+ "lock_tooltip": "Read-only — only creator or admin can edit",
+ "unused": "— unused",
+ "by_creator": "by {{name}}",
+ "source_manual": "Created manually",
+ "source_runtime_named": "From {{name}}",
+ "source_runtime_provider": "From {{provider}} runtime",
+ "source_runtime_unknown": "From a runtime",
+ "source_clawhub": "From ClawHub",
+ "source_skills_sh": "From Skills.sh"
+ },
+ "detail": {
+ "all_skills": "All skills",
+ "read_only": "Read-only",
+ "delete_aria": "Delete skill",
+ "delete_tooltip": "Delete skill",
+ "supporting_data_warning": "Some workspace data failed to load. Creator attribution, runtime names, or edit permissions may appear incomplete until the next refresh.",
+ "files_label": "Files · {{count}}",
+ "add_file_aria": "Add file",
+ "add_file_tooltip": "Add file",
+ "delete_file": "Delete file",
+ "name_aria": "Skill name",
+ "name_placeholder": "skill-name",
+ "description_label": "Description",
+ "description_placeholder": "One sentence describing when an agent should use this skill…",
+ "subline": {
+ "origin_runtime_named": "Local runtime · {{name}}",
+ "origin_runtime_provider": "Local runtime · {{provider}}",
+ "origin_runtime_unknown": "Local runtime",
+ "origin_clawhub": "Imported · ClawHub",
+ "origin_skills_sh": "Imported · Skills.sh",
+ "origin_workspace": "Workspace",
+ "updated_label": "Updated {{when}}",
+ "by_creator": "by {{name}}"
+ },
+ "conflict_banner": {
+ "title": "Someone else updated this skill",
+ "body": "Your edits are preserved. Discard to pull their changes, or Save to overwrite."
+ },
+ "save_bar": {
+ "unsaved": "Unsaved changes — will overwrite the live skill on save",
+ "discard": "Discard",
+ "save": "Save changes",
+ "saving": "Saving…"
+ },
+ "sidebar": {
+ "metadata": "Metadata",
+ "created": "Created",
+ "updated": "Updated",
+ "created_by": "Created by",
+ "files": "Files",
+ "id": "ID",
+ "origin": "Origin",
+ "used_by_one": "Used by {{count}} agent",
+ "used_by_other": "Used by {{count}} agents",
+ "permissions": "Permissions",
+ "permissions_owner": "You can edit and delete this skill. Changes take effect on the next agent run.",
+ "permissions_locked_creator": "Only the creator ({{name}}) or a workspace admin can edit this skill.",
+ "permissions_locked": "Only the creator or a workspace admin can edit this skill.",
+ "used_by_empty": "Not assigned to any agent yet. Open an agent's Skills tab to assign."
+ },
+ "origin_card": {
+ "imported_runtime": "Imported from local runtime",
+ "imported_clawhub": "Imported from ClawHub",
+ "imported_skills_sh": "Imported from Skills.sh",
+ "provider": "provider · {{provider}}"
+ },
+ "not_found": {
+ "title": "Skill not found",
+ "fallback": "This skill may have been deleted or you lost access.",
+ "back": "Back to Skills"
+ },
+ "toast_saved": "Skill saved",
+ "toast_save_failed": "Failed to save skill",
+ "toast_deleted": "Skill deleted",
+ "toast_delete_failed": "Failed to delete skill",
+ "delete_dialog": {
+ "title": "Delete skill?",
+ "description_with_agents_one": "This will permanently delete \"{{name}}\" and remove it from {{count}} agent currently using it.",
+ "description_with_agents_other": "This will permanently delete \"{{name}}\" and remove it from {{count}} agents currently using it.",
+ "description_no_agents": "This will permanently delete \"{{name}}\" and remove it from all agents.",
+ "warning": "This action cannot be undone.",
+ "cancel": "Cancel",
+ "confirm": "Delete permanently",
+ "deleting": "Deleting…"
+ },
+ "add_file": {
+ "placeholder": "templates/review.md",
+ "add": "Add",
+ "cancel": "Cancel",
+ "errors": {
+ "empty": "Path cannot be empty.",
+ "absolute": "Absolute paths are not allowed.",
+ "double_dot": "Paths cannot contain \"..\".",
+ "reserved": "SKILL.md is reserved for the main file.",
+ "exists": "A file at this path already exists."
+ }
+ }
+ },
+ "create": {
+ "back": "Back",
+ "back_aria": "Back to method chooser",
+ "close": "Close",
+ "close_aria": "Close",
+ "method": {
+ "chooser": {
+ "title": "New skill",
+ "desc": "Choose how you want to add a skill to this workspace."
+ },
+ "manual": {
+ "title": "Create manually",
+ "desc": "Write a new SKILL.md from scratch."
+ },
+ "url": {
+ "title": "Import from URL",
+ "desc": "Fetch a published skill by URL. Files are pulled server-side."
+ },
+ "runtime": {
+ "title": "Copy from runtime",
+ "desc": "Scan a local runtime and promote one of its on-disk skills into this workspace."
+ }
+ },
+ "method_card": {
+ "manual_title": "Create manually",
+ "manual_desc": "Start from a blank SKILL.md and write your own instructions.",
+ "url_title": "Import from URL",
+ "url_desc": "Pull a published skill from ClawHub or Skills.sh.",
+ "runtime_title": "Copy from runtime",
+ "runtime_desc": "Promote a skill already installed on your local runtime."
+ },
+ "manual": {
+ "name_label": "Name",
+ "name_placeholder": "e.g. review-helper",
+ "name_hint": "Must be unique within the workspace.",
+ "description_label": "Description",
+ "description_placeholder": "One sentence on when to assign this skill to an agent.",
+ "name_conflict_hint": " Try a different name and submit again.",
+ "fallback_error": "Failed to create skill",
+ "cancel": "Cancel",
+ "submit": "Create skill",
+ "submitting": "Creating…",
+ "toast_created": "Skill created"
+ },
+ "url": {
+ "url_label": "Skill URL",
+ "supported_sources": "Supported sources",
+ "import": "Import",
+ "importing": "Importing…",
+ "importing_clawhub": "Importing from ClawHub…",
+ "importing_skills_sh": "Importing from Skills.sh…",
+ "name_conflict_hint": " The imported skill's name already exists — delete the existing one before retrying.",
+ "fallback_error": "Import failed",
+ "cancel": "Cancel",
+ "toast_imported": "Skill imported"
+ }
+ },
+ "runtime_import": {
+ "runtime_label": "Runtime",
+ "runtime_placeholder": "Select a local runtime",
+ "no_local_runtimes_title": "No local runtimes available",
+ "no_local_runtimes_hint": "Connect a local runtime to browse and import its local skills.",
+ "choose_runtime": "Choose a runtime to continue",
+ "must_be_online": "Runtime must be online to browse local skills.",
+ "load_failed": "Failed to load runtime local skills",
+ "not_supported": "This runtime provider does not expose local skill inventory yet.",
+ "no_skills_title": "No local skills found",
+ "no_skills_hint": "This runtime does not have any discoverable local skills yet.",
+ "ignored_files_hint": "Symlinks, unreadable files, oversized files, and very large bundles are ignored during import.",
+ "ready": "Ready to import",
+ "into_workspace": "into this workspace.",
+ "select_skill": "Select a skill to continue.",
+ "import_button": "Import to Workspace",
+ "importing": "Importing…",
+ "skill_files_one": "{{count}} file",
+ "skill_files_other": "{{count}} files",
+ "skill_name_label": "Workspace skill name",
+ "skill_description_label": "Description",
+ "skill_description_placeholder": "Optional — describe when an agent should use this skill.",
+ "toast_imported": "Skill imported",
+ "toast_import_failed": "Failed to import skill"
+ },
+ "file_tree": {
+ "no_files": "No files"
+ },
+ "file_viewer": {
+ "edit_tooltip": "Edit",
+ "preview_tooltip": "Preview",
+ "no_content": "*No content yet*",
+ "markdown_placeholder": "Write markdown content...",
+ "raw_placeholder": "File content..."
+ }
+}
diff --git a/packages/views/locales/en/workspace.json b/packages/views/locales/en/workspace.json
new file mode 100644
index 0000000000..30e40572cd
--- /dev/null
+++ b/packages/views/locales/en/workspace.json
@@ -0,0 +1,29 @@
+{
+ "create_form": {
+ "name_label": "Workspace Name",
+ "name_placeholder": "My Workspace",
+ "url_label": "Workspace URL",
+ "url_placeholder": "my-workspace",
+ "submit": "Create workspace",
+ "submitting": "Creating...",
+ "errors": {
+ "slug_format": "Only lowercase letters, numbers, and hyphens",
+ "slug_taken": "That workspace URL is already taken.",
+ "slug_conflict_toast": "Choose a different workspace URL",
+ "create_failed": "Failed to create workspace"
+ }
+ },
+ "new_page": {
+ "back": "Back",
+ "log_out": "Log out",
+ "title": "Welcome to Multica",
+ "description": "One workspace where you and your AI teammates work side by side — taking issues, leaving comments, sharing the same context.",
+ "invite_hint": "You can invite teammates once your workspace is ready."
+ },
+ "no_access": {
+ "title": "Workspace not available",
+ "description": "This workspace doesn't exist or you don't have access.",
+ "go_to_workspaces": "Go to my workspaces",
+ "sign_in_different": "Sign in as a different user"
+ }
+}
diff --git a/packages/views/locales/glossary.md b/packages/views/locales/glossary.md
new file mode 100644
index 0000000000..70eb3f875a
--- /dev/null
+++ b/packages/views/locales/glossary.md
@@ -0,0 +1,12 @@
+# Multica i18n 术语表 (Glossary)
+
+> **本文件已迁移**。所有翻译规范、命名规范、中文风格指南现在统一在 docs 站维护:
+>
+> - 中文:[`apps/docs/content/docs/developers/conventions.zh.mdx`](../../../apps/docs/content/docs/developers/conventions.zh.mdx)
+> - English: [`apps/docs/content/docs/developers/conventions.mdx`](../../../apps/docs/content/docs/developers/conventions.mdx)
+>
+> 翻译 PR 必读那一份文档,不要参考此处。
+
+如果你看到的是 git 历史里的旧版本,对应规则在 docs 站的「Conventions」页面里都能找到,按 `## 2. i18n 翻译术语表` / `## 3. 中文风格` 两段查询。
+
+修改规则只能在 docs 站改,本文件不再维护。
diff --git a/packages/views/locales/index.ts b/packages/views/locales/index.ts
new file mode 100644
index 0000000000..0603bc8ee8
--- /dev/null
+++ b/packages/views/locales/index.ts
@@ -0,0 +1,95 @@
+import type { LocaleResources, SupportedLocale } from "@multica/core/i18n";
+import enCommon from "./en/common.json";
+import enAuth from "./en/auth.json";
+import enSettings from "./en/settings.json";
+import enIssues from "./en/issues.json";
+import enAgents from "./en/agents.json";
+import enEditor from "./en/editor.json";
+import enOnboarding from "./en/onboarding.json";
+import enInvite from "./en/invite.json";
+import enLabels from "./en/labels.json";
+import enMembers from "./en/members.json";
+import enMyIssues from "./en/my-issues.json";
+import enSearch from "./en/search.json";
+import enInbox from "./en/inbox.json";
+import enWorkspace from "./en/workspace.json";
+import enProjects from "./en/projects.json";
+import enAutopilots from "./en/autopilots.json";
+import enSkills from "./en/skills.json";
+import enChat from "./en/chat.json";
+import enModals from "./en/modals.json";
+import enRuntimes from "./en/runtimes.json";
+import enLayout from "./en/layout.json";
+import zhHansCommon from "./zh-Hans/common.json";
+import zhHansAuth from "./zh-Hans/auth.json";
+import zhHansSettings from "./zh-Hans/settings.json";
+import zhHansIssues from "./zh-Hans/issues.json";
+import zhHansAgents from "./zh-Hans/agents.json";
+import zhHansEditor from "./zh-Hans/editor.json";
+import zhHansOnboarding from "./zh-Hans/onboarding.json";
+import zhHansInvite from "./zh-Hans/invite.json";
+import zhHansLabels from "./zh-Hans/labels.json";
+import zhHansMembers from "./zh-Hans/members.json";
+import zhHansMyIssues from "./zh-Hans/my-issues.json";
+import zhHansSearch from "./zh-Hans/search.json";
+import zhHansInbox from "./zh-Hans/inbox.json";
+import zhHansWorkspace from "./zh-Hans/workspace.json";
+import zhHansProjects from "./zh-Hans/projects.json";
+import zhHansAutopilots from "./zh-Hans/autopilots.json";
+import zhHansSkills from "./zh-Hans/skills.json";
+import zhHansChat from "./zh-Hans/chat.json";
+import zhHansModals from "./zh-Hans/modals.json";
+import zhHansRuntimes from "./zh-Hans/runtimes.json";
+import zhHansLayout from "./zh-Hans/layout.json";
+
+// Single source of truth for the resource bundle. Both apps (web layout +
+// desktop App.tsx) import from here so adding a locale or namespace happens
+// in exactly one place.
+export const RESOURCES: Record<SupportedLocale, LocaleResources> = {
+ en: {
+ common: enCommon,
+ auth: enAuth,
+ settings: enSettings,
+ issues: enIssues,
+ agents: enAgents,
+ editor: enEditor,
+ onboarding: enOnboarding,
+ invite: enInvite,
+ labels: enLabels,
+ members: enMembers,
+ "my-issues": enMyIssues,
+ search: enSearch,
+ inbox: enInbox,
+ workspace: enWorkspace,
+ projects: enProjects,
+ autopilots: enAutopilots,
+ skills: enSkills,
+ chat: enChat,
+ modals: enModals,
+ runtimes: enRuntimes,
+ layout: enLayout,
+ },
+ "zh-Hans": {
+ common: zhHansCommon,
+ auth: zhHansAuth,
+ settings: zhHansSettings,
+ issues: zhHansIssues,
+ agents: zhHansAgents,
+ editor: zhHansEditor,
+ onboarding: zhHansOnboarding,
+ invite: zhHansInvite,
+ labels: zhHansLabels,
+ members: zhHansMembers,
+ "my-issues": zhHansMyIssues,
+ search: zhHansSearch,
+ inbox: zhHansInbox,
+ workspace: zhHansWorkspace,
+ projects: zhHansProjects,
+ autopilots: zhHansAutopilots,
+ skills: zhHansSkills,
+ chat: zhHansChat,
+ modals: zhHansModals,
+ runtimes: zhHansRuntimes,
+ layout: zhHansLayout,
+ },
+};
diff --git a/packages/views/locales/parity.test.ts b/packages/views/locales/parity.test.ts
new file mode 100644
index 0000000000..eba441eca3
--- /dev/null
+++ b/packages/views/locales/parity.test.ts
@@ -0,0 +1,81 @@
+import { readdirSync } from "node:fs";
+import { fileURLToPath } from "node:url";
+import { dirname, resolve } from "node:path";
+import { describe, expect, it } from "vitest";
+import { RESOURCES } from "./index";
+
+// Schema-level guard: every key in the EN bundle must have a counterpart
+// in the zh-Hans bundle and vice-versa. Catches retrofit drift where a
+// new EN key lands without zh, which would silently fall back to the
+// English string in production.
+//
+// i18next plural rule: EN uses `_one` + `_other`; zh only uses `_other`
+// because Chinese has no grammatical number. Normalize both forms to
+// `_other` before comparing so a `{ key_one, key_other }` pair in EN
+// matches a single `{ key_other }` in zh.
+
+// Derive the canonical namespace list from disk so the test fails if a JSON
+// file ships without a matching RESOURCES entry. Without this guard the test
+// would still pass when both EN and zh-Hans skip a namespace (e.g. issues +
+// agents both unregistered), since the iteration happens over RESOURCES.en
+// itself — that's a tautology, not parity.
+const LOCALES_DIR = dirname(fileURLToPath(import.meta.url));
+
+function jsonNamespacesIn(locale: string): string[] {
+ return readdirSync(resolve(LOCALES_DIR, locale))
+ .filter((name) => name.endsWith(".json"))
+ .map((name) => name.replace(/\.json$/, ""))
+ .sort();
+}
+
+type Json = Record<string, unknown>;
+
+function flattenKeys(obj: unknown, prefix = ""): string[] {
+ if (obj === null || typeof obj !== "object") return [prefix];
+ const entries = Object.entries(obj as Json);
+ if (entries.length === 0) return [];
+ return entries.flatMap(([k, v]) =>
+ flattenKeys(v, prefix ? `${prefix}.${k}` : k),
+ );
+}
+
+function normalizePlural(key: string): string {
+ return key.replace(/_(one|other)$/, "_count");
+}
+
+function keySet(bundle: Record<string, unknown>): Set<string> {
+ return new Set(flattenKeys(bundle).map(normalizePlural));
+}
+
+const en = RESOURCES.en;
+const zh = RESOURCES["zh-Hans"];
+
+describe("locale bundle parity", () => {
+ it("declares the same namespaces in EN and zh-Hans", () => {
+ expect(Object.keys(en).sort()).toEqual(Object.keys(zh).sort());
+ });
+
+ it("registers every JSON file in RESOURCES (EN)", () => {
+ expect(Object.keys(en).sort()).toEqual(jsonNamespacesIn("en"));
+ });
+
+ it("registers every JSON file in RESOURCES (zh-Hans)", () => {
+ expect(Object.keys(zh).sort()).toEqual(jsonNamespacesIn("zh-Hans"));
+ });
+
+ for (const ns of Object.keys(en)) {
+ it(`${ns}: zh-Hans covers every EN key`, () => {
+ const enKeys = keySet(en[ns] ?? {});
+ const zhKeys = keySet(zh[ns] ?? {});
+ const missing = [...enKeys].filter((k) => !zhKeys.has(k));
+ expect(missing).toEqual([]);
+ });
+
+ it(`${ns}: EN covers every zh-Hans key`, () => {
+ const enKeys = keySet(en[ns] ?? {});
+ const zhKeys = keySet(zh[ns] ?? {});
+ const extra = [...zhKeys].filter((k) => !enKeys.has(k));
+ expect(extra).toEqual([]);
+ });
+ }
+});
diff --git a/packages/views/locales/zh-Hans/agents.json b/packages/views/locales/zh-Hans/agents.json
new file mode 100644
index 0000000000..87dc8d99b3
--- /dev/null
+++ b/packages/views/locales/zh-Hans/agents.json
@@ -0,0 +1,349 @@
+{
+ "page": {
+ "title": "智能体",
+ "tagline": "能领取 issue、留下评论、推进状态的 AI 队友。",
+ "learn_more": "了解更多 →",
+ "new_agent": "新建智能体",
+ "search_placeholder": "搜索智能体...",
+ "show_archived": "显示已归档({{count}})→",
+ "of_total": "{{visible}} / {{total}}",
+ "list_load_failed": "无法加载智能体列表",
+ "list_load_failed_default": "获取智能体列表时出错。",
+ "try_again": "重试"
+ },
+ "scope": {
+ "mine": "我的",
+ "all": "全部"
+ },
+ "sort": {
+ "label_recent": "最近活跃",
+ "label_name": "名称",
+ "label_runs": "运行最多",
+ "label_created": "最近创建"
+ },
+ "availability": {
+ "all": "全部",
+ "online": "在线",
+ "unstable": "不稳定",
+ "offline": "离线"
+ },
+ "workload": {
+ "working": "处理中",
+ "queued": "排队中",
+ "idle": "空闲"
+ },
+ "archived": {
+ "active_link": "活跃智能体",
+ "title": "已归档智能体"
+ },
+ "empty": {
+ "title": "还没有智能体",
+ "description": "创建一个智能体,像分配给同事那样把 issue 交给它。本地智能体在你的机器上运行,云智能体在 Multica 运行时上运行。"
+ },
+ "no_matches": {
+ "title": "无匹配项",
+ "search_archived": "没有已归档智能体匹配\"{{query}}\"。",
+ "no_archived": "还没有已归档智能体。",
+ "search_active": "没有智能体匹配\"{{query}}\"。",
+ "search_active_filtered": "在该筛选下没有智能体匹配\"{{query}}\"。",
+ "no_filter_match": "该筛选下没有匹配的智能体。"
+ },
+ "columns": {
+ "agent": "智能体",
+ "status": "状态",
+ "workload": "工作负载",
+ "runtime": "运行时",
+ "activity_7d": "活动(7 天)",
+ "runs": "运行次数"
+ },
+ "row": {
+ "you": "你",
+ "archived": "已归档",
+ "no_description": "暂无描述",
+ "fallback_runtime_cloud": "云端",
+ "fallback_runtime_local": "本地",
+ "actions_aria": "行操作"
+ },
+ "activity_tooltip": {
+ "created_today": "今天创建",
+ "created_days_ago_other": "{{count}} 天前创建",
+ "last_7_days": "近 7 天",
+ "no_activity": "无活动",
+ "runs_other": "{{count}} 次运行",
+ "failed_suffix": " · {{count}} 次失败({{percent}}%)"
+ },
+ "row_actions": {
+ "cancel_all_tasks": "取消全部 task",
+ "duplicate": "复制",
+ "restore": "恢复",
+ "archive": "归档",
+ "agent_archived_toast": "已归档智能体",
+ "archive_failed_toast": "归档智能体失败",
+ "agent_restored_toast": "已恢复智能体",
+ "restore_failed_toast": "恢复智能体失败",
+ "no_tasks_to_cancel_toast": "没有要取消的活动 task",
+ "cancelled_tasks_toast_other": "已取消 {{count}} 个 task",
+ "cancel_failed_toast": "取消 task 失败",
+ "cancel_dialog_title": "取消\"{{name}}\"的全部 task?",
+ "cancel_dialog_no_tasks": "没有要取消的活动 task。",
+ "cancel_dialog_running_one": "{{count}} 个进行中",
+ "cancel_dialog_queued_one": "{{count}} 个排队中",
+ "cancel_dialog_impact_other": "将取消 {{summary}} 个 task。",
+ "cancel_dialog_running_note": " 进行中的 task 最多需要 5 秒才能完全停止。",
+ "cancel_dialog_irreversible": " 已取消的 task 无法恢复。",
+ "cancel_dialog_keep": "保留",
+ "cancel_dialog_confirm": "取消全部 task",
+ "archive_dialog_title": "归档\"{{name}}\"?",
+ "archive_dialog_description": "归档后这个智能体将无法被分配或提及,进行中的 task 会被取消。所有历史会被保留,可以稍后恢复。",
+ "archive_dialog_cancel": "取消",
+ "archive_dialog_confirm": "归档"
+ },
+ "detail": {
+ "back_to_agents": "智能体",
+ "back_to_agents_full": "返回智能体列表",
+ "not_found_title": "未找到该智能体",
+ "not_found_default": "该智能体可能已被归档或删除。",
+ "try_again": "重试",
+ "archived_banner": "该智能体已归档,无法被分配或提及。",
+ "restore": "恢复",
+ "archive_dialog_title": "归档智能体?",
+ "archive_dialog_description": "\"{{name}}\"将被归档,无法被分配或提及,但所有历史会被保留。可以稍后恢复。",
+ "archive_dialog_cancel": "取消",
+ "archive_dialog_confirm": "归档",
+ "more_archive": "归档智能体",
+ "agent_updated_toast": "已更新智能体",
+ "update_failed_toast": "更新智能体失败",
+ "agent_archived_toast": "已归档智能体",
+ "archive_failed_toast": "归档智能体失败",
+ "agent_restored_toast": "已恢复智能体",
+ "restore_failed_toast": "恢复智能体失败"
+ },
+ "inspector": {
+ "section_properties": "属性",
+ "section_details": "详情",
+ "section_skills": "skill",
+ "prop_runtime": "运行时",
+ "prop_model": "模型",
+ "prop_visibility": "可见性",
+ "prop_concurrency": "并发",
+ "prop_owner": "所有者",
+ "prop_created": "创建时间",
+ "prop_updated": "更新时间",
+ "no_description_placeholder": "暂无描述",
+ "change_avatar_aria": "更换头像",
+ "avatar_updated_toast": "已更新头像",
+ "avatar_upload_failed_toast": "头像上传失败",
+ "rename_title": "重命名智能体",
+ "rename_placeholder": "智能体名称",
+ "rename_required": "名称必填",
+ "edit_description_title": "编辑描述",
+ "description_placeholder": "这个智能体做什么?",
+ "save": "保存",
+ "cancel": "取消"
+ },
+ "skill_attach": {
+ "trigger_aria": "附加工作区 skill",
+ "trigger_label": "附加"
+ },
+ "pickers": {
+ "concurrency_tooltip": "并发 · 最多 {{value}} 个并行 task",
+ "concurrency_range": "最大并行 task 数({{min}}–{{max}})",
+ "runtime_none": "无运行时",
+ "runtime_tooltip": "运行时 · {{name}} · {{status}}",
+ "runtime_tooltip_none": "运行时 · 未选择",
+ "runtime_online": "在线",
+ "runtime_offline": "离线",
+ "runtime_owned_by": "{{name}} 的",
+ "runtime_empty": "暂无运行时",
+ "model_default": "默认",
+ "model_tooltip": "模型 · {{value}}",
+ "model_managed_by_runtime": "由运行时管理",
+ "model_search_placeholder": "搜索或输入模型 ID",
+ "model_discovering": "正在发现模型...",
+ "model_default_badge": "默认",
+ "model_empty": "暂无可用模型",
+ "model_empty_with_dot": "暂无可用模型。",
+ "model_custom_tooltip": "使用\"{{value}}\"作为自定义模型 ID",
+ "model_custom_use": "使用\"{{value}}\"",
+ "model_clear": "清除(使用提供方默认)",
+ "model_clear_title": "清除并回退到运行时的提供方默认"
+ },
+ "model_dropdown": {
+ "label": "模型",
+ "select_runtime_first": "请先选择运行时",
+ "default_provider": "默认(提供方)",
+ "runtime_offline_manual": "运行时离线 —— 请手动输入",
+ "managed_by_runtime_title": "模型选择由该运行时管理。",
+ "managed_by_runtime_hint": "请在运行时主机上配置模型(例如 Hermes 会从自身配置文件读取)。",
+ "discovery_failed": "发现失败",
+ "clear_full": "清除选择(使用提供方默认)"
+ },
+ "tabs": {
+ "activity": "动态",
+ "instructions": "指令",
+ "skills": "skill",
+ "environment": "环境变量",
+ "custom_args": "自定义参数",
+ "discard_dialog_title": "放弃未保存的修改?",
+ "discard_dialog_description": "当前 tab 有未保存的修改,离开会丢弃这些修改。",
+ "discard_keep": "继续编辑",
+ "discard_confirm": "放弃修改"
+ },
+ "create_dialog": {
+ "title_create": "创建智能体",
+ "title_duplicate": "复制智能体",
+ "description_create": "为工作区创建一个新的 AI 智能体。",
+ "description_duplicate": "基于\"{{name}}\"创建一个新智能体。指令、环境变量和 skill 会一并复制。",
+ "name_label": "名称",
+ "name_placeholder": "例如:深度研究智能体",
+ "description_label": "描述",
+ "description_placeholder": "这个智能体做什么?",
+ "visibility_label": "可见性",
+ "runtime_label": "运行时",
+ "runtime_filter_mine": "我的",
+ "runtime_filter_all": "全部",
+ "runtime_loading": "加载运行时...",
+ "runtime_none": "暂无可用运行时",
+ "runtime_register_first": "请先注册一个运行时再创建智能体",
+ "runtime_cloud_badge": "云端",
+ "duplicate_copy_suffix": "(副本)",
+ "create": "创建",
+ "creating": "创建中...",
+ "cancel": "取消",
+ "create_failed_toast": "创建智能体失败"
+ },
+ "tab_body": {
+ "common": {
+ "save": "保存",
+ "add": "添加",
+ "unsaved_changes": "未保存的修改"
+ },
+ "instructions": {
+ "intro": "定义这个智能体的身份和工作风格。会注入到每个 task 的上下文。支持 Markdown。",
+ "placeholder": "定义这个智能体的角色、专长和工作风格。\n\n# 示例\n你是一名专注 React 和 TypeScript 的前端工程师。\n\n## 工作风格\n- 写小而聚焦的 PR —— 每个逻辑变更一个 commit\n- 优先组合而不是继承\n- 新组件总是配单元测试\n\n## 约束\n- 未经明确批准不要修改 shared/ 下的 type\n- 遵循 features/ 中现有的组件模式"
+ },
+ "env": {
+ "intro_readonly": "在智能体进程启动时注入。值已隐藏 —— 只有智能体所有者或工作区管理员可以查看和编辑。",
+ "empty_readonly": "尚未配置环境变量。",
+ "intro_prefix": "在智能体进程启动时注入(例如 ",
+ "intro_separator": "、",
+ "intro_suffix": ")。",
+ "key_placeholder": "KEY",
+ "value_placeholder": "值",
+ "show_value_aria": "显示值",
+ "hide_value_aria": "隐藏值",
+ "remove_aria": "移除变量",
+ "duplicate_keys_toast": "环境变量 key 重复",
+ "saved_toast": "已保存环境变量",
+ "save_failed_toast": "保存环境变量失败"
+ },
+ "custom_args": {
+ "intro": "在智能体命令启动时追加的额外 CLI 参数。多 token 的参数可以共用一行 —— 在传给 CLI 前会按空白拆分。",
+ "launch_mode_prefix": "启动方式: ",
+ "launch_mode_args_placeholder": "<你的参数>",
+ "input_placeholder": "--flag 值",
+ "remove_aria": "移除参数",
+ "saved_toast": "已保存自定义参数",
+ "save_failed_toast": "保存自定义参数失败"
+ },
+ "skills": {
+ "intro": "分配给该智能体的工作区 skill。本地运行时 skill 会自动可用。",
+ "add_action": "添加 skill",
+ "import_hint": "导入会在工作区创建一份副本,团队可以编辑和复用。",
+ "empty_title": "尚未分配 skill",
+ "empty_hint": "添加工作区 skill,把团队知识共享给这个智能体。",
+ "remove_failed_toast": "移除 skill 失败",
+ "add_dialog_title": "添加 skill",
+ "add_dialog_description": "选择一个工作区 skill 分配给该智能体。",
+ "add_dialog_empty": "全部工作区 skill 都已分配。",
+ "add_dialog_cancel": "取消",
+ "add_failed_toast": "添加 skill 失败"
+ },
+ "activity": {
+ "section_now": "当前",
+ "section_last_30d": "近 30 天",
+ "section_recent": "最近工作",
+ "subtitle_no_active": "无进行中的工作",
+ "subtitle_active_other": "{{count}} 个进行中的 task",
+ "subtitle_performance": "表现",
+ "subtitle_no_recent": "还没有完成的 task",
+ "subtitle_recent_progress": "{{shown}} / {{total}}",
+ "subtitle_recent_latest": "最近 {{count}} 条",
+ "empty_now": "这个智能体当前没有在跑任何 task。",
+ "empty_30d": "近 30 天没有任何完成记录。",
+ "empty_recent": "这个智能体还没有完成过任何 task。",
+ "show_more": "查看更多 →",
+ "runs_other": "次运行",
+ "success_pct": "{{percent}}% 成功",
+ "avg_duration": "平均 {{value}}",
+ "failed_count": "{{count}} 次失败",
+ "source_issue": "issue",
+ "source_chat": "聊天",
+ "source_autopilot": "自动化",
+ "source_untracked": "未追踪",
+ "source_quick_create": "快速创建",
+ "source_creating_issue": "正在创建 issue",
+ "source_chat_session": "聊天会话",
+ "source_autopilot_run": "自动化运行",
+ "issue_short_fallback": "issue {{prefix}}...",
+ "triggered_by": "触发来源",
+ "open_issue_aria": "打开 issue",
+ "open_issue_tooltip": "打开 issue",
+ "transcript_tooltip": "查看记录",
+ "cancel_task_aria": "取消 task",
+ "cancel_task_tooltip": "取消 task",
+ "cancelling_tooltip": "正在取消...",
+ "cancel_failed_toast": "取消 task 失败",
+ "started_prefix": "{{when}}启动",
+ "dispatched_prefix": "{{when}}派发",
+ "queued_prefix": "{{when}}排队"
+ }
+ },
+ "char_counter": {
+ "over_limit": " · 超出 {{count}} 字"
+ },
+ "presence": {
+ "queue_badge": "+{{count}} 排队"
+ },
+ "visibility": {
+ "private": {
+ "label": "个人",
+ "tooltip": "个人 · 仅你和工作区管理员可以使用该智能体"
+ },
+ "workspace": {
+ "label": "工作区",
+ "tooltip": "工作区 · 工作区内所有人都可以使用该智能体"
+ }
+ },
+ "profile_card": {
+ "unavailable": "智能体不可用",
+ "detail_link": "详情 →",
+ "runtime_label": "运行时",
+ "skills_label": "skill",
+ "owner_label": "所有者",
+ "unknown_runtime": "未知运行时"
+ },
+ "transcript": {
+ "dialog_title": "智能体执行记录",
+ "status_running": "进行中",
+ "status_completed": "已完成",
+ "status_failed": "失败",
+ "filter": "筛选",
+ "clear_filters": "清除筛选",
+ "tool_calls_other": "{{count}} 次工具调用",
+ "events_other": "{{count}} 个事件",
+ "events_filtered": "{{shown}} / {{total}} 个事件",
+ "copy_all": "全部复制",
+ "copy_filtered": "复制筛选结果",
+ "copied": "已复制",
+ "waiting_events": "等待事件中...",
+ "no_data": "未记录执行数据。"
+ },
+ "task_failure": {
+ "agent_error": "智能体执行出错",
+ "timeout": "task 超时",
+ "runtime_offline": "守护进程离线",
+ "runtime_recovery": "守护进程已重启",
+ "manual": "用户取消"
+ }
+}
diff --git a/packages/views/locales/zh-Hans/auth.json b/packages/views/locales/zh-Hans/auth.json
new file mode 100644
index 0000000000..7b0b57ae9c
--- /dev/null
+++ b/packages/views/locales/zh-Hans/auth.json
@@ -0,0 +1,48 @@
+{
+ "signin": {
+ "title": "登录 Multica",
+ "description": "输入邮箱以获取登录验证码",
+ "continue": "继续",
+ "sending": "发送验证码...",
+ "divider": "或",
+ "google": "使用 Google 登录"
+ },
+ "verify": {
+ "title": "查看你的邮箱",
+ "description": "已发送验证码至 {{email}}",
+ "resend": "重新发送",
+ "resend_cooldown": "{{seconds}} 秒后可重新发送"
+ },
+ "cli": {
+ "title": "授权 CLI",
+ "description": "允许 CLI 以 {{email}} 身份访问 Multica",
+ "authorize": "授权",
+ "authorizing": "授权中...",
+ "different_account": "使用其他账号"
+ },
+ "common": {
+ "back": "返回",
+ "email": "邮箱",
+ "email_placeholder": "[email protected]",
+ "email_required": "请输入邮箱"
+ },
+ "errors": {
+ "server_unreachable": "请确认服务器已启动。",
+ "send_failed": "发送验证码失败。",
+ "resend_failed": "重新发送失败",
+ "code_invalid": "验证码无效或已过期",
+ "cli_auth_failed": "CLI 授权失败,请重新登录。"
+ },
+ "web": {
+ "prefer_desktop": "想用桌面应用?",
+ "download": "下载",
+ "desktop_handoff": {
+ "preparing": "正在准备桌面登录...",
+ "opening_title": "正在打开 Multica",
+ "opening_description": "应该会看到打开 Multica 桌面应用的提示。如果没有反应,请点击下方按钮。",
+ "open_button": "打开 Multica 桌面应用",
+ "failed_title": "登录失败",
+ "prepare_failed": "桌面登录准备失败"
+ }
+ }
+}
diff --git a/packages/views/locales/zh-Hans/autopilots.json b/packages/views/locales/zh-Hans/autopilots.json
new file mode 100644
index 0000000000..2dafbfec91
--- /dev/null
+++ b/packages/views/locales/zh-Hans/autopilots.json
@@ -0,0 +1,232 @@
+{
+ "page": {
+ "title": "自动化",
+ "new_autopilot": "新建自动化",
+ "start_blank": "从空白开始",
+ "table": {
+ "name": "名称",
+ "agent": "智能体",
+ "mode": "模式",
+ "status": "状态",
+ "last_run": "上次运行"
+ },
+ "last_run_empty": "--",
+ "empty": {
+ "title": "还没有自动化",
+ "hint": "为你的智能体安排周期性 task。从模板选一个,或从空白开始。"
+ }
+ },
+ "status": {
+ "active": "启用",
+ "paused": "已暂停",
+ "archived": "已归档"
+ },
+ "execution_mode": {
+ "create_issue": "创建 issue",
+ "run_only": "仅运行"
+ },
+ "relative_date": {
+ "today": "今天",
+ "one_day_ago": "1 天前",
+ "days_ago": "{{count}} 天前",
+ "months_ago": "{{count}} 个月前"
+ },
+ "templates": {
+ "daily_news": {
+ "title": "每日新闻摘要",
+ "summary": "搜索并汇总今天的新闻给团队"
+ },
+ "pr_review": {
+ "title": "PR review 提醒",
+ "summary": "标记需要 review 的滞留 pull request"
+ },
+ "bug_triage": {
+ "title": "Bug 分诊",
+ "summary": "评估并安排新提交的 bug"
+ },
+ "weekly_progress": {
+ "title": "每周进度报告",
+ "summary": "汇总团队本周进展"
+ },
+ "dependency_audit": {
+ "title": "依赖审计",
+ "summary": "扫描安全漏洞和过时的依赖包"
+ },
+ "documentation_check": {
+ "title": "文档检查",
+ "summary": "检查近期改动是否缺失文档"
+ }
+ },
+ "detail": {
+ "not_found": "未找到该自动化",
+ "pause_aria": "暂停自动化",
+ "activate_aria": "启用自动化",
+ "edit": "编辑",
+ "run_now": "立即运行",
+ "running": "运行中...",
+ "toast_triggered": "已触发自动化",
+ "toast_trigger_failed": "触发自动化失败",
+ "section_properties": "属性",
+ "section_triggers": "触发器",
+ "section_run_history": "运行历史",
+ "section_danger": "危险操作",
+ "field_agent": "智能体",
+ "field_output_mode": "输出模式",
+ "field_prompt": "Prompt",
+ "add_trigger": "添加触发器",
+ "no_triggers": "未配置触发器。添加一个时间表让它自动运行。",
+ "no_runs": "暂无运行记录。点击\"立即运行\"手动触发。",
+ "delete_button": "删除自动化",
+ "toast_deleted": "已删除自动化",
+ "toast_delete_failed": "删除自动化失败",
+ "delete_dialog": {
+ "title": "删除自动化",
+ "description": "将永久删除\"{{title}}\",连同它的触发器和运行历史。此操作不可撤销。",
+ "cancel": "取消",
+ "confirm": "删除",
+ "deleting": "删除中..."
+ }
+ },
+ "run_status": {
+ "issue_created": "已创建 issue",
+ "running": "运行中",
+ "completed": "已完成",
+ "failed": "失败"
+ },
+ "run": {
+ "issue_linked": "已关联 issue",
+ "view_log": "查看执行日志"
+ },
+ "trigger_row": {
+ "disabled_badge": "已禁用",
+ "next_label": "下次:{{date}}",
+ "toast_deleted": "已删除触发器",
+ "toast_delete_failed": "删除触发器失败",
+ "delete_dialog": {
+ "title": "删除触发器",
+ "description": "将移除该触发器,自动化不再按此时间表运行。此操作不可撤销。",
+ "cancel": "取消",
+ "confirm": "删除",
+ "deleting": "删除中..."
+ }
+ },
+ "add_trigger_dialog": {
+ "title": "添加触发器",
+ "label_field": "标签(可选)",
+ "label_placeholder": "例如:工作日早晨",
+ "submit": "添加触发器",
+ "submitting": "添加中...",
+ "toast_added": "已添加触发器",
+ "toast_add_failed": "添加触发器失败"
+ },
+ "dialog": {
+ "sr_create": "新建自动化",
+ "sr_edit": "编辑自动化",
+ "header_create": "新建自动化",
+ "header_edit": "编辑自动化",
+ "subtitle": "周期性的 AI task",
+ "expand": "展开",
+ "collapse": "收起",
+ "close": "关闭",
+ "title_placeholder": "自动化名称",
+ "runbook_label": "Runbook",
+ "runbook_hint": "智能体每次运行时读取",
+ "description_placeholder": "# 目标\n你希望智能体完成什么?\n\n# 上下文\n这是给谁的?有什么约束?\n\n# 步骤\n1. ...\n2. ...",
+ "auto_run_hint": "保存后会自动运行,直到暂停。",
+ "cancel": "取消",
+ "create": "创建自动化",
+ "save": "保存",
+ "creating": "创建中...",
+ "saving": "保存中...",
+ "toast_created": "已创建自动化",
+ "toast_create_partial": "自动化已创建,但时间表保存失败",
+ "toast_create_failed": "创建自动化失败",
+ "toast_updated": "已更新自动化",
+ "toast_update_partial": "自动化已更新,但时间表保存失败",
+ "toast_update_failed": "更新自动化失败",
+ "section_agent": "智能体",
+ "select_agent": "选择智能体",
+ "section_output_mode": "输出模式",
+ "section_schedule": "时间表",
+ "schedule_disabled_reason": "该自动化有多个时间表——请到详情页编辑。",
+ "next_run_label": "下次运行:",
+ "output_modes": {
+ "create_issue": {
+ "label": "创建 issue",
+ "description": "每次运行都创建一个可追踪的 issue"
+ },
+ "run_only": {
+ "label": "仅运行",
+ "description": "静默运行,不创建 issue"
+ }
+ },
+ "frequency_long": {
+ "hourly": "每小时",
+ "daily": "每天",
+ "weekdays": "每个工作日",
+ "weekly": "每周",
+ "custom": "自定义 cron"
+ },
+ "days": {
+ "sunday": "周日",
+ "monday": "周一",
+ "tuesday": "周二",
+ "wednesday": "周三",
+ "thursday": "周四",
+ "friday": "周五",
+ "saturday": "周六"
+ }
+ },
+ "trigger_config": {
+ "frequencies": {
+ "hourly": "每小时",
+ "daily": "每天",
+ "weekdays": "工作日",
+ "weekly": "按天",
+ "custom": "自定义"
+ },
+ "days_short": {
+ "sun": "日",
+ "mon": "一",
+ "tue": "二",
+ "wed": "三",
+ "thu": "四",
+ "fri": "五",
+ "sat": "六"
+ },
+ "cron_label": "Cron 表达式",
+ "cron_hint": "标准 5 字段 cron(分 时 日 月 星期)",
+ "minute_label": "分钟",
+ "time_label": "时间",
+ "timezone_label": "时区",
+ "days_label": "星期",
+ "summary": {
+ "hourly": "每小时 · :{{min}}",
+ "daily": "每天 {{time}}",
+ "weekdays": "工作日 {{time}}",
+ "weekly": "{{days}} {{time}}",
+ "custom": "自定义 cron",
+ "no_days": "—"
+ },
+ "describe": {
+ "hourly": "每小时整点过 {{min}} 分运行",
+ "daily": "每天 {{time}} {{offset}} 运行",
+ "weekdays": "每个工作日 {{time}} {{offset}} 运行",
+ "weekly": "每 {{days}} 的 {{time}} {{offset}} 运行",
+ "custom": "自定义时间表:{{cron}}"
+ },
+ "countdown": {
+ "days_hours": "{{days}} 天 {{hours}} 小时",
+ "hours_minutes": "{{hours}} 小时 {{minutes}} 分",
+ "minutes": "{{minutes}} 分",
+ "less_than_minute": "不到 1 分"
+ }
+ },
+ "agent_picker": {
+ "filter_placeholder": "筛选智能体...",
+ "select_agent": "选择智能体"
+ },
+ "timezone_picker": {
+ "search_placeholder": "搜索时区..."
+ }
+}
diff --git a/packages/views/locales/zh-Hans/chat.json b/packages/views/locales/zh-Hans/chat.json
new file mode 100644
index 0000000000..0abcd571ec
--- /dev/null
+++ b/packages/views/locales/zh-Hans/chat.json
@@ -0,0 +1,111 @@
+{
+ "fab": {
+ "running": "Multica 正在工作...",
+ "unread_other": "{{count}} 条未读对话",
+ "default": "问 Multica"
+ },
+ "input": {
+ "placeholder_no_agent": "创建一个智能体后才能开始对话",
+ "placeholder_archived": "此会话已归档",
+ "placeholder_named": "告诉 {{name}} 该做什么...",
+ "placeholder_default": "告诉我该做什么..."
+ },
+ "message_list": {
+ "show_details": "查看详情",
+ "replied_in": "{{elapsed}} 内回复",
+ "failed_after": "{{elapsed}} 后失败",
+ "task_failed_fallback": "task 失败",
+ "tools_other": "{{count}} 个工具",
+ "tool_result_named": "{{tool}} 结果:",
+ "tool_result_unnamed": "结果:"
+ },
+ "session_history": {
+ "back_tooltip": "返回",
+ "header": "对话历史",
+ "empty": "还没有对话记录",
+ "untitled": "无标题",
+ "time": {
+ "just_now": "刚刚",
+ "minutes": "{{count}} 分钟前",
+ "hours": "{{count}} 小时前",
+ "days": "{{count}} 天前"
+ },
+ "row_delete_aria": "删除对话",
+ "row_delete_tooltip": "删除",
+ "delete_dialog": {
+ "title": "删除对话",
+ "description_with_title": "\"{{title}}\" 及其消息会被永久删除,无法撤销。",
+ "description_default": "此对话及其消息会被永久删除,无法撤销。",
+ "cancel": "取消",
+ "confirm": "删除",
+ "confirming": "删除中..."
+ }
+ },
+ "window": {
+ "new_chat_tooltip": "新对话",
+ "restore_tooltip": "还原",
+ "expand_tooltip": "展开",
+ "minimize_tooltip": "最小化",
+ "another_running": "另一个对话正在运行",
+ "another_unread": "另一个对话有未读回复",
+ "running": "运行中",
+ "unread": "未读",
+ "no_previous": "暂无历史对话",
+ "untitled": "新对话",
+ "my_agents": "我的智能体",
+ "others": "其他",
+ "no_agents": "暂无智能体",
+ "history_show_tooltip": "对话历史",
+ "history_back_tooltip": "返回对话"
+ },
+ "empty_state": {
+ "first_time_title": "和你的智能体对话",
+ "first_time_intro": "✨ 它们了解你的工作区——",
+ "first_time_pillars": "issue、项目、skill",
+ "first_time_pillars_suffix": "。",
+ "first_time_actions": "让它做一份总结、规划你的一天,或交给它一个小任务。",
+ "returning_title_named": "你好,我是 {{name}}",
+ "returning_title_default": "欢迎使用 Multica",
+ "returning_subtitle": "试试问"
+ },
+ "starter_prompts": {
+ "list_open": "按优先级列出我未完成的任务",
+ "summarize_today": "总结一下我今天做了什么",
+ "plan_next": "规划接下来该做什么"
+ },
+ "context_anchor": {
+ "tooltip_disabled": "当前页面没有可以共享给 Multica 的内容",
+ "tooltip_off": "让 Multica 知道你正在看的内容",
+ "tooltip_on_issue": "Multica 知道你正在看 {{label}},点击关闭",
+ "tooltip_on_project": "Multica 知道你正在看项目 \"{{label}}\",点击关闭",
+ "card_tooltip_issue_with_subtitle": "Multica 知道你正在看 {{label}} —— {{subtitle}}",
+ "card_tooltip_issue": "Multica 知道你正在看 {{label}}",
+ "card_tooltip_project": "Multica 知道你正在看项目 \"{{label}}\"",
+ "aria_stop": "停止共享当前页面",
+ "aria_start": "把当前页面共享给 Multica"
+ },
+ "no_agent_banner": "需要先有一个智能体才能开始对话。",
+ "offline_banner": {
+ "fallback_name": "智能体",
+ "unstable": "{{name}} 的连接不稳定——回复可能延迟。",
+ "offline": "{{name}} 离线——你的消息将在它上线后发送。"
+ },
+ "status_pill": {
+ "stages": {
+ "offline": "离线",
+ "reconnecting": "重连中",
+ "queued": "排队中",
+ "starting_up": "启动中",
+ "thinking": "思考中",
+ "typing": "输入中"
+ },
+ "tools": {
+ "running_command": "执行命令",
+ "reading_files": "读取文件",
+ "searching_code": "搜索代码",
+ "making_edits": "修改文件",
+ "searching_web": "搜索网页",
+ "fallback": "处理中"
+ }
+ }
+}
diff --git a/packages/views/locales/zh-Hans/common.json b/packages/views/locales/zh-Hans/common.json
new file mode 100644
index 0000000000..0cffb198df
--- /dev/null
+++ b/packages/views/locales/zh-Hans/common.json
@@ -0,0 +1,7 @@
+{
+ "save": "保存",
+ "cancel": "取消",
+ "delete": "删除",
+ "confirm": "确认",
+ "loading": "加载中..."
+}
diff --git a/packages/views/locales/zh-Hans/editor.json b/packages/views/locales/zh-Hans/editor.json
new file mode 100644
index 0000000000..c258cddf42
--- /dev/null
+++ b/packages/views/locales/zh-Hans/editor.json
@@ -0,0 +1,58 @@
+{
+ "bubble_menu": {
+ "bold": "加粗",
+ "italic": "斜体",
+ "strikethrough": "删除线",
+ "code": "代码",
+ "link": "链接",
+ "list": "列表",
+ "quote": "引用",
+ "url_aria_label": "URL",
+ "heading_dropdown": {
+ "text": "正文",
+ "normal_text": "正文",
+ "heading_1": "标题 1",
+ "heading_2": "标题 2",
+ "heading_3": "标题 3"
+ },
+ "list_dropdown": {
+ "bullet_list": "无序列表",
+ "ordered_list": "有序列表"
+ },
+ "sub_issue": {
+ "tooltip": "用选中内容创建子 issue",
+ "created": "已创建 {{identifier}}",
+ "create_failed": "创建子 issue 失败"
+ }
+ },
+ "image": {
+ "view": "查看图片",
+ "download": "下载",
+ "copy_link": "复制链接",
+ "delete": "删除",
+ "link_copied": "已复制链接",
+ "copy_link_failed": "复制链接失败"
+ },
+ "link_hover": {
+ "copy_link": "复制链接",
+ "open_link": "打开链接",
+ "link_copied": "已复制链接",
+ "copy_failed": "复制失败"
+ },
+ "mention": {
+ "group_users": "用户",
+ "group_issues": "issue",
+ "all_members": "所有成员",
+ "searching": "搜索中...",
+ "no_results": "无结果"
+ },
+ "code_block": {
+ "copy_code": "复制代码"
+ },
+ "file_card": {
+ "uploading": "正在上传 {{filename}}"
+ },
+ "title_editor": {
+ "title_aria_label": "标题"
+ }
+}
diff --git a/packages/views/locales/zh-Hans/inbox.json b/packages/views/locales/zh-Hans/inbox.json
new file mode 100644
index 0000000000..09c724953a
--- /dev/null
+++ b/packages/views/locales/zh-Hans/inbox.json
@@ -0,0 +1,68 @@
+{
+ "page": {
+ "title": "收件箱",
+ "back": "收件箱"
+ },
+ "menu": {
+ "mark_all_read": "全部标为已读",
+ "archive_all": "归档全部",
+ "archive_all_read": "归档全部已读",
+ "archive_completed": "归档已完成"
+ },
+ "list": {
+ "empty": "暂无通知",
+ "mark_done_tooltip": "标为已完成",
+ "archive_tooltip": "归档",
+ "time": {
+ "just_now": "刚刚",
+ "minutes": "{{count}} 分钟",
+ "hours": "{{count}} 小时",
+ "days": "{{count}} 天"
+ }
+ },
+ "detail": {
+ "select_prompt": "选择一条通知查看详情",
+ "empty": "收件箱为空",
+ "original_input": "原始输入",
+ "edit_advanced": "在完整表单中编辑",
+ "archive": "归档"
+ },
+ "types": {
+ "issue_assigned": "已分配",
+ "unassigned": "已取消分配",
+ "assignee_changed": "分配人已更改",
+ "status_changed": "状态已更改",
+ "priority_changed": "优先级已更改",
+ "due_date_changed": "截止日期已更改",
+ "new_comment": "新评论",
+ "mentioned": "提及了你",
+ "review_requested": "请求审阅",
+ "task_completed": "task 已完成",
+ "task_failed": "task 失败",
+ "agent_blocked": "智能体被阻塞",
+ "agent_completed": "智能体已完成",
+ "reaction_added": "添加了表情反应",
+ "quick_create_done": "通过智能体创建",
+ "quick_create_failed": "通过智能体创建失败"
+ },
+ "labels": {
+ "set_status_to": "状态设为",
+ "set_priority_to": "优先级设为",
+ "assigned_to": "分配给 {{name}}",
+ "removed_assignee": "移除了分配人",
+ "set_due_date_to": "截止日期设为 {{date}}",
+ "removed_due_date": "移除了截止日期",
+ "reacted_to_comment": "用 {{emoji}} 回应了你的评论",
+ "created_with_agent": "通过智能体创建:{{identifier}}",
+ "failed_with_detail": "失败:{{detail}}"
+ },
+ "errors": {
+ "mark_read_failed": "标为已读失败",
+ "archive_failed": "归档失败",
+ "mark_done_failed": "标为已完成失败",
+ "mark_all_read_failed": "全部标为已读失败",
+ "archive_all_failed": "归档全部失败",
+ "archive_all_read_failed": "归档已读失败",
+ "archive_completed_failed": "归档已完成失败"
+ }
+}
diff --git a/packages/views/locales/zh-Hans/invite.json b/packages/views/locales/zh-Hans/invite.json
new file mode 100644
index 0000000000..fe92927157
--- /dev/null
+++ b/packages/views/locales/zh-Hans/invite.json
@@ -0,0 +1,37 @@
+{
+ "header": {
+ "back": "返回",
+ "log_out": "退出登录"
+ },
+ "not_found": {
+ "title": "未找到邀请",
+ "description": "此邀请可能已过期、已被撤销,或不属于你的账号。",
+ "go_to_dashboard": "前往主页"
+ },
+ "accepted": {
+ "title": "你已加入 {{workspace_name}}!",
+ "redirecting": "正在跳转到 工作区..."
+ },
+ "declined": {
+ "title": "已拒绝邀请",
+ "description": "你将不会加入此 工作区。",
+ "go_to_dashboard": "前往主页"
+ },
+ "main": {
+ "join_title": "加入 {{workspace_name}}",
+ "fallback_workspace_name": "工作区",
+ "invited_role_admin": "邀请你以管理员身份加入。",
+ "invited_role_member": "邀请你以成员身份加入。",
+ "already_handled_accepted": "此邀请已被接受。",
+ "already_handled_declined": "此邀请已被拒绝。",
+ "expired": "此邀请已过期。",
+ "decline": "拒绝",
+ "declining": "拒绝中...",
+ "accept": "接受并加入",
+ "joining": "加入中..."
+ },
+ "errors": {
+ "accept_failed": "接受邀请失败",
+ "decline_failed": "拒绝邀请失败"
+ }
+}
diff --git a/packages/views/locales/zh-Hans/issues.json b/packages/views/locales/zh-Hans/issues.json
new file mode 100644
index 0000000000..1b1a720933
--- /dev/null
+++ b/packages/views/locales/zh-Hans/issues.json
@@ -0,0 +1,298 @@
+{
+ "page": {
+ "breadcrumb_title": "issue",
+ "breadcrumb_workspace_fallback": "工作区",
+ "empty_title": "还没有 issue",
+ "empty_hint": "创建一个 issue 开始使用。",
+ "move_failed": "移动 issue 失败"
+ },
+ "status": {
+ "backlog": "待规划",
+ "todo": "待办",
+ "in_progress": "进行中",
+ "in_review": "审核中",
+ "done": "已完成",
+ "blocked": "已阻塞",
+ "cancelled": "已取消"
+ },
+ "priority": {
+ "urgent": "紧急",
+ "high": "高",
+ "medium": "中",
+ "low": "低",
+ "none": "无优先级"
+ },
+ "scope": {
+ "all_label": "全部",
+ "all_description": "工作区内的全部 issue",
+ "members_label": "成员",
+ "members_description": "分配给成员的 issue",
+ "agents_label": "智能体",
+ "agents_description": "分配给智能体的 issue"
+ },
+ "filters": {
+ "tooltip": "筛选",
+ "placeholder": "筛选...",
+ "no_results": "无结果",
+ "no_labels": "还没有标签",
+ "no_assignee": "无负责人",
+ "no_project": "无项目",
+ "section_status": "状态",
+ "section_priority": "优先级",
+ "section_assignee": "负责人",
+ "section_creator": "创建者",
+ "section_project": "项目",
+ "section_label": "标签",
+ "members_group": "成员",
+ "agents_group": "智能体",
+ "issue_count_other": "{{count}} 个 issue",
+ "reset": "重置全部筛选"
+ },
+ "display": {
+ "tooltip": "显示设置",
+ "ordering_section": "排序",
+ "card_properties_section": "卡片属性",
+ "ascending_title": "升序",
+ "descending_title": "降序",
+ "sort_manual": "手动",
+ "sort_priority": "优先级",
+ "sort_due_date": "截止日期",
+ "sort_created": "创建时间",
+ "sort_title": "标题",
+ "card_priority": "优先级",
+ "card_description": "描述",
+ "card_assignee": "负责人",
+ "card_due_date": "截止日期",
+ "card_project": "项目",
+ "card_labels": "标签",
+ "card_child_progress": "子 issue 进度"
+ },
+ "view": {
+ "tooltip_board": "看板视图",
+ "tooltip_list": "列表视图",
+ "section": "视图",
+ "board": "看板",
+ "list": "列表"
+ },
+ "list": {
+ "empty_status": "无 issue",
+ "add_issue_tooltip": "新建 issue"
+ },
+ "board": {
+ "hidden_columns_label": "隐藏的列",
+ "hide_column": "隐藏列",
+ "show_column": "显示列",
+ "add_issue_tooltip": "新建 issue",
+ "empty_column": "无 issue"
+ },
+ "detail": {
+ "not_found": "这个 issue 不存在或已在该工作区被删除。",
+ "back_to_issues": "返回 issue 列表",
+ "title_placeholder": "issue 标题",
+ "desc_placeholder": "添加描述...",
+ "sub_issues_label": "子 issue",
+ "sub_issue_of": "属于父 issue",
+ "add_sub_issues": "添加子 issue",
+ "add_sub_issue_tooltip": "添加子 issue",
+ "add_sub_issue_aria": "添加子 issue",
+ "section_properties": "属性",
+ "section_parent_issue": "父 issue",
+ "section_details": "详情",
+ "section_token_usage": "Token 用量",
+ "prop_status": "状态",
+ "prop_priority": "优先级",
+ "prop_assignee": "负责人",
+ "prop_due_date": "截止日期",
+ "prop_project": "项目",
+ "prop_labels": "标签",
+ "prop_created_by": "创建者",
+ "prop_created": "创建时间",
+ "prop_updated": "更新时间",
+ "prop_input": "输入",
+ "prop_output": "输出",
+ "prop_cache": "缓存",
+ "prop_cache_value": "{{read}} 读 / {{write}} 写",
+ "prop_runs": "运行次数",
+ "activity_section": "动态",
+ "subscribe": "订阅",
+ "unsubscribe": "取消订阅",
+ "no_subscribers_results": "未找到结果",
+ "change_subscribers_placeholder": "更改订阅者...",
+ "members_group": "成员",
+ "agents_group": "智能体",
+ "mark_done_tooltip": "标记为已完成",
+ "pin_tooltip": "固定到侧边栏",
+ "unpin_tooltip": "从侧边栏取消固定",
+ "sidebar_tooltip": "切换侧边栏",
+ "update_failed": "更新 issue 失败",
+ "link_copied": "已复制链接",
+ "link_copy_failed": "复制链接失败"
+ },
+ "activity": {
+ "created": "创建了这个 issue",
+ "self_assigned": "把这个 issue 分配给了自己",
+ "assigned_to": "分配给 {{name}}",
+ "removed_assignee": "移除了负责人",
+ "changed_assignee": "更改了负责人",
+ "status_changed": "状态从 {{from}} 改为 {{to}}",
+ "priority_changed": "优先级从 {{from}} 改为 {{to}}",
+ "due_date_set": "截止日期设为 {{date}}",
+ "due_date_removed": "移除了截止日期",
+ "title_renamed": "把这个 issue 从\"{{from}}\"重命名为\"{{to}}\"",
+ "description_updated": "更新了描述",
+ "task_completed_one": "完成了 task",
+ "task_completed_other": "完成了 task({{count}} 次)",
+ "task_failed_one": "task 失败",
+ "task_failed_other": "task 失败({{count}} 次)"
+ },
+ "comment": {
+ "delete_title": "删除评论",
+ "delete_desc": "这条评论会被永久删除,无法撤销。",
+ "delete_desc_with_replies": "这条评论及其全部回复会被永久删除,无法撤销。",
+ "delete_action": "删除",
+ "cancel_action": "取消",
+ "edit_placeholder": "编辑评论...",
+ "save_action": "保存",
+ "cancel_edit": "取消",
+ "copy_action": "复制",
+ "copied_toast": "已复制",
+ "edit_action": "编辑",
+ "update_failed": "更新评论失败",
+ "send_failed": "发送评论失败",
+ "send_reply_failed": "发送回复失败",
+ "delete_failed": "删除评论失败",
+ "reply_count_other": "{{count}} 条回复",
+ "leave_comment_placeholder": "留下评论...",
+ "expand_tooltip": "展开",
+ "collapse_tooltip": "收起"
+ },
+ "reply": {
+ "placeholder": "回复...",
+ "expand_tooltip": "展开",
+ "collapse_tooltip": "收起"
+ },
+ "agent_live": {
+ "is_working": "{{name}} 正在处理",
+ "fallback_name": "智能体",
+ "tool_count_other": "{{count}} 次工具调用",
+ "transcript_button": "查看记录",
+ "stop_button": "停止",
+ "stop_tooltip": "停止智能体",
+ "cancel_failed": "取消 task 失败"
+ },
+ "execution_log": {
+ "section": "执行日志",
+ "show_past": "显示历史运行({{count}})",
+ "hide_past": "隐藏历史运行({{count}})",
+ "cancel_task_tooltip": "取消 task",
+ "cancel_task_aria": "取消 task",
+ "transcript_tooltip": "查看记录",
+ "cancel_failed": "取消 task 失败",
+ "trigger_retry": "重试",
+ "trigger_retry_attempt": "重试 #{{attempt}}",
+ "trigger_retry_attempt_prefix": "重试 #{{attempt}} · ",
+ "trigger_retry_prefix": "重试 · ",
+ "trigger_autopilot": "自动化运行",
+ "trigger_comment": "评论触发",
+ "trigger_initial": "首次运行",
+ "status_queued": "排队中",
+ "status_dispatched": "启动中",
+ "status_running": "处理中",
+ "status_completed": "已完成",
+ "status_failed": "失败",
+ "status_cancelled": "已取消"
+ },
+ "batch": {
+ "selected": "已选择 {{count}} 个",
+ "status": "状态",
+ "priority": "优先级",
+ "assignee": "负责人",
+ "delete": "删除",
+ "update_success_other": "已更新 {{count}} 个 issue",
+ "update_failed": "更新 issue 失败",
+ "delete_success_other": "已删除 {{count}} 个 issue",
+ "delete_failed": "删除 issue 失败",
+ "delete_dialog_title_other": "删除 {{count}} 个 issue?",
+ "delete_dialog_desc_other": "此操作无法撤销,所选 issue 及其全部关联数据都会被永久删除。",
+ "delete_dialog_warning": "任何工作区成员都可以删除 issue。",
+ "cancel": "取消"
+ },
+ "card": {
+ "update_failed": "更新 issue 失败"
+ },
+ "actions": {
+ "status": "状态",
+ "priority": "优先级",
+ "assignee": "负责人",
+ "due_date": "截止日期",
+ "due_today": "今天",
+ "due_tomorrow": "明天",
+ "due_next_week": "下周",
+ "due_clear": "清除日期",
+ "unassigned": "未分配",
+ "pin_to_sidebar": "固定到侧边栏",
+ "unpin_from_sidebar": "从侧边栏取消固定",
+ "copy_link": "复制链接",
+ "more": "更多",
+ "create_sub_issue": "创建子 issue",
+ "set_parent_issue": "设置父 issue...",
+ "add_sub_issue": "添加子 issue...",
+ "delete_issue": "删除 issue"
+ },
+ "pickers": {
+ "filter_options_aria": "筛选选项",
+ "no_results": "无结果",
+ "assignee": {
+ "trigger_unassigned": "未分配",
+ "search_placeholder": "分配给...",
+ "members_group": "成员",
+ "agents_group": "智能体"
+ },
+ "due_date": {
+ "trigger_label": "截止日期",
+ "clear_action": "清除日期"
+ },
+ "label": {
+ "trigger_label": "添加标签",
+ "search_placeholder": "查找或创建标签...",
+ "manage_action": "管理标签...",
+ "manage_dialog_title": "管理标签",
+ "create_action": "创建",
+ "create_failed": "创建标签失败"
+ }
+ },
+ "labels_panel": {
+ "intro": "创建和管理标签,用于在工作区内分类 issue。",
+ "new_placeholder": "新标签名称...",
+ "new_aria": "新标签名称",
+ "add_action": "添加",
+ "loading": "加载中...",
+ "empty": "还没有标签。",
+ "name_required": "标签名称必填。",
+ "color_label": "颜色",
+ "pick_color_aria": "选择颜色",
+ "edit_aria": "编辑 {{name}}",
+ "delete_aria": "删除 {{name}}",
+ "save_aria": "保存",
+ "cancel_aria": "取消",
+ "delete_dialog_title": "删除标签?",
+ "delete_dialog_desc_prefix": "标签 ",
+ "delete_dialog_desc_suffix": " 会从全部 issue 上移除,无法撤销。",
+ "delete_dialog_cancel": "取消",
+ "delete_dialog_confirm": "删除",
+ "create_failed": "创建标签失败",
+ "update_failed": "更新标签失败",
+ "delete_failed": "删除标签失败"
+ },
+ "backlog_hint": {
+ "title": "智能体在 backlog 状态下暂停",
+ "description": "这个 issue 处于待规划状态,被分配的智能体会等待。准备启动时把它移到 todo。",
+ "row_backlog_label": "Backlog",
+ "row_backlog_hint": "智能体保持暂停",
+ "row_todo_label": "Todo",
+ "row_todo_hint": "启动智能体",
+ "dont_show_again": "不再提示",
+ "keep_in_backlog": "保持在 Backlog",
+ "move_to_todo": "移到 Todo"
+ }
+}
diff --git a/packages/views/locales/zh-Hans/labels.json b/packages/views/locales/zh-Hans/labels.json
new file mode 100644
index 0000000000..b4ef7c8c85
--- /dev/null
+++ b/packages/views/locales/zh-Hans/labels.json
@@ -0,0 +1,3 @@
+{
+ "remove_label": "移除标签 {{name}}"
+}
diff --git a/packages/views/locales/zh-Hans/layout.json b/packages/views/locales/zh-Hans/layout.json
new file mode 100644
index 0000000000..a893820805
--- /dev/null
+++ b/packages/views/locales/zh-Hans/layout.json
@@ -0,0 +1,39 @@
+{
+ "nav": {
+ "inbox": "收件箱",
+ "my_issues": "我的 Issue",
+ "issues": "Issue",
+ "projects": "项目",
+ "autopilots": "自动化",
+ "agents": "智能体",
+ "runtimes": "运行时",
+ "skills": "Skill",
+ "settings": "设置"
+ },
+ "help": {
+ "trigger": "帮助",
+ "docs": "文档",
+ "changelog": "更新日志",
+ "feedback": "反馈"
+ },
+ "workspace_loader": {
+ "loading_workspace": "正在加载工作区...",
+ "loading_named_prefix": "正在加载"
+ },
+ "sidebar": {
+ "unpin_tooltip": "取消固定",
+ "workspaces_label": "工作区",
+ "create_workspace": "创建工作区",
+ "pending_invitations_label": "待处理的邀请",
+ "invitation_workspace_fallback": "工作区",
+ "invitation_join": "加入",
+ "invitation_decline": "拒绝",
+ "log_out": "退出登录",
+ "new_issue": "新建 issue",
+ "new_issue_shortcut": "C",
+ "pinned_label": "固定",
+ "workspace_group": "工作区",
+ "configure_group": "配置",
+ "unread_overflow": "99+"
+ }
+}
diff --git a/packages/views/locales/zh-Hans/members.json b/packages/views/locales/zh-Hans/members.json
new file mode 100644
index 0000000000..57f0f43b53
--- /dev/null
+++ b/packages/views/locales/zh-Hans/members.json
@@ -0,0 +1,13 @@
+{
+ "role": {
+ "owner": "所有者",
+ "admin": "管理员",
+ "member": "成员"
+ },
+ "card": {
+ "unavailable": "成员信息不可用",
+ "agents_section": "智能体({{count}})",
+ "detail_link": "详情 →",
+ "more_agents_other": "另有 {{count}} 个智能体"
+ }
+}
diff --git a/packages/views/locales/zh-Hans/modals.json b/packages/views/locales/zh-Hans/modals.json
new file mode 100644
index 0000000000..e587ec3f4e
--- /dev/null
+++ b/packages/views/locales/zh-Hans/modals.json
@@ -0,0 +1,136 @@
+{
+ "common": {
+ "back": "返回",
+ "close": "关闭",
+ "cancel": "取消",
+ "expand_tooltip": "展开",
+ "collapse_tooltip": "收起"
+ },
+ "create_workspace": {
+ "title": "创建新工作区",
+ "description": "工作区是团队协作处理项目和 issue 的共享空间。"
+ },
+ "delete_issue": {
+ "title": "删除 issue",
+ "description": "将永久删除该 issue 及其所有评论。此操作不可撤销。",
+ "hint": "工作区任何成员都可以删除 issue。",
+ "cancel": "取消",
+ "confirm": "删除",
+ "deleting": "删除中...",
+ "toast_deleted": "已删除 issue",
+ "toast_delete_failed": "删除 issue 失败"
+ },
+ "feedback": {
+ "title": "反馈",
+ "description": "告诉我们哪些好用、哪些不好用、希望接下来做什么。",
+ "placeholder": "聊聊你的体验、遇到的 bug,或想看到的功能...",
+ "toast_uploading": "请等待上传完成...",
+ "toast_too_long": "内容过长",
+ "toast_sent": "感谢反馈!",
+ "toast_failed": "发送反馈失败",
+ "send": "发送反馈",
+ "sending": "发送中..."
+ },
+ "issue_picker": {
+ "search_placeholder": "搜索 issue...",
+ "searching": "搜索中...",
+ "no_results": "未找到 issue。",
+ "prompt_to_search": "输入关键词搜索 issue"
+ },
+ "set_parent": {
+ "title": "设置父 issue",
+ "description": "搜索一个 issue,将其设为当前 issue 的父级",
+ "toast_failed": "更新 issue 失败",
+ "toast_success": "已将 {{identifier}} 设为父 issue"
+ },
+ "add_child": {
+ "title": "添加子 issue",
+ "description": "搜索一个 issue 添加为子 issue",
+ "toast_failed": "添加子 issue 失败",
+ "toast_success": "已添加 {{identifier}} 为子 issue"
+ },
+ "backlog_hint": {
+ "toast_status_failed": "更新状态失败"
+ },
+ "create_project": {
+ "title": "新建项目",
+ "title_breadcrumb": "新建项目",
+ "icon_tooltip": "选择图标",
+ "title_placeholder": "项目标题",
+ "description_placeholder": "添加描述...",
+ "lead": "负责人",
+ "no_lead": "无负责人",
+ "lead_placeholder": "指派负责人...",
+ "members_group": "成员",
+ "agents_group": "智能体",
+ "no_results": "未找到结果",
+ "submit": "创建项目",
+ "submitting": "创建中...",
+ "toast_created": "已创建项目",
+ "toast_failed": "创建项目失败",
+ "repos_pill": "代码仓库",
+ "repos_pill_count_one": "{{count}} 个仓库",
+ "repos_pill_count_other": "{{count}} 个仓库",
+ "repos_heading": "为此项目关联 GitHub 仓库",
+ "repos_empty": "还没有工作区级别的仓库。可以在下方粘贴 URL 临时关联一个。",
+ "repos_url_placeholder": "https://github.com/owner/repo",
+ "repos_add": "添加",
+ "repos_selected": "已选"
+ },
+ "create_issue": {
+ "sr_manual": "新建 issue",
+ "sr_agent": "快速创建 issue",
+ "manual_breadcrumb": "手动创建",
+ "agent_breadcrumb": "通过智能体创建",
+ "title_placeholder": "issue 标题",
+ "description_placeholder": "添加描述...",
+ "more_options_aria": "更多选项",
+ "submit": "创建 issue",
+ "submitting": "创建中...",
+ "toast_created": "已创建 issue",
+ "view_issue": "查看 issue",
+ "toast_failed": "创建 issue 失败",
+ "toast_link_subissues_all_failed": "关联子 issue 失败",
+ "toast_link_subissues_partial": "{{total}} 个子 issue 中有 {{failed}} 个关联失败",
+ "switch_to_agent": "切换到智能体",
+ "switch_to_agent_tooltip": "切换到通过智能体创建——一句话描述,让它替你建",
+ "switch_to_manual": "切换到手动",
+ "switch_to_manual_tooltip": "切换到手动创建——自己填字段",
+ "create_another": "继续创建",
+ "remove_parent_aria": "移除父级",
+ "remove_subissue_aria": "移除子 issue {{identifier}}",
+ "subissue_of": "{{identifier}} 的子 issue",
+ "subissue_chip": "子 issue:{{identifier}}",
+ "parent_with_id": "父:{{identifier}}",
+ "set_parent": "设置父 issue...",
+ "add_subissue": "添加子 issue...",
+ "remove_parent": "移除父级",
+ "set_parent_picker": {
+ "title": "设置父 issue",
+ "description": "搜索一个 issue 设为父级"
+ },
+ "add_subissue_picker": {
+ "title": "添加子 issue",
+ "description": "搜索一个 issue 设为子级"
+ },
+ "agent": {
+ "created_by": "创建者",
+ "select_agent_aria": "选择智能体",
+ "pick_an_agent": "选一个智能体...",
+ "no_agents": "暂无可用智能体。",
+ "version_missing": "该智能体的 daemon 没有报告 CLI 版本。通过智能体创建需要 multica CLI ≥ {{min}}。请升级 daemon 并重连,或切换到手动创建。",
+ "version_below": "该智能体的 daemon CLI 是 {{current}}——通过智能体创建需要 ≥ {{min}}。请升级 daemon,或切换到手动创建。",
+ "prompt_placeholder": "告诉智能体要做什么,例如:\"让 Bohan 修一下 Web 项目里收件箱加载慢的问题\"",
+ "submit": "创建(⌘↵)",
+ "sending": "发送中...",
+ "uploading": "上传中...",
+ "sent_label": "已发送",
+ "sent_count": "已发送 {{count}}",
+ "version_blocked_tooltip": "daemon CLI 必须 ≥ {{min}}",
+ "toast_sent": "已交给智能体——完成后会在收件箱通知你",
+ "error_agent_unavailable_fallback": "智能体不可用,请换一个。",
+ "error_daemon_version": "该智能体的 daemon CLI({{current}})低于要求的 {{min}}。请升级 daemon 后再使用通过智能体创建。",
+ "error_unknown": "提交失败,请重试。"
+ }
+ }
+}
diff --git a/packages/views/locales/zh-Hans/my-issues.json b/packages/views/locales/zh-Hans/my-issues.json
new file mode 100644
index 0000000000..90c7072ab2
--- /dev/null
+++ b/packages/views/locales/zh-Hans/my-issues.json
@@ -0,0 +1,37 @@
+{
+ "page": {
+ "breadcrumb": "我的 issue",
+ "workspace_fallback": "工作区",
+ "empty_title": "没有分配给你的 issue",
+ "empty_description": "你创建或被分配到的 issue 会显示在这里。"
+ },
+ "header": {
+ "scope": {
+ "assigned_label": "已分配",
+ "assigned_description": "分配给我的 issue",
+ "created_label": "我创建的",
+ "created_description": "我创建的 issue",
+ "agents_label": "我的智能体",
+ "agents_description": "分配给我的智能体的 issue"
+ },
+ "filter_button": "筛选",
+ "filter_status": "状态",
+ "filter_priority": "优先级",
+ "issue_count_other": "{{count}} 个 issue",
+ "reset_filters": "重置所有筛选",
+ "display_settings": "显示设置",
+ "ordering": "排序",
+ "ascending": "升序",
+ "descending": "降序",
+ "card_properties": "卡片属性",
+ "view_board": "看板视图",
+ "view_list": "列表视图",
+ "view_label": "视图",
+ "view_board_short": "看板",
+ "view_list_short": "列表",
+ "sort_manual": "手动"
+ },
+ "errors": {
+ "move_failed": "移动 issue 失败"
+ }
+}
diff --git a/packages/views/locales/zh-Hans/onboarding.json b/packages/views/locales/zh-Hans/onboarding.json
new file mode 100644
index 0000000000..9020d2f335
--- /dev/null
+++ b/packages/views/locales/zh-Hans/onboarding.json
@@ -0,0 +1,302 @@
+{
+ "step_header": {
+ "step_of": "第 {{current}} 步 / 共 {{total}} 步"
+ },
+ "welcome": {
+ "wordmark": "欢迎使用 Multica",
+ "headline_line1": "你的 AI 队友,",
+ "headline_line2": "在",
+ "headline_emphasis": "同一个工作区。",
+ "lede": "像分配给同事一样把任务交给它们——它们会接手、推进状态、完成后留下评论。",
+ "lede_web": "桌面端自带运行时,无需安装。在 web 端继续可以连接你自己的 CLI。",
+ "lede_desktop": "完成本流程后,真实的智能体会回复你创建的第一个 issue。",
+ "download_desktop": "下载桌面端",
+ "continue_on_web": "在 web 端继续",
+ "start_exploring": "开始探索",
+ "skip_existing": "我之前做过了",
+ "illustration_caption": "每个 issue、每条对话、每个决策——团队和智能体共享同一份上下文。",
+ "illustration": {
+ "card1_actor_name": "你",
+ "card1_actor_initial": "N",
+ "card1_body_prefix": " 能不能起草一篇简短的发布文?参考 ",
+ "card1_body_suffix": " 的访谈结论。",
+ "card1_mention_content": "@内容智能体",
+ "card1_mention_research": "@研究智能体",
+ "card2_actor_name": "内容智能体",
+ "card2_body": "好的,正在拉取研究智能体的引述,围绕\"节省的时间\"展开...",
+ "card3_actor_name": "研究智能体",
+ "card3_body": "本周用户访谈整理完成 —— 12 通电话、4 个反复出现的主题、3 段可引用语。",
+ "card3_timestamp": "15 分钟前",
+ "card4_actor_name": "审稿智能体",
+ "card4_body": "已审完周一那版草稿 —— 留了 4 条语气批注。等新一版。",
+ "card5_actor_name": "编码智能体",
+ "card5_body_prefix": "已发布 ",
+ "card5_body_suffix": " 标记的导出功能,PR 里附了预览链接。",
+ "card5_mention_you": "@你",
+ "card5_timestamp": "刚刚"
+ }
+ },
+ "common": {
+ "back": "返回",
+ "continue": "继续"
+ },
+ "questionnaire": {
+ "eyebrow": "开始之前",
+ "headline": "三个问题,更了解你。",
+ "q1_question": "谁会用这个工作区?",
+ "q1_solo": "只有我自己",
+ "q1_team": "我的团队(2–10 人)",
+ "q1_other_placeholder": "例如:我维护的一个小社区",
+ "q2_question": "哪个最贴近你?",
+ "q2_developer": "软件开发者",
+ "q2_product_lead": "产品或项目负责人",
+ "q2_writer": "写作者或内容创作者",
+ "q2_founder": "创始人或运营",
+ "q2_other_placeholder": "例如:研究员、设计师、运营负责人",
+ "q3_question": "你想用 Multica 做什么?",
+ "q3_coding": "写代码、发版",
+ "q3_planning": "规划和管理项目",
+ "q3_writing_research": "研究或写作",
+ "q3_explore": "暂时只是探索",
+ "q3_other_placeholder": "例如:自动化每周报告",
+ "answered_progress": "已回答 {{count}} / 3",
+ "why_eyebrow": "为什么是三问",
+ "why_headline": "让你一上手就能跑。",
+ "what_eyebrow": "你会得到",
+ "unlock_starter_title": "为你定制的入门项目",
+ "unlock_starter_body": "根据你的回答生成的\"上手清单\"。",
+ "unlock_agents_title": "智能体抢跑",
+ "unlock_agents_body": "连接一个运行时,按你的角色挑选模板 —— 顺手把第一个 task 也写好。",
+ "learn_more": "了解智能体怎么工作 →"
+ },
+ "option_card": {
+ "other_label": "其他",
+ "other_aria": "描述其他选项"
+ },
+ "runtime_aside": {
+ "what_eyebrow": "什么是运行时?",
+ "what_prefix": "",
+ "what_term": "运行时",
+ "what_suffix": "是跑在你机器上的一个后台进程。它把工作区连接到 Claude Code、Codex 这类 AI 编码工具,并执行智能体接到的 task。",
+ "good_eyebrow": "需要知道",
+ "swap_title": "随时切换",
+ "swap_body": "每个智能体的运行时只是一个设置。想换就换。",
+ "add_more_title": "之后再加",
+ "add_more_body": "可以在另一台机器上连接第二个运行时给团队用,或每个智能体配一个专用运行时。",
+ "learn_more": "了解运行时 →"
+ },
+ "cli_install": {
+ "copy_aria": "复制",
+ "intro": "守护进程需要本机有一个 AI 编码工具(Claude Code、Codex、Cursor 等)才能执行真实工作。也支持服务器和远程开发机。",
+ "step1_label": "安装 Multica CLI",
+ "step2_label": "启动守护进程"
+ },
+ "starter_content": {
+ "title": "欢迎 —— 要不要添加入门 task?",
+ "description_prefix": "一个 ",
+ "description_term": "上手指南",
+ "description_suffix": " 项目,包含若干简短 task,带你了解 Multica 中的智能体、issue 和上下文是怎么工作的。",
+ "dismiss_action": "从空白工作区开始",
+ "import_action": "添加入门 task",
+ "success_toast": "入门 task 已添加,看一下侧边栏",
+ "import_failed": "导入失败,请重试",
+ "dismiss_failed": "跳过失败,请重试"
+ },
+ "cloud_waitlist": {
+ "intro_main": "云运行时尚未上线。留下邮箱,上线时通过邮件通知你。",
+ "intro_warning": "提示:没有运行时,智能体无法执行 task —— 如果现在跳过,工作区会是只读状态,直到你回来安装一个。",
+ "email_label": "邮箱",
+ "email_placeholder": "[email protected]",
+ "reason_label": "为什么选择云?",
+ "optional": "选填",
+ "reason_placeholder": "例如:希望智能体 24/7 运行,或团队在不同设备协作。",
+ "join": "加入候补",
+ "on_list": "已在候补名单",
+ "success_toast": "已加入候补名单。云运行时上线时会通过邮件通知你。",
+ "failed_toast": "加入候补名单失败"
+ },
+ "first_issue": {
+ "error_title": "出错了",
+ "retry": "重试",
+ "retry_failed": "重试失败",
+ "finishing": "即将完成",
+ "opening": "马上就好 —— 正在打开你的工作区。"
+ },
+ "step_agent": {
+ "eyebrow": "你的第一个智能体",
+ "headline": "和你的第一位队友打个招呼。",
+ "lede_prefix": "根据你的回答,推荐的是 ",
+ "lede_suffix": "。从这四个模板里挑一个最贴你的——每个模板都开箱即用,可以立刻接 issue。之后可以在智能体设置页里再调整指令。",
+ "footer_hint": "一个智能体足够上手了。之后可以从侧边栏添加更多。",
+ "create_action": "创建 {{name}}",
+ "create_failed": "创建智能体失败",
+ "recommended_badge": "推荐",
+ "templates": {
+ "coding": {
+ "label": "编码智能体",
+ "blurb": "写代码、重构、发版。会读你的仓库。",
+ "instructions": "你是产品团队里的编码智能体。负责接编码相关的 issue —— 实现功能、修 bug、写测试、提 PR。开工前先读一下仓库,遵循已有的代码规范,保持 diff 聚焦。验收标准模糊时主动问清楚。"
+ },
+ "planning": {
+ "label": "规划智能体",
+ "blurb": "拆解工作、写规格、维护看板。",
+ "instructions": "你是规划智能体。把零散的想法和 open issue 转化成范围清晰、可立即执行的工作:拆成子任务、写验收标准、提出负责人和先后顺序。清晰优先于速度。缺少上下文时提一个具体问题,不要猜。"
+ },
+ "writing": {
+ "label": "写作智能体",
+ "blurb": "起草、摘要、调研。擅长长文。",
+ "instructions": "你是写作智能体。负责起草文档、总结长文,必要时上网调研主题。输出要做成读者可以直接用的成文 —— 不是大纲。引用资料时注明来源。语气和 issue 中用户的语气保持一致。"
+ },
+ "assistant": {
+ "label": "通用助手",
+ "blurb": "通用型。任务不明确时的默认选择。",
+ "instructions": "你是一名通用型队友。处理各种任务 —— 轻度编码、写作、调研、规划 —— 对范围保持务实。任务模糊时先问一个澄清性问题再开工。默认输出简短有用,而不是详尽冗长。"
+ }
+ },
+ "about_eyebrow": "什么是智能体",
+ "about_headline": "住在你工作区里的 AI 队友。",
+ "about_body": "智能体会出现在每个负责人选择器里,就像任何同事一样 —— 区别是它们可以 24/7 在你指定的运行时上工作。",
+ "ways_eyebrow": "和智能体协作的方式",
+ "way_assign_title": "分配 issue",
+ "way_assign_body": "它会接下任务,并在评论里反馈进展。",
+ "way_mention_title": "在评论中 @提及",
+ "way_mention_body": "把它拉进对话,给个快速反馈。",
+ "way_chat_title": "一对一聊天",
+ "way_chat_body": "无需创建 issue,直接问快速问题。",
+ "way_autopilot_title": "交给自动化",
+ "way_autopilot_body": "按周期跑:每日整理、每周摘要、每月审计。",
+ "add_more_hint": "随时添加更多智能体。一支专长各异的小团队胜过一个万能选手。",
+ "docs_link": "创建第一个智能体 →"
+ },
+ "step_workspace": {
+ "eyebrow_first": "你的第一个工作区",
+ "eyebrow_resume": "继续,或重新开始",
+ "headline_first": "给工作区起个名字。",
+ "headline_resume": "继续 {{name}},或新建一个。",
+ "lede_first": "工作区是 issue、智能体和项目所在的地方。之后可以邀请同事,或再开一个工作区。",
+ "lede_resume": "用已有的工作区继续,或在它旁边再建一个新的 —— 你可以加入任意多个工作区。",
+ "name_label": "工作区名称",
+ "name_placeholder": "Acme Inc、我的实验室、副业...",
+ "url_label": "URL",
+ "slug_placeholder": "acme",
+ "issue_prefix_label": "issue 前缀",
+ "issue_prefix_prefix": "issue 编号会形如 ",
+ "issue_prefix_suffix": "。之后可以在设置里修改。",
+ "create_new_title": "创建一个新工作区",
+ "create_new_subtitle": "重新开始 —— 给工作的另一面留一个独立空间。",
+ "hint_opening": "正在打开 {{name}}。",
+ "hint_creating": "正在创建 {{name}}。",
+ "hint_creating_pending": "正在创建 {{name}}...",
+ "hint_creating_fallback": "你的工作区",
+ "hint_name_first": "先给工作区起个名字才能创建。",
+ "hint_pick": "选择你的工作区或开一个新的。",
+ "cta_open": "打开 {{name}}",
+ "cta_create_named": "创建 {{name}}",
+ "cta_create_workspace": "创建工作区",
+ "cta_creating": "创建中...",
+ "slug_conflict_toast": "请换一个工作区 URL",
+ "create_failed_toast": "创建工作区失败",
+ "side_create_eyebrow": "工作区里有什么",
+ "side_existing_eyebrow": "你的工作区",
+ "side_things_eyebrow": "你会在这里做什么",
+ "side_next_eyebrow": "接下来",
+ "side_preview_name": "你的工作区",
+ "side_preview_slug": "workspace",
+ "perk_assign": "像分配给同事一样把 issue 分配给智能体",
+ "perk_chat": "无需创建 issue,直接和任意智能体对话",
+ "perk_invite": "邀请同事 —— 他们只会看到这个工作区",
+ "perk_switch": "随时从左上角切换到其他工作区",
+ "next_runtime": "连接一个运行时,给智能体一个跑的地方",
+ "next_agent": "创建符合你角色的第一个智能体",
+ "next_starter": "看它接下入门 task 并回复",
+ "preview": {
+ "inbox_label": "收件箱",
+ "inbox_meta": "你的通知",
+ "issues_label": "issue",
+ "issues_meta": "共享任务面板",
+ "agents_label": "智能体",
+ "agents_meta": "你的 AI 队友",
+ "projects_label": "项目",
+ "projects_meta": "把相关 issue 分组",
+ "autopilot_label": "自动化",
+ "autopilot_meta": "定时自动化",
+ "runtimes_label": "运行时",
+ "runtimes_meta": "智能体跑的地方",
+ "skills_label": "skill",
+ "skills_meta": "可复用的剧本",
+ "more_label": "更多",
+ "more_meta": "and more"
+ }
+ },
+ "step_runtime": {
+ "scanning_headline": "正在寻找你的工具...",
+ "scanning_lede_prefix": "Multica 驱动本地的 AI 编码工具,比如 ",
+ "scanning_lede_suffix": " 等。等待你机器上的反馈中。",
+ "found_headline": "找到了你的运行时。",
+ "found_lede": "扫描到你机器上已经设置好的 AI 编码工具。挑一个给你的第一个智能体。",
+ "runtime_count_other": "{{count}} 个运行时",
+ "status_all_online": "全部在线",
+ "status_none_online": "全部离线",
+ "status_n_online": "{{count}} 个在线",
+ "online_label": "在线",
+ "offline_label": "离线",
+ "empty_headline": "未检测到支持的工具。",
+ "empty_lede_prefix": "Multica 驱动本地的 AI 编码工具,比如 ",
+ "empty_lede_suffix": " 等 —— 这台机器上没找到。装一个再回来,或在下面挑一条路。",
+ "empty_skip_title": "暂时跳过",
+ "empty_skip_subtitle": "进入工作区(只读模式)。没有运行时连接前,智能体无法执行 task —— 但你仍可以浏览、规划、邀请同事。",
+ "empty_skip_action": "跳过",
+ "empty_waitlist_title": "加入云运行时候补",
+ "empty_waitlist_subtitle": "由 Multica 托管运行时 —— 无需本地安装,无需配置。尚未上线,点击留下邮箱。",
+ "empty_waitlist_action": "加入候补",
+ "empty_waitlist_done": "已在候补",
+ "dialog_title": "加入云运行时候补名单",
+ "dialog_description": "云运行时尚未上线。留下邮箱,上线时通过邮件通知你。",
+ "dialog_close": "关闭",
+ "dialog_cancel": "取消",
+ "skip": "暂时跳过",
+ "hint_selected": "已选择:{{name}}",
+ "hint_pick": "在上方选一个运行时继续。",
+ "hint_waiting": "等待第一个结果...",
+ "hint_waitlist_done": "已在候补名单 —— 跳过即可继续探索。",
+ "hint_skip_or_waitlist": "跳过进入工作区,或在上方加入云候补。"
+ },
+ "step_platform": {
+ "eyebrow": "第 3 步 · 运行时",
+ "headline": "连接一个运行时。",
+ "lede": "运行时是真正执行智能体工作的地方。挑一种你想用的方式。",
+ "hint_default": "在上方挑一条路 —— 或跳过,之后再配置运行时。",
+ "hint_downloaded": "在下载页完成安装,然后回到此标签页。",
+ "hint_waitlist": "已在候补名单 —— 选择\"跳过\"继续探索。",
+ "download_title": "下载桌面端",
+ "download_title_after": "已在下载页继续...",
+ "download_subtitle": "内置守护进程,零配置。下一页选你的平台。",
+ "download_subtitle_after": "已在新标签页打开。在那里选安装包,然后在桌面端完成设置。",
+ "download_button": "下载",
+ "cli_title": "安装 CLI",
+ "cli_subtitle": "适合服务器、远程开发机和无头环境。需要终端。",
+ "cli_action": "查看步骤",
+ "cloud_title": "云运行时",
+ "cloud_subtitle": "由 Multica 托管运行时。尚未上线 —— 加入候补。",
+ "cloud_action": "加入候补",
+ "cloud_action_done": "已在名单",
+ "cli_dialog_title": "安装 CLI",
+ "cli_dialog_description": "和桌面端相同的守护进程,通过终端安装。当桌面端不合适时使用 —— 服务器、远程开发机或无头环境。",
+ "cli_dialog_pick_hint": "在上方选择一个运行时。",
+ "cli_dialog_connect": "连接并继续",
+ "runtimes_connected_other": "已连接 {{count}} 个运行时",
+ "live_listening": "实时 · 正在监听你的守护进程",
+ "stage_normal_prefix": "运行上面的命令。当 ",
+ "stage_normal_suffix": " 完成浏览器登录、守护进程启动后,你的运行时会自动出现在这里(通常 10–30 秒)。",
+ "stage_midway_prefix": "仍在监听。请确保完成了 ",
+ "stage_midway_suffix": " 打开的浏览器标签页 —— 必须批准登录才能启动守护进程。",
+ "stage_slow_prefix": "比平时慢一些。请检查运行 ",
+ "stage_slow_suffix": " 的终端是否有错误。",
+ "stage_stalled_prefix": "还没有任何信号传来。如果你不太习惯终端,",
+ "stage_stalled_term": "桌面端",
+ "stage_stalled_suffix": " 更顺手 —— 它内置守护进程。关闭这个对话框选择桌面端,或点跳过继续。"
+ },
+ "errors": {
+ "skip_failed": "完成上手引导失败"
+ }
+}
diff --git a/packages/views/locales/zh-Hans/projects.json b/packages/views/locales/zh-Hans/projects.json
new file mode 100644
index 0000000000..4a15d4e88e
--- /dev/null
+++ b/packages/views/locales/zh-Hans/projects.json
@@ -0,0 +1,92 @@
+{
+ "page": {
+ "title": "项目",
+ "new_project": "新建项目",
+ "empty": "还没有项目",
+ "create_first": "创建第一个项目"
+ },
+ "table": {
+ "name": "名称",
+ "priority": "优先级",
+ "status": "状态",
+ "progress": "进度",
+ "lead": "负责人",
+ "created": "创建时间"
+ },
+ "status": {
+ "planned": "计划中",
+ "in_progress": "进行中",
+ "paused": "已暂停",
+ "completed": "已完成",
+ "cancelled": "已取消"
+ },
+ "priority": {
+ "urgent": "紧急",
+ "high": "高",
+ "medium": "中",
+ "low": "低",
+ "none": "无优先级"
+ },
+ "lead": {
+ "no_lead": "无负责人",
+ "assign_placeholder": "指派负责人...",
+ "members_group": "成员",
+ "agents_group": "智能体",
+ "no_results": "未找到结果"
+ },
+ "relative_date": {
+ "today": "今天",
+ "one_day_ago": "1 天前",
+ "days_ago": "{{count}} 天前",
+ "months_ago": "{{count}} 个月前"
+ },
+ "detail": {
+ "not_found": "未找到该项目",
+ "breadcrumb_fallback": "项目",
+ "title_placeholder": "项目标题",
+ "icon_tooltip": "更换图标",
+ "pin_tooltip": "固定到侧边栏",
+ "unpin_tooltip": "从侧边栏取消固定",
+ "sidebar_tooltip": "切换侧边栏",
+ "copy_link": "复制链接",
+ "delete_action": "删除项目",
+ "section_properties": "属性",
+ "section_progress": "进度",
+ "section_description": "描述",
+ "description_placeholder": "添加描述...",
+ "empty_issues_title": "还没有关联的 issue",
+ "empty_issues_hint": "新建一个 issue,或把已有的 issue 关联到这个项目。",
+ "empty_issues_new_button": "新建 issue",
+ "toast_link_copied": "已复制链接",
+ "toast_project_deleted": "已删除项目",
+ "toast_move_issue_failed": "移动 issue 失败"
+ },
+ "resources": {
+ "section_header": "资源",
+ "empty": "还没有关联资源。",
+ "add_button": "添加资源",
+ "popover_title": "关联 GitHub 仓库",
+ "attached_badge": "已关联",
+ "remove_tooltip": "移除",
+ "url_placeholder": "https://github.com/owner/repo",
+ "url_submit": "添加",
+ "toast_attached": "已关联仓库",
+ "toast_attach_failed": "关联失败",
+ "toast_removed": "已移除资源",
+ "toast_remove_failed": "移除资源失败"
+ },
+ "delete_dialog": {
+ "title": "删除项目",
+ "description": "将删除这个项目。issue 不会被删除,只会从项目中解除关联。",
+ "confirm": "删除",
+ "cancel": "取消"
+ },
+ "picker": {
+ "no_project": "无项目",
+ "remove": "从项目移除",
+ "empty": "还没有项目"
+ },
+ "chip": {
+ "fallback_label": "项目"
+ }
+}
diff --git a/packages/views/locales/zh-Hans/runtimes.json b/packages/views/locales/zh-Hans/runtimes.json
new file mode 100644
index 0000000000..f053ecc999
--- /dev/null
+++ b/packages/views/locales/zh-Hans/runtimes.json
@@ -0,0 +1,190 @@
+{
+ "page": {
+ "title": "运行时",
+ "tagline": "为智能体跑 CLI 会话的机器和云端 worker。",
+ "learn_more": "了解更多 →",
+ "connect_remote": "连接远程机器",
+ "search_placeholder": "搜索运行时...",
+ "scope_mine": "我的",
+ "scope_all": "全部",
+ "live": "实时",
+ "live_tooltip": "实时更新 · 离线检测 75 秒以内",
+ "filter_all": "全部",
+ "filter_all_description": "当前视图下的所有运行时",
+ "empty": {
+ "title": "还没有运行时",
+ "hint": "桌面端会自动扫描本地机器。对于 AWS EC2 或其他远程机器,可使用连接向导。"
+ },
+ "no_matches": {
+ "title": "无匹配",
+ "with_query": "没有运行时匹配 \"{{query}}\"{{filterSuffix}}。",
+ "with_query_filter_suffix": "(在当前筛选下)",
+ "no_query": "当前筛选下没有匹配的运行时。",
+ "try_widening": "试试放宽筛选或清除条件。"
+ },
+ "bootstrapping": {
+ "title": "正在启动本地运行时...",
+ "hint": "通常需要几秒钟。守护进程正在向工作区注册。"
+ }
+ },
+ "health": {
+ "online": {
+ "label": "在线",
+ "description": "最近 45 秒内收到心跳。可以派发 task。"
+ },
+ "recently_lost": {
+ "label": "最近失联",
+ "description": "失联不到 5 分钟——通常是短暂的网络抖动。"
+ },
+ "offline": {
+ "label": "离线",
+ "description": "5 分钟以上没有心跳。请重启守护进程或排查主机。"
+ },
+ "about_to_gc": {
+ "label": "即将清理",
+ "description": "离线 6 天以上。如不重连,将在 7 天时自动删除。"
+ }
+ },
+ "detail": {
+ "all_runtimes": "全部运行时",
+ "read_only": "只读",
+ "delete_aria": "删除运行时",
+ "delete_tooltip": "删除运行时",
+ "delete_button": "删除运行时",
+ "last_seen": "最后活跃 {{when}}",
+ "fact_owner": "所有者",
+ "fact_device": "设备",
+ "fact_runtime": "运行时",
+ "technical_details": "技术详情",
+ "fact_daemon_cli": "守护进程 CLI",
+ "fact_daemon_id": "守护进程 ID",
+ "serving_title": "服务中",
+ "serving_count_other": "{{count}} 个智能体",
+ "no_agents": "还没有智能体绑定到这个运行时。",
+ "diagnostics_title": "诊断",
+ "diagnostics_cli": "CLI",
+ "delete_dialog": {
+ "title": "删除运行时",
+ "description": "确定要删除\"{{name}}\"吗?此操作不可撤销。",
+ "cancel": "取消",
+ "confirm": "删除",
+ "deleting": "删除中..."
+ },
+ "toast_deleted": "已删除运行时",
+ "toast_delete_failed": "删除运行时失败",
+ "running_chip_other": "· {{count}} 个进行中",
+ "queued_chip_other": "· {{count}} 个排队中"
+ },
+ "detail_page": {
+ "not_found_title": "未找到运行时",
+ "not_found_hint": "它可能已被删除,或你没有访问权限。"
+ },
+ "running_other": "{{count}} 个运行中",
+ "queued_other": "{{count}} 个排队中",
+ "connect": {
+ "title": "连接远程机器",
+ "description": "在远程机器(例如 AWS EC2)上运行这些命令,安装 Multica CLI 并注册为运行时。",
+ "step1": "1. 安装 CLI",
+ "step2": "2. 配置",
+ "step3": "3. 用个人访问令牌登录",
+ "step3_hint_prefix": "可在 ",
+ "step3_hint_destination": "设置 → Tokens",
+ "step3_hint_suffix": " 中创建。",
+ "step4": "4. 启动守护进程",
+ "security_label": "安全提示: ",
+ "security_body": "使用 EC2 IAM 角色或最小权限凭证。切勿把 root 凭证写入智能体的 ",
+ "security_body_suffix": "。守护进程只使用出站连接 —— 无需开放入站端口。",
+ "troubleshooting": "故障排查",
+ "trouble_check_status": "检查状态: ",
+ "trouble_view_logs": "查看日志: ",
+ "trouble_verify_provider": "验证 provider: ",
+ "trouble_remote_note_prefix": "桌面端只会自动扫描本地机器。远程机器需要单独运行 ",
+ "trouble_remote_note_suffix": "。",
+ "cancel": "取消",
+ "started_daemon": "我已启动守护进程",
+ "waiting_title": "正在等待运行时...",
+ "waiting_description": "正在监听远程守护进程的注册。此页面会自动更新,无需刷新。",
+ "waiting_hint_prefix": "在远程机器上运行 ",
+ "waiting_hint_suffix": " 来确认它在运行。",
+ "back": "返回",
+ "success_title": "运行时已连接!",
+ "success_description": "你的远程机器已注册为运行时。现在可以创建一个智能体,把 task 派发到它上。",
+ "view_runtime": "查看运行时",
+ "create_agent": "创建智能体"
+ },
+ "update": {
+ "cli_version_label": "CLI 版本:",
+ "version_unknown": "未知",
+ "managed_by_desktop": "由桌面端管理",
+ "managed_by_desktop_title": "CLI 二进制由 Multica 桌面端管理 —— 升级桌面端即可升级 CLI。",
+ "latest": "最新",
+ "available": "可用",
+ "action": "更新",
+ "retry": "重试",
+ "unknown_error": "未知错误",
+ "initiate_failed": "启动更新失败",
+ "status": {
+ "pending": "等待守护进程...",
+ "running": "更新中...",
+ "completed": "更新完成。守护进程正在重启...",
+ "failed": "更新失败",
+ "timeout": "超时"
+ }
+ },
+ "charts": {
+ "heatmap_less": "少",
+ "heatmap_more": "多"
+ },
+ "list": {
+ "col_runtime": "运行时",
+ "col_health": "健康度",
+ "col_owner": "所有者",
+ "col_agents": "智能体",
+ "col_workload": "工作负载",
+ "col_cost": "费用 · 7 天",
+ "col_cli": "CLI",
+ "cost_delta_flat": "持平",
+ "cli_managed_badge": "桌面端",
+ "cli_update_available_aria": "有可用更新",
+ "cli_update_available_tooltip": "有可用更新:{{version}}",
+ "row_actions_aria": "行操作",
+ "delete_action": "删除",
+ "delete_permission_hint": "只有运行时所有者和工作区管理员可以删除这个运行时",
+ "delete_admin_hint": "只有运行时所有者和工作区管理员可以删除运行时。"
+ },
+ "usage": {
+ "period_label": "时间范围",
+ "kpi_cost_label": "费用 · {{days}} 天",
+ "kpi_cost_delta": "{{sign}}{{pct}}% 对比上期",
+ "kpi_cache_label": "缓存节省 · {{days}} 天",
+ "kpi_cache_hint": "命中率 {{pct}}% · 读取 {{reads}}",
+ "kpi_tokens_label": "Token · {{days}} 天",
+ "kpi_tokens_hint": "输入 {{input}} · 输出 {{output}}",
+ "when_title": "这个运行时在何时消耗",
+ "when_tab_daily": "按天",
+ "when_tab_hourly": "按小时",
+ "when_tab_heatmap": "热力图",
+ "heatmap_caption": "最近 26 周 · 每日 $ 强度(此处忽略上方时间范围)",
+ "legend_input": "输入",
+ "legend_output": "输出",
+ "legend_cache_write": "缓存写入",
+ "empty_no_usage": "此期间无使用记录。",
+ "empty_pricing_missing": "记录到 token,但缺少这些模型的价格:",
+ "empty_pricing_hint": "请在 packages/views/runtimes/utils.ts 的 MODEL_PRICING 中补充",
+ "empty_zero_cost": "记录到 token,但费用计算结果为 $0。",
+ "cost_by_title_agent": "按智能体分摊",
+ "cost_by_title_model": "按模型分摊",
+ "cost_by_tab_agent": "按智能体",
+ "cost_by_tab_model": "按模型",
+ "cost_by_caption_agent_other": "{{count}} 个智能体使用此运行时",
+ "cost_by_caption_model_other": "{{count}} 个模型已使用",
+ "daily_breakdown_toggle": "每日明细表",
+ "table_date": "日期",
+ "table_model": "模型",
+ "table_input": "输入",
+ "table_output": "输出",
+ "table_cache_r": "缓存读",
+ "table_cache_w": "缓存写",
+ "no_data": "还没有使用数据"
+ }
+}
diff --git a/packages/views/locales/zh-Hans/search.json b/packages/views/locales/zh-Hans/search.json
new file mode 100644
index 0000000000..d4a0113681
--- /dev/null
+++ b/packages/views/locales/zh-Hans/search.json
@@ -0,0 +1,44 @@
+{
+ "title": "搜索",
+ "description": "搜索页面、issue 和项目",
+ "placeholder": "输入命令或关键词搜索...",
+ "groups": {
+ "pages": "页面",
+ "commands": "命令",
+ "switch_workspace": "切换工作区",
+ "projects": "项目",
+ "issues": "issue",
+ "recent": "最近"
+ },
+ "pages": {
+ "inbox": "收件箱",
+ "my_issues": "我的 issue",
+ "issues": "issue",
+ "projects": "项目",
+ "agents": "智能体",
+ "runtimes": "运行时",
+ "skills": "skill",
+ "settings": "设置"
+ },
+ "commands": {
+ "current_theme_aria": "当前主题",
+ "new_issue": "新建 issue",
+ "new_project": "新建项目",
+ "copy_issue_link": "复制 issue 链接",
+ "copy_identifier": "复制标识符 ({{identifier}})",
+ "switch_to_light": "切换到浅色主题",
+ "switch_to_dark": "切换到深色主题",
+ "use_system_theme": "跟随系统主题"
+ },
+ "toast": {
+ "link_copied": "已复制链接",
+ "copied_identifier": "已复制 {{identifier}}"
+ },
+ "empty": {
+ "no_results": "未找到结果。",
+ "type_to_search": "输入关键词搜索 issue 和项目"
+ },
+ "trigger": {
+ "label": "搜索..."
+ }
+}
diff --git a/packages/views/locales/zh-Hans/settings.json b/packages/views/locales/zh-Hans/settings.json
new file mode 100644
index 0000000000..c74fc98fa5
--- /dev/null
+++ b/packages/views/locales/zh-Hans/settings.json
@@ -0,0 +1,206 @@
+{
+ "appearance": {
+ "theme": {
+ "title": "主题",
+ "light": "浅色",
+ "dark": "深色",
+ "system": "跟随系统"
+ },
+ "language": {
+ "title": "语言",
+ "english": "English",
+ "chinese": "中文",
+ "sync_failed": "语言已在本设备保存,但同步到账号失败。其他设备可能仍显示旧语言。"
+ }
+ },
+ "page": {
+ "title": "设置",
+ "my_account": "我的账号",
+ "workspace_fallback": "工作区",
+ "tabs": {
+ "profile": "个人资料",
+ "appearance": "外观",
+ "notifications": "通知",
+ "tokens": "API Token",
+ "general": "通用",
+ "repositories": "代码仓库",
+ "labs": "实验室",
+ "members": "成员"
+ }
+ },
+ "account": {
+ "section_profile": "个人资料",
+ "click_avatar_hint": "点击上传头像",
+ "name_label": "姓名",
+ "save": "更新资料",
+ "saving": "更新中...",
+ "toast_avatar_updated": "头像已更新",
+ "toast_avatar_failed": "上传头像失败",
+ "toast_profile_updated": "资料已更新",
+ "toast_profile_failed": "更新资料失败"
+ },
+ "notifications": {
+ "title": "收件箱通知",
+ "description": "控制哪些事件会产生收件箱通知。被静默的事件类型仍然存在——可以直接到 issue 页面查看。",
+ "toast_failed": "更新通知设置失败",
+ "groups": {
+ "assignments": {
+ "label": "分配",
+ "description": "你被分配或取消分配某个 issue 时"
+ },
+ "status_changes": {
+ "label": "状态变更",
+ "description": "你订阅的 issue 状态变化时(例如 todo、in progress、done)"
+ },
+ "comments": {
+ "label": "评论与提及",
+ "description": "你订阅的 issue 有新评论,或有人 @ 你时"
+ },
+ "updates": {
+ "label": "优先级与截止日期",
+ "description": "你订阅的 issue 优先级或截止日期变更时"
+ },
+ "agent_activity": {
+ "label": "智能体活动",
+ "description": "智能体 task 完成或失败时"
+ }
+ }
+ },
+ "tokens": {
+ "title": "API Token",
+ "description": "个人访问 token 让 CLI 和外部集成可以代表你的账号进行身份验证。",
+ "name_placeholder": "Token 名称(例如:我的 CLI)",
+ "expiry": {
+ "30": "30 天",
+ "90": "90 天",
+ "365": "1 年",
+ "never": "永不过期"
+ },
+ "create": "创建",
+ "creating": "创建中...",
+ "toast_load_failed": "加载 token 失败",
+ "toast_create_failed": "创建 token 失败",
+ "toast_revoked": "已吊销 token",
+ "toast_revoke_failed": "吊销 token 失败",
+ "metadata_prefix": "{{prefix}}... · 创建于 {{created}} · {{lastUsed}}",
+ "last_used_with_date": "最后使用 {{date}}",
+ "last_used_never": "未使用",
+ "expires_with_date": " · {{date}} 过期",
+ "revoke_aria": "吊销 {{name}}",
+ "revoke_tooltip": "吊销",
+ "revoke_dialog": {
+ "title": "吊销 token",
+ "description": "该 token 将被永久吊销且不再可用。此操作不可撤销。",
+ "cancel": "取消",
+ "confirm": "吊销"
+ },
+ "created_dialog": {
+ "title": "Token 已创建",
+ "description": "立即复制你的个人访问 token——它不会再次显示。",
+ "copy_tooltip": "复制 token",
+ "done": "完成"
+ }
+ },
+ "workspace": {
+ "section_general": "通用",
+ "name_label": "名称",
+ "description_label": "描述",
+ "description_placeholder": "这个工作区主要做什么?",
+ "context_label": "上下文",
+ "context_placeholder": "供工作区中的智能体参考的背景信息和上下文",
+ "slug_label": "Slug",
+ "save": "保存",
+ "saving": "保存中...",
+ "manage_hint": "只有管理员和所有者可以修改工作区设置。",
+ "toast_saved": "已保存工作区设置",
+ "toast_save_failed": "保存工作区设置失败",
+ "danger_zone": "危险操作",
+ "leave_title": "离开工作区",
+ "leave_sole_owner": "你是唯一的所有者。请先把另一位成员升级为所有者,或者删除工作区。",
+ "leave_sole_member": "你是唯一的成员。请删除工作区来离开。",
+ "leave_default": "从该工作区中移除你自己。",
+ "leave_button": "离开工作区",
+ "leaving": "离开中...",
+ "leave_confirm_title": "离开工作区",
+ "leave_confirm_description": "确认离开 {{name}}?再次加入需要重新被邀请。",
+ "toast_leave_failed": "离开工作区失败",
+ "delete_title": "删除工作区",
+ "delete_description": "永久删除该工作区及其所有数据。",
+ "delete_button": "删除工作区",
+ "deleting": "删除中...",
+ "toast_delete_failed": "删除工作区失败",
+ "confirm_cancel": "取消",
+ "confirm_action": "确认"
+ },
+ "delete_workspace_dialog": {
+ "title": "删除工作区",
+ "description": "此操作不可撤销。所有 issue、智能体和数据都将被永久删除。",
+ "type_to_confirm_prefix": "确认请输入",
+ "type_to_confirm_suffix": "。",
+ "cancel": "取消",
+ "confirm": "删除工作区",
+ "deleting": "删除中..."
+ },
+ "labs": {
+ "section_git": "Git",
+ "co_authored_by_label": "Co-authored-by trailer",
+ "co_authored_by_description_prefix": "自动给智能体的 commit 加上",
+ "co_authored_by_description_suffix": "。",
+ "toast_failed": "更新设置失败"
+ },
+ "repositories": {
+ "section_title": "代码仓库",
+ "description": "与该工作区关联的 Git 仓库。智能体会从这里 clone 代码并完成工作。",
+ "url_placeholder": "https://git.example.com/org/repo.git",
+ "description_placeholder": "描述(例如:Go 后端 + Next.js 前端)",
+ "add": "添加仓库",
+ "save": "保存",
+ "saving": "保存中...",
+ "manage_hint": "只有管理员和所有者可以管理代码仓库。",
+ "toast_saved": "已保存代码仓库",
+ "toast_save_failed": "保存代码仓库失败"
+ },
+ "members": {
+ "section_title": "成员({{count}})",
+ "invite_title": "邀请成员",
+ "invite_email_placeholder": "[email protected]",
+ "invite_button": "邀请",
+ "inviting": "邀请中...",
+ "toast_invitation_sent": "已发送邀请",
+ "toast_invitation_failed": "发送邀请失败",
+ "no_members": "未找到成员。",
+ "pending_title": "待处理邀请({{count}})",
+ "pending_status": "待处理",
+ "revoke_invitation_tooltip": "撤销邀请",
+ "revoke_invitation_title": "撤销邀请",
+ "revoke_invitation_description": "撤销发给 {{email}} 的邀请?对方将不能再加入该工作区。",
+ "toast_invitation_revoked": "已撤销邀请",
+ "toast_invitation_revoke_failed": "撤销邀请失败",
+ "toast_role_updated": "已更新角色",
+ "toast_role_failed": "更新成员失败",
+ "toast_member_removed": "已移除成员",
+ "toast_member_remove_failed": "移除成员失败",
+ "remove_member_title": "移除 {{name}}",
+ "remove_member_description": "从 {{workspace}} 中移除 {{name}}?该成员将失去对该工作区的访问权限。",
+ "confirm_cancel": "取消",
+ "confirm_action": "确认",
+ "change_role": "更改角色",
+ "remove_action": "从工作区移除",
+ "cannot_demote_last_owner_title": "请先把另一位成员升级为所有者——工作区必须至少保留一位所有者。",
+ "cannot_demote_last_owner": "不能降级最后一位所有者",
+ "roles": {
+ "owner": {
+ "label": "所有者",
+ "description": "完全访问权限,可管理所有设置"
+ },
+ "admin": {
+ "label": "管理员",
+ "description": "管理成员与设置"
+ },
+ "member": {
+ "label": "成员",
+ "description": "创建并处理 issue"
+ }
+ }
+ }
+}
diff --git a/packages/views/locales/zh-Hans/skills.json b/packages/views/locales/zh-Hans/skills.json
new file mode 100644
index 0000000000..ede9b461c3
--- /dev/null
+++ b/packages/views/locales/zh-Hans/skills.json
@@ -0,0 +1,245 @@
+{
+ "page": {
+ "title": "skill",
+ "tagline": "工作区里任何智能体都能使用的指令。",
+ "learn_more": "了解更多 →",
+ "new_skill": "新建 skill",
+ "search_placeholder": "搜索 skill...",
+ "scopes": {
+ "all": {
+ "label": "全部",
+ "description": "工作区里所有 skill"
+ },
+ "used": {
+ "label": "使用中",
+ "description": "至少分配给一个智能体的 skill"
+ },
+ "unused": {
+ "label": "未使用",
+ "description": "未分配给任何智能体的 skill"
+ },
+ "mine": {
+ "label": "我创建的",
+ "description": "你创建的 skill"
+ }
+ },
+ "empty": {
+ "title": "还没有 skill",
+ "description": "创建第一个 skill、从 URL 导入、或从已连接的运行时复制——之后工作区里每个智能体都能用它。"
+ },
+ "no_matches": {
+ "title": "无匹配",
+ "with_query": "没有 skill 匹配 \"{{query}}\"{{filterSuffix}}。",
+ "with_query_filter_suffix": "(在当前筛选下)",
+ "filter_only": "当前筛选下没有匹配的 skill。",
+ "try_different": " 换个关键词试试。"
+ },
+ "intro_banner": {
+ "title": "在工作区内共享。",
+ "body": "任何成员都可以创建 skill、从 URL 导入、或从本地运行时复制——之后所有智能体都能用它。",
+ "highlight": "本地运行时里的 skill 在你复制过来之前是私有的。"
+ },
+ "list_error": {
+ "title": "无法加载 skill",
+ "fallback": "拉取 skill 列表时出错。",
+ "retry": "重试"
+ },
+ "supporting_data_warning": "部分工作区数据加载失败。创建者归属、运行时名称、编辑权限可能显示不完整。"
+ },
+ "table": {
+ "name": "名称",
+ "used_by": "被谁使用",
+ "source": "来源 · 添加者",
+ "updated": "更新时间",
+ "no_description": "无描述",
+ "lock_tooltip": "只读——只有创建者或管理员能编辑",
+ "unused": "— 未使用",
+ "by_creator": "由 {{name}} 创建",
+ "source_manual": "手动创建",
+ "source_runtime_named": "来自 {{name}}",
+ "source_runtime_provider": "来自 {{provider}} 运行时",
+ "source_runtime_unknown": "来自某个运行时",
+ "source_clawhub": "来自 ClawHub",
+ "source_skills_sh": "来自 Skills.sh"
+ },
+ "detail": {
+ "all_skills": "全部 skill",
+ "read_only": "只读",
+ "delete_aria": "删除 skill",
+ "delete_tooltip": "删除 skill",
+ "supporting_data_warning": "部分工作区数据加载失败。创建者归属、运行时名称、编辑权限可能要等下次刷新才完整。",
+ "files_label": "文件 · {{count}}",
+ "add_file_aria": "添加文件",
+ "add_file_tooltip": "添加文件",
+ "delete_file": "删除文件",
+ "name_aria": "skill 名称",
+ "name_placeholder": "skill-name",
+ "description_label": "描述",
+ "description_placeholder": "用一句话描述智能体什么时候应该使用这个 skill...",
+ "subline": {
+ "origin_runtime_named": "本地运行时 · {{name}}",
+ "origin_runtime_provider": "本地运行时 · {{provider}}",
+ "origin_runtime_unknown": "本地运行时",
+ "origin_clawhub": "导入自 · ClawHub",
+ "origin_skills_sh": "导入自 · Skills.sh",
+ "origin_workspace": "工作区",
+ "updated_label": "{{when}}更新",
+ "by_creator": "由 {{name}}"
+ },
+ "conflict_banner": {
+ "title": "其他人更新了这个 skill",
+ "body": "你的修改已保留。Discard 来拉取他们的版本,或 Save 覆盖。"
+ },
+ "save_bar": {
+ "unsaved": "未保存的修改——保存会覆盖当前的 skill",
+ "discard": "丢弃",
+ "save": "保存修改",
+ "saving": "保存中..."
+ },
+ "sidebar": {
+ "metadata": "元数据",
+ "created": "创建于",
+ "updated": "更新于",
+ "created_by": "创建者",
+ "files": "文件",
+ "id": "ID",
+ "origin": "来源",
+ "used_by_one": "被 {{count}} 个智能体使用",
+ "used_by_other": "被 {{count}} 个智能体使用",
+ "permissions": "权限",
+ "permissions_owner": "你可以编辑和删除这个 skill。修改在智能体下次运行时生效。",
+ "permissions_locked_creator": "只有创建者({{name}})或工作区管理员能编辑这个 skill。",
+ "permissions_locked": "只有创建者或工作区管理员能编辑这个 skill。",
+ "used_by_empty": "还未分配给任何智能体。打开某个智能体的 Skills 标签页进行分配。"
+ },
+ "origin_card": {
+ "imported_runtime": "从本地运行时导入",
+ "imported_clawhub": "从 ClawHub 导入",
+ "imported_skills_sh": "从 Skills.sh 导入",
+ "provider": "provider · {{provider}}"
+ },
+ "not_found": {
+ "title": "未找到该 skill",
+ "fallback": "这个 skill 可能已被删除,或你没有访问权限。",
+ "back": "返回 Skills"
+ },
+ "toast_saved": "已保存 skill",
+ "toast_save_failed": "保存 skill 失败",
+ "toast_deleted": "已删除 skill",
+ "toast_delete_failed": "删除 skill 失败",
+ "delete_dialog": {
+ "title": "删除这个 skill?",
+ "description_with_agents_one": "将永久删除\"{{name}}\",并从当前正在使用它的 {{count}} 个智能体上移除。",
+ "description_with_agents_other": "将永久删除\"{{name}}\",并从当前正在使用它的 {{count}} 个智能体上移除。",
+ "description_no_agents": "将永久删除\"{{name}}\",并从所有智能体上移除。",
+ "warning": "此操作不可撤销。",
+ "cancel": "取消",
+ "confirm": "永久删除",
+ "deleting": "删除中..."
+ },
+ "add_file": {
+ "placeholder": "templates/review.md",
+ "add": "添加",
+ "cancel": "取消",
+ "errors": {
+ "empty": "路径不能为空。",
+ "absolute": "不允许绝对路径。",
+ "double_dot": "路径不能包含 \"..\"。",
+ "reserved": "SKILL.md 已为主文件保留。",
+ "exists": "该路径已存在文件。"
+ }
+ }
+ },
+ "create": {
+ "back": "返回",
+ "back_aria": "返回方式选择",
+ "close": "关闭",
+ "close_aria": "关闭",
+ "method": {
+ "chooser": {
+ "title": "新建 skill",
+ "desc": "选择一种方式把 skill 添加到工作区。"
+ },
+ "manual": {
+ "title": "手动创建",
+ "desc": "从空白 SKILL.md 开始写。"
+ },
+ "url": {
+ "title": "从 URL 导入",
+ "desc": "通过 URL 拉取已发布的 skill,文件由服务端拉取。"
+ },
+ "runtime": {
+ "title": "从运行时复制",
+ "desc": "扫描本地运行时,把它磁盘上的 skill 提升到工作区。"
+ }
+ },
+ "method_card": {
+ "manual_title": "手动创建",
+ "manual_desc": "从空白 SKILL.md 开始,自己写指令。",
+ "url_title": "从 URL 导入",
+ "url_desc": "从 ClawHub 或 Skills.sh 拉取已发布的 skill。",
+ "runtime_title": "从运行时复制",
+ "runtime_desc": "把本地运行时里已经装好的 skill 提升过来。"
+ },
+ "manual": {
+ "name_label": "名称",
+ "name_placeholder": "例如:review-helper",
+ "name_hint": "工作区内必须唯一。",
+ "description_label": "描述",
+ "description_placeholder": "用一句话说什么时候应该把这个 skill 分配给智能体。",
+ "name_conflict_hint": "请换一个名字再提交。",
+ "fallback_error": "创建 skill 失败",
+ "cancel": "取消",
+ "submit": "创建 skill",
+ "submitting": "创建中...",
+ "toast_created": "已创建 skill"
+ },
+ "url": {
+ "url_label": "skill URL",
+ "supported_sources": "支持的来源",
+ "import": "导入",
+ "importing": "导入中...",
+ "importing_clawhub": "正在从 ClawHub 导入...",
+ "importing_skills_sh": "正在从 Skills.sh 导入...",
+ "name_conflict_hint": "导入的 skill 名称已存在——请先删除已有的再重试。",
+ "fallback_error": "导入失败",
+ "cancel": "取消",
+ "toast_imported": "已导入 skill"
+ }
+ },
+ "runtime_import": {
+ "runtime_label": "运行时",
+ "runtime_placeholder": "选择一个本地运行时",
+ "no_local_runtimes_title": "暂无可用的本地运行时",
+ "no_local_runtimes_hint": "连接一个本地运行时,才能浏览并导入其本地 skill。",
+ "choose_runtime": "请选择一个运行时继续",
+ "must_be_online": "运行时必须在线才能浏览本地 skill。",
+ "load_failed": "加载本地 skill 失败",
+ "not_supported": "这个 provider 暂不支持本地 skill 列表。",
+ "no_skills_title": "未找到本地 skill",
+ "no_skills_hint": "这个运行时上还没有可发现的本地 skill。",
+ "ignored_files_hint": "导入时会忽略软链、不可读文件、超大文件以及超大目录。",
+ "ready": "准备导入",
+ "into_workspace": "到工作区。",
+ "select_skill": "请选择一个 skill 继续。",
+ "import_button": "导入到工作区",
+ "importing": "导入中...",
+ "skill_files_one": "{{count}} 个文件",
+ "skill_files_other": "{{count}} 个文件",
+ "skill_name_label": "工作区里的 skill 名称",
+ "skill_description_label": "描述",
+ "skill_description_placeholder": "可选——描述智能体什么时候应该使用这个 skill。",
+ "toast_imported": "已导入 skill",
+ "toast_import_failed": "导入 skill 失败"
+ },
+ "file_tree": {
+ "no_files": "无文件"
+ },
+ "file_viewer": {
+ "edit_tooltip": "编辑",
+ "preview_tooltip": "预览",
+ "no_content": "*暂无内容*",
+ "markdown_placeholder": "输入 Markdown 内容...",
+ "raw_placeholder": "文件内容..."
+ }
+}
diff --git a/packages/views/locales/zh-Hans/workspace.json b/packages/views/locales/zh-Hans/workspace.json
new file mode 100644
index 0000000000..eb36d77d24
--- /dev/null
+++ b/packages/views/locales/zh-Hans/workspace.json
@@ -0,0 +1,29 @@
+{
+ "create_form": {
+ "name_label": "工作区名称",
+ "name_placeholder": "我的工作区",
+ "url_label": "工作区 URL",
+ "url_placeholder": "my-workspace",
+ "submit": "创建工作区",
+ "submitting": "创建中...",
+ "errors": {
+ "slug_format": "只能包含小写字母、数字和连字符",
+ "slug_taken": "该工作区 URL 已被占用。",
+ "slug_conflict_toast": "请换一个工作区 URL",
+ "create_failed": "创建工作区失败"
+ }
+ },
+ "new_page": {
+ "back": "返回",
+ "log_out": "退出登录",
+ "title": "欢迎使用 Multica",
+ "description": "一个工作区,让你和 AI 队友并肩协作——一起处理 issue、留下评论、共享同一份上下文。",
+ "invite_hint": "工作区创建后可邀请队友加入。"
+ },
+ "no_access": {
+ "title": "工作区不可用",
+ "description": "该工作区不存在,或你没有访问权限。",
+ "go_to_workspaces": "前往我的工作区",
+ "sign_in_different": "使用其他账号登录"
+ }
+}
diff --git a/packages/views/members/member-profile-card.tsx b/packages/views/members/member-profile-card.tsx
index e3fbd44163..1c1e7f52b4 100644
--- a/packages/views/members/member-profile-card.tsx
+++ b/packages/views/members/member-profile-card.tsx
@@ -10,6 +10,7 @@ import { ActorAvatar as ActorAvatarBase } from "@multica/ui/components/common/ac
import { Skeleton } from "@multica/ui/components/ui/skeleton";
import { ActorAvatar } from "../common/actor-avatar";
import { AppLink } from "../navigation";
+import { useT } from "../i18n";
interface MemberProfileCardProps {
// The User UUID — matches member.user_id and agent.owner_id. We accept user_id
@@ -18,18 +19,13 @@ interface MemberProfileCardProps {
userId: string;
}
-const ROLE_LABEL: Record<MemberRole, string> = {
- owner: "Owner",
- admin: "Admin",
- member: "Member",
-};
-
// Mirrors AgentProfileCard's structure so the two hover surfaces feel like
// twins ("agent and human are both first-class team members"). Content is
// asymmetric on purpose: humans get identity + the AI agents they own; they
// don't get a status dot because there's no member-presence backbone today
// and we don't want to fabricate one.
export function MemberProfileCard({ userId }: MemberProfileCardProps) {
+ const { t } = useT("members");
const wsId = useWorkspaceId();
const { data: members = [], isLoading: membersLoading } = useQuery(
memberListOptions(wsId),
@@ -53,7 +49,7 @@ export function MemberProfileCard({ userId }: MemberProfileCardProps) {
if (!member) {
return (
- <div className="text-xs text-muted-foreground">Member unavailable</div>
+ <div className="text-xs text-muted-foreground">{t(($) => $.card.unavailable)}</div>
);
}
@@ -106,14 +102,20 @@ export function MemberProfileCard({ userId }: MemberProfileCardProps) {
}
function RoleBadge({ role }: { role: MemberRole }) {
+ const { t } = useT("members");
return (
<span className="rounded-md bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground">
- {ROLE_LABEL[role]}
+ {role === "owner"
+ ? t(($) => $.role.owner)
+ : role === "admin"
+ ? t(($) => $.role.admin)
+ : t(($) => $.role.member)}
</span>
);
}
function OwnedAgentsSection({ agents }: { agents: Agent[] }) {
+ const { t } = useT("members");
// Top-2 by frequency (parent already sorted), each row links to the agent
// detail page. The presence dot is overlaid on the avatar via ActorAvatar's
// showStatusDot — `enableHoverCard` deliberately omitted to avoid
@@ -126,7 +128,7 @@ function OwnedAgentsSection({ agents }: { agents: Agent[] }) {
return (
<div className="flex flex-col gap-1.5 text-xs">
- <span className="text-muted-foreground">Agents ({agents.length})</span>
+ <span className="text-muted-foreground">{t(($) => $.card.agents_section, { count: agents.length })}</span>
<div className="flex flex-col gap-0.5">
{visible.map((a) => (
<AppLink
@@ -153,13 +155,13 @@ function OwnedAgentsSection({ agents }: { agents: Agent[] }) {
aria-hidden
className="mt-0.5 shrink-0 font-normal text-brand opacity-0 transition-opacity group-hover:opacity-100"
>
- Detail →
+ {t(($) => $.card.detail_link)}
</span>
</AppLink>
))}
{overflow > 0 && (
<span className="text-muted-foreground">
- and {overflow} other agent{overflow === 1 ? "" : "s"}
+ {t(($) => $.card.more_agents, { count: overflow })}
</span>
)}
</div>
diff --git a/packages/views/modals/add-child-issue.tsx b/packages/views/modals/add-child-issue.tsx
index 2a2bf4d331..f7ec9d0768 100644
--- a/packages/views/modals/add-child-issue.tsx
+++ b/packages/views/modals/add-child-issue.tsx
@@ -9,6 +9,7 @@ import {
} from "@multica/core/issues/queries";
import { useUpdateIssue } from "@multica/core/issues/mutations";
import { IssuePickerModal } from "./issue-picker-modal";
+import { useT } from "../i18n";
export function AddChildIssueModal({
onClose,
@@ -17,6 +18,7 @@ export function AddChildIssueModal({
onClose: () => void;
data: Record<string, unknown> | null;
}) {
+ const { t } = useT("modals");
const issueId = (data?.issueId as string) || "";
const wsId = useWorkspaceId();
const updateIssue = useUpdateIssue();
@@ -42,15 +44,15 @@ export function AddChildIssueModal({
onOpenChange={(v) => {
if (!v) onClose();
}}
- title="Add sub-issue"
- description="Search for an issue to add as a sub-issue"
+ title={t(($) => $.add_child.title)}
+ description={t(($) => $.add_child.description)}
excludeIds={excludeIds}
onSelect={(selected) => {
updateIssue.mutate(
{ id: selected.id, parent_issue_id: issueId },
- { onError: () => toast.error("Failed to add sub-issue") },
+ { onError: () => toast.error(t(($) => $.add_child.toast_failed)) },
);
- toast.success(`Added ${selected.identifier} as sub-issue`);
+ toast.success(t(($) => $.add_child.toast_success, { identifier: selected.identifier }));
}}
/>
);
diff --git a/packages/views/modals/backlog-agent-hint.tsx b/packages/views/modals/backlog-agent-hint.tsx
index 97b8b4fbed..76be3c3f65 100644
--- a/packages/views/modals/backlog-agent-hint.tsx
+++ b/packages/views/modals/backlog-agent-hint.tsx
@@ -3,6 +3,7 @@
import { toast } from "sonner";
import { BacklogAgentHintDialog } from "../issues/components/backlog-agent-hint-dialog";
import { useUpdateIssue } from "@multica/core/issues/mutations";
+import { useT } from "../i18n";
export function BacklogAgentHintModal({
onClose,
@@ -11,6 +12,7 @@ export function BacklogAgentHintModal({
onClose: () => void;
data: Record<string, unknown> | null;
}) {
+ const { t } = useT("modals");
const issueId = (data?.issueId as string) || "";
const updateIssue = useUpdateIssue();
@@ -27,7 +29,7 @@ export function BacklogAgentHintModal({
if (issueId) {
updateIssue.mutate(
{ id: issueId, status: "todo" },
- { onError: () => toast.error("Failed to update status") },
+ { onError: () => toast.error(t(($) => $.backlog_hint.toast_status_failed)) },
);
}
onClose();
diff --git a/packages/views/modals/create-issue.test.tsx b/packages/views/modals/create-issue.test.tsx
index 6955447d79..fa68b44881 100644
--- a/packages/views/modals/create-issue.test.tsx
+++ b/packages/views/modals/create-issue.test.tsx
@@ -1,8 +1,23 @@
-import { forwardRef, useImperativeHandle, useRef, useState } from "react";
+import { forwardRef, useImperativeHandle, useRef, useState, type ReactNode } from "react";
import { describe, it, expect, vi, beforeEach } from "vitest";
import { render, screen, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
+import { I18nProvider } from "@multica/core/i18n/react";
+import enCommon from "../locales/en/common.json";
+import enModals from "../locales/en/modals.json";
+
+const TEST_RESOURCES = {
+ en: { common: enCommon, modals: enModals },
+};
+
+function I18nWrapper({ children }: { children: ReactNode }) {
+ return (
+ <I18nProvider locale="en" resources={TEST_RESOURCES}>
+ {children}
+ </I18nProvider>
+ );
+}
const mockPush = vi.hoisted(() => vi.fn());
const mockCreateIssue = vi.hoisted(() => vi.fn());
@@ -236,7 +251,11 @@ function renderModal(element: React.ReactElement) {
const qc = new QueryClient({
defaultOptions: { queries: { retry: false } },
});
- return render(<QueryClientProvider client={qc}>{element}</QueryClientProvider>);
+ return render(
+ <I18nWrapper>
+ <QueryClientProvider client={qc}>{element}</QueryClientProvider>
+ </I18nWrapper>,
+ );
}
describe("CreateIssueModal", () => {
diff --git a/packages/views/modals/create-issue.tsx b/packages/views/modals/create-issue.tsx
index 9462238eb7..3f252e07bc 100644
--- a/packages/views/modals/create-issue.tsx
+++ b/packages/views/modals/create-issue.tsx
@@ -47,6 +47,7 @@ import { api } from "@multica/core/api";
import { FileUploadButton } from "@multica/ui/components/common/file-upload-button";
import { PillButton } from "../common/pill-button";
import { IssuePickerModal } from "./issue-picker-modal";
+import { useT } from "../i18n";
// ---------------------------------------------------------------------------
// ManualCreatePanel — manual-mode body of the create-issue dialog. Renders
@@ -77,6 +78,7 @@ export function ManualCreatePanel({
backlogHintIssueId: string | null;
setBacklogHintIssueId: (id: string | null) => void;
}) {
+ const { t } = useT("modals");
const router = useNavigation();
const p = useWorkspacePaths();
const workspaceName = useCurrentWorkspace()?.name;
@@ -198,8 +200,11 @@ export function ManualCreatePanel({
if (failed > 0) {
toast.error(
failed === childIssues.length
- ? "Failed to link sub-issues"
- : `Failed to link ${failed} of ${childIssues.length} sub-issues`,
+ ? t(($) => $.create_issue.toast_link_subissues_all_failed)
+ : t(($) => $.create_issue.toast_link_subissues_partial, {
+ failed,
+ total: childIssues.length,
+ }),
);
}
}
@@ -220,13 +225,13 @@ export function ManualCreatePanel({
}
if (!shouldShowBacklogHint) {
- toast.custom((t) => (
+ toast.custom((toastId) => (
<div className="bg-popover text-popover-foreground border rounded-lg shadow-lg p-4 w-[360px]">
<div className="flex items-center gap-2 mb-2">
<div className="flex items-center justify-center size-5 rounded-full bg-emerald-500/15 text-emerald-500">
<Check className="size-3" />
</div>
- <span className="text-sm font-medium">Issue created</span>
+ <span className="text-sm font-medium">{t(($) => $.create_issue.toast_created)}</span>
</div>
<div className="flex items-center gap-2 text-sm text-muted-foreground ml-7">
<StatusIcon status={issue.status} className="size-3.5 shrink-0" />
@@ -237,16 +242,16 @@ export function ManualCreatePanel({
className="ml-7 mt-2 text-sm text-primary hover:underline cursor-pointer"
onClick={() => {
router.push(p.issueDetail(issue.id));
- toast.dismiss(t);
+ toast.dismiss(toastId);
}}
>
- View issue
+ {t(($) => $.create_issue.view_issue)}
</button>
</div>
), { duration: 5000 });
}
} catch {
- toast.error("Failed to create issue");
+ toast.error(t(($) => $.create_issue.toast_failed));
} finally {
setSubmitting(false);
}
@@ -283,7 +288,7 @@ export function ManualCreatePanel({
onMoveToTodo={() => {
updateIssueMutation.mutate(
{ id: backlogHintIssueId, status: "todo" },
- { onError: () => toast.error("Failed to update status") },
+ { onError: () => toast.error(t(($) => $.backlog_hint.toast_status_failed)) },
);
setBacklogHintIssueId(null);
onClose();
@@ -291,14 +296,14 @@ export function ManualCreatePanel({
/>
) : (
<>
- <DialogTitle className="sr-only">New Issue</DialogTitle>
+ <DialogTitle className="sr-only">{t(($) => $.create_issue.sr_manual)}</DialogTitle>
{/* Header */}
<div className="flex items-center justify-between px-5 pt-3 pb-2 shrink-0">
<div className="flex items-center gap-1.5 text-xs">
<span className="text-muted-foreground">{workspaceName}</span>
<ChevronRight className="size-3 text-muted-foreground/50" />
- <span className="font-medium">Create manually</span>
+ <span className="font-medium">{t(($) => $.create_issue.manual_breadcrumb)}</span>
</div>
<div className="flex items-center gap-1">
<Tooltip>
@@ -312,7 +317,11 @@ export function ManualCreatePanel({
</button>
}
/>
- <TooltipContent side="bottom">{isExpanded ? "Collapse" : "Expand"}</TooltipContent>
+ <TooltipContent side="bottom">
+ {isExpanded
+ ? t(($) => $.common.collapse_tooltip)
+ : t(($) => $.common.expand_tooltip)}
+ </TooltipContent>
</Tooltip>
<Tooltip>
<TooltipTrigger
@@ -325,7 +334,7 @@ export function ManualCreatePanel({
</button>
}
/>
- <TooltipContent side="bottom">Close</TooltipContent>
+ <TooltipContent side="bottom">{t(($) => $.common.close)}</TooltipContent>
</Tooltip>
</div>
</div>
@@ -336,7 +345,7 @@ export function ManualCreatePanel({
key={formResetKey}
autoFocus
defaultValue={draft.title}
- placeholder="Issue title"
+ placeholder={t(($) => $.create_issue.title_placeholder)}
className="text-lg font-semibold"
onChange={(v) => updateTitle(v)}
onSubmit={handleSubmit}
@@ -348,7 +357,7 @@ export function ManualCreatePanel({
<ContentEditor
ref={descEditorRef}
defaultValue={draft.description}
- placeholder="Add description..."
+ placeholder={t(($) => $.create_issue.description_placeholder)}
onUpdate={(md) => setDraft({ description: md })}
onUploadFile={handleUpload}
debounceMs={500}
@@ -413,13 +422,15 @@ export function ManualCreatePanel({
className="flex items-center gap-1.5 py-1 pl-2.5 cursor-pointer"
>
<ArrowUp className="size-3 text-muted-foreground" />
- <span>Sub-issue of {parentIssue.identifier}</span>
+ <span>
+ {t(($) => $.create_issue.subissue_of, { identifier: parentIssue.identifier })}
+ </span>
</button>
<button
type="button"
onClick={() => setParentIssueId(undefined)}
className="p-1 pr-2 text-muted-foreground hover:text-foreground cursor-pointer"
- aria-label="Remove parent"
+ aria-label={t(($) => $.create_issue.remove_parent_aria)}
>
<XIcon className="size-3" />
</button>
@@ -435,7 +446,7 @@ export function ManualCreatePanel({
>
<div className="flex items-center gap-1.5 py-1 pl-2.5">
<ArrowDown className="size-3 text-muted-foreground" />
- <span>Sub-issue: {c.identifier}</span>
+ <span>{t(($) => $.create_issue.subissue_chip, { identifier: c.identifier })}</span>
</div>
<button
type="button"
@@ -443,7 +454,7 @@ export function ManualCreatePanel({
setChildIssues((prev) => prev.filter((x) => x.id !== c.id))
}
className="p-1 pr-2 text-muted-foreground hover:text-foreground cursor-pointer"
- aria-label={`Remove sub-issue ${c.identifier}`}
+ aria-label={t(($) => $.create_issue.remove_subissue_aria, { identifier: c.identifier })}
>
<XIcon className="size-3" />
</button>
@@ -455,7 +466,7 @@ export function ManualCreatePanel({
<DropdownMenu>
<DropdownMenuTrigger
render={
- <PillButton aria-label="More options">
+ <PillButton aria-label={t(($) => $.create_issue.more_options_aria)}>
<MoreHorizontal className="size-3.5" />
</PillButton>
}
@@ -464,17 +475,17 @@ export function ManualCreatePanel({
{parentIssueId && parentIssue ? (
<DropdownMenuItem onClick={() => setParentPickerOpen(true)}>
<ArrowUp className="h-3.5 w-3.5" />
- Parent: {parentIssue.identifier}
+ {t(($) => $.create_issue.parent_with_id, { identifier: parentIssue.identifier })}
</DropdownMenuItem>
) : (
<DropdownMenuItem onClick={() => setParentPickerOpen(true)}>
<ArrowUp className="h-3.5 w-3.5" />
- Set parent issue...
+ {t(($) => $.create_issue.set_parent)}
</DropdownMenuItem>
)}
<DropdownMenuItem onClick={() => setChildPickerOpen(true)}>
<ArrowDown className="h-3.5 w-3.5" />
- Add sub-issue...
+ {t(($) => $.create_issue.add_subissue)}
</DropdownMenuItem>
{parentIssueId && parentIssue && (
<>
@@ -484,7 +495,7 @@ export function ManualCreatePanel({
onClick={() => setParentIssueId(undefined)}
>
<XIcon className="h-3.5 w-3.5" />
- Remove parent
+ {t(($) => $.create_issue.remove_parent)}
</DropdownMenuItem>
</>
)}
@@ -497,8 +508,8 @@ export function ManualCreatePanel({
<IssuePickerModal
open={parentPickerOpen}
onOpenChange={setParentPickerOpen}
- title="Set parent issue"
- description="Search for an issue to set as the parent of the new issue"
+ title={t(($) => $.create_issue.set_parent_picker.title)}
+ description={t(($) => $.create_issue.set_parent_picker.description)}
excludeIds={[
...childIssues.map((c) => c.id),
...(parentIssueId ? [parentIssueId] : []),
@@ -510,8 +521,8 @@ export function ManualCreatePanel({
<IssuePickerModal
open={childPickerOpen}
onOpenChange={setChildPickerOpen}
- title="Add sub-issue"
- description="Search for an issue to add as a sub-issue of the new issue"
+ title={t(($) => $.create_issue.add_subissue_picker.title)}
+ description={t(($) => $.create_issue.add_subissue_picker.description)}
excludeIds={[
...childIssues.map((c) => c.id),
...(parentIssueId ? [parentIssueId] : []),
@@ -534,11 +545,11 @@ export function ManualCreatePanel({
<button
type="button"
onClick={switchToAgent}
- title="Switch to create with agent — describe in one line and let the agent file it"
+ title={t(($) => $.create_issue.switch_to_agent_tooltip)}
className="flex shrink-0 items-center gap-1.5 text-xs px-2 py-1 rounded-sm text-muted-foreground hover:text-foreground hover:bg-accent/60 transition-colors cursor-pointer"
>
<ArrowLeftRight className="size-3.5" />
- Switch to Agent
+ {t(($) => $.create_issue.switch_to_agent)}
</button>
<label className="flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground cursor-pointer select-none">
<Switch
@@ -546,10 +557,10 @@ export function ManualCreatePanel({
checked={keepOpen}
onCheckedChange={setKeepOpen}
/>
- Create another
+ {t(($) => $.create_issue.create_another)}
</label>
<Button size="sm" onClick={handleSubmit} disabled={!title.trim() || submitting}>
- {submitting ? "Creating..." : "Create Issue"}
+ {submitting ? t(($) => $.create_issue.submitting) : t(($) => $.create_issue.submit)}
</Button>
</div>
</div>
diff --git a/packages/views/modals/create-project.tsx b/packages/views/modals/create-project.tsx
index 1bf83074e5..f9c3ec3c36 100644
--- a/packages/views/modals/create-project.tsx
+++ b/packages/views/modals/create-project.tsx
@@ -27,7 +27,6 @@ import { useProjectDraftStore } from "@multica/core/projects";
import {
PROJECT_STATUS_CONFIG,
PROJECT_STATUS_ORDER,
- PROJECT_PRIORITY_CONFIG,
PROJECT_PRIORITY_ORDER,
} from "@multica/core/projects/config";
import { useWorkspaceId } from "@multica/core/hooks";
@@ -52,6 +51,11 @@ import { ContentEditor, type ContentEditorRef, TitleEditor } from "../editor";
import { PriorityIcon } from "../issues/components/priority-icon";
import { ActorAvatar } from "../common/actor-avatar";
import { useNavigation } from "../navigation";
+import { useT } from "../i18n";
+import {
+ useProjectStatusLabels,
+ useProjectPriorityLabels,
+} from "../projects/components/labels";
function PillButton({
children,
@@ -100,6 +104,7 @@ function RepoUrlText({
}
export function CreateProjectModal({ onClose }: { onClose: () => void }) {
+ const { t } = useT("modals");
const router = useNavigation();
const workspace = useCurrentWorkspace();
const workspaceName = workspace?.name;
@@ -108,6 +113,8 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
const { data: members = [] } = useQuery(memberListOptions(wsId));
const { data: agents = [] } = useQuery(agentListOptions(wsId));
const { getActorName } = useActorName();
+ const projectStatusLabels = useProjectStatusLabels();
+ const projectPriorityLabels = useProjectPriorityLabels();
const draft = useProjectDraftStore((s) => s.draft);
const setDraft = useProjectDraftStore((s) => s.setDraft);
@@ -150,7 +157,8 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
(a) => !a.archived_at && a.name.toLowerCase().includes(leadQuery),
);
- const leadLabel = leadType && leadId ? getActorName(leadType, leadId) : "Lead";
+ const leadLabel =
+ leadType && leadId ? getActorName(leadType, leadId) : t(($) => $.create_project.lead);
const createProject = useCreateProject();
@@ -177,10 +185,10 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
});
clearDraft();
onClose();
- toast.success("Project created");
+ toast.success(t(($) => $.create_project.toast_created));
router.push(wsPaths.projectDetail(project.id));
} catch {
- toast.error("Failed to create project");
+ toast.error(t(($) => $.create_project.toast_failed));
} finally {
setSubmitting(false);
}
@@ -212,13 +220,13 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
: "!max-w-2xl !w-full !h-96 !-translate-y-1/2",
)}
>
- <DialogTitle className="sr-only">New Project</DialogTitle>
+ <DialogTitle className="sr-only">{t(($) => $.create_project.title)}</DialogTitle>
<div className="flex items-center justify-between px-5 pt-3 pb-2 shrink-0">
<div className="flex items-center gap-1.5 text-xs">
<span className="text-muted-foreground">{workspaceName}</span>
<ChevronRight className="size-3 text-muted-foreground/50" />
- <span className="font-medium">New project</span>
+ <span className="font-medium">{t(($) => $.create_project.title_breadcrumb)}</span>
</div>
<div className="flex items-center gap-1">
<Tooltip>
@@ -232,7 +240,11 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
</button>
}
/>
- <TooltipContent side="bottom">{isExpanded ? "Collapse" : "Expand"}</TooltipContent>
+ <TooltipContent side="bottom">
+ {isExpanded
+ ? t(($) => $.common.collapse_tooltip)
+ : t(($) => $.common.expand_tooltip)}
+ </TooltipContent>
</Tooltip>
<Tooltip>
<TooltipTrigger
@@ -245,7 +257,7 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
</button>
}
/>
- <TooltipContent side="bottom">Close</TooltipContent>
+ <TooltipContent side="bottom">{t(($) => $.common.close)}</TooltipContent>
</Tooltip>
</div>
</div>
@@ -257,7 +269,7 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
<button
type="button"
className="text-2xl cursor-pointer rounded-lg p-1 -ml-1 hover:bg-accent/60 transition-colors"
- title="Choose icon"
+ title={t(($) => $.create_project.icon_tooltip)}
>
{icon || "📁"}
</button>
@@ -275,7 +287,7 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
<TitleEditor
autoFocus
defaultValue={draft.title}
- placeholder="Project title"
+ placeholder={t(($) => $.create_project.title_placeholder)}
className="text-lg font-semibold"
onChange={(v) => updateTitle(v)}
onSubmit={handleSubmit}
@@ -286,7 +298,7 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
<ContentEditor
ref={descEditorRef}
defaultValue={draft.description}
- placeholder="Add description..."
+ placeholder={t(($) => $.create_project.description_placeholder)}
onUpdate={(md) => setDraft({ description: md })}
debounceMs={500}
/>
@@ -305,7 +317,7 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
render={
<PillButton>
<span className={cn("size-2 rounded-full", PROJECT_STATUS_CONFIG[status].dotColor)} />
- <span>{PROJECT_STATUS_CONFIG[status].label}</span>
+ <span>{projectStatusLabels[status]}</span>
</PillButton>
}
/>
@@ -313,7 +325,7 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
{PROJECT_STATUS_ORDER.map((s) => (
<DropdownMenuItem key={s} onClick={() => updateStatus(s)}>
<span className={cn("size-2 rounded-full", PROJECT_STATUS_CONFIG[s].dotColor)} />
- <span>{PROJECT_STATUS_CONFIG[s].label}</span>
+ <span>{projectStatusLabels[s]}</span>
</DropdownMenuItem>
))}
</DropdownMenuContent>
@@ -324,7 +336,7 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
render={
<PillButton>
<PriorityIcon priority={priority} />
- <span>{PROJECT_PRIORITY_CONFIG[priority].label}</span>
+ <span>{projectPriorityLabels[priority]}</span>
</PillButton>
}
/>
@@ -332,7 +344,7 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
{PROJECT_PRIORITY_ORDER.map((pr) => (
<DropdownMenuItem key={pr} onClick={() => updatePriority(pr)}>
<PriorityIcon priority={pr} />
- <span>{PROJECT_PRIORITY_CONFIG[pr].label}</span>
+ <span>{projectPriorityLabels[pr]}</span>
</DropdownMenuItem>
))}
</DropdownMenuContent>
@@ -354,7 +366,7 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
<span>{leadLabel}</span>
</>
) : (
- <span className="text-muted-foreground">Lead</span>
+ <span className="text-muted-foreground">{t(($) => $.create_project.lead)}</span>
)}
</PillButton>
}
@@ -365,7 +377,7 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
type="text"
value={leadFilter}
onChange={(e) => setLeadFilter(e.target.value)}
- placeholder="Assign lead..."
+ placeholder={t(($) => $.create_project.lead_placeholder)}
className="w-full bg-transparent text-sm placeholder:text-muted-foreground outline-none"
/>
</div>
@@ -379,12 +391,12 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent transition-colors"
>
<UserMinus className="h-3.5 w-3.5 text-muted-foreground" />
- <span className="text-muted-foreground">No lead</span>
+ <span className="text-muted-foreground">{t(($) => $.create_project.no_lead)}</span>
</button>
{filteredMembers.length > 0 && (
<>
<div className="px-2 pt-2 pb-1 text-xs font-medium text-muted-foreground uppercase tracking-wider">
- Members
+ {t(($) => $.create_project.members_group)}
</div>
{filteredMembers.map((m) => (
<button
@@ -405,7 +417,7 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
{filteredAgents.length > 0 && (
<>
<div className="px-2 pt-2 pb-1 text-xs font-medium text-muted-foreground uppercase tracking-wider">
- Agents
+ {t(($) => $.create_project.agents_group)}
</div>
{filteredAgents.map((a) => (
<button
@@ -427,7 +439,7 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
filteredAgents.length === 0 &&
leadFilter && (
<div className="px-2 py-3 text-center text-sm text-muted-foreground">
- No results
+ {t(($) => $.create_project.no_results)}
</div>
)}
</div>
@@ -441,15 +453,15 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
<GithubIcon className="size-3" />
<span>
{selectedRepos.length === 0
- ? "Repos"
- : `${selectedRepos.length} repo${selectedRepos.length === 1 ? "" : "s"}`}
+ ? t(($) => $.create_project.repos_pill)
+ : t(($) => $.create_project.repos_pill_count, { count: selectedRepos.length })}
</span>
</PillButton>
}
/>
<PopoverContent align="start" className="w-72 p-2 space-y-2">
<div className="text-xs font-medium text-muted-foreground">
- Attach GitHub repos to this project
+ {t(($) => $.create_project.repos_heading)}
</div>
{workspaceRepos.length > 0 ? (
<div className="space-y-1">
@@ -479,8 +491,7 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
</div>
) : (
<p className="text-xs text-muted-foreground">
- No workspace-level repos yet. Paste a URL below to attach one
- ad-hoc.
+ {t(($) => $.create_project.repos_empty)}
</p>
)}
<form
@@ -494,7 +505,7 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
type="url"
value={customRepoUrl}
onChange={(e) => setCustomRepoUrl(e.target.value)}
- placeholder="https://github.com/owner/repo"
+ placeholder={t(($) => $.create_project.repos_url_placeholder)}
className="flex-1 bg-transparent text-xs px-2 py-1 outline-none placeholder:text-muted-foreground"
/>
<Button
@@ -504,13 +515,13 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
className="h-6 px-2 text-xs"
disabled={!customRepoUrl.trim()}
>
- Add
+ {t(($) => $.create_project.repos_add)}
</Button>
</form>
{selectedRepos.length > 0 && (
<div className="space-y-1 pt-1 border-t">
<div className="text-[10px] font-medium text-muted-foreground uppercase tracking-wider">
- Selected
+ {t(($) => $.create_project.repos_selected)}
</div>
{selectedRepos.map((url) => (
<div
@@ -540,7 +551,7 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
disabled={!title.trim() || submitting}
className="shrink-0"
>
- {submitting ? "Creating..." : "Create Project"}
+ {submitting ? t(($) => $.create_project.submitting) : t(($) => $.create_project.submit)}
</Button>
</div>
</DialogContent>
diff --git a/packages/views/modals/create-workspace.test.tsx b/packages/views/modals/create-workspace.test.tsx
index a90ce7045a..22b9c4df39 100644
--- a/packages/views/modals/create-workspace.test.tsx
+++ b/packages/views/modals/create-workspace.test.tsx
@@ -2,6 +2,13 @@ import type { ReactNode } from "react";
import { describe, expect, it, beforeEach, vi } from "vitest";
import { render, screen, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
+import { I18nProvider } from "@multica/core/i18n/react";
+import enCommon from "../locales/en/common.json";
+import enWorkspace from "../locales/en/workspace.json";
+
+const TEST_RESOURCES = {
+ en: { common: enCommon, workspace: enWorkspace },
+};
const mockPush = vi.hoisted(() => vi.fn());
const mockCreateWorkspaceMutate = vi.hoisted(() => vi.fn());
@@ -35,6 +42,18 @@ vi.mock("sonner", () => ({
import { CreateWorkspaceModal } from "./create-workspace";
+function I18nWrapper({ children }: { children: ReactNode }) {
+ return (
+ <I18nProvider locale="en" resources={TEST_RESOURCES}>
+ {children}
+ </I18nProvider>
+ );
+}
+
+function renderModal(props: { onClose: () => void }) {
+ return render(<CreateWorkspaceModal {...props} />, { wrapper: I18nWrapper });
+}
+
describe("CreateWorkspaceModal", () => {
beforeEach(() => {
vi.clearAllMocks();
@@ -42,7 +61,7 @@ describe("CreateWorkspaceModal", () => {
it("auto-generates the slug until the user edits it", async () => {
const user = userEvent.setup();
- render(<CreateWorkspaceModal onClose={vi.fn()} />);
+ renderModal({ onClose: vi.fn() });
const nameInput = screen.getByPlaceholderText("My Workspace");
const slugInput = screen.getByPlaceholderText("my-workspace");
@@ -69,7 +88,7 @@ describe("CreateWorkspaceModal", () => {
},
);
- render(<CreateWorkspaceModal onClose={vi.fn()} />);
+ renderModal({ onClose: vi.fn() });
await user.type(screen.getByPlaceholderText("My Workspace"), "My Team");
await user.click(screen.getByRole("button", { name: "Create workspace" }));
@@ -101,7 +120,7 @@ describe("CreateWorkspaceModal", () => {
},
);
- render(<CreateWorkspaceModal onClose={onClose} />);
+ renderModal({ onClose });
await user.type(screen.getByPlaceholderText("My Workspace"), "My Team");
await user.click(screen.getByRole("button", { name: "Create workspace" }));
diff --git a/packages/views/modals/create-workspace.tsx b/packages/views/modals/create-workspace.tsx
index a61d225211..5739377ce6 100644
--- a/packages/views/modals/create-workspace.tsx
+++ b/packages/views/modals/create-workspace.tsx
@@ -12,8 +12,10 @@ import {
} from "@multica/ui/components/ui/dialog";
import { paths } from "@multica/core/paths";
import { CreateWorkspaceForm } from "../workspace/create-workspace-form";
+import { useT } from "../i18n";
export function CreateWorkspaceModal({ onClose }: { onClose: () => void }) {
+ const { t } = useT("modals");
const router = useNavigation();
return (
@@ -43,18 +45,17 @@ export function CreateWorkspaceModal({ onClose }: { onClose: () => void }) {
onClick={onClose}
>
<ArrowLeft className="h-4 w-4" />
- Back
+ {t(($) => $.common.back)}
</Button>
<div className="flex flex-1 flex-col items-center justify-center px-6 pb-12">
<div className="flex w-full max-w-md flex-col items-center gap-6">
<div className="text-center">
<DialogTitle className="text-2xl font-semibold">
- Create a new workspace
+ {t(($) => $.create_workspace.title)}
</DialogTitle>
<DialogDescription className="mt-2">
- Workspaces are shared environments where teams can work on
- projects and issues.
+ {t(($) => $.create_workspace.description)}
</DialogDescription>
</div>
<CreateWorkspaceForm
diff --git a/packages/views/modals/delete-issue-confirm.tsx b/packages/views/modals/delete-issue-confirm.tsx
index cd62b10672..b3bc7af634 100644
--- a/packages/views/modals/delete-issue-confirm.tsx
+++ b/packages/views/modals/delete-issue-confirm.tsx
@@ -14,6 +14,7 @@ import {
} from "@multica/ui/components/ui/alert-dialog";
import { useDeleteIssue } from "@multica/core/issues/mutations";
import { useNavigation } from "../navigation";
+import { useT } from "../i18n";
export function DeleteIssueConfirmModal({
onClose,
@@ -22,6 +23,7 @@ export function DeleteIssueConfirmModal({
onClose: () => void;
data: Record<string, unknown> | null;
}) {
+ const { t } = useT("modals");
const issueId = (data?.issueId as string) || "";
const navigateTo = (data?.onDeletedNavigateTo as string | undefined) || undefined;
const [deleting, setDeleting] = useState(false);
@@ -33,11 +35,11 @@ export function DeleteIssueConfirmModal({
setDeleting(true);
try {
await deleteIssue.mutateAsync(issueId);
- toast.success("Issue deleted");
+ toast.success(t(($) => $.delete_issue.toast_deleted));
onClose();
if (navigateTo) navigation.push(navigateTo);
} catch {
- toast.error("Failed to delete issue");
+ toast.error(t(($) => $.delete_issue.toast_delete_failed));
setDeleting(false);
}
};
@@ -46,22 +48,22 @@ export function DeleteIssueConfirmModal({
<AlertDialog open onOpenChange={(v) => { if (!v && !deleting) onClose(); }}>
<AlertDialogContent>
<AlertDialogHeader>
- <AlertDialogTitle>Delete issue</AlertDialogTitle>
+ <AlertDialogTitle>{t(($) => $.delete_issue.title)}</AlertDialogTitle>
<AlertDialogDescription>
- This will permanently delete this issue and all its comments. This action cannot be undone.
+ {t(($) => $.delete_issue.description)}
<span className="mt-2 block text-xs text-muted-foreground/80">
- Any workspace member can delete issues.
+ {t(($) => $.delete_issue.hint)}
</span>
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
- <AlertDialogCancel disabled={deleting}>Cancel</AlertDialogCancel>
+ <AlertDialogCancel disabled={deleting}>{t(($) => $.delete_issue.cancel)}</AlertDialogCancel>
<AlertDialogAction
onClick={handleDelete}
disabled={deleting}
className="bg-destructive text-white hover:bg-destructive/90"
>
- {deleting ? "Deleting..." : "Delete"}
+ {deleting ? t(($) => $.delete_issue.deleting) : t(($) => $.delete_issue.confirm)}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
diff --git a/packages/views/modals/feedback.tsx b/packages/views/modals/feedback.tsx
index 0b7a7f0e2c..8cc73e4927 100644
--- a/packages/views/modals/feedback.tsx
+++ b/packages/views/modals/feedback.tsx
@@ -21,11 +21,13 @@ import { useCurrentWorkspace } from "@multica/core/paths";
import { useFileUpload } from "@multica/core/hooks/use-file-upload";
import { api } from "@multica/core/api";
import { captureFeedbackOpened } from "@multica/core/analytics";
+import { useT } from "../i18n";
import { formatShortcut, modKey, enterKey } from "@multica/core/platform";
const MAX_MESSAGE_LEN = 10000;
export function FeedbackModal({ onClose }: { onClose: () => void }) {
+ const { t } = useT("modals");
const workspace = useCurrentWorkspace();
const draft = useFeedbackDraftStore((s) => s.draft);
const setDraft = useFeedbackDraftStore((s) => s.setDraft);
@@ -56,7 +58,7 @@ export function FeedbackModal({ onClose }: { onClose: () => void }) {
const handleSubmit = async () => {
if (!canSubmit) return;
if (editorRef.current?.hasActiveUploads()) {
- toast.info("Please wait for uploads to finish…");
+ toast.info(t(($) => $.feedback.toast_uploading));
return;
}
// Read from the editor ref at submit time — `message` state lags 150ms
@@ -65,7 +67,7 @@ export function FeedbackModal({ onClose }: { onClose: () => void }) {
const latest = editorRef.current?.getMarkdown()?.trim() ?? "";
if (!latest) return;
if (latest.length > MAX_MESSAGE_LEN) {
- toast.error("Message is too long");
+ toast.error(t(($) => $.feedback.toast_too_long));
return;
}
try {
@@ -75,13 +77,13 @@ export function FeedbackModal({ onClose }: { onClose: () => void }) {
workspace_id: workspace?.id,
});
clearDraft();
- toast.success("Thanks for the feedback!");
+ toast.success(t(($) => $.feedback.toast_sent));
onClose();
} catch (err) {
const msg =
err instanceof Error && err.message
? err.message
- : "Failed to send feedback";
+ : t(($) => $.feedback.toast_failed);
toast.error(msg);
}
};
@@ -90,10 +92,9 @@ export function FeedbackModal({ onClose }: { onClose: () => void }) {
<Dialog open onOpenChange={(v) => !v && onClose()}>
<DialogContent className="sm:max-w-2xl !h-[28rem] p-0 gap-0 flex flex-col overflow-hidden">
<DialogHeader className="px-5 pt-4 pb-2 shrink-0">
- <DialogTitle>Feedback</DialogTitle>
+ <DialogTitle>{t(($) => $.feedback.title)}</DialogTitle>
<DialogDescription>
- We&apos;d love to hear what&apos;s working, what isn&apos;t, or
- what you&apos;d like to see next.
+ {t(($) => $.feedback.description)}
</DialogDescription>
</DialogHeader>
@@ -105,7 +106,7 @@ export function FeedbackModal({ onClose }: { onClose: () => void }) {
<ContentEditor
ref={editorRef}
defaultValue={draft.message}
- placeholder="Tell us about your experience, bugs you've found, or features you'd like to see…"
+ placeholder={t(($) => $.feedback.placeholder)}
onUpdate={(md) => { setMessage(md); setDraft({ message: md }); }}
onUploadFile={uploadWithToast}
onSubmit={handleSubmit}
@@ -119,7 +120,7 @@ export function FeedbackModal({ onClose }: { onClose: () => void }) {
<div className="flex items-center justify-end px-4 py-3 border-t shrink-0">
<Button size="sm" onClick={handleSubmit} disabled={!canSubmit}>
- {mutation.isPending ? "Sending…" : "Send feedback"}
+ {mutation.isPending ? t(($) => $.feedback.sending) : t(($) => $.feedback.send)}
<kbd className="ml-1 inline-flex h-4 items-center gap-0.5 rounded border border-border/50 bg-background/30 px-1 font-mono text-[10px] leading-none">
{formatShortcut(modKey, enterKey)}
</kbd>
diff --git a/packages/views/modals/issue-picker-modal.tsx b/packages/views/modals/issue-picker-modal.tsx
index de74195206..d89b5c3820 100644
--- a/packages/views/modals/issue-picker-modal.tsx
+++ b/packages/views/modals/issue-picker-modal.tsx
@@ -13,6 +13,7 @@ import {
CommandItem,
} from "@multica/ui/components/ui/command";
import { StatusIcon } from "../issues/components/status-icon";
+import { useT } from "../i18n";
interface IssuePickerModalProps {
open: boolean;
@@ -31,6 +32,7 @@ export function IssuePickerModal({
excludeIds,
onSelect,
}: IssuePickerModalProps) {
+ const { t } = useT("modals");
const [query, setQuery] = useState("");
const [results, setResults] = useState<Issue[]>([]);
const [isLoading, setIsLoading] = useState(false);
@@ -90,7 +92,7 @@ export function IssuePickerModal({
>
<Command shouldFilter={false}>
<CommandInput
- placeholder="Search issues..."
+ placeholder={t(($) => $.issue_picker.search_placeholder)}
value={query}
onValueChange={(v) => {
setQuery(v);
@@ -100,15 +102,15 @@ export function IssuePickerModal({
<CommandList>
{isLoading && (
<div className="py-6 text-center text-sm text-muted-foreground">
- Searching...
+ {t(($) => $.issue_picker.searching)}
</div>
)}
{!isLoading && query.trim() && results.length === 0 && (
- <CommandEmpty>No issues found.</CommandEmpty>
+ <CommandEmpty>{t(($) => $.issue_picker.no_results)}</CommandEmpty>
)}
{!isLoading && !query.trim() && (
<div className="py-6 text-center text-sm text-muted-foreground">
- Type to search issues
+ {t(($) => $.issue_picker.prompt_to_search)}
</div>
)}
{results.length > 0 && (
diff --git a/packages/views/modals/quick-create-issue.test.tsx b/packages/views/modals/quick-create-issue.test.tsx
index 786a6c2f38..ee466f39e6 100644
--- a/packages/views/modals/quick-create-issue.test.tsx
+++ b/packages/views/modals/quick-create-issue.test.tsx
@@ -192,8 +192,21 @@ vi.mock("sonner", () => ({
},
}));
+import { I18nProvider } from "@multica/core/i18n/react";
+import enCommon from "../locales/en/common.json";
+import enModals from "../locales/en/modals.json";
import { AgentCreatePanel } from "./quick-create-issue";
+const TEST_RESOURCES = { en: { common: enCommon, modals: enModals } };
+
+function renderPanel(props: React.ComponentProps<typeof AgentCreatePanel>) {
+ return render(
+ <I18nProvider locale="en" resources={TEST_RESOURCES}>
+ <AgentCreatePanel {...props} />
+ </I18nProvider>,
+ );
+}
+
describe("AgentCreatePanel", () => {
beforeEach(() => {
vi.clearAllMocks();
@@ -207,7 +220,7 @@ describe("AgentCreatePanel", () => {
});
it("loads the persisted prompt draft when no transient prompt is provided", () => {
- render(<AgentCreatePanel onClose={vi.fn()} />);
+ renderPanel({ onClose: vi.fn() });
expect(
screen.getByPlaceholderText(
@@ -220,7 +233,7 @@ describe("AgentCreatePanel", () => {
const user = userEvent.setup();
const onClose = vi.fn();
- render(<AgentCreatePanel onClose={onClose} />);
+ renderPanel({ onClose });
const editor = screen.getByPlaceholderText(
'Tell the agent what to do, e.g. "let Bohan fix the inbox loading slowness in the Web project"',
diff --git a/packages/views/modals/quick-create-issue.tsx b/packages/views/modals/quick-create-issue.tsx
index 9a0cea2011..b3faaf84b6 100644
--- a/packages/views/modals/quick-create-issue.tsx
+++ b/packages/views/modals/quick-create-issue.tsx
@@ -40,6 +40,7 @@ import {
FileDropOverlay,
} from "../editor";
import { FileUploadButton } from "@multica/ui/components/common/file-upload-button";
+import { useT } from "../i18n";
// AgentCreatePanel — agent-mode body of the create-issue dialog. Renders
// only the inner content; the surrounding `<Dialog>` AND `<DialogContent>`
@@ -59,6 +60,7 @@ export function AgentCreatePanel({
onSwitchMode?: () => void;
data?: Record<string, unknown> | null;
}) {
+ const { t } = useT("modals");
const workspaceName = useCurrentWorkspace()?.name;
const wsId = useWorkspaceId();
const userId = useAuthStore((s) => s.user?.id);
@@ -175,7 +177,7 @@ export function AgentCreatePanel({
setLastAgentId(agentId);
clearPrompt();
setLastMode("agent");
- toast.success("Sent to agent — you'll get an inbox notification when it's done", {
+ toast.success(t(($) => $.create_issue.agent.toast_sent), {
duration: 4000,
});
if (keepOpen) {
@@ -203,7 +205,7 @@ export function AgentCreatePanel({
min_version?: string;
};
if (body.code === "agent_unavailable") {
- setError(body.reason || "Agent is unavailable. Pick another agent.");
+ setError(body.reason || t(($) => $.create_issue.agent.error_agent_unavailable_fallback));
setSubmitting(false);
return;
}
@@ -214,13 +216,16 @@ export function AgentCreatePanel({
// consistency.
const cur = body.current_version || "unknown";
setError(
- `This agent's daemon CLI (${cur}) is below the required ${body.min_version || MIN_QUICK_CREATE_CLI_VERSION}. Upgrade the daemon to use Create with agent.`,
+ t(($) => $.create_issue.agent.error_daemon_version, {
+ current: cur,
+ min: body.min_version || MIN_QUICK_CREATE_CLI_VERSION,
+ }),
);
setSubmitting(false);
return;
}
}
- setError("Failed to submit. Try again.");
+ setError(t(($) => $.create_issue.agent.error_unknown));
} finally {
setSubmitting(false);
}
@@ -246,14 +251,14 @@ export function AgentCreatePanel({
return (
<>
- <DialogTitle className="sr-only">Quick create issue</DialogTitle>
+ <DialogTitle className="sr-only">{t(($) => $.create_issue.sr_agent)}</DialogTitle>
{/* Header */}
<div className="flex items-center justify-between px-5 pt-3 pb-2 shrink-0">
<div className="flex items-center gap-1.5 text-xs">
<span className="text-muted-foreground">{workspaceName}</span>
<ChevronRight className="size-3 text-muted-foreground/50" />
- <span className="font-medium">Create with agent</span>
+ <span className="font-medium">{t(($) => $.create_issue.agent_breadcrumb)}</span>
</div>
{/* Native `title` instead of Base UI Tooltip — Tooltip opens on
keyboard focus, and the dialog's focus trap briefly lands focus
@@ -262,8 +267,8 @@ export function AgentCreatePanel({
<button
type="button"
onClick={onClose}
- title="Close"
- aria-label="Close"
+ title={t(($) => $.common.close)}
+ aria-label={t(($) => $.common.close)}
className="rounded-sm p-1.5 opacity-70 hover:opacity-100 hover:bg-accent/60 transition-all cursor-pointer"
>
<XIcon className="size-4" />
@@ -277,10 +282,10 @@ export function AgentCreatePanel({
render={
<button
type="button"
- aria-label="Select agent"
+ aria-label={t(($) => $.create_issue.agent.select_agent_aria)}
className="flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer rounded-sm px-1.5 py-1 -ml-1.5 hover:bg-accent/60"
>
- <span>Created by</span>
+ <span>{t(($) => $.create_issue.agent.created_by)}</span>
{selectedAgent ? (
<span className="flex items-center gap-1.5 text-foreground">
<ActorAvatar
@@ -291,7 +296,7 @@ export function AgentCreatePanel({
{selectedAgent.name}
</span>
) : (
- <span>Pick an agent…</span>
+ <span>{t(($) => $.create_issue.agent.pick_an_agent)}</span>
)}
</button>
}
@@ -299,7 +304,7 @@ export function AgentCreatePanel({
<DropdownMenuContent align="start" className="w-64 max-h-72 overflow-y-auto">
{visibleAgents.length === 0 ? (
<div className="px-2 py-1.5 text-xs text-muted-foreground">
- No agents available.
+ {t(($) => $.create_issue.agent.no_agents)}
</div>
) : (
visibleAgents.map((a: Agent) => (
@@ -330,8 +335,11 @@ export function AgentCreatePanel({
{selectedAgent && versionBlocked && (
<div className="mx-5 mb-2 shrink-0 rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-xs text-amber-700 dark:text-amber-300">
{versionCheck.state === "missing"
- ? `This agent's daemon doesn't report a CLI version. Create with agent needs multica CLI ≥ ${versionCheck.min}. Upgrade the daemon and reconnect, or switch to manual create.`
- : `This agent's daemon CLI is ${versionCheck.current} — Create with agent needs ≥ ${versionCheck.min}. Upgrade the daemon, or switch to manual create.`}
+ ? t(($) => $.create_issue.agent.version_missing, { min: versionCheck.min })
+ : t(($) => $.create_issue.agent.version_below, {
+ current: versionCheck.current,
+ min: versionCheck.min,
+ })}
</div>
)}
@@ -349,7 +357,7 @@ export function AgentCreatePanel({
<ContentEditor
ref={editorRef}
defaultValue={initialPrompt}
- placeholder='Tell the agent what to do, e.g. "let Bohan fix the inbox loading slowness in the Web project"'
+ placeholder={t(($) => $.create_issue.agent.prompt_placeholder)}
onUpdate={(md) => {
setHasContent(md.trim().length > 0);
setPrompt(md);
@@ -375,7 +383,7 @@ export function AgentCreatePanel({
/>
{keepOpen && sentCount > 0 && (
<span className="text-xs text-emerald-600 dark:text-emerald-400">
- {sentCount} sent
+ {t(($) => $.create_issue.agent.sent_count, { count: sentCount })}
</span>
)}
</div>
@@ -383,11 +391,11 @@ export function AgentCreatePanel({
<button
type="button"
onClick={switchToManual}
- title="Switch to manual create — fill the fields yourself"
+ title={t(($) => $.create_issue.switch_to_manual_tooltip)}
className="flex shrink-0 items-center gap-1.5 text-xs px-2 py-1 rounded-sm text-muted-foreground hover:text-foreground hover:bg-accent/60 transition-colors cursor-pointer"
>
<ArrowLeftRight className="size-3.5" />
- Switch to Manual
+ {t(($) => $.create_issue.switch_to_manual)}
</button>
<label className="flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground cursor-pointer select-none">
<Switch
@@ -395,7 +403,7 @@ export function AgentCreatePanel({
checked={keepOpen}
onCheckedChange={setKeepOpen}
/>
- Create another
+ {t(($) => $.create_issue.create_another)}
</label>
<Button
size="sm"
@@ -403,14 +411,14 @@ export function AgentCreatePanel({
disabled={!hasContent || !agentId || submitting || versionBlocked || uploading}
title={
versionBlocked
- ? `Daemon CLI must be ≥ ${versionCheck.min}`
+ ? t(($) => $.create_issue.agent.version_blocked_tooltip, { min: versionCheck.min })
: undefined
}
className={justSent ? "min-w-28 !bg-emerald-600 !text-white" : "min-w-28"}
>
- {submitting ? "Sending…" : uploading ? "Uploading…" : justSent ? (
- <span className="flex items-center gap-1"><Check className="size-3.5" />Sent</span>
- ) : `Create (${formatShortcut(modKey, enterKey)})`}
+ {submitting ? t(($) => $.create_issue.agent.sending) : uploading ? t(($) => $.create_issue.agent.uploading) : justSent ? (
+ <span className="flex items-center gap-1"><Check className="size-3.5" />{t(($) => $.create_issue.agent.sent_label)}</span>
+ ) : `${t(($) => $.create_issue.agent.submit)} (${formatShortcut(modKey, enterKey)})`}
</Button>
</div>
</div>
diff --git a/packages/views/modals/set-parent-issue.tsx b/packages/views/modals/set-parent-issue.tsx
index 11c65f73a0..eb4c4b3c2a 100644
--- a/packages/views/modals/set-parent-issue.tsx
+++ b/packages/views/modals/set-parent-issue.tsx
@@ -6,6 +6,7 @@ import { useWorkspaceId } from "@multica/core/hooks";
import { childIssuesOptions } from "@multica/core/issues/queries";
import { useUpdateIssue } from "@multica/core/issues/mutations";
import { IssuePickerModal } from "./issue-picker-modal";
+import { useT } from "../i18n";
export function SetParentIssueModal({
onClose,
@@ -14,6 +15,7 @@ export function SetParentIssueModal({
onClose: () => void;
data: Record<string, unknown> | null;
}) {
+ const { t } = useT("modals");
const issueId = (data?.issueId as string) || "";
const wsId = useWorkspaceId();
const updateIssue = useUpdateIssue();
@@ -31,15 +33,15 @@ export function SetParentIssueModal({
onOpenChange={(v) => {
if (!v) onClose();
}}
- title="Set parent issue"
- description="Search for an issue to set as the parent of this issue"
+ title={t(($) => $.set_parent.title)}
+ description={t(($) => $.set_parent.description)}
excludeIds={excludeIds}
onSelect={(selected) => {
updateIssue.mutate(
{ id: issueId, parent_issue_id: selected.id },
- { onError: () => toast.error("Failed to update issue") },
+ { onError: () => toast.error(t(($) => $.set_parent.toast_failed)) },
);
- toast.success(`Set ${selected.identifier} as parent issue`);
+ toast.success(t(($) => $.set_parent.toast_success, { identifier: selected.identifier }));
}}
/>
);
diff --git a/packages/views/my-issues/components/my-issues-header.tsx b/packages/views/my-issues/components/my-issues-header.tsx
index d0bb136680..228afe5209 100644
--- a/packages/views/my-issues/components/my-issues-header.tsx
+++ b/packages/views/my-issues/components/my-issues-header.tsx
@@ -48,6 +48,7 @@ import {
import { Tooltip, TooltipTrigger, TooltipContent } from "@multica/ui/components/ui/tooltip";
import type { Issue } from "@multica/core/types";
import { myIssuesViewStore, type MyIssuesScope } from "@multica/core/issues/stores/my-issues-view-store";
+import { useT } from "../../i18n";
// ---------------------------------------------------------------------------
// HoverCheck
@@ -99,17 +100,17 @@ function useIssueCounts(allIssues: Issue[]) {
// Scope config
// ---------------------------------------------------------------------------
-const SCOPES: { value: MyIssuesScope; label: string; description: string }[] = [
- { value: "assigned", label: "Assigned", description: "Issues assigned to me" },
- { value: "created", label: "Created", description: "Issues I created" },
- { value: "agents", label: "My Agents", description: "Issues assigned to my agents" },
-];
-
// ---------------------------------------------------------------------------
// MyIssuesHeader
// ---------------------------------------------------------------------------
export function MyIssuesHeader({ allIssues }: { allIssues: Issue[] }) {
+ const { t } = useT("my-issues");
+ const SCOPES: { value: MyIssuesScope; label: string; description: string }[] = [
+ { value: "assigned", label: t(($) => $.header.scope.assigned_label), description: t(($) => $.header.scope.assigned_description) },
+ { value: "created", label: t(($) => $.header.scope.created_label), description: t(($) => $.header.scope.created_description) },
+ { value: "agents", label: t(($) => $.header.scope.agents_label), description: t(($) => $.header.scope.agents_description) },
+ ];
const viewMode = useStore(myIssuesViewStore, (s) => s.viewMode);
const statusFilters = useStore(myIssuesViewStore, (s) => s.statusFilters);
const priorityFilters = useStore(myIssuesViewStore, (s) => s.priorityFilters);
@@ -125,7 +126,7 @@ export function MyIssuesHeader({ allIssues }: { allIssues: Issue[] }) {
getActiveFilterCount({ statusFilters, priorityFilters }) > 0;
const sortLabel =
- SORT_OPTIONS.find((o) => o.value === sortBy)?.label ?? "Manual";
+ SORT_OPTIONS.find((o) => o.value === sortBy)?.label ?? t(($) => $.header.sort_manual);
return (
<div className="flex h-12 shrink-0 items-center justify-between px-4">
@@ -173,14 +174,14 @@ export function MyIssuesHeader({ allIssues }: { allIssues: Issue[] }) {
/>
}
/>
- <TooltipContent side="bottom">Filter</TooltipContent>
+ <TooltipContent side="bottom">{t(($) => $.header.filter_button)}</TooltipContent>
</Tooltip>
<DropdownMenuContent align="end" className="w-auto">
{/* Status */}
<DropdownMenuSub>
<DropdownMenuSubTrigger>
<CircleDot className="size-3.5" />
- <span className="flex-1">Status</span>
+ <span className="flex-1">{t(($) => $.header.filter_status)}</span>
{statusFilters.length > 0 && (
<span className="text-xs text-primary font-medium">
{statusFilters.length}
@@ -203,7 +204,7 @@ export function MyIssuesHeader({ allIssues }: { allIssues: Issue[] }) {
{STATUS_CONFIG[s].label}
{count > 0 && (
<span className="ml-auto text-xs text-muted-foreground">
- {count} {count === 1 ? "issue" : "issues"}
+ {t(($) => $.header.issue_count, { count })}
</span>
)}
</DropdownMenuCheckboxItem>
@@ -216,7 +217,7 @@ export function MyIssuesHeader({ allIssues }: { allIssues: Issue[] }) {
<DropdownMenuSub>
<DropdownMenuSubTrigger>
<SignalHigh className="size-3.5" />
- <span className="flex-1">Priority</span>
+ <span className="flex-1">{t(($) => $.header.filter_priority)}</span>
{priorityFilters.length > 0 && (
<span className="text-xs text-primary font-medium">
{priorityFilters.length}
@@ -239,7 +240,7 @@ export function MyIssuesHeader({ allIssues }: { allIssues: Issue[] }) {
{PRIORITY_CONFIG[p].label}
{count > 0 && (
<span className="ml-auto text-xs text-muted-foreground">
- {count} {count === 1 ? "issue" : "issues"}
+ {t(($) => $.header.issue_count, { count })}
</span>
)}
</DropdownMenuCheckboxItem>
@@ -253,7 +254,7 @@ export function MyIssuesHeader({ allIssues }: { allIssues: Issue[] }) {
<>
<DropdownMenuSeparator />
<DropdownMenuItem onClick={act.clearFilters}>
- Reset all filters
+ {t(($) => $.header.reset_filters)}
</DropdownMenuItem>
</>
)}
@@ -274,12 +275,12 @@ export function MyIssuesHeader({ allIssues }: { allIssues: Issue[] }) {
/>
}
/>
- <TooltipContent side="bottom">Display settings</TooltipContent>
+ <TooltipContent side="bottom">{t(($) => $.header.display_settings)}</TooltipContent>
</Tooltip>
<PopoverContent align="end" className="w-64 p-0">
<div className="border-b px-3 py-2.5">
<span className="text-xs font-medium text-muted-foreground">
- Ordering
+ {t(($) => $.header.ordering)}
</span>
<div className="mt-2 flex items-center gap-1.5">
<DropdownMenu>
@@ -314,7 +315,7 @@ export function MyIssuesHeader({ allIssues }: { allIssues: Issue[] }) {
sortDirection === "asc" ? "desc" : "asc",
)
}
- title={sortDirection === "asc" ? "Ascending" : "Descending"}
+ title={sortDirection === "asc" ? t(($) => $.header.ascending) : t(($) => $.header.descending)}
>
{sortDirection === "asc" ? (
<ArrowUp className="size-3.5" />
@@ -327,7 +328,7 @@ export function MyIssuesHeader({ allIssues }: { allIssues: Issue[] }) {
<div className="px-3 py-2.5">
<span className="text-xs font-medium text-muted-foreground">
- Card properties
+ {t(($) => $.header.card_properties)}
</span>
<div className="mt-2 space-y-2">
{CARD_PROPERTY_OPTIONS.map((opt) => (
@@ -367,19 +368,19 @@ export function MyIssuesHeader({ allIssues }: { allIssues: Issue[] }) {
}
/>
<TooltipContent side="bottom">
- {viewMode === "board" ? "Board view" : "List view"}
+ {viewMode === "board" ? t(($) => $.header.view_board) : t(($) => $.header.view_list)}
</TooltipContent>
</Tooltip>
<DropdownMenuContent align="end" className="w-auto">
<DropdownMenuGroup>
- <DropdownMenuLabel>View</DropdownMenuLabel>
+ <DropdownMenuLabel>{t(($) => $.header.view_label)}</DropdownMenuLabel>
<DropdownMenuItem onClick={() => act.setViewMode("board")}>
<Columns3 />
- Board
+ {t(($) => $.header.view_board_short)}
</DropdownMenuItem>
<DropdownMenuItem onClick={() => act.setViewMode("list")}>
<List />
- List
+ {t(($) => $.header.view_list_short)}
</DropdownMenuItem>
</DropdownMenuGroup>
</DropdownMenuContent>
diff --git a/packages/views/my-issues/components/my-issues-page.tsx b/packages/views/my-issues/components/my-issues-page.tsx
index 02380c0d44..0207480607 100644
--- a/packages/views/my-issues/components/my-issues-page.tsx
+++ b/packages/views/my-issues/components/my-issues-page.tsx
@@ -24,9 +24,11 @@ import { myIssueListOptions, childIssueProgressOptions, type MyIssuesFilter } fr
import { useUpdateIssue } from "@multica/core/issues/mutations";
import { myIssuesViewStore } from "@multica/core/issues/stores/my-issues-view-store";
import { PageHeader } from "../../layout/page-header";
+import { useT } from "../../i18n";
import { MyIssuesHeader } from "./my-issues-header";
export function MyIssuesPage() {
+ const { t } = useT("my-issues");
const user = useAuthStore((s) => s.user);
const workspace = useCurrentWorkspace();
const wsId = useWorkspaceId();
@@ -109,10 +111,10 @@ export function MyIssuesPage() {
updateIssueMutation.mutate(
{ id: issueId, ...updates },
- { onError: () => toast.error("Failed to move issue") },
+ { onError: () => toast.error(t(($) => $.errors.move_failed)) },
);
},
- [updateIssueMutation],
+ [updateIssueMutation, t],
);
if (loading) {
@@ -161,10 +163,10 @@ export function MyIssuesPage() {
<PageHeader className="gap-1.5">
<WorkspaceAvatar name={workspace?.name ?? "W"} size="sm" />
<span className="text-sm text-muted-foreground">
- {workspace?.name ?? "Workspace"}
+ {workspace?.name ?? t(($) => $.page.workspace_fallback)}
</span>
<ChevronRight className="h-3 w-3 text-muted-foreground" />
- <span className="text-sm font-medium">My Issues</span>
+ <span className="text-sm font-medium">{t(($) => $.page.breadcrumb)}</span>
</PageHeader>
{/* Header: scope tabs (left) + controls (right) */}
@@ -175,8 +177,8 @@ export function MyIssuesPage() {
{myIssues.length === 0 ? (
<div className="flex flex-1 min-h-0 flex-col items-center justify-center gap-2 text-muted-foreground">
<ListTodo className="h-10 w-10 text-muted-foreground/40" />
- <p className="text-sm">No issues assigned to you</p>
- <p className="text-xs">Issues you create or are assigned to will appear here.</p>
+ <p className="text-sm">{t(($) => $.page.empty_title)}</p>
+ <p className="text-xs">{t(($) => $.page.empty_description)}</p>
</div>
) : (
<div className="flex flex-col flex-1 min-h-0">
diff --git a/packages/views/onboarding/components/cloud-waitlist-expand.tsx b/packages/views/onboarding/components/cloud-waitlist-expand.tsx
index 4085c46389..138e75c4d0 100644
--- a/packages/views/onboarding/components/cloud-waitlist-expand.tsx
+++ b/packages/views/onboarding/components/cloud-waitlist-expand.tsx
@@ -8,6 +8,7 @@ import { Input } from "@multica/ui/components/ui/input";
import { Label } from "@multica/ui/components/ui/label";
import { Textarea } from "@multica/ui/components/ui/textarea";
import { joinCloudWaitlist } from "@multica/core/onboarding";
+import { useT } from "../../i18n";
const EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
const REASON_MAX = 500;
@@ -29,6 +30,7 @@ export function CloudWaitlistExpand({
submitted: boolean;
onSubmitted: () => void;
}) {
+ const { t } = useT("onboarding");
const [email, setEmail] = useState("");
const [reason, setReason] = useState("");
const [submitting, setSubmitting] = useState(false);
@@ -44,13 +46,11 @@ export function CloudWaitlistExpand({
setSubmitting(true);
try {
await joinCloudWaitlist(email.trim(), reason.trim());
- toast.success(
- "You're on the list. We'll email when cloud runtimes are live.",
- );
+ toast.success(t(($) => $.cloud_waitlist.success_toast));
onSubmitted();
} catch (err) {
toast.error(
- err instanceof Error ? err.message : "Failed to join waitlist",
+ err instanceof Error ? err.message : t(($) => $.cloud_waitlist.failed_toast),
);
} finally {
setSubmitting(false);
@@ -60,12 +60,9 @@ export function CloudWaitlistExpand({
return (
<div className="flex flex-col gap-4 rounded-lg border bg-muted/40 p-5">
<p className="text-[13.5px] leading-[1.55] text-foreground/85">
- Cloud runtimes aren&apos;t live yet. Leave your email and we&apos;ll
- reach out when they are.{" "}
+ {t(($) => $.cloud_waitlist.intro_main)}{" "}
<span className="text-foreground/70">
- Heads-up: agents can&apos;t execute tasks without a runtime — if
- you hit Skip now, your workspace is read-only until you come back
- and install one.
+ {t(($) => $.cloud_waitlist.intro_warning)}
</span>
</p>
@@ -74,7 +71,7 @@ export function CloudWaitlistExpand({
htmlFor="waitlist-email"
className="text-xs font-medium text-muted-foreground"
>
- Email
+ {t(($) => $.cloud_waitlist.email_label)}
</Label>
<Input
id="waitlist-email"
@@ -82,7 +79,7 @@ export function CloudWaitlistExpand({
autoComplete="email"
value={email}
disabled={submitted}
- placeholder="[email protected]"
+ placeholder={t(($) => $.cloud_waitlist.email_placeholder)}
onChange={(e) => setEmail(e.target.value)}
onKeyDown={(e) => {
if (e.key === "Enter") {
@@ -98,9 +95,9 @@ export function CloudWaitlistExpand({
htmlFor="waitlist-reason"
className="text-xs font-medium text-muted-foreground"
>
- Why cloud?
+ {t(($) => $.cloud_waitlist.reason_label)}
<span className="ml-2 font-normal text-muted-foreground/70">
- Optional
+ {t(($) => $.cloud_waitlist.optional)}
</span>
</Label>
<Textarea
@@ -108,7 +105,7 @@ export function CloudWaitlistExpand({
value={reason}
disabled={submitted}
onChange={(e) => setReason(e.target.value)}
- placeholder="e.g. we want agents running 24/7, or my team works across different devices."
+ placeholder={t(($) => $.cloud_waitlist.reason_placeholder)}
rows={3}
maxLength={REASON_MAX}
/>
@@ -120,11 +117,11 @@ export function CloudWaitlistExpand({
{submitted ? (
<>
<Check className="h-4 w-4" />
- You&apos;re on the list
+ {t(($) => $.cloud_waitlist.on_list)}
</>
) : (
<>
- Join waitlist
+ {t(($) => $.cloud_waitlist.join)}
<ArrowRight className="h-4 w-4" />
</>
)}
diff --git a/packages/views/onboarding/components/compact-runtime-row.tsx b/packages/views/onboarding/components/compact-runtime-row.tsx
index 64ea4e5dca..49a344bd48 100644
--- a/packages/views/onboarding/components/compact-runtime-row.tsx
+++ b/packages/views/onboarding/components/compact-runtime-row.tsx
@@ -1,6 +1,7 @@
import { cn } from "@multica/ui/lib/utils";
import type { AgentRuntime } from "@multica/core/types";
import { ProviderLogo } from "../../runtimes/components/provider-logo";
+import { useT } from "../../i18n";
/**
* One-line runtime row for Step 3's web CLI expand. Provider logo,
@@ -18,6 +19,7 @@ export function CompactRuntimeRow({
selected: boolean;
onSelect: () => void;
}) {
+ const { t: tAgents } = useT("agents");
const online = runtime.status === "online";
return (
<div
@@ -47,7 +49,7 @@ export function CompactRuntimeRow({
"h-2 w-2 shrink-0 rounded-full",
online ? "bg-success" : "bg-muted-foreground/40",
)}
- aria-label={online ? "Online" : "Offline"}
+ aria-label={online ? tAgents(($) => $.availability.online) : tAgents(($) => $.availability.offline)}
/>
</div>
);
diff --git a/packages/views/onboarding/components/option-card.tsx b/packages/views/onboarding/components/option-card.tsx
index 3a4ae8c00b..4754923f06 100644
--- a/packages/views/onboarding/components/option-card.tsx
+++ b/packages/views/onboarding/components/option-card.tsx
@@ -2,6 +2,7 @@
import { Input } from "@multica/ui/components/ui/input";
import { cn } from "@multica/ui/lib/utils";
+import { useT } from "../../i18n";
const OTHER_INPUT_MAX_LENGTH = 80;
@@ -64,6 +65,7 @@ export function OtherOptionCard({
onOtherChange: (value: string) => void;
placeholder: string;
}) {
+ const { t } = useT("onboarding");
return (
<div
className={cn(
@@ -82,7 +84,7 @@ export function OtherOptionCard({
>
<RadioMark selected={selected} />
<span className="text-[14.5px] font-normal leading-tight text-foreground">
- Other
+ {t(($) => $.option_card.other_label)}
</span>
</button>
{selected && (
diff --git a/packages/views/onboarding/components/runtime-aside-panel.tsx b/packages/views/onboarding/components/runtime-aside-panel.tsx
index 4f82f09eec..68cb5d3eac 100644
--- a/packages/views/onboarding/components/runtime-aside-panel.tsx
+++ b/packages/views/onboarding/components/runtime-aside-panel.tsx
@@ -1,3 +1,7 @@
+"use client";
+
+import { useT } from "../../i18n";
+
/**
* Shared right-rail aside for Step 3 (runtime).
*
@@ -7,34 +11,34 @@
* editorial shell's `<aside>` column.
*/
export function RuntimeAsidePanel() {
+ const { t } = useT("onboarding");
return (
<div className="flex flex-col gap-6">
<section>
<div className="mb-3 text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground">
- What&apos;s a runtime?
+ {t(($) => $.runtime_aside.what_eyebrow)}
</div>
<p className="text-[14px] leading-[1.6] text-foreground/80">
- A <strong className="font-medium text-foreground">runtime</strong>{" "}
- is a small background process that runs on your machine. It
- connects your workspace to AI coding tools like Claude Code or
- Codex, and executes the tasks your agents pick up.
+ {t(($) => $.runtime_aside.what_prefix)}
+ <strong className="font-medium text-foreground">{t(($) => $.runtime_aside.what_term)}</strong>
+ {t(($) => $.runtime_aside.what_suffix)}
</p>
</section>
<section>
<div className="mb-3 text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground">
- Good to know
+ {t(($) => $.runtime_aside.good_eyebrow)}
</div>
<div className="flex flex-col gap-4">
<AsideItem
glyph="↻"
- title="Swap anytime"
- body="Each agent's runtime is just a setting. Change it whenever you want."
+ title={t(($) => $.runtime_aside.swap_title)}
+ body={t(($) => $.runtime_aside.swap_body)}
/>
<AsideItem
glyph="∞"
- title="Add more later"
- body="You can connect a second runtime on another machine for a team, or a dedicated one per agent."
+ title={t(($) => $.runtime_aside.add_more_title)}
+ body={t(($) => $.runtime_aside.add_more_body)}
/>
</div>
</section>
@@ -45,7 +49,7 @@ export function RuntimeAsidePanel() {
rel="noopener noreferrer"
className="self-start text-[13px] text-muted-foreground underline underline-offset-4 transition-colors hover:text-foreground"
>
- Learn about runtimes →
+ {t(($) => $.runtime_aside.learn_more)}
</a>
</div>
);
diff --git a/packages/views/onboarding/components/starter-content-prompt.tsx b/packages/views/onboarding/components/starter-content-prompt.tsx
index 8ef1872b08..79a228c26e 100644
--- a/packages/views/onboarding/components/starter-content-prompt.tsx
+++ b/packages/views/onboarding/components/starter-content-prompt.tsx
@@ -26,6 +26,7 @@ import {
DialogTitle,
} from "@multica/ui/components/ui/dialog";
import { buildImportPayload } from "../utils/starter-content-templates";
+import { useT } from "../../i18n";
/**
* Post-onboarding opt-in dialog.
@@ -43,6 +44,7 @@ import { buildImportPayload } from "../utils/starter-content-templates";
* no client-side cache timing, no stale decisions, no Unknown bugs.
*/
export function StarterContentPrompt() {
+ const { t } = useT("onboarding");
const workspace = useCurrentWorkspace();
const user = useAuthStore((s) => s.user);
const refreshMe = useAuthStore((s) => s.refreshMe);
@@ -115,7 +117,7 @@ export function StarterContentPrompt() {
// component unmounts cleanly on the next render.
await refreshMe();
- toast.success("Starter tasks added — check your sidebar");
+ toast.success(t(($) => $.starter_content.success_toast));
// If the server took the agent-guided branch, a welcome issue
// exists and we jump to it. Otherwise, stay on the issues list —
@@ -127,7 +129,7 @@ export function StarterContentPrompt() {
}
} catch (err) {
toast.error(
- err instanceof Error ? err.message : "Import failed — please retry",
+ err instanceof Error ? err.message : t(($) => $.starter_content.import_failed),
);
setSubmitting(null);
}
@@ -143,7 +145,7 @@ export function StarterContentPrompt() {
toast.error(
err instanceof Error
? err.message
- : "Could not dismiss — please retry",
+ : t(($) => $.starter_content.dismiss_failed),
);
setSubmitting(null);
}
@@ -163,15 +165,14 @@ export function StarterContentPrompt() {
<DialogContent showCloseButton={false} className="sm:max-w-[440px]">
<DialogHeader>
<DialogTitle className="text-balance font-serif text-[22px] leading-[1.2] font-medium tracking-tight">
- Welcome — add starter tasks?
+ {t(($) => $.starter_content.title)}
</DialogTitle>
<DialogDescription className="pt-2 text-[14px] leading-[1.55]">
- A{" "}
+ {t(($) => $.starter_content.description_prefix)}
<span className="font-medium text-foreground">
- Getting Started
- </span>{" "}
- project with short tasks that walk through how agents, issues,
- and context work in Multica.
+ {t(($) => $.starter_content.description_term)}
+ </span>
+ {t(($) => $.starter_content.description_suffix)}
</DialogDescription>
</DialogHeader>
@@ -184,13 +185,13 @@ export function StarterContentPrompt() {
{submitting === "dismiss" && (
<Loader2 className="h-4 w-4 animate-spin" />
)}
- Start blank workspace
+ {t(($) => $.starter_content.dismiss_action)}
</Button>
<Button onClick={onImport} disabled={submitting !== null}>
{submitting === "import" && (
<Loader2 className="h-4 w-4 animate-spin" />
)}
- Add starter tasks
+ {t(($) => $.starter_content.import_action)}
</Button>
</DialogFooter>
</DialogContent>
diff --git a/packages/views/onboarding/components/step-header.test.tsx b/packages/views/onboarding/components/step-header.test.tsx
index 859222550c..7a0076ab79 100644
--- a/packages/views/onboarding/components/step-header.test.tsx
+++ b/packages/views/onboarding/components/step-header.test.tsx
@@ -1,8 +1,28 @@
+import type { ReactNode } from "react";
import { describe, expect, it } from "vitest";
-import { render, screen } from "@testing-library/react";
+import { render as rtlRender, screen, type RenderOptions } from "@testing-library/react";
import { ONBOARDING_STEP_ORDER } from "@multica/core/onboarding";
+import { I18nProvider } from "@multica/core/i18n/react";
+import enCommon from "../../locales/en/common.json";
+import enOnboarding from "../../locales/en/onboarding.json";
import { StepHeader } from "./step-header";
+const TEST_RESOURCES = {
+ en: { common: enCommon, onboarding: enOnboarding },
+};
+
+function I18nWrapper({ children }: { children: ReactNode }) {
+ return (
+ <I18nProvider locale="en" resources={TEST_RESOURCES}>
+ {children}
+ </I18nProvider>
+ );
+}
+
+function render(ui: React.ReactElement, options?: RenderOptions) {
+ return rtlRender(ui, { wrapper: I18nWrapper, ...options });
+}
+
describe("StepHeader", () => {
it("renders one dot per step in ONBOARDING_STEP_ORDER", () => {
const { container } = render(<StepHeader currentStep="questionnaire" />);
diff --git a/packages/views/onboarding/components/step-header.tsx b/packages/views/onboarding/components/step-header.tsx
index 7959efb591..2e97948ef5 100644
--- a/packages/views/onboarding/components/step-header.tsx
+++ b/packages/views/onboarding/components/step-header.tsx
@@ -5,6 +5,7 @@ import {
type OnboardingStep,
} from "@multica/core/onboarding";
import { cn } from "@multica/ui/lib/utils";
+import { useT } from "../../i18n";
/**
* Horizontal step indicator shown at the top of every onboarding step
@@ -30,6 +31,7 @@ import { cn } from "@multica/ui/lib/utils";
* mapping from local UI step to the canonical `OnboardingStep`.
*/
export function StepHeader({ currentStep }: { currentStep: OnboardingStep }) {
+ const { t } = useT("onboarding");
const total = ONBOARDING_STEP_ORDER.length;
const currentIndex = ONBOARDING_STEP_ORDER.indexOf(currentStep);
// Defensive: unknown step → render a disabled-looking header rather
@@ -43,7 +45,7 @@ export function StepHeader({ currentStep }: { currentStep: OnboardingStep }) {
aria-valuemin={1}
aria-valuemax={total}
aria-valuenow={safeIndex + 1}
- aria-label={`Step ${safeIndex + 1} of ${total}`}
+ aria-label={t(($) => $.step_header.step_of, { current: safeIndex + 1, total })}
className="flex w-full items-center justify-between py-2"
>
<div className="flex items-center gap-2">
@@ -65,7 +67,7 @@ export function StepHeader({ currentStep }: { currentStep: OnboardingStep }) {
})}
</div>
<span className="text-xs font-medium text-muted-foreground">
- Step {safeIndex + 1} of {total}
+ {t(($) => $.step_header.step_of, { current: safeIndex + 1, total })}
</span>
</div>
);
diff --git a/packages/views/onboarding/onboarding-flow.tsx b/packages/views/onboarding/onboarding-flow.tsx
index 2369b31132..460a79d104 100644
--- a/packages/views/onboarding/onboarding-flow.tsx
+++ b/packages/views/onboarding/onboarding-flow.tsx
@@ -24,6 +24,7 @@ import { StepRuntimeConnect } from "./steps/step-runtime-connect";
import { StepPlatformFork } from "./steps/step-platform-fork";
import { StepAgent } from "./steps/step-agent";
import { StepFirstIssue } from "./steps/step-first-issue";
+import { useT } from "../i18n";
const EMPTY_QUESTIONNAIRE: QuestionnaireAnswers = {
team_size: null,
@@ -55,6 +56,7 @@ export function OnboardingFlow({
onComplete: (workspace?: Workspace) => void;
runtimeInstructions?: React.ReactNode;
}) {
+ const { t } = useT("onboarding");
const user = useAuthStore((s) => s.user);
if (!user) {
throw new Error("OnboardingFlow requires an authenticated user");
@@ -114,7 +116,7 @@ export function OnboardingFlow({
await completeOnboarding("skip_existing");
} catch (err) {
toast.error(
- err instanceof Error ? err.message : "Failed to finish onboarding",
+ err instanceof Error ? err.message : t(($) => $.errors.skip_failed),
);
return;
}
diff --git a/packages/views/onboarding/steps/cli-install-instructions.tsx b/packages/views/onboarding/steps/cli-install-instructions.tsx
index 7bbcd4da58..022877ae9f 100644
--- a/packages/views/onboarding/steps/cli-install-instructions.tsx
+++ b/packages/views/onboarding/steps/cli-install-instructions.tsx
@@ -3,12 +3,14 @@
import { useState } from "react";
import { Check, Copy, Terminal } from "lucide-react";
import { Card, CardContent } from "@multica/ui/components/ui/card";
+import { useT } from "../../i18n";
const INSTALL_CMD =
"curl -fsSL https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.sh | bash";
const SETUP_CMD = "multica setup";
function CopyButton({ text }: { text: string }) {
+ const { t } = useT("onboarding");
const [copied, setCopied] = useState(false);
const handleCopy = () => {
@@ -22,7 +24,7 @@ function CopyButton({ text }: { text: string }) {
type="button"
onClick={handleCopy}
className="shrink-0 rounded p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"
- aria-label="Copy"
+ aria-label={t(($) => $.cli_install.copy_aria)}
>
{copied ? (
<Check className="h-3.5 w-3.5 text-success" />
@@ -59,16 +61,15 @@ function Step({ n, label, cmd }: { n: number; label: string; cmd: string }) {
* thread env vars through React.
*/
export function CliInstallInstructions() {
+ const { t } = useT("onboarding");
return (
<Card className="w-full">
<CardContent className="space-y-4 pt-4">
<p className="text-xs leading-[1.55] text-muted-foreground">
- You&apos;ll need an AI coding tool on this machine (Claude
- Code, Codex, Cursor, …) for the daemon to do real work. Also
- works on servers and remote dev boxes.
+ {t(($) => $.cli_install.intro)}
</p>
- <Step n={1} label="Install the Multica CLI" cmd={INSTALL_CMD} />
- <Step n={2} label="Start the daemon" cmd={SETUP_CMD} />
+ <Step n={1} label={t(($) => $.cli_install.step1_label)} cmd={INSTALL_CMD} />
+ <Step n={2} label={t(($) => $.cli_install.step2_label)} cmd={SETUP_CMD} />
</CardContent>
</Card>
);
diff --git a/packages/views/onboarding/steps/step-agent.tsx b/packages/views/onboarding/steps/step-agent.tsx
index 12dd47b570..ef46362e3e 100644
--- a/packages/views/onboarding/steps/step-agent.tsx
+++ b/packages/views/onboarding/steps/step-agent.tsx
@@ -19,6 +19,7 @@ import type {
} from "@multica/core/types";
import { DragStrip } from "@multica/views/platform";
import { StepHeader } from "../components/step-header";
+import { useT } from "../../i18n";
/**
* Step 4 — create the user's first agent.
@@ -50,50 +51,32 @@ interface AgentTemplate {
instructions: string;
}
-const AGENT_TEMPLATES: readonly AgentTemplate[] = [
- {
- id: "coding",
- label: "Coding Agent",
- defaultName: "Atlas",
- emoji: "⌘",
- blurb: "Writes, refactors, and ships code. Reads your repo.",
- instructions:
- "You are a Coding Agent on a product team. Pick up coding issues — implement features, fix bugs, write tests, and open pull requests. Read the repository before you start, follow existing code conventions, and keep diffs focused. Ask for clarification when the acceptance criteria are ambiguous.",
- },
- {
- id: "planning",
- label: "Planning Agent",
- defaultName: "Orion",
- emoji: "◐",
- blurb: "Breaks down work, drafts specs, keeps the board tidy.",
- instructions:
- "You are a Planning Agent. Turn loose ideas and open issues into scoped, ready-to-execute work: break them down into subtasks, write acceptance criteria, and propose owners and sequencing. Prefer clarity over speed. When blocked by missing context, ask one specific question rather than guessing.",
- },
- {
- id: "writing",
- label: "Writing Agent",
- defaultName: "Mira",
- emoji: "✎",
- blurb: "Drafts, summarizes, researches. Long-form friendly.",
- instructions:
- "You are a Writing Agent. Draft documents, summarize long content, and research topics on the web when needed. Structure your output as finished prose a reader can use directly — not an outline. Cite sources when you draw from them. Match the tone the user establishes in the issue.",
- },
- {
- id: "assistant",
- label: "Assistant",
- defaultName: "Vega",
- emoji: "✦",
- blurb: "General-purpose. Good default when the task is unclear.",
- instructions:
- "You are a general-purpose teammate. Handle varied tasks — light coding, writing, research, planning — and stay pragmatic about scope. When the task is ambiguous, ask one clarifying question before diving in. Default to short, useful outputs over exhaustive ones.",
- },
+// Defaults stay constant (names + emoji are visual identity, not copy);
+// label / blurb / instructions resolve from the bundle at render time.
+const TEMPLATE_DEFAULTS: readonly Omit<AgentTemplate, "label" | "blurb" | "instructions">[] = [
+ { id: "coding", defaultName: "Atlas", emoji: "⌘" },
+ { id: "planning", defaultName: "Orion", emoji: "◐" },
+ { id: "writing", defaultName: "Mira", emoji: "✎" },
+ { id: "assistant", defaultName: "Vega", emoji: "✦" },
] as const;
-const TEMPLATE_BY_ID: Record<AgentTemplateId, AgentTemplate> =
- Object.fromEntries(AGENT_TEMPLATES.map((t) => [t.id, t])) as Record<
+function useAgentTemplates(): {
+ templates: readonly AgentTemplate[];
+ byId: Record<AgentTemplateId, AgentTemplate>;
+} {
+ const { t } = useT("onboarding");
+ const templates = TEMPLATE_DEFAULTS.map((d) => ({
+ ...d,
+ label: t(($) => $.step_agent.templates[d.id].label),
+ blurb: t(($) => $.step_agent.templates[d.id].blurb),
+ instructions: t(($) => $.step_agent.templates[d.id].instructions),
+ })) as readonly AgentTemplate[];
+ const byId = Object.fromEntries(templates.map((tpl) => [tpl.id, tpl])) as Record<
AgentTemplateId,
AgentTemplate
>;
+ return { templates, byId };
+}
export function StepAgent({
runtime,
@@ -106,6 +89,8 @@ export function StepAgent({
onCreated: (agent: Agent) => void | Promise<void>;
onBack?: () => void;
}) {
+ const { t } = useT("onboarding");
+ const { templates: AGENT_TEMPLATES, byId: TEMPLATE_BY_ID } = useAgentTemplates();
const recommendedId = recommendTemplate(questionnaire);
const recommended = TEMPLATE_BY_ID[recommendedId];
@@ -131,7 +116,7 @@ export function StepAgent({
await onCreated(agent);
} catch (err) {
toast.error(
- err instanceof Error ? err.message : "Failed to create agent",
+ err instanceof Error ? err.message : t(($) => $.step_agent.create_failed),
);
setCreating(false);
}
@@ -154,7 +139,7 @@ export function StepAgent({
className="flex items-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground"
>
<ArrowLeft className="h-3.5 w-3.5" />
- Back
+ {t(($) => $.common.back)}
</button>
) : (
<span aria-hidden className="w-0" />
@@ -174,19 +159,17 @@ export function StepAgent({
>
<div className="mx-auto w-full max-w-[620px] px-6 py-10 sm:px-10 md:px-14 lg:px-0 lg:py-14">
<div className="mb-2 text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground">
- Your first agent
+ {t(($) => $.step_agent.eyebrow)}
</div>
<h1 className="text-balance font-serif text-[36px] font-medium leading-[1.1] tracking-tight text-foreground">
- Meet your first teammate.
+ {t(($) => $.step_agent.headline)}
</h1>
<p className="mt-4 text-[15.5px] leading-[1.55] text-foreground/80">
- Your answers point to a{" "}
+ {t(($) => $.step_agent.lede_prefix)}
<strong className="font-medium text-foreground">
{recommended.label}
</strong>
- . Pick whichever of the four fits you — each template ships
- ready to take its first issue. You can retune its
- instructions from the agent settings page later.
+ {t(($) => $.step_agent.lede_suffix)}
</p>
<div className="mt-10 grid grid-cols-1 gap-3 sm:grid-cols-2">
@@ -208,11 +191,11 @@ export function StepAgent({
the agent IS this step. */}
<footer className="flex shrink-0 items-center justify-between gap-4 bg-background px-6 py-4 sm:px-10 md:px-14 lg:px-16">
<span className="hidden text-xs text-muted-foreground sm:block">
- One agent is enough to start. Add more from the sidebar later.
+ {t(($) => $.step_agent.footer_hint)}
</span>
<Button size="lg" onClick={handleCreate} disabled={creating}>
{creating && <Loader2 className="h-4 w-4 animate-spin" />}
- Create {template.defaultName}
+ {t(($) => $.step_agent.create_action, { name: template.defaultName })}
<ArrowRight className="h-4 w-4" />
</Button>
</footer>
@@ -240,6 +223,7 @@ function TemplateCard({
recommended: boolean;
onSelect: () => void;
}) {
+ const { t } = useT("onboarding");
return (
<button
type="button"
@@ -262,7 +246,7 @@ function TemplateCard({
</span>
{recommended && (
<span className="shrink-0 rounded-full bg-brand/10 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wider text-brand">
- Recommended
+ {t(($) => $.step_agent.recommended_badge)}
</span>
)}
</div>
@@ -279,53 +263,51 @@ function TemplateCard({
}
function AboutAgentsSide() {
+ const { t } = useT("onboarding");
return (
<div className="flex max-w-[380px] flex-col gap-8">
<section className="flex flex-col gap-4">
<div className="text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground">
- What&apos;s an agent
+ {t(($) => $.step_agent.about_eyebrow)}
</div>
<h2 className="font-serif text-[22px] font-medium leading-[1.25] tracking-tight text-foreground">
- An AI teammate that lives in your workspace.
+ {t(($) => $.step_agent.about_headline)}
</h2>
<p className="text-[14px] leading-[1.6] text-foreground/80">
- Agents show up in every assignee picker, just like any other
- colleague — except they can work 24/7 on whatever runtime you
- give them.
+ {t(($) => $.step_agent.about_body)}
</p>
</section>
<section className="flex flex-col gap-4">
<div className="text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground">
- Ways to work with an agent
+ {t(($) => $.step_agent.ways_eyebrow)}
</div>
<div className="flex flex-col gap-4">
<WayItem
glyph="→"
- title="Assign it an issue"
- body="It picks up the task and reports back in the thread."
+ title={t(($) => $.step_agent.way_assign_title)}
+ body={t(($) => $.step_agent.way_assign_body)}
/>
<WayItem
glyph="@"
- title="@mention in a comment"
- body="Pull it into a conversation for a quick take."
+ title={t(($) => $.step_agent.way_mention_title)}
+ body={t(($) => $.step_agent.way_mention_body)}
/>
<WayItem
glyph="◯"
- title="Chat one-on-one"
- body="Ask quick questions without creating an issue."
+ title={t(($) => $.step_agent.way_chat_title)}
+ body={t(($) => $.step_agent.way_chat_body)}
/>
<WayItem
glyph="↻"
- title="Put it on Autopilot"
- body="Daily triage, weekly digest, monthly audit — on a schedule."
+ title={t(($) => $.step_agent.way_autopilot_title)}
+ body={t(($) => $.step_agent.way_autopilot_body)}
/>
</div>
</section>
<p className="text-[13px] leading-[1.55] text-muted-foreground">
- Add more agents anytime. A small team of specialized agents beats
- one jack-of-all-trades.
+ {t(($) => $.step_agent.add_more_hint)}
</p>
<a
@@ -334,7 +316,7 @@ function AboutAgentsSide() {
rel="noopener noreferrer"
className="self-start text-[13px] text-muted-foreground underline underline-offset-4 transition-colors hover:text-foreground"
>
- Creating your first agent →
+ {t(($) => $.step_agent.docs_link)}
</a>
</div>
);
diff --git a/packages/views/onboarding/steps/step-first-issue.tsx b/packages/views/onboarding/steps/step-first-issue.tsx
index 3dadc3a307..31d45fd390 100644
--- a/packages/views/onboarding/steps/step-first-issue.tsx
+++ b/packages/views/onboarding/steps/step-first-issue.tsx
@@ -8,6 +8,7 @@ import {
completeOnboarding,
type OnboardingCompletionPath,
} from "@multica/core/onboarding";
+import { useT } from "../../i18n";
/**
* Step 5 — the final onboarding beat.
@@ -38,6 +39,7 @@ export function StepFirstIssue({
* both in scope. */
completionPath: OnboardingCompletionPath;
}) {
+ const { t } = useT("onboarding");
const [error, setError] = useState<string | null>(null);
const [retrying, setRetrying] = useState(false);
const started = useRef(false);
@@ -55,11 +57,11 @@ export function StepFirstIssue({
onFinishedRef.current();
} catch (err) {
setError(
- err instanceof Error ? err.message : "Failed to finish onboarding",
+ err instanceof Error ? err.message : t(($) => $.errors.skip_failed),
);
}
})();
- }, []);
+ }, [t]);
const retry = async () => {
if (retrying) return;
@@ -69,8 +71,9 @@ export function StepFirstIssue({
await completeOnboarding(completionPathRef.current);
onFinishedRef.current();
} catch (err) {
- setError(err instanceof Error ? err.message : "Retry failed");
- toast.error(err instanceof Error ? err.message : "Retry failed");
+ const msg = err instanceof Error ? err.message : t(($) => $.first_issue.retry_failed);
+ setError(msg);
+ toast.error(msg);
} finally {
setRetrying(false);
}
@@ -84,13 +87,13 @@ export function StepFirstIssue({
</div>
<div className="flex flex-col gap-2">
<h1 className="text-2xl font-semibold tracking-tight">
- Something went wrong
+ {t(($) => $.first_issue.error_title)}
</h1>
<p className="text-sm text-muted-foreground">{error}</p>
</div>
<Button onClick={retry} disabled={retrying}>
{retrying && <Loader2 className="h-4 w-4 animate-spin" />}
- Retry
+ {t(($) => $.first_issue.retry)}
</Button>
</div>
);
@@ -101,10 +104,10 @@ export function StepFirstIssue({
<Loader2 className="h-10 w-10 animate-spin text-primary" />
<div className="flex flex-col gap-2">
<h1 className="text-2xl font-semibold tracking-tight">
- Finishing up
+ {t(($) => $.first_issue.finishing)}
</h1>
<p className="text-sm text-muted-foreground">
- Almost there — opening your workspace.
+ {t(($) => $.first_issue.opening)}
</p>
</div>
</div>
diff --git a/packages/views/onboarding/steps/step-platform-fork.test.tsx b/packages/views/onboarding/steps/step-platform-fork.test.tsx
index 37ecf0789b..539c6fef08 100644
--- a/packages/views/onboarding/steps/step-platform-fork.test.tsx
+++ b/packages/views/onboarding/steps/step-platform-fork.test.tsx
@@ -2,6 +2,11 @@ import { describe, expect, it, vi, beforeEach } from "vitest";
import { render, screen, within } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import type { AgentRuntime } from "@multica/core/types";
+import { I18nProvider } from "@multica/core/i18n/react";
+import enCommon from "../../locales/en/common.json";
+import enOnboarding from "../../locales/en/onboarding.json";
+
+const TEST_RESOURCES = { en: { common: enCommon, onboarding: enOnboarding } };
// Mock the core onboarding module BEFORE the SUT imports it.
const mocks = vi.hoisted(() => ({
@@ -59,12 +64,14 @@ function renderFork(
) {
const onNext = vi.fn();
render(
- <StepPlatformFork
- wsId="ws_test"
- onNext={onNext}
- cliInstructions={<div data-testid="cli-instructions">install me</div>}
- {...overrides}
- />,
+ <I18nProvider locale="en" resources={TEST_RESOURCES}>
+ <StepPlatformFork
+ wsId="ws_test"
+ onNext={onNext}
+ cliInstructions={<div data-testid="cli-instructions">install me</div>}
+ {...overrides}
+ />
+ </I18nProvider>,
);
return { onNext };
}
diff --git a/packages/views/onboarding/steps/step-platform-fork.tsx b/packages/views/onboarding/steps/step-platform-fork.tsx
index 29feb28ded..822793c2db 100644
--- a/packages/views/onboarding/steps/step-platform-fork.tsx
+++ b/packages/views/onboarding/steps/step-platform-fork.tsx
@@ -25,6 +25,7 @@ import { RuntimeAsidePanel } from "../components/runtime-aside-panel";
import { CompactRuntimeRow } from "../components/compact-runtime-row";
import { useRuntimePicker } from "../components/use-runtime-picker";
import { CloudWaitlistExpand } from "../components/cloud-waitlist-expand";
+import { useT } from "../../i18n";
/**
* Step 3 on **web**. The user is in a browser and hasn't downloaded
@@ -74,6 +75,7 @@ export function StepPlatformFork({
* submitting the waitlist form. */
onWaitlistSubmitted?: () => void;
}) {
+ const { t } = useT("onboarding");
const mainRef = useRef<HTMLElement>(null);
const fadeStyle = useScrollFade(mainRef);
@@ -137,12 +139,12 @@ export function StepPlatformFork({
const footerHint = (() => {
if (waitlistSubmitted) {
- return "You're on the waitlist — pick Skip to keep exploring.";
+ return t(($) => $.step_platform.hint_waitlist);
}
if (downloaded) {
- return "Finish setup on the download page, then come back to this tab.";
+ return t(($) => $.step_platform.hint_downloaded);
}
- return "Pick a path above — or skip and configure a runtime later.";
+ return t(($) => $.step_platform.hint_default);
})();
return (
@@ -159,7 +161,7 @@ export function StepPlatformFork({
className="flex items-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground"
>
<ArrowLeft className="h-3.5 w-3.5" />
- Back
+ {t(($) => $.common.back)}
</button>
) : (
<span aria-hidden className="w-0" />
@@ -176,31 +178,32 @@ export function StepPlatformFork({
>
<div className="mx-auto w-full max-w-[620px] px-6 py-10 sm:px-10 md:px-14 lg:px-0 lg:py-14">
<div className="mb-2 text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground">
- Step 3 · Runtime
+ {t(($) => $.step_platform.eyebrow)}
</div>
<h1 className="text-balance font-serif text-[36px] font-medium leading-[1.1] tracking-tight text-foreground">
- Connect a runtime.
+ {t(($) => $.step_platform.headline)}
</h1>
<p className="mt-4 max-w-[560px] text-[15.5px] leading-[1.55] text-muted-foreground">
- A runtime is what actually runs your agents&apos; work. Pick
- how you&apos;d like to set one up.
+ {t(($) => $.step_platform.lede)}
</p>
<div className="mt-10 flex max-w-[560px] flex-col gap-3.5">
<ForkPrimary onClick={pickDesktop} downloaded={downloaded} />
<ForkAlt
- title="Install the CLI"
- subtitle="For servers, remote dev boxes, and headless setups. Terminal required."
- actionLabel="Show steps"
+ title={t(($) => $.step_platform.cli_title)}
+ subtitle={t(($) => $.step_platform.cli_subtitle)}
+ actionLabel={t(($) => $.step_platform.cli_action)}
onAction={handleOpenCli}
/>
<ForkAlt
- title="Cloud runtime"
- subtitle="We host the runtime. Not live yet — join the waitlist."
+ title={t(($) => $.step_platform.cloud_title)}
+ subtitle={t(($) => $.step_platform.cloud_subtitle)}
actionLabel={
- waitlistSubmitted ? "On the list" : "Join waitlist"
+ waitlistSubmitted
+ ? t(($) => $.step_platform.cloud_action_done)
+ : t(($) => $.step_platform.cloud_action)
}
onAction={handleOpenCloud}
/>
@@ -219,7 +222,7 @@ export function StepPlatformFork({
{footerHint}
</span>
<Button variant="secondary" onClick={() => onNext(null)}>
- Skip for now
+ {t(($) => $.step_runtime.skip)}
</Button>
</footer>
</div>
@@ -269,6 +272,7 @@ function ForkPrimary({
onClick: () => void;
downloaded: boolean;
}) {
+ const { t } = useT("onboarding");
return (
<button
type="button"
@@ -281,19 +285,21 @@ function ForkPrimary({
<div className="min-w-0">
<div className="flex items-center gap-2 text-[17px] font-medium tracking-tight">
<Download className="h-4 w-4" aria-hidden />
- {downloaded ? "Continuing on the download page…" : "Download the desktop app"}
+ {downloaded
+ ? t(($) => $.step_platform.download_title_after)
+ : t(($) => $.step_platform.download_title)}
</div>
<div className="mt-1 text-[13px] text-background/60">
{downloaded
- ? "Opened in a new tab. Pick your installer there, then finish setup on desktop."
- : "Bundled daemon, zero setup. Pick your platform on the next page."}
+ ? t(($) => $.step_platform.download_subtitle_after)
+ : t(($) => $.step_platform.download_subtitle)}
</div>
</div>
<span
aria-hidden
className="inline-flex shrink-0 items-center gap-1.5 rounded-full bg-background/10 px-4 py-2 text-[13px] font-medium transition-colors group-hover:bg-background/20"
>
- Download
+ {t(($) => $.step_platform.download_button)}
<ArrowRight className="h-3.5 w-3.5" />
</span>
</button>
@@ -371,34 +377,26 @@ function CliInstallDialog({
selectedName: string | null;
cliInstructions?: ReactNode;
}) {
+ const { t } = useT("onboarding");
return (
<Dialog open={open} onOpenChange={(o) => (o ? null : onClose())}>
- {/* max-h + flex column so an unbounded runtime list (N machines)
- triggers internal scrolling instead of pushing the footer's
- Connect button below the viewport. */}
<DialogContent className="flex max-h-[85vh] flex-col sm:max-w-[560px]">
<DialogHeader>
- <DialogTitle>Install the CLI</DialogTitle>
+ <DialogTitle>{t(($) => $.step_platform.cli_dialog_title)}</DialogTitle>
<DialogDescription>
- Same daemon as Desktop, installed via terminal. Use it when
- Desktop doesn&apos;t fit — servers, remote dev boxes, or
- headless setups.
+ {t(($) => $.step_platform.cli_dialog_description)}
</DialogDescription>
</DialogHeader>
<div className="flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto pt-2">
{cliInstructions}
- {/* Live probe. Shows a staged waiting message with elapsed-
- time fallbacks while no runtime is detected; flips to
- a success list once the daemon registers via WS. */}
{hasRuntimes ? (
<>
<div className="flex items-center gap-2 pt-1 text-sm">
<div className="h-2 w-2 rounded-full bg-success" />
<span className="font-medium">
- {runtimes.length} runtime{runtimes.length > 1 ? "s" : ""}{" "}
- connected
+ {t(($) => $.step_platform.runtimes_connected, { count: runtimes.length })}
</span>
</div>
{/* Cap the runtime list at ~4 rows visible, scroll the rest.
@@ -428,16 +426,16 @@ function CliInstallDialog({
<span className="text-xs text-muted-foreground">
{hasRuntimes
? canConnect && selectedName
- ? `Selected: ${selectedName}`
- : "Pick a runtime above."
+ ? t(($) => $.step_runtime.hint_selected, { name: selectedName })
+ : t(($) => $.step_platform.cli_dialog_pick_hint)
: null}
</span>
<div className="flex items-center gap-2">
<Button variant="ghost" onClick={onClose}>
- Cancel
+ {t(($) => $.step_runtime.dialog_cancel)}
</Button>
<Button disabled={!canConnect} onClick={onConnect}>
- Connect &amp; continue
+ {t(($) => $.step_platform.cli_dialog_connect)}
<ArrowRight className="h-4 w-4" />
</Button>
</div>
@@ -479,6 +477,7 @@ function formatElapsed(seconds: number) {
* after closing resets the staging.
*/
function CliWaitingStatus({ dialogOpen }: { dialogOpen: boolean }) {
+ const { t } = useT("onboarding");
const [elapsed, setElapsed] = useState(0);
useEffect(() => {
@@ -520,7 +519,7 @@ function CliWaitingStatus({ dialogOpen }: { dialogOpen: boolean }) {
className="inline-block size-2 shrink-0 rounded-full bg-success animate-pulse"
/>
<span className="font-medium text-foreground">
- Live · Listening for your daemon
+ {t(($) => $.step_platform.live_listening)}
</span>
<span className="ml-auto font-mono text-xs tabular-nums text-muted-foreground">
{formatElapsed(elapsed)}
@@ -533,32 +532,30 @@ function CliWaitingStatus({ dialogOpen }: { dialogOpen: boolean }) {
>
{stage === "normal" && (
<>
- Run the command above. As soon as{" "}
- <span className="font-mono">multica setup</span> finishes
- browser sign-in and the daemon starts, your runtime will
- appear here automatically (usually 10–30 seconds).
+ {t(($) => $.step_platform.stage_normal_prefix)}
+ <span className="font-mono">{"multica setup"}</span>
+ {t(($) => $.step_platform.stage_normal_suffix)}
</>
)}
{stage === "midway" && (
<>
- Still listening. Make sure you finished the browser tab that{" "}
- <span className="font-mono">multica setup</span> opened — it
- needs you to approve the sign-in before the daemon can start.
+ {t(($) => $.step_platform.stage_midway_prefix)}
+ <span className="font-mono">{"multica setup"}</span>
+ {t(($) => $.step_platform.stage_midway_suffix)}
</>
)}
{stage === "slow" && (
<>
- Taking longer than usual. Check the terminal where you ran{" "}
- <span className="font-mono">multica setup</span> for errors.
+ {t(($) => $.step_platform.stage_slow_prefix)}
+ <span className="font-mono">{"multica setup"}</span>
+ {t(($) => $.step_platform.stage_slow_suffix)}
</>
)}
{stage === "stalled" && (
<>
- Nothing coming through yet. If you&apos;re not comfortable
- with the terminal,{" "}
- <span className="font-medium text-foreground">Desktop</span>{" "}
- is the smoother path — it bundles the daemon. Close this
- dialog and pick Desktop, or hit Skip to continue.
+ {t(($) => $.step_platform.stage_stalled_prefix)}
+ <span className="font-medium text-foreground">{t(($) => $.step_platform.stage_stalled_term)}</span>
+ {t(($) => $.step_platform.stage_stalled_suffix)}
</>
)}
</p>
@@ -587,14 +584,14 @@ function CloudWaitlistDialog({
submitted: boolean;
onSubmitted: () => void;
}) {
+ const { t } = useT("onboarding");
return (
<Dialog open={open} onOpenChange={(o) => (o ? null : onClose())}>
<DialogContent className="flex max-h-[85vh] flex-col sm:max-w-[520px]">
<DialogHeader>
- <DialogTitle>Join the cloud runtime waitlist</DialogTitle>
+ <DialogTitle>{t(($) => $.step_runtime.dialog_title)}</DialogTitle>
<DialogDescription>
- Cloud runtimes aren&apos;t live yet. Leave your email and
- we&apos;ll email you when they are.
+ {t(($) => $.step_runtime.dialog_description)}
</DialogDescription>
</DialogHeader>
@@ -607,7 +604,9 @@ function CloudWaitlistDialog({
<DialogFooter>
<Button variant="ghost" onClick={onClose}>
- {submitted ? "Close" : "Cancel"}
+ {submitted
+ ? t(($) => $.step_runtime.dialog_close)
+ : t(($) => $.step_runtime.dialog_cancel)}
</Button>
</DialogFooter>
</DialogContent>
diff --git a/packages/views/onboarding/steps/step-questionnaire.test.tsx b/packages/views/onboarding/steps/step-questionnaire.test.tsx
index f41fb9560a..0cdaf85345 100644
--- a/packages/views/onboarding/steps/step-questionnaire.test.tsx
+++ b/packages/views/onboarding/steps/step-questionnaire.test.tsx
@@ -3,6 +3,11 @@ import { render, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import type { QuestionnaireAnswers } from "@multica/core/onboarding";
import { StepQuestionnaire } from "./step-questionnaire";
+import { I18nProvider } from "@multica/core/i18n/react";
+import enCommon from "../../locales/en/common.json";
+import enOnboarding from "../../locales/en/onboarding.json";
+
+const TEST_RESOURCES = { en: { common: enCommon, onboarding: enOnboarding } };
const EMPTY_ANSWERS: QuestionnaireAnswers = {
team_size: null,
@@ -16,10 +21,12 @@ const EMPTY_ANSWERS: QuestionnaireAnswers = {
function renderStep(initial: Partial<QuestionnaireAnswers> = {}) {
const onSubmit = vi.fn();
render(
- <StepQuestionnaire
- initial={{ ...EMPTY_ANSWERS, ...initial }}
- onSubmit={onSubmit}
- />,
+ <I18nProvider locale="en" resources={TEST_RESOURCES}>
+ <StepQuestionnaire
+ initial={{ ...EMPTY_ANSWERS, ...initial }}
+ onSubmit={onSubmit}
+ />
+ </I18nProvider>,
);
return { onSubmit };
}
diff --git a/packages/views/onboarding/steps/step-questionnaire.tsx b/packages/views/onboarding/steps/step-questionnaire.tsx
index 5b4be7d1db..2a95e029a7 100644
--- a/packages/views/onboarding/steps/step-questionnaire.tsx
+++ b/packages/views/onboarding/steps/step-questionnaire.tsx
@@ -19,6 +19,7 @@ import type {
import { DragStrip } from "@multica/views/platform";
import { StepHeader } from "../components/step-header";
import { OptionCard, OtherOptionCard } from "../components/option-card";
+import { useT } from "../../i18n";
/**
* Step 1 — three-question user profile.
@@ -41,6 +42,7 @@ export function StepQuestionnaire({
onSubmit: (answers: QuestionnaireAnswers) => void | Promise<void>;
onBack?: () => void;
}) {
+ const { t } = useT("onboarding");
const [answers, setAnswers] = useState<QuestionnaireAnswers>(initial);
const [submitting, setSubmitting] = useState(false);
const mainRef = useRef<HTMLElement>(null);
@@ -110,7 +112,7 @@ export function StepQuestionnaire({
className="flex items-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground"
>
<ArrowLeft className="h-3.5 w-3.5" />
- Back
+ {t(($) => $.common.back)}
</button>
) : (
<span aria-hidden className="w-0" />
@@ -134,27 +136,27 @@ export function StepQuestionnaire({
>
<div className="mx-auto w-full max-w-[620px] px-6 py-10 sm:px-10 md:px-14 lg:px-0 lg:py-14">
<div className="mb-2 text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground">
- Before we start
+ {t(($) => $.questionnaire.eyebrow)}
</div>
<h1 className="text-balance font-serif text-[36px] font-medium leading-[1.1] tracking-tight text-foreground">
- Three questions to get to know you.
+ {t(($) => $.questionnaire.headline)}
</h1>
<div className="mt-10 flex flex-col gap-7">
<QuestionBlock
num={1}
- question="Who will use this workspace?"
- ariaLabel="Who will use this workspace?"
+ question={t(($) => $.questionnaire.q1_question)}
+ ariaLabel={t(($) => $.questionnaire.q1_question)}
>
<OptionCard
selected={answers.team_size === "solo"}
onSelect={() => setTeamSize("solo")}
- label="Just me"
+ label={t(($) => $.questionnaire.q1_solo)}
/>
<OptionCard
selected={answers.team_size === "team"}
onSelect={() => setTeamSize("team")}
- label="My team (2–10 people)"
+ label={t(($) => $.questionnaire.q1_team)}
/>
<OtherOptionCard
selected={answers.team_size === "other"}
@@ -163,34 +165,34 @@ export function StepQuestionnaire({
onOtherChange={(v) =>
setAnswers((a) => ({ ...a, team_size_other: v }))
}
- placeholder="e.g. a small community I help run"
+ placeholder={t(($) => $.questionnaire.q1_other_placeholder)}
/>
</QuestionBlock>
<QuestionBlock
num={2}
- question="What best describes you?"
- ariaLabel="What best describes you?"
+ question={t(($) => $.questionnaire.q2_question)}
+ ariaLabel={t(($) => $.questionnaire.q2_question)}
>
<OptionCard
selected={answers.role === "developer"}
onSelect={() => setRole("developer")}
- label="Software developer"
+ label={t(($) => $.questionnaire.q2_developer)}
/>
<OptionCard
selected={answers.role === "product_lead"}
onSelect={() => setRole("product_lead")}
- label="Product or project lead"
+ label={t(($) => $.questionnaire.q2_product_lead)}
/>
<OptionCard
selected={answers.role === "writer"}
onSelect={() => setRole("writer")}
- label="Writer or content creator"
+ label={t(($) => $.questionnaire.q2_writer)}
/>
<OptionCard
selected={answers.role === "founder"}
onSelect={() => setRole("founder")}
- label="Founder or operator"
+ label={t(($) => $.questionnaire.q2_founder)}
/>
<OtherOptionCard
selected={answers.role === "other"}
@@ -199,34 +201,34 @@ export function StepQuestionnaire({
onOtherChange={(v) =>
setAnswers((a) => ({ ...a, role_other: v }))
}
- placeholder="e.g. researcher, designer, ops lead"
+ placeholder={t(($) => $.questionnaire.q2_other_placeholder)}
/>
</QuestionBlock>
<QuestionBlock
num={3}
- question="What do you want to do with Multica?"
- ariaLabel="What do you want to do with Multica?"
+ question={t(($) => $.questionnaire.q3_question)}
+ ariaLabel={t(($) => $.questionnaire.q3_question)}
>
<OptionCard
selected={answers.use_case === "coding"}
onSelect={() => setUseCase("coding")}
- label="Write and ship code"
+ label={t(($) => $.questionnaire.q3_coding)}
/>
<OptionCard
selected={answers.use_case === "planning"}
onSelect={() => setUseCase("planning")}
- label="Plan and manage projects"
+ label={t(($) => $.questionnaire.q3_planning)}
/>
<OptionCard
selected={answers.use_case === "writing_research"}
onSelect={() => setUseCase("writing_research")}
- label="Research or write"
+ label={t(($) => $.questionnaire.q3_writing_research)}
/>
<OptionCard
selected={answers.use_case === "explore"}
onSelect={() => setUseCase("explore")}
- label="I'm just exploring for now"
+ label={t(($) => $.questionnaire.q3_explore)}
/>
<OtherOptionCard
selected={answers.use_case === "other"}
@@ -235,7 +237,7 @@ export function StepQuestionnaire({
onOtherChange={(v) =>
setAnswers((a) => ({ ...a, use_case_other: v }))
}
- placeholder="e.g. automate my weekly reports"
+ placeholder={t(($) => $.questionnaire.q3_other_placeholder)}
/>
</QuestionBlock>
</div>
@@ -248,7 +250,7 @@ export function StepQuestionnaire({
aria-live="polite"
className="text-xs tabular-nums text-muted-foreground"
>
- {answeredCount} of 3 answered
+ {t(($) => $.questionnaire.answered_progress, { count: answeredCount })}
</span>
<Button
size="lg"
@@ -256,7 +258,7 @@ export function StepQuestionnaire({
onClick={submit}
>
{submitting && <Loader2 className="h-4 w-4 animate-spin" />}
- Continue
+ {t(($) => $.common.continue)}
<ArrowRight className="h-4 w-4" />
</Button>
</footer>
@@ -300,31 +302,32 @@ function QuestionBlock({
}
function WhyWeAsk() {
+ const { t } = useT("onboarding");
return (
<div className="flex max-w-[380px] flex-col gap-8">
<section className="flex flex-col gap-4">
<div className="text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground">
- Why three questions
+ {t(($) => $.questionnaire.why_eyebrow)}
</div>
<h2 className="font-serif text-[22px] font-medium leading-[1.25] tracking-tight text-foreground">
- So you land running.
+ {t(($) => $.questionnaire.why_headline)}
</h2>
</section>
<section className="flex flex-col gap-4">
<div className="text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground">
- What you get
+ {t(($) => $.questionnaire.what_eyebrow)}
</div>
<div className="flex flex-col gap-4">
<UnlockItem
icon={<PenLine className="h-4 w-4" />}
- title="A starter project, tailored"
- body="A Getting Started checklist shaped by your answers."
+ title={t(($) => $.questionnaire.unlock_starter_title)}
+ body={t(($) => $.questionnaire.unlock_starter_body)}
/>
<UnlockItem
icon={<Sparkles className="h-4 w-4" />}
- title="A head start with agents"
- body="Connect a runtime and we'll pick a template for your role — plus write its first task."
+ title={t(($) => $.questionnaire.unlock_agents_title)}
+ body={t(($) => $.questionnaire.unlock_agents_body)}
/>
</div>
</section>
@@ -335,7 +338,7 @@ function WhyWeAsk() {
rel="noopener noreferrer"
className="self-start text-[13px] text-muted-foreground underline underline-offset-4 transition-colors hover:text-foreground"
>
- Learn how agents work →
+ {t(($) => $.questionnaire.learn_more)}
</a>
</div>
);
diff --git a/packages/views/onboarding/steps/step-runtime-connect.test.tsx b/packages/views/onboarding/steps/step-runtime-connect.test.tsx
index 9fc73f975b..e86d1f2d51 100644
--- a/packages/views/onboarding/steps/step-runtime-connect.test.tsx
+++ b/packages/views/onboarding/steps/step-runtime-connect.test.tsx
@@ -1,6 +1,11 @@
import { describe, expect, it, vi, beforeEach, afterEach } from "vitest";
import { act, render, screen } from "@testing-library/react";
import type { AgentRuntime } from "@multica/core/types";
+import { I18nProvider } from "@multica/core/i18n/react";
+import enCommon from "../../locales/en/common.json";
+import enOnboarding from "../../locales/en/onboarding.json";
+
+const TEST_RESOURCES = { en: { common: enCommon, onboarding: enOnboarding } };
// Hoisted mocks — replace analytics and the runtime picker before the SUT
// imports them. Tests drive picker state via `mocks.pickerState`; every
@@ -60,7 +65,9 @@ function renderStep() {
const onNext = vi.fn();
const onBack = vi.fn();
render(
- <StepRuntimeConnect wsId="ws_test" onNext={onNext} onBack={onBack} />,
+ <I18nProvider locale="en" resources={TEST_RESOURCES}>
+ <StepRuntimeConnect wsId="ws_test" onNext={onNext} onBack={onBack} />
+ </I18nProvider>,
);
return { onNext, onBack };
}
diff --git a/packages/views/onboarding/steps/step-runtime-connect.tsx b/packages/views/onboarding/steps/step-runtime-connect.tsx
index fc0238e697..68c2b38e96 100644
--- a/packages/views/onboarding/steps/step-runtime-connect.tsx
+++ b/packages/views/onboarding/steps/step-runtime-connect.tsx
@@ -21,6 +21,7 @@ import { RuntimeAsidePanel } from "../components/runtime-aside-panel";
import { useRuntimePicker } from "../components/use-runtime-picker";
import { CloudWaitlistExpand } from "../components/cloud-waitlist-expand";
import { ProviderLogo } from "../../runtimes/components/provider-logo";
+import { useT } from "../../i18n";
/**
* Step 3 (desktop) — connect a runtime.
@@ -94,6 +95,7 @@ function FancyView({
onBack?: () => void;
onWaitlistSubmitted?: () => void;
}) {
+ const { t } = useT("onboarding");
const mainRef = useRef<HTMLElement>(null);
const fadeStyle = useScrollFade(mainRef);
@@ -190,14 +192,14 @@ function FancyView({
const footerHint =
phase === "found" && selected
- ? `Selected: ${selected.name}`
+ ? t(($) => $.step_runtime.hint_selected, { name: selected.name })
: phase === "found"
- ? "Pick a runtime above to continue."
+ ? t(($) => $.step_runtime.hint_pick)
: phase === "scanning"
- ? "Waiting for the first result…"
+ ? t(($) => $.step_runtime.hint_waiting)
: waitlistSubmitted
- ? "You're on the waitlist — skip to keep exploring."
- : "Skip to enter your workspace, or join the cloud waitlist above.";
+ ? t(($) => $.step_runtime.hint_waitlist_done)
+ : t(($) => $.step_runtime.hint_skip_or_waitlist);
return (
<div className="animate-onboarding-enter grid h-full min-h-0 grid-cols-1 lg:grid-cols-[minmax(0,1fr)_480px]">
@@ -214,7 +216,7 @@ function FancyView({
className="flex items-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground"
>
<ArrowLeft className="h-3.5 w-3.5" />
- Back
+ {t(($) => $.common.back)}
</button>
) : (
<span aria-hidden className="w-0" />
@@ -278,7 +280,7 @@ function FancyView({
disabled={submitting}
onClick={handleSkip}
>
- Skip for now
+ {t(($) => $.step_runtime.skip)}
</Button>
<Button
size="lg"
@@ -286,7 +288,7 @@ function FancyView({
onClick={handleContinue}
>
{submitting && <Loader2 className="h-4 w-4 animate-spin" />}
- Continue
+ {t(($) => $.common.continue)}
<ArrowRight className="h-4 w-4" />
</Button>
</footer>
@@ -309,18 +311,20 @@ function FancyView({
// ------------------------------------------------------------
function ScanningView() {
+ const { t } = useT("onboarding");
return (
<div>
<h1 className="text-balance font-serif text-[36px] font-medium leading-[1.1] tracking-tight text-foreground">
- Looking for your tools…
+ {t(($) => $.step_runtime.scanning_headline)}
</h1>
<p className="mt-4 max-w-[560px] text-[15.5px] leading-[1.55] text-muted-foreground">
- Multica drives local AI coding tools like{" "}
- <span className="font-medium text-foreground">Claude Code</span>,{" "}
- <span className="font-medium text-foreground">Codex</span>,{" "}
- <span className="font-medium text-foreground">Cursor</span>, and
- others. We&apos;re waiting to hear back from your machine about
- which ones are installed.
+ {t(($) => $.step_runtime.scanning_lede_prefix)}
+ <span className="font-medium text-foreground">{"Claude Code"}</span>
+ {", "}
+ <span className="font-medium text-foreground">{"Codex"}</span>
+ {", "}
+ <span className="font-medium text-foreground">{"Cursor"}</span>
+ {t(($) => $.step_runtime.scanning_lede_suffix)}
</p>
<div className="mt-10 grid grid-cols-1 gap-2.5 sm:grid-cols-2">
<SkeletonRuntimeCard />
@@ -341,30 +345,29 @@ function FoundView({
onSelect: (id: string) => void;
onlineCount: number;
}) {
+ const { t } = useT("onboarding");
const total = runtimes.length;
const statusLabel =
onlineCount === total
- ? "all online"
+ ? t(($) => $.step_runtime.status_all_online)
: onlineCount === 0
- ? "none online"
- : `${onlineCount} online`;
+ ? t(($) => $.step_runtime.status_none_online)
+ : t(($) => $.step_runtime.status_n_online, { count: onlineCount });
const statusTone =
onlineCount === 0 ? "text-muted-foreground" : "text-success";
return (
<div>
<h1 className="text-balance font-serif text-[36px] font-medium leading-[1.1] tracking-tight text-foreground">
- We found your runtimes.
+ {t(($) => $.step_runtime.found_headline)}
</h1>
<p className="mt-4 max-w-[560px] text-[15.5px] leading-[1.55] text-muted-foreground">
- We scanned your machine for AI coding tools you&apos;ve already
- set up. Pick one for your first agent.
+ {t(($) => $.step_runtime.found_lede)}
</p>
- {/* Summary strip — trust signal ("we really did scan") */}
<div className="mt-8 flex flex-wrap items-center gap-x-2 gap-y-1 rounded-lg bg-muted/60 px-4 py-2.5 text-xs">
<span className="font-semibold text-foreground">
- {total} runtime{total === 1 ? "" : "s"}
+ {t(($) => $.step_runtime.runtime_count, { count: total })}
</span>
<span className="text-muted-foreground">·</span>
<span className={cn("flex items-center gap-1", statusTone)}>
@@ -402,40 +405,40 @@ function EmptyView({
onWaitlistSubmitted: () => void;
onSkip: () => void;
}) {
- // Two exits: "Skip for now" (enter the workspace in read-only mode)
- // or "Join waitlist" (capture interest in the hosted runtime we
- // haven't shipped yet). We deliberately don't link out to Claude
- // Code / Codex / Cursor here — those are other companies' products,
- // and nudging the user to install one would frame Multica as a
- // launcher for them rather than a product that runs them.
+ const { t } = useT("onboarding");
const [waitlistOpen, setWaitlistOpen] = useState(false);
return (
<div>
<h1 className="text-balance font-serif text-[36px] font-medium leading-[1.1] tracking-tight text-foreground">
- No supported tools detected.
+ {t(($) => $.step_runtime.empty_headline)}
</h1>
<p className="mt-4 max-w-[560px] text-[15.5px] leading-[1.55] text-muted-foreground">
- Multica drives local AI coding tools like{" "}
- <span className="font-medium text-foreground">Claude Code</span>,{" "}
- <span className="font-medium text-foreground">Codex</span>,{" "}
- <span className="font-medium text-foreground">Cursor</span>, and
- others — we didn&apos;t find any on this machine. Install one and
- come back, or pick a path below.
+ {t(($) => $.step_runtime.empty_lede_prefix)}
+ <span className="font-medium text-foreground">{"Claude Code"}</span>
+ {", "}
+ <span className="font-medium text-foreground">{"Codex"}</span>
+ {", "}
+ <span className="font-medium text-foreground">{"Cursor"}</span>
+ {t(($) => $.step_runtime.empty_lede_suffix)}
</p>
<div className="mt-10 flex flex-col gap-3.5">
<EmptyCard
- title="Skip for now"
- subtitle="Enter your workspace in read-only mode. Agents can't execute tasks until a runtime connects — but you can still browse, plan, and invite teammates."
- actionLabel="Skip"
+ title={t(($) => $.step_runtime.empty_skip_title)}
+ subtitle={t(($) => $.step_runtime.empty_skip_subtitle)}
+ actionLabel={t(($) => $.step_runtime.empty_skip_action)}
onAction={onSkip}
/>
<EmptyCard
- title="Join the cloud runtime waitlist"
- subtitle="We'll host the runtime for you — no local install, no setup. Not live yet; click to leave your email and get notified."
- actionLabel={waitlistSubmitted ? "On the waitlist" : "Join waitlist"}
+ title={t(($) => $.step_runtime.empty_waitlist_title)}
+ subtitle={t(($) => $.step_runtime.empty_waitlist_subtitle)}
+ actionLabel={
+ waitlistSubmitted
+ ? t(($) => $.step_runtime.empty_waitlist_done)
+ : t(($) => $.step_runtime.empty_waitlist_action)
+ }
onAction={() => setWaitlistOpen(true)}
/>
</div>
@@ -446,10 +449,9 @@ function EmptyView({
>
<DialogContent className="flex max-h-[85vh] flex-col sm:max-w-[520px]">
<DialogHeader>
- <DialogTitle>Join the cloud runtime waitlist</DialogTitle>
+ <DialogTitle>{t(($) => $.step_runtime.dialog_title)}</DialogTitle>
<DialogDescription>
- Cloud runtimes aren&apos;t live yet. Leave your email and
- we&apos;ll email you when they are.
+ {t(($) => $.step_runtime.dialog_description)}
</DialogDescription>
</DialogHeader>
@@ -462,7 +464,9 @@ function EmptyView({
<DialogFooter>
<Button variant="ghost" onClick={() => setWaitlistOpen(false)}>
- {waitlistSubmitted ? "Close" : "Cancel"}
+ {waitlistSubmitted
+ ? t(($) => $.step_runtime.dialog_close)
+ : t(($) => $.step_runtime.dialog_cancel)}
</Button>
</DialogFooter>
</DialogContent>
@@ -523,6 +527,7 @@ function RuntimeCard({
selected: boolean;
onSelect: () => void;
}) {
+ const { t } = useT("onboarding");
const online = runtime.status === "online";
return (
@@ -553,7 +558,7 @@ function RuntimeCard({
)}
aria-hidden
/>
- {online ? "online" : "offline"}
+ {online ? t(($) => $.step_runtime.online_label) : t(($) => $.step_runtime.offline_label)}
</div>
</div>
<RadioMark selected={selected} />
diff --git a/packages/views/onboarding/steps/step-welcome.tsx b/packages/views/onboarding/steps/step-welcome.tsx
index d47013c55b..b4d5ad80b4 100644
--- a/packages/views/onboarding/steps/step-welcome.tsx
+++ b/packages/views/onboarding/steps/step-welcome.tsx
@@ -11,6 +11,7 @@ import { STATUS_CONFIG } from "@multica/core/issues/config";
import type { IssueStatus } from "@multica/core/types";
import { StatusIcon } from "../../issues/components/status-icon";
import { ProviderLogo } from "../../runtimes/components/provider-logo";
+import { useT } from "../../i18n";
/**
* Step 0 — the one-shot product intro shown on every onboarding
@@ -45,6 +46,7 @@ export function StepWelcome({
onSkip?: () => void | Promise<void>;
isWeb?: boolean;
}) {
+ const { t } = useT("onboarding");
// Tracks which button is mid-flight so we can show a per-button
// spinner and disable both while one is in progress.
const [pending, setPending] = useState<"next" | "skip" | null>(null);
@@ -79,30 +81,25 @@ export function StepWelcome({
<div className="flex items-center gap-2.5">
<MulticaIcon className="size-5 text-foreground" noSpin />
<span className="font-serif text-xl font-medium tracking-tight">
- Welcome to Multica
+ {t(($) => $.welcome.wordmark)}
</span>
</div>
<h1 className="text-balance font-serif text-5xl font-medium leading-[1.04] tracking-tight sm:text-6xl">
- Your AI teammates,
+ {t(($) => $.welcome.headline_line1)}
<br />
- in <em className="italic text-brand">one workspace.</em>
+ {t(($) => $.welcome.headline_line2)}{" "}
+ <em className="italic text-brand">{t(($) => $.welcome.headline_emphasis)}</em>
</h1>
<div className="flex flex-col gap-4">
<p className="text-lg leading-relaxed text-foreground/85">
- Assign them work like you&apos;d assign a colleague — they
- pick it up, update status, and comment when done.
+ {t(($) => $.welcome.lede)}
</p>
<p className="text-sm leading-relaxed text-muted-foreground">
- {isWeb ? (
- <>
- Desktop bundles the runtime — nothing to install.
- Continue on web to connect your own CLI.
- </>
- ) : (
- "By the end, a real agent will be replying to your first issue."
- )}
+ {isWeb
+ ? t(($) => $.welcome.lede_web)
+ : t(($) => $.welcome.lede_desktop)}
</p>
</div>
@@ -124,7 +121,7 @@ export function StepWelcome({
className={buttonVariants({ size: "lg" })}
>
<Download className="h-4 w-4" />
- Download Desktop
+ {t(($) => $.welcome.download_desktop)}
</a>
<Button
size="lg"
@@ -135,7 +132,7 @@ export function StepWelcome({
{pending === "next" && (
<Loader2 className="h-4 w-4 animate-spin" />
)}
- Continue on web
+ {t(($) => $.welcome.continue_on_web)}
<ArrowRight className="h-4 w-4" />
</Button>
</>
@@ -148,7 +145,7 @@ export function StepWelcome({
{pending === "next" && (
<Loader2 className="h-4 w-4 animate-spin" />
)}
- Start exploring
+ {t(($) => $.welcome.start_exploring)}
<ArrowRight className="h-4 w-4" />
</Button>
)}
@@ -162,7 +159,7 @@ export function StepWelcome({
{pending === "skip" && (
<Loader2 className="h-4 w-4 animate-spin" />
)}
- I&apos;ve done this before
+ {t(($) => $.welcome.skip_existing)}
</Button>
)}
</div>
@@ -180,8 +177,7 @@ export function StepWelcome({
<DragStrip />
<div className="flex flex-1 flex-col items-center justify-center gap-7 px-8 py-8">
<p className="max-w-[440px] text-balance text-center font-serif text-[15px] italic leading-snug text-muted-foreground">
- Every issue, every thread, every decision — shared by your team and
- agents.
+ {t(($) => $.welcome.illustration_caption)}
</p>
<WelcomeIllustration />
</div>
@@ -202,58 +198,76 @@ export function StepWelcome({
* aesthetic of the left column.
*/
function WelcomeIllustration() {
+ const { t } = useT("onboarding");
return (
<div className="flex w-full max-w-[460px] flex-col gap-3">
<MockActivityCard
- actor={{ kind: "user", name: "You", initial: "N" }}
+ actor={{
+ kind: "user",
+ name: t(($) => $.welcome.illustration.card1_actor_name),
+ initial: t(($) => $.welcome.illustration.card1_actor_initial),
+ }}
issueId="MCA-42"
content={
<>
- <Mention>@Content Agent</Mention> can you draft a short launch
- post? Pull from <Mention>@Research Agent</Mention>&apos;s interview
- findings.
+ <Mention>{t(($) => $.welcome.illustration.card1_mention_content)}</Mention>
+ {t(($) => $.welcome.illustration.card1_body_prefix)}
+ <Mention>{t(($) => $.welcome.illustration.card1_mention_research)}</Mention>
+ {t(($) => $.welcome.illustration.card1_body_suffix)}
</>
}
/>
<MockActivityCard
className="-translate-x-5 -rotate-[1.2deg]"
- actor={{ kind: "agent", name: "Content Agent", provider: "codex" }}
+ actor={{
+ kind: "agent",
+ name: t(($) => $.welcome.illustration.card2_actor_name),
+ provider: "codex",
+ }}
issueId="MCA-42"
- content={
- <>
- On it. Pulling Research&apos;s quotes, drafting around the
- &ldquo;time saved&rdquo; angle…
- </>
- }
+ content={t(($) => $.welcome.illustration.card2_body)}
status="in_progress"
/>
<MockActivityCard
className="translate-x-8 rotate-[1.6deg]"
- actor={{ kind: "agent", name: "Research Agent", provider: "hermes" }}
+ actor={{
+ kind: "agent",
+ name: t(($) => $.welcome.illustration.card3_actor_name),
+ provider: "hermes",
+ }}
issueId="MCA-38"
- content="This week's user interviews summarized — 12 calls, 4 recurring themes, 3 pull-quotes."
+ content={t(($) => $.welcome.illustration.card3_body)}
status="done"
- timestamp="15 min ago"
+ timestamp={t(($) => $.welcome.illustration.card3_timestamp)}
/>
<MockActivityCard
className="-translate-x-6 -rotate-[0.8deg]"
- actor={{ kind: "agent", name: "Review Agent", provider: "openclaw" }}
+ actor={{
+ kind: "agent",
+ name: t(($) => $.welcome.illustration.card4_actor_name),
+ provider: "openclaw",
+ }}
issueId="MCA-42"
- content="Reviewed Monday's draft — left 4 notes on tone. Standing by for the new one."
+ content={t(($) => $.welcome.illustration.card4_body)}
status="in_review"
/>
<MockActivityCard
className="translate-x-6 rotate-[1deg]"
- actor={{ kind: "agent", name: "Coding Agent", provider: "claude" }}
+ actor={{
+ kind: "agent",
+ name: t(($) => $.welcome.illustration.card5_actor_name),
+ provider: "claude",
+ }}
issueId="MCA-35"
content={
<>
- Shipped the export feature <Mention>@you</Mention> flagged.
- Preview link in the PR.
+ {t(($) => $.welcome.illustration.card5_body_prefix)}
+ <Mention>{t(($) => $.welcome.illustration.card5_mention_you)}</Mention>
+ {t(($) => $.welcome.illustration.card5_body_suffix)}
</>
}
status="done"
- timestamp="just now"
+ timestamp={t(($) => $.welcome.illustration.card5_timestamp)}
/>
</div>
);
diff --git a/packages/views/onboarding/steps/step-workspace.tsx b/packages/views/onboarding/steps/step-workspace.tsx
index c5fedbb97f..250d882ca9 100644
--- a/packages/views/onboarding/steps/step-workspace.tsx
+++ b/packages/views/onboarding/steps/step-workspace.tsx
@@ -27,6 +27,7 @@ import { DragStrip } from "@multica/views/platform";
import { StepHeader } from "../components/step-header";
import { RadioMark } from "../components/option-card";
import { WorkspaceAvatar } from "../../workspace/workspace-avatar";
+import { useT } from "../../i18n";
import {
WORKSPACE_SLUG_CONFLICT_ERROR,
WORKSPACE_SLUG_FORMAT_ERROR,
@@ -74,6 +75,7 @@ export function StepWorkspace({
onCreated: (workspace: Workspace) => void | Promise<void>;
onBack?: () => void;
}) {
+ const { t } = useT("onboarding");
const mainRef = useRef<HTMLElement>(null);
const fadeStyle = useScrollFade(mainRef);
@@ -130,10 +132,10 @@ export function StepWorkspace({
onError: (error) => {
if (isWorkspaceSlugConflict(error)) {
setSlugServerError(WORKSPACE_SLUG_CONFLICT_ERROR);
- toast.error("Choose a different workspace URL");
+ toast.error(t(($) => $.step_workspace.slug_conflict_toast));
return;
}
- toast.error("Failed to create workspace");
+ toast.error(t(($) => $.step_workspace.create_failed_toast));
},
},
);
@@ -153,31 +155,32 @@ export function StepWorkspace({
let onContinue: () => void;
if (existingActive && reusing) {
- hint = `Opening ${reusing.name}.`;
- continueLabel = `Open ${reusing.name}`;
+ hint = t(($) => $.step_workspace.hint_opening, { name: reusing.name });
+ continueLabel = t(($) => $.step_workspace.cta_open, { name: reusing.name });
continueDisabled = isCreating;
onContinue = () => onCreated(reusing);
} else if (creatingActive) {
if (isCreating) {
- hint = `Creating ${name.trim() || "your workspace"}…`;
- continueLabel = "Creating…";
+ hint = t(($) => $.step_workspace.hint_creating_pending, {
+ name: name.trim() || t(($) => $.step_workspace.hint_creating_fallback),
+ });
+ continueLabel = t(($) => $.step_workspace.cta_creating);
continueDisabled = true;
onContinue = () => {};
} else if (canCreate) {
- hint = `Creating ${name.trim()}.`;
- continueLabel = `Create ${name.trim()}`;
+ hint = t(($) => $.step_workspace.hint_creating, { name: name.trim() });
+ continueLabel = t(($) => $.step_workspace.cta_create_named, { name: name.trim() });
continueDisabled = false;
onContinue = handleCreate;
} else {
- hint = "Name your workspace to create it.";
- continueLabel = "Create workspace";
+ hint = t(($) => $.step_workspace.hint_name_first);
+ continueLabel = t(($) => $.step_workspace.cta_create_workspace);
continueDisabled = true;
onContinue = () => {};
}
} else {
- // Resume path, nothing picked yet.
- hint = "Pick your workspace or start a new one.";
- continueLabel = "Continue";
+ hint = t(($) => $.step_workspace.hint_pick);
+ continueLabel = t(($) => $.common.continue);
continueDisabled = true;
onContinue = () => {};
}
@@ -189,7 +192,7 @@ export function StepWorkspace({
htmlFor="ws-name"
className="text-xs font-medium text-muted-foreground"
>
- Workspace name
+ {t(($) => $.step_workspace.name_label)}
</Label>
<Input
id="ws-name"
@@ -197,7 +200,7 @@ export function StepWorkspace({
type="text"
value={name}
onChange={(e) => handleNameChange(e.target.value)}
- placeholder="Acme Inc, My Lab, Side Projects…"
+ placeholder={t(($) => $.step_workspace.name_placeholder)}
onKeyDown={(e) => e.key === "Enter" && handleCreate()}
/>
</div>
@@ -206,18 +209,18 @@ export function StepWorkspace({
htmlFor="ws-slug"
className="text-xs font-medium text-muted-foreground"
>
- URL
+ {t(($) => $.step_workspace.url_label)}
</Label>
<div className="flex items-center rounded-md border bg-muted transition-colors focus-within:border-foreground">
<span className="select-none pl-3 font-mono text-sm text-muted-foreground">
- multica.ai/
+ {"multica.ai/"}
</span>
<Input
id="ws-slug"
type="text"
value={slug}
onChange={(e) => handleSlugChange(e.target.value)}
- placeholder="acme"
+ placeholder={t(($) => $.step_workspace.slug_placeholder)}
className="border-0 bg-transparent font-mono shadow-none focus-visible:ring-0"
onKeyDown={(e) => e.key === "Enter" && handleCreate()}
/>
@@ -226,14 +229,14 @@ export function StepWorkspace({
</div>
<div className="flex flex-col gap-1.5">
<div className="text-xs font-medium text-muted-foreground">
- Issue prefix
+ {t(($) => $.step_workspace.issue_prefix_label)}
</div>
<div className="text-sm leading-[1.55] text-muted-foreground">
- Issues will look like{" "}
+ {t(($) => $.step_workspace.issue_prefix_prefix)}
<span className="font-mono text-foreground">
{issuePrefix(slug)}-123
</span>
- . You can change this later in settings.
+ {t(($) => $.step_workspace.issue_prefix_suffix)}
</div>
</div>
</div>
@@ -253,7 +256,7 @@ export function StepWorkspace({
className="flex items-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground disabled:opacity-40"
>
<ArrowLeft className="h-3.5 w-3.5" />
- Back
+ {t(($) => $.common.back)}
</button>
) : (
<span aria-hidden className="w-0" />
@@ -270,17 +273,19 @@ export function StepWorkspace({
>
<div className="mx-auto w-full max-w-[620px] px-6 py-10 sm:px-10 md:px-14 lg:px-0 lg:py-14">
<div className="mb-2 text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground">
- {reusing ? "Pick up or start fresh" : "Your first workspace"}
+ {reusing
+ ? t(($) => $.step_workspace.eyebrow_resume)
+ : t(($) => $.step_workspace.eyebrow_first)}
</div>
<h1 className="text-balance font-serif text-[36px] font-medium leading-[1.1] tracking-tight text-foreground">
{reusing
- ? `Continue with ${reusing.name}, or start another.`
- : "Name your workspace."}
+ ? t(($) => $.step_workspace.headline_resume, { name: reusing.name })
+ : t(($) => $.step_workspace.headline_first)}
</h1>
<p className="mt-4 text-[15.5px] leading-[1.55] text-foreground/80">
{reusing
- ? "Resume setup with the workspace you already have, or create a new one alongside it — you can belong to any number of workspaces."
- : "A workspace is where your issues, agents, and projects live. You can invite teammates or spin up more workspaces later."}
+ ? t(($) => $.step_workspace.lede_resume)
+ : t(($) => $.step_workspace.lede_first)}
</p>
<div className="mt-10">
@@ -364,7 +369,7 @@ function ExistingWorkspaceCard({
{workspace.name}
</div>
<div className="truncate font-mono text-xs text-muted-foreground">
- multica.ai/{workspace.slug}
+ {`multica.ai/${workspace.slug}`}
</div>
</div>
<RadioMark selected={selected} />
@@ -388,6 +393,7 @@ function CreateNewWorkspaceCard({
onSelect: () => void;
children: ReactNode;
}) {
+ const { t } = useT("onboarding");
return (
<div
className={cn(
@@ -413,10 +419,10 @@ function CreateNewWorkspaceCard({
</div>
<div className="flex min-w-0 flex-1 flex-col">
<div className="truncate text-[14.5px] font-medium text-foreground">
- Create a new workspace
+ {t(($) => $.step_workspace.create_new_title)}
</div>
<div className="truncate text-xs text-muted-foreground">
- Start fresh — a separate space for a different side of your work.
+ {t(($) => $.step_workspace.create_new_subtitle)}
</div>
</div>
<RadioMark selected={selected} />
@@ -427,45 +433,48 @@ function CreateNewWorkspaceCard({
}
function CreateWorkspaceSide() {
+ const { t } = useT("onboarding");
return (
<div className="flex flex-col gap-6">
<div className="text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground">
- What lives inside a workspace
+ {t(($) => $.step_workspace.side_create_eyebrow)}
</div>
- <WorkspacePreviewCard name="Your workspace" slug="workspace" />
+ <WorkspacePreviewCard
+ name={t(($) => $.step_workspace.side_preview_name)}
+ slug={t(($) => $.step_workspace.side_preview_slug)}
+ />
<div className="mt-2 text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground">
- Things you&apos;ll do here
+ {t(($) => $.step_workspace.side_things_eyebrow)}
</div>
<div className="flex flex-col gap-3.5">
- <PerkRow>Assign issues to agents like you would a teammate</PerkRow>
- <PerkRow>Chat with any agent without creating an issue</PerkRow>
- <PerkRow>Invite teammates — they see only this workspace</PerkRow>
- <PerkRow>Switch to other workspaces anytime from the top-left</PerkRow>
+ <PerkRow>{t(($) => $.step_workspace.perk_assign)}</PerkRow>
+ <PerkRow>{t(($) => $.step_workspace.perk_chat)}</PerkRow>
+ <PerkRow>{t(($) => $.step_workspace.perk_invite)}</PerkRow>
+ <PerkRow>{t(($) => $.step_workspace.perk_switch)}</PerkRow>
</div>
</div>
);
}
function ExistingWorkspaceSide({ workspace }: { workspace: Workspace }) {
+ const { t } = useT("onboarding");
return (
<div className="flex flex-col gap-6">
<div className="text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground">
- Your workspace
+ {t(($) => $.step_workspace.side_existing_eyebrow)}
</div>
<WorkspacePreviewCard name={workspace.name} slug={workspace.slug} />
<div className="mt-2 text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground">
- What&apos;s next
+ {t(($) => $.step_workspace.side_next_eyebrow)}
</div>
<div className="flex flex-col gap-3.5">
- <PerkRow>
- Connect a runtime so your agents have somewhere to run
- </PerkRow>
- <PerkRow>Create your first agent matched to your role</PerkRow>
- <PerkRow>Watch it pick up a starter task and reply</PerkRow>
+ <PerkRow>{t(($) => $.step_workspace.next_runtime)}</PerkRow>
+ <PerkRow>{t(($) => $.step_workspace.next_agent)}</PerkRow>
+ <PerkRow>{t(($) => $.step_workspace.next_starter)}</PerkRow>
</div>
</div>
);
@@ -486,6 +495,7 @@ function WorkspacePreviewCard({
name: string;
slug: string;
}) {
+ const { t } = useT("onboarding");
return (
<div className="overflow-hidden rounded-xl border bg-card shadow-xs">
<div className="flex items-center gap-3 border-b px-4 py-3.5">
@@ -495,7 +505,7 @@ function WorkspacePreviewCard({
{name}
</div>
<div className="truncate font-mono text-[11.5px] text-muted-foreground">
- multica.ai/{slug}
+ {`multica.ai/${slug}`}
</div>
</div>
<Lock
@@ -506,44 +516,44 @@ function WorkspacePreviewCard({
<div className="flex flex-col">
<EntityRow
icon={<Inbox className="h-4 w-4" />}
- label="Inbox"
- meta="your notifications"
+ label={t(($) => $.step_workspace.preview.inbox_label)}
+ meta={t(($) => $.step_workspace.preview.inbox_meta)}
/>
<EntityRow
icon={<ListTodo className="h-4 w-4" />}
- label="Issues"
- meta="shared task board"
+ label={t(($) => $.step_workspace.preview.issues_label)}
+ meta={t(($) => $.step_workspace.preview.issues_meta)}
/>
<EntityRow
icon={<Bot className="h-4 w-4" />}
- label="Agents"
- meta="your AI teammates"
+ label={t(($) => $.step_workspace.preview.agents_label)}
+ meta={t(($) => $.step_workspace.preview.agents_meta)}
/>
<EntityRow
icon={<FolderKanban className="h-4 w-4" />}
- label="Projects"
- meta="group related issues"
+ label={t(($) => $.step_workspace.preview.projects_label)}
+ meta={t(($) => $.step_workspace.preview.projects_meta)}
/>
<EntityRow
icon={<Zap className="h-4 w-4" />}
- label="Autopilot"
- meta="scheduled automation"
+ label={t(($) => $.step_workspace.preview.autopilot_label)}
+ meta={t(($) => $.step_workspace.preview.autopilot_meta)}
/>
<EntityRow
icon={<Monitor className="h-4 w-4" />}
- label="Runtimes"
- meta="where agents run"
+ label={t(($) => $.step_workspace.preview.runtimes_label)}
+ meta={t(($) => $.step_workspace.preview.runtimes_meta)}
/>
<EntityRow
icon={<BookOpenText className="h-4 w-4" />}
- label="Skills"
- meta="reusable playbooks"
+ label={t(($) => $.step_workspace.preview.skills_label)}
+ meta={t(($) => $.step_workspace.preview.skills_meta)}
/>
<EntityRow
dim
icon={<MoreHorizontal className="h-4 w-4" />}
- label="And more"
- meta="and more"
+ label={t(($) => $.step_workspace.preview.more_label)}
+ meta={t(($) => $.step_workspace.preview.more_meta)}
/>
</div>
</div>
diff --git a/packages/views/package.json b/packages/views/package.json
index 630d4d9de5..a134b5a8b8 100644
--- a/packages/views/package.json
+++ b/packages/views/package.json
@@ -40,7 +40,10 @@
"./invite": "./invite/index.ts",
"./invitations": "./invitations/index.ts",
"./onboarding": "./onboarding/index.ts",
- "./platform": "./platform/index.ts"
+ "./platform": "./platform/index.ts",
+ "./i18n": "./i18n/index.ts",
+ "./locales": "./locales/index.ts",
+ "./locales/*": "./locales/*"
},
"dependencies": {
"@base-ui/react": "^1.3.0",
@@ -88,9 +91,11 @@
"peerDependencies": {
"@tanstack/react-query": "catalog:",
"@tanstack/react-table": "catalog:",
+ "i18next": "catalog:",
"lucide-react": "catalog:",
"react": "catalog:",
"react-dom": "catalog:",
+ "react-i18next": "catalog:",
"zustand": "catalog:"
},
"devDependencies": {
@@ -101,6 +106,7 @@
"@types/react": "catalog:",
"@types/react-dom": "catalog:",
"@vitejs/plugin-react": "catalog:",
+ "eslint-plugin-i18next": "catalog:",
"jsdom": "catalog:",
"rehype-sanitize": "^6.0.0",
"typescript": "catalog:",
diff --git a/packages/views/projects/components/labels.ts b/packages/views/projects/components/labels.ts
new file mode 100644
index 0000000000..074408ced3
--- /dev/null
+++ b/packages/views/projects/components/labels.ts
@@ -0,0 +1,48 @@
+"use client";
+
+import type { ProjectStatus, ProjectPriority } from "@multica/core/types";
+import { useT } from "../../i18n";
+
+// Hooks returning the i18n-aware label maps for project status / priority.
+// They replace the static `.label` field on PROJECT_STATUS_CONFIG /
+// PROJECT_PRIORITY_CONFIG for view-layer rendering. Core's `.label` stays
+// for non-translated callers (search, create-project modal) — those will
+// flip when their namespaces translate. Mirror of inbox `useTypeLabels`.
+
+export function useProjectStatusLabels(): Record<ProjectStatus, string> {
+ const { t } = useT("projects");
+ return {
+ planned: t(($) => $.status.planned),
+ in_progress: t(($) => $.status.in_progress),
+ paused: t(($) => $.status.paused),
+ completed: t(($) => $.status.completed),
+ cancelled: t(($) => $.status.cancelled),
+ };
+}
+
+export function useProjectPriorityLabels(): Record<ProjectPriority, string> {
+ const { t } = useT("projects");
+ return {
+ urgent: t(($) => $.priority.urgent),
+ high: t(($) => $.priority.high),
+ medium: t(($) => $.priority.medium),
+ low: t(($) => $.priority.low),
+ none: t(($) => $.priority.none),
+ };
+}
+
+// "1d ago" / "3mo ago" / "Today" — relative date helper that flows through
+// i18next. Returns a function so callers keep the previous
+// `formatRelativeDate(iso)` shape.
+export function useFormatRelativeDate(): (date: string) => string {
+ const { t } = useT("projects");
+ return (date: string) => {
+ const diff = Date.now() - new Date(date).getTime();
+ const days = Math.floor(diff / (1000 * 60 * 60 * 24));
+ if (days < 1) return t(($) => $.relative_date.today);
+ if (days === 1) return t(($) => $.relative_date.one_day_ago);
+ if (days < 30) return t(($) => $.relative_date.days_ago, { count: days });
+ const months = Math.floor(days / 30);
+ return t(($) => $.relative_date.months_ago, { count: months });
+ };
+}
diff --git a/packages/views/projects/components/project-chip.tsx b/packages/views/projects/components/project-chip.tsx
index 34285ce556..6a6039c0af 100644
--- a/packages/views/projects/components/project-chip.tsx
+++ b/packages/views/projects/components/project-chip.tsx
@@ -4,6 +4,7 @@ import { useQuery } from "@tanstack/react-query";
import { projectListOptions, projectDetailOptions } from "@multica/core/projects/queries";
import { useWorkspaceId } from "@multica/core/hooks";
import { ProjectIcon } from "./project-icon";
+import { useT } from "../../i18n";
/**
* Compact presentational representation of a project —
@@ -28,6 +29,7 @@ export function ProjectChip({
fallbackLabel,
className,
}: ProjectChipProps) {
+ const { t } = useT("projects");
const wsId = useWorkspaceId();
const { data: projects = [] } = useQuery(projectListOptions(wsId));
const listProject = projects.find((p) => p.id === projectId);
@@ -45,7 +47,7 @@ export function ProjectChip({
<span className={cls}>
<ProjectIcon size="md" />
<span className="text-muted-foreground truncate">
- {fallbackLabel ?? "Project"}
+ {fallbackLabel ?? t(($) => $.chip.fallback_label)}
</span>
</span>
);
diff --git a/packages/views/projects/components/project-detail.tsx b/packages/views/projects/components/project-detail.tsx
index 255671fd8f..92b6c8df10 100644
--- a/packages/views/projects/components/project-detail.tsx
+++ b/packages/views/projects/components/project-detail.tsx
@@ -19,7 +19,7 @@ import { memberListOptions, agentListOptions } from "@multica/core/workspace/que
import { useWorkspaceId } from "@multica/core/hooks";
import { useCurrentWorkspace, useWorkspacePaths } from "@multica/core/paths";
import { useActorName } from "@multica/core/workspace/hooks";
-import { PROJECT_STATUS_ORDER, PROJECT_STATUS_CONFIG, PROJECT_PRIORITY_ORDER, PROJECT_PRIORITY_CONFIG } from "@multica/core/projects/config";
+import { PROJECT_STATUS_ORDER, PROJECT_STATUS_CONFIG, PROJECT_PRIORITY_ORDER } from "@multica/core/projects/config";
import { BOARD_STATUSES } from "@multica/core/issues/config";
import { createIssueViewStore } from "@multica/core/issues/stores/view-store";
import { ViewStoreProvider, useViewStore } from "@multica/core/issues/stores/view-store-context";
@@ -68,6 +68,8 @@ import {
AlertDialogHeader,
AlertDialogTitle,
} from "@multica/ui/components/ui/alert-dialog";
+import { useT } from "../../i18n";
+import { useProjectStatusLabels, useProjectPriorityLabels } from "./labels";
// ---------------------------------------------------------------------------
// Property row — sidebar property display
@@ -107,6 +109,7 @@ function ProjectIssuesContent({
scope: string;
filter: MyIssuesFilter;
}) {
+ const { t } = useT("projects");
const wsId = useWorkspaceId();
const viewMode = useViewStore((s) => s.viewMode);
const statusFilters = useViewStore((s) => s.statusFilters);
@@ -141,18 +144,18 @@ function ProjectIssuesContent({
if (newPosition !== undefined) updates.position = newPosition;
updateIssueMutation.mutate(
{ id: issueId, ...updates },
- { onError: () => toast.error("Failed to move issue") },
+ { onError: () => toast.error(t(($) => $.detail.toast_move_issue_failed)) },
);
},
- [updateIssueMutation],
+ [updateIssueMutation, t],
);
if (projectIssues.length === 0) {
return (
<div className="flex flex-1 min-h-0 flex-col items-center justify-center gap-3 text-muted-foreground">
<ListTodo className="h-10 w-10 text-muted-foreground/40" />
- <p className="text-sm">No issues linked</p>
- <p className="text-xs">Create a new issue or assign existing ones to this project.</p>
+ <p className="text-sm">{t(($) => $.detail.empty_issues_title)}</p>
+ <p className="text-xs">{t(($) => $.detail.empty_issues_hint)}</p>
<Button
variant="outline"
size="sm"
@@ -162,7 +165,7 @@ function ProjectIssuesContent({
}
>
<Plus className="size-3.5 mr-1.5" />
- New Issue
+ {t(($) => $.detail.empty_issues_new_button)}
</Button>
</div>
);
@@ -198,6 +201,9 @@ function ProjectIssuesContent({
// ---------------------------------------------------------------------------
export function ProjectDetail({ projectId }: { projectId: string }) {
+ const { t } = useT("projects");
+ const statusLabels = useProjectStatusLabels();
+ const priorityLabels = useProjectPriorityLabels();
const wsId = useWorkspaceId();
const wsPaths = useWorkspacePaths();
const router = useNavigation();
@@ -271,11 +277,11 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
if (!project) return;
deleteProject.mutate(project.id, {
onSuccess: () => {
- toast.success("Project deleted");
+ toast.success(t(($) => $.detail.toast_project_deleted));
router.push(wsPaths.projects());
},
});
- }, [project, deleteProject, router, wsPaths]);
+ }, [project, deleteProject, router, wsPaths, t]);
if (isLoading) {
return (
@@ -289,12 +295,11 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
}
if (!project) {
- return <div className="flex items-center justify-center h-full text-muted-foreground">Project not found</div>;
+ return <div className="flex items-center justify-center h-full text-muted-foreground">{t(($) => $.detail.not_found)}</div>;
}
const issueMetrics = getProjectIssueMetrics(project);
const statusCfg = PROJECT_STATUS_CONFIG[project.status];
- const priorityCfg = PROJECT_PRIORITY_CONFIG[project.priority];
const sidebarContent = (
<div className="space-y-5">
@@ -306,7 +311,7 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
<button
type="button"
className="text-2xl cursor-pointer rounded-lg p-1 -ml-1 hover:bg-accent/60 transition-colors"
- title="Change icon"
+ title={t(($) => $.detail.icon_tooltip)}
>
{project.icon || "📁"}
</button>
@@ -324,7 +329,7 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
<TitleEditor
key={`title-${projectId}`}
defaultValue={project.title}
- placeholder="Project title"
+ placeholder={t(($) => $.detail.title_placeholder)}
className="mt-2 w-full text-base font-semibold leading-snug tracking-tight"
onBlur={(value) => {
const trimmed = value.trim();
@@ -339,17 +344,17 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
className={`flex w-full items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors mb-2 hover:bg-accent/70 ${propertiesOpen ? "" : "text-muted-foreground hover:text-foreground"}`}
onClick={() => setPropertiesOpen(!propertiesOpen)}
>
- Properties
+ {t(($) => $.detail.section_properties)}
<ChevronRight className={`!size-3 shrink-0 stroke-[2.5] text-muted-foreground transition-transform ${propertiesOpen ? "rotate-90" : ""}`} />
</button>
{propertiesOpen && <div className="space-y-0.5 pl-2">
- <PropRow label="Status">
+ <PropRow label={t(($) => $.table.status)}>
<DropdownMenu>
<DropdownMenuTrigger
render={
<button type="button" className="inline-flex items-center gap-1.5 text-xs hover:text-foreground transition-colors">
<span className={cn("size-2 rounded-full", statusCfg.dotColor)} />
- <span>{statusCfg.label}</span>
+ <span>{statusLabels[project.status]}</span>
</button>
}
/>
@@ -357,20 +362,20 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
{PROJECT_STATUS_ORDER.map((s) => (
<DropdownMenuItem key={s} onClick={() => handleUpdateField({ status: s as ProjectStatus })}>
<span className={cn("size-2 rounded-full", PROJECT_STATUS_CONFIG[s].dotColor)} />
- <span>{PROJECT_STATUS_CONFIG[s].label}</span>
+ <span>{statusLabels[s]}</span>
{s === project.status && <Check className="ml-auto h-3.5 w-3.5" />}
</DropdownMenuItem>
))}
</DropdownMenuContent>
</DropdownMenu>
</PropRow>
- <PropRow label="Priority">
+ <PropRow label={t(($) => $.table.priority)}>
<DropdownMenu>
<DropdownMenuTrigger
render={
<button type="button" className="inline-flex items-center gap-1.5 text-xs hover:text-foreground transition-colors">
<PriorityIcon priority={project.priority} />
- <span>{priorityCfg.label}</span>
+ <span>{priorityLabels[project.priority]}</span>
</button>
}
/>
@@ -378,14 +383,14 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
{PROJECT_PRIORITY_ORDER.map((p) => (
<DropdownMenuItem key={p} onClick={() => handleUpdateField({ priority: p as ProjectPriority })}>
<PriorityIcon priority={p} />
- <span>{PROJECT_PRIORITY_CONFIG[p].label}</span>
+ <span>{priorityLabels[p]}</span>
{p === project.priority && <Check className="ml-auto h-3.5 w-3.5" />}
</DropdownMenuItem>
))}
</DropdownMenuContent>
</DropdownMenu>
</PropRow>
- <PropRow label="Lead">
+ <PropRow label={t(($) => $.table.lead)}>
<Popover open={leadOpen} onOpenChange={(v) => { setLeadOpen(v); if (!v) setLeadFilter(""); }}>
<PopoverTrigger
render={
@@ -396,7 +401,7 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
<span className="cursor-pointer">{getActorName(project.lead_type, project.lead_id)}</span>
</>
) : (
- <span className="text-muted-foreground">No lead</span>
+ <span className="text-muted-foreground">{t(($) => $.lead.no_lead)}</span>
)}
</button>
}
@@ -407,7 +412,7 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
type="text"
value={leadFilter}
onChange={(e) => setLeadFilter(e.target.value)}
- placeholder="Assign lead..."
+ placeholder={t(($) => $.lead.assign_placeholder)}
className="w-full bg-transparent text-sm placeholder:text-muted-foreground outline-none"
/>
</div>
@@ -418,11 +423,11 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent transition-colors"
>
<UserMinus className="h-3.5 w-3.5 text-muted-foreground" />
- <span className="text-muted-foreground">No lead</span>
+ <span className="text-muted-foreground">{t(($) => $.lead.no_lead)}</span>
</button>
{filteredMembers.length > 0 && (
<>
- <div className="px-2 pt-2 pb-1 text-xs font-medium text-muted-foreground uppercase tracking-wider">Members</div>
+ <div className="px-2 pt-2 pb-1 text-xs font-medium text-muted-foreground uppercase tracking-wider">{t(($) => $.lead.members_group)}</div>
{filteredMembers.map((m) => (
<button
type="button"
@@ -438,7 +443,7 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
)}
{filteredAgents.length > 0 && (
<>
- <div className="px-2 pt-2 pb-1 text-xs font-medium text-muted-foreground uppercase tracking-wider">Agents</div>
+ <div className="px-2 pt-2 pb-1 text-xs font-medium text-muted-foreground uppercase tracking-wider">{t(($) => $.lead.agents_group)}</div>
{filteredAgents.map((a) => (
<button
type="button"
@@ -453,7 +458,7 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
</>
)}
{filteredMembers.length === 0 && filteredAgents.length === 0 && leadFilter && (
- <div className="px-2 py-3 text-center text-sm text-muted-foreground">No results</div>
+ <div className="px-2 py-3 text-center text-sm text-muted-foreground">{t(($) => $.lead.no_results)}</div>
)}
</div>
</PopoverContent>
@@ -471,7 +476,7 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
className={`flex w-full items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors mb-2 hover:bg-accent/70 ${progressOpen ? "" : "text-muted-foreground hover:text-foreground"}`}
onClick={() => setProgressOpen(!progressOpen)}
>
- Progress
+ {t(($) => $.detail.section_progress)}
<ChevronRight className={`!size-3 shrink-0 stroke-[2.5] text-muted-foreground transition-transform ${progressOpen ? "rotate-90" : ""}`} />
</button>
{progressOpen && <div className="pl-2 flex items-center gap-3">
@@ -495,7 +500,7 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
className={`flex w-full items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors mb-2 hover:bg-accent/70 ${descriptionOpen ? "" : "text-muted-foreground hover:text-foreground"}`}
onClick={() => setDescriptionOpen(!descriptionOpen)}
>
- Description
+ {t(($) => $.detail.section_description)}
<ChevronRight className={`!size-3 shrink-0 stroke-[2.5] text-muted-foreground transition-transform ${descriptionOpen ? "rotate-90" : ""}`} />
</button>
{descriptionOpen && <div className="pl-2">
@@ -503,7 +508,7 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
ref={descEditorRef}
key={projectId}
defaultValue={project.description || ""}
- placeholder="Add description..."
+ placeholder={t(($) => $.detail.description_placeholder)}
onUpdate={(md) => handleUpdateField({ description: md || null })}
debounceMs={1500}
/>
@@ -523,7 +528,7 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
<PageHeader className="gap-2 bg-background text-sm">
<div className="flex flex-1 items-center gap-1.5 min-w-0">
<AppLink href={wsPaths.projects()} className="text-muted-foreground hover:text-foreground transition-colors shrink-0">
- {workspaceName ?? "Projects"}
+ {workspaceName ?? t(($) => $.detail.breadcrumb_fallback)}
</AppLink>
<ChevronRight className="h-3 w-3 text-muted-foreground/50 shrink-0" />
<span className="truncate">{project.title}</span>
@@ -533,7 +538,7 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
variant="ghost"
size="icon-sm"
className={cn("text-muted-foreground", isPinned && "text-foreground")}
- title={isPinned ? "Unpin from sidebar" : "Pin to sidebar"}
+ title={isPinned ? t(($) => $.detail.unpin_tooltip) : t(($) => $.detail.pin_tooltip)}
onClick={() => {
if (isPinned) {
deletePinMut.mutate({ itemType: "project", itemId: projectId });
@@ -555,10 +560,10 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
<DropdownMenuContent align="end" className="w-auto">
<DropdownMenuItem onClick={() => {
navigator.clipboard.writeText(window.location.href);
- toast.success("Link copied");
+ toast.success(t(($) => $.detail.toast_link_copied));
}}>
<Link2 className="h-3.5 w-3.5" />
- Copy link
+ {t(($) => $.detail.copy_link)}
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem
@@ -566,7 +571,7 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
onClick={() => setDeleteDialogOpen(true)}
>
<Trash2 className="h-3.5 w-3.5" />
- Delete project
+ {t(($) => $.detail.delete_action)}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
@@ -592,7 +597,7 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
</Button>
}
/>
- <TooltipContent side="bottom">Toggle sidebar</TooltipContent>
+ <TooltipContent side="bottom">{t(($) => $.detail.sidebar_tooltip)}</TooltipContent>
</Tooltip>
</div>
</PageHeader>
@@ -641,15 +646,15 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
<AlertDialog open={deleteDialogOpen} onOpenChange={setDeleteDialogOpen}>
<AlertDialogContent>
<AlertDialogHeader>
- <AlertDialogTitle>Delete project</AlertDialogTitle>
+ <AlertDialogTitle>{t(($) => $.delete_dialog.title)}</AlertDialogTitle>
<AlertDialogDescription>
- This will delete the project. Issues will not be deleted but will be unlinked.
+ {t(($) => $.delete_dialog.description)}
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
- <AlertDialogCancel>Cancel</AlertDialogCancel>
+ <AlertDialogCancel>{t(($) => $.delete_dialog.cancel)}</AlertDialogCancel>
<AlertDialogAction onClick={handleDelete} className="bg-destructive text-white hover:bg-destructive/90">
- Delete
+ {t(($) => $.delete_dialog.confirm)}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
diff --git a/packages/views/projects/components/project-picker.tsx b/packages/views/projects/components/project-picker.tsx
index 6147c12d0e..62139c91df 100644
--- a/packages/views/projects/components/project-picker.tsx
+++ b/packages/views/projects/components/project-picker.tsx
@@ -13,6 +13,7 @@ import {
DropdownMenuSeparator,
} from "@multica/ui/components/ui/dropdown-menu";
import { ProjectIcon } from "./project-icon";
+import { useT } from "../../i18n";
export function ProjectPicker({
projectId,
@@ -25,6 +26,7 @@ export function ProjectPicker({
triggerRender?: React.ReactElement;
align?: "start" | "center" | "end";
}) {
+ const { t } = useT("projects");
const wsId = useWorkspaceId();
const { data: projects = [] } = useQuery(projectListOptions(wsId));
const current = projects.find((p) => p.id === projectId);
@@ -40,7 +42,7 @@ export function ProjectPicker({
) : (
<FolderKanban className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />
)}
- <span className="truncate">{current ? current.title : "No project"}</span>
+ <span className="truncate">{current ? current.title : t(($) => $.picker.no_project)}</span>
</DropdownMenuTrigger>
<DropdownMenuContent align={align} className="w-52">
{projects.map((p) => (
@@ -54,11 +56,11 @@ export function ProjectPicker({
{projectId && (
<DropdownMenuItem onClick={() => onUpdate({ project_id: null })}>
<X className="h-3.5 w-3.5 text-muted-foreground" />
- Remove from project
+ {t(($) => $.picker.remove)}
</DropdownMenuItem>
)}
{projects.length === 0 && (
- <div className="px-2 py-1.5 text-xs text-muted-foreground">No projects yet</div>
+ <div className="px-2 py-1.5 text-xs text-muted-foreground">{t(($) => $.picker.empty)}</div>
)}
</DropdownMenuContent>
</DropdownMenu>
diff --git a/packages/views/projects/components/project-resources-section.tsx b/packages/views/projects/components/project-resources-section.tsx
index 58c100320b..6eb08a3ef0 100644
--- a/packages/views/projects/components/project-resources-section.tsx
+++ b/packages/views/projects/components/project-resources-section.tsx
@@ -26,6 +26,7 @@ import {
TooltipTrigger,
TooltipContent,
} from "@multica/ui/components/ui/tooltip";
+import { useT } from "../../i18n";
// Project Resources sidebar section.
//
@@ -33,6 +34,7 @@ import {
// so adding a new type means: (1) extend the API validator, (2) add a render
// case here. No changes to the schema or query layer.
export function ProjectResourcesSection({ projectId }: { projectId: string }) {
+ const { t } = useT("projects");
const wsId = useWorkspaceId();
const workspace = useCurrentWorkspace();
const [open, setOpen] = useState(true);
@@ -56,9 +58,9 @@ export function ProjectResourcesSection({ projectId }: { projectId: string }) {
resource_type: "github_repo",
resource_ref: { url },
});
- toast.success("Repository attached");
+ toast.success(t(($) => $.resources.toast_attached));
} catch (err) {
- const msg = err instanceof Error ? err.message : "Failed to attach";
+ const msg = err instanceof Error ? err.message : t(($) => $.resources.toast_attach_failed);
toast.error(msg);
}
};
@@ -66,9 +68,9 @@ export function ProjectResourcesSection({ projectId }: { projectId: string }) {
const handleRemove = async (resource: ProjectResource) => {
try {
await deleteResource.mutateAsync(resource.id);
- toast.success("Resource removed");
+ toast.success(t(($) => $.resources.toast_removed));
} catch {
- toast.error("Failed to remove resource");
+ toast.error(t(($) => $.resources.toast_remove_failed));
}
};
@@ -78,7 +80,7 @@ export function ProjectResourcesSection({ projectId }: { projectId: string }) {
className={`flex w-full items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors mb-2 hover:bg-accent/70 ${open ? "" : "text-muted-foreground hover:text-foreground"}`}
onClick={() => setOpen(!open)}
>
- Resources
+ {t(($) => $.resources.section_header)}
<ChevronRight
className={`!size-3 shrink-0 stroke-[2.5] text-muted-foreground transition-transform ${open ? "rotate-90" : ""}`}
/>
@@ -87,7 +89,7 @@ export function ProjectResourcesSection({ projectId }: { projectId: string }) {
<div className="pl-2 space-y-1.5">
{resources.length === 0 && (
<p className="text-xs text-muted-foreground">
- No resources attached.
+ {t(($) => $.resources.empty)}
</p>
)}
{resources.map((resource) => (
@@ -106,13 +108,13 @@ export function ProjectResourcesSection({ projectId }: { projectId: string }) {
className="h-7 px-2 text-xs text-muted-foreground hover:text-foreground"
>
<Plus className="size-3" />
- Add resource
+ {t(($) => $.resources.add_button)}
</Button>
}
/>
<PopoverContent align="start" className="w-72 p-2 space-y-2">
<div className="text-xs font-medium text-muted-foreground">
- Attach a GitHub repo
+ {t(($) => $.resources.popover_title)}
</div>
{workspace?.repos && workspace.repos.length > 0 && (
<div className="space-y-1">
@@ -145,7 +147,7 @@ export function ProjectResourcesSection({ projectId }: { projectId: string }) {
</Tooltip>
{isAttached && (
<span className="text-[10px] text-muted-foreground">
- attached
+ {t(($) => $.resources.attached_badge)}
</span>
)}
</button>
@@ -174,6 +176,7 @@ function ResourceRow({
resource: ProjectResource;
onRemove: () => void;
}) {
+ const { t } = useT("projects");
if (resource.resource_type === "github_repo") {
const ref = resource.resource_ref as GithubRepoResourceRef;
return (
@@ -198,7 +201,7 @@ function ResourceRow({
type="button"
onClick={onRemove}
className="opacity-0 group-hover:opacity-100 transition-opacity rounded-sm p-0.5 hover:bg-accent"
- title="Remove"
+ title={t(($) => $.resources.remove_tooltip)}
>
<Trash2 className="size-3 text-muted-foreground" />
</button>
@@ -214,7 +217,7 @@ function ResourceRow({
type="button"
onClick={onRemove}
className="rounded-sm p-0.5 hover:bg-accent"
- title="Remove"
+ title={t(($) => $.resources.remove_tooltip)}
>
<Trash2 className="size-3" />
</button>
@@ -227,6 +230,7 @@ function CustomRepoForm({
}: {
onSubmit: (url: string) => Promise<void> | void;
}) {
+ const { t } = useT("projects");
const [url, setUrl] = useState("");
const [submitting, setSubmitting] = useState(false);
const handle = async (e: React.FormEvent) => {
@@ -247,7 +251,7 @@ function CustomRepoForm({
type="url"
value={url}
onChange={(e) => setUrl(e.target.value)}
- placeholder="https://github.com/owner/repo"
+ placeholder={t(($) => $.resources.url_placeholder)}
className="flex-1 bg-transparent text-xs px-2 py-1 outline-none placeholder:text-muted-foreground"
/>
<Button
@@ -257,7 +261,7 @@ function CustomRepoForm({
className="h-6 px-2 text-xs"
disabled={!url.trim() || submitting}
>
- Add
+ {t(($) => $.resources.url_submit)}
</Button>
</form>
);
diff --git a/packages/views/projects/components/projects-page.tsx b/packages/views/projects/components/projects-page.tsx
index 1c27455ad6..b58965b0a5 100644
--- a/packages/views/projects/components/projects-page.tsx
+++ b/packages/views/projects/components/projects-page.tsx
@@ -37,20 +37,20 @@ import type { Project, ProjectStatus, ProjectPriority, UpdateProjectRequest } fr
import { PageHeader } from "../../layout/page-header";
import { PriorityIcon } from "../../issues/components/priority-icon";
import { ProjectIcon } from "./project-icon";
-
-function formatRelativeDate(date: string): string {
- const diff = Date.now() - new Date(date).getTime();
- const days = Math.floor(diff / (1000 * 60 * 60 * 24));
- if (days < 1) return "Today";
- if (days === 1) return "1d ago";
- if (days < 30) return `${days}d ago`;
- const months = Math.floor(days / 30);
- return `${months}mo ago`;
-}
+import { useT } from "../../i18n";
+import {
+ useProjectStatusLabels,
+ useProjectPriorityLabels,
+ useFormatRelativeDate,
+} from "./labels";
function ProjectRow({ project }: { project: Project }) {
+ const { t } = useT("projects");
const wsId = useWorkspaceId();
const wsPaths = useWorkspacePaths();
+ const statusLabels = useProjectStatusLabels();
+ const priorityLabels = useProjectPriorityLabels();
+ const formatRelativeDate = useFormatRelativeDate();
const statusCfg = PROJECT_STATUS_CONFIG[project.status];
const priorityCfg = PROJECT_PRIORITY_CONFIG[project.priority];
const updateProject = useUpdateProject();
@@ -88,7 +88,7 @@ function ProjectRow({ project }: { project: Project }) {
render={
<button type="button" className="flex w-24 items-center justify-center gap-1 shrink-0 rounded px-1 py-0.5 hover:bg-accent/60 transition-colors cursor-pointer">
<PriorityIcon priority={project.priority} />
- <span className={cn("text-xs", priorityCfg.color)}>{priorityCfg.label}</span>
+ <span className={cn("text-xs", priorityCfg.color)}>{priorityLabels[project.priority]}</span>
</button>
}
/>
@@ -96,7 +96,7 @@ function ProjectRow({ project }: { project: Project }) {
{PROJECT_PRIORITY_ORDER.map((p) => (
<DropdownMenuItem key={p} onClick={() => handleUpdate({ priority: p as ProjectPriority })}>
<PriorityIcon priority={p} />
- <span>{PROJECT_PRIORITY_CONFIG[p].label}</span>
+ <span>{priorityLabels[p]}</span>
{p === project.priority && <Check className="ml-auto h-3.5 w-3.5" />}
</DropdownMenuItem>
))}
@@ -111,7 +111,7 @@ function ProjectRow({ project }: { project: Project }) {
"inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium shrink-0 w-28 justify-center cursor-pointer hover:opacity-80 transition-opacity",
statusCfg.badgeBg, statusCfg.badgeText,
)}>
- {statusCfg.label}
+ {statusLabels[project.status]}
</button>
}
/>
@@ -119,7 +119,7 @@ function ProjectRow({ project }: { project: Project }) {
{PROJECT_STATUS_ORDER.map((s) => (
<DropdownMenuItem key={s} onClick={() => handleUpdate({ status: s as ProjectStatus })}>
<span className={cn("size-2 rounded-full", PROJECT_STATUS_CONFIG[s].dotColor)} />
- <span>{PROJECT_STATUS_CONFIG[s].label}</span>
+ <span>{statusLabels[s]}</span>
{s === project.status && <Check className="ml-auto h-3.5 w-3.5" />}
</DropdownMenuItem>
))}
@@ -167,7 +167,7 @@ function ProjectRow({ project }: { project: Project }) {
type="text"
value={leadFilter}
onChange={(e) => setLeadFilter(e.target.value)}
- placeholder="Assign lead..."
+ placeholder={t(($) => $.lead.assign_placeholder)}
className="w-full bg-transparent text-sm placeholder:text-muted-foreground outline-none"
/>
</div>
@@ -178,11 +178,11 @@ function ProjectRow({ project }: { project: Project }) {
className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent transition-colors"
>
<UserMinus className="h-3.5 w-3.5 text-muted-foreground" />
- <span className="text-muted-foreground">No lead</span>
+ <span className="text-muted-foreground">{t(($) => $.lead.no_lead)}</span>
</button>
{filteredMembers.length > 0 && (
<>
- <div className="px-2 pt-2 pb-1 text-xs font-medium text-muted-foreground uppercase tracking-wider">Members</div>
+ <div className="px-2 pt-2 pb-1 text-xs font-medium text-muted-foreground uppercase tracking-wider">{t(($) => $.lead.members_group)}</div>
{filteredMembers.map((m) => (
<button
type="button"
@@ -198,7 +198,7 @@ function ProjectRow({ project }: { project: Project }) {
)}
{filteredAgents.length > 0 && (
<>
- <div className="px-2 pt-2 pb-1 text-xs font-medium text-muted-foreground uppercase tracking-wider">Agents</div>
+ <div className="px-2 pt-2 pb-1 text-xs font-medium text-muted-foreground uppercase tracking-wider">{t(($) => $.lead.agents_group)}</div>
{filteredAgents.map((a) => (
<button
type="button"
@@ -213,7 +213,7 @@ function ProjectRow({ project }: { project: Project }) {
</>
)}
{filteredMembers.length === 0 && filteredAgents.length === 0 && leadFilter && (
- <div className="px-2 py-3 text-center text-sm text-muted-foreground">No results</div>
+ <div className="px-2 py-3 text-center text-sm text-muted-foreground">{t(($) => $.lead.no_results)}</div>
)}
</div>
</PopoverContent>
@@ -229,6 +229,7 @@ function ProjectRow({ project }: { project: Project }) {
export function ProjectsPage() {
+ const { t } = useT("projects");
const wsId = useWorkspaceId();
const { data: projects = [], isLoading } = useQuery(projectListOptions(wsId));
const openCreateProject = () => useModalStore.getState().open("create-project");
@@ -239,14 +240,14 @@ export function ProjectsPage() {
<PageHeader className="justify-between px-5">
<div className="flex items-center gap-2">
<FolderKanban className="h-4 w-4 text-muted-foreground" />
- <h1 className="text-sm font-medium">Projects</h1>
+ <h1 className="text-sm font-medium">{t(($) => $.page.title)}</h1>
{!isLoading && projects.length > 0 && (
<span className="text-xs text-muted-foreground tabular-nums">{projects.length}</span>
)}
</div>
<Button size="sm" variant="outline" onClick={openCreateProject}>
<Plus className="h-3.5 w-3.5 mr-1" />
- New project
+ {t(($) => $.page.new_project)}
</Button>
</PageHeader>
@@ -272,9 +273,9 @@ export function ProjectsPage() {
) : projects.length === 0 ? (
<div className="flex flex-col items-center justify-center py-24 text-muted-foreground">
<FolderKanban className="h-10 w-10 mb-3 opacity-30" />
- <p className="text-sm">No projects yet</p>
+ <p className="text-sm">{t(($) => $.page.empty)}</p>
<Button size="sm" variant="outline" className="mt-3" onClick={openCreateProject}>
- Create your first project
+ {t(($) => $.page.create_first)}
</Button>
</div>
) : (
@@ -283,12 +284,12 @@ export function ProjectsPage() {
<div className="sticky top-0 z-[1] flex h-8 items-center gap-2 border-b bg-muted/30 px-5 text-xs font-medium text-muted-foreground">
{/* Icon spacer + Name */}
<span className="shrink-0 w-[24px]" />
- <span className="min-w-0 flex-1">Name</span>
- <span className="w-24 text-center shrink-0">Priority</span>
- <span className="w-28 text-center shrink-0">Status</span>
- <span className="w-24 text-center shrink-0">Progress</span>
- <span className="w-10 text-center shrink-0">Lead</span>
- <span className="w-20 text-right shrink-0">Created</span>
+ <span className="min-w-0 flex-1">{t(($) => $.table.name)}</span>
+ <span className="w-24 text-center shrink-0">{t(($) => $.table.priority)}</span>
+ <span className="w-28 text-center shrink-0">{t(($) => $.table.status)}</span>
+ <span className="w-24 text-center shrink-0">{t(($) => $.table.progress)}</span>
+ <span className="w-10 text-center shrink-0">{t(($) => $.table.lead)}</span>
+ <span className="w-20 text-right shrink-0">{t(($) => $.table.created)}</span>
</div>
{/* Rows */}
{projects.map((project) => (
diff --git a/packages/views/runtimes/components/charts/activity-heatmap.tsx b/packages/views/runtimes/components/charts/activity-heatmap.tsx
index 1a4a18d58e..ed12b17208 100644
--- a/packages/views/runtimes/components/charts/activity-heatmap.tsx
+++ b/packages/views/runtimes/components/charts/activity-heatmap.tsx
@@ -1,6 +1,7 @@
import { useMemo } from "react";
import type { RuntimeUsage } from "@multica/core/types";
import { estimateCost } from "../../utils";
+import { useT } from "../../../i18n";
// 26 weeks (~6 months) gives the heatmap real presence in the wider chart
// card and turns "long-view" into a meaningful tab — a 13-week strip looked
@@ -46,6 +47,7 @@ interface Insights {
}
export function ActivityHeatmap({ usage }: { usage: RuntimeUsage[] }) {
+ const { t } = useT("runtimes");
const { cells, monthLabels, insights } = useMemo(() => {
// Sum priced cost per day. Cost (not tokens) gives the colour scale a
// financial meaning that lines up with the rest of the page — a "hot"
@@ -225,7 +227,7 @@ export function ActivityHeatmap({ usage }: { usage: RuntimeUsage[] }) {
</svg>
</div>
<div className="flex items-center gap-1 text-[10px] text-muted-foreground">
- <span>Less</span>
+ <span>{t(($) => $.charts.heatmap_less)}</span>
{[0, 1, 2, 3, 4].map((level) => (
<div
key={level}
@@ -233,7 +235,7 @@ export function ActivityHeatmap({ usage }: { usage: RuntimeUsage[] }) {
style={{ backgroundColor: getHeatmapColor(level) }}
/>
))}
- <span>More</span>
+ <span>{t(($) => $.charts.heatmap_more)}</span>
</div>
</div>
diff --git a/packages/views/runtimes/components/connect-remote-dialog.tsx b/packages/views/runtimes/components/connect-remote-dialog.tsx
index 1bb07beb6d..6ce539f248 100644
--- a/packages/views/runtimes/components/connect-remote-dialog.tsx
+++ b/packages/views/runtimes/components/connect-remote-dialog.tsx
@@ -26,6 +26,7 @@ import {
} from "@multica/ui/components/ui/dialog";
import { Button } from "@multica/ui/components/ui/button";
import { useNavigation } from "../../navigation";
+import { useT } from "../../i18n";
type Step = "instructions" | "waiting" | "success";
@@ -168,23 +169,22 @@ function InstructionsStep({
onNext: () => void;
onClose: () => void;
}) {
+ const { t } = useT("runtimes");
return (
<>
<DialogHeader>
- <DialogTitle>Connect a remote machine</DialogTitle>
+ <DialogTitle>{t(($) => $.connect.title)}</DialogTitle>
<DialogDescription>
- Run these commands on your remote machine (e.g. AWS EC2) to install the
- Multica CLI and register it as a runtime.
+ {t(($) => $.connect.description)}
</DialogDescription>
</DialogHeader>
<div className="-mx-4 min-h-0 flex-1 overflow-y-auto px-4">
<div className="space-y-3">
- {/* Step 1: Install */}
<div>
<div className="mb-1 flex items-center gap-1.5 text-xs font-medium text-muted-foreground">
<Terminal className="h-3.5 w-3.5" />
- 1. Install the CLI
+ {t(($) => $.connect.step1)}
</div>
<CodeBlock
code={INSTALL_CMD}
@@ -194,11 +194,10 @@ function InstructionsStep({
/>
</div>
- {/* Step 2: Configure */}
<div>
<div className="mb-1 flex items-center gap-1.5 text-xs font-medium text-muted-foreground">
<Server className="h-3.5 w-3.5" />
- 2. Configure
+ {t(($) => $.connect.step2)}
</div>
<CodeBlock
code={CONFIGURE_CMD}
@@ -208,10 +207,9 @@ function InstructionsStep({
/>
</div>
- {/* Step 3: Login */}
<div>
<div className="mb-1 flex items-center gap-1.5 text-xs font-medium text-muted-foreground">
- 3. Login with a personal access token
+ {t(($) => $.connect.step3)}
</div>
<CodeBlock
code={LOGIN_CMD}
@@ -220,18 +218,17 @@ function InstructionsStep({
onCopy={onCopy}
/>
<p className="mt-1 text-[11px] text-muted-foreground">
- Create one in{" "}
+ {t(($) => $.connect.step3_hint_prefix)}
<span className="font-medium text-foreground">
- Settings → Tokens
+ {t(($) => $.connect.step3_hint_destination)}
</span>
- .
+ {t(($) => $.connect.step3_hint_suffix)}
</p>
</div>
- {/* Step 4: Start daemon */}
<div>
<div className="mb-1 flex items-center gap-1.5 text-xs font-medium text-muted-foreground">
- 4. Start the daemon
+ {t(($) => $.connect.step4)}
</div>
<CodeBlock
code={START_CMD}
@@ -241,56 +238,51 @@ function InstructionsStep({
/>
</div>
- {/* Security tips */}
<div className="rounded-md border border-warning/30 bg-warning/5 p-2.5">
<div className="flex items-start gap-2">
<ShieldAlert className="mt-0.5 h-3.5 w-3.5 shrink-0 text-warning" />
<div className="text-[11px] leading-relaxed text-muted-foreground">
- <span className="font-medium text-foreground">Security: </span>
- Use an EC2 IAM role or least-privilege credentials. Never put
- root keys into agent{" "}
+ <span className="font-medium text-foreground">{t(($) => $.connect.security_label)}</span>
+ {t(($) => $.connect.security_body)}
<code className="rounded bg-muted px-1 py-0.5 font-mono text-[10px]">
- custom_env
+ {"custom_env"}
</code>
- . The daemon uses outbound connections only — no inbound ports
- needed.
+ {t(($) => $.connect.security_body_suffix)}
</div>
</div>
</div>
- {/* Troubleshooting */}
<details className="group pb-1">
<summary className="flex cursor-pointer items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground">
<Wrench className="h-3.5 w-3.5" />
- Troubleshooting
+ {t(($) => $.connect.troubleshooting)}
<ChevronRight className="h-3 w-3 transition-transform group-open:rotate-90" />
</summary>
<ul className="mt-1.5 list-disc space-y-0.5 pl-8 text-[11px] text-muted-foreground">
<li>
- Check status:{" "}
+ {t(($) => $.connect.trouble_check_status)}
<code className="rounded bg-muted px-1 py-0.5 font-mono text-[10px]">
- multica daemon status
+ {"multica daemon status"}
</code>
</li>
<li>
- View logs:{" "}
+ {t(($) => $.connect.trouble_view_logs)}
<code className="rounded bg-muted px-1 py-0.5 font-mono text-[10px]">
- multica daemon logs -f
+ {"multica daemon logs -f"}
</code>
</li>
<li>
- Verify provider:{" "}
+ {t(($) => $.connect.trouble_verify_provider)}
<code className="rounded bg-muted px-1 py-0.5 font-mono text-[10px]">
- claude --version
+ {"claude --version"}
</code>
</li>
<li>
- Desktop auto-scans only your local machine. Remote machines must
- run{" "}
+ {t(($) => $.connect.trouble_remote_note_prefix)}
<code className="rounded bg-muted px-1 py-0.5 font-mono text-[10px]">
- multica daemon
- </code>{" "}
- separately.
+ {"multica daemon"}
+ </code>
+ {t(($) => $.connect.trouble_remote_note_suffix)}
</li>
</ul>
</details>
@@ -299,10 +291,10 @@ function InstructionsStep({
<DialogFooter>
<Button variant="ghost" onClick={onClose}>
- Cancel
+ {t(($) => $.connect.cancel)}
</Button>
<Button onClick={onNext}>
- I&apos;ve started the daemon
+ {t(($) => $.connect.started_daemon)}
<ChevronRight className="h-3.5 w-3.5" />
</Button>
</DialogFooter>
@@ -315,30 +307,30 @@ function InstructionsStep({
// ---------------------------------------------------------------------------
function WaitingStep({ onBack }: { onBack: () => void }) {
+ const { t } = useT("runtimes");
return (
<>
<DialogHeader>
- <DialogTitle>Waiting for runtime…</DialogTitle>
+ <DialogTitle>{t(($) => $.connect.waiting_title)}</DialogTitle>
<DialogDescription>
- Listening for your remote daemon to register. This page updates
- automatically — no need to refresh.
+ {t(($) => $.connect.waiting_description)}
</DialogDescription>
</DialogHeader>
<div className="flex flex-col items-center gap-3 py-8">
<Loader2 className="h-8 w-8 animate-spin text-muted-foreground" />
<p className="text-sm text-muted-foreground">
- Run{" "}
+ {t(($) => $.connect.waiting_hint_prefix)}
<code className="rounded bg-muted px-1.5 py-0.5 font-mono text-xs">
- multica daemon status
- </code>{" "}
- on the remote machine to verify it&apos;s running.
+ {"multica daemon status"}
+ </code>
+ {t(($) => $.connect.waiting_hint_suffix)}
</p>
</div>
<DialogFooter>
<Button variant="ghost" onClick={onBack}>
- Back
+ {t(($) => $.connect.back)}
</Button>
</DialogFooter>
</>
@@ -356,13 +348,13 @@ function SuccessStep({
onGoToAgents: () => void;
onGoToRuntime?: () => void;
}) {
+ const { t } = useT("runtimes");
return (
<>
<DialogHeader>
- <DialogTitle>Runtime connected!</DialogTitle>
+ <DialogTitle>{t(($) => $.connect.success_title)}</DialogTitle>
<DialogDescription>
- Your remote machine has registered as a runtime. You can now create an
- agent that dispatches tasks to it.
+ {t(($) => $.connect.success_description)}
</DialogDescription>
</DialogHeader>
@@ -375,11 +367,11 @@ function SuccessStep({
<DialogFooter>
{onGoToRuntime && (
<Button variant="ghost" onClick={onGoToRuntime}>
- View runtime
+ {t(($) => $.connect.view_runtime)}
</Button>
)}
<Button onClick={onGoToAgents}>
- Create an agent
+ {t(($) => $.connect.create_agent)}
<ChevronRight className="h-3.5 w-3.5" />
</Button>
</DialogFooter>
diff --git a/packages/views/runtimes/components/runtime-columns.tsx b/packages/views/runtimes/components/runtime-columns.tsx
index 067e876736..61f621d8b8 100644
--- a/packages/views/runtimes/components/runtime-columns.tsx
+++ b/packages/views/runtimes/components/runtime-columns.tsx
@@ -41,13 +41,14 @@ import {
import { ActorAvatar } from "../../common/actor-avatar";
import { workloadConfig } from "../../agents/presence";
import { ProviderLogo } from "./provider-logo";
-import { HealthIcon, healthLabel } from "./shared";
+import { HealthIcon, useHealthLabel } from "./shared";
import {
computeCostInWindow,
formatLastSeen,
isVersionNewer,
pctChange,
} from "../utils";
+import { useT } from "../../i18n";
// Per-row data assembled at the page level. The columns reach into
// `row.original` and never pull their own data — except for the per-runtime
@@ -78,11 +79,14 @@ const COL_WIDTHS = {
actions: 60,
} as const;
+type RuntimesT = ReturnType<typeof useT<"runtimes">>["t"];
+
interface CreateColumnsArgs {
showOwner: boolean;
latestCliVersion: string | null;
wsId: string;
now: number;
+ t: RuntimesT;
}
export function createRuntimeColumns({
@@ -90,18 +94,19 @@ export function createRuntimeColumns({
latestCliVersion,
wsId,
now,
+ t,
}: CreateColumnsArgs): ColumnDef<RuntimeRow>[] {
const cols: ColumnDef<RuntimeRow>[] = [
{
id: "runtime",
- header: "Runtime",
+ header: () => t(($) => $.list.col_runtime),
size: COL_WIDTHS.runtime,
meta: { grow: true },
cell: ({ row }) => <RuntimeNameCell runtime={row.original.runtime} />,
},
{
id: "health",
- header: "Health",
+ header: () => t(($) => $.list.col_health),
size: COL_WIDTHS.health,
meta: { grow: true },
cell: ({ row }) => (
@@ -113,7 +118,7 @@ export function createRuntimeColumns({
if (showOwner) {
cols.push({
id: "owner",
- header: "Owner",
+ header: () => t(($) => $.list.col_owner),
size: COL_WIDTHS.owner,
cell: ({ row }) =>
row.original.ownerMember ? (
@@ -136,7 +141,7 @@ export function createRuntimeColumns({
cols.push(
{
id: "agents",
- header: "Agents",
+ header: () => t(($) => $.list.col_agents),
size: COL_WIDTHS.agents,
cell: ({ row }) => (
<AgentStack agentIds={row.original.workload.agentIds} />
@@ -144,7 +149,7 @@ export function createRuntimeColumns({
},
{
id: "workload",
- header: "Workload",
+ header: () => t(($) => $.list.col_workload),
size: COL_WIDTHS.workload,
cell: ({ row }) => {
const health = deriveRuntimeHealth(row.original.runtime, now);
@@ -160,13 +165,13 @@ export function createRuntimeColumns({
},
{
id: "cost",
- header: () => <div className="text-right">Cost · 7d</div>,
+ header: () => <div className="text-right">{t(($) => $.list.col_cost)}</div>,
size: COL_WIDTHS.cost,
cell: ({ row }) => <CostCell runtimeId={row.original.runtime.id} />,
},
{
id: "cli",
- header: "CLI",
+ header: () => t(($) => $.list.col_cli),
size: COL_WIDTHS.cli,
meta: { grow: true },
cell: ({ row }) => (
@@ -255,13 +260,14 @@ function HealthCell({
runtime: AgentRuntime;
now: number;
}) {
+ const labelOf = useHealthLabel();
const health = deriveRuntimeHealth(runtime, now);
const lastSeen = formatLastSeen(runtime.last_seen_at);
return (
<div className="flex min-w-0 items-center gap-1.5">
<HealthIcon health={health} />
<span className="block min-w-0 truncate text-sm">
- {healthLabel(health)}
+ {labelOf(health)}
{health !== "online" && runtime.last_seen_at && (
<span className="text-muted-foreground"> · {lastSeen}</span>
)}
@@ -284,6 +290,7 @@ function WorkloadCell({
queued: number;
offline: boolean;
}) {
+ const { t: tAgents } = useT("agents");
if (offline) {
return <span className="text-xs text-muted-foreground/50">—</span>;
}
@@ -292,8 +299,6 @@ function WorkloadCell({
queuedCount: queued,
});
const wl = workloadConfig[workload];
- // Working: running count, with +Nq overflow tail. Queued: bare queued
- // count. Idle: no counts at all — the label is the whole signal.
const counts =
workload === "working"
? queued > 0
@@ -304,13 +309,12 @@ function WorkloadCell({
: null;
return (
<span className="inline-flex items-center gap-1 text-xs">
- {/* Icon only for working/queued — see WorkloadCell in agent-columns. */}
{workload !== "idle" && (
<wl.icon
className={`h-3 w-3 shrink-0 ${wl.textClass} ${workload === "working" ? "animate-spin" : ""}`}
/>
)}
- <span className={`shrink-0 ${wl.textClass}`}>{wl.label}</span>
+ <span className={`shrink-0 ${wl.textClass}`}>{tAgents(($) => $.workload[workload])}</span>
{counts && (
<span className="truncate font-mono tabular-nums text-muted-foreground">
{counts}
@@ -331,6 +335,7 @@ function WorkloadCell({
const COST_CELL_DAYS = 14;
function CostCell({ runtimeId }: { runtimeId: string }) {
+ const { t } = useT("runtimes");
const { data: usage = [] } = useQuery(
runtimeUsageOptions(runtimeId, COST_CELL_DAYS),
);
@@ -361,7 +366,7 @@ function CostCell({ runtimeId }: { runtimeId: string }) {
delta == null
? null
: delta === 0
- ? "flat"
+ ? t(($) => $.list.cost_delta_flat)
: `${delta > 0 ? "↑" : "↓"}${Math.abs(delta)}%`;
return (
<div className="flex flex-col items-end leading-tight">
@@ -382,6 +387,7 @@ function CliCell({
runtime: AgentRuntime;
latestCliVersion: string | null;
}) {
+ const { t } = useT("runtimes");
if (runtime.runtime_mode === "cloud") {
return <span className="text-xs text-muted-foreground/50">—</span>;
}
@@ -408,7 +414,7 @@ function CliCell({
<div className="flex min-w-0 items-center gap-1 text-xs">
{isManaged && (
<span className="shrink-0 rounded-sm bg-muted px-1 py-0.5 text-[10px] font-medium text-muted-foreground">
- Desktop
+ {t(($) => $.list.cli_managed_badge)}
</span>
)}
<span
@@ -424,12 +430,12 @@ function CliCell({
render={
<ArrowUpCircle
className="h-3 w-3 shrink-0 text-warning"
- aria-label="Update available"
+ aria-label={t(($) => $.list.cli_update_available_aria)}
/>
}
/>
<TooltipContent>
- Update available: {latestCliVersion}
+ {t(($) => $.list.cli_update_available_tooltip, { version: latestCliVersion })}
</TooltipContent>
</Tooltip>
)}
@@ -479,6 +485,7 @@ function RowMenu({
wsId: string;
canDelete: boolean;
}) {
+ const { t } = useT("runtimes");
const deleteMutation = useDeleteRuntime(wsId);
const [deleteOpen, setDeleteOpen] = useState(false);
@@ -489,12 +496,12 @@ function RowMenu({
const handleDelete = () => {
deleteMutation.mutate(runtime.id, {
onSuccess: () => {
- toast.success("Runtime deleted");
+ toast.success(t(($) => $.detail.toast_deleted));
setDeleteOpen(false);
},
onError: (e) => {
toast.error(
- e instanceof Error ? e.message : "Failed to delete runtime",
+ e instanceof Error ? e.message : t(($) => $.detail.toast_delete_failed),
);
},
});
@@ -508,7 +515,7 @@ function RowMenu({
<Button
variant="ghost"
size="icon-sm"
- aria-label="Row actions"
+ aria-label={t(($) => $.list.row_actions_aria)}
onClick={(e) => e.stopPropagation()}
onKeyDown={(e) => e.stopPropagation()}
/>
@@ -524,10 +531,10 @@ function RowMenu({
<DropdownMenuItem
variant="destructive"
onClick={() => setDeleteOpen(true)}
- title="Only the runtime owner and workspace admins can delete this runtime"
+ title={t(($) => $.list.delete_permission_hint)}
>
<Trash2 className="h-3.5 w-3.5" />
- Delete
+ {t(($) => $.list.delete_action)}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
@@ -540,23 +547,22 @@ function RowMenu({
>
<AlertDialogContent onClick={(e) => e.stopPropagation()}>
<AlertDialogHeader>
- <AlertDialogTitle>Delete Runtime</AlertDialogTitle>
+ <AlertDialogTitle>{t(($) => $.detail.delete_dialog.title)}</AlertDialogTitle>
<AlertDialogDescription>
- Are you sure you want to delete &ldquo;{runtime.name}&rdquo;?
- This action cannot be undone.
+ {t(($) => $.detail.delete_dialog.description, { name: runtime.name })}
<span className="mt-2 block text-xs text-muted-foreground/80">
- Only the runtime owner and workspace admins can delete a runtime.
+ {t(($) => $.list.delete_admin_hint)}
</span>
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
- <AlertDialogCancel>Cancel</AlertDialogCancel>
+ <AlertDialogCancel>{t(($) => $.detail.delete_dialog.cancel)}</AlertDialogCancel>
<AlertDialogAction
variant="destructive"
onClick={handleDelete}
disabled={deleteMutation.isPending}
>
- {deleteMutation.isPending ? "Deleting..." : "Delete"}
+ {deleteMutation.isPending ? t(($) => $.detail.delete_dialog.deleting) : t(($) => $.detail.delete_dialog.confirm)}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
diff --git a/packages/views/runtimes/components/runtime-detail-page.tsx b/packages/views/runtimes/components/runtime-detail-page.tsx
index fc23482109..2b0d3ffb94 100644
--- a/packages/views/runtimes/components/runtime-detail-page.tsx
+++ b/packages/views/runtimes/components/runtime-detail-page.tsx
@@ -6,6 +6,7 @@ import { useWorkspaceId } from "@multica/core/hooks";
import { runtimeListOptions } from "@multica/core/runtimes/queries";
import { Skeleton } from "@multica/ui/components/ui/skeleton";
import { RuntimeDetail } from "./runtime-detail";
+import { useT } from "../../i18n";
/**
* Routed entry for `/{slug}/runtimes/{id}`. Reads the workspace runtime list
@@ -16,6 +17,7 @@ import { RuntimeDetail } from "./runtime-detail";
* keeps cache invariants simple (one cache, one update path).
*/
export function RuntimeDetailPage({ runtimeId }: { runtimeId: string }) {
+ const { t } = useT("runtimes");
const wsId = useWorkspaceId();
const { data: runtimes, isLoading } = useQuery(runtimeListOptions(wsId));
@@ -38,9 +40,9 @@ export function RuntimeDetailPage({ runtimeId }: { runtimeId: string }) {
return (
<div className="flex h-full flex-col items-center justify-center text-muted-foreground">
<Server className="h-10 w-10 text-muted-foreground/30" />
- <p className="mt-3 text-sm">Runtime not found</p>
+ <p className="mt-3 text-sm">{t(($) => $.detail_page.not_found_title)}</p>
<p className="mt-1 text-xs text-muted-foreground/70">
- It may have been deleted or you may not have access.
+ {t(($) => $.detail_page.not_found_hint)}
</p>
</div>
);
diff --git a/packages/views/runtimes/components/runtime-detail.tsx b/packages/views/runtimes/components/runtime-detail.tsx
index c6b9e972ba..76deb77f84 100644
--- a/packages/views/runtimes/components/runtime-detail.tsx
+++ b/packages/views/runtimes/components/runtime-detail.tsx
@@ -45,6 +45,7 @@ import { HealthBadge } from "./shared";
import { ProviderLogo } from "./provider-logo";
import { UpdateSection } from "./update-section";
import { UsageSection } from "./usage-section";
+import { useT } from "../../i18n";
function getCliVersion(metadata: Record<string, unknown>): string | null {
if (
@@ -89,6 +90,7 @@ function useNowTick(intervalMs = 30_000): number {
}
export function RuntimeDetail({ runtime }: { runtime: AgentRuntime }) {
+ const { t } = useT("runtimes");
const cliVersion =
runtime.runtime_mode === "local" ? getCliVersion(runtime.metadata) : null;
const launchedBy =
@@ -126,11 +128,11 @@ export function RuntimeDetail({ runtime }: { runtime: AgentRuntime }) {
const handleDelete = () => {
deleteMutation.mutate(runtime.id, {
onSuccess: () => {
- toast.success("Runtime deleted");
+ toast.success(t(($) => $.detail.toast_deleted));
setDeleteOpen(false);
},
onError: (e) => {
- toast.error(e instanceof Error ? e.message : "Failed to delete runtime");
+ toast.error(e instanceof Error ? e.message : t(($) => $.detail.toast_delete_failed));
},
});
};
@@ -150,7 +152,7 @@ export function RuntimeDetail({ runtime }: { runtime: AgentRuntime }) {
render={<AppLink href={paths.runtimes()} />}
>
<ArrowLeft className="h-3 w-3" />
- All runtimes
+ {t(($) => $.detail.all_runtimes)}
</Button>
<ChevronRight className="h-3 w-3 text-muted-foreground" />
<span className="truncate font-mono text-xs text-foreground">
@@ -160,7 +162,7 @@ export function RuntimeDetail({ runtime }: { runtime: AgentRuntime }) {
{!canDelete && (
<span className="inline-flex items-center gap-1 text-xs text-muted-foreground">
<Lock className="h-3 w-3" />
- Read-only
+ {t(($) => $.detail.read_only)}
</span>
)}
{canDelete && (
@@ -172,13 +174,13 @@ export function RuntimeDetail({ runtime }: { runtime: AgentRuntime }) {
size="icon-sm"
onClick={() => setDeleteOpen(true)}
className="text-muted-foreground hover:text-destructive"
- aria-label="Delete runtime"
+ aria-label={t(($) => $.detail.delete_aria)}
>
<Trash2 className="h-3.5 w-3.5" />
</Button>
}
/>
- <TooltipContent>Delete runtime</TooltipContent>
+ <TooltipContent>{t(($) => $.detail.delete_tooltip)}</TooltipContent>
</Tooltip>
)}
</div>
@@ -225,19 +227,19 @@ export function RuntimeDetail({ runtime }: { runtime: AgentRuntime }) {
<AlertDialog open={deleteOpen} onOpenChange={(v) => { if (!v) setDeleteOpen(false); }}>
<AlertDialogContent>
<AlertDialogHeader>
- <AlertDialogTitle>Delete Runtime</AlertDialogTitle>
+ <AlertDialogTitle>{t(($) => $.detail.delete_dialog.title)}</AlertDialogTitle>
<AlertDialogDescription>
- Are you sure you want to delete &ldquo;{runtime.name}&rdquo;? This action cannot be undone.
+ {t(($) => $.detail.delete_dialog.description, { name: runtime.name })}
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
- <AlertDialogCancel>Cancel</AlertDialogCancel>
+ <AlertDialogCancel>{t(($) => $.detail.delete_dialog.cancel)}</AlertDialogCancel>
<AlertDialogAction
variant="destructive"
onClick={handleDelete}
disabled={deleteMutation.isPending}
>
- {deleteMutation.isPending ? "Deleting..." : "Delete"}
+ {deleteMutation.isPending ? t(($) => $.detail.delete_dialog.deleting) : t(($) => $.detail.delete_dialog.confirm)}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
@@ -275,6 +277,7 @@ function HeroCard({
cliVersion: string | null;
daemonShort: string | null;
}) {
+ const { t } = useT("runtimes");
const [showDetails, setShowDetails] = useState(false);
const device = runtime.device_info ? parseDeviceInfo(runtime.device_info) : null;
const hasTechDetails = !!cliVersion || !!daemonShort;
@@ -293,7 +296,7 @@ function HeroCard({
</h2>
<HealthBadge health={health} />
<span className="text-xs text-muted-foreground">
- last seen {lastSeen}
+ {t(($) => $.detail.last_seen, { when: lastSeen })}
</span>
</div>
</div>
@@ -358,7 +361,7 @@ function HeroCard({
showDetails ? "rotate-90" : ""
}`}
/>
- Technical details
+ {t(($) => $.detail.technical_details)}
</button>
{showDetails && (
<dl className="grid grid-cols-1 gap-y-2 border-t bg-muted/30 px-4 py-3 sm:grid-cols-2">
@@ -410,19 +413,21 @@ function ServingAgentsCard({
presenceMap: Map<string, AgentPresenceDetail>;
agentHref: (agentId: string) => string;
}) {
+ const { t } = useT("runtimes");
+ const { t: tAgents } = useT("agents");
return (
<div className="rounded-lg border">
<div className="flex items-center justify-between border-b px-4 py-2.5">
- <span className="text-xs font-semibold">Serving</span>
+ <span className="text-xs font-semibold">{t(($) => $.detail.serving_title)}</span>
<span className="text-xs text-muted-foreground">
- {agents.length} agent{agents.length === 1 ? "" : "s"}
+ {t(($) => $.detail.serving_count, { count: agents.length })}
</span>
</div>
{agents.length === 0 ? (
<div className="flex flex-col items-center px-4 py-6 text-center">
<Cpu className="h-5 w-5 text-muted-foreground/40" />
<p className="mt-2 text-xs text-muted-foreground">
- No agents are bound to this runtime yet.
+ {t(($) => $.detail.no_agents)}
</p>
</div>
) : (
@@ -432,6 +437,7 @@ function ServingAgentsCard({
const av = detail
? availabilityConfig[detail.availability]
: availabilityConfig.offline;
+ const avLabel = tAgents(($) => $.availability[detail?.availability ?? "offline"]);
const wl = detail ? workloadConfig[detail.workload] : null;
const running = detail?.runningCount ?? 0;
const queued = detail?.queuedCount ?? 0;
@@ -449,7 +455,7 @@ function ServingAgentsCard({
<div className="mt-0.5 flex flex-wrap items-center gap-x-1.5 gap-y-0.5 text-xs">
<span className="inline-flex items-center gap-1.5">
<span className={`h-1.5 w-1.5 rounded-full ${av.dotClass}`} />
- <span className={av.textClass}>{av.label}</span>
+ <span className={av.textClass}>{avLabel}</span>
</span>
{wl && detail && detail.workload !== "idle" && (
<span className={`inline-flex items-center gap-1 ${wl.textClass}`}>
@@ -457,12 +463,12 @@ function ServingAgentsCard({
<wl.icon
className={`h-3 w-3 ${detail.workload === "working" ? "animate-spin" : ""}`}
/>
- {wl.label}
+ {tAgents(($) => $.workload[detail.workload])}
{running > 0 && (
- <span className="text-muted-foreground">· {running} running</span>
+ <span className="text-muted-foreground">{t(($) => $.detail.running_chip, { count: running })}</span>
)}
{queued > 0 && (
- <span className="text-muted-foreground">· {queued} queued</span>
+ <span className="text-muted-foreground">{t(($) => $.detail.queued_chip, { count: queued })}</span>
)}
</span>
)}
@@ -491,17 +497,18 @@ function DiagnosticsCard({
canDelete: boolean;
onDelete: () => void;
}) {
+ const { t } = useT("runtimes");
const isLocal = runtime.runtime_mode === "local";
return (
<div className="rounded-lg border">
<div className="border-b px-4 py-2.5">
- <span className="text-xs font-semibold">Diagnostics</span>
+ <span className="text-xs font-semibold">{t(($) => $.detail.diagnostics_title)}</span>
</div>
<div className="space-y-3 p-4">
{isLocal && (
<div>
<div className="mb-1.5 text-[11px] uppercase tracking-wide text-muted-foreground">
- CLI
+ {t(($) => $.detail.diagnostics_cli)}
</div>
<UpdateSection
runtimeId={runtime.id}
@@ -520,7 +527,7 @@ function DiagnosticsCard({
onClick={onDelete}
>
<Trash2 className="h-3.5 w-3.5" />
- Delete runtime
+ {t(($) => $.detail.delete_button)}
</Button>
</div>
)}
diff --git a/packages/views/runtimes/components/runtime-list.tsx b/packages/views/runtimes/components/runtime-list.tsx
index 084764ea16..37733e6b44 100644
--- a/packages/views/runtimes/components/runtime-list.tsx
+++ b/packages/views/runtimes/components/runtime-list.tsx
@@ -21,6 +21,7 @@ import { paths, useWorkspaceSlug } from "@multica/core/paths";
import { DataTable } from "@multica/ui/components/ui/data-table";
import { useNavigation } from "../../navigation";
import { type RuntimeRow, createRuntimeColumns } from "./runtime-columns";
+import { useT } from "../../i18n";
interface RuntimeWorkload {
agentIds: string[];
@@ -84,6 +85,7 @@ export function RuntimeList({
}) {
void updatableIds;
+ const { t } = useT("runtimes");
const wsId = useWorkspaceId();
const slug = useWorkspaceSlug();
const navigation = useNavigation();
@@ -141,8 +143,9 @@ export function RuntimeList({
latestCliVersion,
wsId,
now,
+ t,
}),
- [showOwner, latestCliVersion, wsId, now],
+ [showOwner, latestCliVersion, wsId, now, t],
);
const table = useReactTable({
diff --git a/packages/views/runtimes/components/runtimes-page.tsx b/packages/views/runtimes/components/runtimes-page.tsx
index 5dcf308b5b..5623d38e66 100644
--- a/packages/views/runtimes/components/runtimes-page.tsx
+++ b/packages/views/runtimes/components/runtimes-page.tsx
@@ -20,6 +20,7 @@ import {
import { PageHeader } from "../../layout/page-header";
import { ConnectRemoteDialog } from "./connect-remote-dialog";
import { RuntimeList } from "./runtime-list";
+import { useT } from "../../i18n";
type RuntimeFilter = "mine" | "all";
type HealthFilter = "all" | "online" | "recently_lost" | "offline" | "about_to_gc";
@@ -32,35 +33,12 @@ const HEALTH_ORDER: HealthFilter[] = [
"about_to_gc",
];
-// Single source of truth for the 4-state chip visuals + tooltip copy.
-// Thresholds come from `deriveRuntimeHealth`: 45s heartbeat window (server
-// sweeper), 5 min "recently lost" cutoff, 6 day "about_to_gc" trigger,
-// 7 day hard GC. Wording leans on what the user should *do*, not the
-// internals of the sweeper — those live in the redesign doc.
-const HEALTH_CHIP: Record<
- Exclude<HealthFilter, "all">,
- { label: string; dot: string; description: string }
-> = {
- online: {
- label: "Online",
- dot: "bg-success",
- description: "Heartbeat received in the last 45s. Ready to dispatch tasks.",
- },
- recently_lost: {
- label: "Recently lost",
- dot: "bg-warning",
- description: "Lost contact under 5 minutes ago — often a brief network blip.",
- },
- offline: {
- label: "Offline",
- dot: "bg-muted-foreground/40",
- description: "No heartbeat for 5+ minutes. Restart the daemon or investigate the host.",
- },
- about_to_gc: {
- label: "About to GC",
- dot: "bg-destructive",
- description: "Offline 6+ days. Auto-deleted at 7 days unless it reconnects.",
- },
+// Dot tokens stay in code — labels/descriptions flow through useT.
+const HEALTH_DOT: Record<Exclude<HealthFilter, "all">, string> = {
+ online: "bg-success",
+ recently_lost: "bg-warning",
+ offline: "bg-muted-foreground/40",
+ about_to_gc: "bg-destructive",
};
interface RuntimesPageProps {
@@ -214,31 +192,32 @@ function PageHeaderBar({
totalCount: number;
onConnectRemote: () => void;
}) {
+ const { t } = useT("runtimes");
return (
<PageHeader className="justify-between px-5">
<div className="flex items-center gap-2">
<Server className="h-4 w-4 text-muted-foreground" />
- <h1 className="text-sm font-medium">Runtimes</h1>
+ <h1 className="text-sm font-medium">{t(($) => $.page.title)}</h1>
{totalCount > 0 && (
<span className="font-mono text-xs tabular-nums text-muted-foreground/70">
{totalCount}
</span>
)}
<p className="ml-2 hidden text-xs text-muted-foreground md:block">
- Machines and cloud workers running CLI sessions for your agents.{" "}
+ {t(($) => $.page.tagline)}{" "}
<a
href="https://multica.ai/docs/runtimes"
target="_blank"
rel="noopener noreferrer"
className="underline decoration-muted-foreground/30 underline-offset-4 transition-colors hover:text-foreground"
>
- Learn more →
+ {t(($) => $.page.learn_more)}
</a>
</p>
</div>
<Button type="button" size="sm" onClick={onConnectRemote}>
<Plus className="h-3 w-3" />
- Connect remote machine
+ {t(($) => $.page.connect_remote)}
</Button>
</PageHeader>
);
@@ -268,6 +247,7 @@ function CardToolbar({
scope: RuntimeFilter;
setScope: (v: RuntimeFilter) => void;
}) {
+ const { t } = useT("runtimes");
return (
<div className="flex h-12 shrink-0 items-center gap-2 border-b px-4">
<div className="relative">
@@ -275,7 +255,7 @@ function CardToolbar({
<Input
value={search}
onChange={(e) => setSearch(e.target.value)}
- placeholder="Search runtimes…"
+ placeholder={t(($) => $.page.search_placeholder)}
className="h-8 w-64 pl-8 text-sm"
/>
</div>
@@ -288,12 +268,12 @@ function CardToolbar({
<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-success/60" />
<span className="relative inline-flex h-1.5 w-1.5 rounded-full bg-success" />
</span>
- Live
+ {t(($) => $.page.live)}
</div>
}
/>
<TooltipContent side="top">
- Real-time updates · offline detection up to 75s
+ {t(($) => $.page.live_tooltip)}
</TooltipContent>
</Tooltip>
</div>
@@ -307,9 +287,7 @@ function ScopeSegment({
value: RuntimeFilter;
onChange: (v: RuntimeFilter) => void;
}) {
- // Mine first — that's the default selection and the more frequent
- // scope (your own runtimes), so it lives in the leading slot. Mirrors
- // the Agents page convention.
+ const { t } = useT("runtimes");
return (
<div className="flex items-center gap-0.5 rounded-md bg-muted p-0.5">
<button
@@ -320,7 +298,7 @@ function ScopeSegment({
: "text-muted-foreground hover:text-foreground"
}`}
>
- Mine
+ {t(($) => $.page.scope_mine)}
</button>
<button
onClick={() => onChange("all")}
@@ -330,7 +308,7 @@ function ScopeSegment({
: "text-muted-foreground hover:text-foreground"
}`}
>
- All
+ {t(($) => $.page.scope_all)}
</button>
</div>
);
@@ -353,21 +331,27 @@ function FilterChipsRow({
healthCounts: Record<Exclude<HealthFilter, "all">, number>;
total: number;
}) {
+ const { t } = useT("runtimes");
return (
<div className="flex shrink-0 items-center gap-2 border-b px-4 py-2.5">
{HEALTH_ORDER.map((key) => {
const count = key === "all" ? total : healthCounts[key];
- const visual = key === "all" ? null : HEALTH_CHIP[key];
+ const label =
+ key === "all"
+ ? t(($) => $.page.filter_all)
+ : t(($) => $.health[key].label);
const description =
- key === "all" ? "All runtimes in this view" : visual!.description;
+ key === "all"
+ ? t(($) => $.page.filter_all_description)
+ : t(($) => $.health[key].description);
return (
<HealthChip
key={key}
active={healthFilter === key}
onClick={() => setHealthFilter(key)}
- label={visual?.label ?? "All"}
+ label={label}
count={count}
- dotClass={visual?.dot}
+ dotClass={key === "all" ? undefined : HEALTH_DOT[key]}
description={description}
/>
);
@@ -430,15 +414,15 @@ function HealthChip({
// ---------------------------------------------------------------------------
function EmptyState({ onConnectRemote }: { onConnectRemote: () => void }) {
+ const { t } = useT("runtimes");
return (
<div className="flex flex-1 flex-col items-center justify-center px-6 py-16 text-center">
<div className="flex h-12 w-12 items-center justify-center rounded-full bg-muted">
<Server className="h-6 w-6 text-muted-foreground" />
</div>
- <h2 className="mt-4 text-base font-semibold">No runtimes yet</h2>
+ <h2 className="mt-4 text-base font-semibold">{t(($) => $.page.empty.title)}</h2>
<p className="mt-1 max-w-md text-sm text-muted-foreground">
- Desktop auto-scans your local machine. For AWS EC2 or other remote
- machines, connect them using the setup wizard.
+ {t(($) => $.page.empty.hint)}
</p>
<Button
type="button"
@@ -447,7 +431,7 @@ function EmptyState({ onConnectRemote }: { onConnectRemote: () => void }) {
className="mt-5"
>
<Plus className="h-3 w-3" />
- Connect remote machine
+ {t(($) => $.page.connect_remote)}
</Button>
</div>
);
@@ -470,13 +454,14 @@ function NoMatchesState({
scope: RuntimeFilter;
bootstrapping?: boolean;
}) {
+ const { t } = useT("runtimes");
if (bootstrapping) {
return (
<div className="flex flex-1 flex-col items-center justify-center gap-2 px-4 py-16 text-center">
<Server className="h-8 w-8 animate-pulse text-muted-foreground/40" />
- <p className="text-sm text-muted-foreground">Starting local runtime…</p>
+ <p className="text-sm text-muted-foreground">{t(($) => $.page.bootstrapping.title)}</p>
<p className="max-w-xs text-xs text-muted-foreground/70">
- This usually takes a few seconds. Your daemon is registering with the workspace.
+ {t(($) => $.page.bootstrapping.hint)}
</p>
</div>
);
@@ -485,16 +470,17 @@ function NoMatchesState({
const hasSearch = search.length > 0;
const hasHealthFilter = healthFilter !== "all";
const hasScope = scope === "mine";
+ const filterSuffix = hasHealthFilter || hasScope ? t(($) => $.page.no_matches.with_query_filter_suffix) : "";
return (
<div className="flex flex-1 flex-col items-center justify-center gap-2 px-4 py-16 text-center text-muted-foreground">
<Search className="h-8 w-8 text-muted-foreground/40" />
- <p className="text-sm">No matches</p>
+ <p className="text-sm">{t(($) => $.page.no_matches.title)}</p>
<p className="max-w-xs text-xs">
{hasSearch
- ? `No runtimes match "${search}"${hasHealthFilter || hasScope ? " in this filter" : ""}.`
- : "No runtimes match this filter."}{" "}
- Try widening the scope or clearing filters.
+ ? t(($) => $.page.no_matches.with_query, { query: search, filterSuffix })
+ : t(($) => $.page.no_matches.no_query)}
+ {t(($) => $.page.no_matches.try_widening)}
</p>
</div>
);
diff --git a/packages/views/runtimes/components/shared.tsx b/packages/views/runtimes/components/shared.tsx
index 9909aae628..a9911f2ad2 100644
--- a/packages/views/runtimes/components/shared.tsx
+++ b/packages/views/runtimes/components/shared.tsx
@@ -2,6 +2,7 @@ import { Cloud, Monitor, Wifi, WifiHigh, WifiOff } from "lucide-react";
import { Badge } from "@multica/ui/components/ui/badge";
import type { RuntimeHealth } from "@multica/core/runtimes";
import { ProviderLogo } from "./provider-logo";
+import { useT } from "../../i18n";
export function RuntimeModeIcon({ mode }: { mode: string }) {
return mode === "cloud" ? (
@@ -26,30 +27,13 @@ export function ProviderChip({ provider }: { provider: string }) {
// The mapping intentionally reuses our existing tokens (success/warning/
// muted-foreground/destructive) instead of introducing runtime-specific
// colours — keeps the palette small and consistent with Skills.
-const HEALTH_VISUAL: Record<
- RuntimeHealth,
- { dot: string; label: string; tone: string }
-> = {
- online: {
- dot: "bg-success",
- label: "Online",
- tone: "bg-success/10 text-success",
- },
- recently_lost: {
- dot: "bg-warning",
- label: "Recently lost",
- tone: "bg-warning/10 text-warning",
- },
- offline: {
- dot: "bg-muted-foreground/40",
- label: "Offline",
- tone: "bg-muted text-muted-foreground",
- },
- about_to_gc: {
- dot: "bg-destructive",
- label: "About to GC",
- tone: "bg-destructive/10 text-destructive",
- },
+// Maps each derived 4-state runtime health to a semantic colour class.
+// Labels flow through useT — see useHealthLabel below.
+const HEALTH_VISUAL: Record<RuntimeHealth, { dot: string; tone: string }> = {
+ online: { dot: "bg-success", tone: "bg-success/10 text-success" },
+ recently_lost: { dot: "bg-warning", tone: "bg-warning/10 text-warning" },
+ offline: { dot: "bg-muted-foreground/40", tone: "bg-muted text-muted-foreground" },
+ about_to_gc: { dot: "bg-destructive", tone: "bg-destructive/10 text-destructive" },
};
export function HealthDot({
@@ -106,9 +90,29 @@ export function HealthIcon({
return <Icon className={`${className} ${tone}`} />;
}
+// English-only fallback. Pure function form for non-component callers
+// (e.g. column factory builders). Translated call sites should use the
+// `useHealthLabel` hook below instead.
+const HEALTH_LABEL_EN: Record<RuntimeHealth, string> = {
+ online: "Online",
+ recently_lost: "Recently lost",
+ offline: "Offline",
+ about_to_gc: "About to GC",
+};
+
export function healthLabel(health: RuntimeHealth | "loading"): string {
if (health === "loading") return "—";
- return HEALTH_VISUAL[health].label;
+ return HEALTH_LABEL_EN[health];
+}
+
+// Hook form: usable inside React components (preferred for new call sites
+// that aren't running in non-component contexts).
+export function useHealthLabel(): (health: RuntimeHealth | "loading") => string {
+ const { t } = useT("runtimes");
+ return (health) => {
+ if (health === "loading") return "—";
+ return t(($) => $.health[health].label);
+ };
}
export function HealthBadge({
@@ -116,6 +120,7 @@ export function HealthBadge({
}: {
health: RuntimeHealth | "loading";
}) {
+ const labelOf = useHealthLabel();
if (health === "loading") {
return (
<Badge variant="secondary" className="bg-muted text-muted-foreground">
@@ -127,7 +132,7 @@ export function HealthBadge({
return (
<Badge variant="secondary" className={v.tone}>
<span className={`h-1.5 w-1.5 rounded-full ${v.dot}`} />
- {v.label}
+ {labelOf(health)}
</Badge>
);
}
diff --git a/packages/views/runtimes/components/update-section.tsx b/packages/views/runtimes/components/update-section.tsx
index c91cb5ddb9..28b54115d2 100644
--- a/packages/views/runtimes/components/update-section.tsx
+++ b/packages/views/runtimes/components/update-section.tsx
@@ -9,6 +9,7 @@ import {
import { Button } from "@multica/ui/components/ui/button";
import { api } from "@multica/core/api";
import type { RuntimeUpdateStatus } from "@multica/core/types";
+import { useT } from "../../i18n";
const GITHUB_RELEASES_URL =
"https://api.github.com/repos/multica-ai/multica/releases/latest";
@@ -53,25 +54,13 @@ function isNewer(latest: string, current: string): boolean {
const statusConfig: Record<
RuntimeUpdateStatus,
- { label: string; icon: typeof Loader2; color: string }
+ { icon: typeof Loader2; color: string }
> = {
- pending: {
- label: "Waiting for daemon...",
- icon: Loader2,
- color: "text-muted-foreground",
- },
- running: {
- label: "Updating...",
- icon: Loader2,
- color: "text-info",
- },
- completed: {
- label: "Update complete. Daemon is restarting...",
- icon: CheckCircle2,
- color: "text-success",
- },
- failed: { label: "Update failed", icon: XCircle, color: "text-destructive" },
- timeout: { label: "Timeout", icon: XCircle, color: "text-warning" },
+ pending: { icon: Loader2, color: "text-muted-foreground" },
+ running: { icon: Loader2, color: "text-info" },
+ completed: { icon: CheckCircle2, color: "text-success" },
+ failed: { icon: XCircle, color: "text-destructive" },
+ timeout: { icon: XCircle, color: "text-warning" },
};
interface UpdateSectionProps {
@@ -93,6 +82,7 @@ export function UpdateSection({
isOnline,
launchedBy,
}: UpdateSectionProps) {
+ const { t } = useT("runtimes");
const isManaged = launchedBy === "desktop";
const [latestVersion, setLatestVersion] = useState<string | null>(null);
const [status, setStatus] = useState<RuntimeUpdateStatus | null>(null);
@@ -162,7 +152,7 @@ export function UpdateSection({
result.status === "failed" ||
result.status === "timeout"
) {
- setError(result.error ?? "Unknown error");
+ setError(result.error ?? t(($) => $.update.unknown_error));
setUpdating(false);
setTargetVersion(null);
cleanup();
@@ -173,7 +163,7 @@ export function UpdateSection({
}, 2000);
} catch {
setStatus("failed");
- setError("Failed to initiate update");
+ setError(t(($) => $.update.initiate_failed));
setUpdating(false);
setTargetVersion(null);
}
@@ -191,24 +181,24 @@ export function UpdateSection({
return (
<div className="space-y-2">
<div className="flex items-center gap-2 flex-wrap">
- <span className="text-xs text-muted-foreground">CLI Version:</span>
+ <span className="text-xs text-muted-foreground">{t(($) => $.update.cli_version_label)}</span>
<span className="text-xs font-mono">
- {currentVersion ?? "unknown"}
+ {currentVersion ?? t(($) => $.update.version_unknown)}
</span>
{isManaged ? (
<span
className="inline-flex items-center gap-1 text-xs text-muted-foreground"
- title="The CLI binary is managed by Multica Desktop — update Desktop to upgrade the CLI."
+ title={t(($) => $.update.managed_by_desktop_title)}
>
- Managed by Desktop
+ {t(($) => $.update.managed_by_desktop)}
</span>
) : (
<>
{!hasUpdate && currentVersion && latestVersion && !status && (
<span className="inline-flex items-center gap-1 text-xs text-success">
<Check className="h-3 w-3" />
- Latest
+ {t(($) => $.update.latest)}
</span>
)}
@@ -218,7 +208,7 @@ export function UpdateSection({
<span className="text-xs font-mono text-info">
{latestVersion}
</span>
- <span className="text-xs text-muted-foreground">available</span>
+ <span className="text-xs text-muted-foreground">{t(($) => $.update.available)}</span>
</>
)}
@@ -230,18 +220,18 @@ export function UpdateSection({
disabled={updating}
>
<ArrowUpCircle className="h-3 w-3" />
- Update
+ {t(($) => $.update.action)}
</Button>
)}
</>
)}
- {config && Icon && (
+ {config && Icon && status && (
<span
className={`inline-flex items-center gap-1 text-xs ${config.color}`}
>
<Icon className={`h-3 w-3 ${isActive ? "animate-spin" : ""}`} />
- {config.label}
+ {t(($) => $.update.status[status])}
</span>
)}
</div>
@@ -262,7 +252,7 @@ export function UpdateSection({
className="mt-1"
onClick={handleUpdate}
>
- Retry
+ {t(($) => $.update.retry)}
</Button>
)}
</div>
diff --git a/packages/views/runtimes/components/usage-section.tsx b/packages/views/runtimes/components/usage-section.tsx
index 8ae968e0ae..407afa7e0f 100644
--- a/packages/views/runtimes/components/usage-section.tsx
+++ b/packages/views/runtimes/components/usage-section.tsx
@@ -30,8 +30,8 @@ import {
DailyCostChart,
HourlyActivityChart,
ActivityHeatmap,
- costStackConfig,
} from "./charts";
+import { useT } from "../../i18n";
// Single source of truth for the period selector. KPIs, the When-chart, the
// Cost-by tabs, and the CSV export all read from the same `days` value so
@@ -103,6 +103,7 @@ function fmtMoney(n: number): string {
// ---------------------------------------------------------------------------
export function UsageSection({ runtimeId }: { runtimeId: string }) {
+ const { t } = useT("runtimes");
const { data: usage = [], isLoading: loading } = useQuery(
runtimeUsageOptions(runtimeId, 180),
);
@@ -136,7 +137,7 @@ export function UsageSection({ runtimeId }: { runtimeId: string }) {
its tab disables this control to telegraph that. */}
<div className="flex items-center justify-between gap-3">
<span className="text-xs uppercase tracking-wider text-muted-foreground">
- Period
+ {t(($) => $.usage.period_label)}
</span>
<Segmented
value={days}
@@ -148,11 +149,9 @@ export function UsageSection({ runtimeId }: { runtimeId: string }) {
/>
</div>
- {/* Layer 1 — KPI hero. One outer card, three columns separated by a
- divider; the big numbers carry the visual weight of the page. */}
<div className="grid grid-cols-3 divide-x rounded-lg border bg-card">
<KpiCard
- label={`Cost · ${days}D`}
+ label={t(($) => $.usage.kpi_cost_label, { days })}
value={fmtMoney(totals.cost)}
hint={
costDelta == null ? undefined : (
@@ -165,28 +164,36 @@ export function UsageSection({ runtimeId }: { runtimeId: string }) {
: ""
}
>
- {costDelta > 0 ? "+" : ""}
- {costDelta}% vs prev
+ {t(($) => $.usage.kpi_cost_delta, {
+ sign: costDelta > 0 ? "+" : "",
+ pct: costDelta,
+ })}
</span>
)
}
/>
<KpiCard
- label={`Cache savings · ${days}D`}
+ label={t(($) => $.usage.kpi_cache_label, { days })}
value={fmtMoney(totals.cacheSavings)}
accent={totals.cacheSavings > 0 ? "success" : "default"}
hint={
<span>
- {cacheHitRate}% hit · {formatTokens(totals.cacheRead)} reads
+ {t(($) => $.usage.kpi_cache_hint, {
+ pct: cacheHitRate,
+ reads: formatTokens(totals.cacheRead),
+ })}
</span>
}
/>
<KpiCard
- label={`Tokens · ${days}D`}
+ label={t(($) => $.usage.kpi_tokens_label, { days })}
value={formatTokens(tokensTotal)}
hint={
<span>
- in {formatTokens(totals.input)} · out {formatTokens(totals.output)}
+ {t(($) => $.usage.kpi_tokens_hint, {
+ input: formatTokens(totals.input),
+ output: formatTokens(totals.output),
+ })}
</span>
}
/>
@@ -235,6 +242,7 @@ function WhenChart({
filtered: RuntimeUsage[];
days: TimeRange;
}) {
+ const { t } = useT("runtimes");
const [tab, setTab] = useState<WhenTab>("daily");
// Lazy-fetch hourly cost — only needed when its tab is active. Daily and
@@ -258,15 +266,15 @@ function WhenChart({
<div className="rounded-lg border bg-card p-4">
<div className="mb-3 flex flex-wrap items-center justify-between gap-3">
<div className="flex items-center gap-3">
- <h4 className="text-sm font-semibold">When this runtime spent</h4>
+ <h4 className="text-sm font-semibold">{t(($) => $.usage.when_title)}</h4>
<Segmented
value={tab}
onChange={setTab}
options={
[
- { label: "Daily", value: "daily" },
- { label: "Hourly", value: "hourly" },
- { label: "Heatmap", value: "heatmap" },
+ { label: t(($) => $.usage.when_tab_daily), value: "daily" },
+ { label: t(($) => $.usage.when_tab_hourly), value: "hourly" },
+ { label: t(($) => $.usage.when_tab_heatmap), value: "heatmap" },
] as const
}
/>
@@ -279,7 +287,7 @@ function WhenChart({
squares; the long view is the whole point). */}
{tab === "heatmap" && (
<p className="mb-2 text-center text-xs text-muted-foreground">
- Last 26 weeks · daily $ intensity (period selector ignored here)
+ {t(($) => $.usage.heatmap_caption)}
</p>
)}
@@ -329,6 +337,7 @@ function HourlyTab({
// ---------------------------------------------------------------------------
function EmptyChartState({ usage }: { usage: RuntimeUsage[] }) {
+ const { t } = useT("runtimes");
const hasTokens = usage.some(
(u) =>
u.input_tokens + u.output_tokens + u.cache_read_tokens + u.cache_write_tokens >
@@ -341,23 +350,23 @@ function EmptyChartState({ usage }: { usage: RuntimeUsage[] }) {
<BarChart3 className="h-5 w-5 text-muted-foreground/50" />
{!hasTokens ? (
<p className="text-xs text-muted-foreground">
- No usage in this period.
+ {t(($) => $.usage.empty_no_usage)}
</p>
) : unmapped.length > 0 ? (
<>
<p className="text-xs text-muted-foreground">
- Tokens recorded but pricing missing for:
+ {t(($) => $.usage.empty_pricing_missing)}
</p>
<p className="font-mono text-[11px] text-foreground">
{unmapped.join(", ")}
</p>
<p className="text-[11px] text-muted-foreground/70">
- Add to MODEL_PRICING in packages/views/runtimes/utils.ts
+ {t(($) => $.usage.empty_pricing_hint)}
</p>
</>
) : (
<p className="text-xs text-muted-foreground">
- Tokens recorded but cost calculation returned $0.
+ {t(($) => $.usage.empty_zero_cost)}
</p>
)}
</div>
@@ -370,10 +379,11 @@ function EmptyChartState({ usage }: { usage: RuntimeUsage[] }) {
// ---------------------------------------------------------------------------
function ChartLegend() {
+ const { t } = useT("runtimes");
const items = [
- { label: costStackConfig.input.label, color: "var(--color-chart-1)" },
- { label: costStackConfig.output.label, color: "var(--color-chart-2)" },
- { label: costStackConfig.cacheWrite.label, color: "var(--color-chart-3)" },
+ { label: t(($) => $.usage.legend_input), color: "var(--color-chart-1)" },
+ { label: t(($) => $.usage.legend_output), color: "var(--color-chart-2)" },
+ { label: t(($) => $.usage.legend_cache_write), color: "var(--color-chart-3)" },
];
return (
<div className="flex items-center gap-3 text-xs text-muted-foreground">
@@ -405,6 +415,7 @@ function CostByBlock({
days: number;
usage: RuntimeUsage[];
}) {
+ const { t } = useT("runtimes");
const [tab, setTab] = useState<"agent" | "model">("agent");
// by-agent is server-side aggregation (fetched lazily on tab activation).
@@ -422,21 +433,25 @@ function CostByBlock({
const caption =
tab === "agent"
- ? `${byAgent.length} agent${byAgent.length === 1 ? "" : "s"} on this runtime`
- : `${byModel.length} model${byModel.length === 1 ? "" : "s"} used`;
+ ? t(($) => $.usage.cost_by_caption_agent, { count: byAgent.length })
+ : t(($) => $.usage.cost_by_caption_model, { count: byModel.length });
return (
<div>
<div className="flex flex-wrap items-center justify-between gap-3 border-b pb-3">
<div className="flex items-center gap-3">
- <h4 className="text-sm font-semibold">Cost by {tab}</h4>
+ <h4 className="text-sm font-semibold">
+ {tab === "agent"
+ ? t(($) => $.usage.cost_by_title_agent)
+ : t(($) => $.usage.cost_by_title_model)}
+ </h4>
<Segmented
value={tab}
onChange={setTab}
options={
[
- { label: "By agent", value: "agent" },
- { label: "By model", value: "model" },
+ { label: t(($) => $.usage.cost_by_tab_agent), value: "agent" },
+ { label: t(($) => $.usage.cost_by_tab_model), value: "model" },
] as const
}
/>
@@ -481,16 +496,17 @@ function CostByBlock({
function CostByList({
rows,
renderKey,
- emptyHint = "No usage in this period.",
+ emptyHint,
}: {
rows: CostByKey[];
renderKey: (key: string) => React.ReactNode;
emptyHint?: string;
}) {
+ const { t } = useT("runtimes");
if (rows.length === 0) {
return (
<p className="py-4 text-center text-xs text-muted-foreground">
- {emptyHint}
+ {emptyHint ?? t(($) => $.usage.empty_no_usage)}
</p>
);
}
@@ -531,6 +547,7 @@ function CostByList({
// ---------------------------------------------------------------------------
function FoldedRow({ usage }: { usage: RuntimeUsage[] }) {
+ const { t } = useT("runtimes");
const [open, setOpen] = useState(false);
return (
<div className="border-t pt-3">
@@ -542,7 +559,7 @@ function FoldedRow({ usage }: { usage: RuntimeUsage[] }) {
<ChevronRight
className={`h-3 w-3 transition-transform ${open ? "rotate-90" : ""}`}
/>
- Daily breakdown table
+ {t(($) => $.usage.daily_breakdown_toggle)}
</button>
{open && (
<div className="mt-3 rounded-md border p-4">
@@ -554,6 +571,7 @@ function FoldedRow({ usage }: { usage: RuntimeUsage[] }) {
}
function DailyBreakdownTable({ usage }: { usage: RuntimeUsage[] }) {
+ const { t } = useT("runtimes");
const byDate = new Map<string, RuntimeUsage[]>();
for (const u of usage) {
const existing = byDate.get(u.date) ?? [];
@@ -563,12 +581,12 @@ function DailyBreakdownTable({ usage }: { usage: RuntimeUsage[] }) {
return (
<div className="rounded-lg border">
<div className="grid grid-cols-[100px_1fr_80px_80px_80px_80px] gap-2 border-b px-3 py-2 text-xs font-medium text-muted-foreground">
- <div>Date</div>
- <div>Model</div>
- <div className="text-right">Input</div>
- <div className="text-right">Output</div>
- <div className="text-right">Cache R</div>
- <div className="text-right">Cache W</div>
+ <div>{t(($) => $.usage.table_date)}</div>
+ <div>{t(($) => $.usage.table_model)}</div>
+ <div className="text-right">{t(($) => $.usage.table_input)}</div>
+ <div className="text-right">{t(($) => $.usage.table_output)}</div>
+ <div className="text-right">{t(($) => $.usage.table_cache_r)}</div>
+ <div className="text-right">{t(($) => $.usage.table_cache_w)}</div>
</div>
<div className="max-h-64 overflow-y-auto divide-y">
{[...byDate.entries()].map(([date, rows]) =>
@@ -614,10 +632,13 @@ function UsageSkeleton() {
}
function UsageEmpty() {
+ const { t } = useT("runtimes");
return (
<div className="flex flex-col items-center rounded-lg border border-dashed py-8">
<BarChart3 className="h-5 w-5 text-muted-foreground/40" />
- <p className="mt-2 text-xs text-muted-foreground">No usage data yet</p>
+ <p className="mt-2 text-xs text-muted-foreground">
+ {t(($) => $.usage.no_data)}
+ </p>
</div>
);
}
diff --git a/packages/views/search/search-command.test.tsx b/packages/views/search/search-command.test.tsx
index 88fc92fd54..293a3c73e1 100644
--- a/packages/views/search/search-command.test.tsx
+++ b/packages/views/search/search-command.test.tsx
@@ -1,9 +1,28 @@
-import { act } from "react";
+import { act, type ReactNode } from "react";
import { render, screen, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { beforeEach, describe, expect, it, vi } from "vitest";
+import { I18nProvider } from "@multica/core/i18n/react";
import { SearchCommand } from "./search-command";
import { useSearchStore } from "./search-store";
+import enCommon from "../locales/en/common.json";
+import enAuth from "../locales/en/auth.json";
+import enSettings from "../locales/en/settings.json";
+import enSearch from "../locales/en/search.json";
+
+const TEST_RESOURCES = {
+ en: { common: enCommon, auth: enAuth, settings: enSettings, search: enSearch },
+};
+
+function I18nWrapper({ children }: { children: ReactNode }) {
+ return (
+ <I18nProvider locale="en" resources={TEST_RESOURCES}>
+ {children}
+ </I18nProvider>
+ );
+}
+
+const renderSearch = () => render(<SearchCommand />, { wrapper: I18nWrapper });
const {
mockPush,
@@ -160,7 +179,7 @@ describe("SearchCommand", () => {
it("closes on a single Escape press from the search input", async () => {
const user = userEvent.setup();
- render(<SearchCommand />);
+ renderSearch();
const input = screen.getByPlaceholderText("Type a command or search...");
await user.click(input);
@@ -176,7 +195,7 @@ describe("SearchCommand", () => {
});
it("shows only New Issue by default and hides Pages / Switch Workspace / low-frequency commands until query", () => {
- render(<SearchCommand />);
+ renderSearch();
expect(screen.queryByText("Pages")).not.toBeInTheDocument();
expect(screen.queryByText("Switch Workspace")).not.toBeInTheDocument();
@@ -194,7 +213,7 @@ describe("SearchCommand", () => {
it("filters navigation pages by query", async () => {
const user = userEvent.setup();
- render(<SearchCommand />);
+ renderSearch();
const input = screen.getByPlaceholderText("Type a command or search...");
await user.type(input, "set");
@@ -208,7 +227,7 @@ describe("SearchCommand", () => {
it("navigates to page on selection", async () => {
const user = userEvent.setup();
- render(<SearchCommand />);
+ renderSearch();
const input = screen.getByPlaceholderText("Type a command or search...");
await user.type(input, "settings");
@@ -230,7 +249,7 @@ describe("SearchCommand", () => {
{ id: "issue-2", identifier: "MUL-2", title: "Second issue", status: "done" },
];
- render(<SearchCommand />);
+ renderSearch();
expect(screen.getByText("Recent")).toBeInTheDocument();
expect(screen.getByText("First issue")).toBeInTheDocument();
@@ -241,7 +260,7 @@ describe("SearchCommand", () => {
it("shows New Issue / New Project under Commands and triggers the modal store", async () => {
const user = userEvent.setup();
- render(<SearchCommand />);
+ renderSearch();
const input = screen.getByPlaceholderText("Type a command or search...");
await user.type(input, "new");
@@ -268,7 +287,7 @@ describe("SearchCommand", () => {
it("hides copy-link commands when not on an issue detail route", async () => {
const user = userEvent.setup();
mockPathname.current = "/ws-test/projects";
- render(<SearchCommand />);
+ renderSearch();
const input = screen.getByPlaceholderText("Type a command or search...");
await user.type(input, "copy");
@@ -288,7 +307,7 @@ describe("SearchCommand", () => {
mockAllIssues.current = [
{ id: "issue-1", identifier: "MUL-42", title: "Demo", status: "todo" },
];
- render(<SearchCommand />);
+ renderSearch();
const input = screen.getByPlaceholderText("Type a command or search...");
await user.type(input, "copy");
@@ -321,7 +340,7 @@ describe("SearchCommand", () => {
it("filters theme commands by query keywords", async () => {
const user = userEvent.setup();
- render(<SearchCommand />);
+ renderSearch();
const input = screen.getByPlaceholderText("Type a command or search...");
await user.type(input, "dark");
@@ -339,7 +358,7 @@ describe("SearchCommand", () => {
it("applies the selected theme and closes the palette", async () => {
const user = userEvent.setup();
mockTheme.current = "light";
- render(<SearchCommand />);
+ renderSearch();
const input = screen.getByPlaceholderText("Type a command or search...");
await user.type(input, "dark");
@@ -356,7 +375,7 @@ describe("SearchCommand", () => {
it("matches theme action via generic 'theme' keyword and marks current theme", async () => {
const user = userEvent.setup();
mockTheme.current = "dark";
- render(<SearchCommand />);
+ renderSearch();
const input = screen.getByPlaceholderText("Type a command or search...");
await user.type(input, "theme");
@@ -383,7 +402,7 @@ describe("SearchCommand", () => {
{ id: "ws-alpha", name: "Alpha Co", slug: "alpha" },
{ id: "ws-beta", name: "Beta Co", slug: "beta" },
];
- render(<SearchCommand />);
+ renderSearch();
const input = screen.getByPlaceholderText("Type a command or search...");
await user.type(input, "alpha");
@@ -414,7 +433,7 @@ describe("SearchCommand", () => {
{ id: "ws-alpha", name: "Alpha Co", slug: "alpha" },
{ id: "ws-beta", name: "Beta Co", slug: "beta" },
];
- render(<SearchCommand />);
+ renderSearch();
const input = screen.getByPlaceholderText("Type a command or search...");
await user.type(input, "workspace");
@@ -440,7 +459,7 @@ describe("SearchCommand", () => {
{ id: "issue-1", identifier: "MUL-1", title: "Existing issue", status: "in_progress" },
];
- render(<SearchCommand />);
+ renderSearch();
expect(screen.getByText("Recent")).toBeInTheDocument();
expect(screen.getByText("Existing issue")).toBeInTheDocument();
diff --git a/packages/views/search/search-command.tsx b/packages/views/search/search-command.tsx
index 23129bdff5..815d5e91cb 100644
--- a/packages/views/search/search-command.tsx
+++ b/packages/views/search/search-command.tsx
@@ -49,6 +49,7 @@ import {
} from "@multica/ui/components/ui/dialog";
import { useTheme } from "@multica/ui/components/common/theme-provider";
import { useNavigation } from "../navigation";
+import { useT } from "../i18n";
import { useSearchStore } from "./search-store";
function HighlightText({ text, query }: { text: string; query: string }) {
@@ -107,17 +108,6 @@ interface NavPage {
keywords: string[];
}
-const navPages: NavPage[] = [
- { key: "inbox", label: "Inbox", icon: Inbox, keywords: ["inbox", "notifications"] },
- { key: "myIssues", label: "My Issues", icon: CircleUser, keywords: ["my", "issues", "assigned"] },
- { key: "issues", label: "Issues", icon: ListTodo, keywords: ["issues", "tasks", "bugs"] },
- { key: "projects", label: "Projects", icon: FolderKanban, keywords: ["projects", "kanban"] },
- { key: "agents", label: "Agents", icon: Bot, keywords: ["agents", "bots", "ai"] },
- { key: "runtimes", label: "Runtimes", icon: Monitor, keywords: ["runtimes", "environments"] },
- { key: "skills", label: "Skills", icon: BookOpenText, keywords: ["skills", "library"] },
- { key: "settings", label: "Settings", icon: Settings, keywords: ["settings", "config", "preferences"] },
-];
-
type ThemeValue = "light" | "dark" | "system";
interface CommandItem {
@@ -135,6 +125,17 @@ interface SearchResults {
}
export function SearchCommand() {
+ const { t } = useT("search");
+ const navPages: NavPage[] = [
+ { key: "inbox", label: t(($) => $.pages.inbox), icon: Inbox, keywords: ["inbox", "notifications", "收件箱"] },
+ { key: "myIssues", label: t(($) => $.pages.my_issues), icon: CircleUser, keywords: ["my", "issues", "assigned", "我的"] },
+ { key: "issues", label: t(($) => $.pages.issues), icon: ListTodo, keywords: ["issues", "tasks", "bugs"] },
+ { key: "projects", label: t(($) => $.pages.projects), icon: FolderKanban, keywords: ["projects", "kanban", "项目"] },
+ { key: "agents", label: t(($) => $.pages.agents), icon: Bot, keywords: ["agents", "bots", "ai"] },
+ { key: "runtimes", label: t(($) => $.pages.runtimes), icon: Monitor, keywords: ["runtimes", "environments"] },
+ { key: "skills", label: t(($) => $.pages.skills), icon: BookOpenText, keywords: ["skills", "library"] },
+ { key: "settings", label: t(($) => $.pages.settings), icon: Settings, keywords: ["settings", "config", "preferences", "设置"] },
+ ];
const { push, pathname, getShareableUrl } = useNavigation();
const open = useSearchStore((s) => s.open);
const setOpen = useSearchStore((s) => s.setOpen);
@@ -190,7 +191,7 @@ export function SearchCommand() {
const activeThemeCheck = (value: ThemeValue) =>
theme === value ? (
<Check
- aria-label="Current theme"
+ aria-label={t(($) => $.commands.current_theme_aria)}
className="ml-auto size-4 shrink-0 text-muted-foreground"
/>
) : undefined;
@@ -198,7 +199,7 @@ export function SearchCommand() {
const items: CommandItem[] = [
{
key: "new-issue",
- label: "New Issue",
+ label: t(($) => $.commands.new_issue),
icon: Plus,
keywords: ["new", "issue", "create", "add"],
onSelect: () => {
@@ -208,7 +209,7 @@ export function SearchCommand() {
},
{
key: "new-project",
- label: "New Project",
+ label: t(($) => $.commands.new_project),
icon: Plus,
keywords: ["new", "project", "create", "add"],
onSelect: () => {
@@ -223,24 +224,24 @@ export function SearchCommand() {
items.push(
{
key: "copy-issue-link",
- label: "Copy Issue Link",
+ label: t(($) => $.commands.copy_issue_link),
icon: Link2,
keywords: ["copy", "link", "share", "url", identifier.toLowerCase()],
onSelect: () => {
const url = getShareableUrl ? getShareableUrl(pathname) : window.location.href;
void navigator.clipboard.writeText(url);
- toast.success("Link copied");
+ toast.success(t(($) => $.toast.link_copied));
setOpen(false);
},
},
{
key: "copy-issue-identifier",
- label: `Copy Identifier (${identifier})`,
+ label: t(($) => $.commands.copy_identifier, { identifier }),
icon: Copy,
keywords: ["copy", "id", "identifier", identifier.toLowerCase()],
onSelect: () => {
void navigator.clipboard.writeText(identifier);
- toast.success(`Copied ${identifier}`);
+ toast.success(t(($) => $.toast.copied_identifier, { identifier }));
setOpen(false);
},
},
@@ -250,7 +251,7 @@ export function SearchCommand() {
items.push(
{
key: "theme-light",
- label: "Switch to Light Theme",
+ label: t(($) => $.commands.switch_to_light),
icon: Sun,
keywords: ["light", "theme", "appearance", "mode", "bright"],
trailing: activeThemeCheck("light"),
@@ -261,7 +262,7 @@ export function SearchCommand() {
},
{
key: "theme-dark",
- label: "Switch to Dark Theme",
+ label: t(($) => $.commands.switch_to_dark),
icon: Moon,
keywords: ["dark", "theme", "appearance", "mode", "night"],
trailing: activeThemeCheck("dark"),
@@ -272,7 +273,7 @@ export function SearchCommand() {
},
{
key: "theme-system",
- label: "Use System Theme",
+ label: t(($) => $.commands.use_system_theme),
icon: Monitor,
keywords: ["system", "theme", "appearance", "mode", "auto"],
trailing: activeThemeCheck("system"),
@@ -284,7 +285,7 @@ export function SearchCommand() {
);
return items;
- }, [currentIssue, getShareableUrl, pathname, setOpen, setTheme, theme]);
+ }, [currentIssue, getShareableUrl, pathname, setOpen, setTheme, theme, t]);
const filteredCommands = useMemo(() => {
const q = query.trim().toLowerCase();
@@ -449,9 +450,9 @@ export function SearchCommand() {
showCloseButton={false}
>
<DialogHeader className="sr-only">
- <DialogTitle>Search</DialogTitle>
+ <DialogTitle>{t(($) => $.title)}</DialogTitle>
<DialogDescription>
- Search pages, issues, and projects
+ {t(($) => $.description)}
</DialogDescription>
</DialogHeader>
<CommandPrimitive
@@ -462,7 +463,7 @@ export function SearchCommand() {
<div className="flex items-center gap-3 border-b px-4 py-3">
<SearchIcon className="size-5 shrink-0 text-muted-foreground" />
<CommandPrimitive.Input
- placeholder="Type a command or search..."
+ placeholder={t(($) => $.placeholder)}
value={query}
onValueChange={handleValueChange}
className="flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"
@@ -478,7 +479,7 @@ export function SearchCommand() {
{filteredPages.length > 0 && (
<CommandPrimitive.Group className="p-2">
<div className="px-3 py-1.5 text-xs font-medium text-muted-foreground">
- Pages
+ {t(($) => $.groups.pages)}
</div>
{filteredPages.map((page) => (
<CommandPrimitive.Item
@@ -500,7 +501,7 @@ export function SearchCommand() {
{filteredCommands.length > 0 && (
<CommandPrimitive.Group className="p-2">
<div className="px-3 py-1.5 text-xs font-medium text-muted-foreground">
- Commands
+ {t(($) => $.groups.commands)}
</div>
{filteredCommands.map((cmd) => (
<CommandPrimitive.Item
@@ -523,7 +524,7 @@ export function SearchCommand() {
{filteredWorkspaces.length > 0 && (
<CommandPrimitive.Group className="p-2">
<div className="px-3 py-1.5 text-xs font-medium text-muted-foreground">
- Switch Workspace
+ {t(($) => $.groups.switch_workspace)}
</div>
{filteredWorkspaces.map((ws) => (
<CommandPrimitive.Item
@@ -557,13 +558,13 @@ export function SearchCommand() {
filteredCommands.length === 0 &&
filteredWorkspaces.length === 0 && (
<CommandPrimitive.Empty className="py-10 text-center text-sm text-muted-foreground">
- No results found.
+ {t(($) => $.empty.no_results)}
</CommandPrimitive.Empty>
)}
{!isLoading && results.projects.length > 0 && (
<CommandPrimitive.Group
- heading="Projects"
+ heading={t(($) => $.groups.projects)}
className="p-2 [&_[cmdk-group-heading]]:px-3 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground"
>
{results.projects.map((project) => (
@@ -602,7 +603,7 @@ export function SearchCommand() {
{!isLoading && results.issues.length > 0 && (
<CommandPrimitive.Group
- heading="Issues"
+ heading={t(($) => $.groups.issues)}
className="p-2 [&_[cmdk-group-heading]]:px-3 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground"
>
{results.issues.map((issue) => (
@@ -650,7 +651,7 @@ export function SearchCommand() {
<CommandPrimitive.Group className="p-2">
<div className="flex items-center gap-2 px-3 py-1.5 text-xs font-medium text-muted-foreground">
<Clock className="size-3" />
- <span>Recent</span>
+ <span>{t(($) => $.groups.recent)}</span>
</div>
{recentIssues.map((item) => (
<CommandPrimitive.Item
@@ -679,7 +680,7 @@ export function SearchCommand() {
{!isLoading && !query.trim() && recentIssues.length === 0 && (
<div className="px-5 py-4 text-center text-xs text-muted-foreground">
- Type to search issues and projects
+ {t(($) => $.empty.type_to_search)}
</div>
)}
</CommandPrimitive.List>
diff --git a/packages/views/search/search-trigger.tsx b/packages/views/search/search-trigger.tsx
index 4371f09909..08c42f1ea0 100644
--- a/packages/views/search/search-trigger.tsx
+++ b/packages/views/search/search-trigger.tsx
@@ -4,15 +4,17 @@ import { Search } from "lucide-react";
import { SidebarMenuButton } from "@multica/ui/components/ui/sidebar";
import { isMac, formatShortcut, modKey } from "@multica/core/platform";
import { useSearchStore } from "./search-store";
+import { useT } from "../i18n";
export function SearchTrigger() {
+ const { t } = useT("search");
return (
<SidebarMenuButton
className="text-muted-foreground"
onClick={() => useSearchStore.getState().setOpen(true)}
>
<Search />
- <span>Search...</span>
+ <span>{t(($) => $.trigger.label)}</span>
<kbd className="pointer-events-none ml-auto inline-flex h-5 select-none items-center gap-0.5 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground">
{isMac ? (
<>
diff --git a/packages/views/settings/components/account-tab.tsx b/packages/views/settings/components/account-tab.tsx
index 2061389b0c..3eac8bfc17 100644
--- a/packages/views/settings/components/account-tab.tsx
+++ b/packages/views/settings/components/account-tab.tsx
@@ -10,8 +10,10 @@ import { toast } from "sonner";
import { useAuthStore } from "@multica/core/auth";
import { api } from "@multica/core/api";
import { useFileUpload } from "@multica/core/hooks/use-file-upload";
+import { useT } from "../../i18n";
export function AccountTab() {
+ const { t } = useT("settings");
const user = useAuthStore((s) => s.user);
const setUser = useAuthStore((s) => s.setUser);
@@ -41,9 +43,9 @@ export function AccountTab() {
if (!result) return;
const updated = await api.updateMe({ avatar_url: result.link });
setUser(updated);
- toast.success("Avatar updated");
+ toast.success(t(($) => $.account.toast_avatar_updated));
} catch (err) {
- toast.error(err instanceof Error ? err.message : "Failed to upload avatar");
+ toast.error(err instanceof Error ? err.message : t(($) => $.account.toast_avatar_failed));
}
};
@@ -52,9 +54,9 @@ export function AccountTab() {
try {
const updated = await api.updateMe({ name: profileName });
setUser(updated);
- toast.success("Profile updated");
+ toast.success(t(($) => $.account.toast_profile_updated));
} catch (e) {
- toast.error(e instanceof Error ? e.message : "Failed to update profile");
+ toast.error(e instanceof Error ? e.message : t(($) => $.account.toast_profile_failed));
} finally {
setProfileSaving(false);
}
@@ -63,7 +65,7 @@ export function AccountTab() {
return (
<div className="space-y-8">
<section className="space-y-4">
- <h2 className="text-sm font-semibold">Profile</h2>
+ <h2 className="text-sm font-semibold">{t(($) => $.account.section_profile)}</h2>
<Card>
<CardContent className="space-y-4">
@@ -102,12 +104,12 @@ export function AccountTab() {
onChange={handleAvatarUpload}
/>
<div className="text-xs text-muted-foreground">
- Click to upload avatar
+ {t(($) => $.account.click_avatar_hint)}
</div>
</div>
<div>
- <Label className="text-xs text-muted-foreground">Name</Label>
+ <Label className="text-xs text-muted-foreground">{t(($) => $.account.name_label)}</Label>
<Input
type="search"
value={profileName}
@@ -122,7 +124,7 @@ export function AccountTab() {
disabled={profileSaving || !profileName.trim()}
>
<Save className="h-3 w-3" />
- {profileSaving ? "Updating..." : "Update Profile"}
+ {profileSaving ? t(($) => $.account.saving) : t(($) => $.account.save)}
</Button>
</div>
</CardContent>
diff --git a/packages/views/settings/components/appearance-tab.test.tsx b/packages/views/settings/components/appearance-tab.test.tsx
new file mode 100644
index 0000000000..e67096d484
--- /dev/null
+++ b/packages/views/settings/components/appearance-tab.test.tsx
@@ -0,0 +1,146 @@
+import type { ReactNode } from "react";
+import { describe, it, expect, beforeEach, afterEach, vi } from "vitest";
+import { render, screen, act } from "@testing-library/react";
+import userEvent from "@testing-library/user-event";
+import { I18nProvider } from "@multica/core/i18n/react";
+import enCommon from "../../locales/en/common.json";
+import enAuth from "../../locales/en/auth.json";
+import enSettings from "../../locales/en/settings.json";
+
+const mockPersist = vi.hoisted(() => vi.fn());
+const mockUpdateMe = vi.hoisted(() => vi.fn());
+const mockReload = vi.hoisted(() => vi.fn());
+const mockToastWarning = vi.hoisted(() => vi.fn());
+const userRef = vi.hoisted(() => ({
+ current: null as { id: string } | null,
+}));
+
+vi.mock("@multica/ui/components/common/theme-provider", () => ({
+ useTheme: () => ({ theme: "light", setTheme: vi.fn() }),
+}));
+
+vi.mock("@multica/core/i18n/react", async () => {
+ const actual =
+ await vi.importActual<typeof import("@multica/core/i18n/react")>(
+ "@multica/core/i18n/react",
+ );
+ return {
+ ...actual,
+ useLocaleAdapter: () => ({
+ persist: mockPersist,
+ getUserChoice: () => null,
+ getSystemPreferences: () => [],
+ }),
+ };
+});
+
+vi.mock("@multica/core/api", () => ({
+ api: { updateMe: mockUpdateMe },
+}));
+
+vi.mock("sonner", () => ({
+ toast: { warning: mockToastWarning },
+}));
+
+vi.mock("@multica/core/auth", async () => {
+ const actual =
+ await vi.importActual<typeof import("@multica/core/auth")>(
+ "@multica/core/auth",
+ );
+ const useAuthStore = Object.assign(
+ (sel?: (s: { user: typeof userRef.current }) => unknown) =>
+ sel ? sel({ user: userRef.current }) : { user: userRef.current },
+ { getState: () => ({ user: userRef.current }) },
+ );
+ return { ...actual, useAuthStore };
+});
+
+import { AppearanceTab } from "./appearance-tab";
+
+const TEST_RESOURCES = {
+ en: { common: enCommon, auth: enAuth, settings: enSettings },
+};
+
+function I18nWrapper({ children }: { children: ReactNode }) {
+ return (
+ <I18nProvider locale="en" resources={TEST_RESOURCES}>
+ {children}
+ </I18nProvider>
+ );
+}
+
+describe("AppearanceTab — Language switcher", () => {
+ beforeEach(() => {
+ vi.clearAllMocks();
+ userRef.current = null;
+ vi.useFakeTimers({ shouldAdvanceTime: true });
+ Object.defineProperty(window, "location", {
+ writable: true,
+ configurable: true,
+ value: { reload: mockReload },
+ });
+ });
+
+ afterEach(() => {
+ vi.useRealTimers();
+ });
+
+ it("does nothing when clicking the current locale", async () => {
+ const user = userEvent.setup({ advanceTimers: vi.advanceTimersByTime });
+ render(<AppearanceTab />, { wrapper: I18nWrapper });
+
+ await user.click(screen.getByRole("radio", { name: "English" }));
+
+ expect(mockPersist).not.toHaveBeenCalled();
+ expect(mockUpdateMe).not.toHaveBeenCalled();
+ expect(mockReload).not.toHaveBeenCalled();
+ });
+
+ it("when not logged in: persists + reloads, no PATCH", async () => {
+ const user = userEvent.setup({ advanceTimers: vi.advanceTimersByTime });
+ render(<AppearanceTab />, { wrapper: I18nWrapper });
+
+ await user.click(screen.getByRole("radio", { name: "中文" }));
+
+ expect(mockPersist).toHaveBeenCalledWith("zh-Hans");
+ expect(mockUpdateMe).not.toHaveBeenCalled();
+ expect(mockReload).toHaveBeenCalledTimes(1);
+ expect(mockToastWarning).not.toHaveBeenCalled();
+ });
+
+ it("when logged in + PATCH success: persists + PATCH + reload immediately", async () => {
+ userRef.current = { id: "user-1" };
+ mockUpdateMe.mockResolvedValueOnce({});
+ const user = userEvent.setup({ advanceTimers: vi.advanceTimersByTime });
+ render(<AppearanceTab />, { wrapper: I18nWrapper });
+
+ await user.click(screen.getByRole("radio", { name: "中文" }));
+
+ expect(mockPersist).toHaveBeenCalledWith("zh-Hans");
+ expect(mockUpdateMe).toHaveBeenCalledWith({ language: "zh-Hans" });
+ expect(mockToastWarning).not.toHaveBeenCalled();
+ expect(mockReload).toHaveBeenCalledTimes(1);
+ });
+
+ it("when logged in + PATCH fails: shows toast and delays reload by 2.5s", async () => {
+ userRef.current = { id: "user-1" };
+ mockUpdateMe.mockRejectedValueOnce(new Error("network"));
+ const user = userEvent.setup({ advanceTimers: vi.advanceTimersByTime });
+ render(<AppearanceTab />, { wrapper: I18nWrapper });
+
+ await user.click(screen.getByRole("radio", { name: "中文" }));
+
+ // Local persist still happened so the reload below sees the new locale.
+ expect(mockPersist).toHaveBeenCalledWith("zh-Hans");
+ expect(mockUpdateMe).toHaveBeenCalledWith({ language: "zh-Hans" });
+ // Toast surfaced the sync failure.
+ expect(mockToastWarning).toHaveBeenCalledTimes(1);
+ // Reload deferred so the toast is visible.
+ expect(mockReload).not.toHaveBeenCalled();
+
+ act(() => {
+ vi.advanceTimersByTime(2500);
+ });
+ expect(mockReload).toHaveBeenCalledTimes(1);
+ });
+});
diff --git a/packages/views/settings/components/appearance-tab.tsx b/packages/views/settings/components/appearance-tab.tsx
index a7573ea973..480c053652 100644
--- a/packages/views/settings/components/appearance-tab.tsx
+++ b/packages/views/settings/components/appearance-tab.tsx
@@ -1,7 +1,17 @@
"use client";
+import { toast } from "sonner";
import { useTheme } from "@multica/ui/components/common/theme-provider";
import { cn } from "@multica/ui/lib/utils";
+import {
+ DEFAULT_LOCALE,
+ SUPPORTED_LOCALES,
+ type SupportedLocale,
+} from "@multica/core/i18n";
+import { useLocaleAdapter } from "@multica/core/i18n/react";
+import { useAuthStore } from "@multica/core/auth";
+import { api } from "@multica/core/api";
+import { useT } from "../../i18n";
const LIGHT_COLORS = {
titleBar: "#e8e8e8",
@@ -78,20 +88,70 @@ function WindowMockup({
);
}
-const themeOptions = [
- { value: "light" as const, label: "Light" },
- { value: "dark" as const, label: "Dark" },
- { value: "system" as const, label: "System" },
-];
-
export function AppearanceTab() {
const { theme, setTheme } = useTheme();
+ const { t, i18n } = useT("settings");
+ const localeAdapter = useLocaleAdapter();
+ const user = useAuthStore((s) => s.user);
+
+ // i18next.language can be a region-tagged BCP-47 string (e.g. "en-US",
+ // "zh-Hans-CN") returned by intl-localematcher. Normalize to a supported
+ // locale before comparing — otherwise the radio shows neither option active.
+ const currentLocale: SupportedLocale = SUPPORTED_LOCALES.includes(
+ i18n.language as SupportedLocale,
+ )
+ ? (i18n.language as SupportedLocale)
+ : DEFAULT_LOCALE;
+
+ const themeOptions = [
+ { value: "light" as const, label: t(($) => $.appearance.theme.light) },
+ { value: "dark" as const, label: t(($) => $.appearance.theme.dark) },
+ { value: "system" as const, label: t(($) => $.appearance.theme.system) },
+ ];
+
+ const languageOptions: { value: SupportedLocale; label: string }[] = [
+ { value: "en", label: t(($) => $.appearance.language.english) },
+ { value: "zh-Hans", label: t(($) => $.appearance.language.chinese) },
+ ];
+
+ // Persist locally → sync to user.language → reload. Reload (vs in-place
+ // changeLanguage) avoids hydration mismatch and is the i18next-recommended
+ // pattern for App Router.
+ //
+ // If the cross-device sync (PATCH /api/me) fails, the local cookie is
+ // already written so the new locale will take effect after reload — but
+ // the user's other devices won't see the change. Surface that explicitly
+ // via a toast and delay the reload long enough for the toast to be read,
+ // otherwise the failure would be invisible.
+ const handleLanguageChange = async (next: SupportedLocale) => {
+ if (next === currentLocale) return;
+ localeAdapter.persist(next);
+
+ let syncFailed = false;
+ if (user) {
+ try {
+ await api.updateMe({ language: next });
+ } catch {
+ syncFailed = true;
+ }
+ }
+
+ if (syncFailed) {
+ toast.warning(t(($) => $.appearance.language.sync_failed));
+ // Give the toast 2.5s of visible time before navigating away.
+ setTimeout(() => window.location.reload(), 2500);
+ return;
+ }
+ window.location.reload();
+ };
return (
<div className="space-y-8">
<section className="space-y-4">
- <h2 className="text-sm font-semibold">Theme</h2>
- <div className="flex gap-6" role="radiogroup" aria-label="Theme">
+ <h2 className="text-sm font-semibold">
+ {t(($) => $.appearance.theme.title)}
+ </h2>
+ <div className="flex gap-6" role="radiogroup">
{themeOptions.map((opt) => {
const active = theme === opt.value;
return (
@@ -99,7 +159,6 @@ export function AppearanceTab() {
key={opt.value}
role="radio"
aria-checked={active}
- aria-label={`Select ${opt.label} theme`}
onClick={() => setTheme(opt.value)}
className="group flex flex-col items-center gap-2"
>
@@ -141,6 +200,33 @@ export function AppearanceTab() {
})}
</div>
</section>
+
+ <section className="space-y-4">
+ <h2 className="text-sm font-semibold">
+ {t(($) => $.appearance.language.title)}
+ </h2>
+ <div className="flex gap-3" role="radiogroup">
+ {languageOptions.map((opt) => {
+ const active = currentLocale === opt.value;
+ return (
+ <button
+ key={opt.value}
+ role="radio"
+ aria-checked={active}
+ onClick={() => handleLanguageChange(opt.value)}
+ className={cn(
+ "rounded-md border px-4 py-2 text-sm transition-colors",
+ active
+ ? "border-brand bg-brand/10 font-medium text-foreground"
+ : "border-border text-muted-foreground hover:border-foreground/30"
+ )}
+ >
+ {opt.label}
+ </button>
+ );
+ })}
+ </div>
+ </section>
</div>
);
}
diff --git a/packages/views/settings/components/delete-workspace-dialog.test.tsx b/packages/views/settings/components/delete-workspace-dialog.test.tsx
index c19144b585..ce3f817b80 100644
--- a/packages/views/settings/components/delete-workspace-dialog.test.tsx
+++ b/packages/views/settings/components/delete-workspace-dialog.test.tsx
@@ -1,7 +1,26 @@
import type { ReactNode } from "react";
import { describe, expect, it, beforeEach, vi } from "vitest";
-import { render, screen } from "@testing-library/react";
+import { render as rtlRender, screen, type RenderOptions } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
+import { I18nProvider } from "@multica/core/i18n/react";
+import enCommon from "../../locales/en/common.json";
+import enSettings from "../../locales/en/settings.json";
+
+const TEST_RESOURCES = {
+ en: { common: enCommon, settings: enSettings },
+};
+
+function I18nWrapper({ children }: { children: ReactNode }) {
+ return (
+ <I18nProvider locale="en" resources={TEST_RESOURCES}>
+ {children}
+ </I18nProvider>
+ );
+}
+
+function render(ui: React.ReactElement, options?: RenderOptions) {
+ return rtlRender(ui, { wrapper: I18nWrapper, ...options });
+}
// The shared Dialog is a Base UI portal that's awkward to test — strip it to
// simple pass-through wrappers. The typed-confirmation logic lives in the
diff --git a/packages/views/settings/components/delete-workspace-dialog.tsx b/packages/views/settings/components/delete-workspace-dialog.tsx
index 64e0240d68..32ebaf1d95 100644
--- a/packages/views/settings/components/delete-workspace-dialog.tsx
+++ b/packages/views/settings/components/delete-workspace-dialog.tsx
@@ -12,6 +12,7 @@ import {
import { Input } from "@multica/ui/components/ui/input";
import { Label } from "@multica/ui/components/ui/label";
import { Button } from "@multica/ui/components/ui/button";
+import { useT } from "../../i18n";
/**
* Typed-confirmation dialog for workspace deletion — GitHub's repo-delete
@@ -42,6 +43,7 @@ export function DeleteWorkspaceDialog({
onOpenChange: (open: boolean) => void;
onConfirm: () => void;
}) {
+ const { t } = useT("settings");
const [typed, setTyped] = useState("");
const matched = typed === workspaceName;
@@ -62,20 +64,19 @@ export function DeleteWorkspaceDialog({
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent>
<DialogHeader>
- <DialogTitle>Delete workspace</DialogTitle>
+ <DialogTitle>{t(($) => $.delete_workspace_dialog.title)}</DialogTitle>
<DialogDescription>
- This cannot be undone. All issues, agents, and data will be
- permanently removed.
+ {t(($) => $.delete_workspace_dialog.description)}
</DialogDescription>
</DialogHeader>
<div className="space-y-2">
<Label htmlFor="delete-workspace-confirm" className="text-xs">
- To confirm, type{" "}
+ {t(($) => $.delete_workspace_dialog.type_to_confirm_prefix)}{" "}
<code className="rounded bg-muted px-1 py-0.5 font-mono text-xs">
{workspaceName}
</code>{" "}
- below.
+ {t(($) => $.delete_workspace_dialog.type_to_confirm_suffix)}
</Label>
<Input
id="delete-workspace-confirm"
@@ -104,7 +105,7 @@ export function DeleteWorkspaceDialog({
onClick={() => onOpenChange(false)}
disabled={loading}
>
- Cancel
+ {t(($) => $.delete_workspace_dialog.cancel)}
</Button>
<Button
type="button"
@@ -112,7 +113,7 @@ export function DeleteWorkspaceDialog({
onClick={submit}
disabled={!matched || loading}
>
- {loading ? "Deleting..." : "Delete workspace"}
+ {loading ? t(($) => $.delete_workspace_dialog.deleting) : t(($) => $.delete_workspace_dialog.confirm)}
</Button>
</DialogFooter>
</DialogContent>
diff --git a/packages/views/settings/components/labs-tab.tsx b/packages/views/settings/components/labs-tab.tsx
index b5f43bc178..a0593edf8d 100644
--- a/packages/views/settings/components/labs-tab.tsx
+++ b/packages/views/settings/components/labs-tab.tsx
@@ -11,8 +11,10 @@ import { useCurrentWorkspace } from "@multica/core/paths";
import { workspaceKeys } from "@multica/core/workspace/queries";
import { api } from "@multica/core/api";
import type { Workspace } from "@multica/core/types";
+import { useT } from "../../i18n";
export function LabsTab() {
+ const { t } = useT("settings");
const workspace = useCurrentWorkspace();
const qc = useQueryClient();
const [saving, setSaving] = useState(false);
@@ -35,7 +37,7 @@ export function LabsTab() {
);
} catch (e) {
toast.error(
- e instanceof Error ? e.message : "Failed to update setting",
+ e instanceof Error ? e.message : t(($) => $.labs.toast_failed),
);
} finally {
setSaving(false);
@@ -47,7 +49,7 @@ export function LabsTab() {
return (
<div className="space-y-4">
<section className="space-y-4">
- <h2 className="text-sm font-semibold">Git</h2>
+ <h2 className="text-sm font-semibold">{t(($) => $.labs.section_git)}</h2>
<Card>
<CardContent>
@@ -61,14 +63,14 @@ export function LabsTab() {
htmlFor="co-authored-by"
className="text-sm font-medium"
>
- Co-authored-by trailer
+ {t(($) => $.labs.co_authored_by_label)}
</Label>
<p className="text-sm text-muted-foreground">
- Automatically add{" "}
+ {t(($) => $.labs.co_authored_by_description_prefix)}{" "}
<code className="rounded bg-muted px-1 py-0.5 text-xs">
- Co-authored-by: multica-agent &lt;[email protected]&gt;
+ {"Co-authored-by: multica-agent <[email protected]>"}
</code>{" "}
- to commits made by agents.
+ {t(($) => $.labs.co_authored_by_description_suffix)}
</p>
</div>
</div>
diff --git a/packages/views/settings/components/members-tab.tsx b/packages/views/settings/components/members-tab.tsx
index 583911a3c0..e0b9b65782 100644
--- a/packages/views/settings/components/members-tab.tsx
+++ b/packages/views/settings/components/members-tab.tsx
@@ -42,13 +42,35 @@ import { useWorkspaceId } from "@multica/core/hooks";
import { useCurrentWorkspace } from "@multica/core/paths";
import { memberListOptions, invitationListOptions, workspaceKeys } from "@multica/core/workspace/queries";
import { api } from "@multica/core/api";
+import { useT } from "../../i18n";
-const roleConfig: Record<MemberRole, { label: string; icon: typeof Crown; description: string }> = {
- owner: { label: "Owner", icon: Crown, description: "Full access, manage all settings" },
- admin: { label: "Admin", icon: Shield, description: "Manage members and settings" },
- member: { label: "Member", icon: User, description: "Create and work on issues" },
+const ROLE_ICONS: Record<MemberRole, typeof Crown> = {
+ owner: Crown,
+ admin: Shield,
+ member: User,
};
+function useRoleLabels() {
+ const { t } = useT("settings");
+ return {
+ owner: {
+ label: t(($) => $.members.roles.owner.label),
+ description: t(($) => $.members.roles.owner.description),
+ icon: ROLE_ICONS.owner,
+ },
+ admin: {
+ label: t(($) => $.members.roles.admin.label),
+ description: t(($) => $.members.roles.admin.description),
+ icon: ROLE_ICONS.admin,
+ },
+ member: {
+ label: t(($) => $.members.roles.member.label),
+ description: t(($) => $.members.roles.member.description),
+ icon: ROLE_ICONS.member,
+ },
+ } as const;
+}
+
function MemberRow({
member,
canManage,
@@ -70,6 +92,8 @@ function MemberRow({
onRoleChange: (role: MemberRole) => void;
onRemove: () => void;
}) {
+ const { t } = useT("settings");
+ const roleConfig = useRoleLabels();
const rc = roleConfig[member.role];
const RoleIcon = rc.icon;
const canEditRole = canManage && !isSelf && (member.role !== "owner" || canManageOwners);
@@ -98,16 +122,13 @@ function MemberRow({
<DropdownMenuSub>
<DropdownMenuSubTrigger>
<Shield className="h-3.5 w-3.5" />
- Change role
+ {t(($) => $.members.change_role)}
</DropdownMenuSubTrigger>
<DropdownMenuSubContent className="w-auto">
{(Object.entries(roleConfig) as [MemberRole, (typeof roleConfig)[MemberRole]][]).map(
([role, config]) => {
if (role === "owner" && !canManageOwners) return null;
const Icon = config.icon;
- // Demoting the last owner would leave the workspace
- // ownerless — server rejects with 400, mirror that
- // here as a disabled option with explanation.
const wouldDemoteLastOwner =
isLastOwner && role !== "owner";
return (
@@ -119,7 +140,7 @@ function MemberRow({
disabled={wouldDemoteLastOwner}
title={
wouldDemoteLastOwner
- ? "Promote another member to owner first — a workspace must keep at least one owner."
+ ? t(($) => $.members.cannot_demote_last_owner_title)
: undefined
}
>
@@ -128,12 +149,12 @@ function MemberRow({
<span>{config.label}</span>
<span className="text-xs text-muted-foreground font-normal">
{wouldDemoteLastOwner
- ? "Cannot demote the last owner"
+ ? t(($) => $.members.cannot_demote_last_owner)
: config.description}
</span>
</div>
{member.role === role && (
- <span className="ml-auto text-xs text-muted-foreground">&#10003;</span>
+ <span className="ml-auto text-xs text-muted-foreground">{"✓"}</span>
)}
</DropdownMenuItem>
);
@@ -146,7 +167,7 @@ function MemberRow({
{canRemove && (
<DropdownMenuItem variant="destructive" onClick={onRemove}>
<UserMinus className="h-3.5 w-3.5" />
- Remove from workspace
+ {t(($) => $.members.remove_action)}
</DropdownMenuItem>
)}
</DropdownMenuContent>
@@ -171,6 +192,8 @@ function InvitationRow({
onRevoke: () => void;
busy: boolean;
}) {
+ const { t } = useT("settings");
+ const roleConfig = useRoleLabels();
const rc = roleConfig[invitation.role];
return (
@@ -182,7 +205,7 @@ function InvitationRow({
<div className="text-sm font-medium truncate">{invitation.invitee_email}</div>
<div className="flex items-center gap-1 text-xs text-muted-foreground">
<Clock className="h-3 w-3" />
- <span>Pending</span>
+ <span>{t(($) => $.members.pending_status)}</span>
</div>
</div>
{canManage && (
@@ -191,7 +214,7 @@ function InvitationRow({
size="icon-sm"
disabled={busy}
onClick={onRevoke}
- title="Revoke invitation"
+ title={t(($) => $.members.revoke_invitation_tooltip)}
>
<X className="h-4 w-4 text-muted-foreground" />
</Button>
@@ -204,6 +227,8 @@ function InvitationRow({
}
export function MembersTab() {
+ const { t } = useT("settings");
+ const roleConfig = useRoleLabels();
const user = useAuthStore((s) => s.user);
const workspace = useCurrentWorkspace();
const qc = useQueryClient();
@@ -239,9 +264,9 @@ export function MembersTab() {
setInviteEmail("");
setInviteRole("member");
qc.invalidateQueries({ queryKey: workspaceKeys.invitations(wsId) });
- toast.success("Invitation sent");
+ toast.success(t(($) => $.members.toast_invitation_sent));
} catch (e) {
- toast.error(e instanceof Error ? e.message : "Failed to send invitation");
+ toast.error(e instanceof Error ? e.message : t(($) => $.members.toast_invitation_failed));
} finally {
setInviteLoading(false);
}
@@ -250,17 +275,17 @@ export function MembersTab() {
const handleRevokeInvitation = (invitation: Invitation) => {
if (!workspace) return;
setConfirmAction({
- title: "Revoke invitation",
- description: `Revoke the invitation to ${invitation.invitee_email}? They will no longer be able to join this workspace.`,
+ title: t(($) => $.members.revoke_invitation_title),
+ description: t(($) => $.members.revoke_invitation_description, { email: invitation.invitee_email }),
variant: "destructive",
onConfirm: async () => {
setInvitationActionId(invitation.id);
try {
await api.revokeInvitation(workspace.id, invitation.id);
qc.invalidateQueries({ queryKey: workspaceKeys.invitations(wsId) });
- toast.success("Invitation revoked");
+ toast.success(t(($) => $.members.toast_invitation_revoked));
} catch (e) {
- toast.error(e instanceof Error ? e.message : "Failed to revoke invitation");
+ toast.error(e instanceof Error ? e.message : t(($) => $.members.toast_invitation_revoke_failed));
} finally {
setInvitationActionId(null);
}
@@ -274,9 +299,9 @@ export function MembersTab() {
try {
await api.updateMember(workspace.id, memberId, { role });
qc.invalidateQueries({ queryKey: workspaceKeys.members(wsId) });
- toast.success("Role updated");
+ toast.success(t(($) => $.members.toast_role_updated));
} catch (e) {
- toast.error(e instanceof Error ? e.message : "Failed to update member");
+ toast.error(e instanceof Error ? e.message : t(($) => $.members.toast_role_failed));
} finally {
setMemberActionId(null);
}
@@ -285,17 +310,17 @@ export function MembersTab() {
const handleRemoveMember = (member: MemberWithUser) => {
if (!workspace) return;
setConfirmAction({
- title: `Remove ${member.name}`,
- description: `Remove ${member.name} from ${workspace.name}? They will lose access to this workspace.`,
+ title: t(($) => $.members.remove_member_title, { name: member.name }),
+ description: t(($) => $.members.remove_member_description, { name: member.name, workspace: workspace.name }),
variant: "destructive",
onConfirm: async () => {
setMemberActionId(member.id);
try {
await api.deleteMember(workspace.id, member.id);
qc.invalidateQueries({ queryKey: workspaceKeys.members(wsId) });
- toast.success("Member removed");
+ toast.success(t(($) => $.members.toast_member_removed));
} catch (e) {
- toast.error(e instanceof Error ? e.message : "Failed to remove member");
+ toast.error(e instanceof Error ? e.message : t(($) => $.members.toast_member_remove_failed));
} finally {
setMemberActionId(null);
}
@@ -310,7 +335,7 @@ export function MembersTab() {
<section className="space-y-4">
<div className="flex items-center gap-2">
<Users className="h-4 w-4 text-muted-foreground" />
- <h2 className="text-sm font-semibold">Members ({members.length})</h2>
+ <h2 className="text-sm font-semibold">{t(($) => $.members.section_title, { count: members.length })}</h2>
</div>
{canManageWorkspace && (
@@ -318,14 +343,14 @@ export function MembersTab() {
<CardContent className="space-y-3">
<div className="flex items-center gap-2">
<Plus className="h-4 w-4 text-muted-foreground" />
- <h3 className="text-sm font-medium">Invite member</h3>
+ <h3 className="text-sm font-medium">{t(($) => $.members.invite_title)}</h3>
</div>
<div className="grid gap-3 sm:grid-cols-[1fr_120px_auto]">
<Input
type="email"
value={inviteEmail}
onChange={(e) => setInviteEmail(e.target.value)}
- placeholder="[email protected]"
+ placeholder={t(($) => $.members.invite_email_placeholder)}
onKeyDown={(e) => {
if (e.key === "Enter" && inviteEmail.trim()) handleInviteMember();
}}
@@ -343,7 +368,7 @@ export function MembersTab() {
onClick={handleInviteMember}
disabled={inviteLoading || !inviteEmail.trim()}
>
- {inviteLoading ? "Inviting..." : "Invite"}
+ {inviteLoading ? t(($) => $.members.inviting) : t(($) => $.members.invite_button)}
</Button>
</div>
</CardContent>
@@ -368,7 +393,7 @@ export function MembersTab() {
))}
</div>
) : (
- <p className="text-sm text-muted-foreground">No members found.</p>
+ <p className="text-sm text-muted-foreground">{t(($) => $.members.no_members)}</p>
)}
</section>
@@ -376,7 +401,7 @@ export function MembersTab() {
<section className="space-y-4">
<div className="flex items-center gap-2">
<Clock className="h-4 w-4 text-muted-foreground" />
- <h2 className="text-sm font-semibold">Pending invitations ({invitations.length})</h2>
+ <h2 className="text-sm font-semibold">{t(($) => $.members.pending_title, { count: invitations.length })}</h2>
</div>
<div className="overflow-hidden rounded-xl ring-1 ring-foreground/10">
{invitations.map((inv, i) => (
@@ -400,7 +425,7 @@ export function MembersTab() {
<AlertDialogDescription>{confirmAction?.description}</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
- <AlertDialogCancel>Cancel</AlertDialogCancel>
+ <AlertDialogCancel>{t(($) => $.members.confirm_cancel)}</AlertDialogCancel>
<AlertDialogAction
variant={confirmAction?.variant === "destructive" ? "destructive" : "default"}
onClick={async () => {
@@ -408,7 +433,7 @@ export function MembersTab() {
setConfirmAction(null);
}}
>
- Confirm
+ {t(($) => $.members.confirm_action)}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
diff --git a/packages/views/settings/components/notifications-tab.tsx b/packages/views/settings/components/notifications-tab.tsx
index 4e44b68b3a..06273ba5ea 100644
--- a/packages/views/settings/components/notifications-tab.tsx
+++ b/packages/views/settings/components/notifications-tab.tsx
@@ -8,40 +8,18 @@ import type { NotificationGroupKey, NotificationPreferences } from "@multica/cor
import { Card, CardContent } from "@multica/ui/components/ui/card";
import { Switch } from "@multica/ui/components/ui/switch";
import { toast } from "sonner";
+import { useT } from "../../i18n";
-const notificationGroups: {
- key: NotificationGroupKey;
- label: string;
- description: string;
-}[] = [
- {
- key: "assignments",
- label: "Assignments",
- description: "When you are assigned or unassigned from an issue",
- },
- {
- key: "status_changes",
- label: "Status changes",
- description: "When an issue you follow changes status (e.g. todo, in progress, done)",
- },
- {
- key: "comments",
- label: "Comments & Mentions",
- description: "New comments on issues you follow, or when someone @mentions you",
- },
- {
- key: "updates",
- label: "Priority & Due date",
- description: "When priority or due date changes on issues you follow",
- },
- {
- key: "agent_activity",
- label: "Agent activity",
- description: "When an agent task completes or fails",
- },
+const NOTIFICATION_GROUP_KEYS: NotificationGroupKey[] = [
+ "assignments",
+ "status_changes",
+ "comments",
+ "updates",
+ "agent_activity",
];
export function NotificationsTab() {
+ const { t } = useT("settings");
const wsId = useWorkspaceId();
const { data } = useQuery(notificationPreferenceOptions(wsId));
const mutation = useUpdateNotificationPreferences();
@@ -58,7 +36,7 @@ export function NotificationsTab() {
delete updated[key];
}
mutation.mutate(updated, {
- onError: () => toast.error("Failed to update notification settings"),
+ onError: () => toast.error(t(($) => $.notifications.toast_failed)),
});
};
@@ -66,34 +44,30 @@ export function NotificationsTab() {
<div className="space-y-4">
<section className="space-y-4">
<div>
- <h2 className="text-sm font-semibold">Inbox Notifications</h2>
+ <h2 className="text-sm font-semibold">{t(($) => $.notifications.title)}</h2>
<p className="text-sm text-muted-foreground mt-1">
- Control which events generate inbox notifications. Muted event types
- are silently filtered — you can still see them by visiting the issue
- directly.
+ {t(($) => $.notifications.description)}
</p>
</div>
<Card>
<CardContent className="divide-y">
- {notificationGroups.map((group) => {
- const enabled = preferences[group.key] !== "muted";
+ {NOTIFICATION_GROUP_KEYS.map((key) => {
+ const enabled = preferences[key] !== "muted";
return (
<div
- key={group.key}
+ key={key}
className="flex items-center justify-between py-3 first:pt-0 last:pb-0"
>
<div className="space-y-0.5 pr-4">
- <p className="text-sm font-medium">{group.label}</p>
+ <p className="text-sm font-medium">{t(($) => $.notifications.groups[key].label)}</p>
<p className="text-xs text-muted-foreground">
- {group.description}
+ {t(($) => $.notifications.groups[key].description)}
</p>
</div>
<Switch
checked={enabled}
- onCheckedChange={(checked) =>
- handleToggle(group.key, checked)
- }
+ onCheckedChange={(checked) => handleToggle(key, checked)}
/>
</div>
);
diff --git a/packages/views/settings/components/repositories-tab.tsx b/packages/views/settings/components/repositories-tab.tsx
index e1e244433e..ac0071e13e 100644
--- a/packages/views/settings/components/repositories-tab.tsx
+++ b/packages/views/settings/components/repositories-tab.tsx
@@ -13,8 +13,10 @@ import { useCurrentWorkspace } from "@multica/core/paths";
import { memberListOptions, workspaceKeys } from "@multica/core/workspace/queries";
import { api } from "@multica/core/api";
import type { Workspace, WorkspaceRepo } from "@multica/core/types";
+import { useT } from "../../i18n";
export function RepositoriesTab() {
+ const { t } = useT("settings");
const user = useAuthStore((s) => s.user);
const workspace = useCurrentWorkspace();
const wsId = useWorkspaceId();
@@ -39,9 +41,9 @@ export function RepositoriesTab() {
qc.setQueryData(workspaceKeys.list(), (old: Workspace[] | undefined) =>
old?.map((ws) => (ws.id === updated.id ? updated : ws)),
);
- toast.success("Repositories saved");
+ toast.success(t(($) => $.repositories.toast_saved));
} catch (e) {
- toast.error(e instanceof Error ? e.message : "Failed to save repositories");
+ toast.error(e instanceof Error ? e.message : t(($) => $.repositories.toast_save_failed));
} finally {
setSaving(false);
}
@@ -64,12 +66,12 @@ export function RepositoriesTab() {
return (
<div className="space-y-8">
<section className="space-y-4">
- <h2 className="text-sm font-semibold">Repositories</h2>
+ <h2 className="text-sm font-semibold">{t(($) => $.repositories.section_title)}</h2>
<Card>
<CardContent className="space-y-3">
<p className="text-xs text-muted-foreground">
- Git repositories associated with this workspace. Agents use these to clone and work on code.
+ {t(($) => $.repositories.description)}
</p>
{repos.map((repo, index) => (
@@ -79,7 +81,7 @@ export function RepositoriesTab() {
value={repo.url}
onChange={(e) => handleRepoChange(index, e.target.value)}
disabled={!canManageWorkspace}
- placeholder="https://git.example.com/org/repo.git"
+ placeholder={t(($) => $.repositories.url_placeholder)}
className="flex-1 min-w-0 text-sm"
/>
{canManageWorkspace && (
@@ -99,7 +101,7 @@ export function RepositoriesTab() {
<div className="flex flex-wrap items-center justify-between gap-2 pt-1">
<Button variant="outline" size="sm" onClick={handleAddRepo}>
<Plus className="h-3 w-3" />
- Add repository
+ {t(($) => $.repositories.add)}
</Button>
<Button
size="sm"
@@ -107,14 +109,14 @@ export function RepositoriesTab() {
disabled={saving}
>
<Save className="h-3 w-3" />
- {saving ? "Saving..." : "Save"}
+ {saving ? t(($) => $.repositories.saving) : t(($) => $.repositories.save)}
</Button>
</div>
)}
{!canManageWorkspace && (
<p className="text-xs text-muted-foreground">
- Only admins and owners can manage repositories.
+ {t(($) => $.repositories.manage_hint)}
</p>
)}
</CardContent>
diff --git a/packages/views/settings/components/settings-page.tsx b/packages/views/settings/components/settings-page.tsx
index 9f4a3c4a5d..83e05cc255 100644
--- a/packages/views/settings/components/settings-page.tsx
+++ b/packages/views/settings/components/settings-page.tsx
@@ -12,20 +12,29 @@ import { MembersTab } from "./members-tab";
import { RepositoriesTab } from "./repositories-tab";
import { LabsTab } from "./labs-tab";
import { NotificationsTab } from "./notifications-tab";
+import { useT } from "../../i18n";
-const accountTabs = [
- { value: "profile", label: "Profile", icon: User },
- { value: "appearance", label: "Appearance", icon: Palette },
- { value: "notifications", label: "Notifications", icon: Bell },
- { value: "tokens", label: "API Tokens", icon: Key },
-];
+const ACCOUNT_TAB_KEYS = ["profile", "appearance", "notifications", "tokens"] as const;
+const ACCOUNT_TAB_ICONS = {
+ profile: User,
+ appearance: Palette,
+ notifications: Bell,
+ tokens: Key,
+} as const;
-const workspaceTabs = [
- { value: "workspace", label: "General", icon: Settings },
- { value: "repositories", label: "Repositories", icon: FolderGit2 },
- { value: "labs", label: "Labs", icon: FlaskConical },
- { value: "members", label: "Members", icon: Users },
-];
+const WORKSPACE_TAB_KEYS = ["general", "repositories", "labs", "members"] as const;
+const WORKSPACE_TAB_VALUES = {
+ general: "workspace",
+ repositories: "repositories",
+ labs: "labs",
+ members: "members",
+} as const;
+const WORKSPACE_TAB_ICONS = {
+ general: Settings,
+ repositories: FolderGit2,
+ labs: FlaskConical,
+ members: Users,
+} as const;
export interface ExtraSettingsTab {
value: string;
@@ -40,6 +49,7 @@ interface SettingsPageProps {
}
export function SettingsPage({ extraAccountTabs }: SettingsPageProps = {}) {
+ const { t } = useT("settings");
const workspaceName = useCurrentWorkspace()?.name;
return (
@@ -50,18 +60,21 @@ export function SettingsPage({ extraAccountTabs }: SettingsPageProps = {}) {
>
{/* Left nav (stacks on top on mobile, sidebar on md+) */}
<div className="shrink-0 md:w-52 border-b md:border-b-0 md:border-r md:overflow-y-auto p-3 md:p-4">
- <h1 className="text-sm font-semibold mb-4 px-2">Settings</h1>
+ <h1 className="text-sm font-semibold mb-4 px-2">{t(($) => $.page.title)}</h1>
<TabsList variant="line" className="flex-col items-stretch w-full">
{/* My Account group */}
<span className="px-2 pb-1 pt-2 text-xs font-medium text-muted-foreground">
- My Account
+ {t(($) => $.page.my_account)}
</span>
- {accountTabs.map((tab) => (
- <TabsTrigger key={tab.value} value={tab.value}>
- <tab.icon className="h-4 w-4" />
- {tab.label}
- </TabsTrigger>
- ))}
+ {ACCOUNT_TAB_KEYS.map((key) => {
+ const Icon = ACCOUNT_TAB_ICONS[key];
+ return (
+ <TabsTrigger key={key} value={key}>
+ <Icon className="h-4 w-4" />
+ {t(($) => $.page.tabs[key])}
+ </TabsTrigger>
+ );
+ })}
{extraAccountTabs?.map((tab) => (
<TabsTrigger key={tab.value} value={tab.value}>
<tab.icon className="h-4 w-4" />
@@ -71,14 +84,17 @@ export function SettingsPage({ extraAccountTabs }: SettingsPageProps = {}) {
{/* Workspace group */}
<span className="px-2 pb-1 pt-4 text-xs font-medium text-muted-foreground truncate">
- {workspaceName ?? "Workspace"}
+ {workspaceName ?? t(($) => $.page.workspace_fallback)}
</span>
- {workspaceTabs.map((tab) => (
- <TabsTrigger key={tab.value} value={tab.value}>
- <tab.icon className="h-4 w-4" />
- {tab.label}
- </TabsTrigger>
- ))}
+ {WORKSPACE_TAB_KEYS.map((key) => {
+ const Icon = WORKSPACE_TAB_ICONS[key];
+ return (
+ <TabsTrigger key={key} value={WORKSPACE_TAB_VALUES[key]}>
+ <Icon className="h-4 w-4" />
+ {t(($) => $.page.tabs[key])}
+ </TabsTrigger>
+ );
+ })}
</TabsList>
</div>
diff --git a/packages/views/settings/components/tokens-tab.tsx b/packages/views/settings/components/tokens-tab.tsx
index adc77ad8dc..cd29296928 100644
--- a/packages/views/settings/components/tokens-tab.tsx
+++ b/packages/views/settings/components/tokens-tab.tsx
@@ -35,8 +35,12 @@ import {
import { Skeleton } from "@multica/ui/components/ui/skeleton";
import { toast } from "sonner";
import { api } from "@multica/core/api";
+import { useT } from "../../i18n";
+
+const EXPIRY_KEYS = ["30", "90", "365", "never"] as const;
export function TokensTab() {
+ const { t } = useT("settings");
const [tokens, setTokens] = useState<PersonalAccessToken[]>([]);
const [tokenName, setTokenName] = useState("");
const [tokenExpiry, setTokenExpiry] = useState("90");
@@ -52,11 +56,11 @@ export function TokensTab() {
const list = await api.listPersonalAccessTokens();
setTokens(list);
} catch (e) {
- toast.error(e instanceof Error ? e.message : "Failed to load tokens");
+ toast.error(e instanceof Error ? e.message : t(($) => $.tokens.toast_load_failed));
} finally {
setTokensLoading(false);
}
- }, []);
+ }, [t]);
useEffect(() => { loadTokens(); }, [loadTokens]);
@@ -70,7 +74,7 @@ export function TokensTab() {
setTokenExpiry("90");
await loadTokens();
} catch (e) {
- toast.error(e instanceof Error ? e.message : "Failed to create token");
+ toast.error(e instanceof Error ? e.message : t(($) => $.tokens.toast_create_failed));
} finally {
setTokenCreating(false);
}
@@ -81,9 +85,9 @@ export function TokensTab() {
try {
await api.revokePersonalAccessToken(id);
await loadTokens();
- toast.success("Token revoked");
+ toast.success(t(($) => $.tokens.toast_revoked));
} catch (e) {
- toast.error(e instanceof Error ? e.message : "Failed to revoke token");
+ toast.error(e instanceof Error ? e.message : t(($) => $.tokens.toast_revoke_failed));
} finally {
setTokenRevoking(null);
}
@@ -101,32 +105,31 @@ export function TokensTab() {
<section className="space-y-4">
<div className="flex items-center gap-2">
<Key className="h-4 w-4 text-muted-foreground" />
- <h2 className="text-sm font-semibold">API Tokens</h2>
+ <h2 className="text-sm font-semibold">{t(($) => $.tokens.title)}</h2>
</div>
<Card>
<CardContent className="space-y-3">
<p className="text-xs text-muted-foreground">
- Personal access tokens allow the CLI and external integrations to authenticate with your account.
+ {t(($) => $.tokens.description)}
</p>
<div className="grid gap-3 sm:grid-cols-[1fr_120px_auto]">
<Input
type="text"
value={tokenName}
onChange={(e) => setTokenName(e.target.value)}
- placeholder="Token name (e.g. My CLI)"
+ placeholder={t(($) => $.tokens.name_placeholder)}
/>
<Select value={tokenExpiry} onValueChange={(v) => { if (v) setTokenExpiry(v); }}>
<SelectTrigger size="sm"><SelectValue /></SelectTrigger>
<SelectContent>
- <SelectItem value="30">30 days</SelectItem>
- <SelectItem value="90">90 days</SelectItem>
- <SelectItem value="365">1 year</SelectItem>
- <SelectItem value="never">No expiry</SelectItem>
+ {EXPIRY_KEYS.map((key) => (
+ <SelectItem key={key} value={key}>{t(($) => $.tokens.expiry[key])}</SelectItem>
+ ))}
</SelectContent>
</Select>
<Button onClick={handleCreateToken} disabled={tokenCreating || !tokenName.trim()}>
- {tokenCreating ? "Creating..." : "Create"}
+ {tokenCreating ? t(($) => $.tokens.creating) : t(($) => $.tokens.create)}
</Button>
</div>
</CardContent>
@@ -148,14 +151,24 @@ export function TokensTab() {
</div>
) : tokens.length > 0 && (
<div className="space-y-2">
- {tokens.map((t) => (
- <Card key={t.id}>
+ {tokens.map((token) => (
+ <Card key={token.id}>
<CardContent className="flex items-center gap-3">
<div className="min-w-0 flex-1">
- <div className="text-sm font-medium truncate">{t.name}</div>
+ <div className="text-sm font-medium truncate">{token.name}</div>
<div className="text-xs text-muted-foreground">
- {t.token_prefix}... · Created {new Date(t.created_at).toLocaleDateString()} · {t.last_used_at ? `Last used ${new Date(t.last_used_at).toLocaleDateString()}` : "Never used"}
- {t.expires_at && ` · Expires ${new Date(t.expires_at).toLocaleDateString()}`}
+ {t(($) => $.tokens.metadata_prefix, {
+ prefix: token.token_prefix,
+ created: new Date(token.created_at).toLocaleDateString(),
+ lastUsed: token.last_used_at
+ ? t(($) => $.tokens.last_used_with_date, {
+ date: new Date(token.last_used_at!).toLocaleDateString(),
+ })
+ : t(($) => $.tokens.last_used_never),
+ })}
+ {token.expires_at && t(($) => $.tokens.expires_with_date, {
+ date: new Date(token.expires_at!).toLocaleDateString(),
+ })}
</div>
</div>
<Tooltip>
@@ -164,15 +177,15 @@ export function TokensTab() {
<Button
variant="ghost"
size="icon-sm"
- onClick={() => setRevokeConfirmId(t.id)}
- disabled={tokenRevoking === t.id}
- aria-label={`Revoke ${t.name}`}
+ onClick={() => setRevokeConfirmId(token.id)}
+ disabled={tokenRevoking === token.id}
+ aria-label={t(($) => $.tokens.revoke_aria, { name: token.name })}
>
<Trash2 className="h-3.5 w-3.5" />
</Button>
}
/>
- <TooltipContent>Revoke</TooltipContent>
+ <TooltipContent>{t(($) => $.tokens.revoke_tooltip)}</TooltipContent>
</Tooltip>
</CardContent>
</Card>
@@ -184,13 +197,13 @@ export function TokensTab() {
<AlertDialog open={!!revokeConfirmId} onOpenChange={(v) => { if (!v) setRevokeConfirmId(null); }}>
<AlertDialogContent>
<AlertDialogHeader>
- <AlertDialogTitle>Revoke token</AlertDialogTitle>
+ <AlertDialogTitle>{t(($) => $.tokens.revoke_dialog.title)}</AlertDialogTitle>
<AlertDialogDescription>
- This token will be permanently revoked and can no longer be used. This cannot be undone.
+ {t(($) => $.tokens.revoke_dialog.description)}
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
- <AlertDialogCancel>Cancel</AlertDialogCancel>
+ <AlertDialogCancel>{t(($) => $.tokens.revoke_dialog.cancel)}</AlertDialogCancel>
<AlertDialogAction
variant="destructive"
onClick={async () => {
@@ -198,7 +211,7 @@ export function TokensTab() {
setRevokeConfirmId(null);
}}
>
- Revoke
+ {t(($) => $.tokens.revoke_dialog.confirm)}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
@@ -207,9 +220,9 @@ export function TokensTab() {
<Dialog open={!!newToken} onOpenChange={(v) => { if (!v) { setNewToken(null); setTokenCopied(false); } }}>
<DialogContent>
<DialogHeader>
- <DialogTitle>Token created</DialogTitle>
+ <DialogTitle>{t(($) => $.tokens.created_dialog.title)}</DialogTitle>
<DialogDescription>
- Copy your personal access token now. You won&apos;t be able to see it again.
+ {t(($) => $.tokens.created_dialog.description)}
</DialogDescription>
</DialogHeader>
<div className="flex items-center gap-2">
@@ -224,11 +237,11 @@ export function TokensTab() {
</Button>
}
/>
- <TooltipContent>Copy token</TooltipContent>
+ <TooltipContent>{t(($) => $.tokens.created_dialog.copy_tooltip)}</TooltipContent>
</Tooltip>
</div>
<DialogFooter>
- <Button onClick={() => { setNewToken(null); setTokenCopied(false); }}>Done</Button>
+ <Button onClick={() => { setNewToken(null); setTokenCopied(false); }}>{t(($) => $.tokens.created_dialog.done)}</Button>
</DialogFooter>
</DialogContent>
</Dialog>
diff --git a/packages/views/settings/components/workspace-tab.tsx b/packages/views/settings/components/workspace-tab.tsx
index 7025ddfc7e..5b62bd751f 100644
--- a/packages/views/settings/components/workspace-tab.tsx
+++ b/packages/views/settings/components/workspace-tab.tsx
@@ -37,8 +37,10 @@ import { setCurrentWorkspace } from "@multica/core/platform";
import type { Workspace } from "@multica/core/types";
import { useNavigation } from "../../navigation";
import { DeleteWorkspaceDialog } from "./delete-workspace-dialog";
+import { useT } from "../../i18n";
export function WorkspaceTab() {
+ const { t } = useT("settings");
const user = useAuthStore((s) => s.user);
const workspace = useCurrentWorkspace();
const wsId = useWorkspaceId();
@@ -135,9 +137,9 @@ export function WorkspaceTab() {
qc.setQueryData(workspaceKeys.list(), (old: Workspace[] | undefined) =>
old?.map((ws) => (ws.id === updated.id ? updated : ws)),
);
- toast.success("Workspace settings saved");
+ toast.success(t(($) => $.workspace.toast_saved));
} catch (e) {
- toast.error(e instanceof Error ? e.message : "Failed to save workspace settings");
+ toast.error(e instanceof Error ? e.message : t(($) => $.workspace.toast_save_failed));
} finally {
setSaving(false);
}
@@ -146,18 +148,16 @@ export function WorkspaceTab() {
const handleLeaveWorkspace = () => {
if (!workspace) return;
setConfirmAction({
- title: "Leave workspace",
- description: `Leave ${workspace.name}? You will lose access until re-invited.`,
+ title: t(($) => $.workspace.leave_confirm_title),
+ description: t(($) => $.workspace.leave_confirm_description, { name: workspace.name }),
variant: "destructive",
onConfirm: async () => {
setActionId("leave");
- // Navigate away FIRST so the realtime handler's
- // "current-workspace-deleted" branch doesn't race the mutation.
navigateAwayFromCurrentWorkspace();
try {
await leaveWorkspace.mutateAsync(workspace.id);
} catch (e) {
- toast.error(e instanceof Error ? e.message : "Failed to leave workspace");
+ toast.error(e instanceof Error ? e.message : t(($) => $.workspace.toast_leave_failed));
} finally {
setActionId(null);
}
@@ -177,7 +177,7 @@ export function WorkspaceTab() {
try {
await deleteWorkspace.mutateAsync(workspace.id);
} catch (e) {
- toast.error(e instanceof Error ? e.message : "Failed to delete workspace");
+ toast.error(e instanceof Error ? e.message : t(($) => $.workspace.toast_delete_failed));
} finally {
setActionId(null);
}
@@ -189,12 +189,12 @@ export function WorkspaceTab() {
<div className="space-y-8">
{/* Workspace settings */}
<section className="space-y-4">
- <h2 className="text-sm font-semibold">General</h2>
+ <h2 className="text-sm font-semibold">{t(($) => $.workspace.section_general)}</h2>
<Card>
<CardContent className="space-y-3">
<div>
- <Label className="text-xs text-muted-foreground">Name</Label>
+ <Label className="text-xs text-muted-foreground">{t(($) => $.workspace.name_label)}</Label>
<Input
type="text"
value={name}
@@ -204,29 +204,29 @@ export function WorkspaceTab() {
/>
</div>
<div>
- <Label className="text-xs text-muted-foreground">Description</Label>
+ <Label className="text-xs text-muted-foreground">{t(($) => $.workspace.description_label)}</Label>
<Textarea
value={description}
onChange={(e) => setDescription(e.target.value)}
rows={3}
disabled={!canManageWorkspace}
className="mt-1 resize-none"
- placeholder="What does this workspace focus on?"
+ placeholder={t(($) => $.workspace.description_placeholder)}
/>
</div>
<div>
- <Label className="text-xs text-muted-foreground">Context</Label>
+ <Label className="text-xs text-muted-foreground">{t(($) => $.workspace.context_label)}</Label>
<Textarea
value={context}
onChange={(e) => setContext(e.target.value)}
rows={4}
disabled={!canManageWorkspace}
className="mt-1 resize-none"
- placeholder="Background information and context for AI agents working in this workspace"
+ placeholder={t(($) => $.workspace.context_placeholder)}
/>
</div>
<div>
- <Label className="text-xs text-muted-foreground">Slug</Label>
+ <Label className="text-xs text-muted-foreground">{t(($) => $.workspace.slug_label)}</Label>
<div className="mt-1 rounded-md border bg-muted/50 px-3 py-2 text-sm text-muted-foreground">
{workspace.slug}
</div>
@@ -238,12 +238,12 @@ export function WorkspaceTab() {
disabled={saving || !name.trim() || !canManageWorkspace}
>
<Save className="h-3 w-3" />
- {saving ? "Saving..." : "Save"}
+ {saving ? t(($) => $.workspace.saving) : t(($) => $.workspace.save)}
</Button>
</div>
{!canManageWorkspace && (
<p className="text-xs text-muted-foreground">
- Only admins and owners can update workspace settings.
+ {t(($) => $.workspace.manage_hint)}
</p>
)}
</CardContent>
@@ -257,20 +257,20 @@ export function WorkspaceTab() {
<section className="space-y-4">
<div className="flex items-center gap-2">
<LogOut className="h-4 w-4 text-muted-foreground" />
- <h2 className="text-sm font-semibold">Danger Zone</h2>
+ <h2 className="text-sm font-semibold">{t(($) => $.workspace.danger_zone)}</h2>
</div>
<Card>
<CardContent className="space-y-3">
<div className="flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between">
<div>
- <p className="text-sm font-medium">Leave workspace</p>
+ <p className="text-sm font-medium">{t(($) => $.workspace.leave_title)}</p>
<p className="text-xs text-muted-foreground">
{isSoleOwner
? isSoleMember
- ? "You're the only member. Delete the workspace to leave."
- : "You're the only owner. Promote another member to owner first, or delete the workspace."
- : "Remove yourself from this workspace."}
+ ? t(($) => $.workspace.leave_sole_member)
+ : t(($) => $.workspace.leave_sole_owner)
+ : t(($) => $.workspace.leave_default)}
</p>
</div>
<Button
@@ -279,16 +279,16 @@ export function WorkspaceTab() {
onClick={handleLeaveWorkspace}
disabled={actionId === "leave" || isSoleOwner}
>
- {actionId === "leave" ? "Leaving..." : "Leave workspace"}
+ {actionId === "leave" ? t(($) => $.workspace.leaving) : t(($) => $.workspace.leave_button)}
</Button>
</div>
{isOwner && (
<div className="flex flex-col gap-2 border-t pt-3 sm:flex-row sm:items-center sm:justify-between">
<div>
- <p className="text-sm font-medium text-destructive">Delete workspace</p>
+ <p className="text-sm font-medium text-destructive">{t(($) => $.workspace.delete_title)}</p>
<p className="text-xs text-muted-foreground">
- Permanently delete this workspace and its data.
+ {t(($) => $.workspace.delete_description)}
</p>
</div>
<Button
@@ -297,7 +297,7 @@ export function WorkspaceTab() {
onClick={() => setDeleteDialogOpen(true)}
disabled={actionId === "delete-workspace"}
>
- {actionId === "delete-workspace" ? "Deleting..." : "Delete workspace"}
+ {actionId === "delete-workspace" ? t(($) => $.workspace.deleting) : t(($) => $.workspace.delete_button)}
</Button>
</div>
)}
@@ -313,7 +313,7 @@ export function WorkspaceTab() {
<AlertDialogDescription>{confirmAction?.description}</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
- <AlertDialogCancel>Cancel</AlertDialogCancel>
+ <AlertDialogCancel>{t(($) => $.workspace.confirm_cancel)}</AlertDialogCancel>
<AlertDialogAction
variant={confirmAction?.variant === "destructive" ? "destructive" : "default"}
onClick={async () => {
@@ -321,7 +321,7 @@ export function WorkspaceTab() {
setConfirmAction(null);
}}
>
- Confirm
+ {t(($) => $.workspace.confirm_action)}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
diff --git a/packages/views/skills/components/create-skill-dialog.tsx b/packages/views/skills/components/create-skill-dialog.tsx
index 0497be6baa..39846b82f0 100644
--- a/packages/views/skills/components/create-skill-dialog.tsx
+++ b/packages/views/skills/components/create-skill-dialog.tsx
@@ -39,12 +39,10 @@ import { useScrollFade } from "@multica/ui/hooks/use-scroll-fade";
import { cn } from "@multica/ui/lib/utils";
import { openExternal } from "../../platform";
import { RuntimeLocalSkillImportPanel } from "./runtime-local-skill-import-panel";
+import { useT } from "../../i18n";
type Method = "chooser" | "manual" | "url" | "runtime";
-/** After create/import, seed the detail cache with the freshly-returned skill
- * so the next navigation renders immediately — no extra round-trip. Also
- * refreshes skills/agents lists since the new row needs to surface. */
function seedAfterCreate(
qc: ReturnType<typeof useQueryClient>,
wsId: string,
@@ -55,8 +53,6 @@ function seedAfterCreate(
qc.invalidateQueries({ queryKey: workspaceKeys.agents(wsId) });
}
-/** Matches only name-conflict errors so we don't confuse users with the
- * "try a different name" hint when the real problem is something else. */
function isNameConflictError(msg: string): boolean {
return /\b(409|conflict|already exists|unique constraint)\b/i.test(msg);
}
@@ -66,34 +62,19 @@ function isNameConflictError(msg: string): boolean {
// ---------------------------------------------------------------------------
function MethodChooser({ onChoose }: { onChoose: (m: Method) => void }) {
+ const { t } = useT("skills");
const methods: {
key: Method;
icon: typeof Plus;
- title: string;
- desc: string;
+ titleKey: "manual" | "url" | "runtime";
}[] = [
- {
- key: "manual",
- icon: Plus,
- title: "Create manually",
- desc: "Start from a blank SKILL.md and write your own instructions.",
- },
- {
- key: "url",
- icon: Download,
- title: "Import from URL",
- desc: "Pull a published skill from ClawHub or Skills.sh.",
- },
- {
- key: "runtime",
- icon: HardDrive,
- title: "Copy from runtime",
- desc: "Promote a skill already installed on your local runtime.",
- },
+ { key: "manual", icon: Plus, titleKey: "manual" },
+ { key: "url", icon: Download, titleKey: "url" },
+ { key: "runtime", icon: HardDrive, titleKey: "runtime" },
];
return (
<div className="grid gap-2 p-5">
- {methods.map(({ key, icon: Icon, title, desc }) => (
+ {methods.map(({ key, icon: Icon, titleKey }) => (
<button
key={key}
type="button"
@@ -104,8 +85,12 @@ function MethodChooser({ onChoose }: { onChoose: (m: Method) => void }) {
<Icon className="h-4 w-4" />
</div>
<div className="min-w-0 flex-1">
- <div className="text-sm font-medium">{title}</div>
- <div className="mt-0.5 text-xs text-muted-foreground">{desc}</div>
+ <div className="text-sm font-medium">
+ {t(($) => $.create.method_card[`${titleKey}_title`])}
+ </div>
+ <div className="mt-0.5 text-xs text-muted-foreground">
+ {t(($) => $.create.method_card[`${titleKey}_desc`])}
+ </div>
</div>
<ChevronRight className="h-4 w-4 shrink-0 text-muted-foreground/40 transition-colors group-hover:text-muted-foreground" />
</button>
@@ -125,6 +110,7 @@ function ManualForm({
onCreated: (skill: Skill) => void;
onCancel: () => void;
}) {
+ const { t } = useT("skills");
const qc = useQueryClient();
const wsId = useWorkspaceId();
const [name, setName] = useState("");
@@ -145,10 +131,10 @@ function ManualForm({
description: description.trim(),
});
seedAfterCreate(qc, wsId, skill);
- toast.success("Skill created");
+ toast.success(t(($) => $.create.manual.toast_created));
onCreated(skill);
} catch (err) {
- setError(err instanceof Error ? err.message : "Failed to create skill");
+ setError(err instanceof Error ? err.message : t(($) => $.create.manual.fallback_error));
setLoading(false);
}
};
@@ -165,7 +151,7 @@ function ManualForm({
htmlFor="create-skill-name"
className="text-xs text-muted-foreground"
>
- Name
+ {t(($) => $.create.manual.name_label)}
</Label>
<Input
id="create-skill-name"
@@ -175,13 +161,13 @@ function ManualForm({
setName(e.target.value);
setError("");
}}
- placeholder="e.g. review-helper"
+ placeholder={t(($) => $.create.manual.name_placeholder)}
onKeyDown={(e) => {
if (e.key === "Enter") submit();
}}
/>
<p className="text-xs text-muted-foreground">
- Must be unique within the workspace.
+ {t(($) => $.create.manual.name_hint)}
</p>
</div>
@@ -191,13 +177,13 @@ function ManualForm({
className="text-xs text-muted-foreground"
>
<Pencil className="h-3 w-3" />
- Description
+ {t(($) => $.create.manual.description_label)}
</Label>
<Textarea
id="create-skill-desc"
value={description}
onChange={(e) => setDescription(e.target.value)}
- placeholder="One sentence on when to assign this skill to an agent."
+ placeholder={t(($) => $.create.manual.description_placeholder)}
rows={3}
className="resize-none"
/>
@@ -212,7 +198,7 @@ function ManualForm({
<span>
{error}
{isNameConflictError(error) && (
- <> Try a different name and submit again.</>
+ <>{t(($) => $.create.manual.name_conflict_hint)}</>
)}
</span>
</div>
@@ -227,7 +213,7 @@ function ManualForm({
onClick={onCancel}
disabled={loading}
>
- Cancel
+ {t(($) => $.create.manual.cancel)}
</Button>
<Button
type="button"
@@ -238,10 +224,10 @@ function ManualForm({
{loading ? (
<>
<Loader2 className="h-3 w-3 animate-spin" />
- Creating…
+ {t(($) => $.create.manual.submitting)}
</>
) : (
- "Create skill"
+ t(($) => $.create.manual.submit)
)}
</Button>
</div>
@@ -280,8 +266,6 @@ function SourceCard({
}`}
>
<div className="text-xs font-medium">{label}</div>
- {/* Host example doubles as a "browse" link — brand-colored underline
- matches the repo's convention for in-flow links (see editor CSS). */}
<button
type="button"
onClick={() => openExternal(browseUrl)}
@@ -300,6 +284,7 @@ function UrlForm({
onCreated: (skill: Skill) => void;
onCancel: () => void;
}) {
+ const { t } = useT("skills");
const qc = useQueryClient();
const wsId = useWorkspaceId();
const [url, setUrl] = useState("");
@@ -317,19 +302,19 @@ function UrlForm({
try {
const skill = await api.importSkill({ url: trimmed });
seedAfterCreate(qc, wsId, skill);
- toast.success("Skill imported");
+ toast.success(t(($) => $.create.url.toast_imported));
onCreated(skill);
} catch (err) {
- setError(err instanceof Error ? err.message : "Import failed");
+ setError(err instanceof Error ? err.message : t(($) => $.create.url.fallback_error));
setLoading(false);
}
};
const submittingLabel = (() => {
- if (!loading) return "Import";
- if (source === "clawhub") return "Importing from ClawHub…";
- if (source === "skills.sh") return "Importing from Skills.sh…";
- return "Importing…";
+ if (!loading) return t(($) => $.create.url.import);
+ if (source === "clawhub") return t(($) => $.create.url.importing_clawhub);
+ if (source === "skills.sh") return t(($) => $.create.url.importing_skills_sh);
+ return t(($) => $.create.url.importing);
})();
return (
@@ -341,7 +326,7 @@ function UrlForm({
>
<div className="space-y-1.5">
<Label htmlFor="import-url" className="text-xs text-muted-foreground">
- Skill URL
+ {t(($) => $.create.url.url_label)}
</Label>
<Input
id="import-url"
@@ -361,7 +346,7 @@ function UrlForm({
<div>
<p className="mb-2 text-xs text-muted-foreground">
- Supported sources
+ {t(($) => $.create.url.supported_sources)}
</p>
<div className="grid grid-cols-2 gap-2">
<SourceCard
@@ -388,11 +373,7 @@ function UrlForm({
<span>
{error}
{isNameConflictError(error) && (
- <>
- {" "}
- The imported skill&rsquo;s name already exists — delete the
- existing one before retrying.
- </>
+ <>{t(($) => $.create.url.name_conflict_hint)}</>
)}
</span>
</div>
@@ -407,7 +388,7 @@ function UrlForm({
onClick={onCancel}
disabled={loading}
>
- Cancel
+ {t(($) => $.create.url.cancel)}
</Button>
<Button
type="button"
@@ -436,21 +417,6 @@ function UrlForm({
// Root dialog
// ---------------------------------------------------------------------------
-const METHOD_TITLES: Record<Method, string> = {
- chooser: "New skill",
- manual: "Create manually",
- url: "Import from URL",
- runtime: "Copy from runtime",
-};
-
-const METHOD_DESCS: Record<Method, string> = {
- chooser: "Choose how you want to add a skill to this workspace.",
- manual: "Write a new SKILL.md from scratch.",
- url: "Fetch a published skill by URL. Files are pulled server-side.",
- runtime:
- "Scan a local runtime and promote one of its on-disk skills into this workspace.",
-};
-
export function CreateSkillDialog({
onClose,
onCreated,
@@ -458,6 +424,7 @@ export function CreateSkillDialog({
onClose: () => void;
onCreated?: (skill: Skill) => void;
}) {
+ const { t } = useT("skills");
const [method, setMethod] = useState<Method>("chooser");
const handleCreated = (skill: Skill) => {
@@ -467,25 +434,15 @@ export function CreateSkillDialog({
const wide = method === "runtime";
- // Mount pattern mirrors CreateIssue / CreateProject: the parent conditionally
- // renders this component and `<Dialog open>` is hard-coded. Toggling `open`
- // via prop (controlled) causes a second data-open → data-closed flip with a
- // tail re-render, which shows up as a "double blink" on close.
return (
<Dialog open onOpenChange={(v) => !v && onClose()}>
<DialogContent
showCloseButton={false}
className={cn(
"flex flex-col gap-0 overflow-hidden p-0",
- // Smooth width/height transition when switching between method
- // dimensions — matches the CreateIssue modal's ease curve so the
- // expand feels native rather than snapping.
"!transition-all !duration-300 !ease-out",
wide
- ? // `min(600px, 85vh)` keeps the dialog from overflowing short
- // viewports (smaller laptops) while still feeling generous on
- // normal screens.
- "!h-[min(600px,85vh)] !max-w-2xl !w-full"
+ ? "!h-[min(600px,85vh)] !max-w-2xl !w-full"
: "!h-auto !max-h-[85vh] !max-w-md !w-full",
)}
>
@@ -500,21 +457,21 @@ export function CreateSkillDialog({
type="button"
onClick={() => setMethod("chooser")}
className="-ml-1 rounded-sm p-1 text-muted-foreground opacity-70 transition-opacity hover:bg-accent/60 hover:opacity-100"
- aria-label="Back to method chooser"
+ aria-label={t(($) => $.create.back_aria)}
>
<ArrowLeft className="h-3.5 w-3.5" />
</button>
}
/>
- <TooltipContent side="bottom">Back</TooltipContent>
+ <TooltipContent side="bottom">{t(($) => $.create.back)}</TooltipContent>
</Tooltip>
)}
<div className="min-w-0">
<DialogTitle className="truncate text-base font-medium">
- {METHOD_TITLES[method]}
+ {t(($) => $.create.method[method].title)}
</DialogTitle>
<p className="mt-0.5 text-xs text-muted-foreground">
- {METHOD_DESCS[method]}
+ {t(($) => $.create.method[method].desc)}
</p>
</div>
</div>
@@ -525,13 +482,13 @@ export function CreateSkillDialog({
type="button"
onClick={onClose}
className="rounded-sm p-1 text-muted-foreground opacity-70 transition-opacity hover:bg-accent/60 hover:opacity-100"
- aria-label="Close"
+ aria-label={t(($) => $.create.close_aria)}
>
<XIcon className="h-3.5 w-3.5" />
</button>
}
/>
- <TooltipContent side="bottom">Close</TooltipContent>
+ <TooltipContent side="bottom">{t(($) => $.create.close)}</TooltipContent>
</Tooltip>
</div>
diff --git a/packages/views/skills/components/file-tree.tsx b/packages/views/skills/components/file-tree.tsx
index bcb5bd93c9..154a05ffe5 100644
--- a/packages/views/skills/components/file-tree.tsx
+++ b/packages/views/skills/components/file-tree.tsx
@@ -10,6 +10,7 @@ import {
FolderOpen,
} from "lucide-react";
import { cn } from "@multica/ui/lib/utils";
+import { useT } from "../../i18n";
// ---------------------------------------------------------------------------
// Tree data structures
@@ -155,13 +156,14 @@ export function FileTree({
selectedPath: string;
onSelect: (path: string) => void;
}) {
+ const { t } = useT("skills");
const tree = buildTree(filePaths);
if (tree.length === 0) {
return (
<div className="flex flex-col items-center justify-center py-8 text-muted-foreground">
<FolderOpen className="h-5 w-5 text-muted-foreground/40" />
- <p className="mt-2 text-xs">No files</p>
+ <p className="mt-2 text-xs">{t(($) => $.file_tree.no_files)}</p>
</div>
);
}
diff --git a/packages/views/skills/components/file-viewer.tsx b/packages/views/skills/components/file-viewer.tsx
index b714293e0c..8eaf9b8ee5 100644
--- a/packages/views/skills/components/file-viewer.tsx
+++ b/packages/views/skills/components/file-viewer.tsx
@@ -6,6 +6,7 @@ import { Button } from "@multica/ui/components/ui/button";
import { Textarea } from "@multica/ui/components/ui/textarea";
import { Tooltip, TooltipTrigger, TooltipContent } from "@multica/ui/components/ui/tooltip";
import { Markdown } from "../../common/markdown";
+import { useT } from "../../i18n";
function isMarkdown(path: string) {
return path.endsWith(".md") || path.endsWith(".mdx");
@@ -87,6 +88,7 @@ export function FileViewer({
content: string;
onChange: (content: string) => void;
}) {
+ const { t } = useT("skills");
const [editing, setEditing] = useState(false);
const isMd = isMarkdown(path);
@@ -122,7 +124,9 @@ export function FileViewer({
}
/>
<TooltipContent>
- {editing ? "Preview" : "Edit"}
+ {editing
+ ? t(($) => $.file_viewer.preview_tooltip)
+ : t(($) => $.file_viewer.edit_tooltip)}
</TooltipContent>
</Tooltip>
)}
@@ -135,7 +139,7 @@ export function FileViewer({
<div className="p-6">
{frontmatter && <FrontmatterCard data={frontmatter} />}
<Markdown mode="full">
- {body || "*No content yet*"}
+ {body || t(($) => $.file_viewer.no_content)}
</Markdown>
</div>
) : (
@@ -144,8 +148,8 @@ export function FileViewer({
onChange={(e) => onChange(e.target.value)}
placeholder={
isMd
- ? "Write markdown content..."
- : "File content..."
+ ? t(($) => $.file_viewer.markdown_placeholder)
+ : t(($) => $.file_viewer.raw_placeholder)
}
className="h-full min-h-full resize-none rounded-none border-0 font-mono text-sm leading-relaxed focus-visible:ring-0"
/>
diff --git a/packages/views/skills/components/runtime-local-skill-import-panel.test.tsx b/packages/views/skills/components/runtime-local-skill-import-panel.test.tsx
index 77f311ee65..b2739132cf 100644
--- a/packages/views/skills/components/runtime-local-skill-import-panel.test.tsx
+++ b/packages/views/skills/components/runtime-local-skill-import-panel.test.tsx
@@ -1,8 +1,16 @@
// @vitest-environment jsdom
+import type { ReactNode } from "react";
import { describe, it, expect, vi, beforeEach } from "vitest";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
+import { I18nProvider } from "@multica/core/i18n/react";
+import enCommon from "../../locales/en/common.json";
+import enSkills from "../../locales/en/skills.json";
+
+const TEST_RESOURCES = {
+ en: { common: enCommon, skills: enSkills },
+};
const mockResolveRuntimeLocalSkillImport = vi.hoisted(() => vi.fn());
const mockRuntimeListOptions = vi.hoisted(() => vi.fn());
@@ -41,14 +49,24 @@ vi.mock("sonner", () => ({
import { RuntimeLocalSkillImportPanel } from "./runtime-local-skill-import-panel";
+function I18nWrapper({ children }: { children: ReactNode }) {
+ return (
+ <I18nProvider locale="en" resources={TEST_RESOURCES}>
+ {children}
+ </I18nProvider>
+ );
+}
+
function renderPanel() {
const queryClient = new QueryClient({
defaultOptions: { queries: { retry: false } },
});
return render(
- <QueryClientProvider client={queryClient}>
- <RuntimeLocalSkillImportPanel />
- </QueryClientProvider>,
+ <I18nWrapper>
+ <QueryClientProvider client={queryClient}>
+ <RuntimeLocalSkillImportPanel />
+ </QueryClientProvider>
+ </I18nWrapper>,
);
}
diff --git a/packages/views/skills/components/runtime-local-skill-import-panel.tsx b/packages/views/skills/components/runtime-local-skill-import-panel.tsx
index 98e8d4a197..9f8f0d5a05 100644
--- a/packages/views/skills/components/runtime-local-skill-import-panel.tsx
+++ b/packages/views/skills/components/runtime-local-skill-import-panel.tsx
@@ -35,6 +35,7 @@ import { Skeleton } from "@multica/ui/components/ui/skeleton";
import { Textarea } from "@multica/ui/components/ui/textarea";
import { useScrollFade } from "@multica/ui/hooks/use-scroll-fade";
import { toast } from "sonner";
+import { useT } from "../../i18n";
function runtimeLabel(runtime: AgentRuntime): string {
return `${runtime.name} (${runtime.provider})`;
@@ -61,6 +62,7 @@ function SkillItem({
onNameChange: (v: string) => void;
onDescriptionChange: (v: string) => void;
}) {
+ const { t } = useT("skills");
return (
<div
className={`overflow-hidden rounded-lg border transition-colors ${
@@ -90,7 +92,7 @@ function SkillItem({
</p>
</div>
<Badge variant="outline" className="shrink-0">
- {skill.file_count} file{skill.file_count === 1 ? "" : "s"}
+ {t(($) => $.runtime_import.skill_files, { count: skill.file_count })}
</Badge>
</button>
@@ -98,7 +100,7 @@ function SkillItem({
<div className="space-y-2.5 border-t bg-card px-4 py-3">
<div className="space-y-1">
<Label className="text-xs text-muted-foreground">
- Workspace skill name
+ {t(($) => $.runtime_import.skill_name_label)}
</Label>
<Input
value={name}
@@ -109,12 +111,12 @@ function SkillItem({
</div>
<div className="space-y-1">
<Label className="text-xs text-muted-foreground">
- Description
+ {t(($) => $.runtime_import.skill_description_label)}
</Label>
<Textarea
value={description}
onChange={(e) => onDescriptionChange(e.target.value)}
- placeholder="Optional — describe when an agent should use this skill."
+ placeholder={t(($) => $.runtime_import.skill_description_placeholder)}
rows={2}
className="resize-none text-sm"
/>
@@ -126,11 +128,7 @@ function SkillItem({
}
// ---------------------------------------------------------------------------
-// Panel — three-section layout: sticky top / scrollable middle / sticky bottom
-//
-// Previously took an `active` prop to defer work inside a tabbed parent; the
-// parent now unmounts the panel when it's not the active method, so `active`
-// is always implicitly true here.
+// Panel
// ---------------------------------------------------------------------------
export function RuntimeLocalSkillImportPanel({
@@ -138,12 +136,12 @@ export function RuntimeLocalSkillImportPanel({
}: {
onImported?: (skill: Skill) => void;
}) {
+ const { t } = useT("skills");
const wsId = useWorkspaceId();
const qc = useQueryClient();
const userId = useAuthStore((s) => s.user?.id ?? null);
const { data: runtimes = [] } = useQuery(runtimeListOptions(wsId));
- // Only the runtime owner can browse + import local skills (server-side ACL).
const localRuntimes = useMemo(
() =>
runtimes.filter(
@@ -160,15 +158,10 @@ export function RuntimeLocalSkillImportPanel({
const [description, setDescription] = useState("");
const [importing, setImporting] = useState(false);
- // Default to the first local runtime once the list lands.
useEffect(() => {
setSelectedRuntimeId((prev) => prev || localRuntimes[0]?.id || "");
}, [localRuntimes]);
- // Switching runtimes: clear the stale skill selection immediately so the
- // old highlight / inline editor don't flash during the next query's fetch
- // window. The auto-seed effect below picks the new first-skill once the
- // scan lands.
useEffect(() => {
setSelectedSkillKey("");
setName("");
@@ -188,8 +181,6 @@ export function RuntimeLocalSkillImportPanel({
);
const selectedSkill = runtimeSkills.find((s) => s.key === selectedSkillKey);
- // After a scan, auto-select the first skill so the Import button has a
- // valid target without requiring a click.
useEffect(() => {
if (runtimeSkills.length === 0) return;
if (runtimeSkills.some((s) => s.key === selectedSkillKey)) return;
@@ -214,7 +205,6 @@ export function RuntimeLocalSkillImportPanel({
name: name.trim() || undefined,
description: description.trim() || undefined,
});
- // Seed the detail cache so navigation lands with data pre-populated.
qc.setQueryData(
skillDetailOptions(wsId, result.skill.id).queryKey,
result.skill,
@@ -226,11 +216,11 @@ export function RuntimeLocalSkillImportPanel({
qc.invalidateQueries({ queryKey: workspaceKeys.skills(wsId) }),
qc.invalidateQueries({ queryKey: workspaceKeys.agents(wsId) }),
]);
- toast.success("Skill imported");
+ toast.success(t(($) => $.runtime_import.toast_imported));
onImported?.(result.skill);
} catch (error) {
toast.error(
- error instanceof Error ? error.message : "Failed to import skill",
+ error instanceof Error ? error.message : t(($) => $.runtime_import.toast_import_failed),
);
} finally {
setImporting(false);
@@ -244,20 +234,18 @@ export function RuntimeLocalSkillImportPanel({
!!name.trim() &&
!importing;
- // --- Scroll fade for the middle region ---
const scrollRef = useRef<HTMLDivElement>(null);
const fadeStyle = useScrollFade(scrollRef);
- // --- Middle body — depends on discovery state ---
const middle = (() => {
if (localRuntimes.length === 0) {
return (
<div className="rounded-lg border border-dashed px-4 py-10 text-center">
<p className="text-sm text-muted-foreground">
- No local runtimes available
+ {t(($) => $.runtime_import.no_local_runtimes_title)}
</p>
<p className="mt-1 text-xs text-muted-foreground">
- Connect a local runtime to browse and import its local skills.
+ {t(($) => $.runtime_import.no_local_runtimes_hint)}
</p>
</div>
);
@@ -266,7 +254,7 @@ export function RuntimeLocalSkillImportPanel({
return (
<div className="rounded-lg border border-dashed px-4 py-10 text-center">
<p className="text-sm text-muted-foreground">
- Choose a runtime to continue
+ {t(($) => $.runtime_import.choose_runtime)}
</p>
</div>
);
@@ -275,7 +263,7 @@ export function RuntimeLocalSkillImportPanel({
return (
<div className="flex items-start gap-2 rounded-md bg-warning/10 px-3 py-2 text-xs text-muted-foreground">
<AlertCircle className="mt-0.5 h-3.5 w-3.5 shrink-0 text-warning" />
- Runtime must be online to browse local skills.
+ {t(($) => $.runtime_import.must_be_online)}
</div>
);
}
@@ -297,7 +285,7 @@ export function RuntimeLocalSkillImportPanel({
<AlertCircle className="mt-0.5 h-3.5 w-3.5 shrink-0" />
{skillsQuery.error instanceof Error
? skillsQuery.error.message
- : "Failed to load runtime local skills"}
+ : t(($) => $.runtime_import.load_failed)}
</div>
);
}
@@ -305,16 +293,18 @@ export function RuntimeLocalSkillImportPanel({
return (
<div className="flex items-start gap-2 rounded-md bg-muted/50 px-3 py-2 text-xs text-muted-foreground">
<AlertCircle className="mt-0.5 h-3.5 w-3.5 shrink-0" />
- This runtime provider does not expose local skill inventory yet.
+ {t(($) => $.runtime_import.not_supported)}
</div>
);
}
if (runtimeSkills.length === 0) {
return (
<div className="rounded-lg border border-dashed px-4 py-10 text-center">
- <p className="text-sm text-muted-foreground">No local skills found</p>
+ <p className="text-sm text-muted-foreground">
+ {t(($) => $.runtime_import.no_skills_title)}
+ </p>
<p className="mt-1 text-xs text-muted-foreground">
- This runtime does not have any discoverable local skills yet.
+ {t(($) => $.runtime_import.no_skills_hint)}
</p>
</div>
);
@@ -341,21 +331,21 @@ export function RuntimeLocalSkillImportPanel({
<div className="flex min-h-0 flex-1 flex-col">
{/* Sticky top: runtime picker + status */}
<div
- // While importing, lock the whole runtime/skill selection so the user
- // can't switch targets out from under the in-flight request.
aria-disabled={importing || undefined}
className={`shrink-0 space-y-2 border-b px-5 py-3 ${
importing ? "pointer-events-none opacity-60" : ""
}`}
>
<div className="space-y-1.5">
- <Label className="text-xs text-muted-foreground">Runtime</Label>
+ <Label className="text-xs text-muted-foreground">
+ {t(($) => $.runtime_import.runtime_label)}
+ </Label>
<Select
value={selectedRuntimeId}
onValueChange={(v) => v && setSelectedRuntimeId(v)}
>
<SelectTrigger className="w-full">
- <SelectValue placeholder="Select a local runtime">
+ <SelectValue placeholder={t(($) => $.runtime_import.runtime_placeholder)}>
{selectedRuntime ? runtimeLabel(selectedRuntime) : null}
</SelectValue>
</SelectTrigger>
@@ -386,7 +376,7 @@ export function RuntimeLocalSkillImportPanel({
)}
</div>
- {/* Scrollable middle — also locked during import. */}
+ {/* Scrollable middle */}
<div
ref={scrollRef}
style={fadeStyle}
@@ -397,8 +387,7 @@ export function RuntimeLocalSkillImportPanel({
>
{middle}
<p className="mt-3 text-xs text-muted-foreground">
- Symlinks, unreadable files, oversized files, and very large bundles
- are ignored during import.
+ {t(($) => $.runtime_import.ignored_files_hint)}
</p>
</div>
@@ -407,14 +396,14 @@ export function RuntimeLocalSkillImportPanel({
<div className="min-w-0 flex-1 text-xs text-muted-foreground">
{selectedSkill ? (
<>
- Ready to import{" "}
+ {t(($) => $.runtime_import.ready)}{" "}
<span className="font-medium text-foreground">
{name.trim() || selectedSkill.name}
</span>{" "}
- into this workspace.
+ {t(($) => $.runtime_import.into_workspace)}
</>
) : (
- "Select a skill to continue."
+ t(($) => $.runtime_import.select_skill)
)}
</div>
<Button
@@ -426,12 +415,12 @@ export function RuntimeLocalSkillImportPanel({
{importing ? (
<>
<Loader2 className="h-3 w-3 animate-spin" />
- Importing…
+ {t(($) => $.runtime_import.importing)}
</>
) : (
<>
<Download className="h-3 w-3" />
- Import to Workspace
+ {t(($) => $.runtime_import.import_button)}
</>
)}
</Button>
diff --git a/packages/views/skills/components/skill-columns.tsx b/packages/views/skills/components/skill-columns.tsx
index 8c2c4baf1e..b36028245b 100644
--- a/packages/views/skills/components/skill-columns.tsx
+++ b/packages/views/skills/components/skill-columns.tsx
@@ -23,6 +23,7 @@ import {
TooltipTrigger,
} from "@multica/ui/components/ui/tooltip";
import { readOrigin, totalFileCount } from "../lib/origin";
+import { useT } from "../../i18n";
// Per-row data assembled at the page level. The columns reach into
// `row.original` and never pull their own queries.
@@ -36,45 +37,36 @@ export interface SkillRow {
canEdit: boolean;
}
-// Column widths in px. Both Name and Source carry `meta.grow: true`,
-// so DataTable skips their inline widths and fixed table-layout splits
-// the leftover space between them equally — a single grow column would
-// dump all the slack into the Name column, leaving Source perpetually
-// truncated while Name accumulates wasteful right-side whitespace.
-//
-// Each column's `size` is its floor: the values still flow into
-// table.getTotalSize() and become the table's min-width, so when the
-// viewport drops below the sum, the container scrolls horizontally
-// instead of letting either column shrink past its floor.
const COL_WIDTHS = {
name: 240,
usedBy: 140,
source: 220,
updated: 100,
- // 48 = 16 left padding + 16 chevron icon + 16 right padding. Keeps
- // the chevron's right edge 16px from the card so it lines up with
- // the toolbar's px-4 right inset.
chevron: 48,
} as const;
-export function createSkillColumns(): ColumnDef<SkillRow>[] {
+// Hook returns column defs that close over a translation function. Defining
+// columns inside a hook (rather than as a module-level static) is the i18n
+// price for header strings — same pattern used by inbox `useTypeLabels`.
+export function useSkillColumns(): ColumnDef<SkillRow>[] {
+ const { t } = useT("skills");
return [
{
id: "name",
- header: "Name",
+ header: t(($) => $.table.name),
size: COL_WIDTHS.name,
meta: { grow: true },
cell: ({ row }) => <SkillNameCell row={row.original} />,
},
{
id: "usedBy",
- header: "Used by",
+ header: t(($) => $.table.used_by),
size: COL_WIDTHS.usedBy,
cell: ({ row }) => <AgentAssignees agents={row.original.agents} />,
},
{
id: "source",
- header: "Source · Added by",
+ header: t(($) => $.table.source),
size: COL_WIDTHS.source,
meta: { grow: true },
cell: ({ row }) => (
@@ -87,7 +79,7 @@ export function createSkillColumns(): ColumnDef<SkillRow>[] {
},
{
id: "updated",
- header: "Updated",
+ header: t(($) => $.table.updated),
size: COL_WIDTHS.updated,
cell: ({ row }) => (
<span className="whitespace-nowrap text-xs text-muted-foreground">
@@ -96,9 +88,6 @@ export function createSkillColumns(): ColumnDef<SkillRow>[] {
),
},
{
- // Trailing chevron — purely a "this row is clickable" affordance,
- // matches the convention from the pre-data-table SkillRow. The
- // colour deepens on row hover via the row's `group` class.
id: "_chevron",
header: () => null,
size: COL_WIDTHS.chevron,
@@ -115,6 +104,7 @@ export function createSkillColumns(): ColumnDef<SkillRow>[] {
// ---------------------------------------------------------------------------
function SkillNameCell({ row }: { row: SkillRow }) {
+ const { t } = useT("skills");
const { skill, canEdit } = row;
return (
<div className="min-w-0">
@@ -128,7 +118,7 @@ function SkillNameCell({ row }: { row: SkillRow }) {
}
/>
<TooltipContent>
- Read-only — only creator or admin can edit
+ {t(($) => $.table.lock_tooltip)}
</TooltipContent>
</Tooltip>
)}
@@ -137,11 +127,6 @@ function SkillNameCell({ row }: { row: SkillRow }) {
{totalFileCount(skill)}
</span>
</div>
- {/* `max-w-xl` (36rem) caps how wide the description gets on
- large viewports. The Name column is `meta.grow`, so on a
- 24" desktop it can balloon past 800px — without this cap,
- a long single-line description would stretch all the way
- across, reading more like a paragraph than a table cell. */}
<div
className={`mt-0.5 max-w-xl truncate text-xs ${
skill.description
@@ -149,15 +134,16 @@ function SkillNameCell({ row }: { row: SkillRow }) {
: "italic text-muted-foreground/50"
}`}
>
- {skill.description || "No description"}
+ {skill.description || t(($) => $.table.no_description)}
</div>
</div>
);
}
function AgentAssignees({ agents }: { agents: Agent[] }) {
+ const { t } = useT("skills");
if (agents.length === 0) {
- return <span className="text-xs text-muted-foreground/70">— unused</span>;
+ return <span className="text-xs text-muted-foreground/70">{t(($) => $.table.unused)}</span>;
}
const visible = agents.slice(0, 3);
const extra = agents.length - visible.length;
@@ -199,23 +185,24 @@ function SourceCell({
creator: MemberWithUser | null;
runtime: AgentRuntime | null;
}) {
+ const { t } = useT("skills");
const origin = readOrigin(skill);
let icon = <Pencil className="h-3 w-3 shrink-0" />;
- let label = "Created manually";
+ let label: string = t(($) => $.table.source_manual);
if (origin.type === "runtime_local") {
icon = <HardDrive className="h-3 w-3 shrink-0" />;
label = runtime
- ? `From ${runtime.name}`
+ ? t(($) => $.table.source_runtime_named, { name: runtime.name })
: origin.provider
- ? `From ${origin.provider} runtime`
- : "From a runtime";
+ ? t(($) => $.table.source_runtime_provider, { provider: origin.provider })
+ : t(($) => $.table.source_runtime_unknown);
} else if (origin.type === "clawhub") {
icon = <Download className="h-3 w-3 shrink-0" />;
- label = "From ClawHub";
+ label = t(($) => $.table.source_clawhub);
} else if (origin.type === "skills_sh") {
icon = <Download className="h-3 w-3 shrink-0" />;
- label = "From Skills.sh";
+ label = t(($) => $.table.source_skills_sh);
}
return (
@@ -232,7 +219,7 @@ function SourceCell({
avatarUrl={creator.avatar_url}
size={14}
/>
- <span className="truncate">by {creator.name}</span>
+ <span className="truncate">{t(($) => $.table.by_creator, { name: creator.name })}</span>
</div>
)}
</div>
diff --git a/packages/views/skills/components/skill-detail-page.tsx b/packages/views/skills/components/skill-detail-page.tsx
index 692b9c3669..d6070586fa 100644
--- a/packages/views/skills/components/skill-detail-page.tsx
+++ b/packages/views/skills/components/skill-detail-page.tsx
@@ -63,6 +63,7 @@ import { CapabilityBanner } from "@multica/ui/components/common/capability-banne
import { readOrigin, totalFileCount, type OriginInfo } from "../lib/origin";
import { FileTree } from "./file-tree";
import { FileViewer } from "./file-viewer";
+import { useT } from "../../i18n";
const SKILL_MD = "SKILL.md";
@@ -72,14 +73,17 @@ type DraftFile = { id?: string; path: string; content: string };
// File path validation + inline add
// ---------------------------------------------------------------------------
-function validateNewFilePath(path: string, existing: string[]): string {
- const p = path.trim();
- if (!p) return "Path cannot be empty.";
- if (p.startsWith("/")) return "Absolute paths are not allowed.";
- if (p.split("/").includes("..")) return 'Paths cannot contain "..".';
- if (p === SKILL_MD) return "SKILL.md is reserved for the main file.";
- if (existing.includes(p)) return "A file at this path already exists.";
- return "";
+function useValidateNewFilePath() {
+ const { t } = useT("skills");
+ return (path: string, existing: string[]): string => {
+ const p = path.trim();
+ if (!p) return t(($) => $.detail.add_file.errors.empty);
+ if (p.startsWith("/")) return t(($) => $.detail.add_file.errors.absolute);
+ if (p.split("/").includes("..")) return t(($) => $.detail.add_file.errors.double_dot);
+ if (p === SKILL_MD) return t(($) => $.detail.add_file.errors.reserved);
+ if (existing.includes(p)) return t(($) => $.detail.add_file.errors.exists);
+ return "";
+ };
}
function AddFileInline({
@@ -91,11 +95,13 @@ function AddFileInline({
onAdd: (path: string) => void;
onCancel: () => void;
}) {
+ const { t } = useT("skills");
+ const validate = useValidateNewFilePath();
const [path, setPath] = useState("");
const [error, setError] = useState("");
const submit = () => {
- const err = validateNewFilePath(path, existingPaths);
+ const err = validate(path, existingPaths);
if (err) {
setError(err);
return;
@@ -116,7 +122,7 @@ function AddFileInline({
if (e.key === "Enter") submit();
if (e.key === "Escape") onCancel();
}}
- placeholder="templates/review.md"
+ placeholder={t(($) => $.detail.add_file.placeholder)}
className="h-7 font-mono text-xs"
/>
{error && (
@@ -126,10 +132,10 @@ function AddFileInline({
)}
<div className="mt-1.5 flex items-center gap-1.5">
<Button type="button" size="xs" onClick={submit}>
- Add
+ {t(($) => $.detail.add_file.add)}
</Button>
<Button type="button" size="xs" variant="ghost" onClick={onCancel}>
- Cancel
+ {t(($) => $.detail.add_file.cancel)}
</Button>
</div>
</div>
@@ -141,11 +147,11 @@ function AddFileInline({
// ---------------------------------------------------------------------------
function UsedBySection({ agents }: { agents: Agent[] }) {
+ const { t } = useT("skills");
if (agents.length === 0) {
return (
<div className="rounded-md border border-dashed px-3 py-4 text-center text-xs text-muted-foreground">
- Not assigned to any agent yet. Open an agent&rsquo;s Skills tab to
- assign.
+ {t(($) => $.detail.sidebar.used_by_empty)}
</div>
);
}
@@ -184,15 +190,16 @@ function OriginSidebarCard({
origin: OriginInfo;
runtime: AgentRuntime | null;
}) {
+ const { t } = useT("skills");
if (origin.type === "manual") return null;
const isRuntime = origin.type === "runtime_local";
const label =
origin.type === "runtime_local"
- ? "Imported from local runtime"
+ ? t(($) => $.detail.origin_card.imported_runtime)
: origin.type === "clawhub"
- ? "Imported from ClawHub"
- : "Imported from Skills.sh";
+ ? t(($) => $.detail.origin_card.imported_clawhub)
+ : t(($) => $.detail.origin_card.imported_skills_sh);
return (
<div className="rounded-md border bg-muted/30 p-3">
@@ -221,7 +228,7 @@ function OriginSidebarCard({
)}
{origin.provider && (
<div className="mt-1 font-mono text-xs text-muted-foreground">
- provider · {origin.provider}
+ {t(($) => $.detail.origin_card.provider, { provider: origin.provider })}
</div>
)}
</div>
@@ -233,6 +240,7 @@ function OriginSidebarCard({
// ---------------------------------------------------------------------------
export function SkillDetailPage({ skillId }: { skillId: string }) {
+ const { t } = useT("skills");
const wsId = useWorkspaceId();
const qc = useQueryClient();
const paths = useWorkspacePaths();
@@ -253,16 +261,12 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
runtimeListOptions(wsId),
);
- // Build the skillId → agents map once per agent-list identity, not on every
- // render — see selectSkillAssignments' doc comment.
const assignments = useMemo(
() => selectSkillAssignments(agents),
[agents],
);
const canEdit = useCanEditSkill(skill, wsId);
- // Rich Decision for the read-only banner — same answer as `canEdit`, but
- // carries the `reason` enum the banner needs to render correct copy.
const skillPermissions = useSkillPermissions(skill ?? null, wsId);
const [name, setName] = useState("");
@@ -274,24 +278,13 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
const [deleting, setDeleting] = useState(false);
const [confirmDelete, setConfirmDelete] = useState(false);
const [addingFile, setAddingFile] = useState(false);
- // When a WS refetch lands newer server state while we have in-progress
- // edits, we surface a banner instead of silently clobbering the draft.
const [conflictPending, setConflictPending] = useState(false);
- // Ref to latest draft — lets the seeding effect decide whether user has
- // in-progress edits without itself depending on draft state (which would
- // fire the effect on every keystroke).
const draftRef = useRef({ name, description, content, files });
draftRef.current = { name, description, content, files };
- // Tracks `${wsId}:${id}@${updated_at}` we last seeded from. `wsId` guards
- // against the rare cross-workspace race where `skillId` collides across
- // workspaces (same UUID wouldn't in practice, but the scope is correct).
const seededKeyRef = useRef<string | null>(null);
- // Seed draft from server state. Preserves in-progress edits when a WS
- // invalidation refetches the same skill; surfaces a conflict banner if
- // server state has drifted under unedited-yet-mid-edit conditions.
useEffect(() => {
if (!skill) return;
const key = `${wsId}:${skill.id}@${skill.updated_at}`;
@@ -367,9 +360,6 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
const filePaths = useMemo(() => Array.from(fileMap.keys()), [fileMap]);
const selectedContent = fileMap.get(selectedPath) ?? "";
- // If the selected file disappeared (user deleted it, or WS refresh removed
- // it), jump back to SKILL.md so the viewer never shows an empty body with
- // a ghost path label.
useEffect(() => {
if (selectedPath !== SKILL_MD && !fileMap.has(selectedPath)) {
setSelectedPath(SKILL_MD);
@@ -417,10 +407,6 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
files: files.filter((f) => f.path.trim()),
};
const updated = await api.updateSkill(skill.id, payload);
- // Seed local state + cache with the authoritative server response so
- // draft → clean transition is immediate. Syncs ALL fields (not just
- // name/desc) — otherwise server-side normalization of content/files
- // would leave isDirty stuck at true.
qc.setQueryData(
skillDetailOptions(wsId, skill.id).queryKey,
updated,
@@ -428,18 +414,14 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
seedFromSkill(updated);
seededKeyRef.current = `${wsId}:${updated.id}@${updated.updated_at}`;
setConflictPending(false);
- // Invalidate list (list rows carry `updated_at`, name, description) AND
- // agents (each agent inlines its `skills` array, so a rename here must
- // sync there too). `exact: true` on skills keeps the detail cache we
- // just wrote from getting re-fetched.
qc.invalidateQueries({
queryKey: workspaceKeys.skills(wsId),
exact: true,
});
qc.invalidateQueries({ queryKey: workspaceKeys.agents(wsId) });
- toast.success("Skill saved");
+ toast.success(t(($) => $.detail.toast_saved));
} catch (err) {
- toast.error(err instanceof Error ? err.message : "Failed to save skill");
+ toast.error(err instanceof Error ? err.message : t(($) => $.detail.toast_save_failed));
} finally {
setSaving(false);
}
@@ -457,20 +439,16 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
setDeleting(true);
try {
await api.deleteSkill(skill.id);
- // Navigate first so the detail route unmounts BEFORE invalidation
- // refetches the now-404 row — otherwise users see a "Skill not found"
- // flash. Deleting also cascade-removes junction rows on the server,
- // so agents cache must refresh too.
navigation.replace(paths.skills());
qc.removeQueries({
queryKey: skillDetailOptions(wsId, skill.id).queryKey,
});
qc.invalidateQueries({ queryKey: workspaceKeys.skills(wsId) });
qc.invalidateQueries({ queryKey: workspaceKeys.agents(wsId) });
- toast.success("Skill deleted");
+ toast.success(t(($) => $.detail.toast_deleted));
} catch (err) {
toast.error(
- err instanceof Error ? err.message : "Failed to delete skill",
+ err instanceof Error ? err.message : t(($) => $.detail.toast_delete_failed),
);
setDeleting(false);
setConfirmDelete(false);
@@ -532,22 +510,20 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
render={<AppLink href={paths.skills()} />}
>
<ArrowLeft className="h-3 w-3" />
- All skills
+ {t(($) => $.detail.all_skills)}
</Button>
</div>
<div className="flex flex-1 flex-col items-center justify-center gap-2 text-center">
<AlertCircle className="h-8 w-8 text-muted-foreground/40" />
- <p className="text-sm font-medium">Skill not found</p>
+ <p className="text-sm font-medium">{t(($) => $.detail.not_found.title)}</p>
<p className="max-w-xs text-xs text-muted-foreground">
- {error instanceof Error
- ? error.message
- : "This skill may have been deleted or you lost access."}
+ {error instanceof Error ? error.message : t(($) => $.detail.not_found.fallback)}
</p>
<AppLink
href={paths.skills()}
className={`${buttonVariants({ variant: "outline", size: "xs" })} mt-2`}
>
- Back to Skills
+ {t(($) => $.detail.not_found.back)}
</AppLink>
</div>
</div>
@@ -559,14 +535,14 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
if (!origin) return null;
if (origin.type === "runtime_local") {
return originRuntime
- ? `Local runtime · ${originRuntime.name}`
+ ? t(($) => $.detail.subline.origin_runtime_named, { name: originRuntime.name })
: origin.provider
- ? `Local runtime · ${origin.provider}`
- : "Local runtime";
+ ? t(($) => $.detail.subline.origin_runtime_provider, { provider: origin.provider })
+ : t(($) => $.detail.subline.origin_runtime_unknown);
}
- if (origin.type === "clawhub") return "Imported · ClawHub";
- if (origin.type === "skills_sh") return "Imported · Skills.sh";
- return "Workspace";
+ if (origin.type === "clawhub") return t(($) => $.detail.subline.origin_clawhub);
+ if (origin.type === "skills_sh") return t(($) => $.detail.subline.origin_skills_sh);
+ return t(($) => $.detail.subline.origin_workspace);
})();
return (
@@ -579,7 +555,7 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
render={<AppLink href={paths.skills()} />}
>
<ArrowLeft className="h-3 w-3" />
- All skills
+ {t(($) => $.detail.all_skills)}
</Button>
<ChevronRight className="h-3 w-3 text-muted-foreground" />
<span className="truncate font-mono text-xs text-foreground">
@@ -589,7 +565,7 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
{!canEdit && (
<span className="inline-flex items-center gap-1 text-xs text-muted-foreground">
<Lock className="h-3 w-3" />
- Read-only
+ {t(($) => $.detail.read_only)}
</span>
)}
{canEdit && (
@@ -601,13 +577,13 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
size="icon-sm"
onClick={() => setConfirmDelete(true)}
className="text-muted-foreground hover:text-destructive"
- aria-label="Delete skill"
+ aria-label={t(($) => $.detail.delete_aria)}
>
<Trash2 className="h-3.5 w-3.5" />
</Button>
}
/>
- <TooltipContent>Delete skill</TooltipContent>
+ <TooltipContent>{t(($) => $.detail.delete_tooltip)}</TooltipContent>
</Tooltip>
)}
</div>
@@ -623,20 +599,13 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
</div>
)}
- {/* Supporting query error banner (non-blocking — the page still works
- but agent attribution / runtime names / permission checks are
- partial). */}
{supportingQueryDown && (
<div
role="status"
className="flex shrink-0 items-start gap-2 border-b bg-warning/10 px-4 py-2 text-xs text-muted-foreground"
>
<AlertTriangle className="mt-0.5 h-3.5 w-3.5 shrink-0 text-warning" />
- <span>
- Some workspace data failed to load. Creator attribution, runtime
- names, or edit permissions may appear incomplete until the next
- refresh.
- </span>
+ <span>{t(($) => $.detail.supporting_data_warning)}</span>
</div>
)}
@@ -646,7 +615,7 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
<aside className="flex w-56 shrink-0 flex-col border-r">
<div className="flex h-10 shrink-0 items-center justify-between border-b px-3">
<span className="text-xs font-medium uppercase tracking-wider text-muted-foreground">
- Files · {totalFileCount(skill)}
+ {t(($) => $.detail.files_label, { count: totalFileCount(skill) })}
</span>
{canEdit && (
<Tooltip>
@@ -658,13 +627,13 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
size="icon-sm"
onClick={() => setAddingFile(true)}
className="text-muted-foreground"
- aria-label="Add file"
+ aria-label={t(($) => $.detail.add_file_aria)}
>
<Plus className="h-3.5 w-3.5" />
</Button>
}
/>
- <TooltipContent>Add file</TooltipContent>
+ <TooltipContent>{t(($) => $.detail.add_file_tooltip)}</TooltipContent>
</Tooltip>
)}
</div>
@@ -692,7 +661,7 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
className="text-muted-foreground hover:text-destructive"
>
<Trash2 className="h-3 w-3" />
- Delete file
+ {t(($) => $.detail.delete_file)}
</Button>
</div>
)}
@@ -706,9 +675,9 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
value={name}
readOnly={!canEdit}
onChange={(e) => setName(e.target.value)}
- placeholder="skill-name"
+ placeholder={t(($) => $.detail.name_placeholder)}
className="h-9 border-0 bg-transparent px-0 text-lg font-semibold shadow-none focus-visible:ring-0 read-only:cursor-default"
- aria-label="Skill name"
+ aria-label={t(($) => $.detail.name_aria)}
/>
<div className="space-y-1">
<Label
@@ -716,20 +685,18 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
className="text-xs text-muted-foreground"
>
<Pencil className="h-3 w-3" />
- Description
+ {t(($) => $.detail.description_label)}
</Label>
<Textarea
id="skill-description"
value={description}
readOnly={!canEdit}
onChange={(e) => setDescription(e.target.value)}
- placeholder="One sentence describing when an agent should use this skill…"
+ placeholder={t(($) => $.detail.description_placeholder)}
rows={2}
className="resize-none text-sm read-only:cursor-default"
/>
</div>
- {/* Subline: origin · updated · creator — each segment atomic so
- flex-wrap doesn't orphan the separators. */}
<div className="flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground">
{originLabel && (
<span className="inline-flex items-center gap-1">
@@ -743,7 +710,11 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
)}
<span className="inline-flex items-center gap-2">
<span aria-hidden>·</span>
- <span>Updated {timeAgo(skill.updated_at)}</span>
+ <span>
+ {t(($) => $.detail.subline.updated_label, {
+ when: timeAgo(skill.updated_at),
+ })}
+ </span>
</span>
{creator && (
<span className="inline-flex items-center gap-2">
@@ -755,15 +726,14 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
avatarUrl={creator.avatar_url}
size={14}
/>
- by {creator.name}
+ {t(($) => $.detail.subline.by_creator, { name: creator.name })}
</span>
</span>
)}
</div>
</div>
- {/* Conflict banner — surfaces when a WS refetch arrived with newer
- server state while the user had edits in flight. */}
+ {/* Conflict banner */}
{conflictPending && canEdit && (
<div
role="status"
@@ -773,11 +743,10 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
<AlertTriangle className="mt-0.5 h-3.5 w-3.5 shrink-0 text-warning" />
<div className="flex-1">
<div className="font-medium text-foreground">
- Someone else updated this skill
+ {t(($) => $.detail.conflict_banner.title)}
</div>
<div className="mt-0.5 text-muted-foreground">
- Your edits are preserved. Discard to pull their changes, or
- Save to overwrite.
+ {t(($) => $.detail.conflict_banner.body)}
</div>
</div>
</div>
@@ -802,7 +771,7 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
>
<span className="h-1.5 w-1.5 rounded-full bg-brand" />
<span className="text-xs text-muted-foreground">
- Unsaved changes — will overwrite the live skill on save
+ {t(($) => $.detail.save_bar.unsaved)}
</span>
<div className="ml-auto flex items-center gap-1.5">
<Button
@@ -811,7 +780,7 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
size="xs"
onClick={handleDiscard}
>
- Discard
+ {t(($) => $.detail.save_bar.discard)}
</Button>
<Button
type="button"
@@ -822,12 +791,12 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
{saving ? (
<>
<Loader2 className="h-3 w-3 animate-spin" />
- Saving…
+ {t(($) => $.detail.save_bar.saving)}
</>
) : (
<>
<Save className="h-3 w-3" />
- Save changes
+ {t(($) => $.detail.save_bar.save)}
</>
)}
</Button>
@@ -840,36 +809,46 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
<aside className="flex w-72 shrink-0 flex-col gap-4 overflow-y-auto border-l bg-muted/20 px-4 py-4">
<div>
<h3 className="mb-2 text-xs font-medium uppercase tracking-wider text-muted-foreground">
- Metadata
+ {t(($) => $.detail.sidebar.metadata)}
</h3>
<dl className="space-y-1.5 text-xs">
<div className="flex gap-2">
- <dt className="min-w-20 text-muted-foreground">Created</dt>
+ <dt className="min-w-20 text-muted-foreground">
+ {t(($) => $.detail.sidebar.created)}
+ </dt>
<dd className="min-w-0 flex-1">
{timeAgo(skill.created_at)}
</dd>
</div>
<div className="flex gap-2">
- <dt className="min-w-20 text-muted-foreground">Updated</dt>
+ <dt className="min-w-20 text-muted-foreground">
+ {t(($) => $.detail.sidebar.updated)}
+ </dt>
<dd className="min-w-0 flex-1">
{timeAgo(skill.updated_at)}
</dd>
</div>
{creator && (
<div className="flex gap-2">
- <dt className="min-w-20 text-muted-foreground">Created by</dt>
+ <dt className="min-w-20 text-muted-foreground">
+ {t(($) => $.detail.sidebar.created_by)}
+ </dt>
<dd className="min-w-0 flex-1">{creator.name}</dd>
</div>
)}
<div className="flex gap-2">
- <dt className="min-w-20 text-muted-foreground">Files</dt>
+ <dt className="min-w-20 text-muted-foreground">
+ {t(($) => $.detail.sidebar.files)}
+ </dt>
<dd className="min-w-0 flex-1">{totalFileCount(skill)}</dd>
</div>
<div
className="flex gap-2"
title={skill.id}
>
- <dt className="min-w-20 text-muted-foreground">ID</dt>
+ <dt className="min-w-20 text-muted-foreground">
+ {t(($) => $.detail.sidebar.id)}
+ </dt>
<dd className="min-w-0 flex-1 truncate font-mono text-muted-foreground">
{skill.id.slice(0, 8)}…
</dd>
@@ -880,7 +859,7 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
{origin && origin.type !== "manual" && (
<div>
<h3 className="mb-2 text-xs font-medium uppercase tracking-wider text-muted-foreground">
- Origin
+ {t(($) => $.detail.sidebar.origin)}
</h3>
<OriginSidebarCard origin={origin} runtime={originRuntime} />
</div>
@@ -888,20 +867,21 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
<div>
<h3 className="mb-2 text-xs font-medium uppercase tracking-wider text-muted-foreground">
- Used by {skillAgents.length} agent
- {skillAgents.length === 1 ? "" : "s"}
+ {t(($) => $.detail.sidebar.used_by, { count: skillAgents.length })}
</h3>
<UsedBySection agents={skillAgents} />
</div>
<div>
<h3 className="mb-2 text-xs font-medium uppercase tracking-wider text-muted-foreground">
- Permissions
+ {t(($) => $.detail.sidebar.permissions)}
</h3>
<p className="text-xs leading-relaxed text-muted-foreground">
{canEdit
- ? "You can edit and delete this skill. Changes take effect on the next agent run."
- : `Only the creator${creator ? ` (${creator.name})` : ""} or a workspace admin can edit this skill.`}
+ ? t(($) => $.detail.sidebar.permissions_owner)
+ : creator
+ ? t(($) => $.detail.sidebar.permissions_locked_creator, { name: creator.name })
+ : t(($) => $.detail.sidebar.permissions_locked)}
</p>
</div>
</aside>
@@ -916,17 +896,20 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
>
<DialogContent className="sm:max-w-md">
<DialogHeader>
- <DialogTitle>Delete skill?</DialogTitle>
+ <DialogTitle>{t(($) => $.detail.delete_dialog.title)}</DialogTitle>
<DialogDescription>
- This will permanently delete &ldquo;{skill.name}&rdquo; and remove
- it from{" "}
{skillAgents.length > 0
- ? `${skillAgents.length} agent${skillAgents.length === 1 ? "" : "s"} currently using it.`
- : "all agents."}
+ ? t(($) => $.detail.delete_dialog.description_with_agents, {
+ name: skill.name,
+ count: skillAgents.length,
+ })
+ : t(($) => $.detail.delete_dialog.description_no_agents, {
+ name: skill.name,
+ })}
</DialogDescription>
</DialogHeader>
<div className="rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive">
- This action cannot be undone.
+ {t(($) => $.detail.delete_dialog.warning)}
</div>
<DialogFooter>
<Button
@@ -935,7 +918,7 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
onClick={() => setConfirmDelete(false)}
disabled={deleting}
>
- Cancel
+ {t(($) => $.detail.delete_dialog.cancel)}
</Button>
<Button
type="button"
@@ -946,12 +929,12 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {
{deleting ? (
<>
<Loader2 className="h-3 w-3 animate-spin" />
- Deleting…
+ {t(($) => $.detail.delete_dialog.deleting)}
</>
) : (
<>
<Trash2 className="h-3 w-3" />
- Delete permanently
+ {t(($) => $.detail.delete_dialog.confirm)}
</>
)}
</Button>
diff --git a/packages/views/skills/components/skills-page.tsx b/packages/views/skills/components/skills-page.tsx
index c4b2c56938..2713fd4081 100644
--- a/packages/views/skills/components/skills-page.tsx
+++ b/packages/views/skills/components/skills-page.tsx
@@ -39,20 +39,12 @@ import { PageHeader } from "../../layout/page-header";
import { canEditSkill } from "../hooks/use-can-edit-skill";
import { readOrigin } from "../lib/origin";
import { CreateSkillDialog } from "./create-skill-dialog";
-import { type SkillRow, createSkillColumns } from "./skill-columns";
+import { type SkillRow, useSkillColumns } from "./skill-columns";
+import { useT } from "../../i18n";
type FilterKey = "all" | "used" | "unused" | "mine";
-// ---------------------------------------------------------------------------
-// Scope tab — matches Issues/MyIssues header pattern
-// ---------------------------------------------------------------------------
-
-const SCOPES: { value: FilterKey; label: string; description: string }[] = [
- { value: "all", label: "All", description: "All skills in this workspace" },
- { value: "used", label: "In use", description: "Skills assigned to at least one agent" },
- { value: "unused", label: "Unused", description: "Skills not assigned to any agent" },
- { value: "mine", label: "Created by me", description: "Skills you created" },
-];
+const SCOPE_KEYS: FilterKey[] = ["all", "used", "unused", "mine"];
// ---------------------------------------------------------------------------
// Page header bar — uses shared PageHeader so the mobile sidebar trigger and
@@ -66,42 +58,39 @@ function PageHeaderBar({
totalCount: number;
onCreate: () => void;
}) {
+ const { t } = useT("skills");
return (
<PageHeader className="justify-between px-5">
<div className="flex items-center gap-2">
<BookOpen className="h-4 w-4 text-muted-foreground" />
- <h1 className="text-sm font-medium">Skills</h1>
+ <h1 className="text-sm font-medium">{t(($) => $.page.title)}</h1>
{totalCount > 0 && (
<span className="font-mono text-xs tabular-nums text-muted-foreground/70">
{totalCount}
</span>
)}
- {/* Tagline next to the title — single sentence + docs link. Hidden
- below md so it never collides with the title on narrow screens. */}
<p className="ml-2 hidden text-xs text-muted-foreground md:block">
- Instructions any agent in this workspace can use.{" "}
+ {t(($) => $.page.tagline)}{" "}
<a
href="https://multica.ai/docs/skills"
target="_blank"
rel="noopener noreferrer"
className="underline decoration-muted-foreground/30 underline-offset-4 transition-colors hover:text-foreground"
>
- Learn more →
+ {t(($) => $.page.learn_more)}
</a>
</p>
</div>
<Button type="button" size="sm" onClick={onCreate}>
<Plus className="h-3 w-3" />
- New skill
+ {t(($) => $.page.new_skill)}
</Button>
</PageHeader>
);
}
// ---------------------------------------------------------------------------
-// Card toolbar — search + scope filters, kept inside the card because they
-// operate on the table content. Page-level actions (New skill) live in the
-// PageHeader instead.
+// Card toolbar — search + scope filters
// ---------------------------------------------------------------------------
function CardToolbar({
@@ -115,6 +104,7 @@ function CardToolbar({
filter: FilterKey;
setFilter: (v: FilterKey) => void;
}) {
+ const { t } = useT("skills");
return (
<div className="flex h-12 shrink-0 items-center gap-2 border-b px-4">
<div className="relative">
@@ -122,29 +112,31 @@ function CardToolbar({
<Input
value={search}
onChange={(e) => setSearch(e.target.value)}
- placeholder="Search skills…"
+ placeholder={t(($) => $.page.search_placeholder)}
className="h-8 w-64 pl-8 text-sm"
/>
</div>
- {SCOPES.map((s) => (
- <Tooltip key={s.value}>
+ {SCOPE_KEYS.map((scope) => (
+ <Tooltip key={scope}>
<TooltipTrigger
render={
<Button
variant="outline"
size="sm"
className={
- filter === s.value
+ filter === scope
? "bg-accent text-accent-foreground hover:bg-accent/80"
: "text-muted-foreground"
}
- onClick={() => setFilter(s.value)}
+ onClick={() => setFilter(scope)}
>
- {s.label}
+ {t(($) => $.page.scopes[scope].label)}
</Button>
}
/>
- <TooltipContent side="bottom">{s.description}</TooltipContent>
+ <TooltipContent side="bottom">
+ {t(($) => $.page.scopes[scope].description)}
+ </TooltipContent>
</Tooltip>
))}
</div>
@@ -156,19 +148,19 @@ function CardToolbar({
// ---------------------------------------------------------------------------
function EmptyState({ onCreate }: { onCreate: () => void }) {
+ const { t } = useT("skills");
return (
<div className="flex flex-1 flex-col items-center justify-center px-6 py-16 text-center">
<div className="flex h-12 w-12 items-center justify-center rounded-full bg-muted">
<BookOpen className="h-6 w-6 text-muted-foreground" />
</div>
- <h2 className="mt-4 text-base font-semibold">No skills yet</h2>
+ <h2 className="mt-4 text-base font-semibold">{t(($) => $.page.empty.title)}</h2>
<p className="mt-1 max-w-md text-sm text-muted-foreground">
- Create your first skill, import one from a URL, or copy one from a
- connected runtime — and every agent in the workspace can use it.
+ {t(($) => $.page.empty.description)}
</p>
<Button type="button" onClick={onCreate} size="sm" className="mt-5">
<Plus className="h-3 w-3" />
- New skill
+ {t(($) => $.page.new_skill)}
</Button>
</div>
);
@@ -179,6 +171,7 @@ function EmptyState({ onCreate }: { onCreate: () => void }) {
// ---------------------------------------------------------------------------
export default function SkillsPage() {
+ const { t } = useT("skills");
const wsId = useWorkspaceId();
const paths = useWorkspacePaths();
const navigation = useNavigation();
@@ -204,8 +197,6 @@ export default function SkillsPage() {
const [filter, setFilter] = useState<FilterKey>("all");
const [createOpen, setCreateOpen] = useState(false);
- // Derive assignments ONCE per agents-identity. Stable reference across
- // unrelated agent refetches — see selectSkillAssignments' doc.
const assignments = useMemo(
() => selectSkillAssignments(agents),
[agents],
@@ -250,9 +241,6 @@ export default function SkillsPage() {
navigation.push(paths.skillDetail(skill.id));
};
- // Assemble per-row data once per render — skill + agents + creator +
- // origin-runtime + permission flag. The table's column cells read off
- // `row.original` and never pull their own queries.
const skillRows = useMemo<SkillRow[]>(() => {
return filtered.map((skill) => {
const origin = readOrigin(skill);
@@ -282,7 +270,7 @@ export default function SkillsPage() {
myRole,
]);
- const columns = useMemo(() => createSkillColumns(), []);
+ const columns = useSkillColumns();
const table = useReactTable({
data: skillRows,
@@ -327,11 +315,13 @@ export default function SkillsPage() {
<div className="flex flex-1 flex-col items-center justify-center gap-3 px-6 py-16 text-center">
<AlertCircle className="h-8 w-8 text-destructive" />
<div>
- <p className="text-sm font-medium">Couldn&rsquo;t load skills</p>
+ <p className="text-sm font-medium">
+ {t(($) => $.page.list_error.title)}
+ </p>
<p className="mt-1 text-xs text-muted-foreground">
{listError instanceof Error
? listError.message
- : "Something went wrong fetching the skill list."}
+ : t(($) => $.page.list_error.fallback)}
</p>
</div>
<Button
@@ -340,7 +330,7 @@ export default function SkillsPage() {
size="sm"
onClick={() => refetchList()}
>
- Try again
+ {t(($) => $.page.list_error.retry)}
</Button>
</div>
</div>
@@ -359,37 +349,25 @@ export default function SkillsPage() {
onCreate={() => setCreateOpen(true)}
/>
- {/* Non-blocking banner when supporting queries fail — list still renders
- but creator/runtime/permission attribution is incomplete. */}
{supportingQueryDown && (
<div
role="status"
className="flex shrink-0 items-start gap-2 border-b bg-warning/10 px-6 py-2 text-xs text-muted-foreground"
>
<AlertTriangle className="mt-0.5 h-3.5 w-3.5 shrink-0 text-warning" />
- <span>
- Some workspace data failed to load. Creator attribution, runtime
- names, or edit permissions may appear incomplete.
- </span>
+ <span>{t(($) => $.page.supporting_data_warning)}</span>
</div>
)}
- {/* Page body — padding here keeps the card from touching the chrome,
- and `gap-4` separates the intro banner from the table card. */}
<div className="flex flex-1 min-h-0 flex-col gap-4 p-6">
{!showEmpty && (
- // Brand-coloured intro banner — explains the sharing model
- // for skills (workspace-wide vs. local runtime). Pre-#1794
- // this lived in the body; #1794 dropped it without a clear
- // reason. Restored intentionally.
<div className="max-w-3xl rounded-r-md border-l-2 border-l-brand bg-brand/5 px-4 py-3 text-xs leading-relaxed text-muted-foreground">
<span className="font-medium text-foreground">
- Shared with your workspace.
+ {t(($) => $.page.intro_banner.title)}
</span>{" "}
- Anyone can create a skill, import one from a URL, or copy one
- from their local runtime — and every agent can use it.{" "}
+ {t(($) => $.page.intro_banner.body)}{" "}
<span className="font-semibold text-brand">
- Local runtime skills stay private until you copy one here.
+ {t(($) => $.page.intro_banner.highlight)}
</span>
</div>
)}
@@ -408,12 +386,18 @@ export default function SkillsPage() {
{filtered.length === 0 ? (
<div className="flex flex-1 flex-col items-center justify-center gap-2 px-4 py-16 text-center text-muted-foreground">
<Search className="h-8 w-8 text-muted-foreground/40" />
- <p className="text-sm">No matches</p>
+ <p className="text-sm">{t(($) => $.page.no_matches.title)}</p>
<p className="max-w-xs text-xs">
{search
- ? `No skills match "${search}"${filter !== "all" ? " in this filter" : ""}.`
- : "No skills match this filter."}{" "}
- Try a different query.
+ ? t(($) => $.page.no_matches.with_query, {
+ query: search,
+ filterSuffix:
+ filter !== "all"
+ ? t(($) => $.page.no_matches.with_query_filter_suffix)
+ : "",
+ })
+ : t(($) => $.page.no_matches.filter_only)}
+ {t(($) => $.page.no_matches.try_different)}
</p>
</div>
) : (
diff --git a/packages/views/test/i18n.tsx b/packages/views/test/i18n.tsx
new file mode 100644
index 0000000000..d07aafdfc0
--- /dev/null
+++ b/packages/views/test/i18n.tsx
@@ -0,0 +1,39 @@
+import {
+ render,
+ type RenderOptions,
+ type RenderResult,
+} from "@testing-library/react";
+import { I18nProvider } from "@multica/core/i18n/react";
+import type { ReactElement, ReactNode } from "react";
+import { RESOURCES } from "../locales";
+
+// Single i18n test wrapper for the whole package. Wraps the production
+// `RESOURCES` map (every namespace registered there is available to the
+// component under test) so when a new namespace lands the test never
+// silently renders translation keys-as-text — the test sees the same
+// resource set users do. The previous pattern of inlining a per-file
+// `TEST_RESOURCES` slice meant every test author had to remember to
+// extend the slice when their component started using a new namespace.
+//
+// Use `renderWithI18n` like the standard `render`. Pass `locale: "zh-Hans"`
+// to verify Chinese strings; default is "en".
+type RenderArgs = Omit<RenderOptions, "wrapper"> & {
+ locale?: "en" | "zh-Hans";
+};
+
+export function renderWithI18n(
+ ui: ReactElement,
+ options: RenderArgs = {},
+): RenderResult {
+ const { locale = "en", ...rest } = options;
+ function Wrapper({ children }: { children: ReactNode }) {
+ return (
+ <I18nProvider locale={locale} resources={RESOURCES}>
+ {children}
+ </I18nProvider>
+ );
+ }
+ return render(ui, { wrapper: Wrapper, ...rest });
+}
+
+export { RESOURCES };
diff --git a/packages/views/workspace/create-workspace-form.test.tsx b/packages/views/workspace/create-workspace-form.test.tsx
index f9234e024b..6c2baf1c03 100644
--- a/packages/views/workspace/create-workspace-form.test.tsx
+++ b/packages/views/workspace/create-workspace-form.test.tsx
@@ -1,19 +1,36 @@
+import type { ReactNode } from "react";
import { describe, expect, it, vi, beforeEach } from "vitest";
import { render, screen, fireEvent, waitFor } from "@testing-library/react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
+import { I18nProvider } from "@multica/core/i18n/react";
+import enCommon from "../locales/en/common.json";
+import enWorkspace from "../locales/en/workspace.json";
import { CreateWorkspaceForm } from "./create-workspace-form";
+const TEST_RESOURCES = {
+ en: { common: enCommon, workspace: enWorkspace },
+};
+
const mockMutate = vi.fn();
vi.mock("@multica/core/workspace/mutations", () => ({
useCreateWorkspace: () => ({ mutate: mockMutate, isPending: false }),
}));
+function I18nWrapper({ children }: { children: ReactNode }) {
+ return (
+ <I18nProvider locale="en" resources={TEST_RESOURCES}>
+ {children}
+ </I18nProvider>
+ );
+}
+
function renderForm(onSuccess = vi.fn()) {
const qc = new QueryClient();
return render(
<QueryClientProvider client={qc}>
<CreateWorkspaceForm onSuccess={onSuccess} />
</QueryClientProvider>,
+ { wrapper: I18nWrapper },
);
}
diff --git a/packages/views/workspace/create-workspace-form.tsx b/packages/views/workspace/create-workspace-form.tsx
index 250ae65ccf..9facfb2c09 100644
--- a/packages/views/workspace/create-workspace-form.tsx
+++ b/packages/views/workspace/create-workspace-form.tsx
@@ -9,18 +9,18 @@ import { Card, CardContent } from "@multica/ui/components/ui/card";
import { useCreateWorkspace } from "@multica/core/workspace/mutations";
import type { Workspace } from "@multica/core/types";
import {
- WORKSPACE_SLUG_CONFLICT_ERROR,
- WORKSPACE_SLUG_FORMAT_ERROR,
WORKSPACE_SLUG_REGEX,
isWorkspaceSlugConflict,
nameToWorkspaceSlug,
} from "./slug";
+import { useT } from "../i18n";
export interface CreateWorkspaceFormProps {
onSuccess: (workspace: Workspace) => void | Promise<void>;
}
export function CreateWorkspaceForm({ onSuccess }: CreateWorkspaceFormProps) {
+ const { t } = useT("workspace");
const createWorkspace = useCreateWorkspace();
const [name, setName] = useState("");
const [slug, setSlug] = useState("");
@@ -29,7 +29,7 @@ export function CreateWorkspaceForm({ onSuccess }: CreateWorkspaceFormProps) {
const slugValidationError =
slug.length > 0 && !WORKSPACE_SLUG_REGEX.test(slug)
- ? WORKSPACE_SLUG_FORMAT_ERROR
+ ? t(($) => $.create_form.errors.slug_format)
: null;
const slugError = slugValidationError ?? slugServerError;
const canSubmit =
@@ -57,11 +57,11 @@ export function CreateWorkspaceForm({ onSuccess }: CreateWorkspaceFormProps) {
onSuccess,
onError: (error) => {
if (isWorkspaceSlugConflict(error)) {
- setSlugServerError(WORKSPACE_SLUG_CONFLICT_ERROR);
- toast.error("Choose a different workspace URL");
+ setSlugServerError(t(($) => $.create_form.errors.slug_taken));
+ toast.error(t(($) => $.create_form.errors.slug_conflict_toast));
return;
}
- toast.error("Failed to create workspace");
+ toast.error(t(($) => $.create_form.errors.create_failed));
},
},
);
@@ -71,20 +71,21 @@ export function CreateWorkspaceForm({ onSuccess }: CreateWorkspaceFormProps) {
<Card className="w-full">
<CardContent className="space-y-4 pt-6">
<div className="space-y-1.5">
- <Label htmlFor="ws-name">Workspace Name</Label>
+ <Label htmlFor="ws-name">{t(($) => $.create_form.name_label)}</Label>
<Input
id="ws-name"
autoFocus
type="text"
value={name}
onChange={(e) => handleNameChange(e.target.value)}
- placeholder="My Workspace"
+ placeholder={t(($) => $.create_form.name_placeholder)}
onKeyDown={(e) => e.key === "Enter" && handleCreate()}
/>
</div>
<div className="space-y-1.5">
- <Label htmlFor="ws-slug">Workspace URL</Label>
+ <Label htmlFor="ws-slug">{t(($) => $.create_form.url_label)}</Label>
<div className="flex items-center gap-0 rounded-md border bg-background focus-within:ring-2 focus-within:ring-ring">
+ {/* eslint-disable-next-line i18next/no-literal-string -- brand URL prefix, not translatable */}
<span className="pl-3 text-sm text-muted-foreground select-none">
multica.ai/
</span>
@@ -93,7 +94,7 @@ export function CreateWorkspaceForm({ onSuccess }: CreateWorkspaceFormProps) {
type="text"
value={slug}
onChange={(e) => handleSlugChange(e.target.value)}
- placeholder="my-workspace"
+ placeholder={t(($) => $.create_form.url_placeholder)}
className="border-0 shadow-none focus-visible:ring-0"
onKeyDown={(e) => e.key === "Enter" && handleCreate()}
/>
@@ -108,7 +109,9 @@ export function CreateWorkspaceForm({ onSuccess }: CreateWorkspaceFormProps) {
onClick={handleCreate}
disabled={createWorkspace.isPending || !canSubmit}
>
- {createWorkspace.isPending ? "Creating..." : "Create workspace"}
+ {createWorkspace.isPending
+ ? t(($) => $.create_form.submitting)
+ : t(($) => $.create_form.submit)}
</Button>
</CardContent>
</Card>
diff --git a/packages/views/workspace/new-workspace-page.tsx b/packages/views/workspace/new-workspace-page.tsx
index e0f11b1ce7..4edd8fa311 100644
--- a/packages/views/workspace/new-workspace-page.tsx
+++ b/packages/views/workspace/new-workspace-page.tsx
@@ -5,6 +5,7 @@ import { Button } from "@multica/ui/components/ui/button";
import type { Workspace } from "@multica/core/types";
import { useLogout } from "../auth";
import { DragStrip } from "../platform";
+import { useT } from "../i18n";
import { CreateWorkspaceForm } from "./create-workspace-form";
/**
@@ -27,6 +28,7 @@ export function NewWorkspacePage({
onSuccess: (workspace: Workspace) => void;
onBack?: () => void;
}) {
+ const { t } = useT("workspace");
const logout = useLogout();
return (
@@ -40,7 +42,7 @@ export function NewWorkspacePage({
onClick={onBack}
>
<ArrowLeft />
- Back
+ {t(($) => $.new_page.back)}
</Button>
)}
<Button
@@ -50,23 +52,22 @@ export function NewWorkspacePage({
onClick={logout}
>
<LogOut />
- Log out
+ {t(($) => $.new_page.log_out)}
</Button>
<div className="flex flex-1 flex-col items-center justify-center px-6 pb-12">
<div className="flex w-full max-w-md flex-col items-center gap-6">
<div className="text-center">
<h1 className="text-3xl font-semibold tracking-tight">
- Welcome to Multica
+ {t(($) => $.new_page.title)}
</h1>
<p className="mt-3 text-muted-foreground">
- One workspace where you and your AI teammates work side by side —
- taking issues, leaving comments, sharing the same context.
+ {t(($) => $.new_page.description)}
</p>
</div>
<CreateWorkspaceForm onSuccess={onSuccess} />
<p className="text-center text-xs text-muted-foreground">
- You can invite teammates once your workspace is ready.
+ {t(($) => $.new_page.invite_hint)}
</p>
</div>
</div>
diff --git a/packages/views/workspace/no-access-page.test.tsx b/packages/views/workspace/no-access-page.test.tsx
index f79962d508..2c2e379f21 100644
--- a/packages/views/workspace/no-access-page.test.tsx
+++ b/packages/views/workspace/no-access-page.test.tsx
@@ -1,7 +1,15 @@
+import type { ReactNode } from "react";
import { describe, expect, it, vi, beforeEach } from "vitest";
import { render, screen, fireEvent } from "@testing-library/react";
+import { I18nProvider } from "@multica/core/i18n/react";
+import enCommon from "../locales/en/common.json";
+import enWorkspace from "../locales/en/workspace.json";
import { NoAccessPage } from "./no-access-page";
+const TEST_RESOURCES = {
+ en: { common: enCommon, workspace: enWorkspace },
+};
+
const navigate = vi.fn();
const logout = vi.fn();
@@ -13,6 +21,18 @@ vi.mock("../auth", () => ({
useLogout: () => logout,
}));
+function I18nWrapper({ children }: { children: ReactNode }) {
+ return (
+ <I18nProvider locale="en" resources={TEST_RESOURCES}>
+ {children}
+ </I18nProvider>
+ );
+}
+
+function renderPage() {
+ return render(<NoAccessPage />, { wrapper: I18nWrapper });
+}
+
describe("NoAccessPage", () => {
beforeEach(() => {
navigate.mockReset();
@@ -20,14 +40,14 @@ describe("NoAccessPage", () => {
});
it("renders generic message that doesn't leak existence", () => {
- render(<NoAccessPage />);
+ renderPage();
expect(
screen.getByText(/doesn't exist or you don't have access/i),
).toBeInTheDocument();
});
it("navigates to root on 'Go to my workspaces'", () => {
- render(<NoAccessPage />);
+ renderPage();
fireEvent.click(screen.getByRole("button", { name: /go to my workspaces/i }));
expect(navigate).toHaveBeenCalledWith("/");
});
@@ -43,7 +63,7 @@ describe("NoAccessPage", () => {
});
it("fully logs out on 'Sign in as a different user' instead of just navigating", () => {
- render(<NoAccessPage />);
+ renderPage();
fireEvent.click(
screen.getByRole("button", { name: /sign in as a different user/i }),
);
diff --git a/packages/views/workspace/no-access-page.tsx b/packages/views/workspace/no-access-page.tsx
index aecf053e57..0dfba07de9 100644
--- a/packages/views/workspace/no-access-page.tsx
+++ b/packages/views/workspace/no-access-page.tsx
@@ -6,6 +6,7 @@ import { paths } from "@multica/core/paths";
import { useNavigation } from "../navigation";
import { useLogout } from "../auth";
import { DragStrip } from "../platform";
+import { useT } from "../i18n";
/**
* Rendered when the workspace slug in the URL does not resolve to a workspace
@@ -14,6 +15,7 @@ import { DragStrip } from "../platform";
* either would let attackers enumerate workspace slugs.
*/
export function NoAccessPage() {
+ const { t } = useT("workspace");
const nav = useNavigation();
const logout = useLogout();
@@ -35,18 +37,18 @@ export function NoAccessPage() {
<div className="flex flex-1 flex-col items-center justify-center gap-6 px-6 pb-12 text-center">
<div className="space-y-2">
<h1 className="text-2xl font-semibold tracking-tight">
- Workspace not available
+ {t(($) => $.no_access.title)}
</h1>
<p className="max-w-md text-muted-foreground">
- This workspace doesn't exist or you don't have access.
+ {t(($) => $.no_access.description)}
</p>
</div>
<div className="flex flex-col gap-2 sm:flex-row">
<Button onClick={() => nav.push(paths.root())}>
- Go to my workspaces
+ {t(($) => $.no_access.go_to_workspaces)}
</Button>
<Button variant="outline" onClick={logout}>
- Sign in as a different user
+ {t(($) => $.no_access.sign_in_different)}
</Button>
</div>
</div>
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 36de54b446..64eb999f4d 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -6,6 +6,9 @@ settings:
catalogs:
default:
+ '@formatjs/intl-localematcher':
+ specifier: ^0.8.4
+ version: 0.8.4
'@tailwindcss/postcss':
specifier: ^4
version: 4.2.2
@@ -36,6 +39,12 @@ catalogs:
clsx:
specifier: ^2.1.1
version: 2.1.1
+ eslint-plugin-i18next:
+ specifier: ^6.1.4
+ version: 6.1.4
+ i18next:
+ specifier: ^26.0.8
+ version: 26.0.8
jsdom:
specifier: ^29.0.1
version: 29.0.1
@@ -57,6 +66,9 @@ catalogs:
react-dom:
specifier: 19.2.3
version: 19.2.3
+ react-i18next:
+ specifier: ^17.0.6
+ version: 17.0.6
rehype-katex:
specifier: ^7.0.1
version: 7.0.1
@@ -474,18 +486,27 @@ importers:
packages/core:
dependencies:
+ '@formatjs/intl-localematcher':
+ specifier: 'catalog:'
+ version: 0.8.4
'@tanstack/react-query':
specifier: 'catalog:'
version: 5.96.2([email protected])
'@tanstack/react-query-devtools':
specifier: ^5.96.2
+ i18next:
+ specifier: 'catalog:'
+ version: 26.0.8([email protected])
posthog-js:
specifier: 'catalog:'
version: 1.369.3
react:
specifier: 'catalog:'
version: 19.2.3
+ react-i18next:
+ specifier: 'catalog:'
zustand:
specifier: 'catalog:'
@@ -496,6 +517,9 @@ importers:
'@types/react':
specifier: ^19.2.0
version: 19.2.14
+ jsdom:
+ specifier: 'catalog:'
+ version: 29.0.1(@noble/[email protected])
typescript:
specifier: 'catalog:'
version: 5.9.3
@@ -733,6 +757,9 @@ importers:
hast-util-to-html:
specifier: ^4.0.1
version: 4.0.1
+ i18next:
+ specifier: 'catalog:'
+ version: 26.0.8([email protected])
katex:
specifier: 'catalog:'
version: 0.16.45
@@ -754,6 +781,9 @@ importers:
react-dom:
specifier: 'catalog:'
version: 19.2.3([email protected])
+ react-i18next:
+ specifier: 'catalog:'
react-markdown:
specifier: ^10.1.0
version: 10.1.0(@types/[email protected])([email protected])
@@ -806,6 +836,9 @@ importers:
'@vitejs/plugin-react':
specifier: 'catalog:'
+ eslint-plugin-i18next:
+ specifier: 'catalog:'
+ version: 6.1.4
jsdom:
specifier: 'catalog:'
version: 29.0.1(@noble/[email protected])
@@ -1414,9 +1447,15 @@ packages:
'@fontsource/[email protected]':
resolution: {integrity: sha512-xVPVFISJg/K0VVd+aQN0Y7X/sw9hUcJPyDWFJ5GpyU3bHELhoRsJkPSRSHXW32mOi0xZCUQDOaPj1sqIFJ1FGg==}
+ '@formatjs/[email protected]':
+ resolution: {integrity: sha512-vPnriihkfK0lzoQGaXq+qXH23VsYyansRTkTgo2aTG0k1NjLFyZimFVdfj4C9JkSE5dm7CEngcQ5TTc1yAyBfQ==}
+
'@formatjs/[email protected]':
resolution: {integrity: sha512-XOMO2Hupl0wdd172Y06h6kLpBz6Dv+J4okPLl4LPtzbr8f66WbIoy4ev98EBuZ6ZK4h5ydTN6XneT4QVpD7cdA==}
+ '@formatjs/[email protected]':
+ resolution: {integrity: sha512-J51dAnynnqJdVUEXidHoIWn+qYve+yNQEgmFk9Dyfr3p0okzm+5QhQ+9QmsMz08+BeWTVpc1HadIiLfZmRYbAQ==}
+
resolution: {integrity: sha512-dr8/3zEaB+p0D2n/IUrlPF1HZm586qgJNXK1a9fhg/PzdtkK7Ksd5l312tJX2yBuALqDYBlG20QEbayqPyxn+g==}
engines: {node: '>=18.14.1'}
@@ -4263,6 +4302,10 @@ packages:
resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==}
engines: {node: '>=12'}
+ resolution: {integrity: sha512-BekXQu1VaVFkREepQGsntBYoKuPsf89V16n/s2xpKMtsw0/lDseds1wBhj3RtO1dKnHsfTPaG+xul1vF0R7LEQ==}
+ engines: {node: '>=18.10.0'}
+
resolution: {integrity: sha512-+f15FfK64YQwZdJNELETdn5ibXEUQmW1DZL6KXhNnc2heoy/sg9VJJeT7n8TlMWouzWqSWavFkIhHyIbIAEapg==}
engines: {node: '>=10'}
@@ -4843,6 +4886,9 @@ packages:
resolution: {integrity: sha512-CV9TW3Y3f8/wT0BRFc1/KAVQ3TUHiXmaAb6VW9vtiMFf7SLoMd1PdAc4W3KFOFETBJUb90KatHqlsZMWV+R9Gg==}
engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0}
+ resolution: {integrity: sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==}
+
resolution: {integrity: sha512-ol6UPyBWqsrO6EJySPz2O7ZSr856WDrEzM5zMqp+FJJLGMW35cLYmmZnl0vztAZxRUoNZJFTCohfjuIJ8I4QBQ==}
@@ -4879,6 +4925,14 @@ packages:
resolution: {integrity: sha512-eKCa6bwnJhvxj14kZk5NCPc6Hb6BdsU9DZcOnmQKSnO1VKrfV0zCvtttPZUsBvjmNDn8rpcJfpwSYnHBjc95MQ==}
engines: {node: '>=18.18.0'}
+ resolution: {integrity: sha512-BRzLom0mhDhV9v0QhgUUHWQJuwFmnr1194xEcNLYD6ym8y8s542n4jXUvRLnhNTbh9PmpU6kGZamyuGHQMsGjw==}
+ peerDependencies:
+ typescript: ^5 || ^6
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+
resolution: {integrity: sha512-T10qvkw0zz4wnm560lOEg0PovVqUXuOFhhHAkixw8/sycy7TJt7v/RrkEKEQnAw2viPSJu6iAkErxnzR0g8PpQ==}
engines: {node: ^8.11.2 || >=10}
@@ -6355,6 +6409,22 @@ packages:
peerDependencies:
react: ^19.2.3
+ resolution: {integrity: sha512-WzJ6SMKF+GTD7JZZqxSR1AKKmXjaSu39sClUrNlwxS4Tl7a99O+ltFy6yhPMO+wgZuxpQjJ2PZkfrQKmAqrLhw==}
+ peerDependencies:
+ i18next: '>= 26.0.1'
+ react: '>= 16.8.0'
+ react-dom: '*'
+ react-native: '*'
+ typescript: ^5 || ^6
+ peerDependenciesMeta:
+ react-dom:
+ optional: true
+ react-native:
+ optional: true
+ typescript:
+ optional: true
+
resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==}
@@ -6557,6 +6627,10 @@ packages:
resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}
engines: {node: '>=0.10.0'}
+ resolution: {integrity: sha512-LBnkqsDE7BZKvqylbmn7lTIVdpx4K/QCduRATpO5R+wtPmky/a8pN1bO2D6wXppn1497AJF9mNjqAXr6bdl9jg==}
+ engines: {node: '>=0.10.5'}
+
resolution: {integrity: sha512-vHjcY2MlAITJhC0eRD/Vv8Vlgmu9Sd3LX9zZvtGzU5ZImdTN3+d6e/4mnTyV8vEbyf1sgNIrWxhWlrys52OkEA==}
engines: {node: '>=12', npm: '>=6'}
@@ -7359,6 +7433,10 @@ packages:
jsdom:
optional: true
+ resolution: {integrity: sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==}
+ engines: {node: '>=0.10.0'}
+
resolution: {integrity: sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==}
engines: {node: '>=14.0.0'}
@@ -8193,10 +8271,16 @@ snapshots:
'@fontsource/[email protected]': {}
+ '@formatjs/[email protected]': {}
+
'@formatjs/[email protected]':
dependencies:
tslib: 2.8.1
+ '@formatjs/[email protected]':
+ dependencies:
+ '@formatjs/fast-memoize': 3.1.2
+
dependencies:
hono: 4.12.8
@@ -11186,6 +11270,11 @@ snapshots:
+ dependencies:
+ lodash: 4.18.1
+ requireindex: 1.1.0
+
dependencies:
eslint: 9.39.4([email protected])
@@ -12008,6 +12097,10 @@ snapshots:
transitivePeerDependencies:
- '@noble/hashes'
+ dependencies:
+ void-elements: 3.1.0
+
@@ -12047,6 +12140,10 @@ snapshots:
+ optionalDependencies:
+ typescript: 5.9.3
+
dependencies:
cli-truncate: 2.1.0
@@ -13851,6 +13948,17 @@ snapshots:
react: 19.2.3
scheduler: 0.27.0
+ dependencies:
+ '@babel/runtime': 7.29.2
+ html-parse-stringify: 3.0.1
+ i18next: 26.0.8([email protected])
+ react: 19.2.3
+ use-sync-external-store: 1.6.0([email protected])
+ optionalDependencies:
+ react-dom: 19.2.3([email protected])
+ typescript: 5.9.3
+
@@ -14147,6 +14255,8 @@ snapshots:
+
dependencies:
pe-library: 0.4.1
@@ -15087,6 +15197,8 @@ snapshots:
transitivePeerDependencies:
- msw
+
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index 08efb358aa..ac64de304a 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -33,6 +33,12 @@ catalog:
# Icons
lucide-react: "^1.0.1"
+ # i18n
+ i18next: "^26.0.8"
+ react-i18next: "^17.0.6"
+ "@formatjs/intl-localematcher": "^0.8.4"
+ eslint-plugin-i18next: "^6.1.4"
+
# Loading animations (chat StatusPill)
unicode-animations: "^1.0.3"
diff --git a/scripts/init-worktree-env.sh b/scripts/init-worktree-env.sh
index 095e21a38d..f63a8e554d 100644
--- a/scripts/init-worktree-env.sh
+++ b/scripts/init-worktree-env.sh
@@ -32,7 +32,7 @@ DATABASE_URL=postgres://multica:multica@localhost:${postgres_port}/${postgres_db
PORT=${backend_port}
JWT_SECRET=change-me-in-production
-MULTICA_DEV_VERIFICATION_CODE=
+MULTICA_DEV_VERIFICATION_CODE=888888
MULTICA_SERVER_URL=ws://localhost:${backend_port}/ws
MULTICA_APP_URL=${frontend_origin}
diff --git a/server/internal/handler/auth.go b/server/internal/handler/auth.go
index d2847ccb34..d40a50b4b2 100644
--- a/server/internal/handler/auth.go
+++ b/server/internal/handler/auth.go
@@ -38,11 +38,21 @@ var ErrEmailNotAllowed = SignupError{Message: "email address or domain not allow
const devVerificationCodeEnv = "MULTICA_DEV_VERIFICATION_CODE"
+// supportedLanguages mirrors `SUPPORTED_LOCALES` in packages/core/i18n/types.ts.
+// Keep both lists in sync when adding a locale — the user-controlled `language`
+// field round-trips through GetMe back into i18n.changeLanguage(), so without
+// validation an arbitrary string would persist and echo to every device.
+var supportedLanguages = map[string]struct{}{
+ "en": {},
+ "zh-Hans": {},
+}
+
type UserResponse struct {
ID string `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
AvatarURL *string `json:"avatar_url"`
+ Language *string `json:"language"`
OnboardedAt *string `json:"onboarded_at"`
OnboardingQuestionnaire json.RawMessage `json:"onboarding_questionnaire"`
StarterContentState *string `json:"starter_content_state"`
@@ -63,6 +73,7 @@ func userToResponse(u db.User) UserResponse {
Name: u.Name,
Email: u.Email,
AvatarURL: textToPtr(u.AvatarUrl),
+ Language: textToPtr(u.Language),
OnboardedAt: timestampToPtr(u.OnboardedAt),
OnboardingQuestionnaire: json.RawMessage(q),
StarterContentState: textToPtr(u.StarterContentState),
@@ -412,6 +423,7 @@ func (h *Handler) GetMe(w http.ResponseWriter, r *http.Request) {
type UpdateMeRequest struct {
Name *string `json:"name"`
AvatarURL *string `json:"avatar_url"`
+ Language *string `json:"language"`
}
type GoogleLoginRequest struct {
@@ -648,6 +660,14 @@ func (h *Handler) UpdateMe(w http.ResponseWriter, r *http.Request) {
if req.AvatarURL != nil {
params.AvatarUrl = pgtype.Text{String: strings.TrimSpace(*req.AvatarURL), Valid: true}
}
+ if req.Language != nil {
+ lang := strings.TrimSpace(*req.Language)
+ if _, ok := supportedLanguages[lang]; !ok {
+ writeError(w, http.StatusBadRequest, "unsupported language")
+ return
+ }
+ params.Language = pgtype.Text{String: lang, Valid: true}
+ }
updatedUser, err := h.Queries.UpdateUser(r.Context(), params)
if err != nil {
diff --git a/server/internal/handler/user_language_test.go b/server/internal/handler/user_language_test.go
new file mode 100644
index 0000000000..2e4049e9c4
--- /dev/null
+++ b/server/internal/handler/user_language_test.go
@@ -0,0 +1,115 @@
+package handler
+
+import (
+ "context"
+ "encoding/json"
+ "net/http"
+ "net/http/httptest"
+ "strings"
+ "testing"
+)
+
+func newLanguageTestUser(t *testing.T, email string) string {
+ t.Helper()
+ ctx := context.Background()
+
+ var userID string
+ if err := testPool.QueryRow(ctx,
+ `INSERT INTO "user" (name, email) VALUES ($1, $2) RETURNING id`,
+ "Language Test", email,
+ ).Scan(&userID); err != nil {
+ t.Fatalf("insert test user: %v", err)
+ }
+ t.Cleanup(func() {
+ testPool.Exec(ctx, `DELETE FROM "user" WHERE id = $1`, userID)
+ })
+ return userID
+}
+
+func newPatchMeRequest(userID, body string) *http.Request {
+ req := httptest.NewRequest("PATCH", "/api/me", strings.NewReader(body))
+ req.Header.Set("Content-Type", "application/json")
+ req.Header.Set("X-User-ID", userID)
+ return req
+}
+
+func TestUpdateMeAcceptsLanguage(t *testing.T) {
+ userID := newLanguageTestUser(t, "[email protected]")
+
+ w := httptest.NewRecorder()
+ req := newPatchMeRequest(userID, `{"language":"zh-Hans"}`)
+ testHandler.UpdateMe(w, req)
+
+ if w.Code != http.StatusOK {
+ t.Fatalf("expected 200, got %d: %s", w.Code, w.Body.String())
+ }
+
+ var lang *string
+ if err := testPool.QueryRow(context.Background(),
+ `SELECT language FROM "user" WHERE id = $1`, userID,
+ ).Scan(&lang); err != nil {
+ t.Fatalf("lookup user: %v", err)
+ }
+ if lang == nil || *lang != "zh-Hans" {
+ t.Fatalf("expected language=zh-Hans, got %v", lang)
+ }
+
+ var resp map[string]any
+ if err := json.Unmarshal(w.Body.Bytes(), &resp); err != nil {
+ t.Fatalf("decode response: %v", err)
+ }
+ if got, _ := resp["language"].(string); got != "zh-Hans" {
+ t.Fatalf("expected response language=zh-Hans, got %v", resp["language"])
+ }
+}
+
+func TestUpdateMeRejectsUnsupportedLanguage(t *testing.T) {
+ userID := newLanguageTestUser(t, "[email protected]")
+
+ w := httptest.NewRecorder()
+ req := newPatchMeRequest(userID, `{"language":"<script>"}`)
+ testHandler.UpdateMe(w, req)
+
+ if w.Code != http.StatusBadRequest {
+ t.Fatalf("expected 400, got %d: %s", w.Code, w.Body.String())
+ }
+
+ var lang *string
+ if err := testPool.QueryRow(context.Background(),
+ `SELECT language FROM "user" WHERE id = $1`, userID,
+ ).Scan(&lang); err != nil {
+ t.Fatalf("lookup user: %v", err)
+ }
+ if lang != nil {
+ t.Fatalf("expected language unchanged (NULL), got %v", *lang)
+ }
+}
+
+// COALESCE semantics: omitting language must NOT clear an existing value.
+func TestUpdateMePreservesLanguageWhenNotProvided(t *testing.T) {
+ userID := newLanguageTestUser(t, "[email protected]")
+
+ if _, err := testPool.Exec(context.Background(),
+ `UPDATE "user" SET language = 'en' WHERE id = $1`, userID,
+ ); err != nil {
+ t.Fatalf("preset language: %v", err)
+ }
+
+ w := httptest.NewRecorder()
+ req := newPatchMeRequest(userID, `{"name":"Updated Name"}`)
+ testHandler.UpdateMe(w, req)
+
+ if w.Code != http.StatusOK {
+ t.Fatalf("expected 200, got %d: %s", w.Code, w.Body.String())
+ }
+
+ var lang *string
+ if err := testPool.QueryRow(context.Background(),
+ `SELECT language FROM "user" WHERE id = $1`, userID,
+ ).Scan(&lang); err != nil {
+ t.Fatalf("lookup user: %v", err)
+ }
+ if lang == nil || *lang != "en" {
+ t.Fatalf("expected language=en preserved, got %v", lang)
+ }
+}
diff --git a/server/migrations/060_add_user_language.down.sql b/server/migrations/060_add_user_language.down.sql
new file mode 100644
index 0000000000..a036a318bb
--- /dev/null
+++ b/server/migrations/060_add_user_language.down.sql
@@ -0,0 +1 @@
+ALTER TABLE "user" DROP COLUMN language;
diff --git a/server/migrations/060_add_user_language.up.sql b/server/migrations/060_add_user_language.up.sql
new file mode 100644
index 0000000000..9591b4f795
--- /dev/null
+++ b/server/migrations/060_add_user_language.up.sql
@@ -0,0 +1 @@
+ALTER TABLE "user" ADD COLUMN language VARCHAR(20) DEFAULT NULL;
diff --git a/server/pkg/db/generated/models.go b/server/pkg/db/generated/models.go
index e9421fbc90..b138df8c99 100644
--- a/server/pkg/db/generated/models.go
+++ b/server/pkg/db/generated/models.go
@@ -436,6 +436,7 @@ type User struct {
CloudWaitlistEmail pgtype.Text `json:"cloud_waitlist_email"`
CloudWaitlistReason pgtype.Text `json:"cloud_waitlist_reason"`
StarterContentState pgtype.Text `json:"starter_content_state"`
+ Language pgtype.Text `json:"language"`
}
type VerificationCode struct {
diff --git a/server/pkg/db/generated/user.sql.go b/server/pkg/db/generated/user.sql.go
index ad1122b150..e919ef84e1 100644
--- a/server/pkg/db/generated/user.sql.go
+++ b/server/pkg/db/generated/user.sql.go
@@ -14,7 +14,7 @@ import (
const createUser = `-- name: CreateUser :one
INSERT INTO "user" (name, email, avatar_url)
VALUES ($1, $2, $3)
-RETURNING id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state
+RETURNING id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state, language
`
type CreateUserParams struct {
@@ -38,12 +38,13 @@ func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, e
&i.CloudWaitlistEmail,
&i.CloudWaitlistReason,
&i.StarterContentState,
+ &i.Language,
)
return i, err
}
const getUser = `-- name: GetUser :one
-SELECT id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state FROM "user"
+SELECT id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state, language FROM "user"
WHERE id = $1
`
@@ -62,12 +63,13 @@ func (q *Queries) GetUser(ctx context.Context, id pgtype.UUID) (User, error) {
&i.CloudWaitlistEmail,
&i.CloudWaitlistReason,
&i.StarterContentState,
+ &i.Language,
)
return i, err
}
const getUserByEmail = `-- name: GetUserByEmail :one
-SELECT id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state FROM "user"
+SELECT id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state, language FROM "user"
WHERE email = $1
`
@@ -86,6 +88,7 @@ func (q *Queries) GetUserByEmail(ctx context.Context, email string) (User, error
&i.CloudWaitlistEmail,
&i.CloudWaitlistReason,
&i.StarterContentState,
+ &i.Language,
)
return i, err
}
@@ -96,7 +99,7 @@ UPDATE "user" SET
cloud_waitlist_reason = $3,
updated_at = now()
WHERE id = $1
-RETURNING id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state
+RETURNING id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state, language
`
type JoinCloudWaitlistParams struct {
@@ -123,6 +126,7 @@ func (q *Queries) JoinCloudWaitlist(ctx context.Context, arg JoinCloudWaitlistPa
&i.CloudWaitlistEmail,
&i.CloudWaitlistReason,
&i.StarterContentState,
+ &i.Language,
)
return i, err
}
@@ -132,7 +136,7 @@ UPDATE "user" SET
onboarded_at = COALESCE(onboarded_at, now()),
updated_at = now()
WHERE id = $1
-RETURNING id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state
+RETURNING id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state, language
`
func (q *Queries) MarkUserOnboarded(ctx context.Context, id pgtype.UUID) (User, error) {
@@ -150,6 +154,7 @@ func (q *Queries) MarkUserOnboarded(ctx context.Context, id pgtype.UUID) (User,
&i.CloudWaitlistEmail,
&i.CloudWaitlistReason,
&i.StarterContentState,
+ &i.Language,
)
return i, err
}
@@ -159,7 +164,7 @@ UPDATE "user" SET
onboarding_questionnaire = COALESCE($1, onboarding_questionnaire),
updated_at = now()
WHERE id = $2
-RETURNING id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state
+RETURNING id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state, language
`
type PatchUserOnboardingParams struct {
@@ -182,6 +187,7 @@ func (q *Queries) PatchUserOnboarding(ctx context.Context, arg PatchUserOnboardi
&i.CloudWaitlistEmail,
&i.CloudWaitlistReason,
&i.StarterContentState,
+ &i.Language,
)
return i, err
}
@@ -191,7 +197,7 @@ UPDATE "user" SET
starter_content_state = $2,
updated_at = now()
WHERE id = $1
-RETURNING id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state
+RETURNING id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state, language
`
type SetStarterContentStateParams struct {
@@ -219,6 +225,7 @@ func (q *Queries) SetStarterContentState(ctx context.Context, arg SetStarterCont
&i.CloudWaitlistEmail,
&i.CloudWaitlistReason,
&i.StarterContentState,
+ &i.Language,
)
return i, err
}
@@ -227,19 +234,26 @@ const updateUser = `-- name: UpdateUser :one
UPDATE "user" SET
name = COALESCE($2, name),
avatar_url = COALESCE($3, avatar_url),
+ language = COALESCE($4, language),
updated_at = now()
WHERE id = $1
-RETURNING id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state
+RETURNING id, name, email, avatar_url, created_at, updated_at, onboarded_at, onboarding_questionnaire, cloud_waitlist_email, cloud_waitlist_reason, starter_content_state, language
`
type UpdateUserParams struct {
ID pgtype.UUID `json:"id"`
Name string `json:"name"`
AvatarUrl pgtype.Text `json:"avatar_url"`
+ Language pgtype.Text `json:"language"`
}
func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error) {
- row := q.db.QueryRow(ctx, updateUser, arg.ID, arg.Name, arg.AvatarUrl)
+ row := q.db.QueryRow(ctx, updateUser,
+ arg.ID,
+ arg.Name,
+ arg.AvatarUrl,
+ arg.Language,
+ )
var i User
err := row.Scan(
&i.ID,
@@ -253,6 +267,7 @@ func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) (User, e
&i.CloudWaitlistEmail,
&i.CloudWaitlistReason,
&i.StarterContentState,
+ &i.Language,
)
return i, err
}
diff --git a/server/pkg/db/queries/user.sql b/server/pkg/db/queries/user.sql
index b6e6016cce..8a8f336fce 100644
--- a/server/pkg/db/queries/user.sql
+++ b/server/pkg/db/queries/user.sql
@@ -15,6 +15,7 @@ RETURNING *;
UPDATE "user" SET
name = COALESCE($2, name),
avatar_url = COALESCE($3, avatar_url),
+ language = COALESCE($4, language),
updated_at = now()
WHERE id = $1
RETURNING *;