feat(i18n): translate Claude session components to Chinese

Translate English interface text to Chinese in Claude Code session components:

- ClaudeCodeSession.tsx: Session management UI, settings, timeline, and execution states
- SessionOutputViewer.tsx: Output viewer, status messages, and copy operations

Key translations:
- Session management terms (会话, 恢复会话, 分叉会话)
- Status indicators (运行中, 实时, 完成, 取消)
- UI actions (复制输出, 刷新, 设置, 时间线)
- Error and loading messages
- Project directory selection interface

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-07-03 12:42:06 +08:00
parent f1377833b3
commit ee565ac80f
2 changed files with 60 additions and 60 deletions

View File

@@ -146,7 +146,7 @@ export function SessionOutputViewer({ session, onClose, className }: SessionOutp
}
} catch (error) {
console.error('Failed to load session output:', error);
setToast({ message: 'Failed to load session output', type: 'error' });
setToast({ message: '加载会话输出失败', type: 'error' });
} finally {
setLoading(false);
}
@@ -180,12 +180,12 @@ export function SessionOutputViewer({ session, onClose, className }: SessionOutp
});
const completeUnlisten = await listen<boolean>(`agent-complete:${session.id}`, () => {
setToast({ message: 'Agent execution completed', type: 'success' });
setToast({ message: '智能体执行完成', type: 'success' });
// Don't set status here as the parent component should handle it
});
const cancelUnlisten = await listen<boolean>(`agent-cancelled:${session.id}`, () => {
setToast({ message: 'Agent execution was cancelled', type: 'error' });
setToast({ message: '智能体执行已取消', type: 'error' });
});
unlistenRefs.current = [outputUnlisten, errorUnlisten, completeUnlisten, cancelUnlisten];
@@ -199,7 +199,7 @@ export function SessionOutputViewer({ session, onClose, className }: SessionOutp
const jsonl = rawJsonlOutput.join('\n');
await navigator.clipboard.writeText(jsonl);
setCopyPopoverOpen(false);
setToast({ message: 'Output copied as JSONL', type: 'success' });
setToast({ message: '输出已复制为JSONL', type: 'success' });
};
const handleCopyAsMarkdown = async () => {
@@ -254,7 +254,7 @@ export function SessionOutputViewer({ session, onClose, className }: SessionOutp
await navigator.clipboard.writeText(markdown);
setCopyPopoverOpen(false);
setToast({ message: 'Output copied as Markdown', type: 'success' });
setToast({ message: '输出已复制为Markdown', type: 'success' });
};
@@ -262,10 +262,10 @@ export function SessionOutputViewer({ session, onClose, className }: SessionOutp
setRefreshing(true);
try {
await loadOutput(true); // Skip cache when manually refreshing
setToast({ message: 'Output refreshed', type: 'success' });
setToast({ message: '输出已刷新', type: 'success' });
} catch (error) {
console.error('Failed to refresh output:', error);
setToast({ message: 'Failed to refresh output', type: 'error' });
setToast({ message: '刷新输出失败', type: 'error' });
} finally {
setRefreshing(false);
}
@@ -345,7 +345,7 @@ export function SessionOutputViewer({ session, onClose, className }: SessionOutp
<div className="flex items-center space-x-3">
<div className="text-2xl">{session.agent_icon}</div>
<div>
<CardTitle className="text-base">{session.agent_name} - Output</CardTitle>
<CardTitle className="text-base">{session.agent_name} - </CardTitle>
<div className="flex items-center space-x-2 mt-1">
<Badge variant={session.status === 'running' ? 'default' : 'secondary'}>
{session.status}
@@ -353,11 +353,11 @@ export function SessionOutputViewer({ session, onClose, className }: SessionOutp
{session.status === 'running' && (
<Badge variant="outline" className="text-xs bg-green-50 text-green-700 border-green-200">
<div className="w-1.5 h-1.5 bg-green-500 rounded-full animate-pulse mr-1"></div>
Live
</Badge>
)}
<span className="text-xs text-muted-foreground">
{messages.length} messages
{messages.length}
</span>
</div>
</div>
@@ -369,7 +369,7 @@ export function SessionOutputViewer({ session, onClose, className }: SessionOutp
variant="outline"
size="sm"
onClick={() => setIsFullscreen(!isFullscreen)}
title="Fullscreen"
title="全屏"
>
{isFullscreen ? <Minimize2 className="h-4 w-4" /> : <Maximize2 className="h-4 w-4" />}
</Button>
@@ -381,7 +381,7 @@ export function SessionOutputViewer({ session, onClose, className }: SessionOutp
className="flex items-center gap-2"
>
<Copy className="h-4 w-4" />
Copy Output
<ChevronDown className="h-3 w-3" />
</Button>
}
@@ -393,7 +393,7 @@ export function SessionOutputViewer({ session, onClose, className }: SessionOutp
className="w-full justify-start"
onClick={handleCopyAsJsonl}
>
Copy as JSONL
JSONL
</Button>
<Button
variant="ghost"
@@ -401,7 +401,7 @@ export function SessionOutputViewer({ session, onClose, className }: SessionOutp
className="w-full justify-start"
onClick={handleCopyAsMarkdown}
>
Copy as Markdown
Markdown
</Button>
</div>
}
@@ -416,7 +416,7 @@ export function SessionOutputViewer({ session, onClose, className }: SessionOutp
size="sm"
onClick={refreshOutput}
disabled={refreshing}
title="Refresh output"
title="刷新输出"
>
<RotateCcw className={`h-4 w-4 ${refreshing ? 'animate-spin' : ''}`} />
</Button>
@@ -431,7 +431,7 @@ export function SessionOutputViewer({ session, onClose, className }: SessionOutp
<div className="flex items-center justify-center h-full">
<div className="flex items-center space-x-2">
<RefreshCw className="h-4 w-4 animate-spin" />
<span>Loading output...</span>
<span>...</span>
</div>
</div>
) : (
@@ -455,14 +455,14 @@ export function SessionOutputViewer({ session, onClose, className }: SessionOutp
{session.status === 'running' ? (
<>
<RefreshCw className="h-8 w-8 animate-spin text-muted-foreground mb-2" />
<p className="text-muted-foreground">Waiting for output...</p>
<p className="text-muted-foreground">...</p>
<p className="text-xs text-muted-foreground mt-1">
Agent is running but no output received yet
</p>
</>
) : (
<>
<p className="text-muted-foreground">No output available</p>
<p className="text-muted-foreground"></p>
<Button
variant="outline"
size="sm"
@@ -471,7 +471,7 @@ export function SessionOutputViewer({ session, onClose, className }: SessionOutp
disabled={refreshing}
>
{refreshing ? <RefreshCw className="h-4 w-4 animate-spin mr-2" /> : <RotateCcw className="h-4 w-4 mr-2" />}
Refresh
</Button>
</>
)}
@@ -508,11 +508,11 @@ export function SessionOutputViewer({ session, onClose, className }: SessionOutp
<div className="flex items-center justify-between p-4 border-b border-border">
<div className="flex items-center gap-2">
<div className="text-2xl">{session.agent_icon}</div>
<h2 className="text-lg font-semibold">{session.agent_name} - Output</h2>
<h2 className="text-lg font-semibold">{session.agent_name} - </h2>
{session.status === 'running' && (
<div className="flex items-center gap-1">
<div className="w-2 h-2 bg-green-500 rounded-full animate-pulse"></div>
<span className="text-xs text-green-600 font-medium">Running</span>
<span className="text-xs text-green-600 font-medium"></span>
</div>
)}
</div>
@@ -526,7 +526,7 @@ export function SessionOutputViewer({ session, onClose, className }: SessionOutp
className="flex items-center gap-2"
>
<Copy className="h-4 w-4" />
Copy Output
<ChevronDown className="h-3 w-3" />
</Button>
}
@@ -538,7 +538,7 @@ export function SessionOutputViewer({ session, onClose, className }: SessionOutp
className="w-full justify-start"
onClick={handleCopyAsJsonl}
>
Copy as JSONL
JSONL
</Button>
<Button
variant="ghost"
@@ -546,7 +546,7 @@ export function SessionOutputViewer({ session, onClose, className }: SessionOutp
className="w-full justify-start"
onClick={handleCopyAsMarkdown}
>
Copy as Markdown
Markdown
</Button>
</div>
}
@@ -562,7 +562,7 @@ export function SessionOutputViewer({ session, onClose, className }: SessionOutp
className="flex items-center gap-2"
>
<X className="h-4 w-4" />
Close
</Button>
</div>
</div>
@@ -589,14 +589,14 @@ export function SessionOutputViewer({ session, onClose, className }: SessionOutp
{session.status === 'running' ? (
<>
<RefreshCw className="h-8 w-8 animate-spin text-muted-foreground mb-2" />
<p className="text-muted-foreground">Waiting for output...</p>
<p className="text-muted-foreground">...</p>
<p className="text-xs text-muted-foreground mt-1">
Agent is running but no output received yet
</p>
</>
) : (
<>
<p className="text-muted-foreground">No output available</p>
<p className="text-muted-foreground"></p>
</>
)}
</div>