Skip to content

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 not-found, shared and loading-error pages

Kilyn292585c616d3
diff --git a/apps/web/src/app/route-error-surfaces.tsx b/apps/web/src/app/route-error-surfaces.tsx
index 58c51223..eaa5c5b9 100644
--- a/apps/web/src/app/route-error-surfaces.tsx
+++ b/apps/web/src/app/route-error-surfaces.tsx
@@ -12,6 +12,12 @@ import { TeamHubError } from "@/features/teamhub/teamhub-client";
import { Button } from "@/components/ui/button";
import { BrandMark } from "@/components/ui/brand-mark";
import { Icon } from "@/components/ui/icon";
+import { navigationMessages } from "@/features/rooms/room-navigation.messages";
+import { settingsMessages } from "@/features/settings/settings.messages";
+import { commonMessages } from "@/i18n/common.messages";
+import { useT } from "@/i18n/use-translation";
+
+import { routePagesMessages } from "./route-pages.messages";
export function FullPageRouteErrorSurface() {
const { tenantId } = useParams();
@@ -24,12 +30,13 @@ export function PanelRouteErrorSurface() {
}
function PanelRouteErrorContent() {
+ const t = useT();
const content = useRouteErrorContent(false);
const navigate = useNavigate();
return (
<main
- aria-label="TeamHub loading error"
+ aria-label={t(routePagesMessages.loadingError)}
className="app-work-surface flex min-h-0 flex-1 items-center justify-center bg-app-surface px-6 py-12 text-center"
role="alert"
>
@@ -39,13 +46,18 @@ function PanelRouteErrorContent() {
void (content.restricted ? navigate("/") : navigate(0));
}}
title={content.title}
- actionLabel={content.restricted ? "Back to my Rooms" : "Try again"}
+ actionLabel={t(
+ content.restricted
+ ? routePagesMessages.backToRooms
+ : commonMessages.tryAgain,
+ )}
/>
</main>
);
}
function ApplicationRouteErrorSurface({ tenantId }: { tenantId?: string }) {
+ const t = useT();
const navigate = useNavigate();
const location = useLocation();
const { roomId } = useParams();
@@ -62,24 +74,24 @@ function ApplicationRouteErrorSurface({ tenantId }: { tenantId?: string }) {
return (
<div className="app-shell flex h-dvh min-h-0 overflow-hidden bg-app-canvas text-app-ink">
<aside
- aria-label="Collaboration sidebar"
+ aria-label={t(navigationMessages.sidebar)}
className="app-navigation hidden shrink-0 bg-app-sidebar md:flex"
>
<nav
- aria-label="Primary navigation"
+ aria-label={t(navigationMessages.primary)}
className="app-primary-navigation flex w-14 flex-col items-center bg-app-rail py-3"
>
<BrandMark className="size-8" />
<div className="mt-4 flex w-full flex-1 flex-col items-center gap-2">
<ErrorRailLink
icon={<Icon icon={Message01Icon} size={16} />}
- label="Rooms"
+ label={t(routePagesMessages.rooms)}
to={roomsPath}
/>
<div className="mt-auto">
<ErrorRailLink
icon={<Icon icon={Settings01Icon} size={16} />}
- label="Settings"
+ label={t(settingsMessages.title)}
to={tenantId ? `/t/${tenantId}/settings` : undefined}
/>
</div>
@@ -87,18 +99,20 @@ function ApplicationRouteErrorSurface({ tenantId }: { tenantId?: string }) {
</nav>
{showRoomList ? (
<nav
- aria-label="Room navigation"
+ aria-label={t(routePagesMessages.roomNavigation)}
className="app-secondary-navigation flex w-[248px] flex-col border-r border-border/60 bg-app-sidebar"
>
<div className="px-3 pb-1 pt-4">
<h2 className="text-lg tracking-normal text-foreground">
- Messages
+ {t(navigationMessages.messages)}
</h2>
</div>
<div className="px-3 py-4">
- <p className="text-sm text-muted-foreground">Rooms</p>
+ <p className="text-sm text-muted-foreground">
+ {t(routePagesMessages.rooms)}
+ </p>
<p className="mt-3 text-sm text-muted-foreground">
- Use “Back to my Rooms” to return to your conversations.
+ {t(routePagesMessages.backToRoomsHint)}
</p>
</div>
</nav>
@@ -110,7 +124,7 @@ function ApplicationRouteErrorSurface({ tenantId }: { tenantId?: string }) {
<span className="ml-3 text-sm font-medium">Linger</span>
</header>
<main
- aria-label="TeamHub loading error"
+ aria-label={t(routePagesMessages.loadingError)}
className="app-work-surface flex min-h-0 flex-1 items-center justify-center bg-app-surface px-6 py-12 text-center"
role="alert"
>
@@ -120,7 +134,11 @@ function ApplicationRouteErrorSurface({ tenantId }: { tenantId?: string }) {
void (content.restricted ? navigate("/") : navigate(0));
}}
title={content.title}
- actionLabel={content.restricted ? "Back to my Rooms" : "Try again"}
+ actionLabel={t(
+ content.restricted
+ ? routePagesMessages.backToRooms
+ : commonMessages.tryAgain,
+ )}
/>
</main>
</div>
@@ -190,6 +208,7 @@ function ErrorMessage({
}
function useRouteErrorContent(fullPage: boolean) {
+ const t = useT();
const error = useRouteError();
const status =
isRouteErrorResponse(error) || error instanceof TeamHubError
@@ -200,26 +219,26 @@ function useRouteErrorContent(fullPage: boolean) {
if (restricted)
return {
restricted: true,
- title: pathname.includes("/rooms/")
- ? "This Room is not available to you"
- : "This page is not available to you",
- message:
- "You may not have access, or it may have been deleted. Check that you are signed in to the right account, or ask the person who shared this link to invite you.",
+ title: t(
+ pathname.includes("/rooms/")
+ ? routePagesMessages.roomRestrictedTitle
+ : routePagesMessages.pageRestrictedTitle,
+ ),
+ message: t(routePagesMessages.restrictedBody),
};
const message = isRouteErrorResponse(error)
? `${error.status} ${error.statusText}`.trim()
: error instanceof Error
? error.message
- : "The requested TeamHub data could not be loaded.";
+ : t(routePagesMessages.loadFailedBody);
return {
restricted: false,
message,
- title:
- status === 404
- ? "Room unavailable"
- : fullPage
- ? "TeamHub unavailable"
- : "This view could not be loaded",
+ title: t(
+ fullPage
+ ? routePagesMessages.teamHubUnavailableTitle
+ : routePagesMessages.viewLoadFailedTitle,
+ ),
};
}
diff --git a/apps/web/src/app/route-pages.messages.ts b/apps/web/src/app/route-pages.messages.ts
new file mode 100644
index 00000000..2fb3b975
--- /dev/null
+++ b/apps/web/src/app/route-pages.messages.ts
@@ -0,0 +1,19 @@
+import { defineMessages } from "@/i18n/messages";
+
+/** Pages a route falls back to: the unknown address and the loading error. */
+export const routePagesMessages = defineMessages("routePages", {
+ notFoundTitle: "Page not found",
+ openMessages: "Open Messages",
+ loadingError: "TeamHub loading error",
+ rooms: "Rooms",
+ roomNavigation: "Room navigation",
+ backToRoomsHint: "Use “Back to my Rooms” to return to your conversations.",
+ backToRooms: "Back to my Rooms",
+ roomRestrictedTitle: "This Room is not available to you",
+ pageRestrictedTitle: "This page is not available to you",
+ restrictedBody:
+ "You may not have access, or it may have been deleted. Check that you are signed in to the right account, or ask the person who shared this link to invite you.",
+ loadFailedBody: "The requested TeamHub data could not be loaded.",
+ teamHubUnavailableTitle: "TeamHub unavailable",
+ viewLoadFailedTitle: "This view could not be loaded",
+});
diff --git a/apps/web/src/app/router.tsx b/apps/web/src/app/router.tsx
index 1c4c223f..e819236b 100644
--- a/apps/web/src/app/router.tsx
+++ b/apps/web/src/app/router.tsx
@@ -57,6 +57,7 @@ import {
FullPageRouteErrorSurface,
PanelRouteErrorSurface,
} from "./route-error-surfaces";
+import { routePagesMessages } from "./route-pages.messages";
export function createAppRoutes(
queryClient: QueryClient,
@@ -806,6 +807,7 @@ function redirectAuthenticationError(
}
function NotFoundRoute({ inShell = false }: { inShell?: boolean }) {
+ const t = useT();
const navigate = useNavigate();
const { tenantId } = useParams();
@@ -813,13 +815,13 @@ function NotFoundRoute({ inShell = false }: { inShell?: boolean }) {
<main
className={`flex flex-col items-center justify-center gap-4 bg-app-canvas px-8 text-center text-app-ink ${inShell ? "h-full min-h-0 flex-1" : "min-h-dvh"}`}
>
- <h1 className="text-lg">Page not found</h1>
+ <h1 className="text-lg">{t(routePagesMessages.notFoundTitle)}</h1>
<Button
onClick={() => {
void navigate(tenantId ? `/t/${tenantId}/rooms` : "/");
}}
>
- Open Messages
+ {t(routePagesMessages.openMessages)}
</Button>
</main>
);
diff --git a/apps/web/src/features/rooms/documents/shared-document-page.tsx b/apps/web/src/features/rooms/documents/shared-document-page.tsx
index 59d3f3ba..330ebda2 100644
--- a/apps/web/src/features/rooms/documents/shared-document-page.tsx
+++ b/apps/web/src/features/rooms/documents/shared-document-page.tsx
@@ -20,6 +20,10 @@ import {
} from "@/features/teamhub/teamhub-client";
import type { SharedDocumentContent } from "@/features/teamhub/teamhub-document-links";
import { triggerArtifactDownload } from "@/features/rooms/files/artifact-preview-loader";
+import { commonMessages } from "@/i18n/common.messages";
+import { useT } from "@/i18n/use-translation";
+
+import { sharedDocumentMessages } from "./shared-document.messages";
export function SharedDocumentPage() {
const { client } = useTeamHubRuntime();
@@ -34,6 +38,7 @@ function SharedDocumentSurface({
client: TeamHubClient;
token: string;
}) {
+ const t = useT();
const [dirty, setDirty] = useState(false);
const valid = /^doc_link_[A-Za-z0-9_-]{43}$/.test(token);
const file = useQuery({
@@ -69,12 +74,12 @@ function SharedDocumentSurface({
className="shrink-0 text-app-muted"
/>
<h1 className="min-w-0 break-all text-lg">
- {file.data?.filename ?? "Shared file"}
+ {file.data?.filename ?? t(sharedDocumentMessages.title)}
</h1>
</div>
<Button
- aria-label="Refresh file"
- title="Refresh file"
+ aria-label={t(sharedDocumentMessages.refresh)}
+ title={t(sharedDocumentMessages.refresh)}
disabled={file.isFetching || !valid || dirty}
onClick={() => void file.refetch()}
size="compactIcon"
@@ -85,7 +90,7 @@ function SharedDocumentSurface({
</header>
{file.error && dirty ? (
<p role="alert" className="px-5 pt-4 text-sm text-app-danger">
- The link is unavailable. Your unsaved changes are still here.
+ {t(sharedDocumentMessages.unavailableWithChanges)}
</p>
) : null}
{!valid || (file.error && (!file.data || !dirty)) ? (
@@ -93,12 +98,12 @@ function SharedDocumentSurface({
{file.error instanceof Error &&
!(file.error instanceof TeamHubError && file.error.status === 404)
? file.error.message
- : "This link is unavailable or has been revoked."}
+ : t(sharedDocumentMessages.unavailable)}
</div>
) : file.isPending ? (
<p className="flex items-center gap-2 p-6 text-sm text-app-muted">
<Spinner size={16} />
- Loading file…
+ {t(sharedDocumentMessages.loading)}
</p>
) : (
<SharedFileEditor
@@ -133,6 +138,7 @@ function SharedFileEditor({
onSaved: () => Promise<unknown>;
onDirty: (dirty: boolean) => void;
}) {
+ const t = useT();
const [text, setText] = useState(data.text ?? "");
const [pending, setPending] = useState(false);
const [error, setError] = useState<string | null>(null);
@@ -154,7 +160,9 @@ function SharedFileEditor({
await onSaved();
} catch (cause) {
setError(
- cause instanceof Error ? cause.message : "Unable to save this version.",
+ cause instanceof Error
+ ? cause.message
+ : t(sharedDocumentMessages.saveFailed),
);
} finally {
setPending(false);
@@ -164,13 +172,17 @@ function SharedFileEditor({
<section className="mx-auto max-w-5xl px-5 py-5">
<div className="mb-4 flex flex-wrap items-center gap-3">
<span className="mr-auto text-sm text-app-muted">
- {editable ? "Can edit" : "Read only"}
+ {t(
+ editable
+ ? sharedDocumentMessages.canEdit
+ : sharedDocumentMessages.readOnly,
+ )}
</span>
<Button
tone="secondary"
onClick={() => triggerArtifactDownload(data.blob, data.filename)}
>
- <Icon icon={Download04Icon} /> Download
+ <Icon icon={Download04Icon} /> {t(sharedDocumentMessages.download)}
</Button>
{editable && !signedIn ? (
<a
@@ -179,7 +191,7 @@ function SharedFileEditor({
rel="noreferrer"
className="text-sm text-[var(--app-link)] underline-offset-2 hover:underline"
>
- Sign in to edit
+ {t(sharedDocumentMessages.signInToEdit)}
</a>
) : null}
{editable && signedIn && data.text !== null ? (
@@ -191,14 +203,16 @@ function SharedFileEditor({
)
}
>
- <Icon icon={FloppyDiskIcon} /> {pending ? "Saving..." : "Save"}
+ <Icon icon={FloppyDiskIcon} />{" "}
+ {t(pending ? sharedDocumentMessages.saving : commonMessages.save)}
</Button>
) : null}
{editable && signedIn ? (
<label className="flex cursor-pointer items-center gap-2 text-sm">
- <Icon icon={Upload04Icon} /> Upload version
+ <Icon icon={Upload04Icon} />{" "}
+ {t(sharedDocumentMessages.uploadVersion)}
<input
- aria-label="Upload version"
+ aria-label={t(sharedDocumentMessages.uploadVersion)}
type="file"
disabled={pending}
className="max-w-52 text-xs"
@@ -219,7 +233,7 @@ function SharedFileEditor({
{data.text !== null ? (
editable && signedIn ? (
<textarea
- aria-label="File content"
+ aria-label={t(sharedDocumentMessages.fileContent)}
disabled={pending}
value={text}
onChange={(event) => {
diff --git a/apps/web/src/features/rooms/documents/shared-document.messages.ts b/apps/web/src/features/rooms/documents/shared-document.messages.ts
new file mode 100644
index 00000000..41f4ab22
--- /dev/null
+++ b/apps/web/src/features/rooms/documents/shared-document.messages.ts
@@ -0,0 +1,19 @@
+import { defineMessages } from "@/i18n/messages";
+
+/** The page a document link opens, with or without a signed-in reader. */
+export const sharedDocumentMessages = defineMessages("sharedDocument", {
+ title: "Shared file",
+ refresh: "Refresh file",
+ unavailableWithChanges:
+ "The link is unavailable. Your unsaved changes are still here.",
+ unavailable: "This link is unavailable or has been revoked.",
+ loading: "Loading file…",
+ saveFailed: "Unable to save this version.",
+ canEdit: "Can edit",
+ readOnly: "Read only",
+ download: "Download",
+ signInToEdit: "Sign in to edit",
+ saving: "Saving...",
+ uploadVersion: "Upload version",
+ fileContent: "File content",
+});
diff --git a/apps/web/src/features/rooms/sharing/shared-conversation.messages.ts b/apps/web/src/features/rooms/sharing/shared-conversation.messages.ts
new file mode 100644
index 00000000..eb0e68d1
--- /dev/null
+++ b/apps/web/src/features/rooms/sharing/shared-conversation.messages.ts
@@ -0,0 +1,16 @@
+import { defineMessages } from "@/i18n/messages";
+
+/** The read-only page a shared conversation link opens. */
+export const sharedConversationMessages = defineMessages("sharedConversation", {
+ title: "Shared conversation",
+ snapshot: "Read-only snapshot",
+ snapshotFrom: "Read-only snapshot · {date}",
+ unavailable:
+ "This shared conversation is unavailable or has been revoked. Ask the person who shared it for a new link.",
+ loading: "Loading conversation…",
+ empty: "No messages had been sent when this snapshot was created.",
+ loadMore: "Load more messages",
+ messageFrom: "Message from {name}",
+ imageUnavailable: "Image unavailable: {filename}",
+ loadingImage: "Loading image...",
+});
diff --git a/apps/web/src/features/rooms/sharing/shared-pages-language.test.tsx b/apps/web/src/features/rooms/sharing/shared-pages-language.test.tsx
new file mode 100644
index 00000000..8a0455c8
--- /dev/null
+++ b/apps/web/src/features/rooms/sharing/shared-pages-language.test.tsx
@@ -0,0 +1,110 @@
+// @vitest-environment jsdom
+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
+import { render, screen } from "@testing-library/react";
+import { MemoryRouter } from "react-router";
+import { afterEach, describe, expect, it, vi } from "vitest";
+
+import { SharedDocumentPage } from "@/features/rooms/documents/shared-document-page";
+import { TeamHubRuntimeProvider } from "@/features/teamhub/teamhub-runtime";
+import { resetLanguageForTest, setLanguage } from "@/i18n/language";
+import zhCN from "@/i18n/locales/zh-CN.json";
+import {
+ createTestTeamHubRuntime,
+ type TestTeamHubRuntime,
+} from "@/test/teamhub-test-runtime";
+
+import { SharedRoomHistoryPage } from "./shared-room-history-page";
+
+function open(
+ runtime: TestTeamHubRuntime,
+ path: string,
+ page: React.ReactNode,
+) {
+ render(
+ <QueryClientProvider
+ client={
+ new QueryClient({ defaultOptions: { queries: { retry: false } } })
+ }
+ >
+ <TeamHubRuntimeProvider runtime={runtime}>
+ <MemoryRouter initialEntries={[path]}>{page}</MemoryRouter>
+ </TeamHubRuntimeProvider>
+ </QueryClientProvider>,
+ );
+}
+
+describe("pages opened from a shared link, in the language on screen", () => {
+ afterEach(() => {
+ resetLanguageForTest();
+ });
+
+ it("words a shared conversation and dates it in that language", async () => {
+ await setLanguage("zh-CN");
+ const runtime = createTestTeamHubRuntime();
+ const createdAt = "2026-09-21T00:00:00Z";
+ vi.spyOn(runtime.client.roomHistory, "read").mockResolvedValue({
+ share: {
+ room_name: "Snapshot Room",
+ message_count: 1,
+ created_at: createdAt,
+ },
+ items: [
+ {
+ id: "message_1",
+ position: 1,
+ author: {
+ id: "actor_1",
+ tenant_id: "tenant_1",
+ kind: "human",
+ display_name: "Alice",
+ },
+ body: "Kept as sent",
+ segments: [],
+ created_at: createdAt,
+ attachments: [],
+ },
+ ],
+ next_after: 0,
+ } as never);
+ open(
+ runtime,
+ `/shared-room-history#room_share_${"a".repeat(43)}`,
+ <SharedRoomHistoryPage />,
+ );
+
+ expect(
+ await screen.findByRole("article", {
+ name: zhCN.sharedConversation.messageFrom.replace("{name}", "Alice"),
+ }),
+ ).toBeVisible();
+ const date = new Intl.DateTimeFormat("zh-CN", {
+ dateStyle: "medium",
+ timeStyle: "short",
+ }).format(new Date(createdAt));
+ expect(
+ screen.getByText(
+ zhCN.sharedConversation.snapshotFrom.replace("{date}", date),
+ ),
+ ).toBeVisible();
+ expect(screen.getByText("Kept as sent")).toBeVisible();
+ });
+
+ it("words a document link that cannot be opened", async () => {
+ await setLanguage("zh-CN");
+ const runtime = createTestTeamHubRuntime();
+ runtime.server.on("GET", "/v0/session", () => ({
+ account_id: "account-1",
+ }));
+ open(runtime, "/shared-documents#not-a-link", <SharedDocumentPage />);
+
+ expect(
+ screen.getByRole("heading", { name: zhCN.sharedDocument.title }),
+ ).toBeVisible();
+ expect(screen.getByRole("alert")).toHaveTextContent(
+ zhCN.sharedDocument.unavailable,
+ );
+ expect(
+ screen.getByRole("button", { name: zhCN.sharedDocument.refresh }),
+ ).toBeDisabled();
+ });
+});
diff --git a/apps/web/src/features/rooms/sharing/shared-room-history-page.tsx b/apps/web/src/features/rooms/sharing/shared-room-history-page.tsx
index 90a87feb..8df44f10 100644
--- a/apps/web/src/features/rooms/sharing/shared-room-history-page.tsx
+++ b/apps/web/src/features/rooms/sharing/shared-room-history-page.tsx
@@ -12,12 +12,18 @@ import { MessageMarkdown } from "../chat/message-markdown";
import { ActorAvatar } from "../members/actor-avatar";
import { avatarKeyFromSeed } from "../members/agent-avatar";
import { formatBytes } from "@/lib/format-bytes";
+import { commonMessages } from "@/i18n/common.messages";
+import { formatLocale } from "@/i18n/language";
+import { useT } from "@/i18n/use-translation";
+
+import { sharedConversationMessages } from "./shared-conversation.messages";
export function SharedRoomHistoryPage() {
const token = useLocation().hash.slice(1);
return <SharedHistory key={token} token={token} />;
}
function SharedHistory({ token }: { token: string }) {
+ const t = useT();
const { client } = useTeamHubRuntime();
const valid = /^room_share_[A-Za-z0-9_-]{43}$/.test(token);
const query = useInfiniteQuery({
@@ -37,33 +43,37 @@ function SharedHistory({ token }: { token: string }) {
<header className="border-b border-app-border px-6 py-5">
<div className="mx-auto max-w-3xl">
<h1 className="text-lg">
- {share?.room_name ?? "Shared conversation"}
+ {share?.room_name ?? t(sharedConversationMessages.title)}
</h1>
<p className="mt-1 text-xs text-app-muted">
- Read-only snapshot
- {share ? ` · ${formatDateTime(share.created_at)}` : ""}
+ {share
+ ? t(sharedConversationMessages.snapshotFrom, {
+ date: formatDateTime(
+ share.created_at,
+ undefined,
+ formatLocale(),
+ ),
+ })
+ : t(sharedConversationMessages.snapshot)}
</p>
</div>
</header>
<div className="mx-auto max-w-3xl px-6 py-6">
{!valid || query.error ? (
- <p role="alert">
- This shared conversation is unavailable or has been revoked. Ask the
- person who shared it for a new link.
- </p>
+ <p role="alert">{t(sharedConversationMessages.unavailable)}</p>
) : query.isPending ? (
<p
className="flex items-center gap-2 text-sm text-app-muted"
role="status"
>
<Spinner size={16} />
- Loading conversation…
+ {t(sharedConversationMessages.loading)}
</p>
) : (
<>
{share?.message_count === 0 ? (
<p className="text-sm text-app-muted">
- No messages had been sent when this snapshot was created.
+ {t(sharedConversationMessages.empty)}
</p>
) : null}
<div className="space-y-7">
@@ -83,7 +93,7 @@ function SharedHistory({ token }: { token: string }) {
loading={query.isFetchingNextPage}
onClick={() => void query.fetchNextPage()}
>
- Load more messages
+ {t(sharedConversationMessages.loadMore)}
</Button>
) : null}
</>
@@ -99,14 +109,17 @@ function SnapshotMessage({
message: RoomHistoryMessage;
token: string;
}) {
+ const t = useT();
return (
<article
className="flex gap-3"
- aria-label={`Message from ${message.author.display_name}`}
+ aria-label={t(sharedConversationMessages.messageFrom, {
+ name: message.author.display_name,
+ })}
>
{message.avatar_image ? (
<img
- alt={`${message.author.display_name} avatar`}
+ alt={t(commonMessages.avatar, { name: message.author.display_name })}
src={message.avatar_image}
className="size-8 shrink-0 rounded-full object-cover"
/>
@@ -128,7 +141,7 @@ function SnapshotMessage({
className="text-xs text-app-muted"
dateTime={message.created_at}
>
- {formatDateTime(message.created_at)}
+ {formatDateTime(message.created_at, undefined, formatLocale())}
</time>
</header>
<div className="break-words text-sm leading-6">
@@ -191,6 +204,7 @@ function SnapshotImage({
assetId: string;
filename: string;
}) {
+ const t = useT();
const { client } = useTeamHubRuntime();
const [url, setUrl] = useState("");
const [failed, setFailed] = useState(false);
@@ -220,7 +234,9 @@ function SnapshotImage({
/>
) : (
<p className="text-xs text-app-muted">
- {failed ? `Image unavailable: ${filename}` : "Loading image..."}
+ {failed
+ ? t(sharedConversationMessages.imageUnavailable, { filename })
+ : t(sharedConversationMessages.loadingImage)}
</p>
);
}
diff --git a/apps/web/src/i18n/locales/zh-CN.json b/apps/web/src/i18n/locales/zh-CN.json
index 1a5a7329..a4eca426 100644
--- a/apps/web/src/i18n/locales/zh-CN.json
+++ b/apps/web/src/i18n/locales/zh-CN.json
@@ -2531,5 +2531,47 @@
"resizeWeeklyBottomLeft": "拖动左下角调整周报窗口大小",
"reportUnavailable": "报告不可用。",
"repeatedCursor": "加载报告时分页返回了重复的游标。"
+ },
+ "routePages": {
+ "notFoundTitle": "找不到页面",
+ "openMessages": "打开消息",
+ "loadingError": "TeamHub 加载出错",
+ "rooms": "Room",
+ "roomNavigation": "Room 导航",
+ "backToRoomsHint": "点击“返回我的 Room”回到你的对话。",
+ "backToRooms": "返回我的 Room",
+ "roomRestrictedTitle": "你无法访问这个 Room",
+ "pageRestrictedTitle": "你无法访问这个页面",
+ "restrictedBody": "你可能没有访问权限,或者它已被删除。请确认登录的账号是否正确,或请分享链接的人邀请你。",
+ "loadFailedBody": "无法加载请求的 TeamHub 数据。",
+ "teamHubUnavailableTitle": "TeamHub 不可用",
+ "viewLoadFailedTitle": "无法加载这个视图"
+ },
+ "sharedDocument": {
+ "title": "共享的文件",
+ "refresh": "刷新文件",
+ "unavailableWithChanges": "链接已不可用。你尚未保存的更改还在这里。",
+ "unavailable": "这个链接不可用,或已被撤销。",
+ "loading": "正在加载文件…",
+ "saveFailed": "无法保存这个版本。",
+ "canEdit": "可编辑",
+ "readOnly": "只读",
+ "download": "下载",
+ "signInToEdit": "登录后编辑",
+ "saving": "正在保存…",
+ "uploadVersion": "上传新版本",
+ "fileContent": "文件内容"
+ },
+ "sharedConversation": {
+ "title": "分享的对话",
+ "snapshot": "只读快照",
+ "snapshotFrom": "只读快照 · {date}",
+ "unavailable": "这个分享的对话不可用,或已被撤销。请向分享的人要一个新链接。",
+ "loading": "正在加载对话…",
+ "empty": "创建这份快照时还没有消息。",
+ "loadMore": "加载更多消息",
+ "messageFrom": "{name} 的消息",
+ "imageUnavailable": "图片不可用:{filename}",
+ "loadingImage": "正在加载图片…"
}
}