diff --git a/src/components/journal/ComposePanel.tsx b/src/components/journal/ComposePanel.tsx
index 5584052..00b4ad3 100644
--- a/src/components/journal/ComposePanel.tsx
+++ b/src/components/journal/ComposePanel.tsx
@@ -68,7 +68,7 @@ export const ComposePanel: Component = () => {
disabled={sending()}
class="ml-auto bg-blue-600 text-white rounded px-3 py-1 text-xs hover:bg-blue-700 disabled:opacity-50"
>
- {sending() ? "..." : "Send"}
+ {sending() ? "..." : "发送"}
diff --git a/src/components/journal/ConnectionBar.tsx b/src/components/journal/ConnectionBar.tsx
index b2cef64..7d780c3 100644
--- a/src/components/journal/ConnectionBar.tsx
+++ b/src/components/journal/ConnectionBar.tsx
@@ -31,7 +31,7 @@ export const ConnectionBar: Component = () => {
};
const handleDeleteSession = (id: string) => {
- if (confirm(`Delete session "${id}"? This cannot be undone.`)) {
+ if (confirm(`确定要删除会话 "${id}"?此操作不可撤销。`)) {
deleteSession(id);
}
};
@@ -41,7 +41,7 @@ export const ConnectionBar: Component = () => {
await hydrateFromServer(id);
setSessionId(id);
} catch (e) {
- setError("Failed to load session");
+ setError("无法加载会话");
}
};
@@ -54,7 +54,7 @@ export const ConnectionBar: Component = () => {
{/* Status row */}
-
connected
+
已连接
{stream.sessionName || stream.sessionId}
@@ -62,12 +62,12 @@ export const ConnectionBar: Component = () => {
- Playing as {stream.myName}
+ 扮演 {stream.myName}
⏻
@@ -77,12 +77,12 @@ export const ConnectionBar: Component = () => {
- Sessions:
+ 会话列表:
setShowNewSession((v) => !v)}
class="text-xs text-blue-600 hover:underline"
>
- + new
+ + 新建
@@ -92,7 +92,7 @@ export const ConnectionBar: Component = () => {
type="text"
value={newSessionName()}
onInput={(e) => setNewSessionName(e.currentTarget.value)}
- placeholder="Session name"
+ placeholder="会话名称"
class="flex-1 border border-gray-300 rounded px-2 py-0.5 text-xs"
onKeyDown={(e) => e.key === "Enter" && handleCreateSession()}
/>
@@ -100,7 +100,7 @@ export const ConnectionBar: Component = () => {
onClick={handleCreateSession}
class="bg-green-600 text-white rounded px-2 py-0.5 text-xs hover:bg-green-700"
>
- Create
+ Create Create
@@ -126,7 +126,7 @@ export const ConnectionBar: Component = () => {
handleDeleteSession(id);
}}
class="text-gray-400 hover:text-red-500 text-xs"
- title="Delete session"
+ title="删除会话"
>
✕
diff --git a/src/components/journal/DynamicForm.tsx b/src/components/journal/DynamicForm.tsx
index 5ece0c5..6d36ecb 100644
--- a/src/components/journal/DynamicForm.tsx
+++ b/src/components/journal/DynamicForm.tsx
@@ -53,7 +53,7 @@ const SchemaFields: Component<{
const shape = unwrapShape(props.schema);
if (!shape) {
- return
No fields
;
+ return
无字段
;
}
return (
@@ -98,7 +98,7 @@ const SchemaFields: Component<{
checked={isSet()}
onChange={toggleOptional}
class="mt-1.5"
- title={`Include ${key}`}
+ title={`包含 ${key}`}
/>
@@ -204,7 +204,7 @@ const FieldInput: Component<{
}}
disabled={props.disabled}
class={inputClass}
- placeholder="comma-separated"
+ placeholder="逗号分隔"
/>
diff --git a/src/components/journal/JournalInput.tsx b/src/components/journal/JournalInput.tsx
index 4e558c8..8c44da8 100644
--- a/src/components/journal/JournalInput.tsx
+++ b/src/components/journal/JournalInput.tsx
@@ -44,20 +44,19 @@ function parseInput(raw: string): ParsedInput {
if (raw.startsWith("/roll ")) {
const notation = raw.slice("/roll ".length).trim();
if (!notation)
- return { type: "roll", payload: {}, error: "Dice notation required" };
+ return { type: "roll", payload: {}, error: "需要骰子表达式" };
return { type: "roll", payload: { notation, label: notation } };
}
if (raw.startsWith("/spark ")) {
const key = raw.slice("/spark ".length).trim();
- if (!key)
- return { type: "spark", payload: {}, error: "Spark table key required" };
+ if (!key) return { type: "spark", payload: {}, error: "需要种子表键名" };
return { type: "spark", payload: { key } };
}
if (raw.startsWith("/link ")) {
const arg = raw.slice("/link ".length).trim();
- if (!arg) return { type: "link", payload: {}, error: "Path required" };
+ if (!arg) return { type: "link", payload: {}, error: "需要路径" };
const hashIdx = arg.indexOf("#");
const path = hashIdx === -1 ? arg : arg.slice(0, hashIdx);
const section =
@@ -67,7 +66,7 @@ function parseInput(raw: string): ParsedInput {
// /roll, /spark, or /link with no space — need to complete, don't send
if (raw === "/roll" || raw === "/spark" || raw === "/link") {
- return { type: "chat", payload: {}, error: "Complete the command" };
+ return { type: "chat", payload: {}, error: "请补全命令" };
}
return { type: "chat", payload: { text: raw } };
@@ -168,7 +167,7 @@ export const JournalInput: Component = () => {
textareaRef?.focus();
return;
} catch (e) {
- setError(e instanceof Error ? e.message : "Failed to roll spark table");
+ setError(e instanceof Error ? e.message : "种子表掷骰失败");
setSending(false);
return;
}
@@ -216,7 +215,7 @@ export const JournalInput: Component = () => {
);
return matches.length > 0
? matches
- : [{ label: "Unknown command", kind: "no-results", insertText: "" }];
+ : [{ label: "未知命令", kind: "no-results", insertText: "" }];
}
// After /roll — show dice suggestions
@@ -230,7 +229,7 @@ export const JournalInput: Component = () => {
)
.slice(0, 8);
if (matches.length === 0) {
- return [{ label: "No dice found", kind: "no-results", insertText: "" }];
+ return [{ label: "未找到骰子", kind: "no-results", insertText: "" }];
}
return matches.map((d) => ({
label: d.notation,
@@ -252,7 +251,7 @@ export const JournalInput: Component = () => {
if (matches.length === 0) {
return [
{
- label: "No spark tables found",
+ label: "未找到种子表",
kind: "no-results",
insertText: "",
},
@@ -276,9 +275,7 @@ export const JournalInput: Component = () => {
)
.slice(0, 8);
if (matches.length === 0) {
- return [
- { label: "No links found", kind: "no-results", insertText: "" },
- ];
+ return [{ label: "未找到链接", kind: "no-results", insertText: "" }];
}
return matches.map((l) => {
const insert = l.section
@@ -459,7 +456,7 @@ export const JournalInput: Component = () => {
ref={completionsRef}
class="absolute bottom-full left-0 right-0 bg-white border border-gray-200 rounded-t shadow-lg mb-0.5 z-50 px-3 py-2 text-xs text-gray-400 italic"
>
- Loading completions…
+ 正在加载补全数据…