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 pages

Kilyn256b12851538
diff --git a/apps/web/src/features/wiki/knowledge-sidebar-trees.tsx b/apps/web/src/features/wiki/knowledge-sidebar-trees.tsx
index de02cad8..e2638baf 100644
--- a/apps/web/src/features/wiki/knowledge-sidebar-trees.tsx
+++ b/apps/web/src/features/wiki/knowledge-sidebar-trees.tsx
@@ -12,6 +12,7 @@ import { Link, useLocation, useParams } from "react-router";
import { Button } from "@/components/ui/button";
import { Spinner } from "@/components/ui/spinner";
import { documentFileName } from "@/features/library/document-display-name";
+import { libraryMessages } from "@/features/library/library.messages";
import { WorkspaceFileIcon } from "@/features/library/workspace-file-icon";
import { useLibraryTreeState } from "@/features/library/use-library-tree-state";
import { personalWikiDocumentsQueryKey } from "@/features/teamhub/document-queries";
@@ -27,8 +28,11 @@ import type {
TeamHubDocument,
TeamHubDocumentPage,
} from "@/features/teamhub/teamhub-types";
+import { translate } from "@/i18n/language";
+import { useT } from "@/i18n/use-translation";
import { useWikiDisplayState, wikiPageKey } from "./wiki-display-state";
+import { wikiMessages as m } from "./wiki.messages";
import { meetingPath, useMeetings } from "@/features/memory/memory-queries";
import {
@@ -73,20 +77,21 @@ export function MeetingsSidebarTree({
openedForRoutedMeeting.current = true;
setCollapsed(false);
}, [holdsRoutedMeeting, setCollapsed]);
- const label = "Meetings";
+ const t = useT();
+ const toggleLabel = t(collapsed ? m.expandMeetings : m.collapseMeetings);
const contentId = "library-meetings-collection";
return (
- <section aria-label={`${label} tree`}>
+ <section aria-label={t(m.meetingsTree)}>
{/* The tree marks the open meeting, not the collection holding it. */}
<div className="flex items-center justify-between gap-1">
<button
aria-controls={contentId}
aria-expanded={!collapsed}
- aria-label={`${collapsed ? "Expand" : "Collapse"} ${label}`}
+ aria-label={toggleLabel}
className={workspaceHeadingToggleClass}
onClick={() => setCollapsed((value) => !value)}
- title={`${collapsed ? "Expand" : "Collapse"} ${label}`}
+ title={toggleLabel}
type="button"
>
<Icon
@@ -94,12 +99,12 @@ export function MeetingsSidebarTree({
className="shrink-0 text-app-muted"
size={WORKSPACE_HEADING_ICON_SIZE}
/>
- <span className="truncate">{label}</span>
+ <span className="truncate">{t(libraryMessages.meetings)}</span>
</button>
<Link
- aria-label={`Open ${label}`}
+ aria-label={t(m.openMeetings)}
className={workspaceHeadingActionClass}
- title={`Open ${label}`}
+ title={t(m.openMeetings)}
to={meetingsTabPath(tenantId, "week")}
>
<Icon icon={ArrowRight01Icon} size={WORKSPACE_HEADING_ICON_SIZE} />
@@ -149,7 +154,7 @@ export function useWikiDocuments(tenantId: string) {
item.creator.tenant_id !== tenantId,
)
) {
- throw new Error("Wiki Documents are unavailable.");
+ throw new Error(translate(m.documentsUnavailable));
}
return page;
},
@@ -173,6 +178,7 @@ export function WikiFileTree({
tenantId: string;
}) {
const { documentId } = useParams();
+ const t = useT();
const display = useWikiDisplayState(tenantId);
const documents = useWikiDocuments(tenantId);
const pages = useMemo(() => {
@@ -234,20 +240,20 @@ export function WikiFileTree({
}
if (documents.isPending)
- return <TreeMessage busy>Loading Wiki Documents…</TreeMessage>;
+ return <TreeMessage busy>{t(m.loadingDocuments)}</TreeMessage>;
if (documents.error)
return (
<TreeError
- message={documents.error.message || "Wiki Documents are unavailable."}
+ message={documents.error.message || t(m.documentsUnavailable)}
onRetry={() => void documents.refetch()}
- label="Retry Wiki"
+ label={t(m.retryWiki)}
/>
);
return (
- <section aria-label="Pages" className="space-y-0.5">
+ <section aria-label={t(m.pages)} className="space-y-0.5">
{pages.length === 0 && !documents.hasNextPage ? (
- <TreeMessage>No generated pages yet.</TreeMessage>
+ <TreeMessage>{t(m.noGeneratedPages)}</TreeMessage>
) : (
rows.map(({ depth, node }) => {
const paddingLeft = 8 + depth * 16;
@@ -256,7 +262,12 @@ export function WikiFileTree({
return (
<button
aria-expanded={!collapsed}
- aria-label={`${collapsed ? "Expand" : "Collapse"} ${node.name}`}
+ aria-label={t(
+ collapsed
+ ? libraryMessages.expandFolder
+ : libraryMessages.collapseFolder,
+ { name: node.name },
+ )}
className="flex h-[33px] w-full items-center gap-2 rounded-md pr-2 text-left text-[14px] leading-[18px] text-muted-foreground hover:bg-app-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-app-focus"
key={`directory:${node.path}`}
onClick={() => toggleDirectory(node.path)}
@@ -295,7 +306,7 @@ export function WikiFileTree({
})
)}
{documents.isFetchingNextPage ? (
- <TreeMessage busy>Loading Wiki Documents…</TreeMessage>
+ <TreeMessage busy>{t(m.loadingDocuments)}</TreeMessage>
) : null}
</section>
);
@@ -314,6 +325,7 @@ function MeetingFiles({
tenantId: string;
}) {
const meetings = useMeetings(tenantId);
+ const t = useT();
const location = useLocation();
const currentId = new URLSearchParams(location.search).get("entry");
const days = useMemo(
@@ -325,22 +337,24 @@ function MeetingFiles({
);
if (meetings.isPending)
- return <TreeMessage busy>Loading Meetings…</TreeMessage>;
+ return <TreeMessage busy>{t(m.loadingMeetings)}</TreeMessage>;
if (meetings.error)
return (
<TreeError
- label="Retry Meetings"
- message="Meetings are unavailable."
+ label={t(m.retryMeetings)}
+ message={t(m.meetingsUnavailable)}
onRetry={() => void meetings.refetch()}
/>
);
- if (days.length === 0)
- return <TreeMessage>No completed meetings yet.</TreeMessage>;
+ if (days.length === 0) return <TreeMessage>{t(m.noMeetings)}</TreeMessage>;
return (
<div className="space-y-1">
{days.map((day) => (
- <section aria-label={`Meetings on ${day.date}`} key={day.date}>
+ <section
+ aria-label={t(m.meetingsOn, { date: day.date })}
+ key={day.date}
+ >
<h3 className="flex h-[24px] items-center px-2 text-[12px] font-medium text-app-muted">
{formatMeetingDay(day.date)}
</h3>
@@ -374,21 +388,24 @@ function MeetingLink({
to: string;
}) {
const ref = useRef<HTMLAnchorElement>(null);
+ const t = useT();
useEffect(() => {
if (current) ref.current?.scrollIntoView?.({ block: "nearest" });
}, [current]);
return (
<Link
aria-current={current ? "page" : undefined}
- aria-label={`Meeting ${meeting.date} ${meeting.time}`}
+ aria-label={t(m.meetingLabel, { date: meeting.date, time: meeting.time })}
className={`flex h-[33px] w-full min-w-0 items-center gap-2 rounded-md pl-[26px] pr-2 text-left text-[14px] leading-[18px] transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-app-focus ${current ? "bg-muted text-foreground" : "text-muted-foreground hover:bg-app-hover"}`}
onClick={onOpen}
ref={ref}
- title={`Meeting · ${meeting.date} ${meeting.time}`}
+ title={t(m.meetingTitle, { date: meeting.date, time: meeting.time })}
to={to}
>
<span className="min-w-0 flex-1 truncate">
- Meeting {formatMeetingWhen(meeting.date, meeting.time)}
+ {t(m.meetingWhen, {
+ when: formatMeetingWhen(meeting.date, meeting.time),
+ })}
</span>
</Link>
);
diff --git a/apps/web/src/features/wiki/wiki-collection-page.tsx b/apps/web/src/features/wiki/wiki-collection-page.tsx
index 9d310143..aa3fa391 100644
--- a/apps/web/src/features/wiki/wiki-collection-page.tsx
+++ b/apps/web/src/features/wiki/wiki-collection-page.tsx
@@ -4,9 +4,10 @@ import { Icon } from "@/components/ui/icon";
import type { TeamHubDocument } from "@/features/teamhub/teamhub-types";
import { Navigate, useParams } from "react-router";
import { requireRoomRouteParam } from "@/features/rooms/room-route-params";
+import { useT } from "@/i18n/use-translation";
import {
isWikiCollection,
- wikiCollectionLabels,
+ wikiCollections,
type WikiCollection,
} from "./wiki-display-state";
import {
@@ -20,6 +21,7 @@ import {
} from "./wiki-home-page";
import { type WikiEntry, wikiPreviewPages } from "./wiki-preview-pages";
import { usePersonalWikiRefresh } from "./wiki-refresh";
+import { wikiMessages as m } from "./wiki.messages";
const GraphPage = lazy(async () => {
const { WikiGraphPage } = await import("@/features/memory/wiki-graph-page");
@@ -28,6 +30,7 @@ const GraphPage = lazy(async () => {
export function WikiCollectionPage() {
const { collection, tenantId = "" } = useParams();
+ const t = useT();
if (!collection) return <WikiHomePage />;
// Profile is the Wiki home's default tab.
if (collection === "profile")
@@ -42,7 +45,7 @@ export function WikiCollectionPage() {
<Suspense
fallback={
<p role="status" className="p-4 text-sm text-app-muted">
- Loading timeline…
+ {t(m.loadingTimeline)}
</p>
}
>
@@ -55,7 +58,7 @@ export function WikiCollectionPage() {
<WikiCollectionContent collection={collection} />
) : (
<p role="alert" className="p-4">
- Wiki collection unavailable.
+ {t(m.collectionUnavailable)}
</p>
)}
</main>
@@ -69,8 +72,9 @@ function WikiCollectionContent({ collection }: { collection: WikiCollection }) {
const { preview } = usePersonalWikiRefresh(tenantId);
const previews = useMemo(() => wikiPreviewPages(preview), [preview]);
const [query, setQuery] = useState("");
+ const t = useT();
const all = collections.entries(collection, previews);
- const label = wikiCollectionLabels[collection];
+ const words = wikiCollections[collection];
const description = (entry: WikiEntry) =>
(entry.preview
? entry.preview.description
@@ -88,9 +92,9 @@ function WikiCollectionContent({ collection }: { collection: WikiCollection }) {
return (
<div className="workspace-content mx-auto w-full px-4 py-6 md:px-8">
<WikiBack />
- <h1 className="mb-2 text-2xl text-foreground">{label}</h1>
+ <h1 className="mb-2 text-2xl text-foreground">{t(words.label)}</h1>
<p className="mb-6 text-sm text-muted-foreground">
- {all.length} {label.toLowerCase()}
+ {t(words.count, { count: all.length })}
</p>
{/* Same search field as the Connectors catalog. */}
<label className="relative mb-6 block">
@@ -100,21 +104,21 @@ function WikiCollectionContent({ collection }: { collection: WikiCollection }) {
size={14}
/>
<input
- aria-label={`Search ${label}`}
+ aria-label={t(words.search)}
className="h-9 w-full rounded-lg border border-border bg-card pr-3 pl-9 text-sm text-foreground transition-colors duration-150 placeholder:text-app-placeholder hover:border-border-hover focus-visible:border-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
onChange={(event) => setQuery(event.target.value)}
- placeholder={`Search ${label.toLowerCase()}`}
+ placeholder={t(words.search)}
type="search"
value={query}
/>
</label>
{collections.pending ? (
<p role="status" className="text-sm text-muted-foreground">
- Loading Wiki Documents…
+ {t(m.loadingDocuments)}
</p>
) : collections.error ? (
<p role="alert" className="text-sm text-muted-foreground">
- Wiki Documents are unavailable.
+ {t(m.documentsUnavailable)}
</p>
) : pages.length ? (
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2">
@@ -131,7 +135,7 @@ function WikiCollectionContent({ collection }: { collection: WikiCollection }) {
</span>
<span className="mt-1 block text-sm text-muted-foreground">
{description(entry) ||
- (entry.published ? editedLabel(entry.published) : "")}
+ (entry.published ? editedLabel(entry.published, t) : "")}
</span>
</WikiEntryLink>
))}
@@ -139,8 +143,8 @@ function WikiCollectionContent({ collection }: { collection: WikiCollection }) {
) : (
<p className="text-sm text-muted-foreground">
{needle
- ? `No ${label.toLowerCase()} match “${query.trim()}”.`
- : `No generated ${label.toLowerCase()} yet.`}
+ ? t(words.noMatch, { query: query.trim() })
+ : t(words.noneGenerated)}
</p>
)}
</div>
diff --git a/apps/web/src/features/wiki/wiki-daily-card.tsx b/apps/web/src/features/wiki/wiki-daily-card.tsx
index 228d69db..617de28b 100644
--- a/apps/web/src/features/wiki/wiki-daily-card.tsx
+++ b/apps/web/src/features/wiki/wiki-daily-card.tsx
@@ -5,28 +5,32 @@ import {
SUGGESTED_FOCUS_LABEL,
} from "@linger/knowledge-format/sections";
import { Icon } from "@/components/ui/icon";
+import { type Translate, formatLocale, translate } from "@/i18n/language";
+import { useT } from "@/i18n/use-translation";
import type { TeamHubMemoryEntry } from "@/features/teamhub/teamhub-types";
import {
usePeriodReport,
type PeriodReportKind,
} from "@/features/memory/wiki-period-reports";
+import { wikiMessages as m } from "./wiki.messages";
+
interface DailyReportParts {
summary: string;
highlights: string[];
next: string;
}
-const dayFormatter = new Intl.DateTimeFormat("en-US", {
- weekday: "short",
- month: "short",
- day: "numeric",
- timeZone: "UTC",
-});
-
export function formatReportDay(day: string): string {
const parsed = Date.parse(`${day}T00:00:00Z`);
- return Number.isFinite(parsed) ? dayFormatter.format(parsed) : day;
+ return Number.isFinite(parsed)
+ ? new Intl.DateTimeFormat(formatLocale(), {
+ weekday: "short",
+ month: "short",
+ day: "numeric",
+ timeZone: "UTC",
+ }).format(parsed)
+ : day;
}
function section(markdown: string, titles: string[]): string {
@@ -75,6 +79,7 @@ function unquote(value: string) {
/** Reads a Daily Memory into the card's summary, Highlights, and Next. */
export function parseDailyReport(
entry: Pick<TeamHubMemoryEntry, "summary" | "content">,
+ t: Translate = translate,
): DailyReportParts {
const meta = frontmatter(entry.content);
const markdown = entry.content.replace(/^---\n[\s\S]*?\n---\n/u, "");
@@ -90,7 +95,7 @@ export function parseDailyReport(
plain(description) ||
plain(entry.summary) ||
work[0] ||
- "Open the timeline to read this report.",
+ t(m.openTimelineToRead),
highlights: work.slice(0, 2),
next: (
items(section(markdown, [DAILY_REPORT_SECTIONS.tomorrowFocus]))[0] ?? ""
@@ -123,11 +128,14 @@ export function WikiDailyCard({
entry,
load && Boolean(entry) && !entry?.content,
);
- const parts = entry ? parseDailyReport(full.data ?? entry) : undefined;
+ const t = useT();
+ const parts = entry ? parseDailyReport(full.data ?? entry, t) : undefined;
return (
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions -- the whole card is a pointer shortcut; keyboard users open the report with its button
<article
- aria-label={`${kind === "daily" ? "Daily" : "Weekly"} report ${day}`}
+ aria-label={t(kind === "daily" ? m.dailyReportFor : m.weeklyReportFor, {
+ day,
+ })}
className={`daily-card ${className}`}
onClick={(event) => {
if (
@@ -143,17 +151,17 @@ export function WikiDailyCard({
</div>
<div className="daily-card-body">
<button
- aria-label={`Open ${kind === "daily" ? "Daily" : "Weekly"} for ${day}`}
+ aria-label={t(kind === "daily" ? m.openDaily : m.openWeekly, { day })}
className="daily-card-summary"
onClick={onOpen}
type="button"
>
{parts?.summary ??
- `No ${kind === "daily" ? "daily" : "weekly"} report for this ${kind === "daily" ? "day" : "week"}.`}
+ t(kind === "daily" ? m.noDailyReport : m.noWeeklyReport)}
</button>
{parts?.highlights.length ? (
<div className="daily-card-group">
- <span className="daily-tag">Highlights</span>
+ <span className="daily-tag">{t(m.highlights)}</span>
<ul>
{parts.highlights.map((item) => (
<li key={item}>{item}</li>
@@ -163,7 +171,7 @@ export function WikiDailyCard({
) : null}
{parts?.next ? (
<div className="daily-card-group">
- <span className="daily-tag">Next</span>
+ <span className="daily-tag">{t(m.next)}</span>
<p>{parts.next}</p>
</div>
) : null}
diff --git a/apps/web/src/features/wiki/wiki-directory.test.tsx b/apps/web/src/features/wiki/wiki-directory.test.tsx
index 09519165..3d57442d 100644
--- a/apps/web/src/features/wiki/wiki-directory.test.tsx
+++ b/apps/web/src/features/wiki/wiki-directory.test.tsx
@@ -355,7 +355,7 @@ describe("Wiki directory", () => {
it("filters a collection page by name", async () => {
await setup("/t/tenant-northstar/library/wiki/projects");
const search = await screen.findByRole("searchbox", {
- name: "Search Projects",
+ name: "Search projects",
});
expect(await screen.findByRole("link", { name: /alpha/ })).toBeVisible();
fireEvent.change(search, { target: { value: "BET" } });
diff --git a/apps/web/src/features/wiki/wiki-directory.tsx b/apps/web/src/features/wiki/wiki-directory.tsx
index 993dfade..687dae1e 100644
--- a/apps/web/src/features/wiki/wiki-directory.tsx
+++ b/apps/web/src/features/wiki/wiki-directory.tsx
@@ -33,12 +33,14 @@ import {
import { useLibraryTreeState } from "@/features/library/use-library-tree-state";
import { documentQueryOptions } from "@/features/rooms/room-queries";
import { useTeamHubRuntime } from "@/features/teamhub/teamhub-runtime";
+import { commonMessages } from "@/i18n/common.messages";
+import { useT } from "@/i18n/use-translation";
import { useWikiDocuments } from "./knowledge-sidebar-trees";
import {
isWikiCollection,
useWikiDisplayState,
wikiCollection,
- wikiCollectionLabels,
+ wikiCollections,
wikiPageKey,
wikiPagePath,
type WikiCollection,
@@ -46,14 +48,23 @@ import {
import { wikiPreviewPath } from "./wiki-preview-page";
import { wikiPreviewPages } from "./wiki-preview-pages";
import { usePersonalWikiRefresh } from "./wiki-refresh";
+import { wikiMessages as m } from "./wiki.messages";
const entries = [
- { id: "profile", label: "Profile", icon: UserIcon },
- { id: "graph", label: "Timeline", icon: NoteEditIcon },
- { id: "projects", label: "Projects", icon: Briefcase01Icon },
- { id: "topics", label: wikiCollectionLabels.topics, icon: Tag01Icon },
- { id: "contacts", label: wikiCollectionLabels.contacts, icon: UserGroupIcon },
- { id: "clients", label: wikiCollectionLabels.clients, icon: Building03Icon },
+ { id: "profile", label: m.profileTab, icon: UserIcon },
+ { id: "graph", label: m.timeline, icon: NoteEditIcon },
+ {
+ id: "projects",
+ label: wikiCollections.projects.label,
+ icon: Briefcase01Icon,
+ },
+ { id: "topics", label: wikiCollections.topics.label, icon: Tag01Icon },
+ {
+ id: "contacts",
+ label: wikiCollections.contacts.label,
+ icon: UserGroupIcon,
+ },
+ { id: "clients", label: wikiCollections.clients.label, icon: Building03Icon },
] as const;
// Rows reuse the Library sidebar's row tokens (30px, 14px/18px, grey idle
// tone, grey pill when current) so both sidebars match. Touch
@@ -70,6 +81,7 @@ export function WikiDirectory({
onFileOpen?: () => void;
}) {
const { client } = useTeamHubRuntime();
+ const t = useT();
const location = useLocation();
const workspaceTree = useWorkspaceTree();
const navigate = useNavigate();
@@ -144,7 +156,7 @@ export function WikiDirectory({
<div className="flex min-w-0 items-center gap-2">
{collection ? (
<button
- aria-label="Back to Wiki"
+ aria-label={t(m.backToWiki)}
className="flex size-8 max-sm:size-11 shrink-0 items-center justify-center rounded-md text-app-muted hover:bg-app-hover focus-visible:ring-2 focus-visible:ring-app-focus"
onClick={() => {
setAnimateNavigation(true);
@@ -159,17 +171,15 @@ export function WikiDirectory({
</button>
) : null}
<h2 className={secondaryNavigationTitleClass}>
- {collection ? wikiCollectionLabels[collection] : "Wiki"}
+ {t(collection ? wikiCollections[collection].label : m.title)}
</h2>
</div>
</header>
<nav
key={collection ?? "root"}
- aria-label={
- collection
- ? `${wikiCollectionLabels[collection]} files`
- : "Wiki directory"
- }
+ aria-label={t(
+ collection ? wikiCollections[collection].files : m.directory,
+ )}
className={`space-y-0.5 pt-2 ${animateNavigation ? (collection ? "wiki-directory-forward" : "wiki-directory-back") : ""}`}
>
{!collection ? (
@@ -196,7 +206,9 @@ export function WikiDirectory({
className={current ? "shrink-0" : "shrink-0 text-app-muted"}
size={WORKSPACE_HEADING_ICON_SIZE}
/>
- <span className="min-w-0 flex-1 truncate">{entry.label}</span>
+ <span className="min-w-0 flex-1 truncate">
+ {t(entry.label)}
+ </span>
{entry.id !== "profile" && entry.id !== "graph" ? (
<Icon
icon={ArrowRight01Icon}
@@ -211,20 +223,20 @@ export function WikiDirectory({
<>
{documents.isPending ? (
<p className="px-2 py-2 text-sm text-app-muted">
- Loading Wiki Documents…
+ {t(m.loadingDocuments)}
</p>
) : documents.error ? (
<div role="alert" className="px-2 py-2 text-sm text-app-danger">
{documents.error.message}
<button onClick={() => void documents.refetch()} type="button">
- Retry Wiki
+ {t(m.retryWiki)}
</button>
</div>
) : pages.length === 0 &&
newPages.length === 0 &&
!documents.hasNextPage ? (
<p className="px-2 py-2 text-sm text-app-muted">
- No generated {collection} yet.
+ {t(wikiCollections[collection].noneGenerated)}
</p>
) : null}
{pages.map((page) => (
@@ -262,16 +274,17 @@ export function WikiDirectory({
<button
className="min-h-7 max-sm:min-h-11 max-sm:min-w-11 rounded-full bg-secondary px-2.5 text-xs font-medium text-secondary-foreground transition-colors hover:bg-primary/9 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50"
disabled={!display.ready}
- aria-label={`Keep ${page.title}`}
+ aria-label={t(m.keepPage, { title: page.title })}
type="button"
onClick={() => display.decide(wikiPagePath(page), "keep")}
>
- Keep
+ {t(m.keep)}
</button>
<button
+ data-voice-risk="never"
className="min-h-7 max-sm:min-h-11 max-sm:min-w-11 rounded-full border border-destructive/40 bg-card px-2.5 text-xs font-medium text-destructive transition-colors hover:border-foreground/15 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50"
disabled={!display.ready}
- aria-label={`Delete ${page.title}`}
+ aria-label={t(m.deletePage, { title: page.title })}
type="button"
onClick={() => {
display.decide(wikiPagePath(page), "delete");
@@ -279,7 +292,7 @@ export function WikiDirectory({
void navigate(`${base}/${collection}`);
}}
>
- Delete
+ {t(commonMessages.delete)}
</button>
</div>
) : null}
diff --git a/apps/web/src/features/wiki/wiki-display-state.ts b/apps/web/src/features/wiki/wiki-display-state.ts
index 6a3b6653..f7c1915c 100644
--- a/apps/web/src/features/wiki/wiki-display-state.ts
+++ b/apps/web/src/features/wiki/wiki-display-state.ts
@@ -5,15 +5,46 @@ import { useTeamHubRuntime } from "@/features/teamhub/teamhub-runtime";
import type { TeamHubDocument } from "@/features/teamhub/teamhub-types";
import type { WikiGraphData } from "@/features/memory/wiki-graph-model";
-export const wikiCollectionLabels = {
- projects: "Projects",
- topics: "Topics",
- contacts: "People",
- clients: "Companies",
+import { wikiMessages as m } from "./wiki.messages";
+
+/** The wording of each collection, by its route and data key. */
+export const wikiCollections = {
+ projects: {
+ count: m.projectCount,
+ files: m.projectFiles,
+ label: m.projects,
+ noMatch: m.noProjectsMatch,
+ noneGenerated: m.noGeneratedProjects,
+ search: m.searchProjects,
+ },
+ topics: {
+ count: m.topicCount,
+ files: m.topicFiles,
+ label: m.topics,
+ noMatch: m.noTopicsMatch,
+ noneGenerated: m.noGeneratedTopics,
+ search: m.searchTopics,
+ },
+ contacts: {
+ count: m.peopleCount,
+ files: m.peopleFiles,
+ label: m.people,
+ noMatch: m.noPeopleMatch,
+ noneGenerated: m.noGeneratedPeople,
+ search: m.searchPeople,
+ },
+ clients: {
+ count: m.companyCount,
+ files: m.companyFiles,
+ label: m.companies,
+ noMatch: m.noCompaniesMatch,
+ noneGenerated: m.noGeneratedCompanies,
+ search: m.searchCompanies,
+ },
} as const;
-export type WikiCollection = keyof typeof wikiCollectionLabels;
+export type WikiCollection = keyof typeof wikiCollections;
export function isWikiCollection(value: string): value is WikiCollection {
- return Object.hasOwn(wikiCollectionLabels, value);
+ return Object.hasOwn(wikiCollections, value);
}
export function wikiPagePath(document: TeamHubDocument) {
return (
diff --git a/apps/web/src/features/wiki/wiki-document-links.ts b/apps/web/src/features/wiki/wiki-document-links.ts
index d81fde91..c0b88533 100644
--- a/apps/web/src/features/wiki/wiki-document-links.ts
+++ b/apps/web/src/features/wiki/wiki-document-links.ts
@@ -14,7 +14,11 @@ import { personalWikiDocumentsQueryKey } from "@/features/teamhub/document-queri
import { teamHubData } from "@/features/teamhub/teamhub-api";
import type { TeamHubClient } from "@/features/teamhub/teamhub-client";
import type { TeamHubDocument } from "@/features/teamhub/teamhub-types";
+import type { Message } from "@/i18n/messages";
+import { useT } from "@/i18n/use-translation";
+
import { isWikiCitationHref } from "./wiki-citation-links";
+import { wikiMessages as m } from "./wiki.messages";
type WikiDocument = Pick<TeamHubDocument, "id" | "tenant_id" | "from">;
@@ -94,7 +98,9 @@ export function useWikiDocumentLinks(
const queryClient = useQueryClient();
const request = useRef(0);
const [pending, setPending] = useState(false);
- const [error, setError] = useState<string | null>(null);
+ // Held as a message so the sentence follows the language on screen.
+ const [error, setError] = useState<Message<string> | null>(null);
+ const t = useT();
const documentId = document?.id;
const anchorLinks = useDocumentAnchorLinks(contentRef, documentId);
useEffect(() => {
@@ -138,7 +144,7 @@ export function useWikiDocumentLinks(
event.stopPropagation();
request.current += 1;
setPending(false);
- setError("This link does not point to an available Wiki page.");
+ setError(m.linkNotWikiPage);
return;
}
event.preventDefault();
@@ -177,13 +183,11 @@ export function useWikiDocumentLinks(
.catch(() => {
if (request.current !== currentRequest) return;
setPending(false);
- setError(
- "This linked Wiki page could not be opened. It may be unavailable or you may no longer have access. Please try again.",
- );
+ setError(m.linkCouldNotOpen);
});
}
return {
- error: pending ? null : (anchorLinks.error ?? error),
+ error: pending ? null : (anchorLinks.error ?? (error ? t(error) : null)),
openLink,
pending,
};
diff --git a/apps/web/src/features/wiki/wiki-home-page.tsx b/apps/web/src/features/wiki/wiki-home-page.tsx
index 6d7b3df3..f11ec045 100644
--- a/apps/web/src/features/wiki/wiki-home-page.tsx
+++ b/apps/web/src/features/wiki/wiki-home-page.tsx
@@ -12,6 +12,10 @@ import { requireRoomRouteParam } from "@/features/rooms/room-route-params";
import { useTeamHubRuntime } from "@/features/teamhub/teamhub-runtime";
import type { TeamHubDocument } from "@/features/teamhub/teamhub-types";
import { documentFileName } from "@/features/library/document-display-name";
+import { commonMessages } from "@/i18n/common.messages";
+import { type Translate, formatLocale, translate } from "@/i18n/language";
+import type { Message } from "@/i18n/messages";
+import { useT } from "@/i18n/use-translation";
import { useWikiDocuments } from "./knowledge-sidebar-trees";
import { WikiDailyCard } from "./wiki-daily-card";
import {
@@ -37,6 +41,7 @@ import {
reportDate,
usePeriodReports,
} from "@/features/memory/wiki-period-reports";
+import { wikiMessages as m } from "./wiki.messages";
import "./wiki-home-page.css";
const entityHues = [
@@ -47,10 +52,6 @@ const entityHues = [
"#9c2a1c",
"#5e9c1c",
];
-const dateFormatter = new Intl.DateTimeFormat("en-US", {
- month: "short",
- day: "numeric",
-});
export function pageName(page: TeamHubDocument) {
return documentFileName(page).replace(/\.md$/i, "");
@@ -74,11 +75,16 @@ function entityColors(key: number | string) {
return { background: `${color}1a`, color };
}
-export function editedLabel(page: TeamHubDocument) {
+export function editedLabel(page: TeamHubDocument, t: Translate = translate) {
const date = new Date(page.updated_at);
return Number.isNaN(date.valueOf())
? ""
- : `Edited ${dateFormatter.format(date)}`;
+ : t(m.edited, {
+ date: new Intl.DateTimeFormat(formatLocale(), {
+ month: "short",
+ day: "numeric",
+ }).format(date),
+ });
}
/** Graph nodes by Wiki page key; descriptions and links feed the cards. */
@@ -128,8 +134,8 @@ export function useWikiCollectionPages(tenantId: string) {
}
const homeTabs = [
- { id: "profile", label: "Profile" },
- { id: "wiki", label: "Wiki" },
+ { id: "profile", label: m.profileTab },
+ { id: "wiki", label: m.title },
] as const;
type WikiHomeTab = (typeof homeTabs)[number]["id"];
@@ -148,15 +154,16 @@ export function WikiHomePage() {
searchParams.get("tab") === "wiki" ? "wiki" : "profile";
const refresh = usePersonalWikiRefresh(tenantId);
const { tabRef, indicator } = useTabIndicator(tab);
+ const t = useT();
return (
<main className="workspace-content-viewport workspace-scrollbar wiki-landing min-w-0 flex-1 overflow-y-auto bg-app-surface [scrollbar-gutter:stable]">
{/* Same column, heading and tabs as the Library page. */}
<div className="workspace-file-browser">
- <h1 className="sr-only">Wiki</h1>
+ <h1 className="sr-only">{t(m.title)}</h1>
{/* Profile and Wiki tabs head the page in the Library column. */}
<header className="wiki-home-header flex items-center gap-3">
<div
- aria-label="Wiki views"
+ aria-label={t(m.views)}
className="workspace-file-tabs relative flex max-w-full gap-1 overflow-x-auto"
role="tablist"
>
@@ -174,7 +181,7 @@ export function WikiHomePage() {
role="tab"
type="button"
>
- {candidate.label}
+ {t(candidate.label)}
</button>
))}
{indicator}
@@ -190,7 +197,7 @@ export function WikiHomePage() {
<Suspense
fallback={
<p role="status" className="text-sm text-app-muted">
- Loading Profile…
+ {t(m.loadingProfile)}
</p>
}
>
@@ -219,6 +226,7 @@ function WikiOverview({
const reports = usePeriodReports(tenantId, "daily");
const previews = useMemo(() => wikiPreviewPages(preview), [preview]);
const anotherMe = useAnotherMeActorId(tenantId);
+ const t = useT();
const base = `/t/${encodeURIComponent(tenantId)}/library/wiki`;
const documentPath = (page: TeamHubDocument) =>
`/t/${encodeURIComponent(tenantId)}/documents/${encodeURIComponent(page.id)}`;
@@ -237,17 +245,18 @@ function WikiOverview({
? entry.preview.description
: nodes.get(entry.key)?.description;
const subtitle = (entry: WikiEntry) =>
- description(entry) || (entry.published ? editedLabel(entry.published) : "");
+ description(entry) ||
+ (entry.published ? editedLabel(entry.published, t) : "");
const card = { documentPath, tenantId };
- const status = (empty: string) =>
+ const status = (empty: Message<string>) =>
collections.pending ? (
- <p className="landing-empty">Loading…</p>
+ <p className="landing-empty">{t(commonMessages.loading)}</p>
) : collections.error ? (
<p role="alert" className="landing-empty">
- Pages are unavailable.
+ {t(m.pagesUnavailable)}
</p>
) : refreshing ? null : (
- <p className="landing-empty">{empty}</p>
+ <p className="landing-empty">{t(empty)}</p>
);
return (
@@ -259,15 +268,15 @@ function WikiOverview({
<div className="landing-col landing-col-left">
<section className="landing-section landing-daily">
<SectionHeader
- title="Daily report"
+ title={t(m.dailyReport)}
count={daily.length}
to={`${base}/graph`}
/>
{reports.isPending ? (
- <p className="landing-empty">Loading reports…</p>
+ <p className="landing-empty">{t(m.loadingReports)}</p>
) : reports.error ? (
<p role="alert" className="landing-empty">
- Reports are unavailable.
+ {t(m.reportsUnavailable)}
</p>
) : daily.length ? (
<div className="daily-list">
@@ -289,16 +298,16 @@ function WikiOverview({
})}
</div>
) : (
- <p className="landing-empty">No daily reports yet.</p>
+ <p className="landing-empty">{t(m.noDailyReports)}</p>
)}
</section>
<EntryCards
{...card}
className="landing-projects"
- title="Projects"
+ title={t(m.projects)}
to={`${base}/projects`}
entries={projects}
- empty={status("No projects yet.")}
+ empty={status(m.noProjects)}
description={description}
members={(entry) =>
[
@@ -315,10 +324,10 @@ function WikiOverview({
<EntryCards
{...card}
className="landing-topics"
- title="Topics"
+ title={t(m.topics)}
to={`${base}/topics`}
entries={topics}
- empty={status("No topics yet.")}
+ empty={status(m.noTopics)}
description={description}
members={() => []}
/>
@@ -326,7 +335,7 @@ function WikiOverview({
<div className="landing-col landing-col-right">
<section className="landing-section landing-people">
<SectionHeader
- title="People"
+ title={t(m.people)}
count={people.length}
to={`${base}/contacts`}
/>
@@ -348,12 +357,12 @@ function WikiOverview({
))}
</div>
) : (
- status("No people yet.")
+ status(m.noPeople)
)}
</section>
<section className="landing-section landing-companies">
<SectionHeader
- title="Companies"
+ title={t(m.companies)}
count={companies.length}
to={`${base}/clients`}
/>
@@ -377,7 +386,7 @@ function WikiOverview({
))}
</div>
) : (
- status("No companies yet.")
+ status(m.noCompanies)
)}
</section>
</div>
@@ -441,6 +450,7 @@ function EntryCards({
description: (entry: WikiEntry) => string | undefined;
members: (entry: WikiEntry) => string[];
}) {
+ const t = useT();
return (
<section className={`landing-section ${className}`}>
<SectionHeader title={title} count={entries.length} to={to} />
@@ -458,7 +468,7 @@ function EntryCards({
<span className="project-card-desc">{description(entry)}</span>
<span className="project-card-meta">
<span className="project-card-time">
- {entry.published ? editedLabel(entry.published) : ""}
+ {entry.published ? editedLabel(entry.published, t) : ""}
</span>
<span className="project-involvers">
{members(entry).map((name) => (
@@ -494,6 +504,7 @@ function SectionHeader({
count: number;
to: string;
}) {
+ const t = useT();
return (
<header className="landing-section-header">
<h2 className="landing-section-title">
@@ -501,7 +512,7 @@ function SectionHeader({
<span className="section-count">{count}</span>
</h2>
<Link className="landing-view-all" to={to}>
- View all
+ {t(m.viewAll)}
<Icon icon={ArrowRight02Icon} size={14} />
</Link>
</header>
@@ -510,14 +521,15 @@ function SectionHeader({
export function WikiBack() {
const tenantId = requireRoomRouteParam(useParams().tenantId, "Tenant");
+ const t = useT();
return (
<Link
- aria-label="Back to Wiki"
+ aria-label={t(m.backToWiki)}
className="wiki-back"
to={`/t/${encodeURIComponent(tenantId)}/library/wiki?tab=wiki`}
>
<Icon icon={ArrowLeft02Icon} size={16} />
- Back
+ {t(commonMessages.back)}
</Link>
);
}
diff --git a/apps/web/src/features/wiki/wiki-preview-page.tsx b/apps/web/src/features/wiki/wiki-preview-page.tsx
index 028d3469..4d51fcba 100644
--- a/apps/web/src/features/wiki/wiki-preview-page.tsx
+++ b/apps/web/src/features/wiki/wiki-preview-page.tsx
@@ -1,12 +1,14 @@
import { Navigate, useParams, useSearchParams } from "react-router";
import { ReadOnlyBlockNoteDocumentLoader } from "@/components/read-only-blocknote-document-loader";
import { requireRoomRouteParam } from "@/features/rooms/room-route-params";
+import { useT } from "@/i18n/use-translation";
import { useWikiDocuments } from "./knowledge-sidebar-trees";
import { wikiPageKey, wikiPagePath } from "./wiki-display-state";
import { resolveWikiPageReference } from "./wiki-document-links";
import { wikiPreviewPages } from "./wiki-preview-pages";
import { usePersonalWikiRefresh } from "./wiki-refresh";
+import { wikiMessages as m } from "./wiki.messages";
import "@/features/rooms/documents/room-document-blocknote.css";
import "./wiki-working-card.css";
@@ -23,6 +25,7 @@ export function wikiPreviewPath(tenantId: string, path: string) {
export function WikiPreviewPage() {
const tenantId = requireRoomRouteParam(useParams().tenantId, "Tenant");
const [searchParams] = useSearchParams();
+ const t = useT();
const path = searchParams.get("page") ?? "";
const refresh = usePersonalWikiRefresh(tenantId);
const documents = useWikiDocuments(tenantId);
@@ -64,9 +67,7 @@ export function WikiPreviewPage() {
return (
<main className="flex min-w-0 flex-1 items-start justify-center bg-app-surface p-10">
<p className="text-sm text-app-muted" role="status">
- {refresh.refreshing
- ? "This page is not written yet."
- : "This page was not published."}
+ {t(refresh.refreshing ? m.notWrittenYet : m.notPublished)}
</p>
</main>
);
@@ -83,10 +84,10 @@ export function WikiPreviewPage() {
</span>
<span
className="room-document-header-updated inline-flex items-center gap-1.5"
- title="Not published yet. This page may still change."
+ title={t(m.notPublishedHint)}
>
<span aria-hidden="true" className="wiki-preview-dot" />
- Generating
+ {t(m.generating)}
</span>
</div>
</div>
diff --git a/apps/web/src/features/wiki/wiki-profile-edit-button.tsx b/apps/web/src/features/wiki/wiki-profile-edit-button.tsx
index 699490b5..3539aadd 100644
--- a/apps/web/src/features/wiki/wiki-profile-edit-button.tsx
+++ b/apps/web/src/features/wiki/wiki-profile-edit-button.tsx
@@ -5,6 +5,9 @@ import { Button } from "@/components/ui/button";
import { Icon } from "@/components/ui/icon";
import { personalProfileQueryOptions } from "@/features/settings/personal-profile-queries";
import { useTeamHubRuntime } from "@/features/teamhub/teamhub-runtime";
+import { useT } from "@/i18n/use-translation";
+
+import { wikiMessages as m } from "./wiki.messages";
/** The Wiki header's page-level Edit action for the Profile tab; the Profile
* page shows its form while the URL carries `edit=1`. */
@@ -12,6 +15,7 @@ export function WikiProfileEditButton({ tenantId }: { tenantId: string }) {
const { client } = useTeamHubRuntime();
const profile = useQuery(personalProfileQueryOptions(client, tenantId));
const [searchParams, setSearchParams] = useSearchParams();
+ const t = useT();
if (!profile.data?.current || searchParams.get("edit") === "1") return null;
const building = Boolean(profile.data.building_since);
return (
@@ -20,13 +24,11 @@ export function WikiProfileEditButton({ tenantId }: { tenantId: string }) {
disabled={building}
onClick={() => setSearchParams({ edit: "1" })}
size="compact"
- title={
- building ? "Another Me is updating your profile" : "Edit your profile"
- }
+ title={t(building ? m.updatingProfile : m.editYourProfile)}
tone="ghost"
>
<Icon icon={PencilEdit02Icon} size={14} className="shrink-0" />
- Edit profile
+ {t(m.editProfile)}
</Button>
);
}
diff --git a/apps/web/src/features/wiki/wiki-profile-editor.tsx b/apps/web/src/features/wiki/wiki-profile-editor.tsx
index 3cf0844f..22d76772 100644
--- a/apps/web/src/features/wiki/wiki-profile-editor.tsx
+++ b/apps/web/src/features/wiki/wiki-profile-editor.tsx
@@ -1,6 +1,10 @@
import { useState, type FormEvent } from "react";
import { Button } from "@/components/ui/button";
import { FormFeedback } from "@/components/ui/form-feedback";
+import { commonMessages } from "@/i18n/common.messages";
+import { RichMessage, useT } from "@/i18n/use-translation";
+
+import { wikiMessages as m } from "./wiki.messages";
/** Edits the whole Profile as its Markdown; TeamHub reads it back into the
* Profile's sections, so the layout hint names what the headings mean. */
@@ -18,25 +22,25 @@ export function WikiProfileEditor({
pending: boolean;
}) {
const [draft, setDraft] = useState(markdown);
+ const t = useT();
const submit = (event: FormEvent<HTMLFormElement>) => {
event.preventDefault();
onSave(draft);
};
return (
<form
- aria-label="Edit Profile"
+ aria-label={t(m.editProfileForm)}
className="wiki-profile-edit"
onSubmit={submit}
>
<p className="wiki-profile-edit-hint">
- Keep the five <code>##</code> sections. Under Background,{" "}
- <code>### Timeline</code> lists <code>- years · organization</code>{" "}
- entries with years only (<code>2019</code> start, <code>–2013</code>{" "}
- end, <code>≤2013</code> ended by then, <code>Present</code> ongoing);
- any other <code>###</code> starts a point.
+ <RichMessage
+ message={m.editHint}
+ tags={{ code: (text) => <code>{text}</code> }}
+ />
</p>
<textarea
- aria-label="Profile Markdown"
+ aria-label={t(m.profileMarkdown)}
className="wiki-profile-edit-markdown ui-field-control"
disabled={pending}
onChange={(event) => setDraft(event.target.value)}
@@ -47,7 +51,7 @@ export function WikiProfileEditor({
{error ? <FormFeedback tone="danger">{error}</FormFeedback> : null}
<div className="wiki-profile-edit-buttons">
<Button disabled={pending} onClick={onCancel}>
- Cancel
+ {t(commonMessages.cancel)}
</Button>
<Button
disabled={draft === markdown}
@@ -55,7 +59,7 @@ export function WikiProfileEditor({
tone="primary"
type="submit"
>
- Save
+ {t(commonMessages.save)}
</Button>
</div>
</div>
diff --git a/apps/web/src/features/wiki/wiki-profile-page.tsx b/apps/web/src/features/wiki/wiki-profile-page.tsx
index 78a8f07d..a3ce5389 100644
--- a/apps/web/src/features/wiki/wiki-profile-page.tsx
+++ b/apps/web/src/features/wiki/wiki-profile-page.tsx
@@ -18,12 +18,16 @@ import type {
TeamHubPersonalProfileModule,
TeamHubPersonalProfileTimelineEntry,
} from "@/features/teamhub/teamhub-types";
+import { commonMessages } from "@/i18n/common.messages";
+import type { Translate } from "@/i18n/language";
+import { useT } from "@/i18n/use-translation";
import {
useAnotherMeActorId,
WikiWorkingCenter,
WikiWorkingLine,
} from "./wiki-working-card";
import { WikiProfileEditor } from "./wiki-profile-editor";
+import { wikiMessages as m } from "./wiki.messages";
import "./wiki-profile-page.css";
type ProfilePart =
@@ -57,10 +61,11 @@ function pointsMarkdown(points: TeamHubPersonalProfileModule["points"]) {
// its overview first, then its Timeline and points.
function profileArticleParts(
profile: TeamHubPersonalProfileDocument,
+ t: Translate,
): ProfilePart[] {
const { background } = profile;
const parts: ProfilePart[] = [
- { kind: "markdown", markdown: "## Background" },
+ { kind: "markdown", markdown: `## ${plainMarkdown(t(m.background))}` },
];
if (background.overview.trim())
parts.push({
@@ -75,16 +80,16 @@ function profileArticleParts(
markdown: pointsMarkdown(background.points).join("\n"),
});
for (const [label, module] of [
- ["Communication style", profile.communication_style],
- ["Working style", profile.working_style],
- ["Preferences", profile.preferences],
- ["Writing style", profile.writing_style],
+ [t(m.communicationStyle), profile.communication_style],
+ [t(m.workingStyle), profile.working_style],
+ [t(m.preferences), profile.preferences],
+ [t(m.writingStyle), profile.writing_style],
] as const) {
const overview = module.overview.trim();
parts.push({
kind: "markdown",
markdown: [
- `## ${label}`,
+ `## ${plainMarkdown(label)}`,
...(overview ? ["", plainMarkdown(overview)] : []),
...(module.points.length ? ["", ...pointsMarkdown(module.points)] : []),
].join("\n"),
@@ -123,8 +128,9 @@ function ProfileTimeline({
}: {
entries: TeamHubPersonalProfileTimelineEntry[];
}) {
+ const t = useT();
return (
- <ol aria-label="Timeline" className="wiki-profile-timeline">
+ <ol aria-label={t(m.timeline)} className="wiki-profile-timeline">
{entries.map((entry, index) => (
<li className="wiki-profile-timeline-entry" key={index}>
<span className="wiki-profile-timeline-period">{entry.period}</span>
@@ -163,6 +169,7 @@ function ProfileTimeline({
export function WikiProfilePage() {
const { tenantId = "" } = useParams();
const { client } = useTeamHubRuntime();
+ const t = useT();
const profile = useQuery(personalProfileQueryOptions(client, tenantId));
const account = useQuery(accountProfileQueryOptions(client, tenantId));
// The Actor ID seeds the initials tint, so this avatar matches the rail's.
@@ -187,7 +194,7 @@ export function WikiProfilePage() {
});
const saveError =
save.error instanceof TeamHubError && save.error.status === 409
- ? "Your Profile changed while you were editing, perhaps because Another Me updated it. Cancel to see the latest version, then edit again."
+ ? t(m.profileChanged)
: (save.error?.message ?? null);
if (profile.isPending || account.isPending)
return (
@@ -196,7 +203,7 @@ export function WikiProfilePage() {
role="status"
>
<Spinner size={16} />
- Loading Profile…
+ {t(m.loadingProfile)}
</p>
);
if (profile.error || account.error)
@@ -210,31 +217,31 @@ export function WikiProfilePage() {
void account.refetch();
}}
>
- Retry Profile
+ {t(m.retryProfile)}
</Button>
</div>
);
const current = profile.data.current;
const building = Boolean(profile.data.building_since);
const person = account.data;
- const parts = current ? profileArticleParts(current.profile) : [];
+ const parts = current ? profileArticleParts(current.profile, t) : [];
// The infobox title already names the person.
const details = [
- ["Organization", person.organization],
- ["Email", person.email],
- ].filter(([, value]) => value);
+ { key: "organization", label: m.organization, value: person.organization },
+ { key: "email", label: m.email, value: person.email },
+ ].filter((detail) => detail.value);
return (
<div className="wiki-profile mx-auto w-full max-w-[1000px] pb-4">
<div className="grid items-start gap-6 xl:grid-cols-[minmax(0,1fr)_320px] xl:gap-8">
<aside
- aria-label="Profile details"
+ aria-label={t(m.profileDetails)}
className="wiki-profile-infobox xl:sticky xl:top-6 xl:order-2"
>
<h2 className="wiki-profile-infobox-title">{person.name}</h2>
<div className="wiki-profile-infobox-avatar flex justify-center px-4 py-4">
{person.avatar_image ? (
<img
- alt={`${person.name} avatar`}
+ alt={t(commonMessages.avatar, { name: person.name })}
className="size-24 rounded-lg object-cover"
src={person.avatar_image}
/>
@@ -248,10 +255,10 @@ export function WikiProfilePage() {
)}
</div>
<dl>
- {details.map(([label, value]) => (
- <div className="wiki-profile-infobox-row" key={label}>
- <dt>{label}</dt>
- <dd>{value}</dd>
+ {details.map((detail) => (
+ <div className="wiki-profile-infobox-row" key={detail.key}>
+ <dt>{t(detail.label)}</dt>
+ <dd>{detail.value}</dd>
</div>
))}
<WikiProfileSourcesRow client={client} tenantId={tenantId} />
@@ -262,7 +269,7 @@ export function WikiProfilePage() {
<WikiWorkingLine
actorId={anotherMe}
className="mb-6"
- text="Another Me is updating your profile"
+ text={t(m.updatingProfile)}
/>
) : null}
{current && editing ? (
@@ -280,7 +287,7 @@ export function WikiProfilePage() {
/>
) : parts.length ? (
<div
- aria-label="Profile content"
+ aria-label={t(m.profileContent)}
className="wiki-profile-article"
data-editable="false"
role="article"
@@ -290,11 +297,11 @@ export function WikiProfilePage() {
<ProfileTimeline entries={part.entries} key={index} />
) : (
<ReadOnlyBlockNoteDocument
- ariaLabel="Profile section"
+ ariaLabel={t(m.profileSection)}
key={index}
markdown={part.markdown}
presentation="knowledge"
- documentTitle="Profile"
+ documentTitle={t(m.profileTab)}
/>
),
)}
@@ -302,13 +309,10 @@ export function WikiProfilePage() {
) : building ? (
<WikiWorkingCenter
actorId={anotherMe}
- title="Getting to know you…"
+ title={t(m.gettingToKnowYou)}
/>
) : (
- <p className="text-sm text-app-muted">
- Your profile is not available yet. Add a source under Sources to
- create it.
- </p>
+ <p className="text-sm text-app-muted">{t(m.profileEmpty)}</p>
)}
</div>
</div>
diff --git a/apps/web/src/features/wiki/wiki-profile-sources.tsx b/apps/web/src/features/wiki/wiki-profile-sources.tsx
index 324b2b30..fbaa3dec 100644
--- a/apps/web/src/features/wiki/wiki-profile-sources.tsx
+++ b/apps/web/src/features/wiki/wiki-profile-sources.tsx
@@ -18,6 +18,9 @@ import { DisconnectAccountDialog } from "@/features/settings/account-disconnect-
import { profileSourcePolicy } from "@/features/settings/profile-source-policy";
import type { TeamHubClient } from "@/features/teamhub/teamhub-client";
import type { TeamHubExternalConnection } from "@/features/teamhub/teamhub-types";
+import { useT } from "@/i18n/use-translation";
+
+import { wikiMessages as m } from "./wiki.messages";
// Add source is a large flow; load it only when the Human opens it.
const AccountMoreDialog = lazy(async () => {
@@ -55,6 +58,7 @@ export function WikiProfileSourcesRow({
const connections = useQuery(externalConnectionsQueryOptions(client));
const [view, setView] = useState<SourcesView | null>(null);
const hintId = useId();
+ const t = useT();
const catalog = apps.data?.apps ?? [];
const sources: ProfileSource[] = catalog
.filter(
@@ -71,7 +75,7 @@ export function WikiProfileSourcesRow({
const reconnectSource: ProfileSource = {
app: app.display_name,
id: app.key,
- label: `Reconnect ${app.display_name}`,
+ label: t(m.reconnectSource, { app: app.display_name }),
logoUrl: app.logo_url,
provider: app.key,
state: "reconnect",
@@ -84,7 +88,12 @@ export function WikiProfileSourcesRow({
app: app.display_name,
connection,
id: connection.id,
- label: `${app.display_name} · ${accountIdentityText(app.key, connection.identity_label) ?? "Connected account"} — connected`,
+ label: t(m.connectedSource, {
+ account:
+ accountIdentityText(app.key, connection.identity_label, t) ??
+ t(m.connectedAccount),
+ app: app.display_name,
+ }),
logoUrl: app.logo_url,
provider: app.key,
state: "connected",
@@ -99,7 +108,7 @@ export function WikiProfileSourcesRow({
: {
app: app.display_name,
id: app.key,
- label: `Connect ${app.display_name}`,
+ label: t(m.connectSource, { app: app.display_name }),
logoUrl: app.logo_url,
provider: app.key,
state: "connect",
@@ -116,14 +125,14 @@ export function WikiProfileSourcesRow({
<div className="wiki-profile-infobox-row">
<dt>
<span className="wiki-profile-sources-label">
- <span aria-describedby={hintId}>Sources</span>
+ <span aria-describedby={hintId}>{t(m.sources)}</span>
<span className="wiki-profile-source-tip" id={hintId} role="tooltip">
- Another Me learns from these to write this page
+ {t(m.sourcesHint)}
</span>
</span>
</dt>
<dd className="wiki-profile-sources">
- <ul aria-label="Profile sources" className="flex items-center">
+ <ul aria-label={t(m.profileSources)} className="flex items-center">
{sources.map((source) => (
<li className="wiki-profile-source group/source" key={source.id}>
<button
@@ -161,7 +170,7 @@ export function WikiProfileSourcesRow({
))}
<li className="wiki-profile-source">
<button
- aria-label="Add source"
+ aria-label={t(m.addSource)}
className="wiki-profile-source-chip text-muted-foreground"
onClick={() => setView({ kind: "add" })}
type="button"
@@ -169,7 +178,7 @@ export function WikiProfileSourcesRow({
<Icon icon={PlusSignIcon} size={14} />
</button>
<span aria-hidden="true" className="wiki-profile-source-tip">
- Add source
+ {t(m.addSource)}
</span>
</li>
</ul>
diff --git a/apps/web/src/features/wiki/wiki-refresh-status.tsx b/apps/web/src/features/wiki/wiki-refresh-status.tsx
index b8da6986..54043a57 100644
--- a/apps/web/src/features/wiki/wiki-refresh-status.tsx
+++ b/apps/web/src/features/wiki/wiki-refresh-status.tsx
@@ -1,18 +1,20 @@
import { AlertCircleIcon } from "@hugeicons/core-free-icons";
import { Icon } from "@/components/ui/icon";
+import type { Message } from "@/i18n/messages";
+import { useT } from "@/i18n/use-translation";
import type {
WikiRefreshFailureReason,
WikiRefreshStatus,
} from "./wiki-refresh";
import { WikiWorkingLine } from "./wiki-working-card";
+import { wikiMessages as m } from "./wiki.messages";
-const failureMessages: Record<WikiRefreshFailureReason, string> = {
- computer_offline: "Wiki update failed — Your Computer was offline.",
- runtime_auth_required: "Wiki update failed — Runtime sign-in required.",
- runtime_incompatible:
- "Wiki update failed — Runtime incompatible. Update your local CLI or Linger.",
- runtime_unavailable: "Wiki update failed — Local Runtime is unavailable.",
+const failureMessages: Record<WikiRefreshFailureReason, Message<string>> = {
+ computer_offline: m.updateFailedComputerOffline,
+ runtime_auth_required: m.updateFailedSignIn,
+ runtime_incompatible: m.updateFailedIncompatible,
+ runtime_unavailable: m.updateFailedRuntimeUnavailable,
};
/** What the Wiki home says while a refresh writes pages, or after one failed.
@@ -25,19 +27,21 @@ export function WikiRefreshBanner({
}: Pick<WikiRefreshStatus, "failed" | "failureReason" | "refreshing"> & {
agentActorId?: string;
}) {
+ const t = useT();
if (refreshing)
return (
<WikiWorkingLine
actorId={agentActorId}
className="mb-6"
- text="Another Me is writing your Wiki"
+ text={t(m.writingWiki)}
/>
);
if (!failed) return null;
- const message =
+ const message = t(
failureReason && Object.hasOwn(failureMessages, failureReason)
? failureMessages[failureReason]
- : "Wiki update failed";
+ : m.updateFailed,
+ );
return (
<div
className="mb-6 flex min-h-9 items-center gap-2 rounded-lg border border-[var(--app-status-danger-border)] bg-[var(--app-status-danger-surface)] px-4 py-2 text-xs font-medium text-[var(--app-status-danger-text)]"
diff --git a/apps/web/src/features/wiki/wiki.messages.ts b/apps/web/src/features/wiki/wiki.messages.ts
new file mode 100644
index 00000000..1fcc4073
--- /dev/null
+++ b/apps/web/src/features/wiki/wiki.messages.ts
@@ -0,0 +1,142 @@
+import { defineMessages } from "@/i18n/messages";
+
+/** The Wiki pages: the Profile and Wiki tabs, collections and sidebar trees. */
+export const wikiMessages = defineMessages("wiki", {
+ // The Wiki home: its two tabs and the overview of generated pages.
+ title: "Wiki",
+ views: "Wiki views",
+ profileTab: "Profile",
+ loadingProfile: "Loading Profile…",
+ backToWiki: "Back to Wiki",
+ viewAll: "View all",
+ pagesUnavailable: "Pages are unavailable.",
+ dailyReport: "Daily report",
+ loadingReports: "Loading reports…",
+ reportsUnavailable: "Reports are unavailable.",
+ noDailyReports: "No daily reports yet.",
+ noProjects: "No projects yet.",
+ noTopics: "No topics yet.",
+ noPeople: "No people yet.",
+ noCompanies: "No companies yet.",
+ edited: "Edited {date}",
+
+ // Collections and the directory beside an opened page.
+ timeline: "Timeline",
+ projects: "Projects",
+ topics: "Topics",
+ people: "People",
+ companies: "Companies",
+ loadingTimeline: "Loading timeline…",
+ collectionUnavailable: "Wiki collection unavailable.",
+ projectCount: { one: "{count} project", other: "{count} projects" },
+ topicCount: { one: "{count} topic", other: "{count} topics" },
+ peopleCount: { one: "{count} person", other: "{count} people" },
+ companyCount: { one: "{count} company", other: "{count} companies" },
+ searchProjects: "Search projects",
+ searchTopics: "Search topics",
+ searchPeople: "Search people",
+ searchCompanies: "Search companies",
+ noProjectsMatch: "No projects match “{query}”.",
+ noTopicsMatch: "No topics match “{query}”.",
+ noPeopleMatch: "No people match “{query}”.",
+ noCompaniesMatch: "No companies match “{query}”.",
+ noGeneratedProjects: "No generated projects yet.",
+ noGeneratedTopics: "No generated topics yet.",
+ noGeneratedPeople: "No generated people yet.",
+ noGeneratedCompanies: "No generated companies yet.",
+ projectFiles: "Projects files",
+ topicFiles: "Topics files",
+ peopleFiles: "People files",
+ companyFiles: "Companies files",
+ directory: "Wiki directory",
+ loadingDocuments: "Loading Wiki Documents…",
+ documentsUnavailable: "Wiki Documents are unavailable.",
+ retryWiki: "Retry Wiki",
+ keep: "Keep",
+ keepPage: "Keep {title}",
+ deletePage: "Delete {title}",
+
+ // The sidebar trees: generated pages and Meetings.
+ pages: "Pages",
+ noGeneratedPages: "No generated pages yet.",
+ meetingsTree: "Meetings tree",
+ expandMeetings: "Expand Meetings",
+ collapseMeetings: "Collapse Meetings",
+ openMeetings: "Open Meetings",
+ loadingMeetings: "Loading Meetings…",
+ retryMeetings: "Retry Meetings",
+ meetingsUnavailable: "Meetings are unavailable.",
+ noMeetings: "No completed meetings yet.",
+ meetingsOn: "Meetings on {date}",
+ meetingLabel: "Meeting {date} {time}",
+ meetingTitle: "Meeting · {date} {time}",
+ meetingWhen: "Meeting {when}",
+
+ // Daily and Weekly report cards.
+ openTimelineToRead: "Open the timeline to read this report.",
+ dailyReportFor: "Daily report {day}",
+ weeklyReportFor: "Weekly report {day}",
+ openDaily: "Open Daily for {day}",
+ openWeekly: "Open Weekly for {day}",
+ noDailyReport: "No daily report for this day.",
+ noWeeklyReport: "No weekly report for this week.",
+ highlights: "Highlights",
+ next: "Next",
+
+ // The Profile tab.
+ background: "Background",
+ communicationStyle: "Communication style",
+ workingStyle: "Working style",
+ preferences: "Preferences",
+ writingStyle: "Writing style",
+ profileChanged:
+ "Your Profile changed while you were editing, perhaps because Another Me updated it. Cancel to see the latest version, then edit again.",
+ retryProfile: "Retry Profile",
+ organization: "Organization",
+ email: "Email",
+ profileDetails: "Profile details",
+ updatingProfile: "Another Me is updating your profile",
+ profileContent: "Profile content",
+ profileSection: "Profile section",
+ gettingToKnowYou: "Getting to know you…",
+ profileEmpty:
+ "Your profile is not available yet. Add a source under Sources to create it.",
+ editProfile: "Edit profile",
+ editYourProfile: "Edit your profile",
+ editProfileForm: "Edit Profile",
+ editHint:
+ "Keep the five <code>##</code> sections. Under Background, <code>### Timeline</code> lists <code>- years · organization</code> entries with years only (<code>2019</code> start, <code>–2013</code> end, <code>≤2013</code> ended by then, <code>Present</code> ongoing); any other <code>###</code> starts a point.",
+ profileMarkdown: "Profile Markdown",
+
+ // The Sources row of the Profile infobox.
+ sources: "Sources",
+ sourcesHint: "Another Me learns from these to write this page",
+ profileSources: "Profile sources",
+ connectSource: "Connect {app}",
+ reconnectSource: "Reconnect {app}",
+ connectedSource: "{app} · {account} — connected",
+ connectedAccount: "Connected account",
+ addSource: "Add source",
+
+ // A refresh that is writing pages, or failed.
+ writingWiki: "Another Me is writing your Wiki",
+ updateFailed: "Wiki update failed",
+ updateFailedComputerOffline:
+ "Wiki update failed — Your Computer was offline.",
+ updateFailedSignIn: "Wiki update failed — Runtime sign-in required.",
+ updateFailedIncompatible:
+ "Wiki update failed — Runtime incompatible. Update your local CLI or Linger.",
+ updateFailedRuntimeUnavailable:
+ "Wiki update failed — Local Runtime is unavailable.",
+
+ // A page the running refresh has written but not published.
+ notWrittenYet: "This page is not written yet.",
+ notPublished: "This page was not published.",
+ notPublishedHint: "Not published yet. This page may still change.",
+ generating: "Generating",
+
+ // Links between Wiki pages.
+ linkNotWikiPage: "This link does not point to an available Wiki page.",
+ linkCouldNotOpen:
+ "This linked Wiki page could not be opened. It may be unavailable or you may no longer have access. Please try again.",
+});
diff --git a/apps/web/src/i18n/locales/zh-CN.glossary.md b/apps/web/src/i18n/locales/zh-CN.glossary.md
index 0505bfc4..8db8ff34 100644
--- a/apps/web/src/i18n/locales/zh-CN.glossary.md
+++ b/apps/web/src/i18n/locales/zh-CN.glossary.md
@@ -156,6 +156,14 @@ elsewhere.
| Popup (authorization) | 弹窗 | `拦截` for a popup the browser blocked. |
| Back / Forward / Reload | 返回 / 前进 / 重新加载 | Buttons of the URL preview panel. |
| Tab (in a browser) | 标签页 | |
+| Sources (of the Profile) | 来源 | What Another Me reads to write the Profile. |
+| Timeline | 时间线 | A Wiki collection, and a list of periods. |
+| Projects / Topics | 项目 / 主题 | Wiki collections. |
+| People / Companies | 人物 / 公司 | Wiki collections. |
+| Daily / Weekly report | 日报 / 周报 | |
+| Highlights / Next | 要点 / 接下来 | Sections of a report card. |
+| Email (an address) | 邮箱 | `邮件` is a message that is sent. |
+| Keep (a Wiki page) | 保留 | The opposite of Delete in the Wiki directory. |
## Style
diff --git a/apps/web/src/i18n/locales/zh-CN.json b/apps/web/src/i18n/locales/zh-CN.json
index 2e91e789..e2986f4e 100644
--- a/apps/web/src/i18n/locales/zh-CN.json
+++ b/apps/web/src/i18n/locales/zh-CN.json
@@ -1976,5 +1976,120 @@
"openSiteInNewTab": "在新标签页中打开这个网站",
"siteRefusesFrame": "{host} 不允许在应用内显示。",
"previewTitle": "预览 {url}"
+ },
+ "wiki": {
+ "title": "Wiki",
+ "views": "Wiki 视图",
+ "profileTab": "个人资料",
+ "loadingProfile": "正在加载个人资料…",
+ "backToWiki": "返回 Wiki",
+ "viewAll": "查看全部",
+ "pagesUnavailable": "页面不可用。",
+ "dailyReport": "日报",
+ "loadingReports": "正在加载报告…",
+ "reportsUnavailable": "报告不可用。",
+ "noDailyReports": "还没有日报。",
+ "noProjects": "还没有项目。",
+ "noTopics": "还没有主题。",
+ "noPeople": "还没有人物。",
+ "noCompanies": "还没有公司。",
+ "edited": "编辑于 {date}",
+ "timeline": "时间线",
+ "projects": "项目",
+ "topics": "主题",
+ "people": "人物",
+ "companies": "公司",
+ "loadingTimeline": "正在加载时间线…",
+ "collectionUnavailable": "这组 Wiki 页面不可用。",
+ "projectCount": { "other": "{count} 个项目" },
+ "topicCount": { "other": "{count} 个主题" },
+ "peopleCount": { "other": "{count} 位人物" },
+ "companyCount": { "other": "{count} 家公司" },
+ "searchProjects": "搜索项目",
+ "searchTopics": "搜索主题",
+ "searchPeople": "搜索人物",
+ "searchCompanies": "搜索公司",
+ "noProjectsMatch": "没有与“{query}”匹配的项目。",
+ "noTopicsMatch": "没有与“{query}”匹配的主题。",
+ "noPeopleMatch": "没有与“{query}”匹配的人物。",
+ "noCompaniesMatch": "没有与“{query}”匹配的公司。",
+ "noGeneratedProjects": "还没有生成的项目。",
+ "noGeneratedTopics": "还没有生成的主题。",
+ "noGeneratedPeople": "还没有生成的人物。",
+ "noGeneratedCompanies": "还没有生成的公司。",
+ "projectFiles": "项目文件",
+ "topicFiles": "主题文件",
+ "peopleFiles": "人物文件",
+ "companyFiles": "公司文件",
+ "directory": "Wiki 目录",
+ "loadingDocuments": "正在加载 Wiki 文档…",
+ "documentsUnavailable": "Wiki 文档不可用。",
+ "retryWiki": "重试加载 Wiki",
+ "keep": "保留",
+ "keepPage": "保留 {title}",
+ "deletePage": "删除 {title}",
+ "pages": "页面",
+ "noGeneratedPages": "还没有生成的页面。",
+ "meetingsTree": "会议目录树",
+ "expandMeetings": "展开会议",
+ "collapseMeetings": "收起会议",
+ "openMeetings": "打开会议",
+ "loadingMeetings": "正在加载会议…",
+ "retryMeetings": "重试加载会议",
+ "meetingsUnavailable": "会议不可用。",
+ "noMeetings": "还没有已结束的会议。",
+ "meetingsOn": "{date} 的会议",
+ "meetingLabel": "会议 {date} {time}",
+ "meetingTitle": "会议 · {date} {time}",
+ "meetingWhen": "会议 {when}",
+ "openTimelineToRead": "打开时间线阅读这份报告。",
+ "dailyReportFor": "日报 {day}",
+ "weeklyReportFor": "周报 {day}",
+ "openDaily": "打开 {day} 的日报",
+ "openWeekly": "打开 {day} 的周报",
+ "noDailyReport": "这一天没有日报。",
+ "noWeeklyReport": "这一周没有周报。",
+ "highlights": "要点",
+ "next": "接下来",
+ "background": "背景",
+ "communicationStyle": "沟通风格",
+ "workingStyle": "工作风格",
+ "preferences": "偏好",
+ "writingStyle": "写作风格",
+ "profileChanged": "你编辑的时候个人资料有了变化,可能是 Another Me 更新了它。请先取消以查看最新版本,再重新编辑。",
+ "retryProfile": "重试加载个人资料",
+ "organization": "组织",
+ "email": "邮箱",
+ "profileDetails": "个人资料详情",
+ "updatingProfile": "Another Me 正在更新你的个人资料",
+ "profileContent": "个人资料内容",
+ "profileSection": "个人资料章节",
+ "gettingToKnowYou": "正在了解你…",
+ "profileEmpty": "你的个人资料还没有生成。在“来源”下添加一个来源即可创建。",
+ "editProfile": "编辑个人资料",
+ "editYourProfile": "编辑你的个人资料",
+ "editProfileForm": "编辑个人资料",
+ "editHint": "请保留五个 <code>##</code> 章节。在 Background 下,<code>### Timeline</code> 列出 <code>- 年份 · 组织</code> 条目,只写年份(<code>2019</code> 表示开始,<code>–2013</code> 表示结束,<code>≤2013</code> 表示在此之前已结束,<code>Present</code> 表示至今);其他 <code>###</code> 都会开始一个要点。",
+ "profileMarkdown": "个人资料 Markdown",
+ "sources": "来源",
+ "sourcesHint": "Another Me 会从这些来源了解你,并写出这个页面",
+ "profileSources": "个人资料来源",
+ "connectSource": "连接 {app}",
+ "reconnectSource": "重新连接 {app}",
+ "connectedSource": "{app} · {account}(已连接)",
+ "connectedAccount": "已连接的账号",
+ "addSource": "添加来源",
+ "writingWiki": "Another Me 正在撰写你的 Wiki",
+ "updateFailed": "Wiki 更新失败",
+ "updateFailedComputerOffline": "Wiki 更新失败:你的电脑当时处于离线状态。",
+ "updateFailedSignIn": "Wiki 更新失败:需要登录 Runtime。",
+ "updateFailedIncompatible": "Wiki 更新失败:Runtime 不兼容。请更新本地的 CLI 或 Linger。",
+ "updateFailedRuntimeUnavailable": "Wiki 更新失败:本地 Runtime 不可用。",
+ "notWrittenYet": "这个页面还没有写好。",
+ "notPublished": "这个页面没有发布。",
+ "notPublishedHint": "尚未发布,这个页面可能还会变化。",
+ "generating": "生成中",
+ "linkNotWikiPage": "这个链接指向的不是可用的 Wiki 页面。",
+ "linkCouldNotOpen": "无法打开链接的这个 Wiki 页面。它可能已不可用,或者你已失去访问权限。请重试。"
}
}