Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.
feat(web): translate the Agent info panel
Kilyn88e99da29777
diff --git a/apps/web/src/features/rooms/members/actor-profile.tsx b/apps/web/src/features/rooms/members/actor-profile.tsxindex b9ea0da6..d032b580 100644--- a/apps/web/src/features/rooms/members/actor-profile.tsx+++ b/apps/web/src/features/rooms/members/actor-profile.tsx@@ -31,10 +31,13 @@ import { useTeamHubRuntime } from "@/features/teamhub/teamhub-runtime";import { type TeamHubClient } from "@/features/teamhub/teamhub-client";import type {TeamHubActor,+ TeamHubAgentReasoningEffort,TeamHubTenantAgent,TeamHubTenantAgentAvailabilitySnapshot,TeamHubTenantAgentUpdateInput,} from "@/features/teamhub/teamhub-types";+import { formatLocale, translate } from "@/i18n/language";+import { RichMessage, useT } from "@/i18n/use-translation";import {teamHubIdentityQueryOptions,@@ -58,24 +61,26 @@ const PublishAgentTemplateDialog = lazy(async () => ({default: (await import("../agent-templates/publish-agent-template-dialog")).PublishAgentTemplateDialog,}));+import { agentTemplateMessages } from "../agent-templates/agent-templates.messages";+import { roomDialogMessages } from "../room-dialogs.messages";+import { sidePanelMessages } from "../task-sidebar/side-panel.messages";+import { agentInfoMessages } from "./agent-info.messages";import { AgentInstructions } from "./agent-instructions";+import { agentRuntimeMessages } from "./agent-runtime.messages";import { EditAgentInstructionsDialog } from "./edit-agent-instructions-dialog";import type {AgentRuntimeField,AgentRuntimeUpdateInput,} from "./edit-agent-runtime-dialog";import { tenantLocalModelsQueryKey } from "@/features/local-models/local-models-queries";-import { useResolvedAgentModelLabel } from "./use-agent-model-selection";+import {+ reasoningEffortLabel,+ useResolvedAgentModelLabel,+} from "./use-agent-model-selection";const EditAgentRuntimeDialog = lazy(async () => ({default: (await import("./edit-agent-runtime-dialog")).EditAgentRuntimeDialog,}));-const profileDateFormatter = dateTimeFormat({- day: "numeric",- month: "short",- year: "numeric",-});-/** A Human's profile. Agents open their Agent Info panel tab instead. */export function ActorProfilePanel({actor,@@ -88,13 +93,16 @@ export function ActorProfilePanel({onSelectActor: (actorId: string) => void;tenantId: string;}) {+ const t = useT();const headingRef = useRef<HTMLHeadingElement>(null);useEffect(() => headingRef.current?.focus(), [actor.id]);return (<aside- aria-label={`${actor.display_name} profile`}+ aria-label={t(agentInfoMessages.profileLabel, {+ name: actor.display_name,+ })}className="room-profile-panel flex h-full min-h-0 w-[336px] max-w-[min(21rem,calc(100%-min(22.5rem,45%)))] shrink flex-col border-l border-border bg-background max-sm:w-full max-sm:max-w-none max-sm:border-l-0"><header className="shrink-0 px-5 pt-5">@@ -114,11 +122,14 @@ export function ActorProfilePanel({{actor.display_name}</h2><p className="truncate text-xs text-app-subtle">- {actor.handle ?? "No public handle"} · Member+ {t(agentInfoMessages.handleMember, {+ handle: actor.handle ?? t(agentInfoMessages.noPublicHandle),+ })}</p></div><Button- aria-label="Close profile"+ data-voice-close+ aria-label={t(agentInfoMessages.closeProfile)}onClick={onClose}size="compactIcon"tone="ghost"@@ -406,6 +417,7 @@ function HumanProfileContent({onSelectActor: (actorId: string) => void;tenantId: string;}) {+ const t = useT();const { client } = useTeamHubRuntime();const { data: tenantAgents } = useSuspenseQuery(tenantAgentsQueryOptions(client, tenantId),@@ -425,19 +437,28 @@ function HumanProfileContent({<div className="mt-4 flex flex-wrap items-center gap-2"><h3 className="text-lg">{actor.display_name}</h3><span className="rounded-sm bg-muted px-1.5 py-0.5 text-2xs font-medium text-muted-foreground">- Human+ {t(agentInfoMessages.human)}</span></div><p className="mt-1 text-sm text-app-subtle">- {actor.handle ?? "No public handle"}+ {actor.handle ?? t(agentInfoMessages.noPublicHandle)}</p></section><ProfileSection>- <p className="mb-4 text-sm text-app-subtle">No description</p>- <ProfileField label="Role" value={actor.kind} />+ <p className="mb-4 text-sm text-app-subtle">+ {t(agentInfoMessages.noDescription)}+ </p>+ <ProfileField+ label={t(agentInfoMessages.role)}+ value={t(+ actor.kind === "agent"+ ? sidePanelMessages.kindAgent+ : sidePanelMessages.kindHuman,+ )}+ /><ProfileFieldicon={<Icon icon={Calendar03Icon} size={14} />}- label="Joined"+ label={t(agentInfoMessages.joined)}value={formatProfileDate(actor.created_at)}/></ProfileSection>@@ -568,7 +589,8 @@ function useAgentConfigurationUpdate("expected_configuration_revision">,) => {- if (!registration) throw new Error("Agent profile is unavailable.");+ if (!registration)+ throw new Error(translate(agentInfoMessages.profileUnavailable));return teamHubData(client.api.PATCH("/v0/tenants/{tenantId}/agents/{agentId}", {params: { path: { tenantId, agentId: actorId } },@@ -590,18 +612,19 @@ function PublishTemplateButton({}: {registration: TeamHubTenantAgent;}) {+ const t = useT();const [open, setOpen] = useState(false);return (<><button- aria-label="Publish as template"+ aria-label={t(agentTemplateMessages.publishTitle)}className="agent-publish-button"onClick={() => setOpen(true)}- title="Publish as template"+ title={t(agentTemplateMessages.publishTitle)}type="button"><Icon icon={LayoutTemplateIcon} size={14} />- Publish+ {t(agentTemplateMessages.publish)}</button>{open ? (<Suspense fallback={null}>@@ -648,12 +671,13 @@ function HumanProfileSections({createdAgents: TeamHubActor[];onSelectActor?: (actorId: string) => void;}) {+ const t = useT();return (<><ProfileSectiontitle={<>- Created Agents{" "}+ {t(agentInfoMessages.createdAgents)}{" "}<span className="text-xs font-normal text-muted-foreground">{createdAgents.length}</span>@@ -680,14 +704,16 @@ function HumanProfileSections({{createdAgent.display_name}</span><span className="block truncate text-xs text-app-subtle">- Agent+ {t(agentInfoMessages.agent)}</span></span></button>))}</div>) : (- <p className="text-sm text-app-subtle">No created Agents.</p>+ <p className="text-sm text-app-subtle">+ {t(agentInfoMessages.noCreatedAgents)}+ </p>)}</ProfileSection></>@@ -706,11 +732,12 @@ function PanelAgentRuntimeDetails({localRuntime?: TeamHubTenantAgentAvailabilitySnapshot["local_runtime_status"];placement?: TeamHubTenantAgent["runtime"]["placement"];modelLabel?: string;- reasoning?: string;+ reasoning?: TeamHubAgentReasoningEffort;canEdit: boolean;busy: boolean;onEdit: (field?: AgentRuntimeField) => void;}) {+ const t = useT();const type = placement?.runtime_type ?? "codex";const name = {codex: "Codex",@@ -719,21 +746,34 @@ function PanelAgentRuntimeDetails({antigravity: "Antigravity",}[type];const computer =- localRuntime?.display_name || placement?.computer_id || "Local Computer";+ localRuntime?.display_name ||+ placement?.computer_id ||+ t(agentInfoMessages.localComputer);const status = localRuntime?.computer_status ?? "unknown";+ const effort = reasoning ? reasoningEffortLabel(reasoning, t) : undefined;return (- <section className="mx-4 mt-4 space-y-3" aria-label="Runtime configuration">+ <section+ className="mx-4 mt-4 space-y-3"+ aria-label={t(agentInfoMessages.runtimeConfiguration)}+ ><div className="overflow-hidden rounded-xl border border-app-border"><InfoRowicon={<Icon icon={ServerStack01Icon} size={16} />}- label="Runs on"- value={`Local · ${computer}${status === "online" ? " · Online" : status === "offline" ? " · Offline" : ""}`}+ label={t(agentInfoMessages.runsOn)}+ value={t(+ status === "online"+ ? agentInfoMessages.runsOnLocalOnline+ : status === "offline"+ ? agentInfoMessages.runsOnLocalOffline+ : agentInfoMessages.runsOnLocal,+ { computer },+ )}chevron={canEdit}onClick={canEdit ? () => onEdit("computer") : undefined}/><InfoRowicon={<Icon icon={CpuIcon} size={16} />}- label="Runtime"+ label={t(agentRuntimeMessages.runtime)}value={name}chevron={canEdit}onClick={canEdit ? () => onEdit("runtime") : undefined}@@ -742,11 +782,14 @@ function PanelAgentRuntimeDetails({names both. */}<InfoRowicon={<Icon icon={AiBrain01Icon} size={16} />}- label="Model"+ label={t(agentRuntimeMessages.model)}value={- modelLabel && reasoning- ? `${modelLabel} · ${reasoning}`- : modelLabel || reasoning+ modelLabel && effort+ ? t(agentInfoMessages.modelWithEffort, {+ model: modelLabel,+ effort,+ })+ : modelLabel || effort}chevron={canEdit}onClick={canEdit ? () => onEdit("model") : undefined}@@ -754,16 +797,24 @@ function PanelAgentRuntimeDetails({</div>{localRuntime ? (<details className="px-1 text-xs text-app-muted">- <summary className="cursor-pointer">Runtime details</summary>+ <summary className="cursor-pointer">+ {t(agentInfoMessages.runtimeDetails)}+ </summary><dl className="mt-2 space-y-1"><div>- <dt className="inline">Status: </dt>- <dd className="inline">{localRuntime.status}</dd>+ <RichMessage+ message={agentInfoMessages.runtimeStatus}+ tags={runtimeDetailTags}+ values={{ status: localRuntime.status }}+ /></div>{localRuntime.version ? (<div>- <dt className="inline">Version: </dt>- <dd className="inline">{localRuntime.version}</dd>+ <RichMessage+ message={agentInfoMessages.runtimeVersion}+ tags={runtimeDetailTags}+ values={{ version: localRuntime.version }}+ /></div>) : null}</dl>@@ -771,13 +822,18 @@ function PanelAgentRuntimeDetails({) : null}{busy ? (<p className="px-1 text-xs text-app-muted">- Runtime settings can't change while this Agent is working.+ {t(agentInfoMessages.runtimeBusy)}</p>) : null}</section>);}+const runtimeDetailTags = {+ term: (text: string) => <dt className="inline">{text}</dt>,+ value: (text: string) => <dd className="inline">{text}</dd>,+};+function PanelAgentInfoDetails({canEdit,instructions,@@ -802,16 +858,18 @@ function PanelAgentInfoActions({canDelete: boolean;onDelete: () => void;}) {+ const t = useT();if (!canDelete) return null;return (- <SettingsGroup ariaLabel="Agent actions">+ <SettingsGroup ariaLabel={t(agentInfoMessages.agentActions)}><button+ data-voice-risk="never"className="flex min-h-11 w-full items-center justify-center gap-2 px-3.5 text-[14px] font-medium text-destructive transition-colors duration-150 hover:bg-destructive/5 focus-visible:bg-destructive/5 focus-visible:outline-none"onClick={onDelete}type="button"><Icon icon={Delete02Icon} size={16} />- Remove Agent+ {t(roomDialogMessages.removeAgent)}</button></SettingsGroup>);@@ -916,5 +974,8 @@ function ProfileField({}function formatProfileDate(value: string) {- return profileDateFormatter.format(new Date(value));+ return dateTimeFormat(+ { day: "numeric", month: "short", year: "numeric" },+ formatLocale(),+ ).format(new Date(value));}diff --git a/apps/web/src/features/rooms/members/agent-avatar-picker.tsx b/apps/web/src/features/rooms/members/agent-avatar-picker.tsxindex f4b678ec..5b701b37 100644--- a/apps/web/src/features/rooms/members/agent-avatar-picker.tsx+++ b/apps/web/src/features/rooms/members/agent-avatar-picker.tsx@@ -4,6 +4,7 @@ import { type ChangeEvent, useEffect, useRef, useState } from "react";import { ColorPalette } from "@/components/ui/color-palette";import { ModalDialog } from "@/components/ui/modal-dialog";+import { useT } from "@/i18n/use-translation";import {AGENT_FIGURE_NAMES,@@ -13,6 +14,7 @@ import {type AgentAvatarKey,} from "./agent-avatar";import { AgentAvatarPortrait } from "./agent-avatar-portrait";+import { agentInfoMessages } from "./agent-info.messages";/** Uploaded images are cropped square and scaled to this edge before saving. */const AVATAR_IMAGE_EDGE = 256;@@ -43,9 +45,10 @@ export function AgentAvatarEditor({onImageChange?: (image: string) => void;value: AgentAvatarKey;}) {+ const t = useT();const fileInputRef = useRef<HTMLInputElement>(null);const [galleryOpen, setGalleryOpen] = useState(false);- const [uploadError, setUploadError] = useState<string | null>(null);+ const [uploadFailed, setUploadFailed] = useState(false);const appearance = agentAvatarAppearance(value);const showsImage = appearance.kind === "image" && Boolean(image);@@ -64,13 +67,13 @@ export function AgentAvatarEditor({const file = event.target.files?.[0];event.target.value = "";if (!file || !onImageChange) return;- setUploadError(null);+ setUploadFailed(false);try {onImageChange(await readAvatarImage(file));onChange(imageKey(appearance.color));setGalleryOpen(false);} catch {- setUploadError("This image could not be used. Try a JPEG, PNG, or WebP.");+ setUploadFailed(true);}}@@ -78,12 +81,12 @@ export function AgentAvatarEditor({<div aria-disabled={disabled} className="flex flex-col items-center"><buttonaria-haspopup="dialog"- aria-label="Choose avatar"+ aria-label={t(agentInfoMessages.chooseAvatar)}className={`agent-avatar-upload group relative ${compact ? "size-24" : "size-40"} shrink-0 rounded-[20%] outline-none focus-visible:ring-2 focus-visible:ring-app-focus focus-visible:ring-offset-2 disabled:cursor-default`}data-testid="agent-avatar-hero"disabled={disabled}onClick={() => setGalleryOpen(true)}- title="Choose avatar"+ title={t(agentInfoMessages.chooseAvatar)}type="button"><AgentAvatarPortrait@@ -98,7 +101,7 @@ export function AgentAvatarEditor({{onImageChange ? (<inputaccept="image/jpeg,image/png,image/webp"- aria-label="Avatar image file"+ aria-label={t(agentInfoMessages.avatarImageFile)}className="sr-only"disabled={disabled}onChange={(event) => void chooseImage(event)}@@ -107,9 +110,9 @@ export function AgentAvatarEditor({type="file"/>) : null}- {uploadError ? (+ {uploadFailed ? (<p className="mt-2 text-xs text-app-danger" role="alert">- {uploadError}+ {t(agentInfoMessages.avatarUnusable)}</p>) : null}{galleryOpen ? (@@ -117,10 +120,10 @@ export function AgentAvatarEditor({closeOnBackdroponClose={() => setGalleryOpen(false)}size="sm"- title="Choose avatar"+ title={t(agentInfoMessages.chooseAvatar)}><div- aria-label="Avatars"+ aria-label={t(agentInfoMessages.avatars)}className="grid grid-cols-6 gap-2 px-5 py-4"role="radiogroup">@@ -132,7 +135,9 @@ export function AgentAvatarEditor({return (<buttonaria-checked={selected}- aria-label={`Avatar ${index + 1}`}+ aria-label={t(agentInfoMessages.avatarOption, {+ number: index + 1,+ })}className={`agent-avatar-option aspect-square rounded-[20%] outline-none focus-visible:ring-2 focus-visible:ring-app-focus ${selected ? "ring-2 ring-app-ink ring-offset-2 ring-offset-app-surface" : ""}`}key={figure}onClick={() => {@@ -149,10 +154,10 @@ export function AgentAvatarEditor({})}{onImageChange ? (<button- aria-label="Upload image"+ aria-label={t(agentInfoMessages.uploadImage)}className="flex aspect-square items-center justify-center rounded-[20%] border border-dashed border-border-hover text-muted-foreground outline-none transition-colors hover:bg-muted/70 hover:text-foreground focus-visible:ring-2 focus-visible:ring-app-focus"onClick={() => fileInputRef.current?.click()}- title="Upload image"+ title={t(agentInfoMessages.uploadImage)}type="button"><Icon icon={PlusSignIcon} size={20} />@@ -163,7 +168,7 @@ export function AgentAvatarEditor({) : null}<div className="mt-4 flex w-full justify-center"><ColorPalette- aria-label="Avatar background color"+ aria-label={t(agentInfoMessages.avatarBackgroundColor)}disabled={disabled}onChange={(color) =>onChange(diff --git a/apps/web/src/features/rooms/members/agent-info-content.tsx b/apps/web/src/features/rooms/members/agent-info-content.tsxindex 2442cde0..9c6af650 100644--- a/apps/web/src/features/rooms/members/agent-info-content.tsx+++ b/apps/web/src/features/rooms/members/agent-info-content.tsx@@ -12,6 +12,8 @@ import {import { AgentConnectors } from "@/features/apps/agent-connectors";import { useTeamHubRuntime } from "@/features/teamhub/teamhub-runtime";+import type { Message } from "@/i18n/messages";+import { useT } from "@/i18n/use-translation";import type {TeamHubActor,TeamHubTenantAgent,@@ -23,12 +25,16 @@ import {tenantAgentsQueryOptions,} from "../room-queries";import { ActorAvatar } from "./actor-avatar";-import { AgentSkillUploadPanel } from "./agent-skill-upload-panel";+import { agentInfoMessages } from "./agent-info.messages";+import {+ AgentSkillUploadPanel,+ type SkillManageHint,+} from "./agent-skill-upload-panel";import { AgentStatus } from "./agent-status";-const skillUploadHint = {- title: "ZIP or SKILL.md",- detail: "Same name upgrades this Skill.",+const skillUploadHint: SkillManageHint = {+ title: agentInfoMessages.uploadFormats,+ detail: agentInfoMessages.uploadUpgrades,};const RemindersPanel = lazy(() =>@@ -38,10 +44,10 @@ const RemindersPanel = lazy(() =>);const AGENT_INFO_TABS = [- ["basic", "Details"],- ["routines", "Routines"],- ["connectors", "Connectors"],-] as const;+ ["basic", agentInfoMessages.tabDetails],+ ["routines", agentInfoMessages.tabRoutines],+ ["connectors", agentInfoMessages.tabConnectors],+] as const satisfies readonly (readonly [string, Message<string>])[];type AgentInfoTab = (typeof AGENT_INFO_TABS)[number][0];@@ -85,6 +91,7 @@ export function AgentInfoContent({/** Routines are listed per Room, so the Routines tab needs the open Room. */roomId?: string;}) {+ const t = useT();const { client } = useTeamHubRuntime();const identityQuery = useQuery(teamHubIdentityQueryOptions(client));const { data: agents } = useQuery(tenantAgentsQueryOptions(client, tenantId));@@ -95,10 +102,9 @@ export function AgentInfoContent({)?.id;const isSponsor = liveRegistration?.created_by.id === currentActorId;const canManageSkills = Boolean(identityQuery.isSuccess && isSponsor);- const skillManageHint = !identityQuery.isSuccess- ? skillUploadHint- : !isSponsor- ? { title: "Only the Sponsor can change Skills" }+ const skillManageHint: SkillManageHint =+ identityQuery.isSuccess && !isSponsor+ ? { title: agentInfoMessages.sponsorOnlySkills }: skillUploadHint;const [tab, setTab] = useState<AgentInfoTab>("basic");const [showAllSkills, setShowAllSkills] = useState(false);@@ -124,7 +130,7 @@ export function AgentInfoContent({<divclassName="mx-auto flex w-fit max-w-full gap-1.5"role="tablist"- aria-label="Agent settings"+ aria-label={t(agentInfoMessages.settingsTabs)}>{AGENT_INFO_TABS.map(([id, label]) => (<button@@ -161,7 +167,7 @@ export function AgentInfoContent({: "text-muted-foreground hover:bg-sidebar-muted/50 hover:text-foreground"}`}>- {label}+ {t(label)}</button>))}</div>@@ -225,13 +231,14 @@ function AgentRoutines({roomId?: string;tenantId: string;}) {+ const t = useT();if (!roomId) {return (<pclassName="px-6 py-8 text-center text-xs text-muted-foreground"role="status">- Open this Agent from a Room to see its routines there.+ {t(agentInfoMessages.routinesNeedRoom)}</p>);}@@ -270,6 +277,7 @@ function AgentInfoIdentity({onSaveName?: (name: string) => Promise<unknown>;onEdit?: () => void;}) {+ const t = useT();const [editing, setEditing] = useState(false);const [draft, setDraft] = useState(actor.display_name);const [focusAfterError, setFocusAfterError] = useState(false);@@ -322,7 +330,7 @@ function AgentInfoIdentity({{action ? <div className="absolute right-3 top-3">{action}</div> : null}{canEdit ? (<button- aria-label="Edit avatar"+ aria-label={t(agentInfoMessages.editAvatar)}className="rounded-[20%] outline-none transition-opacity hover:opacity-80 focus-visible:ring-2 focus-visible:ring-app-focus"onClick={onEdit}type="button"@@ -334,7 +342,7 @@ function AgentInfoIdentity({)}{editing ? (<input- aria-label="Agent name"+ aria-label={t(agentInfoMessages.agentName)}ref={nameInput}autoFocusclassName="mt-2.5 max-w-full rounded-md bg-card px-2 text-center text-[15px] font-semibold leading-5 text-foreground shadow-outline outline-none focus-visible:ring-2 focus-visible:ring-app-focus"@@ -359,7 +367,9 @@ function AgentInfoIdentity({<h2 className="mt-2.5 max-w-full text-[15px] font-semibold leading-5 text-foreground"><buttonref={editNameButton}- aria-label={`Edit name ${actor.display_name}`}+ aria-label={t(agentInfoMessages.editName, {+ name: actor.display_name,+ })}className="max-w-full break-words rounded-md px-2 py-0.5 hover:bg-sidebar-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-app-focus disabled:opacity-50"disabled={nameBusy}onClick={() => {diff --git a/apps/web/src/features/rooms/members/agent-info.messages.ts b/apps/web/src/features/rooms/members/agent-info.messages.tsnew file mode 100644index 00000000..c1832e13--- /dev/null+++ b/apps/web/src/features/rooms/members/agent-info.messages.ts@@ -0,0 +1,129 @@+import { defineMessages } from "@/i18n/messages";++import { UNSET_AGENT_INSTRUCTIONS } from "./agent-instruction-text";++/** The Agent info panel, its edit dialogs, and a Human's profile panel. */+export const agentInfoMessages = defineMessages("agentInfo", {+ // The panel's tabs and the identity header.+ settingsTabs: "Agent settings",+ tabDetails: "Details",+ tabRoutines: "Routines",+ tabConnectors: "Connectors",+ routinesNeedRoom: "Open this Agent from a Room to see its routines there.",+ editAvatar: "Edit avatar",+ agentName: "Agent name",+ editName: "Edit name {name}",++ // The status line and the avatar's status popover.+ online: "Online",+ tasksInProgress: {+ one: "{count} task in progress",+ other: "{count} tasks in progress",+ },+ openStatus: "Open {name} status",+ openProfile: "Open {name} profile",+ viewActivity: "View activity",++ // Instructions.+ instructions: "Instructions",+ agentInstructions: "Agent instructions",+ editInstructions: "Edit instructions",+ instructionsContent: "Instructions content",+ instructionsUnset: UNSET_AGENT_INSTRUCTIONS,+ instructionsDescription: "Define how your Agent should work and respond.",+ showMore: "Show more",+ showLess: "Show less",++ // Where the Agent runs.+ runtimeConfiguration: "Runtime configuration",+ runsOn: "Runs on",+ runsOnLocal: "Local · {computer}",+ runsOnLocalOnline: "Local · {computer} · Online",+ runsOnLocalOffline: "Local · {computer} · Offline",+ localComputer: "Local Computer",+ modelWithEffort: "{model} · {effort}",+ runtimeDetails: "Runtime details",+ runtimeStatus: "<term>Status:</term> <value>{status}</value>",+ runtimeVersion: "<term>Version:</term> <value>{version}</value>",+ runtimeBusy: "Runtime settings can't change while this Agent is working.",+ agentActions: "Agent actions",+ profileUnavailable: "Agent profile is unavailable.",++ // Skills.+ skills: "Skills",+ skillCount: { one: "{count} Skill", other: "{count} Skills" },+ add: "Add",+ upload: "Upload",+ uploadSkill: "Upload Skill",+ uploadSkillPackage: "Upload Skill package",+ uploadFormats: "ZIP or SKILL.md",+ uploadUpgrades: "Same name upgrades this Skill.",+ sponsorOnlySkills: "Only the Sponsor can change Skills",+ removeSkill: "Remove {name}",+ noSkillsTitle: "No Skills added",+ noSkillsBody:+ "Add a Skill to give this Agent a repeatable way to handle a task.",+ showFewerSkills: "Show fewer",+ showAllSkills: {+ one: "Show all {count} Skill",+ other: "Show all {count} Skills",+ },+ addSkill: "Add Skill",+ searchSkills: "Search Skills",+ loadingSkills: "Loading Skills…",+ noSkillsMatch: "No Skills match that search.",+ noMoreSkills: "No more built-in Skills to add.",+ skillsSaved: "Saved. Future runs will use the new configuration.",+ skillsLoadIncomplete: "Could not load all Skills. Please retry.",+ reloadSkillsFirst: "Reload Skill configuration first.",+ skillOperationFailed: "The Skill operation failed. Please retry.",++ // The avatar editor and the profile dialog.+ chooseAvatar: "Choose avatar",+ avatars: "Avatars",+ avatarOption: "Avatar {number}",+ uploadImage: "Upload image",+ avatarImageFile: "Avatar image file",+ avatarBackgroundColor: "Avatar background color",+ avatarUnusable: "This image could not be used. Try a JPEG, PNG, or WebP.",+ editProfile: "Edit profile",+ profileDescription: "Update your Agent's name and avatar.",+ avatarDescription: "Update your Agent's avatar.",+ editAgentName: "Edit agent name",+ avatarSaveFailed: "The avatar could not be saved. Try again.",++ // Choosing a Computer and Runtime for an Agent.+ placementLabel: "Agent runtime placement",+ lookingForComputers: "Looking for Local Computers...",+ computersUnavailable: "Local Computers are unavailable.",+ noComputerOnline: "No Local Computer online",+ localRuntime: "Local Runtime",+ staysOnMachine: "Apps and Skills stay on this machine.",+ runtimeOption: "{runtime} - {status}",+ statusSignInRequired: "Sign in required",+ statusDetectionFailed: "Detection failed",+ statusUpgradeRequired: "Upgrade required",+ retryComputers: "Retry Local Computers",++ // The Agent's activity list in the side panel.+ activityHistory: "Agent activity history",+ recentActivity: "Recent activity in this conversation",+ viewAgentActivity: "View {name} activity: {prompt}",+ noRecentActivity: "No recent activity",+ activityPages: "Activity pages",+ previous: "Previous",+ next: "Next",++ // A Human's profile panel.+ profileLabel: "{name} profile",+ closeProfile: "Close profile",+ noPublicHandle: "No public handle",+ handleMember: "{handle} · Member",+ human: "Human",+ agent: "Agent",+ noDescription: "No description",+ role: "Role",+ joined: "Joined",+ createdAgents: "Created Agents",+ noCreatedAgents: "No created Agents.",+});diff --git a/apps/web/src/features/rooms/members/agent-instructions.tsx b/apps/web/src/features/rooms/members/agent-instructions.tsxindex 86b21dc6..32a8475e 100644--- a/apps/web/src/features/rooms/members/agent-instructions.tsx+++ b/apps/web/src/features/rooms/members/agent-instructions.tsx@@ -4,11 +4,11 @@ import {SettingsGroup,SettingsGroupAction,} from "@/components/ui/settings-group";+import { commonMessages } from "@/i18n/common.messages";+import { useT } from "@/i18n/use-translation";-import {- presentAgentInstructions,- UNSET_AGENT_INSTRUCTIONS,-} from "./agent-instruction-text";+import { agentInfoMessages } from "./agent-info.messages";+import { presentAgentInstructions } from "./agent-instruction-text";const COLLAPSED_LINES = "line-clamp-4";@@ -19,6 +19,7 @@ export function AgentInstructions({instructions: string;onEdit?: () => void;}) {+ const t = useT();const presented = presentAgentInstructions(instructions);const text = useRef<HTMLParagraphElement>(null);const [expanded, setExpanded] = useState(false);@@ -37,18 +38,21 @@ export function AgentInstructions({<SettingsGroupaction={onEdit ? (- <SettingsGroupAction aria-label="Edit instructions" onClick={onEdit}>- Edit+ <SettingsGroupAction+ aria-label={t(agentInfoMessages.editInstructions)}+ onClick={onEdit}+ >+ {t(commonMessages.edit)}</SettingsGroupAction>) : null}- ariaLabel="Agent instructions"- label="Instructions"+ ariaLabel={t(agentInfoMessages.agentInstructions)}+ label={t(agentInfoMessages.instructions)}><div className="border-t border-border px-3.5 py-3">{presented ? (<p- aria-label="Instructions content"+ aria-label={t(agentInfoMessages.instructionsContent)}className={`whitespace-pre-wrap break-words text-[14px] leading-5 text-app-body [overflow-wrap:anywhere] ${expanded ? "" : COLLAPSED_LINES}`}@@ -58,7 +62,7 @@ export function AgentInstructions({</p>) : (<p className="text-[14px] leading-5 text-muted-foreground">- {UNSET_AGENT_INSTRUCTIONS}+ {t(agentInfoMessages.instructionsUnset)}</p>)}{clipped || expanded ? (@@ -68,7 +72,11 @@ export function AgentInstructions({onClick={() => setExpanded((value) => !value)}type="button">- {expanded ? "Show less" : "Show more"}+ {t(+ expanded+ ? agentInfoMessages.showLess+ : agentInfoMessages.showMore,+ )}</button>) : null}</div>diff --git a/apps/web/src/features/rooms/members/agent-placement-fields.tsx b/apps/web/src/features/rooms/members/agent-placement-fields.tsxindex 07b24f40..97493aa1 100644--- a/apps/web/src/features/rooms/members/agent-placement-fields.tsx+++ b/apps/web/src/features/rooms/members/agent-placement-fields.tsx@@ -5,7 +5,15 @@ import { type ReactNode } from "react";import { Button } from "@/components/ui/button";import { Select, SelectItem } from "@/components/ui/select";import { ComputerSetupInstructions } from "@/features/local-computer/computer-setup-instructions";+import { computersMessages } from "@/features/local-computer/computers.messages";import { LocalRuntimeAuthenticationGuidance } from "@/features/local-computer/local-runtime-authentication-guidance";+import { commonMessages } from "@/i18n/common.messages";+import { type Translate, translate } from "@/i18n/language";+import type { Message } from "@/i18n/messages";+import { useT } from "@/i18n/use-translation";++import { agentInfoMessages } from "./agent-info.messages";+import { agentRuntimeMessages } from "./agent-runtime.messages";import type { useLocalRuntimeSelection } from "./use-local-runtime-selection";@@ -20,11 +28,12 @@ export function AgentPlacementFields({onSelectionChange: () => void;selection: ReturnType<typeof useLocalRuntimeSelection>;}) {+ const t = useT();return (// eslint-disable-next-line jsx-a11y/role-supports-aria-props -- aria-description / aria-disabled / aria-invalid are valid ARIA 1.3 global or form-group attributes missing from the rule data<divaria-invalid={invalid || undefined}- aria-label="Agent runtime placement"+ aria-label={t(agentInfoMessages.placementLabel)}className={`space-y-4 rounded-lg transition-shadow ${invalid ? "ring-1 ring-inset ring-app-danger" : ""}`}role="group"tabIndex={invalid ? -1 : undefined}@@ -47,9 +56,12 @@ export function LocalRuntimeFields({onSelectionChange: () => void;selection: ReturnType<typeof useLocalRuntimeSelection>;}) {+ const t = useT();if (selection.isPending) {return (- <LocalRuntimeStatus>Looking for Local Computers...</LocalRuntimeStatus>+ <LocalRuntimeStatus>+ {t(agentInfoMessages.lookingForComputers)}+ </LocalRuntimeStatus>);}if (selection.error) {@@ -58,7 +70,7 @@ export function LocalRuntimeFields({connected={false}disabled={disabled}onRetry={() => void selection.refetch()}- title="Local Computers are unavailable."+ title={t(agentInfoMessages.computersUnavailable)}titleTone="danger"/>);@@ -69,7 +81,7 @@ export function LocalRuntimeFields({connected={false}disabled={disabled}onRetry={() => void selection.refetch()}- title="No Local Computer online"+ title={t(agentInfoMessages.noComputerOnline)}/>);}@@ -77,9 +89,11 @@ export function LocalRuntimeFields({return (<div className="grid gap-3 rounded-lg bg-app-sidebar p-3"><label className="block">- <span className="mb-1.5 block text-sm font-medium">Computer</span>+ <span className="mb-1.5 block text-sm font-medium">+ {t(agentRuntimeMessages.computer)}+ </span><Select- aria-label="Local Computer"+ aria-label={t(agentInfoMessages.localComputer)}className="ui-field-control w-full"disabled={disabled}onValueChange={(value) => {@@ -96,9 +110,11 @@ export function LocalRuntimeFields({</Select></label><label className="block">- <span className="mb-1.5 block text-sm font-medium">Runtime</span>+ <span className="mb-1.5 block text-sm font-medium">+ {t(agentRuntimeMessages.runtime)}+ </span><Select- aria-label="Local Runtime"+ aria-label={t(agentInfoMessages.localRuntime)}className="ui-field-control w-full capitalize"disabled={disabled}onValueChange={(value) => {@@ -116,7 +132,7 @@ export function LocalRuntimeFields({key={runtime.type}value={runtime.type}>- {runtimeLabel(runtime.type, runtime.status)}+ {runtimeLabel(runtime.type, runtime.status, t)}</SelectItem>))}</Select>@@ -133,31 +149,38 @@ export function LocalRuntimeFields({</div>) : null}<p className="text-xs leading-4 text-app-muted">- Apps and Skills stay on this machine.+ {t(agentInfoMessages.staysOnMachine)}</p></div>);}+type LocalRuntimeState =+ | "not_installed"+ | "authentication_required"+ | "ready"+ | "incompatible"+ | "error"+ | "unknown";++const runtimeStateLabels: Record<LocalRuntimeState, Message<string>> = {+ authentication_required: agentInfoMessages.statusSignInRequired,+ error: agentInfoMessages.statusDetectionFailed,+ unknown: computersMessages.statusUnavailable,+ incompatible: agentInfoMessages.statusUpgradeRequired,+ not_installed: computersMessages.notInstalled,+ ready: computersMessages.ready,+};+function runtimeLabel(type: string,- status:- | "not_installed"- | "authentication_required"- | "ready"- | "incompatible"- | "error"- | "unknown",+ status: LocalRuntimeState,+ t: Translate = translate,) {- const detail = {- authentication_required: "Sign in required",- error: "Detection failed",- unknown: "Status unavailable",- incompatible: "Upgrade required",- not_installed: "Not installed",- ready: "Ready",- }[status];- return `${type} - ${detail}`;+ return t(agentInfoMessages.runtimeOption, {+ runtime: type,+ status: t(runtimeStateLabels[status]),+ });}function LocalComputerSetupPrompt({@@ -173,6 +196,7 @@ function LocalComputerSetupPrompt({title: string;titleTone?: "danger";}) {+ const t = useT();return (<div className="space-y-3"><div className="flex flex-wrap items-start justify-between gap-2">@@ -182,14 +206,14 @@ function LocalComputerSetupPrompt({{title}</p><Button- aria-label="Retry Local Computers"+ aria-label={t(agentInfoMessages.retryComputers)}disabled={disabled}onClick={onRetry}size="compact"type="button"><Icon icon={RefreshIcon} size={14} />- Retry+ {t(commonMessages.retry)}</Button></div><ComputerSetupInstructions connected={connected} />diff --git a/apps/web/src/features/rooms/members/agent-skill-upload-panel.tsx b/apps/web/src/features/rooms/members/agent-skill-upload-panel.tsxindex 39978d54..b683dccb 100644--- a/apps/web/src/features/rooms/members/agent-skill-upload-panel.tsx+++ b/apps/web/src/features/rooms/members/agent-skill-upload-panel.tsx@@ -25,14 +25,19 @@ import type {TeamHubSkillManifest,TeamHubTenantAgent,} from "@/features/teamhub/teamhub-types";+import { commonMessages } from "@/i18n/common.messages";+import { type Translate, translate } from "@/i18n/language";+import type { Message } from "@/i18n/messages";+import { useT } from "@/i18n/use-translation";import { tenantAgentsQueryKey } from "../room-queries";+import { agentInfoMessages } from "./agent-info.messages";const acceptedSkillUpload = ".zip,.md,text/markdown,application/zip";export interface SkillManageHint {- title: string;- detail?: string;+ title: Message<string>;+ detail?: Message<string>;}export function AgentSkillUploadPanel({@@ -54,11 +59,12 @@ export function AgentSkillUploadPanel({tenantId: string;visibleLimit?: number;}) {+ const t = useT();const { client } = useTeamHubRuntime();const queryClient = useQueryClient();const input = useRef<HTMLInputElement>(null);const attempt = useRef<{ input: string; key: string } | undefined>(undefined);- const [notice, setNotice] = useState<string>();+ const [saved, setSaved] = useState(false);const [libraryOpen, setLibraryOpen] = useState(false);const bindings = useQuery({queryKey: agentSkillBindingsQueryKey(tenantId, agentId),@@ -90,7 +96,7 @@ export function AgentSkillUploadPanel({if (!page.page.has_more) break;const next = page.page.next_cursor;if (!next || seen.has(next))- throw new Error("Could not load all Skills. Please retry.");+ throw new Error(t(agentInfoMessages.skillsLoadIncomplete));seen.add(next);cursor = next;} while (cursor);@@ -101,9 +107,9 @@ export function AgentSkillUploadPanel({});const operation = useMutation({mutationFn: async (action: () => Promise<void>) => action(),- onMutate: () => setNotice(undefined),+ onMutate: () => setSaved(false),onSuccess: async () => {- setNotice("Saved. Future runs will use the new configuration.");+ setSaved(true);await Promise.all([queryClient.invalidateQueries({queryKey: agentSkillBindingsQueryKey(tenantId, agentId),@@ -162,7 +168,8 @@ export function AgentSkillUploadPanel({async function remove(skillId: string) {const revision = bindings.data?.binding_version;- if (revision == null) throw new Error("Reload Skill configuration first.");+ if (revision == null)+ throw new Error(t(agentInfoMessages.reloadSkillsFirst));await teamHubDone(client.api.DELETE("/v0/tenants/{tenantId}/agents/{agentId}/skill-bindings/{skillId}",@@ -186,7 +193,7 @@ export function AgentSkillUploadPanel({onClick={() => setLibraryOpen(true)}><Icon icon={PlusSignIcon} size={12} />- Add+ {t(agentInfoMessages.add)}</SettingsGroupAction><UploadSkillButtondisabled={!canManage || operation.isPending}@@ -196,24 +203,32 @@ export function AgentSkillUploadPanel({</>}footer={- notice || error ? (+ saved || error ? (<>{error ? (<p role="alert" className="text-app-danger">- {skillUploadErrorMessage(error)}+ {skillUploadErrorMessage(error, t)}</p>) : null}- {notice ? <p role="status">{notice}</p> : null}+ {saved ? (+ <p role="status">{t(agentInfoMessages.skillsSaved)}</p>+ ) : null}</>) : undefined}- label="Skills"- meta={<span aria-label={`${skills.length} Skills`}>{skills.length}</span>}+ label={t(agentInfoMessages.skills)}+ meta={+ <span+ aria-label={t(agentInfoMessages.skillCount, { count: skills.length })}+ >+ {skills.length}+ </span>+ }><inputref={input}accept={acceptedSkillUpload}- aria-label="Upload Skill package"+ aria-label={t(agentInfoMessages.uploadSkillPackage)}className="sr-only"disabled={!canManage}type="file"@@ -268,13 +283,16 @@ export function AgentSkillUploadPanel({</span>{skill.is_default ? null : (<button+ data-voice-risk="never"type="button"disabled={!canManage ||operation.isPending ||bindings.data == null}- aria-label={`Remove ${skill.name}`}+ aria-label={t(agentInfoMessages.removeSkill, {+ name: skill.name,+ })}className="-mr-1 inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-45 [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover:opacity-100 [@media(hover:hover)]:group-focus-within:opacity-100"onClick={() =>operation.mutate(() => remove(skill.skill_id))@@ -291,9 +309,9 @@ export function AgentSkillUploadPanel({) : (<SettingsRow icon={<Icon icon={BookOpen01Icon} size={16} />}><SettingsRowText- description="Add a Skill to give this Agent a repeatable way to handle a task."+ description={t(agentInfoMessages.noSkillsBody)}muted- title="No Skills added"+ title={t(agentInfoMessages.noSkillsTitle)}/></SettingsRow>)}@@ -306,7 +324,11 @@ export function AgentSkillUploadPanel({><SettingsRow icon={null}><span className="flex-1 text-[14px] font-medium text-foreground">- {expanded ? "Show fewer" : `Show all ${skills.length} Skills`}+ {expanded+ ? t(agentInfoMessages.showFewerSkills)+ : t(agentInfoMessages.showAllSkills, {+ count: skills.length,+ })}</span><IconclassName="text-muted-foreground"@@ -337,6 +359,7 @@ function SkillLibraryDialog({onInstall: (manifest: TeamHubSkillManifest) => void;pending: boolean;}) {+ const t = useT();const [query, setQuery] = useState("");const available = catalogSkills(manifests, installedIds);const needle = query.trim().toLowerCase();@@ -350,33 +373,37 @@ function SkillLibraryDialog({}): available;return (- <ModalDialog onClose={onClose} size="lg" title="Add Skill">+ <ModalDialog+ onClose={onClose}+ size="lg"+ title={t(agentInfoMessages.addSkill)}+ ><div className="flex min-h-0 flex-1 flex-col"><div className="border-b border-app-border px-4 py-3"><input- aria-label="Search Skills"+ aria-label={t(agentInfoMessages.searchSkills)}className="h-9 w-full rounded-lg border border-border bg-card px-3 text-sm outline-none transition-[border-color,box-shadow] duration-150 placeholder:text-app-placeholder hover:border-border-hover focus:border-foreground focus:ring-2 focus:ring-ring"onChange={(event) => setQuery(event.target.value)}- placeholder="Search"+ placeholder={t(commonMessages.search)}value={query}/></div><div className="workspace-scrollbar min-h-0 flex-1 overflow-y-auto p-1">{error ? (<div className="px-3 py-6 text-sm text-app-danger" role="alert">- <p>{skillUploadErrorMessage(error)}</p>+ <p>{skillUploadErrorMessage(error, t)}</p><buttonclassName="mt-2 underline"onClick={onRetry}type="button">- Retry+ {t(commonMessages.retry)}</button></div>) : pending && !manifests.length ? (<p className="flex items-center gap-2 px-3 py-6 text-sm text-app-muted"><Spinner size={15} />- Loading Skills…+ {t(agentInfoMessages.loadingSkills)}</p>) : shown.length ? (<ul>@@ -410,9 +437,11 @@ function SkillLibraryDialog({</ul>) : (<p className="px-3 py-6 text-sm text-app-muted">- {available.length- ? "No Skills match that search."- : "No more built-in Skills to add."}+ {t(+ available.length+ ? agentInfoMessages.noSkillsMatch+ : agentInfoMessages.noMoreSkills,+ )}</p>)}</div>@@ -459,6 +488,7 @@ function UploadSkillButton({hint: SkillManageHint;onClick: () => void;}) {+ const t = useT();const tooltipId = useId();const [open, setOpen] = useState(false);function show() {@@ -476,17 +506,21 @@ function UploadSkillButton({<SettingsGroupActiondisabled={disabled}aria-describedby={open ? tooltipId : undefined}- aria-label="Upload Skill"+ aria-label={t(agentInfoMessages.uploadSkill)}onBlur={hide}onClick={onClick}onFocus={show}onMouseEnter={show}><Icon icon={Upload01Icon} size={12} />- Upload+ {t(agentInfoMessages.upload)}</SettingsGroupAction>{open ? (- <HintPopover detail={hint.detail} id={tooltipId} title={hint.title} />+ <HintPopover+ detail={hint.detail ? t(hint.detail) : undefined}+ id={tooltipId}+ title={t(hint.title)}+ />) : null}</span>);@@ -519,10 +553,10 @@ function HintPopover({);}-function skillUploadErrorMessage(error: unknown) {+function skillUploadErrorMessage(error: unknown, t: Translate = translate) {return error instanceof Error? error.message- : "The Skill operation failed. Please retry.";+ : t(agentInfoMessages.skillOperationFailed);}function agentSkillBindingsQueryKey(tenantId: string, agentId: string) {diff --git a/apps/web/src/features/rooms/members/agent-status-avatar.tsx b/apps/web/src/features/rooms/members/agent-status-avatar.tsxindex 611b9295..074fb780 100644--- a/apps/web/src/features/rooms/members/agent-status-avatar.tsx+++ b/apps/web/src/features/rooms/members/agent-status-avatar.tsx@@ -1,5 +1,8 @@import { useContext } from "react";import { ActionMenu } from "@/components/ui/action-menu";+import { useT } from "@/i18n/use-translation";++import { agentInfoMessages } from "./agent-info.messages";import { ActorAvatar } from "./actor-avatar";import { AgentLiveActivities } from "./agent-live-activities";import {@@ -23,6 +26,7 @@ export function AgentStatusAvatar({status?: AgentAvatarStatus;onOpenProfile?: (actorId: string) => void;}) {+ const t = useT();const context = useContext(AgentAvatarStatusContext);const live = status ?? context.statuses.get(actorId);const openProfile = onOpenProfile ?? context.onOpenProfile;@@ -42,7 +46,10 @@ export function AgentStatusAvatar({openOnHoveronTriggerClick={!live ? () => openProfile(actorId) : undefined}placement="bottom-start"- label={`Open ${name} ${live ? "status" : "profile"}`}+ label={t(+ live ? agentInfoMessages.openStatus : agentInfoMessages.openProfile,+ { name },+ )}trigger={avatar}buttonClassName="shrink-0 rounded-full focus-visible:outline-2 focus-visible:outline-app-focus"menuClassName="agent-status-popover fixed z-[100] w-72 max-w-[calc(100vw-16px)] max-h-[min(360px,calc(100dvh-16px))] overflow-y-auto rounded-xl bg-popover p-1.5 shadow-md"@@ -73,7 +80,7 @@ export function AgentStatusAvatar({...(context.onOpenActivityLog? [{- label: "View activity",+ label: t(agentInfoMessages.viewActivity),onSelect: () => context.onOpenActivityLog?.(actorId),},]diff --git a/apps/web/src/features/rooms/members/agent-status.test.tsx b/apps/web/src/features/rooms/members/agent-status.test.tsxnew file mode 100644index 00000000..41015676--- /dev/null+++ b/apps/web/src/features/rooms/members/agent-status.test.tsx@@ -0,0 +1,66 @@+// @vitest-environment jsdom+import { cleanup, render, screen } from "@testing-library/react";+import { afterEach, describe, expect, it } from "vitest";++import { resetLanguageForTest, setLanguage } from "@/i18n/language";+import zhCN from "@/i18n/locales/zh-CN.json";++import { AgentStatus } from "./agent-status";++afterEach(() => {+ cleanup();+ resetLanguageForTest();+});++describe("AgentStatus", () => {+ it("words the online status and the task count in English", () => {+ render(+ <AgentStatus+ availability={{+ status: "online",+ label: "Online",+ active_task_count: 1,+ }}+ showDetails+ />,+ );+ expect(screen.getByText("Online")).toBeInTheDocument();+ expect(screen.getByText(/1 task in progress/)).toBeInTheDocument();+ });++ it("follows the interface language", async () => {+ await setLanguage("zh-CN");+ render(+ <AgentStatus+ availability={{+ status: "online",+ label: "Online",+ active_task_count: 2,+ }}+ showDetails+ />,+ );+ expect(screen.getByText(zhCN.agentInfo.online)).toBeInTheDocument();+ expect(+ screen.getByText(+ new RegExp(+ zhCN.agentInfo.tasksInProgress.other.replace("{count}", "2"),+ ),+ ),+ ).toBeInTheDocument();+ });++ it("shows the label TeamHub sent for any other status as it is", async () => {+ await setLanguage("zh-CN");+ render(+ <AgentStatus+ availability={{+ status: "unknown",+ label: "Status unavailable",+ active_task_count: 0,+ }}+ />,+ );+ expect(screen.getByText("Status unavailable")).toBeInTheDocument();+ });+});diff --git a/apps/web/src/features/rooms/members/agent-status.tsx b/apps/web/src/features/rooms/members/agent-status.tsxindex d1f286b7..3943400f 100644--- a/apps/web/src/features/rooms/members/agent-status.tsx+++ b/apps/web/src/features/rooms/members/agent-status.tsx@@ -1,4 +1,8 @@import type { TeamHubTenantAgentAvailabilitySnapshot } from "@/features/teamhub/teamhub-types";+import { type Translate, translate } from "@/i18n/language";+import { useT } from "@/i18n/use-translation";++import { agentInfoMessages } from "./agent-info.messages";type AgentAvailability = TeamHubTenantAgentAvailabilitySnapshot["availability"];@@ -9,10 +13,13 @@ const dotClasses: Record<AgentAvailability["status"], string> = {unknown: "bg-[var(--app-status-warning-text)]",};-function agentStatusDetail(availability: AgentAvailability) {+function agentStatusDetail(+ availability: AgentAvailability,+ t: Translate = translate,+) {const activeTaskCount = availability.active_task_count ?? 0;return activeTaskCount > 0- ? `${activeTaskCount} ${activeTaskCount === 1 ? "task" : "tasks"} in progress`+ ? t(agentInfoMessages.tasksInProgress, { count: activeTaskCount }): availability.status !== "online"? availability.current_activity?.summary: undefined;@@ -41,9 +48,12 @@ export function AgentStatus({availability: AgentAvailability;showDetails?: boolean;}) {+ const t = useT();const status = availability.status;- const label = status === "online" ? "Online" : availability.label;- const detail = agentStatusDetail(availability);+ // Any other status shows the label TeamHub sent, in TeamHub's own words.+ const label =+ status === "online" ? t(agentInfoMessages.online) : availability.label;+ const detail = agentStatusDetail(availability, t);return (<span className="inline-flex min-w-0 items-center gap-1.5"><spandiff --git a/apps/web/src/features/rooms/members/edit-agent-instructions-dialog.tsx b/apps/web/src/features/rooms/members/edit-agent-instructions-dialog.tsxindex fdfb6fb9..203234e0 100644--- a/apps/web/src/features/rooms/members/edit-agent-instructions-dialog.tsx+++ b/apps/web/src/features/rooms/members/edit-agent-instructions-dialog.tsx@@ -2,11 +2,11 @@ import { type FormEvent, useId, useState } from "react";import { Button } from "@/components/ui/button";import { ModalDialog } from "@/components/ui/modal-dialog";+import { commonMessages } from "@/i18n/common.messages";+import { useT } from "@/i18n/use-translation";-import {- presentAgentInstructions,- UNSET_AGENT_INSTRUCTIONS,-} from "./agent-instruction-text";+import { agentInfoMessages } from "./agent-info.messages";+import { presentAgentInstructions } from "./agent-instruction-text";export function EditAgentInstructionsDialog({instructions,@@ -23,6 +23,7 @@ export function EditAgentInstructionsDialog({onClose: () => void;onSave: (input: { instructions: string }) => void;}) {+ const t = useT();const formId = useId();const [draft, setDraft] = useState(() =>presentAgentInstructions(instructions),@@ -37,14 +38,14 @@ export function EditAgentInstructionsDialog({return (<ModalDialog- description="Define how your Agent should work and respond."+ description={t(agentInfoMessages.instructionsDescription)}onClose={onClose}size="md"- title="Edit instructions"+ title={t(agentInfoMessages.editInstructions)}footer={<>- <Button onClick={onClose} type="button">- {canEdit ? "Cancel" : "Close"}+ <Button data-voice-close onClick={onClose} type="button">+ {t(canEdit ? commonMessages.cancel : commonMessages.close)}</Button>{canEdit ? (<Button@@ -54,7 +55,7 @@ export function EditAgentInstructionsDialog({tone="primary"type="submit">- Save+ {t(commonMessages.save)}</Button>) : null}</>@@ -62,12 +63,12 @@ export function EditAgentInstructionsDialog({><form className="px-5 py-4" id={formId} onSubmit={submit}><textarea- aria-label="Agent instructions"+ aria-label={t(agentInfoMessages.agentInstructions)}className="min-h-64 w-full resize-y rounded-md border border-border bg-card px-3 py-2.5 text-sm leading-6 text-foreground outline-none transition-[border-color,box-shadow] duration-150 placeholder:text-app-placeholder hover:border-border-hover focus:border-foreground focus:ring-2 focus:ring-ring disabled:opacity-60"disabled={disabled}maxLength={50000}onChange={(event) => setDraft(event.target.value)}- placeholder={UNSET_AGENT_INSTRUCTIONS}+ placeholder={t(agentInfoMessages.instructionsUnset)}value={draft}/>{error ? (diff --git a/apps/web/src/features/rooms/members/edit-agent-profile-dialog.tsx b/apps/web/src/features/rooms/members/edit-agent-profile-dialog.tsxindex 6cfb42da..52729a94 100644--- a/apps/web/src/features/rooms/members/edit-agent-profile-dialog.tsx+++ b/apps/web/src/features/rooms/members/edit-agent-profile-dialog.tsx@@ -5,6 +5,8 @@ import { type FormEvent, useId, useRef, useState } from "react";import { Button } from "@/components/ui/button";import { ModalDialog } from "@/components/ui/modal-dialog";+import { commonMessages } from "@/i18n/common.messages";+import { useT } from "@/i18n/use-translation";import { teamHubData } from "@/features/teamhub/teamhub-api";import { useTeamHubRuntime } from "@/features/teamhub/teamhub-runtime";import type { TeamHubActor } from "@/features/teamhub/teamhub-types";@@ -18,6 +20,7 @@ import {type AgentAvatarKey,} from "./agent-avatar";import { AgentAvatarEditor } from "./agent-avatar-picker";+import { agentInfoMessages } from "./agent-info.messages";import { agentNameControlSize } from "./agent-name-control";export function EditAgentProfileDialog({@@ -40,6 +43,7 @@ export function EditAgentProfileDialog({onSave: (input: { name: string }) => void;}) {const { client } = useTeamHubRuntime();+ const t = useT();const queryClient = useQueryClient();const formId = useId();const nameInputRef = useRef<HTMLInputElement>(null);@@ -102,16 +106,20 @@ export function EditAgentProfileDialog({<ModalDialogdescription={canEditName- ? "Update your Agent's name and avatar."- : "Update your Agent's avatar."+ ? t(agentInfoMessages.profileDescription)+ : t(agentInfoMessages.avatarDescription)}onClose={onClose}size="md"- title={canEditName ? "Edit profile" : "Edit avatar"}+ title={t(+ canEditName+ ? agentInfoMessages.editProfile+ : agentInfoMessages.editAvatar,+ )}footer={<>- <Button onClick={onClose} type="button">- {canEdit ? "Cancel" : "Close"}+ <Button data-voice-close onClick={onClose} type="button">+ {t(canEdit ? commonMessages.cancel : commonMessages.close)}</Button>{canEdit ? (<Button@@ -125,7 +133,7 @@ export function EditAgentProfileDialog({tone="primary"type="submit">- Save+ {t(commonMessages.save)}</Button>) : null}</>@@ -148,26 +156,26 @@ export function EditAgentProfileDialog({{canEditName ? (<div className="mt-5 flex h-8 max-w-full items-center justify-center gap-0.5 rounded-md border border-transparent px-0.5 transition-[background-color,border-color,box-shadow] duration-150 hover:bg-muted/70 focus-within:border-foreground focus-within:bg-card focus-within:ring-2 focus-within:ring-ring"><input- aria-label="Agent name"+ aria-label={t(agentInfoMessages.agentName)}className="agent-profile-name-control h-7 w-auto max-w-[280px] shrink-0 border-0 bg-transparent px-1 text-center outline-none placeholder:text-app-placeholder focus-visible:ring-0"disabled={disabled}maxLength={120}onChange={(event) => setName(event.target.value)}- placeholder="Agent name"+ placeholder={t(agentInfoMessages.agentName)}ref={nameInputRef}size={agentNameControlSize(name)}value={name}/>{canEditName ? (<button- aria-label="Edit agent name"+ aria-label={t(agentInfoMessages.editAgentName)}className="inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-app-focus disabled:opacity-45"disabled={disabled}onClick={() => {nameInputRef.current?.focus();nameInputRef.current?.select();}}- title="Edit agent name"+ title={t(agentInfoMessages.editAgentName)}type="button"><Icon icon={PencilEdit02Icon} size={16} />@@ -178,7 +186,7 @@ export function EditAgentProfileDialog({</div>{error || saveAvatar.error ? (<p className="mt-4 text-sm text-app-danger" role="alert">- {error ?? "The avatar could not be saved. Try again."}+ {error ?? t(agentInfoMessages.avatarSaveFailed)}</p>) : null}</form>diff --git a/apps/web/src/features/rooms/task-sidebar/adapters/agent-info-panel-tab.tsx b/apps/web/src/features/rooms/task-sidebar/adapters/agent-info-panel-tab.tsxindex 7f02d950..a5a1f242 100644--- a/apps/web/src/features/rooms/task-sidebar/adapters/agent-info-panel-tab.tsx+++ b/apps/web/src/features/rooms/task-sidebar/adapters/agent-info-panel-tab.tsx@@ -3,6 +3,8 @@ import { formatDateTime } from "@/lib/date-format";import { useMemo, useState } from "react";import { Icon } from "@/components/ui/icon";+import { formatLocale } from "@/i18n/language";+import { useT } from "@/i18n/use-translation";import type {TeamHubActor,@@ -10,7 +12,9 @@ import type {} from "@/features/teamhub/teamhub-types";import { AgentProfileContent } from "../../members/actor-profile";+import { agentInfoMessages } from "../../members/agent-info.messages";import { useRoomMessageRunStatuses } from "../../runtime-status/use-room-message-run-statuses";+import { sidePanelMessages } from "../side-panel.messages";import {agentInfoActivityEntries,type AgentInfoActivityEntry,@@ -27,9 +31,10 @@ export function AgentInfoPanelTab({roomId: string;tenantId: string;}) {+ const t = useT();return (<div- aria-label="Agent info"+ aria-label={t(sidePanelMessages.agentInfo)}className={hidden ? "hidden" : "h-full min-h-0 overflow-hidden"}data-testid="panel-tab-agent-info"hidden={hidden || undefined}@@ -61,6 +66,7 @@ export function AgentActivityLog({roomMessages: readonly TeamHubMessage[];tenantId: string;}) {+ const t = useT();const [page, setPage] = useState(0);const promptIds = useMemo(() => roomMessages.map((message) => message.id),@@ -80,9 +86,9 @@ export function AgentActivityLog({const currentPage = Math.min(page, pageCount - 1);const visible = entries.slice(currentPage * 10, (currentPage + 1) * 10);return (- <section className="p-4" aria-label="Agent activity history">+ <section className="p-4" aria-label={t(agentInfoMessages.activityHistory)}><p className="mb-3 text-xs text-app-muted">- Recent activity in this conversation+ {t(agentInfoMessages.recentActivity)}</p>{visible.length ? (<ul className="overflow-hidden rounded-xl border border-app-border">@@ -92,7 +98,10 @@ export function AgentActivityLog({className="border-t border-app-border first:border-t-0"><button- aria-label={`View ${agentName} activity: ${entry.promptText}`}+ aria-label={t(agentInfoMessages.viewAgentActivity, {+ name: agentName,+ prompt: entry.promptText,+ })}onClick={() => onView(entry)}type="button"className="flex w-full items-center gap-3 px-3 py-3 text-left hover:bg-app-hover focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-app-focus"@@ -105,13 +114,17 @@ export function AgentActivityLog({dateTime={entry.createdAt}className="mt-1 block text-xs text-app-muted">- {formatDateTime(entry.createdAt, {- month: "short",- day: "numeric",- hour: "2-digit",- minute: "2-digit",- hour12: false,- })}+ {formatDateTime(+ entry.createdAt,+ {+ month: "short",+ day: "numeric",+ hour: "2-digit",+ minute: "2-digit",+ hour12: false,+ },+ formatLocale(),+ )}</time></span><Icon@@ -125,12 +138,12 @@ export function AgentActivityLog({</ul>) : (<p className="py-8 text-center text-xs text-app-muted" role="status">- No recent activity+ {t(agentInfoMessages.noRecentActivity)}</p>)}{pageCount > 1 ? (<nav- aria-label="Activity pages"+ aria-label={t(agentInfoMessages.activityPages)}className="mt-4 flex items-center justify-between text-xs"><button@@ -139,7 +152,7 @@ export function AgentActivityLog({disabled={currentPage === 0}onClick={() => setPage(currentPage - 1)}>- Previous+ {t(agentInfoMessages.previous)}</button><span className="text-app-muted">{currentPage + 1} / {pageCount}@@ -150,7 +163,7 @@ export function AgentActivityLog({disabled={currentPage === pageCount - 1}onClick={() => setPage(currentPage + 1)}>- Next+ {t(agentInfoMessages.next)}</button></nav>) : null}diff --git a/apps/web/src/i18n/locales/zh-CN.glossary.md b/apps/web/src/i18n/locales/zh-CN.glossary.mdindex d2904ffc..d8558c4f 100644--- a/apps/web/src/i18n/locales/zh-CN.glossary.md+++ b/apps/web/src/i18n/locales/zh-CN.glossary.md@@ -167,6 +167,9 @@ elsewhere.| Session (a sign-in) | 登录 / 浏览器会话 | `会话` only for the browser session. || Panel, Panel view | 面板、面板视图 | A view in the Room's side panel. || Collaboration | 协作 | The panel on how a Room's Agents work together. |+| Sponsor (of an Agent) | 创建者 | The Human who created the Agent. |+| Avatar | 头像 | |+| Runs on | 运行位置 | Where an Agent runs: Computer and Runtime. |## Stylediff --git a/apps/web/src/i18n/locales/zh-CN.json b/apps/web/src/i18n/locales/zh-CN.jsonindex 84d01748..2f0444e2 100644--- a/apps/web/src/i18n/locales/zh-CN.json+++ b/apps/web/src/i18n/locales/zh-CN.json@@ -2177,5 +2177,105 @@"kindHuman": "成员","noMembers": "暂无成员","noRoomFiles": "暂无 Room 文件"+ },+ "agentInfo": {+ "settingsTabs": "Agent 设置",+ "tabDetails": "详情",+ "tabRoutines": "Routine",+ "tabConnectors": "连接器",+ "routinesNeedRoom": "从 Room 里打开这个 Agent,才能看到它在那里的 Routine。",+ "editAvatar": "编辑头像",+ "agentName": "Agent 名称",+ "editName": "编辑名称 {name}",+ "online": "在线",+ "tasksInProgress": { "other": "{count} 个任务进行中" },+ "openStatus": "打开 {name} 的状态",+ "openProfile": "打开 {name} 的个人资料",+ "viewActivity": "查看活动",+ "instructions": "指令",+ "agentInstructions": "Agent 指令",+ "editInstructions": "编辑指令",+ "instructionsContent": "指令内容",+ "instructionsUnset": "还没有设置指令,第一次对话后会自动写好。",+ "instructionsDescription": "告诉 Agent 该怎样工作和回复。",+ "showMore": "展开",+ "showLess": "收起",+ "runtimeConfiguration": "Runtime 配置",+ "runsOn": "运行位置",+ "runsOnLocal": "本地 · {computer}",+ "runsOnLocalOnline": "本地 · {computer} · 在线",+ "runsOnLocalOffline": "本地 · {computer} · 离线",+ "localComputer": "本地电脑",+ "modelWithEffort": "{model} · {effort}",+ "runtimeDetails": "Runtime 详情",+ "runtimeStatus": "<term>状态:</term><value>{status}</value>",+ "runtimeVersion": "<term>版本:</term><value>{version}</value>",+ "runtimeBusy": "这个 Agent 正在工作,暂时不能修改 Runtime 设置。",+ "agentActions": "Agent 操作",+ "profileUnavailable": "无法获取 Agent 资料。",+ "skills": "Skill",+ "skillCount": { "other": "{count} 个 Skill" },+ "add": "添加",+ "upload": "上传",+ "uploadSkill": "上传 Skill",+ "uploadSkillPackage": "上传 Skill 包",+ "uploadFormats": "ZIP 或 SKILL.md",+ "uploadUpgrades": "同名的 Skill 会被升级。",+ "sponsorOnlySkills": "只有创建者可以修改 Skill",+ "removeSkill": "移除 {name}",+ "noSkillsTitle": "还没有添加 Skill",+ "noSkillsBody": "添加一个 Skill,让这个 Agent 用固定的方法处理某类任务。",+ "showFewerSkills": "收起",+ "showAllSkills": { "other": "显示全部 {count} 个 Skill" },+ "addSkill": "添加 Skill",+ "searchSkills": "搜索 Skill",+ "loadingSkills": "正在加载 Skill…",+ "noSkillsMatch": "没有匹配的 Skill。",+ "noMoreSkills": "没有更多可添加的内置 Skill。",+ "skillsSaved": "已保存,之后的运行会使用新配置。",+ "skillsLoadIncomplete": "没能加载全部 Skill,请重试。",+ "reloadSkillsFirst": "请先重新加载 Skill 配置。",+ "skillOperationFailed": "Skill 操作失败,请重试。",+ "chooseAvatar": "选择头像",+ "avatars": "头像",+ "avatarOption": "头像 {number}",+ "uploadImage": "上传图片",+ "avatarImageFile": "头像图片文件",+ "avatarBackgroundColor": "头像背景色",+ "avatarUnusable": "这张图片无法使用,请换一张 JPEG、PNG 或 WebP 图片。",+ "editProfile": "编辑资料",+ "profileDescription": "修改 Agent 的名称和头像。",+ "avatarDescription": "修改 Agent 的头像。",+ "editAgentName": "编辑 Agent 名称",+ "avatarSaveFailed": "头像保存失败,请重试。",+ "placementLabel": "Agent 的运行位置",+ "lookingForComputers": "正在查找本地电脑…",+ "computersUnavailable": "本地电脑暂不可用。",+ "noComputerOnline": "没有在线的本地电脑",+ "localRuntime": "本地 Runtime",+ "staysOnMachine": "应用和 Skill 都留在这台电脑上。",+ "runtimeOption": "{runtime} - {status}",+ "statusSignInRequired": "需要登录",+ "statusDetectionFailed": "检测失败",+ "statusUpgradeRequired": "需要升级",+ "retryComputers": "重新查找本地电脑",+ "activityHistory": "Agent 活动记录",+ "recentActivity": "这个对话里最近的活动",+ "viewAgentActivity": "查看 {name} 的活动:{prompt}",+ "noRecentActivity": "暂无最近活动",+ "activityPages": "活动分页",+ "previous": "上一页",+ "next": "下一页",+ "profileLabel": "{name} 的个人资料",+ "closeProfile": "关闭个人资料",+ "noPublicHandle": "暂无公开用户名",+ "handleMember": "{handle} · 成员",+ "human": "成员",+ "agent": "Agent",+ "noDescription": "暂无描述",+ "role": "角色",+ "joined": "加入时间",+ "createdAgents": "创建的 Agent",+ "noCreatedAgents": "暂无创建的 Agent。"}}