From bc59bb9307e9f141465362bc33a710bedc790fff Mon Sep 17 00:00:00 2001 From: Heiko Liebscher Date: Mon, 22 Jun 2026 13:58:24 +0200 Subject: [PATCH] i18n(ai-routing): localize workload labels, descriptions, and hints (#3870) Co-authored-by: OpenHuman Co-authored-by: Steven Enamakel --- .../components/settings/panels/AIPanel.tsx | 137 ++++++++++-------- .../panels/__tests__/AIPanel.test.tsx | 44 +++++- app/src/lib/i18n/ar.ts | 40 +++++ app/src/lib/i18n/bn.ts | 40 +++++ app/src/lib/i18n/de.ts | 43 ++++++ app/src/lib/i18n/en.ts | 40 +++++ app/src/lib/i18n/es.ts | 40 +++++ app/src/lib/i18n/fr.ts | 40 +++++ app/src/lib/i18n/hi.ts | 40 +++++ app/src/lib/i18n/id.ts | 40 +++++ app/src/lib/i18n/it.ts | 40 +++++ app/src/lib/i18n/ko.ts | 40 +++++ app/src/lib/i18n/pl.ts | 40 +++++ app/src/lib/i18n/pt.ts | 40 +++++ app/src/lib/i18n/ru.ts | 40 +++++ app/src/lib/i18n/zh-CN.ts | 40 +++++ 16 files changed, 682 insertions(+), 62 deletions(-) diff --git a/app/src/components/settings/panels/AIPanel.tsx b/app/src/components/settings/panels/AIPanel.tsx index 5cd7fb2d2..a14d20dde 100644 --- a/app/src/components/settings/panels/AIPanel.tsx +++ b/app/src/components/settings/panels/AIPanel.tsx @@ -109,7 +109,14 @@ export type ProviderRef = | { kind: 'local'; model: string; temperature?: number | null } | { kind: 'claude-code'; model: string; temperature?: number | null }; -type Workload = { id: WorkloadId; group: WorkloadGroup; label: string; description: string }; +type Workload = { + id: WorkloadId; + group: WorkloadGroup; + // i18n keys (resolved with `t()` at render) rather than literal English, so the + // workload labels/descriptions translate like the rest of the panel. + labelKey: string; + descriptionKey: string; +}; export type RoutingMap = Record; type RoutingMode = 'managed' | 'own' | 'custom'; @@ -161,79 +168,99 @@ const WORKLOADS: Workload[] = [ { id: 'chat', group: 'chat', - label: 'Chat', - description: 'Direct conversational back-and-forth — “Quick” mode in Conversations', + labelKey: 'settings.ai.routing.workload.chat.label', + descriptionKey: 'settings.ai.routing.workload.chat.description', }, { id: 'reasoning', group: 'chat', - label: 'Reasoning', - description: 'Main chat agent, meeting summarizer — “Reasoning” mode in Conversations', + labelKey: 'settings.ai.routing.workload.reasoning.label', + descriptionKey: 'settings.ai.routing.workload.reasoning.description', }, { id: 'agentic', group: 'chat', - label: 'Agentic', - description: 'Sub-agent runners, tool loops, GIF decisions', + labelKey: 'settings.ai.routing.workload.agentic.label', + descriptionKey: 'settings.ai.routing.workload.agentic.description', }, { id: 'coding', group: 'chat', - label: 'Coding', - description: 'Code generation and refactor passes', + labelKey: 'settings.ai.routing.workload.coding.label', + descriptionKey: 'settings.ai.routing.workload.coding.description', }, { id: 'vision', group: 'chat', - label: 'Vision', - description: 'Image understanding for the vision sub-agent — always multimodal', + labelKey: 'settings.ai.routing.workload.vision.label', + descriptionKey: 'settings.ai.routing.workload.vision.description', }, { id: 'memory', group: 'background', - label: 'Memory summarization', - description: 'Tree-extracts and consolidations', + labelKey: 'settings.ai.routing.workload.memory.label', + descriptionKey: 'settings.ai.routing.workload.memory.description', }, { id: 'heartbeat', group: 'background', - label: 'Heartbeat', - description: 'Background reasoning between user turns', + labelKey: 'settings.ai.routing.workload.heartbeat.label', + descriptionKey: 'settings.ai.routing.workload.heartbeat.description', }, { id: 'learning', group: 'background', - label: 'Learning · Reflections', - description: 'Periodic reflection over recent history', + labelKey: 'settings.ai.routing.workload.learning.label', + descriptionKey: 'settings.ai.routing.workload.learning.description', }, { id: 'subconscious', group: 'background', - label: 'Subconscious', - description: 'Eventfulness scoring + drift checks', + labelKey: 'settings.ai.routing.workload.subconscious.label', + descriptionKey: 'settings.ai.routing.workload.subconscious.description', }, ]; -const WORKLOAD_MODEL_HINTS: Record = { - chat: 'Recommended: a cheap or mid-cost fast chat model with high tokens/sec and low latency. Open-source local models can work well here if they feel responsive.', - reasoning: - 'Recommended: a more expensive frontier or strong reasoning model for deep thinking. This is used for the main chat agent, meeting summaries, and heavier answer synthesis.', - agentic: - 'Recommended: a reliable instruction-following model with strong tool use. Mid-cost frontier models are usually safest; capable open-source models can work if tool calling is stable.', - coding: - 'Recommended: a coding-tuned model with strong instruction following, edit quality, and long-context performance. This is usually worth spending more on.', - vision: - 'Recommended: a multimodal model that accepts image input. The managed default (vision-v1) is image-capable; any provider you route here is always treated as vision-enabled.', - memory: - 'Recommended: a cheaper summarization model. It should be consistent and compact, but it does not need premium frontier-level reasoning.', - heartbeat: - 'Recommended: a cheap, efficient background model. This runs often between turns, so low cost matters more than maximum intelligence.', - learning: - 'Recommended: a stronger reflective model. This can be mid-cost or premium because it benefits from better synthesis over recent history.', - subconscious: - 'Recommended: a very cheap monitoring model, ideally one that is lightweight and predictable. This is for eventfulness scoring, drift checks, and quiet background evaluation.', +// i18n keys for the per-workload "Recommended: …" hints (resolved with `t()`). +const WORKLOAD_MODEL_HINT_KEYS: Record = { + chat: 'settings.ai.routing.workload.chat.hint', + reasoning: 'settings.ai.routing.workload.reasoning.hint', + agentic: 'settings.ai.routing.workload.agentic.hint', + coding: 'settings.ai.routing.workload.coding.hint', + vision: 'settings.ai.routing.workload.vision.hint', + memory: 'settings.ai.routing.workload.memory.hint', + heartbeat: 'settings.ai.routing.workload.heartbeat.hint', + learning: 'settings.ai.routing.workload.learning.hint', + subconscious: 'settings.ai.routing.workload.subconscious.hint', }; +// Build the "pending routing changes" summary: one `"