Skip to content

LLM Wiki is a cross-platform desktop application that turns your documents into an organized, interlinked knowledge base — automatically. Instead of traditional RAG (retrieve-and-answer from scratch every time), the LLM incrementally builds and maintains a persistent wiki from your sources。

TypeScript

feat: complete UI internationalization and component improvements

TonyCMCCd48bdc10777c
diff --git a/src/components/chat/chat-panel.tsx b/src/components/chat/chat-panel.tsx
index 65ef8ad5..7e7fa61d 100644
--- a/src/components/chat/chat-panel.tsx
+++ b/src/components/chat/chat-panel.tsx
@@ -1,4 +1,5 @@
import { useRef, useEffect, useCallback, useState } from "react"
+import { useTranslation } from "react-i18next"
import { BookOpen, Plus, Trash2, MessageSquare } from "lucide-react"
import { Button } from "@/components/ui/button"
import { ChatMessage, StreamingMessage, useSourceFiles } from "./chat-message"
@@ -29,6 +30,7 @@ function formatDate(timestamp: number): string {
}
function ConversationSidebar() {
+ const { t } = useTranslation()
const conversations = useChatStore((s) => s.conversations)
const activeConversationId = useChatStore((s) => s.activeConversationId)
const messages = useChatStore((s) => s.messages)
@@ -54,14 +56,14 @@ function ConversationSidebar() {
onClick={() => createConversation()}
>
<Plus className="h-3.5 w-3.5" />
- New Chat
+ {t("chat.newChat")}
</Button>
</div>
<div className="flex-1 overflow-y-auto py-1">
{sorted.length === 0 ? (
<p className="px-3 py-4 text-xs text-muted-foreground text-center">
- No conversations yet
+ {t("chat.noConversationsYet")}
</p>
) : (
sorted.map((conv) => {
@@ -105,7 +107,7 @@ function ConversationSidebar() {
{msgCount > 0 && (
<>
<span>·</span>
- <span>{msgCount} msgs</span>
+ <span>{msgCount} {t("chat.msgCount")}</span>
</>
)}
</div>
@@ -119,6 +121,7 @@ function ConversationSidebar() {
}
export function ChatPanel() {
+ const { t } = useTranslation()
useSourceFiles() // Keep source file cache warm
const activeConversationId = useChatStore((s) => s.activeConversationId)
const isStreaming = useChatStore((s) => s.isStreaming)
@@ -484,8 +487,8 @@ export function ChatPanel() {
<div className="flex flex-1 items-center justify-center text-muted-foreground">
<div className="text-center">
<MessageSquare className="mx-auto mb-3 h-8 w-8 opacity-30" />
- <p className="text-sm">Start a new conversation</p>
- <p className="mt-1 text-xs opacity-60">Click "New Chat" to begin</p>
+ <p className="text-sm">{t("chat.startNewConversation")}</p>
+ <p className="mt-1 text-xs opacity-60">{t("chat.clickNewChatToBegin")}</p>
</div>
</div>
) : (
@@ -522,7 +525,7 @@ export function ChatPanel() {
className="w-full gap-2"
>
<BookOpen className="h-4 w-4" />
- Write to Wiki
+ {t("chat.writeToWiki")}
</Button>
</div>
)}
@@ -535,8 +538,8 @@ export function ChatPanel() {
isStreaming={isStreaming}
placeholder={
mode === "ingest"
- ? "Discuss the source or ask follow-up questions..."
- : "Type a message..."
+ ? t("chat.ingestPlaceholder")
+ : t("chat.typeAMessage")
}
/>
</div>
diff --git a/src/components/graph/graph-view.tsx b/src/components/graph/graph-view.tsx
index 92fdda7a..61469c49 100644
--- a/src/components/graph/graph-view.tsx
+++ b/src/components/graph/graph-view.tsx
@@ -16,29 +16,19 @@ import { queueResearch } from "@/lib/deep-research"
import { optimizeResearchTopic } from "@/lib/optimize-research-topic"
import { normalizePath } from "@/lib/path-utils"
import { applyGraphFilters, DEFAULT_GRAPH_FILTERS, hasActiveGraphFilters, type GraphFilterState } from "@/lib/graph-filters"
+import { useTranslation } from "react-i18next"
const NODE_TYPE_COLORS: Record<string, string> = {
entity: "#60a5fa", // blue-400
concept: "#c084fc", // purple-400
source: "#fb923c", // orange-400
query: "#4ade80", // green-400
- synthesis: "#f87171", // red-400
+ synthesis: "#f87171", // red-400
overview: "#facc15", // yellow-400
comparison: "#2dd4bf", // teal-400
other: "#94a3b8", // slate-400
}
-const NODE_TYPE_LABELS: Record<string, string> = {
- entity: "Entity",
- concept: "Concept",
- source: "Source",
- query: "Query",
- synthesis: "Synthesis",
- overview: "Overview",
- comparison: "Comparison",
- other: "Other",
-}
-
const COMMUNITY_COLORS = [
"#60a5fa", // blue-400
"#4ade80", // green-400
@@ -321,6 +311,7 @@ function ZoomControls() {
// --- Main component ---
export function GraphView() {
+ const { t } = useTranslation()
const project = useWikiStore((s) => s.project)
const dataVersion = useWikiStore((s) => s.dataVersion)
const setSelectedFile = useWikiStore((s) => s.setSelectedFile)
@@ -349,6 +340,9 @@ export function GraphView() {
}))
const [nodeMenu, setNodeMenu] = useState<{ nodeId: string; x: number; y: number } | null>(null)
const graphContainerRef = useRef<HTMLDivElement>(null)
+ // i18n node type labels (populated after mount to support language switching)
+ const [nodeTypeLabels, setNodeTypeLabels] = useState<Record<string, string>>({})
+
// Research confirmation dialog
const [researchDialog, setResearchDialog] = useState<{
loading: boolean
@@ -377,6 +371,20 @@ export function GraphView() {
}
}, [project])
+ // Initialize node type labels when i18n is ready
+ useEffect(() => {
+ setNodeTypeLabels({
+ entity: t("graph.nodeTypeLabels.entity"),
+ concept: t("graph.nodeTypeLabels.concept"),
+ source: t("graph.nodeTypeLabels.source"),
+ query: t("graph.nodeTypeLabels.query"),
+ synthesis: t("graph.nodeTypeLabels.synthesis"),
+ overview: t("graph.nodeTypeLabels.overview"),
+ comparison: t("graph.nodeTypeLabels.comparison"),
+ other: t("graph.nodeTypeLabels.other"),
+ })
+ }, [t])
+
useEffect(() => {
if (dataVersion !== lastLoadedVersion.current) {
loadGraph()
@@ -523,7 +531,7 @@ export function GraphView() {
return (
<div className="flex h-full flex-col items-center justify-center gap-3 text-muted-foreground">
<Network className="h-10 w-10 opacity-30" />
- <p className="text-sm">Open a project to view the graph</p>
+ <p className="text-sm">{t("graph.openProject")}</p>
</div>
)
}
@@ -532,7 +540,7 @@ export function GraphView() {
return (
<div className="flex h-full flex-col items-center justify-center gap-3 text-muted-foreground">
<RefreshCw className="h-8 w-8 animate-spin opacity-50" />
- <p className="text-sm">Building graph...</p>
+ <p className="text-sm">{t("graph.buildingGraph")}</p>
</div>
)
}
@@ -542,7 +550,7 @@ export function GraphView() {
<div className="flex h-full flex-col items-center justify-center gap-3 text-muted-foreground">
<Network className="h-10 w-10 opacity-30" />
<p className="text-sm text-destructive">{error}</p>
- <Button variant="outline" size="sm" onClick={loadGraph}>Retry</Button>
+ <Button variant="outline" size="sm" onClick={loadGraph}>{t("graph.retry")}</Button>
</div>
)
}
@@ -551,8 +559,8 @@ export function GraphView() {
return (
<div className="flex h-full flex-col items-center justify-center gap-3 text-muted-foreground">
<Network className="h-10 w-10 opacity-30" />
- <p className="text-sm">No pages yet</p>
- <p className="text-xs">Import sources to start building the knowledge graph</p>
+ <p className="text-sm">{t("graph.noPages")}</p>
+ <p className="text-xs">{t("graph.importSourcesHint")}</p>
</div>
)
}
@@ -564,14 +572,14 @@ export function GraphView() {
<div className="flex items-center gap-3">
<div className="flex items-center gap-2">
<Network className="h-4 w-4 text-muted-foreground" />
- <span className="text-sm font-medium">Knowledge Graph</span>
+ <span className="text-sm font-medium">{t("graph.knowledgeGraph")}</span>
</div>
<div className="flex items-center gap-1.5 text-xs text-muted-foreground">
- <span className="rounded bg-muted px-1.5 py-0.5">{filteredGraph.nodes.length}/{nodes.length} pages</span>
- <span className="rounded bg-muted px-1.5 py-0.5">{filteredGraph.edges.length}/{edges.length} links</span>
+ <span className="rounded bg-muted px-1.5 py-0.5">{filteredGraph.nodes.length}/{nodes.length} {t("graph.pages", { count: nodes.length })}</span>
+ <span className="rounded bg-muted px-1.5 py-0.5">{filteredGraph.edges.length}/{edges.length} {t("graph.links", { count: edges.length })}</span>
{hiddenCount > 0 && (
<span className="rounded bg-amber-500/10 px-1.5 py-0.5 text-amber-700 dark:text-amber-300">
- {hiddenCount} hidden
+ {hiddenCount} {t("graph.hidden")}
</span>
)}
</div>
@@ -584,7 +592,7 @@ export function GraphView() {
className="text-xs gap-1 h-7"
>
<Filter className="h-3 w-3" />
- Filter
+ {t("graph.filter")}
</Button>
{filtersActive && (
<Button
@@ -595,7 +603,7 @@ export function GraphView() {
title="Reset graph filters"
>
<RotateCcw className="h-3 w-3" />
- Reset
+ {t("graph.reset")}
</Button>
)}
<Button
@@ -605,7 +613,7 @@ export function GraphView() {
className="text-xs gap-1 h-7"
>
<Tag className="h-3 w-3" />
- Type
+ {t("graph.type")}
</Button>
<Button
variant={colorMode === "community" ? "secondary" : "ghost"}
@@ -614,7 +622,7 @@ export function GraphView() {
className="text-xs gap-1 h-7"
>
<Layers className="h-3 w-3" />
- Community
+ {t("graph.community")}
</Button>
{(surprisingConns.filter((c) => !dismissedInsights.has(c.key)).length > 0 || knowledgeGaps.length > 0) && (
<Button
@@ -629,7 +637,7 @@ export function GraphView() {
className="text-xs gap-1 h-7"
>
<Lightbulb className="h-3 w-3" />
- Insights
+ {t("graph.insights")}
<span className="rounded bg-muted px-1 text-[10px]">
{surprisingConns.filter((c) => !dismissedInsights.has(c.key)).length + knowledgeGaps.length}
</span>
@@ -652,7 +660,7 @@ export function GraphView() {
>
{isResizing ? (
<div className="flex h-full items-center justify-center text-xs text-muted-foreground">
- Resizing...
+ {t("graph.resizing")}
</div>
) : (
<ErrorBoundary>
@@ -718,7 +726,7 @@ export function GraphView() {
<div className="mb-3 flex items-center justify-between">
<div className="flex items-center gap-1.5 font-semibold text-foreground">
<Filter className="h-3.5 w-3.5" />
- Graph Filters
+ {t("graph.graphFilters")}
</div>
<Button
variant="ghost"
@@ -726,20 +734,20 @@ export function GraphView() {
className="h-6 px-1.5 text-[10px]"
onClick={resetFilters}
>
- Reset
+ {t("graph.reset")}
</Button>
</div>
<div className="space-y-3">
<div className="space-y-1.5">
- <div className="font-medium text-muted-foreground">Quick filters</div>
+ <div className="font-medium text-muted-foreground">{t("graph.quickFilters")}</div>
<label className="flex items-center gap-2">
<input
type="checkbox"
checked={filters.hideStructural}
onChange={(e) => setFilters((prev) => ({ ...prev, hideStructural: e.target.checked }))}
/>
- <span>Hide index / overview / log</span>
+ <span>{t("graph.hideIndexOverview")}</span>
</label>
<label className="flex items-center gap-2">
<input
@@ -747,12 +755,12 @@ export function GraphView() {
checked={filters.hideIsolated}
onChange={(e) => setFilters((prev) => ({ ...prev, hideIsolated: e.target.checked }))}
/>
- <span>Hide isolated nodes</span>
+ <span>{t("graph.hideIsolated")}</span>
</label>
</div>
<div className="space-y-1.5">
- <div className="font-medium text-muted-foreground">Max links</div>
+ <div className="font-medium text-muted-foreground">{t("graph.maxLinks")}</div>
<div className="flex items-center gap-2">
<input
type="number"
@@ -769,14 +777,14 @@ export function GraphView() {
}}
placeholder="Any"
/>
- <span className="text-muted-foreground">Hide nodes above this link count</span>
+ <span className="text-muted-foreground">{t("graph.maxLinksHint")}</span>
</div>
</div>
<div className="space-y-1.5">
- <div className="font-medium text-muted-foreground">Node types</div>
+ <div className="font-medium text-muted-foreground">{t("graph.nodeTypes")}</div>
<div className="grid grid-cols-2 gap-1">
- {Object.entries(NODE_TYPE_LABELS)
+ {Object.entries(nodeTypeLabels)
.filter(([type]) => (typeCounts[type] ?? 0) > 0)
.map(([type, label]) => (
<label key={type} className="flex min-w-0 items-center gap-1.5">
@@ -801,7 +809,7 @@ export function GraphView() {
{filters.hiddenNodeIds.size > 0 && (
<div className="space-y-1.5">
- <div className="font-medium text-muted-foreground">Hidden nodes</div>
+ <div className="font-medium text-muted-foreground">{t("graph.hiddenNodes")}</div>
<div className="max-h-24 space-y-1 overflow-y-auto">
{[...filters.hiddenNodeIds].map((nodeId) => {
const node = nodes.find((n) => n.id === nodeId)
@@ -817,7 +825,7 @@ export function GraphView() {
return { ...prev, hiddenNodeIds: next }
})}
>
- Show
+ {t("graph.show")}
</button>
</div>
)
@@ -827,7 +835,7 @@ export function GraphView() {
)}
<div className="rounded bg-muted/50 px-2 py-1.5 text-muted-foreground">
- Showing {filteredGraph.nodes.length} of {nodes.length} pages and {filteredGraph.edges.length} of {edges.length} links.
+ {t("graph.showingStats", { pages: filteredGraph.nodes.length, total: nodes.length, links: filteredGraph.edges.length, totalLinks: edges.length })}
</div>
</div>
</div>
@@ -855,7 +863,7 @@ export function GraphView() {
}}
>
<EyeOff className="h-3.5 w-3.5" />
- Hide this node
+ {t("graph.hideThisNode")}
</button>
</div>
)}
@@ -864,7 +872,7 @@ export function GraphView() {
<div className="absolute bottom-3 left-3 rounded-lg border bg-background/90 backdrop-blur-sm px-3 py-2 text-xs shadow-sm max-w-[260px]">
<div className="flex items-center justify-between mb-1.5">
<span className="font-semibold text-foreground">
- {colorMode === "type" ? "Node Types" : "Communities"}
+ {colorMode === "type" ? t("graph.nodeTypesLabel") : t("graph.communitiesLabel")}
</span>
<div className="flex items-center gap-1">
{colorMode === "type" && filters.hiddenTypes.size > 0 && (
@@ -875,7 +883,7 @@ export function GraphView() {
onClick={() => setFilters((prev) => ({ ...prev, hiddenTypes: new Set() }))}
title="Show all types"
>
- Show all
+ {t("graph.showAll")}
</Button>
)}
<Button
@@ -893,7 +901,7 @@ export function GraphView() {
colorMode === "type" ? (
<div className="flex flex-col gap-0.5 max-h-48 overflow-y-auto legend-scroll" style={{ direction: "rtl" }}>
<div className="flex flex-col gap-0.5" style={{ direction: "ltr" }}>
- {Object.entries(NODE_TYPE_LABELS)
+ {Object.entries(nodeTypeLabels)
.filter(([type]) => (typeCounts[type] ?? 0) > 0)
.map(([type, label]) => {
const isHidden = filters.hiddenTypes.has(type)
@@ -927,7 +935,7 @@ export function GraphView() {
{label}
</span>
<span className="text-muted-foreground/60 ml-auto">{typeCounts[type]}</span>
- {isHidden && <span className="text-muted-foreground/60 text-[10px]">hidden</span>}
+ {isHidden && <span className="text-muted-foreground/60 text-[10px]">{t("graph.hidden")}</span>}
</div>
)
})}
@@ -949,7 +957,7 @@ export function GraphView() {
}}
/>
<span className="text-muted-foreground truncate" title={c.topNodes.join(", ")}>
- {c.topNodes[0] ?? `Cluster ${c.id}`}
+ {c.topNodes[0] ?? `${t("graph.cluster", { id: c.id })}`}
</span>
<span className="text-muted-foreground/60 ml-auto shrink-0">{c.nodeCount}</span>
{c.cohesion < 0.15 && c.nodeCount >= 3 && (
@@ -971,7 +979,7 @@ export function GraphView() {
<div className="flex items-center justify-between">
<div className="flex items-center gap-2">
<Lightbulb className="h-4 w-4 text-amber-500" />
- <span className="text-sm font-medium">Insights</span>
+ <span className="text-sm font-medium">{t("graph.insights")}</span>
</div>
<button
className="p-1 rounded hover:bg-muted text-muted-foreground"
@@ -991,7 +999,7 @@ export function GraphView() {
<div>
<div className="flex items-center gap-1.5 mb-2 text-xs font-semibold text-foreground">
<Link2 className="h-3.5 w-3.5 text-blue-500" />
- Surprising Connections
+ {t("graph.surprisingConnections")}
</div>
<div className="flex flex-col gap-2">
{surprisingConns
@@ -1036,7 +1044,7 @@ export function GraphView() {
<div>
<div className="flex items-center gap-1.5 mb-2 text-xs font-semibold text-foreground">
<AlertTriangle className="h-3.5 w-3.5 text-amber-500" />
- Knowledge Gaps
+ {t("graph.knowledgeGaps")}
</div>
<div className="flex flex-col gap-2">
{knowledgeGaps.map((gap, i) => {
@@ -1063,7 +1071,7 @@ export function GraphView() {
}}
>
<Search className="h-3.5 w-3.5" />
- Deep Research
+ {t("graph.deepResearch")}
</Button>
</div>
)
@@ -1083,7 +1091,7 @@ export function GraphView() {
<div className="flex items-center justify-between border-b px-4 py-3">
<div className="flex items-center gap-2">
<Search className="h-4 w-4 text-primary" />
- <span className="font-medium text-sm">Deep Research</span>
+ <span className="font-medium text-sm">{t("graph.deepResearch")}</span>
</div>
{!researchDialog.loading && (
<button
@@ -1098,12 +1106,12 @@ export function GraphView() {
{researchDialog.loading ? (
<div className="flex items-center justify-center gap-2 py-12 text-sm text-muted-foreground">
<Loader2 className="h-4 w-4 animate-spin" />
- Generating research topic...
+ {t("graph.generatingTopic")}
</div>
) : (
<div className="p-4">
<div className="mb-3">
- <label className="text-xs font-medium text-muted-foreground mb-1 block">Research Topic</label>
+ <label className="text-xs font-medium text-muted-foreground mb-1 block">{t("graph.researchTopic")}</label>
<input
type="text"
className="w-full rounded-md border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring"
@@ -1116,7 +1124,7 @@ export function GraphView() {
/>
</div>
<div className="mb-4">
- <label className="text-xs font-medium text-muted-foreground mb-1 block">Search Queries</label>
+ <label className="text-xs font-medium text-muted-foreground mb-1 block">{t("graph.searchQueries")}</label>
<div className="flex flex-col gap-1.5">
{researchDialog.queries.map((q, idx) => (
<input
@@ -1138,7 +1146,7 @@ export function GraphView() {
</div>
<div className="flex justify-end gap-2">
<Button variant="outline" size="sm" onClick={() => setResearchDialog(null)}>
- Cancel
+ {t("graph.cancel")}
</Button>
<Button
variant="default"
@@ -1147,7 +1155,7 @@ export function GraphView() {
onClick={handleResearchConfirm}
>
<Search className="h-3.5 w-3.5" />
- Start Research
+ {t("graph.startResearch")}
</Button>
</div>
</div>
diff --git a/src/components/layout/sidebar-panel.tsx b/src/components/layout/sidebar-panel.tsx
index 8eaebf96..5cffb260 100644
--- a/src/components/layout/sidebar-panel.tsx
+++ b/src/components/layout/sidebar-panel.tsx
@@ -1,8 +1,10 @@
import { useState } from "react"
+import { useTranslation } from "react-i18next"
import { KnowledgeTree } from "./knowledge-tree"
import { FileTree } from "./file-tree"
export function SidebarPanel() {
+ const { t } = useTranslation()
const [mode, setMode] = useState<"knowledge" | "files">("knowledge")
return (
@@ -16,7 +18,7 @@ export function SidebarPanel() {
: "text-muted-foreground hover:text-foreground"
}`}
>
- Knowledge
+ {t("sidebar.knowledge")}
</button>
<button
onClick={() => setMode("files")}
@@ -26,7 +28,7 @@ export function SidebarPanel() {
: "text-muted-foreground hover:text-foreground"
}`}
>
- Files
+ {t("sidebar.files")}
</button>
</div>
<div className="flex-1 overflow-hidden">
diff --git a/src/components/lint/lint-view.tsx b/src/components/lint/lint-view.tsx
index cac42681..205e8779 100644
--- a/src/components/lint/lint-view.tsx
+++ b/src/components/lint/lint-view.tsx
@@ -1,4 +1,4 @@
-import { useState, useCallback } from "react"
+import { useState, useCallback, useMemo } from "react"
import {
Link2Off,
Unlink,
@@ -18,15 +18,10 @@ import { runStructuralLint, runSemanticLint, type LintResult } from "@/lib/lint"
import { hasUsableLlm } from "@/lib/has-usable-llm"
import { readFile, writeFile, listDirectory } from "@/commands/fs"
import { normalizePath } from "@/lib/path-utils"
-
-const typeConfig: Record<string, { icon: typeof AlertTriangle; label: string }> = {
- orphan: { icon: Unlink, label: "Orphan Page" },
- "broken-link": { icon: Link2Off, label: "Broken Link" },
- "no-outlinks": { icon: ArrowUpRight, label: "No Outbound Links" },
- semantic: { icon: BrainCircuit, label: "Semantic Issue" },
-}
+import { useTranslation } from "react-i18next"
export function LintView() {
+ const { t } = useTranslation()
const project = useWikiStore((s) => s.project)
const llmConfig = useWikiStore((s) => s.llmConfig)
const setSelectedFile = useWikiStore((s) => s.setSelectedFile)
@@ -35,6 +30,14 @@ export function LintView() {
const setFileTree = useWikiStore((s) => s.setFileTree)
const bumpDataVersion = useWikiStore((s) => s.bumpDataVersion)
+ // Dynamic type config based on i18n
+ const typeConfig = useMemo(() => ({
+ orphan: { icon: Unlink, label: t("lint.typeLabels.orphan") },
+ "broken-link": { icon: Link2Off, label: t("lint.typeLabels.broken-link") },
+ "no-outlinks": { icon: ArrowUpRight, label: t("lint.typeLabels.no-outlinks") },
+ semantic: { icon: BrainCircuit, label: t("lint.typeLabels.semantic") },
+ }), [t])
+
const [results, setResults] = useState<LintResult[]>([])
const [running, setRunning] = useState(false)
const [hasRun, setHasRun] = useState(false)
@@ -116,13 +119,13 @@ export function LintView() {
const pagePath = `${pp}/wiki/${result.page}`
useReviewStore.getState().addItem({
type: "confirm",
- title: `Fix broken link in ${result.page}`,
+ title: t("lint.fixBrokenLink", { page: result.page }),
description: result.detail,
affectedPages: [result.page],
options: [
- { label: "Open & Edit", action: `open:${result.page}` },
- { label: "Delete Page", action: `delete:${pagePath}` },
- { label: "Skip", action: "Skip" },
+ { label: t("lint.openEdit"), action: `open:${result.page}` },
+ { label: t("lint.deletePage"), action: `delete:${pagePath}` },
+ { label: t("lint.skip"), action: "Skip" },
],
})
setResults((prev) => prev.filter((_, i) => i !== index))
@@ -133,12 +136,12 @@ export function LintView() {
// Send to Review — user should add links manually
useReviewStore.getState().addItem({
type: "suggestion",
- title: `Add cross-references to ${result.page}`,
- description: "This page has no outbound [[wikilinks]]. Consider adding cross-references to related entities and concepts.",
+ title: t("lint.addCrossRefs", { page: result.page }),
+ description: t("lint.addCrossRefsDescription"),
affectedPages: [result.page],
options: [
- { label: "Open & Edit", action: `open:${result.page}` },
- { label: "Skip", action: "Skip" },
+ { label: t("lint.openEdit"), action: `open:${result.page}` },
+ { label: t("lint.skip"), action: "Skip" },
],
})
setResults((prev) => prev.filter((_, i) => i !== index))
@@ -153,8 +156,8 @@ export function LintView() {
description: result.detail,
affectedPages: result.affectedPages ?? [result.page],
options: [
- { label: "Open & Edit", action: `open:${result.page}` },
- { label: "Skip", action: "Skip" },
+ { label: t("lint.openEdit"), action: `open:${result.page}` },
+ { label: t("lint.skip"), action: "Skip" },
],
})
setResults((prev) => prev.filter((_, i) => i !== index))
@@ -177,7 +180,7 @@ export function LintView() {
if (!project) return
const pp = normalizePath(project.path)
const pagePath = `${pp}/wiki/${result.page}`
- const confirmed = window.confirm(`Delete orphan page "${result.page}"?`)
+ const confirmed = window.confirm(t("lint.deleteOrphanConfirm", { page: result.page }))
if (!confirmed) return
try {
@@ -207,10 +210,10 @@ export function LintView() {
<div className="flex h-full flex-col">
<div className="shrink-0 flex items-center justify-between border-b px-4 py-3">
<div className="flex items-center gap-2">
- <h2 className="text-sm font-semibold">Wiki Lint</h2>
+ <h2 className="text-sm font-semibold">{t("lint.title")}</h2>
{hasRun && results.length > 0 && (
<span className="rounded-full bg-amber-500/20 px-2 py-0.5 text-xs font-medium text-amber-600 dark:text-amber-400">
- {results.length} issue{results.length !== 1 ? "s" : ""}
+ {results.length === 1 ? t("lint.issues", { count: results.length }) : t("lint.issues_plural", { count: results.length })}
</span>
)}
</div>
@@ -222,7 +225,7 @@ export function LintView() {
checked={runSemantic}
onChange={(e) => setRunSemantic(e.target.checked)}
/>
- Semantic (LLM)
+ {t("lint.semantic")}
</label>
<Button
size="sm"
@@ -230,7 +233,7 @@ export function LintView() {
disabled={running || !project}
>
<RefreshCw className={`mr-1.5 h-3.5 w-3.5 ${running ? "animate-spin" : ""}`} />
- {running ? "Running..." : "Run Lint"}
+ {running ? t("lint.running") : t("lint.runLint")}
</Button>
</div>
</div>
@@ -239,19 +242,19 @@ export function LintView() {
{!hasRun ? (
<div className="flex flex-col items-center justify-center gap-2 p-8 text-center text-sm text-muted-foreground">
<CheckCircle2 className="h-8 w-8 text-muted-foreground/30" />
- <p>Run lint to check wiki health</p>
- <p className="text-xs">Checks for orphan pages, broken links, and more</p>
+ <p>{t("lint.runLintHint")}</p>
+ <p className="text-xs">{t("lint.runLintDescription")}</p>
</div>
) : results.length === 0 ? (
<div className="flex flex-col items-center justify-center gap-2 p-8 text-center text-sm text-muted-foreground">
<CheckCircle2 className="h-8 w-8 text-emerald-500/60" />
- <p className="text-emerald-600 dark:text-emerald-400 font-medium">All clear!</p>
- <p className="text-xs">No issues found.</p>
+ <p className="text-emerald-600 dark:text-emerald-400 font-medium">{t("lint.allClear")}</p>
+ <p className="text-xs">{t("lint.noIssues")}</p>
</div>
) : (
<div className="flex flex-col gap-2 p-3">
{warnings.length > 0 && (
- <SectionHeader icon={AlertTriangle} label="Warnings" count={warnings.length} color="text-amber-500" />
+ <SectionHeader icon={AlertTriangle} label={t("lint.warnings")} count={warnings.length} color="text-amber-500" t={t} />
)}
{warnings.map((result, i) => (
<LintCard
@@ -262,10 +265,12 @@ export function LintView() {
onOpenPage={handleOpenPage}
onFix={handleFix}
onDelete={result.type === "orphan" ? handleDeleteOrphan : undefined}
+ typeConfig={typeConfig}
+ t={t}
/>
))}
{infos.length > 0 && (
- <SectionHeader icon={Info} label="Info" count={infos.length} color="text-blue-500" />
+ <SectionHeader icon={Info} label={t("lint.info")} count={infos.length} color="text-blue-500" t={t} />
)}
{infos.map((result, i) => {
const realIndex = warnings.length + i
@@ -278,6 +283,8 @@ export function LintView() {
onOpenPage={handleOpenPage}
onFix={handleFix}
onDelete={result.type === "orphan" ? handleDeleteOrphan : undefined}
+ typeConfig={typeConfig}
+ t={t}
/>
)
})}
@@ -293,16 +300,18 @@ function SectionHeader({
label,
count,
color,
+ t,
}: {
icon: typeof AlertTriangle
label: string
count: number
color: string
+ t: (key: string, opts?: Record<string, unknown>) => string
}) {
return (
<div className={`flex items-center gap-1.5 px-1 py-1 text-xs font-semibold ${color}`}>
<Icon className="h-3.5 w-3.5" />
- {label} ({count})
+ {t("lint.sectionCount", { label, count })}
</div>
)
}
@@ -314,6 +323,8 @@ function LintCard({
onOpenPage,
onFix,
onDelete,
+ typeConfig,
+ t,
}: {
result: LintResult
index: number
@@ -321,6 +332,8 @@ function LintCard({
onOpenPage: (page: string) => void
onFix: (result: LintResult, index: number) => void
onDelete?: (result: LintResult, index: number) => void
+ typeConfig: Record<string, { icon: typeof AlertTriangle; label: string }>
+ t: (key: string, opts?: Record<string, unknown>) => string
}) {
const config = typeConfig[result.type] ?? typeConfig.semantic
const Icon = config.icon
@@ -363,7 +376,7 @@ function LintCard({
className="h-6 text-xs gap-1"
onClick={() => onOpenPage(result.page)}
>
- Open
+ {t("lint.open")}
</Button>
<Button
variant="outline"
@@ -373,7 +386,7 @@ function LintCard({
onClick={() => onFix(result, index)}
>
<Wrench className="h-3 w-3" />
- {fixing ? "Fixing..." : "Fix"}
+ {fixing ? t("lint.fixing") : t("lint.fix")}
</Button>
{onDelete && (
<Button
@@ -383,7 +396,7 @@ function LintCard({
onClick={() => onDelete(result, index)}
>
<Trash2 className="h-3 w-3" />
- Delete
+ {t("lint.delete")}
</Button>
)}
</div>
diff --git a/src/components/project/create-project-dialog.tsx b/src/components/project/create-project-dialog.tsx
index 85859489..b8c3e5d2 100644
--- a/src/components/project/create-project-dialog.tsx
+++ b/src/components/project/create-project-dialog.tsx
@@ -1,4 +1,5 @@
import { useState } from "react"
+import { useTranslation } from "react-i18next"
import { open } from "@tauri-apps/plugin-dialog"
import {
Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter,
@@ -23,6 +24,7 @@ interface CreateProjectDialogProps {
}
export function CreateProjectDialog({ open: isOpen, onOpenChange, onCreated }: CreateProjectDialogProps) {
+ const { t } = useTranslation()
const [name, setName] = useState("")
const [path, setPath] = useState("")
const [selectedTemplate, setSelectedTemplate] = useState("general")
@@ -40,7 +42,7 @@ export function CreateProjectDialog({ open: isOpen, onOpenChange, onCreated }: C
const selected = await open({
directory: true,
multiple: false,
- title: "Select Parent Directory",
+ title: t("project.browse"),
})
if (selected) {
setPath(selected)
@@ -49,11 +51,11 @@ export function CreateProjectDialog({ open: isOpen, onOpenChange, onCreated }: C
async function handleCreate() {
if (!name.trim() || !path.trim()) {
- setError("Name and path are required")
+ setError(t("project.errorNameRequired"))
return
}
if (!language) {
- setError("Please pick an AI output language")
+ setError(t("project.errorLanguageRequired"))
return
}
setCreating(true)
@@ -94,20 +96,20 @@ export function CreateProjectDialog({ open: isOpen, onOpenChange, onCreated }: C
<Dialog open={isOpen} onOpenChange={onOpenChange}>
<DialogContent className="max-w-lg">
<DialogHeader>
- <DialogTitle>Create New Wiki Project</DialogTitle>
+ <DialogTitle>{t("project.createTitle")}</DialogTitle>
</DialogHeader>
<div className="flex flex-col gap-4 py-4">
<div className="flex flex-col gap-2">
- <Label htmlFor="name">Project Name</Label>
- <Input id="name" value={name} onChange={(e) => setName(e.target.value)} placeholder="my-research-wiki" />
+ <Label htmlFor="name">{t("project.name")}</Label>
+ <Input id="name" value={name} onChange={(e) => setName(e.target.value)} placeholder={t("project.namePlaceholder")} />
</div>
<div className="flex flex-col gap-2">
- <Label>Template</Label>
+ <Label>{t("project.template")}</Label>
<TemplatePicker selected={selectedTemplate} onSelect={setSelectedTemplate} />
</div>
<div className="flex flex-col gap-2">
<Label htmlFor="language">
- AI Output Language <span className="text-destructive">*</span>
+ {t("project.aiOutputLanguage")} <span className="text-destructive">{t("project.aiOutputLanguageRequired")}</span>
</Label>
<select
id="language"
@@ -116,7 +118,7 @@ export function CreateProjectDialog({ open: isOpen, onOpenChange, onCreated }: C
className="w-full rounded-md border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring"
>
<option value="" disabled>
- Pick a language…
+ {t("project.pickLanguage")}
</option>
{/*
* "auto" is intentionally filtered out at project
@@ -135,15 +137,13 @@ export function CreateProjectDialog({ open: isOpen, onOpenChange, onCreated }: C
))}
</select>
<p className="text-xs text-muted-foreground">
- All AI-generated content (wiki pages, chat replies, research
- output) will use this language. You can change it later in
- Settings → Output.
+ {t("project.aiOutputLanguageHint")}
</p>
</div>
<div className="flex flex-col gap-2">
- <Label htmlFor="path">Parent Directory</Label>
+ <Label htmlFor="path">{t("project.parentDir")}</Label>
<div className="flex gap-2">
- <Input id="path" value={path} onChange={(e) => setPath(e.target.value)} placeholder="/Users/you/projects" className="flex-1" />
+ <Input id="path" value={path} onChange={(e) => setPath(e.target.value)} placeholder={t("project.parentDirPlaceholder")} className="flex-1" />
<Button variant="outline" size="icon" onClick={handleBrowse} type="button">
<FolderOpen className="h-4 w-4" />
</Button>
@@ -152,8 +152,8 @@ export function CreateProjectDialog({ open: isOpen, onOpenChange, onCreated }: C
{error && <p className="text-sm text-destructive">{error}</p>}
</div>
<DialogFooter>
- <Button variant="outline" onClick={() => onOpenChange(false)}>Cancel</Button>
- <Button onClick={handleCreate} disabled={creating}>{creating ? "Creating..." : "Create"}</Button>
+ <Button variant="outline" onClick={() => onOpenChange(false)}>{t("project.cancel")}</Button>
+ <Button onClick={handleCreate} disabled={creating}>{creating ? t("project.creating") : t("project.create")}</Button>
</DialogFooter>
</DialogContent>
</Dialog>
diff --git a/src/components/sources/sources-view.tsx b/src/components/sources/sources-view.tsx
index f9b87a7c..5bc44a01 100644
--- a/src/components/sources/sources-view.tsx
+++ b/src/components/sources/sources-view.tsx
@@ -76,7 +76,7 @@ export function SourcesView() {
const selected = await open({
multiple: true,
- title: "Import Source Files",
+ title: t("sources.importSourceFiles"),
filters: [
{
name: "Documents",
@@ -127,7 +127,7 @@ export function SourcesView() {
const selected = await open({
directory: true,
- title: "Import Source Folder",
+ title: t("sources.importSourceFolder"),
})
if (!selected || typeof selected !== "string") return
@@ -239,7 +239,7 @@ export function SourcesView() {
<div className="flex items-center justify-between border-b px-4 py-3">
<h2 className="text-sm font-semibold">{t("sources.title")}</h2>
<div className="flex gap-1">
- <Button variant="ghost" size="icon" onClick={loadSources} title="Refresh">
+ <Button variant="ghost" size="icon" onClick={loadSources} title={t("sources.refresh")}>
<RefreshCw className="h-4 w-4" />
</Button>
<Button size="sm" onClick={handleImport} disabled={importing}>
@@ -265,7 +265,7 @@ export function SourcesView() {
</Button>
<Button variant="outline" size="sm" onClick={handleImportFolder}>
<Plus className="mr-1 h-4 w-4" />
- Folder
+ {t("sources.importFolder")}
</Button>
</div>
</div>
@@ -367,6 +367,7 @@ function SourceTree({
setPendingDeletePath: (path: string | null) => void
ingestingPath: string | null
}) {
+ const { t } = useTranslation()
const [collapsed, setCollapsed] = useState<Record<string, boolean>>({})
const [visibleLimit, setVisibleLimit] = useState(SOURCE_TREE_INITIAL_ROWS)
const loadMoreRef = useRef<HTMLDivElement | null>(null)
@@ -451,8 +452,8 @@ function SourceTree({
onClick={() => handleDeleteClick(node)}
hint={
isPendingDelete
- ? `Click again to delete folder ${node.name} and ALL its contents`
- : `Delete folder ${node.name} (recursive)`
+ ? t("sources.deleteFolderConfirm", { name: node.name })
+ : t("sources.deleteFolder", { name: node.name })
}
/>
</div>
@@ -477,7 +478,7 @@ function SourceTree({
variant="ghost"
size="icon"
className="h-7 w-7 shrink-0"
- title="Ingest"
+ title={t("sources.ingest")}
disabled={ingestingPath === node.path}
onClick={() => onIngest(node)}
>
@@ -488,8 +489,8 @@ function SourceTree({
onClick={() => handleDeleteClick(node)}
hint={
isPendingDelete
- ? `Click again to delete ${node.name}`
- : `Delete ${node.name}`
+ ? t("sources.deleteFileConfirm", { name: node.name })
+ : t("sources.deleteFile", { name: node.name })
}
/>
</div>
@@ -500,7 +501,7 @@ function SourceTree({
ref={loadMoreRef}
className="px-3 py-2 text-center text-[11px] text-muted-foreground"
>
- Loading more sources...
+ {t("sources.loadingMore")}
</div>
)}
</>
@@ -526,6 +527,7 @@ function DeleteButton({
onClick: () => void
hint: string
}) {
+ const { t } = useTranslation()
if (isPending) {
return (
<Button
@@ -536,7 +538,7 @@ function DeleteButton({
onClick={onClick}
>
<Trash2 className="mr-1 h-3.5 w-3.5" />
- Confirm
+ {t("sources.confirm")}
</Button>
)
}
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 3d13c3cc..8deeaa8b 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -25,15 +25,49 @@
"openProject": "Open Project",
"recentProjects": "Recent Projects"
},
+ "sidebar": {
+ "knowledge": "Knowledge",
+ "files": "Files"
+ },
"project": {
"createTitle": "Create New Wiki Project",
"name": "Project Name",
"namePlaceholder": "my-research-wiki",
"parentDir": "Parent Directory",
+ "parentDirPlaceholder": "/Users/you/projects",
"template": "Template",
"cancel": "Cancel",
"create": "Create",
- "creating": "Creating..."
+ "creating": "Creating...",
+ "errorNameRequired": "Name and path are required",
+ "errorLanguageRequired": "Please pick an AI output language",
+ "browse": "Select Parent Directory",
+ "aiOutputLanguage": "AI Output Language",
+ "aiOutputLanguageRequired": "*",
+ "aiOutputLanguageHint": "All AI-generated content (wiki pages, chat replies, research output) will use this language. You can change it later in Settings → Output.",
+ "pickLanguage": "Pick a language…"
+ },
+ "templates": {
+ "research": {
+ "name": "Research",
+ "description": "Deep-dive research with hypothesis tracking and methodology notes"
+ },
+ "reading": {
+ "name": "Reading",
+ "description": "Track a book's characters, themes, plot threads, and chapter notes"
+ },
+ "personal": {
+ "name": "Personal Growth",
+ "description": "Track goals, habits, reflections, and journal entries for self-improvement"
+ },
+ "business": {
+ "name": "Business",
+ "description": "Manage meetings, decisions, projects, and stakeholder context for a team"
+ },
+ "general": {
+ "name": "General",
+ "description": "Minimal setup — a blank slate for any purpose"
+ }
},
"sources": {
"title": "Raw Sources",
@@ -42,9 +76,19 @@
"noSources": "No sources yet",
"importHint": "Import documents to start building your wiki",
"importFiles": "Import Files",
+ "importFolder": "Folder",
+ "importSourceFiles": "Import Source Files",
+ "importSourceFolder": "Import Source Folder",
+ "refresh": "Refresh",
"ingest": "Ingest",
"delete": "Delete source and related wiki pages",
"deleteConfirm": "Delete \"{{name}}\" and its related wiki pages?\n\nThis will:\n- Delete the source file\n- Delete wiki pages generated from this source\n- Update index.md",
+ "deleteFolder": "Delete folder {{name}} (recursive)",
+ "deleteFolderConfirm": "Click again to delete folder {{name}} and ALL its contents",
+ "deleteFile": "Delete {{name}}",
+ "deleteFileConfirm": "Click again to delete {{name}}",
+ "confirm": "Confirm",
+ "loadingMore": "Loading more sources...",
"sourceCount": "{{count}} source",
"sourceCount_plural": "{{count}} sources"
},
@@ -56,7 +100,14 @@
"saved": "Saved!",
"writeToWiki": "Write to Wiki",
"emptyHint": "Ask a question or start an ingest to begin.",
- "sources": "Sources"
+ "sources": "Sources",
+ "newChat": "New Chat",
+ "newConversation": "New Conversation",
+ "noConversationsYet": "No conversations yet",
+ "msgCount": "msgs",
+ "startNewConversation": "Start a new conversation",
+ "clickNewChatToBegin": "Click \"New Chat\" to begin",
+ "typeAMessage": "Type a message..."
},
"search": {
"title": "Search",
@@ -78,6 +129,38 @@
"missingPage": "Missing Page",
"suggestion": "Suggestion"
},
+ "lint": {
+ "title": "Wiki Lint",
+ "semantic": "Semantic (LLM)",
+ "running": "Running...",
+ "runLint": "Run Lint",
+ "runLintHint": "Run lint to check wiki health",
+ "runLintDescription": "Checks for orphan pages, broken links, and more",
+ "allClear": "All clear!",
+ "noIssues": "No issues found.",
+ "warnings": "Warnings",
+ "info": "Info",
+ "sectionCount": "{{label}} ({{count}})",
+ "open": "Open",
+ "fixing": "Fixing...",
+ "fix": "Fix",
+ "delete": "Delete",
+ "openEdit": "Open & Edit",
+ "skip": "Skip",
+ "deletePage": "Delete Page",
+ "fixBrokenLink": "Fix broken link in {{page}}",
+ "addCrossRefs": "Add cross-references to {{page}}",
+ "addCrossRefsDescription": "This page has no outbound [[wikilinks]]. Consider adding cross-references to related entities and concepts.",
+ "deleteOrphanConfirm": "Delete orphan page \"{{page}}\"?",
+ "typeLabels": {
+ "orphan": "Orphan Page",
+ "broken-link": "Broken Link",
+ "no-outlinks": "No Outbound Links",
+ "semantic": "Semantic Issue"
+ },
+ "issues": "{{count}} issue",
+ "issues_plural": "{{count}} issues"
+ },
"review": {
"title": "Review",
"clearResolved": "Clear resolved",
@@ -275,6 +358,56 @@
"fileTree": {
"noProject": "No project open"
},
+ "graph": {
+ "openProject": "Open a project to view the graph",
+ "buildingGraph": "Building graph...",
+ "retry": "Retry",
+ "noPages": "No pages yet",
+ "importSourcesHint": "Import sources to start building the knowledge graph",
+ "knowledgeGraph": "Knowledge Graph",
+ "hidden": "hidden",
+ "pages": "pages",
+ "links": "links",
+ "filter": "Filter",
+ "reset": "Reset",
+ "type": "Type",
+ "community": "Community",
+ "insights": "Insights",
+ "resizing": "Resizing...",
+ "graphFilters": "Graph Filters",
+ "quickFilters": "Quick filters",
+ "hideIndexOverview": "Hide index / overview / log",
+ "hideIsolated": "Hide isolated nodes",
+ "maxLinks": "Max links",
+ "maxLinksHint": "Hide nodes above this link count",
+ "nodeTypes": "Node types",
+ "hiddenNodes": "Hidden nodes",
+ "show": "Show",
+ "showingStats": "Showing {{pages}} of {{total}} pages and {{links}} of {{totalLinks}} links.",
+ "hideThisNode": "Hide this node",
+ "nodeTypesLabel": "Node Types",
+ "communitiesLabel": "Communities",
+ "showAll": "Show all",
+ "cluster": "Cluster {{id}}",
+ "surprisingConnections": "Surprising Connections",
+ "knowledgeGaps": "Knowledge Gaps",
+ "deepResearch": "Deep Research",
+ "generatingTopic": "Generating research topic...",
+ "researchTopic": "Research Topic",
+ "searchQueries": "Search Queries",
+ "cancel": "Cancel",
+ "startResearch": "Start Research",
+ "nodeTypeLabels": {
+ "entity": "Entity",
+ "concept": "Concept",
+ "source": "Source",
+ "query": "Query",
+ "synthesis": "Synthesis",
+ "overview": "Overview",
+ "comparison": "Comparison",
+ "other": "Other"
+ }
+ },
"time": {
"justNow": "just now",
"minutesAgo": "{{count}} min ago",
diff --git a/src/i18n/zh.json b/src/i18n/zh.json
index fd5b06f4..929c84f1 100644
--- a/src/i18n/zh.json
+++ b/src/i18n/zh.json
@@ -25,15 +25,27 @@
"openProject": "打开项目",
"recentProjects": "最近项目"
},
+ "sidebar": {
+ "knowledge": "知识库",
+ "files": "文件"
+ },
"project": {
"createTitle": "新建 Wiki 项目",
"name": "项目名称",
"namePlaceholder": "my-research-wiki",
"parentDir": "父目录",
+ "parentDirPlaceholder": "/Users/you/projects",
"template": "模板",
"cancel": "取消",
"create": "创建",
- "creating": "创建中..."
+ "creating": "创建中...",
+ "errorNameRequired": "名称和路径不能为空",
+ "errorLanguageRequired": "请选择 AI 输出语言",
+ "browse": "选择父目录",
+ "aiOutputLanguage": "AI 输出语言",
+ "aiOutputLanguageRequired": "*",
+ "aiOutputLanguageHint": "所有 AI 生成的内容(Wiki 页面、聊天回复、Research 结果)都将使用此语言。您可以在设置 → 输出 中稍后更改。",
+ "pickLanguage": "选择语言..."
},
"sources": {
"title": "原始资料",
@@ -42,9 +54,19 @@
"noSources": "暂无资料",
"importHint": "导入文档,开始构建你的 Wiki",
"importFiles": "导入文件",
+ "importFolder": "文件夹",
+ "importSourceFiles": "导入源文件",
+ "importSourceFolder": "导入源文件夹",
+ "refresh": "刷新",
"ingest": "提取到 Wiki",
"delete": "删除资料及相关 Wiki 页面",
"deleteConfirm": "删除「{{name}}」及其相关 Wiki 页面?\n\n此操作将:\n- 删除原始资料文件\n- 删除由该资料生成的 Wiki 页面\n- 更新 index.md",
+ "deleteFolder": "删除文件夹 {{name}}(递归)",
+ "deleteFolderConfirm": "再次点击删除文件夹 {{name}} 及全部内容",
+ "deleteFile": "删除 {{name}}",
+ "deleteFileConfirm": "再次点击删除 {{name}}",
+ "confirm": "确认",
+ "loadingMore": "加载更多资料...",
"sourceCount": "{{count}} 个资料",
"sourceCount_plural": "{{count}} 个资料"
},
@@ -56,7 +78,14 @@
"saved": "已保存!",
"writeToWiki": "写入 Wiki",
"emptyHint": "提问或开始提取资料。",
- "sources": "来源"
+ "sources": "来源",
+ "newChat": "新建对话",
+ "newConversation": "新对话",
+ "noConversationsYet": "暂无对话",
+ "msgCount": "条消息",
+ "startNewConversation": "开始新对话",
+ "clickNewChatToBegin": "点击「新建对话」开始",
+ "typeAMessage": "输入消息..."
},
"search": {
"title": "搜索",
@@ -78,6 +107,38 @@
"missingPage": "缺失页面",
"suggestion": "建议"
},
+ "lint": {
+ "title": "Wiki 检查",
+ "semantic": "语义检查 (LLM)",
+ "running": "检查中...",
+ "runLint": "开始检查",
+ "runLintHint": "运行检查以诊断 Wiki 健康状况",
+ "runLintDescription": "检查孤立页面、失效链接等问题",
+ "allClear": "一切正常!",
+ "noIssues": "未发现问题。",
+ "warnings": "警告",
+ "info": "提示",
+ "sectionCount": "{{label}} ({{count}})",
+ "open": "打开",
+ "fixing": "修复中...",
+ "fix": "修复",
+ "delete": "删除",
+ "openEdit": "打开编辑",
+ "skip": "跳过",
+ "deletePage": "删除页面",
+ "fixBrokenLink": "修复 {{page}} 中的失效链接",
+ "addCrossRefs": "为 {{page}} 添加交叉引用",
+ "addCrossRefsDescription": "此页面没有出站 [[wikilinks]]。建议添加与相关实体和概念的交叉引用。",
+ "deleteOrphanConfirm": "删除孤立页面「{{page}}」?",
+ "typeLabels": {
+ "orphan": "孤立页面",
+ "broken-link": "失效链接",
+ "no-outlinks": "无出站链接",
+ "semantic": "语义问题"
+ },
+ "issues": "{{count}} 个问题",
+ "issues_plural": "{{count}} 个问题"
+ },
"review": {
"title": "待审阅",
"clearResolved": "清除已解决",
@@ -275,6 +336,56 @@
"fileTree": {
"noProject": "未打开项目"
},
+ "graph": {
+ "openProject": "打开项目以查看关系图",
+ "buildingGraph": "正在构建关系图...",
+ "retry": "重试",
+ "noPages": "暂无页面",
+ "importSourcesHint": "导入资料以开始构建知识图谱",
+ "knowledgeGraph": "知识关系图",
+ "hidden": "已隐藏",
+ "pages": "页面",
+ "links": "链接",
+ "filter": "过滤器",
+ "reset": "重置",
+ "type": "类型",
+ "community": "社区",
+ "insights": "洞察",
+ "resizing": "调整中...",
+ "graphFilters": "关系图过滤器",
+ "quickFilters": "快速过滤",
+ "hideIndexOverview": "隐藏索引/概述/日志",
+ "hideIsolated": "隐藏孤立节点",
+ "maxLinks": "最大链接数",
+ "maxLinksHint": "隐藏链接数超过此值的节点",
+ "nodeTypes": "节点类型",
+ "hiddenNodes": "已隐藏节点",
+ "show": "显示",
+ "showingStats": "显示 {{pages}}/{{total}} 个页面和 {{links}}/{{totalLinks}} 条链接。",
+ "hideThisNode": "隐藏此节点",
+ "nodeTypesLabel": "节点类型",
+ "communitiesLabel": "社区",
+ "showAll": "显示全部",
+ "cluster": "簇 {{id}}",
+ "surprisingConnections": "意外连接",
+ "knowledgeGaps": "知识缺口",
+ "deepResearch": "深度研究",
+ "generatingTopic": "正在生成研究主题...",
+ "researchTopic": "研究主题",
+ "searchQueries": "搜索查询",
+ "cancel": "取消",
+ "startResearch": "开始研究",
+ "nodeTypeLabels": {
+ "entity": "实体",
+ "concept": "概念",
+ "source": "来源",
+ "query": "查询",
+ "synthesis": "综合",
+ "overview": "概述",
+ "comparison": "比较",
+ "other": "其他"
+ }
+ },
"time": {
"justNow": "刚刚",
"minutesAgo": "{{count}} 分钟前",
diff --git a/src/stores/chat-store.ts b/src/stores/chat-store.ts
index b15e9f7b..69df20fb 100644
--- a/src/stores/chat-store.ts
+++ b/src/stores/chat-store.ts
@@ -1,5 +1,6 @@
import { create } from "zustand"
import type { ChatMessage } from "@/lib/llm-client"
+import i18n from "@/i18n"
export interface Conversation {
id: string
@@ -81,7 +82,7 @@ export const useChatStore = create<ChatState>((set, get) => ({
const now = Date.now()
const newConversation: Conversation = {
id,
- title: "New Conversation",
+ title: i18n.t("chat.newConversation"),
createdAt: now,
updatedAt: now,
}