feat(i18n): localize members dialog, notifications, uploads, user menus, dates, and players

This commit is contained in:
yiling
2026-07-06 10:38:41 +08:00
parent 64ad183bc1
commit 45f3255796
49 changed files with 1001 additions and 155 deletions
+11 -13
View File
@@ -278,7 +278,7 @@ export const MessageCard: React.FC<MessageCardProps> = ({
onClick={handleReply}
className="text-xs font-medium text-gray-500 hover:text-blue-600 flex items-center gap-1 cursor-pointer"
>
Reply
{m.reply()}
</button>
</div>
</div>
@@ -289,11 +289,9 @@ export const MessageCard: React.FC<MessageCardProps> = ({
<DialogHeader className="pb-4 border-b border-foreground/15">
<DialogTitle className="flex items-center gap-2 text-xl font-bold">
<Terminal className="w-5 h-5 text-violet-500" />
Agent Session Logs
{m.agent_session_logs()}
</DialogTitle>
<DialogDescription>
Step-by-step execution trace of the agent's background tasks and tool calls.
</DialogDescription>
<DialogDescription>{m.agent_logs_description()}</DialogDescription>
</DialogHeader>
<div className="flex-1 overflow-y-auto pr-1 py-4 space-y-4 min-h-0 select-text">
@@ -338,20 +336,20 @@ export const MessageCard: React.FC<MessageCardProps> = ({
if (msg.role === 'user') {
badgeColor =
'bg-slate-100 text-slate-800 dark:bg-slate-900/30 dark:text-slate-300'
roleName = 'User'
roleName = m.role_user()
} else if (msg.role === 'assistant') {
badgeColor =
'bg-violet-100 text-violet-800 dark:bg-violet-900/30 dark:text-violet-300'
roleName = 'Agent'
roleName = m.role_agent()
} else if (msg.role === 'toolResult') {
badgeColor = msg.isError
? 'bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300'
: 'bg-emerald-100 text-emerald-800 dark:bg-emerald-900/30 dark:text-emerald-300'
roleName = `Tool Result: ${String(msg.toolName || 'Unknown')}`
roleName = `${m.tool_result()} ${String(msg.toolName || m.unknown())}`
} else if (msg.role === 'thought') {
badgeColor =
'bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-300'
roleName = 'Thinking'
roleName = m.role_thinking()
}
const renderToolCallArguments = (args: unknown) => {
@@ -450,7 +448,7 @@ export const MessageCard: React.FC<MessageCardProps> = ({
if (type === 'toolCall') {
const toolName = String(
itemObj.name || itemObj.toolName || 'Unknown',
itemObj.name || itemObj.toolName || m.unknown(),
)
const toolArgs = itemObj.arguments || itemObj.args
renderedBlocks.push(
@@ -480,7 +478,7 @@ export const MessageCard: React.FC<MessageCardProps> = ({
key={`img-${idx}`}
className="text-xs text-muted-foreground italic flex items-center gap-1.5 py-1"
>
[Image Object]
{m.image_object()}
</div>,
)
return
@@ -574,9 +572,9 @@ export const MessageCard: React.FC<MessageCardProps> = ({
) : (
<div className="flex flex-col items-center justify-center py-12 text-center text-muted-foreground">
<Terminal className="w-8 h-8 text-muted-foreground/40 mb-2 animate-pulse" />
<p className="text-sm font-medium">No logs found for this session.</p>
<p className="text-sm font-medium">{m.no_logs_found()}</p>
<p className="text-xs text-muted-foreground/60 mt-1">
The session might have been initialized but has not produced any entries yet.
{m.session_no_entries_yet()}
</p>
</div>
)}
@@ -1,4 +1,5 @@
import type { CommentInfo, PostAttachmentRequest, PostAttachmentResponse } from '@shumai/dtos'
import { m } from '@/ui/paraglide/messages.js'
import type { BotInfo } from '@shumai/dtos'
import type { UserInfo } from '@shumai/dtos'
import { client } from '@/ui/api/client'
@@ -603,7 +604,7 @@ export const ChatInput = React.forwardRef<HTMLDivElement, ChatInputProps>(
{replyingTo && (
<div className="flex items-center justify-between bg-muted p-2 px-3 rounded-lg border border-border">
<div className="text-xs text-muted-foreground truncate mr-2">
reply to: {replyingTo.message}
{m.reply_to()} {replyingTo.message}
</div>
<button
onClick={onCancelReply}
@@ -674,7 +675,7 @@ export const ChatInput = React.forwardRef<HTMLDivElement, ChatInputProps>(
suppressContentEditableWarning
onInput={handleInput}
onKeyDown={handleKeyDown}
data-placeholder={replyingTo ? 'Reply...' : 'Message...'}
data-placeholder={replyingTo ? m.reply_placeholder() : m.message_placeholder()}
className={`bg-transparent border-none focus:ring-0 resize-none min-h-[40px] leading-relaxed py-2 focus:outline-none block ${paddingLeftClass}`}
/>
</div>
@@ -784,7 +785,7 @@ export const ChatInput = React.forwardRef<HTMLDivElement, ChatInputProps>(
variant={isTimestampEnabled ? 'secondary' : 'ghost'}
size="icon"
className={`p-2 rounded-full cursor-pointer ${isTimestampEnabled ? 'text-blue-600 bg-blue-50 dark:bg-blue-900/20' : ''}`}
title={isTimestampEnabled ? 'Disable Timestamp' : 'Enable Timestamp'}
title={isTimestampEnabled ? m.disable_timestamp() : m.enable_timestamp()}
>
<Clock className="w-4 h-4" />
</Button>
@@ -794,7 +795,7 @@ export const ChatInput = React.forwardRef<HTMLDivElement, ChatInputProps>(
className="p-2 rounded-full cursor-pointer"
variant="ghost"
size="icon"
title="Attach files"
title={m.attach_files()}
>
<Paperclip className="w-4 h-4" />
</Button>
@@ -804,7 +805,7 @@ export const ChatInput = React.forwardRef<HTMLDivElement, ChatInputProps>(
variant="ghost"
size="icon"
className="p-2 rounded-full cursor-pointer"
title="Toggle Annotation"
title={m.toggle_annotation()}
>
<DrawAnnotation className="w-4 h-4" />
</Button>