diff --git a/src/components/chat-view/McpHubView.tsx b/src/components/chat-view/McpHubView.tsx index b5c6209..2b4a698 100644 --- a/src/components/chat-view/McpHubView.tsx +++ b/src/components/chat-view/McpHubView.tsx @@ -65,7 +65,7 @@ const McpHubView = () => { const handleDelete = async (serverName: string) => { const hub = await getMcpHub(); if (hub) { - if (confirm(`确定要删除服务器 "${serverName}" 吗?`)) { + if (confirm(t('mcpHub.deleteConfirm', { name: serverName }))) { await hub.deleteServer(serverName, "global") const updatedServers = hub.getAllServers() setMcpServers(updatedServers) @@ -76,12 +76,12 @@ const McpHubView = () => { const handleCreate = async () => { // 验证输入 if (newServerName.trim().length === 0) { - new Notice("服务器名称不能为空") + new Notice(t('mcpHub.serverNameRequired')) return } if (newServerConfig.trim().length === 0) { - new Notice("配置不能为空") + new Notice(t('mcpHub.configRequired')) return } @@ -89,7 +89,7 @@ const McpHubView = () => { try { JSON.parse(newServerConfig) } catch (error) { - new Notice("配置格式无效,请输入有效的 JSON 格式") + new Notice(t('mcpHub.invalidConfig')) return } @@ -103,9 +103,9 @@ const McpHubView = () => { // 清空表单 setNewServerName('') setNewServerConfig('') - new Notice(`服务器 "${newServerName}" 创建成功`) + new Notice(t('mcpHub.createSuccess', { name: newServerName })) } catch (error) { - new Notice(`创建服务器失败: ${error.message}`) + new Notice(t('mcpHub.createFailed', { error: error.message })) } } } @@ -144,7 +144,7 @@ const McpHubView = () => { if (properties && typeof properties === 'object' && Object.keys(properties).length > 0) { return (
-
{t('parameters')}
+
{t('mcpHub.parameters')}
{Object.entries(properties).map( ([paramName, paramSchemaUntyped]) => { const paramSchema = paramSchemaUntyped && typeof paramSchemaUntyped === 'object' ? paramSchemaUntyped : {}; @@ -157,7 +157,7 @@ const McpHubView = () => { {isRequired && *} - {paramDescription || t('mcpHub.tool.noDescription')} + {paramDescription || t('mcpHub.toolNoDescription')}
); @@ -198,7 +198,7 @@ const McpHubView = () => {
{/* Header Section */}
-

MCP 服务器

+

{t('mcpHub.title')}

{/* MCP Settings */} @@ -211,12 +211,12 @@ const McpHubView = () => { onChange={switchMcp} className="infio-mcp-setting-checkbox" /> - 启用 MCP 服务器 + {t('mcpHub.enableMcp')}

- 开启后可用已连接 MCP 服务器的工具,能力更强。不用这些工具时建议关闭,节省 API Token 费用。 + {t('mcpHub.enableMcpDescription')} - Learn more about MCP + {t('mcpHub.learnMore')}

@@ -231,33 +231,25 @@ const McpHubView = () => {
{isCreateSectionExpanded ? : }
-

+ 添加新的 MCP 服务器

+

{t('mcpHub.addNewServer')}

{isCreateSectionExpanded && (
-
服务器名称
+
{t('mcpHub.serverName')}
setNewServerName(e.target.value)} - placeholder="输入服务器名称" + placeholder={t('mcpHub.serverNamePlaceholder')} className="infio-mcp-create-input" /> -
配置 (JSON 格式)
+
{t('mcpHub.config')}