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 Wiki Timeline

Kilyn2b7b64d0203a
diff --git a/apps/web/src/features/memory/wiki-graph-daily-panel.tsx b/apps/web/src/features/memory/wiki-graph-daily-panel.tsx
index 30c09014..b534c867 100644
--- a/apps/web/src/features/memory/wiki-graph-daily-panel.tsx
+++ b/apps/web/src/features/memory/wiki-graph-daily-panel.tsx
@@ -12,6 +12,7 @@ import {
import { ReadOnlyBlockNoteDocument } from "@/components/read-only-blocknote-document";
import { useDocumentAnchorLinks } from "@/components/document-anchor-links";
import { Button } from "@/components/ui/button";
+import { useT } from "@/i18n/use-translation";
import { resolveMemoryDocumentLink } from "./memory-document-links";
import {
@@ -21,15 +22,17 @@ import {
usePeriodReports,
type PeriodReportKind,
} from "./wiki-period-reports";
+import { wikiTimelineMessages as m } from "./wiki-timeline.messages";
+/** What each handle is called on a Daily and on a Weekly report. */
const RESIZE_HANDLES = {
- n: "top edge",
- s: "bottom edge",
- e: "right edge",
- w: "left edge",
- ne: "top right corner",
- nw: "top left corner",
- se: "bottom right corner",
- sw: "bottom left corner",
+ n: [m.resizeDailyTop, m.resizeWeeklyTop],
+ s: [m.resizeDailyBottom, m.resizeWeeklyBottom],
+ e: [m.resizeDailyRight, m.resizeWeeklyRight],
+ w: [m.resizeDailyLeft, m.resizeWeeklyLeft],
+ ne: [m.resizeDailyTopRight, m.resizeWeeklyTopRight],
+ nw: [m.resizeDailyTopLeft, m.resizeWeeklyTopLeft],
+ se: [m.resizeDailyBottomRight, m.resizeWeeklyBottomRight],
+ sw: [m.resizeDailyBottomLeft, m.resizeWeeklyBottomLeft],
} as const;
type ResizeDirection = keyof typeof RESIZE_HANDLES;
interface WindowBox {
@@ -110,7 +113,8 @@ export function WikiGraphDailyPanel({
kind?: PeriodReportKind;
onClose: () => void;
}) {
- const label = kind === "daily" ? "Daily" : "Weekly";
+ const t = useT();
+ const isDaily = kind === "daily";
const contentRef = useRef<HTMLDivElement>(null);
const windowRef = useRef<HTMLElement>(null);
const gesture = useRef<{
@@ -248,7 +252,7 @@ export function WikiGraphDailyPanel({
/>
<aside
ref={windowRef}
- aria-label={`${label} report`}
+ aria-label={t(isDaily ? m.dailyReport : m.weeklyReport)}
className="wiki-graph-daily-panel"
style={box ?? undefined}
onPointerMove={moveGesture}
@@ -264,16 +268,20 @@ export function WikiGraphDailyPanel({
onPointerDown={(event) => beginGesture(event, "move")}
>
<div className="min-w-0">
- <p className="wiki-graph-daily-eyebrow">{label} summary</p>
+ <p className="wiki-graph-daily-eyebrow">
+ {t(isDaily ? m.dailySummary : m.weeklySummary)}
+ </p>
<h2>
<time dateTime={day}>{periodLabel(day, kind)}</time>
</h2>
</div>
<div className="flex shrink-0 items-center gap-1">
<Button
- aria-label={`Toggle ${label} contents`}
+ aria-label={t(
+ isDaily ? m.toggleDailyContents : m.toggleWeeklyContents,
+ )}
aria-expanded={tocOpen}
- title="Contents"
+ title={t(m.contents)}
onClick={() => setTocOpen((open) => !open)}
size="icon"
tone="ghost"
@@ -281,7 +289,8 @@ export function WikiGraphDailyPanel({
<Icon icon={LeftToRightListBulletIcon} size={16} />
</Button>
<Button
- aria-label={`Close ${label}`}
+ data-voice-close
+ aria-label={t(isDaily ? m.closeDaily : m.closeWeekly)}
onClick={onClose}
size="icon"
tone="ghost"
@@ -293,10 +302,10 @@ export function WikiGraphDailyPanel({
<div className="wiki-graph-daily-reading">
{tocOpen && headings.length > 0 ? (
<nav
- aria-label={`${label} contents`}
+ aria-label={t(isDaily ? m.dailyContents : m.weeklyContents)}
className="wiki-graph-daily-toc workspace-scrollbar"
>
- <p>Contents</p>
+ <p>{t(m.contents)}</p>
{headings.map((heading) => (
<button
key={heading.id}
@@ -324,7 +333,7 @@ export function WikiGraphDailyPanel({
>
{pending ? (
<p role="status" className="p-6 text-sm text-app-muted">
- Loading {label}…
+ {t(isDaily ? m.loadingDaily : m.loadingWeekly)}
</p>
) : error ? (
<div role="alert" className="p-6 text-sm">
@@ -336,12 +345,14 @@ export function WikiGraphDailyPanel({
}
tone="secondary"
>
- Retry {label}
+ {t(isDaily ? m.retryDaily : m.retryWeekly)}
</Button>
</div>
) : entry ? (
<ReadOnlyBlockNoteDocument
- ariaLabel={`${day} ${label} content`}
+ ariaLabel={t(isDaily ? m.dailyContent : m.weeklyContent, {
+ day,
+ })}
markdown={entry.content || entry.summary}
presentation="knowledge"
documentTitle={entry.title}
@@ -349,7 +360,7 @@ export function WikiGraphDailyPanel({
/>
) : (
<p className="p-6 text-sm text-app-muted">
- No {label} report for this {kind === "daily" ? "day" : "week"}.
+ {t(isDaily ? m.noDailyReport : m.noWeeklyReport)}
</p>
)}
{anchors.error ? (
@@ -365,7 +376,7 @@ export function WikiGraphDailyPanel({
type="button"
className="wiki-graph-daily-resize"
data-direction={direction}
- aria-label={`Resize ${label} ${RESIZE_HANDLES[direction]}`}
+ aria-label={t(RESIZE_HANDLES[direction][isDaily ? 0 : 1])}
onPointerDown={(event) => beginGesture(event, direction)}
onKeyDown={(event) => {
const measured = measureBox();
diff --git a/apps/web/src/features/memory/wiki-graph-model.ts b/apps/web/src/features/memory/wiki-graph-model.ts
index 919e0e55..951bf616 100644
--- a/apps/web/src/features/memory/wiki-graph-model.ts
+++ b/apps/web/src/features/memory/wiki-graph-model.ts
@@ -1,3 +1,4 @@
+import { formatLocale } from "@/i18n/language";
import { dayKey, formatDateTime } from "@/lib/date-format";
export interface WikiGraphNode {
@@ -129,6 +130,7 @@ export function buildTimeline(
moments: Map<string, NodeMoment[]>,
granularity: TimeGranularity,
today = dayKey(new Date()),
+ locale: string = formatLocale(),
): WikiTimeline {
const days = [...moments.values()]
.flat()
@@ -152,7 +154,7 @@ export function buildTimeline(
buckets.push({
start,
...(previous === undefined || previous.slice(0, 7) !== start.slice(0, 7)
- ? { monthLabel: monthLabel(start) }
+ ? { monthLabel: monthLabel(start, locale) }
: {}),
...(previous === undefined || previous.slice(0, 4) !== start.slice(0, 4)
? { yearLabel: start.slice(0, 4) }
@@ -183,11 +185,12 @@ export function bucketStart(day: string, granularity: TimeGranularity): string {
return dayString(time - weekday * DAY_MS);
}
-function monthLabel(start: string): string {
- return formatDateTime(dayTime(start), {
- month: "short",
- timeZone: "UTC",
- });
+function monthLabel(start: string, locale: string): string {
+ return formatDateTime(
+ dayTime(start),
+ { month: "short", timeZone: "UTC" },
+ locale,
+ );
}
function isCalendarDay(day: string): boolean {
diff --git a/apps/web/src/features/memory/wiki-graph-page.tsx b/apps/web/src/features/memory/wiki-graph-page.tsx
index 3328f4da..f115af3c 100644
--- a/apps/web/src/features/memory/wiki-graph-page.tsx
+++ b/apps/web/src/features/memory/wiki-graph-page.tsx
@@ -11,6 +11,7 @@ import { useParams, useSearchParams } from "react-router";
import { Button } from "@/components/ui/button";
import { requireRoomRouteParam } from "@/features/rooms/room-route-params";
import { useTeamHubRuntime } from "@/features/teamhub/teamhub-runtime";
+import { useT } from "@/i18n/use-translation";
import {
filterWikiGraph,
@@ -21,8 +22,10 @@ import { WikiRefreshBanner } from "@/features/wiki/wiki-refresh-status";
import { useAnotherMeActorId } from "@/features/wiki/wiki-working-card";
import { nodeMoments, parseEmbeddedWikiGraph } from "./wiki-graph-model";
import { WikiBack } from "@/features/wiki/wiki-home-page";
+import { wikiMessages } from "@/features/wiki/wiki.messages";
import { WikiKnowledgeGraph } from "./wiki-knowledge-graph";
import { usePeriodReports } from "./wiki-period-reports";
+import { wikiTimelineMessages as m } from "./wiki-timeline.messages";
const DailyPanel = lazy(async () => {
const { WikiGraphDailyPanel } = await import("./wiki-graph-daily-panel");
@@ -35,6 +38,7 @@ const ReportCards = lazy(async () => {
});
export function WikiGraphPage() {
+ const t = useT();
const { client } = useTeamHubRuntime();
const tenantId = requireRoomRouteParam(useParams().tenantId, "Tenant");
const [searchParams] = useSearchParams();
@@ -77,11 +81,11 @@ export function WikiGraphPage() {
<main className="wiki-graph-page flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-app-surface">
<header className="wiki-graph-page-header px-4 pt-4 pb-6">
<WikiBack />
- <h1 className="mb-2 text-2xl text-foreground">Daily report</h1>
+ <h1 className="mb-2 text-2xl text-foreground">{t(m.dailyReport)}</h1>
<p className="text-sm text-muted-foreground">
{reports.isPending
- ? "Loading reports…"
- : `${reports.data?.length ?? 0} reports · Browse by day`}
+ ? t(wikiMessages.loadingReports)
+ : t(m.reportCount, { count: reports.data?.length ?? 0 })}
</p>
</header>
@@ -102,13 +106,13 @@ export function WikiGraphPage() {
className={refresh.initializing ? "town-shimmer-text" : undefined}
>
{refresh.initializing
- ? "Wiki is being generated…"
- : "Loading timeline…"}
+ ? t(m.generating)
+ : t(wikiMessages.loadingTimeline)}
</span>
</div>
) : graph.error ? (
<div
- aria-label={graph.error.message || "Timeline is unavailable."}
+ aria-label={graph.error.message || t(m.unavailable)}
className="flex h-full min-h-[480px] flex-col items-center justify-center text-center"
role="alert"
>
@@ -118,7 +122,7 @@ export function WikiGraphPage() {
size={24}
/>
<p className="text-sm text-app-danger">
- {graph.error.message || "Timeline is unavailable."}
+ {graph.error.message || t(m.unavailable)}
</p>
<Button
className="mt-3"
@@ -126,7 +130,7 @@ export function WikiGraphPage() {
size="compact"
tone="secondary"
>
- <Icon icon={RefreshIcon} size={14} /> Retry graph
+ <Icon icon={RefreshIcon} size={14} /> {t(m.retryGraph)}
</Button>
</div>
) : filteredGraph ? (
@@ -139,7 +143,7 @@ export function WikiGraphPage() {
<Suspense
fallback={
<p role="status" className="p-6 text-sm text-app-muted">
- Loading timeline…
+ {t(wikiMessages.loadingTimeline)}
</p>
}
>
@@ -161,7 +165,11 @@ export function WikiGraphPage() {
<Suspense
fallback={
<div role="status" className="wiki-graph-daily-panel p-4">
- Loading Daily…
+ {t(
+ selectedReport.kind === "daily"
+ ? m.loadingDaily
+ : m.loadingWeekly,
+ )}
</div>
}
>
@@ -178,8 +186,7 @@ export function WikiGraphPage() {
/>
) : Object.values(display.decisions).includes("delete") ? (
<p role="alert" className="p-4 text-sm text-app-muted">
- This graph cannot display your hidden-file preferences. Refresh the
- graph to load the current view.
+ {t(m.hiddenPreferences)}
</p>
) : (
<iframe
@@ -187,7 +194,7 @@ export function WikiGraphPage() {
key={tenantId}
sandbox="allow-scripts"
srcDoc={graph.data}
- title="Personal knowledge graph"
+ title={t(m.graphFrame)}
/>
)}
</section>
diff --git a/apps/web/src/features/memory/wiki-graph-report-cards.tsx b/apps/web/src/features/memory/wiki-graph-report-cards.tsx
index c82b317b..37cd807b 100644
--- a/apps/web/src/features/memory/wiki-graph-report-cards.tsx
+++ b/apps/web/src/features/memory/wiki-graph-report-cards.tsx
@@ -1,5 +1,6 @@
import { ArrowLeft01Icon, ArrowRight01Icon } from "@hugeicons/core-free-icons";
import { Icon } from "@/components/ui/icon";
+import { useT } from "@/i18n/use-translation";
import {
useCallback,
useEffect,
@@ -22,6 +23,7 @@ import {
usePeriodReports,
type PeriodReportKind,
} from "./wiki-period-reports";
+import { wikiTimelineMessages as m } from "./wiki-timeline.messages";
export function WikiGraphReportCards({
tenantId,
@@ -84,7 +86,8 @@ function PeriodCards({
moved: boolean;
} | null>(null);
const suppressClick = useRef(false);
- const label = kind === "daily" ? "Daily" : "Weekly";
+ const t = useT();
+ const daily = kind === "daily";
const entriesByDate = useMemo(
() =>
new Map((reports.data ?? []).map((entry) => [reportDate(entry)!, entry])),
@@ -301,11 +304,16 @@ function PeriodCards({
}
return (
- <section aria-label={`${label} timeline`} className="wiki-report-timeline">
+ <section
+ aria-label={t(daily ? m.dailyTimeline : m.weeklyTimeline)}
+ className="wiki-report-timeline"
+ >
<div className="wiki-report-controls">
<button
type="button"
- aria-label={`Previous ${granularity} card`}
+ aria-label={t(
+ granularity === "day" ? m.previousDayCard : m.previousWeekCard,
+ )}
disabled={scrollEdges.start}
onClick={() => browseToCard(activeIndex - 1)}
>
@@ -313,7 +321,7 @@ function PeriodCards({
</button>
<button
type="button"
- aria-label={`Next ${granularity} card`}
+ aria-label={t(granularity === "day" ? m.nextDayCard : m.nextWeekCard)}
disabled={scrollEdges.end}
onClick={() => browseToCard(activeIndex + 1)}
>
@@ -324,24 +332,24 @@ function PeriodCards({
<div role="alert" className="wiki-report-error">
<p>{reports.error.message}</p>
<button type="button" onClick={() => void reports.refetch()}>
- Retry reports
+ {t(m.retryReports)}
</button>
</div>
) : null}
{reports.isPending ? (
<p role="status" className="p-6 text-sm text-app-muted">
- Loading {label} cards…
+ {t(daily ? m.loadingDailyCards : m.loadingWeeklyCards)}
</p>
) : !cards.length ? (
<p className="p-6 text-sm text-app-muted">
- No {label} reports or dated pages yet.
+ {t(daily ? m.noDailyCards : m.noWeeklyCards)}
</p>
) : (
<>
{/* eslint-disable-next-line jsx-a11y/no-static-element-interactions -- pointer dragging for the report track; keyboard scrolling works through its tabIndex */}
<div
ref={trackRef}
- aria-label={`${label} cards`}
+ aria-label={t(daily ? m.dailyCards : m.weeklyCards)}
className="wiki-report-track workspace-scrollbar"
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex -- keyboard-focusable scroll region so keyboard users can scroll it
tabIndex={0}
diff --git a/apps/web/src/features/memory/wiki-graph-timeline.tsx b/apps/web/src/features/memory/wiki-graph-timeline.tsx
index 838f6f7e..1198f0e4 100644
--- a/apps/web/src/features/memory/wiki-graph-timeline.tsx
+++ b/apps/web/src/features/memory/wiki-graph-timeline.tsx
@@ -1,6 +1,8 @@
import { ArrowRightDoubleIcon } from "@hugeicons/core-free-icons";
import { formatDateTime } from "@/lib/date-format";
import { Icon } from "@/components/ui/icon";
+import { type Translate, formatLocale } from "@/i18n/language";
+import { useTranslation } from "@/i18n/use-translation";
import {
type CSSProperties,
type KeyboardEvent,
@@ -14,6 +16,7 @@ import {
} from "react";
import type { TimeBucket, TimeGranularity } from "./wiki-graph-model";
+import { wikiTimelineMessages as m } from "./wiki-timeline.messages";
interface WikiGraphTimelineProps {
buckets: TimeBucket[];
@@ -42,6 +45,8 @@ export function WikiGraphTimeline({
focused,
onShowAll,
}: WikiGraphTimelineProps) {
+ const { language, t } = useTranslation();
+ const locale = formatLocale(language);
const rulerRef = useRef<HTMLDivElement>(null);
const [width, setWidth] = useState(0);
// Fractional playhead position while dragging, gliding or snapping.
@@ -253,7 +258,7 @@ export function WikiGraphTimeline({
if (!count) {
return (
<div className="wiki-graph-timeline wiki-graph-timeline-empty">
- No dated sessions or events yet.
+ {t(m.noDated)}
</div>
);
}
@@ -269,14 +274,14 @@ export function WikiGraphTimeline({
<div className="wiki-graph-timeline-controls">
<div className="wiki-graph-readout" aria-live="polite">
<p className="wiki-graph-readout-date">
- {longLabel(bucket.start, granularity)}
+ {longLabel(bucket.start, granularity, locale)}
<span className="wiki-graph-readout-year">
{yearOf(bucket.start, granularity)}
</span>
</p>
</div>
<button
- aria-label="Jump to latest"
+ aria-label={t(m.jumpToLatest)}
className="wiki-graph-latest"
data-hidden={(atLatest && !focused) || undefined}
onClick={() => {
@@ -286,17 +291,19 @@ export function WikiGraphTimeline({
tabIndex={atLatest && !focused ? -1 : 0}
type="button"
>
- Latest <Icon icon={ArrowRightDoubleIcon} size={14} />
+ {t(m.latest)} <Icon icon={ArrowRightDoubleIcon} size={14} />
</button>
</div>
<div
- aria-label="Timeline playhead"
+ aria-label={t(m.playhead)}
aria-valuemax={last}
aria-valuemin={0}
aria-valuenow={cursor}
aria-valuetext={fullLabel(
buckets[cursor]?.start ?? bucket.start,
granularity,
+ locale,
+ t,
)}
className="wiki-graph-ruler"
data-dragging={dragging || undefined}
@@ -371,7 +378,7 @@ export function WikiGraphTimeline({
{hoverIndex !== undefined && !dragging ? (
<HoverPreview
inset={rulerRef.current?.offsetLeft ?? 0}
- label={fullLabel(buckets[hoverIndex]!.start, granularity)}
+ label={fullLabel(buckets[hoverIndex]!.start, granularity, locale, t)}
left={center - (position + 0.5) * step + (hoverIndex + 0.5) * step}
width={width}
/>
@@ -402,19 +409,27 @@ function HoverPreview({
);
}
-function longLabel(start: string, granularity: TimeGranularity): string {
+/** "SEP 3", or "SEP 28 – OCT 4" for a week, in the language on screen. */
+function longLabel(
+ start: string,
+ granularity: TimeGranularity,
+ locale: string,
+): string {
const date = new Date(`${start}T00:00:00Z`);
- const month = formatDateTime(date, {
- month: "short",
- timeZone: "UTC",
- }).toUpperCase();
- if (granularity === "day") return `${month} ${date.getUTCDate()}`;
+ const monthDay = (value: Date) =>
+ formatDateTime(
+ value,
+ { month: "short", day: "numeric", timeZone: "UTC" },
+ locale,
+ ).toUpperCase();
+ if (granularity === "day") return monthDay(date);
const end = new Date(date.getTime() + 6 * 86_400_000);
- const endMonth = formatDateTime(end, {
- month: "short",
- timeZone: "UTC",
- }).toUpperCase();
- return `${month} ${date.getUTCDate()} – ${endMonth === month ? "" : `${endMonth} `}${end.getUTCDate()}`;
+ const sameMonth = end.getUTCMonth() === date.getUTCMonth();
+ return `${monthDay(date)} – ${
+ sameMonth
+ ? formatDateTime(end, { day: "numeric", timeZone: "UTC" }, locale)
+ : monthDay(end)
+ }`;
}
/** The bucket's year, or both years for a week that crosses New Year. */
@@ -427,8 +442,16 @@ function yearOf(start: string, granularity: TimeGranularity): string {
return first === last ? first : `${first}–${last}`;
}
-function fullLabel(start: string, granularity: TimeGranularity): string {
- return `${longLabel(start, granularity)}, ${yearOf(start, granularity)}`;
+function fullLabel(
+ start: string,
+ granularity: TimeGranularity,
+ locale: string,
+ t: Translate,
+): string {
+ return t(m.dateWithYear, {
+ date: longLabel(start, granularity, locale),
+ year: yearOf(start, granularity),
+ });
}
function isMonday(day: string): boolean {
diff --git a/apps/web/src/features/memory/wiki-knowledge-graph.tsx b/apps/web/src/features/memory/wiki-knowledge-graph.tsx
index 2bfa6bcb..21894abb 100644
--- a/apps/web/src/features/memory/wiki-knowledge-graph.tsx
+++ b/apps/web/src/features/memory/wiki-knowledge-graph.tsx
@@ -2,6 +2,9 @@ import { Search01Icon } from "@hugeicons/core-free-icons";
import { Icon } from "@/components/ui/icon";
import { type ReactNode, useCallback, useMemo, useState } from "react";
+import { formatLocale } from "@/i18n/language";
+import { useTranslation } from "@/i18n/use-translation";
+
import "./wiki-knowledge-graph.css";
import {
buildTimeline,
@@ -12,6 +15,7 @@ import {
type WikiGraphNode,
} from "./wiki-graph-model";
import { WikiGraphTimeline } from "./wiki-graph-timeline";
+import { wikiTimelineMessages as m } from "./wiki-timeline.messages";
/** Daily or Weekly report cards above a ruler of dated Wiki pages. */
export function WikiKnowledgeGraph({
@@ -34,6 +38,8 @@ export function WikiKnowledgeGraph({
onReadingModeChange?: () => void;
dailyPanel?: ReactNode;
}) {
+ const { language, t } = useTranslation();
+ const locale = formatLocale(language);
const [granularity, setGranularity] = useState<TimeGranularity>("day");
const [query, setQuery] = useState("");
const moments = useMemo(
@@ -41,8 +47,8 @@ export function WikiKnowledgeGraph({
[graph, timelineMoments],
);
const timeline = useMemo(
- () => buildTimeline(moments, granularity),
- [granularity, moments],
+ () => buildTimeline(moments, granularity, undefined, locale),
+ [granularity, locale, moments],
);
const lastBucket = Math.max(0, timeline.buckets.length - 1);
// The playhead starts on the latest bucket.
@@ -113,7 +119,7 @@ export function WikiKnowledgeGraph({
<div className="wiki-graph-surface">
<div className="wiki-graph-toolbar">
<div
- aria-label="Timeline granularity"
+ aria-label={t(m.granularity)}
className="wiki-graph-segmented"
role="radiogroup"
>
@@ -125,16 +131,16 @@ export function WikiKnowledgeGraph({
aria-checked={granularity === value}
onClick={() => changeGranularity(value)}
>
- {value === "day" ? "Day" : "Week"}
+ {t(value === "day" ? m.day : m.week)}
</button>
))}
</div>
<label className="wiki-graph-search">
<Icon icon={Search01Icon} size={14} />
<input
- aria-label="Search pages"
+ aria-label={t(m.searchPages)}
onChange={(event) => setQuery(event.target.value)}
- placeholder="Search pages"
+ placeholder={t(m.searchPages)}
type="search"
value={query}
/>
@@ -145,9 +151,7 @@ export function WikiKnowledgeGraph({
{renderTimeline?.(matchingPages, granularity, {
focus: cardFocus,
onPeriodChange: followCard,
- }) ?? (
- <p className="p-6 text-sm text-app-muted">No reports available.</p>
- )}
+ }) ?? <p className="p-6 text-sm text-app-muted">{t(m.noReports)}</p>}
{dailyPanel}
</div>
diff --git a/apps/web/src/features/memory/wiki-period-reports.ts b/apps/web/src/features/memory/wiki-period-reports.ts
index ad9bc108..19729aea 100644
--- a/apps/web/src/features/memory/wiki-period-reports.ts
+++ b/apps/web/src/features/memory/wiki-period-reports.ts
@@ -3,7 +3,9 @@ import { teamHubData } from "@/features/teamhub/teamhub-api";
import type { TeamHubClient } from "@/features/teamhub/teamhub-client";
import { useTeamHubRuntime } from "@/features/teamhub/teamhub-runtime";
import type { TeamHubMemoryEntry } from "@/features/teamhub/teamhub-types";
+import { translate } from "@/i18n/language";
import { bucketStart } from "./wiki-graph-model";
+import { wikiTimelineMessages as m } from "./wiki-timeline.messages";
export type PeriodReportKind = "daily" | "weekly";
@@ -42,7 +44,7 @@ async function listReports(
entries.set(entry.id, entry);
if (!page.next_cursor) return [...entries.values()];
if (seen.has(page.next_cursor))
- throw new Error("Report pagination returned a repeated cursor.");
+ throw new Error(translate(m.repeatedCursor));
seen.add(page.next_cursor);
cursor = page.next_cursor;
}
@@ -68,7 +70,7 @@ export function usePeriodReport(
return useQuery({
queryKey: ["teamhub", tenantId, "personal-memory", kind, day],
queryFn: () => {
- if (!entry) throw new Error("Report is unavailable.");
+ if (!entry) throw new Error(translate(m.reportUnavailable));
return teamHubData(
client.api.GET("/v0/tenants/{tenantId}/memory/{entryId}", {
params: { path: { tenantId, entryId: entry.id } },
diff --git a/apps/web/src/features/memory/wiki-timeline-language.test.tsx b/apps/web/src/features/memory/wiki-timeline-language.test.tsx
new file mode 100644
index 00000000..fa8e07d4
--- /dev/null
+++ b/apps/web/src/features/memory/wiki-timeline-language.test.tsx
@@ -0,0 +1,111 @@
+import { act, fireEvent, render, screen } from "@testing-library/react";
+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
+
+import { resetLanguageForTest, setLanguage } from "@/i18n/language";
+import zhCN from "@/i18n/locales/zh-CN.json";
+
+import { buildTimeline, type WikiGraphData } from "./wiki-graph-model";
+import { WikiKnowledgeGraph } from "./wiki-knowledge-graph";
+
+const words = zhCN.wikiTimeline;
+
+function session(day: string) {
+ return {
+ id: `sessions/${day}/capture`,
+ title: `Session ${day}`,
+ category: "Session",
+ description: "",
+ tags: [],
+ body: "",
+ size: 400,
+ links: [],
+ backlinks: [],
+ };
+}
+
+const graph: WikiGraphData = {
+ types: ["Session"],
+ nodes: [session("2026-08-31"), session("2026-09-03")],
+ edges: [],
+};
+
+function chinese(day: string, options: Intl.DateTimeFormatOptions) {
+ return new Intl.DateTimeFormat("zh-CN", {
+ ...options,
+ timeZone: "UTC",
+ }).format(new Date(`${day}T00:00:00Z`));
+}
+
+function withYear(date: string) {
+ return words.dateWithYear.replace("{year}", "2026").replace("{date}", date);
+}
+
+describe("Wiki Timeline in the language on screen", () => {
+ // The timeline runs through today; pin today to the last Session day.
+ beforeEach(() => {
+ vi.useFakeTimers({ toFake: ["Date"] });
+ vi.setSystemTime(new Date("2026-09-03T12:00:00+08:00"));
+ });
+ afterEach(() => {
+ vi.useRealTimers();
+ resetLanguageForTest();
+ });
+
+ it("names the months of the ruler in that language", async () => {
+ const moments = new Map([
+ ["a", [{ day: "2026-08-31", strength: "session" as const }]],
+ ]);
+ const months = () =>
+ buildTimeline(moments, "day", "2026-09-01").buckets.map(
+ (bucket) => bucket.monthLabel,
+ );
+ expect(months()).toEqual(["Aug", "Sep"]);
+ await setLanguage("zh-CN");
+ expect(months()).toEqual([
+ chinese("2026-08-31", { month: "short" }),
+ chinese("2026-09-01", { month: "short" }),
+ ]);
+ expect(
+ buildTimeline(moments, "day", "2026-09-01", "en-US").buckets[0]!
+ .monthLabel,
+ ).toBe("Aug");
+ });
+
+ it("words the toolbar and the playhead in Chinese and switches back in place", async () => {
+ await setLanguage("zh-CN");
+ render(<WikiKnowledgeGraph graph={graph} />);
+ const playhead = screen.getByRole("slider", { name: words.playhead });
+ const monthDay = { month: "short", day: "numeric" } as const;
+ expect(
+ screen.getAllByRole("radio").map((radio) => radio.textContent),
+ ).toEqual([words.day, words.week]);
+ expect(
+ screen.getByRole("searchbox", { name: words.searchPages }),
+ ).toHaveAttribute("placeholder", words.searchPages);
+ expect(screen.getByText(words.noReports)).toBeVisible();
+ expect(
+ screen.getByRole("button", { name: words.jumpToLatest }),
+ ).toHaveTextContent(words.latest);
+ expect(playhead).toHaveAttribute(
+ "aria-valuetext",
+ withYear(chinese("2026-09-03", monthDay)),
+ );
+
+ fireEvent.click(screen.getByRole("radio", { name: words.week }));
+ expect(playhead).toHaveAttribute(
+ "aria-valuetext",
+ withYear(
+ `${chinese("2026-08-31", monthDay)} – ${chinese("2026-09-06", monthDay)}`,
+ ),
+ );
+
+ await act(() => setLanguage("en"));
+ expect(
+ screen.getByRole("slider", { name: "Timeline playhead" }),
+ ).toHaveAttribute("aria-valuetext", "AUG 31 – SEP 6, 2026");
+ expect(screen.getByRole("radio", { name: "Week" })).toHaveAttribute(
+ "aria-checked",
+ "true",
+ );
+ });
+});
diff --git a/apps/web/src/features/memory/wiki-timeline.messages.ts b/apps/web/src/features/memory/wiki-timeline.messages.ts
new file mode 100644
index 00000000..dc011330
--- /dev/null
+++ b/apps/web/src/features/memory/wiki-timeline.messages.ts
@@ -0,0 +1,86 @@
+import { defineMessages } from "@/i18n/messages";
+
+/** Wiki > Timeline: the report cards, the ruler and the report panel. */
+export const wikiTimelineMessages = defineMessages("wikiTimeline", {
+ // Page.
+ dailyReport: "Daily report",
+ weeklyReport: "Weekly report",
+ reportCount: {
+ one: "{count} report · Browse by day",
+ other: "{count} reports · Browse by day",
+ },
+ generating: "Wiki is being generated…",
+ unavailable: "Timeline is unavailable.",
+ retryGraph: "Retry graph",
+ hiddenPreferences:
+ "This graph cannot display your hidden-file preferences. Refresh the graph to load the current view.",
+ graphFrame: "Personal knowledge graph",
+
+ // Toolbar.
+ granularity: "Timeline granularity",
+ day: "Day",
+ week: "Week",
+ searchPages: "Search pages",
+ noReports: "No reports available.",
+
+ // Ruler.
+ noDated: "No dated sessions or events yet.",
+ jumpToLatest: "Jump to latest",
+ latest: "Latest",
+ playhead: "Timeline playhead",
+ dateWithYear: "{date}, {year}",
+
+ // Report cards.
+ dailyTimeline: "Daily timeline",
+ weeklyTimeline: "Weekly timeline",
+ previousDayCard: "Previous day card",
+ previousWeekCard: "Previous week card",
+ nextDayCard: "Next day card",
+ nextWeekCard: "Next week card",
+ retryReports: "Retry reports",
+ loadingDailyCards: "Loading Daily cards…",
+ loadingWeeklyCards: "Loading Weekly cards…",
+ noDailyCards: "No Daily reports or dated pages yet.",
+ noWeeklyCards: "No Weekly reports or dated pages yet.",
+ dailyCards: "Daily cards",
+ weeklyCards: "Weekly cards",
+
+ // Report panel.
+ dailySummary: "Daily summary",
+ weeklySummary: "Weekly summary",
+ toggleDailyContents: "Toggle Daily contents",
+ toggleWeeklyContents: "Toggle Weekly contents",
+ contents: "Contents",
+ closeDaily: "Close Daily",
+ closeWeekly: "Close Weekly",
+ dailyContents: "Daily contents",
+ weeklyContents: "Weekly contents",
+ loadingDaily: "Loading Daily…",
+ loadingWeekly: "Loading Weekly…",
+ retryDaily: "Retry Daily",
+ retryWeekly: "Retry Weekly",
+ dailyContent: "{day} Daily content",
+ weeklyContent: "{day} Weekly content",
+ noDailyReport: "No Daily report for this day.",
+ noWeeklyReport: "No Weekly report for this week.",
+ resizeDailyTop: "Resize Daily top edge",
+ resizeDailyBottom: "Resize Daily bottom edge",
+ resizeDailyRight: "Resize Daily right edge",
+ resizeDailyLeft: "Resize Daily left edge",
+ resizeDailyTopRight: "Resize Daily top right corner",
+ resizeDailyTopLeft: "Resize Daily top left corner",
+ resizeDailyBottomRight: "Resize Daily bottom right corner",
+ resizeDailyBottomLeft: "Resize Daily bottom left corner",
+ resizeWeeklyTop: "Resize Weekly top edge",
+ resizeWeeklyBottom: "Resize Weekly bottom edge",
+ resizeWeeklyRight: "Resize Weekly right edge",
+ resizeWeeklyLeft: "Resize Weekly left edge",
+ resizeWeeklyTopRight: "Resize Weekly top right corner",
+ resizeWeeklyTopLeft: "Resize Weekly top left corner",
+ resizeWeeklyBottomRight: "Resize Weekly bottom right corner",
+ resizeWeeklyBottomLeft: "Resize Weekly bottom left corner",
+
+ // Raised while loading reports.
+ reportUnavailable: "Report is unavailable.",
+ repeatedCursor: "Report pagination returned a repeated cursor.",
+});
diff --git a/apps/web/src/i18n/locales/zh-CN.glossary.md b/apps/web/src/i18n/locales/zh-CN.glossary.md
index 48bfaef5..75177e7c 100644
--- a/apps/web/src/i18n/locales/zh-CN.glossary.md
+++ b/apps/web/src/i18n/locales/zh-CN.glossary.md
@@ -168,6 +168,9 @@ elsewhere.
| People / Companies | 人物 / 公司 | Wiki collections. |
| Daily / Weekly report | 日报 / 周报 | |
| Highlights / Next | 要点 / 接下来 | Sections of a report card. |
+| Personal Knowledge Graph | 个人知识图谱 | The Wiki's graph of pages. |
+| Session (a Wiki page) | 会话记录 | Not `会话`, which is the browser session. |
+| Playhead (of the Timeline) | 游标 | The marker a day or week rests under. |
| Email (an address) | 邮箱 | `邮件` is a message that is sent. |
| Keep (a Wiki page) | 保留 | The opposite of Delete in the Wiki directory. |
| Session (a sign-in) | 登录 / 浏览器会话 | `会话` only for the browser session. |
diff --git a/apps/web/src/i18n/locales/zh-CN.json b/apps/web/src/i18n/locales/zh-CN.json
index 2c861b21..1a5a7329 100644
--- a/apps/web/src/i18n/locales/zh-CN.json
+++ b/apps/web/src/i18n/locales/zh-CN.json
@@ -2463,5 +2463,73 @@
"cannotPlay": "此浏览器无法播放,请下载后收听。",
"seekRecording": "调整播放进度",
"playbackPosition": "{current} / {total}"
+ },
+ "wikiTimeline": {
+ "dailyReport": "日报",
+ "weeklyReport": "周报",
+ "reportCount": { "other": "{count} 份报告 · 按天浏览" },
+ "generating": "正在生成 Wiki…",
+ "unavailable": "时间线不可用。",
+ "retryGraph": "重试加载图谱",
+ "hiddenPreferences": "这个图谱无法按你隐藏文件的设置显示。请刷新图谱以加载当前视图。",
+ "graphFrame": "个人知识图谱",
+ "granularity": "时间线粒度",
+ "day": "天",
+ "week": "周",
+ "searchPages": "搜索页面",
+ "noReports": "没有可显示的报告。",
+ "noDated": "还没有带日期的会话记录或事件。",
+ "jumpToLatest": "跳到最新",
+ "latest": "最新",
+ "playhead": "时间线游标",
+ "dateWithYear": "{year}年{date}",
+ "dailyTimeline": "日报时间线",
+ "weeklyTimeline": "周报时间线",
+ "previousDayCard": "上一天的卡片",
+ "previousWeekCard": "上一周的卡片",
+ "nextDayCard": "下一天的卡片",
+ "nextWeekCard": "下一周的卡片",
+ "retryReports": "重试加载报告",
+ "loadingDailyCards": "正在加载日报卡片…",
+ "loadingWeeklyCards": "正在加载周报卡片…",
+ "noDailyCards": "还没有日报或带日期的页面。",
+ "noWeeklyCards": "还没有周报或带日期的页面。",
+ "dailyCards": "日报卡片",
+ "weeklyCards": "周报卡片",
+ "dailySummary": "日报摘要",
+ "weeklySummary": "周报摘要",
+ "toggleDailyContents": "展开或收起日报目录",
+ "toggleWeeklyContents": "展开或收起周报目录",
+ "contents": "目录",
+ "closeDaily": "关闭日报",
+ "closeWeekly": "关闭周报",
+ "dailyContents": "日报目录",
+ "weeklyContents": "周报目录",
+ "loadingDaily": "正在加载日报…",
+ "loadingWeekly": "正在加载周报…",
+ "retryDaily": "重试加载日报",
+ "retryWeekly": "重试加载周报",
+ "dailyContent": "{day} 日报内容",
+ "weeklyContent": "{day} 周报内容",
+ "noDailyReport": "这一天没有日报。",
+ "noWeeklyReport": "这一周没有周报。",
+ "resizeDailyTop": "拖动上边缘调整日报窗口大小",
+ "resizeDailyBottom": "拖动下边缘调整日报窗口大小",
+ "resizeDailyRight": "拖动右边缘调整日报窗口大小",
+ "resizeDailyLeft": "拖动左边缘调整日报窗口大小",
+ "resizeDailyTopRight": "拖动右上角调整日报窗口大小",
+ "resizeDailyTopLeft": "拖动左上角调整日报窗口大小",
+ "resizeDailyBottomRight": "拖动右下角调整日报窗口大小",
+ "resizeDailyBottomLeft": "拖动左下角调整日报窗口大小",
+ "resizeWeeklyTop": "拖动上边缘调整周报窗口大小",
+ "resizeWeeklyBottom": "拖动下边缘调整周报窗口大小",
+ "resizeWeeklyRight": "拖动右边缘调整周报窗口大小",
+ "resizeWeeklyLeft": "拖动左边缘调整周报窗口大小",
+ "resizeWeeklyTopRight": "拖动右上角调整周报窗口大小",
+ "resizeWeeklyTopLeft": "拖动左上角调整周报窗口大小",
+ "resizeWeeklyBottomRight": "拖动右下角调整周报窗口大小",
+ "resizeWeeklyBottomLeft": "拖动左下角调整周报窗口大小",
+ "reportUnavailable": "报告不可用。",
+ "repeatedCursor": "加载报告时分页返回了重复的游标。"
}
}