Skip to content

Commit 148f98c

Browse files
committed
feat(web): translate the interfaces that arrived with the upstream merge
The merge brought new settings, sidebar, chat, and device surfaces that were still English. Route the remaining copy through the existing catalogs, reuse shared keys where the wording matches, and keep runtime and managed-policy strings verbatim. English output is unchanged.
1 parent 46e9c6b commit 148f98c

26 files changed

Lines changed: 2268 additions & 681 deletions

‎apps/web/src/components/GitActionsControl.tsx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ function PublishRepositoryDialog(props: PublishRepositoryDialogProps) {
841841
role="alert"
842842
className="rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive"
843843
>
844-
<p className="font-medium">Publish failed</p>
844+
<p className="font-medium">{t("app.git.publish.failed")}</p>
845845
<p className="mt-0.5 text-destructive/90">{publishError}</p>
846846
</div>
847847
) : null}
@@ -1663,7 +1663,9 @@ export default function GitActionsControl({
16631663
onClick={onOpenChanges}
16641664
>
16651665
<FileDiffIcon className={THREAD_DETAILS_PANEL_ICON_CLASS} aria-hidden />
1666-
<span className={cn("flex-1 text-left", THREAD_DETAILS_PANEL_LABEL_CLASS)}>Changes</span>
1666+
<span className={cn("flex-1 text-left", THREAD_DETAILS_PANEL_LABEL_CLASS)}>
1667+
{t("chat.details.changes")}
1668+
</span>
16671669
<span className="flex items-center gap-1.5 font-mono text-xs tabular-nums">
16681670
<span
16691671
className={

‎apps/web/src/components/chat/ExpandedImageDialog.tsx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { Dialog, DialogPopup, DialogTitle } from "../ui/dialog";
88
import type { ExpandedImageItem, ExpandedImagePreview } from "./ExpandedImagePreview";
99
import { resolveExternalWebLinkHost } from "./externalLinkContextMenu";
1010
import { useAssetUrlRefresh, useAssetUrlState } from "../../assets/assetUrls";
11+
import { useT } from "../../hooks/useI18n";
1112
import { OpenMediaLink } from "../media/OpenMediaLink";
1213
import { MediaActions, type MediaActionSource } from "../media/MediaActions";
1314
import { MediaVideoPlayer } from "../media/MediaVideoPlayer";
@@ -83,6 +84,7 @@ export const ExpandedImageDialog = memo(function ExpandedImageDialog({
8384
preview,
8485
onClose,
8586
}: ExpandedImageDialogProps) {
87+
const t = useT();
8688
const [imageOffset, setImageOffset] = useState(0);
8789
const [failedImageSrc, setFailedImageSrc] = useState<string | null>(null);
8890
const [accessibilityDetailsSrc, setAccessibilityDetailsSrc] = useState<string | null>(null);
@@ -202,7 +204,7 @@ export const ExpandedImageDialog = memo(function ExpandedImageDialog({
202204
size="icon"
203205
variant="media-navigation"
204206
className="left-0 top-auto bottom-0 translate-y-0 sm:top-1/2 sm:bottom-auto sm:-translate-y-1/2"
205-
aria-label="Previous media"
207+
aria-label={t("chat.media.previous")}
206208
onClick={() => navigateImage(-1)}
207209
>
208210
<ChevronLeftIcon className="size-5" />
@@ -278,7 +280,7 @@ export const ExpandedImageDialog = memo(function ExpandedImageDialog({
278280
size="icon"
279281
variant="media-navigation"
280282
className="right-0 top-auto bottom-0 translate-y-0 sm:top-1/2 sm:bottom-auto sm:-translate-y-1/2"
281-
aria-label="Next media"
283+
aria-label={t("chat.media.next")}
282284
onClick={() => navigateImage(1)}
283285
>
284286
<ChevronRightIcon className="size-5" />

‎apps/web/src/components/chat/MessagesTimeline.tsx‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,8 +1630,13 @@ function useDeferredWorkLoading(
16301630
}
16311631

16321632
function WorkHistorySkeleton() {
1633+
const t = useT();
16331634
return (
1634-
<div role="status" aria-label="Loading work history" className="space-y-2 px-1 pb-1 pt-3">
1635+
<div
1636+
role="status"
1637+
aria-label={t("chat.timeline.loadingWorkHistory")}
1638+
className="space-y-2 px-1 pb-1 pt-3"
1639+
>
16351640
{[0, 1, 2].map((index) => (
16361641
<div key={index} className="flex items-center gap-2" aria-hidden="true">
16371642
<Skeleton className="size-3 shrink-0" />
@@ -1681,6 +1686,7 @@ function TurnFoldTimelineRow({ row }: { row: Extract<TimelineRow, { kind: "turn-
16811686

16821687
function AttemptFoldTimelineRow({ row }: { row: Extract<TimelineRow, { kind: "attempt-fold" }> }) {
16831688
const ctx = use(TimelineRowCtx);
1689+
const t = useT();
16841690
const { loading, error, toggle } = useDeferredWorkLoading(row, () =>
16851691
ctx.onToggleAttemptFold(row.attemptId),
16861692
);
@@ -1704,7 +1710,7 @@ function AttemptFoldTimelineRow({ row }: { row: Extract<TimelineRow, { kind: "at
17041710
{row.label}
17051711
{error ? ` · ${error}` : ""}
17061712
</span>
1707-
<span className="text-2xs text-muted-foreground">Cut off by a steer</span>
1713+
<span className="text-2xs text-muted-foreground">{t("chat.timeline.cutOffBySteer")}</span>
17081714
</button>
17091715
{loading ? <WorkHistorySkeleton /> : null}
17101716
</div>

‎apps/web/src/components/chat/NativeChildWorkDialog.tsx‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { useState } from "react";
1010

1111
import { orchestrationEnvironment } from "../../state/orchestration";
1212
import { useEnvironmentQuery } from "../../state/query";
13+
import { useT } from "../../hooks/useI18n";
1314
import { Button } from "../ui/button";
1415
import {
1516
Dialog,
@@ -31,17 +32,18 @@ export function NativeChildWorkDialog(props: {
3132
readonly environmentId: EnvironmentId;
3233
readonly threadId: ThreadId;
3334
}) {
35+
const t = useT();
3436
const [open, setOpen] = useState(false);
3537
return (
3638
<Dialog open={open} onOpenChange={setOpen}>
3739
<Button size="sm" variant="ghost" onClick={() => setOpen(true)}>
3840
<ListTreeIcon />
39-
<span className="@max-[420px]/composer-surface:sr-only">Subagent work</span>
41+
<span className="@max-[420px]/composer-surface:sr-only">{t("chat.work.subagentWork")}</span>
4042
</Button>
4143
<DialogPopup className="max-w-2xl">
4244
<DialogHeader>
43-
<DialogTitle>Subagent work</DialogTitle>
44-
<DialogDescription>Read only. These subagents cannot take messages.</DialogDescription>
45+
<DialogTitle>{t("chat.work.subagentWork")}</DialogTitle>
46+
<DialogDescription>{t("chat.work.subagentWorkReadOnly")}</DialogDescription>
4547
</DialogHeader>
4648
{open ? <NativeChildWorkContent {...props} /> : null}
4749
</DialogPopup>
@@ -85,6 +87,7 @@ function NativeChildWorkContent(props: {
8587
}
8688

8789
function NativeChild(props: { readonly child: OrchestrationV2NativeChildWork }) {
90+
const t = useT();
8891
const { child } = props;
8992
return (
9093
<section aria-label={child.role || "Subagent"} className="flex min-w-0 flex-col gap-2">
@@ -93,10 +96,10 @@ function NativeChild(props: { readonly child: OrchestrationV2NativeChildWork })
9396
{child.prompt}
9497
</p>
9598
{child.truncated ? (
96-
<p className="text-xs text-muted-foreground">Earlier steps are not shown.</p>
99+
<p className="text-xs text-muted-foreground">{t("chat.work.earlierStepsHidden")}</p>
97100
) : null}
98101
{child.steps === null ? (
99-
<p className="text-xs text-muted-foreground">No transcript yet.</p>
102+
<p className="text-xs text-muted-foreground">{t("chat.work.noTranscript")}</p>
100103
) : (
101104
<ol className="m-0 flex list-none flex-col gap-2 border-s ps-3">
102105
{child.steps.map((step) => (

‎apps/web/src/components/chat/ProviderSubagentBar.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { ArrowUpLeftIcon } from "lucide-react";
77
import type { ReactNode } from "react";
88

99
import { tickTextContent } from "~/lib/tickTextContent";
10+
import { useT } from "../../hooks/useI18n";
1011
import type { ProviderInstanceEntry } from "../../providerInstances";
1112
import { Button } from "../ui/button";
1213
import { ProviderInstanceIcon } from "./ProviderInstanceIcon";
@@ -20,6 +21,7 @@ export function ProviderSubagentBar(props: {
2021
readonly onOpenParent: (() => void) | null;
2122
readonly actions?: ReactNode;
2223
}) {
24+
const t = useT();
2325
const { status } = props;
2426
const live = status !== null && isOrchestrationV2WorkActive(status.status);
2527
const modelDescription =
@@ -70,7 +72,7 @@ export function ProviderSubagentBar(props: {
7072
{props.onOpenParent ? (
7173
<Button size="sm" variant="ghost" onClick={props.onOpenParent}>
7274
<ArrowUpLeftIcon />
73-
<span className="@max-[320px]/composer-surface:sr-only">Open parent</span>
75+
<span className="@max-[320px]/composer-surface:sr-only">{t("chat.work.openParent")}</span>
7476
</Button>
7577
) : null}
7678
</div>

‎apps/web/src/components/chat/ThreadRelationshipsControl.tsx‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ import {
5959
import { useRef, useState, type ReactNode } from "react";
6060

6161
import { useArchivedThreadSnapshots } from "../../lib/archivedThreadsState";
62+
import { useT } from "../../hooks/useI18n";
6263
import { buildThreadRouteParams } from "../../threadRoutes";
6364
import {
6465
useProjects,
@@ -112,11 +113,12 @@ function ThreadLineageRowList(props: {
112113
readonly onShowMore: () => void;
113114
readonly children: ReactNode;
114115
}) {
116+
const t = useT();
115117
return (
116118
<>
117119
{/* ScrollArea's max-height viewport measures badly inside this scrolling panel. */}
118120
<ul
119-
aria-label="Related threads"
121+
aria-label={t("chat.lineage.relatedThreads")}
120122
className="m-0 max-h-[13.5rem] list-none overflow-y-auto overscroll-contain p-0 has-data-workflow-expanded:max-h-[min(28rem,55dvh)]"
121123
>
122124
{props.children}
@@ -384,6 +386,7 @@ export function ThreadRelationshipsPanel(props: {
384386
readonly showLineage: boolean;
385387
readonly showSideChats: boolean;
386388
}) {
389+
const t = useT();
387390
const ref = scopeThreadRef(props.environmentId, props.threadId);
388391
const projection = useThreadProjection(ref)?.projection ?? null;
389392
const providersByEnvironment = useEnvironmentProviders();
@@ -864,7 +867,7 @@ export function ThreadRelationshipsPanel(props: {
864867
variant="ghost"
865868
part="icon"
866869
tone="destructive"
867-
aria-label={`Stop subagent ${threadTitle}`}
870+
aria-label={t("chat.lineage.stopSubagentNamed", { title: threadTitle })}
868871
disabled={stoppingId !== null}
869872
onClick={() => void stopSubagent(threadId, agent)}
870873
/>
@@ -876,7 +879,7 @@ export function ThreadRelationshipsPanel(props: {
876879
<SquareIcon aria-hidden className="size-3 fill-current" />
877880
)}
878881
</TooltipTrigger>
879-
<TooltipPopup side="left">Stop subagent</TooltipPopup>
882+
<TooltipPopup side="left">{t("chat.lineage.stopSubagent")}</TooltipPopup>
880883
</Tooltip>
881884
</div>
882885
) : null}
@@ -908,7 +911,7 @@ export function ThreadRelationshipsPanel(props: {
908911
size="icon-xs"
909912
variant="ghost"
910913
part="icon"
911-
aria-label="More thread actions"
914+
aria-label={t("chat.lineage.moreThreadActions")}
912915
disabled={busyAction !== null}
913916
/>
914917
}

‎apps/web/src/components/chat/V2LifecycleRow.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ import { ProviderInstanceIcon, providerTextColor } from "./ProviderInstanceIcon"
6161
import { cn } from "~/lib/utils";
6262
import { TimelineSystemDivider } from "./TimelineSystemDivider";
6363
import { subagentResumedSince } from "./V2LifecycleRow.logic";
64+
import { useT } from "../../hooks/useI18n";
6465
import { Button, InlineButton } from "../ui/button";
6566
import { T3Wordmark } from "../T3Wordmark";
6667

@@ -73,11 +74,12 @@ export function V2LifecycleRow(props: {
7374
readonly runs: ReadonlyArray<HandoffTimelineRun>;
7475
readonly onOpenThread: (threadId: ThreadId) => void;
7576
}) {
77+
const t = useT();
7678
const { item } = props;
7779
if (item.type === "run_interrupt_result") {
7880
return (
7981
<TimelineSystemDivider
80-
label="Run interrupted"
82+
label={t("chat.timeline.runInterrupted")}
8183
detail={item.message}
8284
icon={CircleStopIcon}
8385
wrapDetail

0 commit comments

Comments
 (0)