Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🌐 fix(i18n): localize settings skill descriptions (#16227)

AmAzing-b39e8aed9cf0
diff --git a/locales/en-US/setting.json b/locales/en-US/setting.json
index d141334bf88..e6f08ccacfc 100644
--- a/locales/en-US/setting.json
+++ b/locales/en-US/setting.json
@@ -1221,6 +1221,7 @@
"tools.lobehubSkill.providers.twitter.readme": "Connect to X (Twitter) to post tweets, manage your timeline, and engage with your audience. Create content, schedule posts, monitor mentions, and build your social media presence through conversational AI.",
"tools.lobehubSkill.providers.vercel.description": "Vercel is a cloud platform for frontend developers, providing hosting and serverless functions to deploy web applications with ease.",
"tools.lobehubSkill.providers.vercel.readme": "Connect to Vercel to manage your deployments, monitor project status, and control your infrastructure. Deploy applications, check build logs, manage environment variables, and scale your projects through conversational AI.",
+ "tools.noConfigurablePermissions": "This skill does not expose configurable tool permissions.",
"tools.notInstalled": "Not Installed",
"tools.notInstalledWarning": "This skill is not currently installed, which may affect agent functionality.",
"tools.plugins.enabled": "Enabled: {{num}}",
diff --git a/locales/zh-CN/setting.json b/locales/zh-CN/setting.json
index a89e223dc2c..678f7f1b312 100644
--- a/locales/zh-CN/setting.json
+++ b/locales/zh-CN/setting.json
@@ -1221,6 +1221,7 @@
"tools.lobehubSkill.providers.twitter.readme": "连接 X(原 Twitter)以发布推文、管理时间线并与受众互动。创建内容、安排发布、监控提及,并通过对话式 AI 构建社交媒体影响力。",
"tools.lobehubSkill.providers.vercel.description": "Vercel 是一个面向前端开发者的云平台,提供托管服务和无服务器函数,可轻松部署 Web 应用。",
"tools.lobehubSkill.providers.vercel.readme": "连接 Vercel 以管理部署、监控项目状态并控制基础设施。通过对话式 AI 部署应用、查看构建日志、管理环境变量并扩展项目。",
+ "tools.noConfigurablePermissions": "此技能未提供可配置的工具权限。",
"tools.notInstalled": "未安装",
"tools.notInstalledWarning": "当前技能暂未安装,可能会影响助理使用",
"tools.plugins.enabled": "已启用 {{num}}",
diff --git a/packages/locales/src/default/setting.ts b/packages/locales/src/default/setting.ts
index f9d2c1cbe96..0ccb8f89b4e 100644
--- a/packages/locales/src/default/setting.ts
+++ b/packages/locales/src/default/setting.ts
@@ -2162,6 +2162,7 @@ When I am ___, I need ___
'workspaceSetting.tab.usage': 'Usage',
'tools.add': 'Add Skill',
'tools.addSkillOrConnector': 'Add Skills / Connectors',
+ 'tools.noConfigurablePermissions': 'This skill does not expose configurable tool permissions.',
'tools.builtins.groupName': 'Built-ins',
'tools.builtins.install': 'Install',
'tools.builtins.installed': 'Installed',
diff --git a/src/features/Connectors/ConnectorDetail/index.test.tsx b/src/features/Connectors/ConnectorDetail/index.test.tsx
index dde6a27b17c..8fa17572479 100644
--- a/src/features/Connectors/ConnectorDetail/index.test.tsx
+++ b/src/features/Connectors/ConnectorDetail/index.test.tsx
@@ -41,10 +41,16 @@ const mocks = vi.hoisted(() => ({
vi.mock('react-i18next', () => ({
useTranslation: () => ({
- t: (_key: string, fallback?: string) => fallback ?? _key,
+ t: (_key: string, options?: { defaultValue?: string } | string) =>
+ typeof options === 'object' ? (options.defaultValue ?? _key) : (options ?? _key),
}),
}));
+vi.mock('@lobechat/const', () => ({
+ getComposioAppByIdentifier: () => undefined,
+ getLobehubSkillProviderById: () => undefined,
+}));
+
vi.mock('antd', () => ({
Button: ({
children,
diff --git a/src/features/Connectors/ConnectorDetail/index.tsx b/src/features/Connectors/ConnectorDetail/index.tsx
index 666e048f002..7e84bcb6478 100644
--- a/src/features/Connectors/ConnectorDetail/index.tsx
+++ b/src/features/Connectors/ConnectorDetail/index.tsx
@@ -1,3 +1,4 @@
+import { getComposioAppByIdentifier, getLobehubSkillProviderById } from '@lobechat/const';
import { confirmModal } from '@lobehub/ui/base-ui';
import { Button } from 'antd';
import { PencilIcon, RefreshCwIcon, Trash2 } from 'lucide-react';
@@ -11,6 +12,7 @@ import { useToolStore } from '@/store/tool';
import { connectorSelectors } from '@/store/tool/slices/connector';
import CustomConnectorModal from '../CustomConnectorModal';
+import { getLocalizedConnectorDetail } from './localization';
import ToolPermissionGroup from './ToolPermissionGroup';
interface ConnectorDetailProps {
@@ -19,220 +21,234 @@ interface ConnectorDetailProps {
onDelete?: () => void;
}
-const ConnectorDetail = memo<ConnectorDetailProps>(({ connectorId, lifecycleActions, onDelete }) => {
- const { t } = useTranslation('tool');
- const [customModalOpen, setCustomModalOpen] = useState(false);
-
- const connector = useToolStore(connectorSelectors.connectorById(connectorId));
- const { readTools, createTools, updateTools, deleteTools } = useToolStore(
- connectorSelectors.connectorToolsGrouped(connectorId),
- );
- const syncing = useToolStore(connectorSelectors.isSyncing(connectorId));
-
- const syncConnectorTools = useToolStore((s) => s.syncConnectorTools);
- const syncBuiltinTool = useToolStore((s) => s.syncBuiltinTool);
- const syncPluginTools = useToolStore((s) => s.syncPluginTools);
- const resetConnectorPermissions = useToolStore((s) => s.resetConnectorPermissions);
- const disconnectConnector = useToolStore((s) => s.disconnectConnector);
- const deleteConnector = useToolStore((s) => s.deleteConnector);
- const uninstallBuiltinTool = useToolStore((s) => s.uninstallBuiltinTool);
- const uninstallMCPPlugin = useToolStore((s) => s.uninstallMCPPlugin);
- const fetchConnectors = useToolStore((s) => s.fetchConnectors);
- const updateToolPermission = useToolStore((s) => s.updateToolPermission);
-
- const isMcpConnector = connector?.sourceType === ConnectorSourceType.custom;
- const isBuiltin = connector?.sourceType === ConnectorSourceType.builtin;
- const isMarketplace = connector?.sourceType === ConnectorSourceType.marketplace;
-
- const handleSync = useCallback(async () => {
- if (!connector) return;
- if (connector.sourceType === ConnectorSourceType.builtin) {
- await syncBuiltinTool(connector.identifier);
- } else if (connector.sourceType === ConnectorSourceType.marketplace) {
- await syncPluginTools(connector.identifier);
- } else {
- await syncConnectorTools(connectorId);
- }
- }, [connector, connectorId, syncBuiltinTool, syncPluginTools, syncConnectorTools]);
-
- const handleUninstall = () => {
- if (!connector) return;
- confirmModal({
- okButtonProps: { danger: true },
- onOk: async () => {
- if (isBuiltin) {
- await uninstallBuiltinTool(connector.identifier);
- } else if (isMarketplace) {
- await uninstallMCPPlugin(connector.identifier);
- }
- await deleteConnector(connectorId);
- onDelete?.();
- },
- title: t('connector.uninstallConfirm', 'Uninstall this tool?'),
+const ConnectorDetail = memo<ConnectorDetailProps>(
+ ({ connectorId, lifecycleActions, onDelete }) => {
+ const { t } = useTranslation('tool');
+ const { t: ts } = useTranslation('setting');
+ const [customModalOpen, setCustomModalOpen] = useState(false);
+
+ const connector = useToolStore(connectorSelectors.connectorById(connectorId));
+ const { readTools, createTools, updateTools, deleteTools } = useToolStore(
+ connectorSelectors.connectorToolsGrouped(connectorId),
+ );
+ const syncing = useToolStore(connectorSelectors.isSyncing(connectorId));
+
+ const syncConnectorTools = useToolStore((s) => s.syncConnectorTools);
+ const syncBuiltinTool = useToolStore((s) => s.syncBuiltinTool);
+ const syncPluginTools = useToolStore((s) => s.syncPluginTools);
+ const resetConnectorPermissions = useToolStore((s) => s.resetConnectorPermissions);
+ const disconnectConnector = useToolStore((s) => s.disconnectConnector);
+ const deleteConnector = useToolStore((s) => s.deleteConnector);
+ const uninstallBuiltinTool = useToolStore((s) => s.uninstallBuiltinTool);
+ const uninstallMCPPlugin = useToolStore((s) => s.uninstallMCPPlugin);
+ const fetchConnectors = useToolStore((s) => s.fetchConnectors);
+ const updateToolPermission = useToolStore((s) => s.updateToolPermission);
+
+ const isMcpConnector = connector?.sourceType === ConnectorSourceType.custom;
+ const isBuiltin = connector?.sourceType === ConnectorSourceType.builtin;
+ const isMarketplace = connector?.sourceType === ConnectorSourceType.marketplace;
+
+ const handleSync = useCallback(async () => {
+ if (!connector) return;
+ if (connector.sourceType === ConnectorSourceType.builtin) {
+ await syncBuiltinTool(connector.identifier);
+ } else if (connector.sourceType === ConnectorSourceType.marketplace) {
+ await syncPluginTools(connector.identifier);
+ } else {
+ await syncConnectorTools(connectorId);
+ }
+ }, [connector, connectorId, syncBuiltinTool, syncPluginTools, syncConnectorTools]);
+
+ const handleUninstall = () => {
+ if (!connector) return;
+ confirmModal({
+ okButtonProps: { danger: true },
+ onOk: async () => {
+ if (isBuiltin) {
+ await uninstallBuiltinTool(connector.identifier);
+ } else if (isMarketplace) {
+ await uninstallMCPPlugin(connector.identifier);
+ }
+ await deleteConnector(connectorId);
+ onDelete?.();
+ },
+ title: t('connector.uninstallConfirm', 'Uninstall this tool?'),
+ });
+ };
+
+ if (!connector) return null;
+
+ const lobehubProvider = isMarketplace
+ ? getLobehubSkillProviderById(connector.identifier)
+ : undefined;
+ const composioApp = isMarketplace
+ ? getComposioAppByIdentifier(connector.identifier)
+ : undefined;
+ const { name: connectorName, description: connectorDescription } = getLocalizedConnectorDetail({
+ composioApp,
+ connector,
+ lobehubProvider,
+ t: ts,
});
- };
-
- if (!connector) return null;
-
- // Sync button label: re-sync tool list from manifest (does NOT reset permissions)
- const syncLabel =
- connector?.sourceType === ConnectorSourceType.custom
- ? t('connector.sync', 'Sync')
- : t('connector.refresh', 'Refresh');
-
- const hasTools =
- readTools.length > 0 ||
- createTools.length > 0 ||
- updateTools.length > 0 ||
- deleteTools.length > 0;
-
- const handleBatchPermission = async (toolIds: string[], permission: ConnectorToolPermission) => {
- await Promise.all(toolIds.map((id) => updateToolPermission(id, permission)));
- };
-
- return (
- <div style={{ display: 'flex', flexDirection: 'column', height: '100%', padding: 16 }}>
- {/* Header */}
- <div
- style={{
- alignItems: 'center',
- display: 'flex',
- gap: 8,
- justifyContent: 'space-between',
- marginBottom: 16,
- }}
- >
- <div style={{ fontSize: 16, fontWeight: 600 }}>{connector.name}</div>
- <div style={{ display: 'flex', gap: 8 }}>
- {/* Reset permissions: restore all tools to auto (fully open) */}
- <Button size="small" onClick={() => resetConnectorPermissions(connectorId)}>
- {t('connector.resetPermissions', 'Reset permissions')}
- </Button>
- {/* Sync/Refresh: re-sync tool list from manifest */}
- <Button
- icon={<RefreshCwIcon size={14} />}
- loading={syncing}
- size="small"
- onClick={handleSync}
- >
- {syncLabel}
- </Button>
- {/* Edit button for custom MCP connectors — only http type has a server URL to edit */}
- {isMcpConnector && connector?.mcpConnectionType === 'http' && (
- <Button
- icon={<PencilIcon size={14} />}
- size="small"
- onClick={() => setCustomModalOpen(true)}
- >
- {t('connector.edit', 'Edit')}
- </Button>
- )}
- {lifecycleActions !== undefined ? (
- lifecycleActions
- ) : (
- <>
- {/* Disconnect / Delete for custom MCP connectors */}
- {isMcpConnector && (
- <>
- <Button danger size="small" onClick={() => disconnectConnector(connectorId)}>
- {t('connector.disconnect', 'Disconnect')}
- </Button>
- <Button
- danger
- icon={<Trash2 size={14} />}
- size="small"
- onClick={() => {
- confirmModal({
- okButtonProps: { danger: true },
- onOk: async () => {
- await deleteConnector(connectorId);
- onDelete?.();
- },
- title: t('connector.deleteConfirm', 'Delete this connector?'),
- });
- }}
- >
- {t('connector.delete', 'Delete')}
- </Button>
- </>
- )}
- {/* Uninstall for builtin and marketplace tools */}
- {(isBuiltin || isMarketplace) && (
- <Button
- danger
- icon={<Trash2 size={14} />}
- size="small"
- onClick={handleUninstall}
- >
- {t('connector.uninstall', 'Uninstall')}
- </Button>
- )}
- </>
- )}
- </div>
- </div>
- {/* Description */}
- {typeof connector.metadata?.description === 'string' && connector.metadata.description && (
+ // Sync button label: re-sync tool list from manifest (does NOT reset permissions)
+ const syncLabel =
+ connector?.sourceType === ConnectorSourceType.custom
+ ? t('connector.sync', 'Sync')
+ : t('connector.refresh', 'Refresh');
+
+ const hasTools =
+ readTools.length > 0 ||
+ createTools.length > 0 ||
+ updateTools.length > 0 ||
+ deleteTools.length > 0;
+
+ const handleBatchPermission = async (
+ toolIds: string[],
+ permission: ConnectorToolPermission,
+ ) => {
+ await Promise.all(toolIds.map((id) => updateToolPermission(id, permission)));
+ };
+
+ return (
+ <div style={{ display: 'flex', flexDirection: 'column', height: '100%', padding: 16 }}>
+ {/* Header */}
<div
style={{
- color: 'var(--ant-color-text-secondary)',
- fontSize: 13,
- lineHeight: 1.6,
+ alignItems: 'center',
+ display: 'flex',
+ gap: 8,
+ justifyContent: 'space-between',
marginBottom: 16,
}}
>
- {connector.metadata.description}
+ <div style={{ fontSize: 16, fontWeight: 600 }}>{connectorName}</div>
+ <div style={{ display: 'flex', gap: 8 }}>
+ {/* Reset permissions: restore all tools to auto (fully open) */}
+ <Button size="small" onClick={() => resetConnectorPermissions(connectorId)}>
+ {t('connector.resetPermissions', 'Reset permissions')}
+ </Button>
+ {/* Sync/Refresh: re-sync tool list from manifest */}
+ <Button
+ icon={<RefreshCwIcon size={14} />}
+ loading={syncing}
+ size="small"
+ onClick={handleSync}
+ >
+ {syncLabel}
+ </Button>
+ {/* Edit button for custom MCP connectors — only http type has a server URL to edit */}
+ {isMcpConnector && connector?.mcpConnectionType === 'http' && (
+ <Button
+ icon={<PencilIcon size={14} />}
+ size="small"
+ onClick={() => setCustomModalOpen(true)}
+ >
+ {t('connector.edit', 'Edit')}
+ </Button>
+ )}
+ {lifecycleActions !== undefined ? (
+ lifecycleActions
+ ) : (
+ <>
+ {/* Disconnect / Delete for custom MCP connectors */}
+ {isMcpConnector && (
+ <>
+ <Button danger size="small" onClick={() => disconnectConnector(connectorId)}>
+ {t('connector.disconnect', 'Disconnect')}
+ </Button>
+ <Button
+ danger
+ icon={<Trash2 size={14} />}
+ size="small"
+ onClick={() => {
+ confirmModal({
+ okButtonProps: { danger: true },
+ onOk: async () => {
+ await deleteConnector(connectorId);
+ onDelete?.();
+ },
+ title: t('connector.deleteConfirm', 'Delete this connector?'),
+ });
+ }}
+ >
+ {t('connector.delete', 'Delete')}
+ </Button>
+ </>
+ )}
+ {/* Uninstall for builtin and marketplace tools */}
+ {(isBuiltin || isMarketplace) && (
+ <Button danger icon={<Trash2 size={14} />} size="small" onClick={handleUninstall}>
+ {t('connector.uninstall', 'Uninstall')}
+ </Button>
+ )}
+ </>
+ )}
+ </div>
</div>
- )}
-
- {hasTools ? (
- <div style={{ flex: 1, overflowY: 'auto' }}>
- <ToolPermissionGroup
- label={t('connector.readOnlyTools', 'Read-only tools')}
- tools={readTools}
- onBatchPermission={handleBatchPermission}
- onPermissionChange={updateToolPermission}
- />
- <ToolPermissionGroup
- label={t('connector.createTools', 'Create tools')}
- tools={createTools}
- onBatchPermission={handleBatchPermission}
- onPermissionChange={updateToolPermission}
- />
- <ToolPermissionGroup
- label={t('connector.updateTools', 'Update tools')}
- tools={updateTools}
- onBatchPermission={handleBatchPermission}
- onPermissionChange={updateToolPermission}
- />
- <ToolPermissionGroup
- label={t('connector.deleteTools', 'Delete tools')}
- tools={deleteTools}
- onBatchPermission={handleBatchPermission}
- onPermissionChange={updateToolPermission}
+
+ {/* Description */}
+ {connectorDescription && (
+ <div
+ style={{
+ color: 'var(--ant-color-text-secondary)',
+ fontSize: 13,
+ lineHeight: 1.6,
+ marginBottom: 16,
+ }}
+ >
+ {connectorDescription}
+ </div>
+ )}
+
+ {hasTools ? (
+ <div style={{ flex: 1, overflowY: 'auto' }}>
+ <ToolPermissionGroup
+ label={t('connector.readOnlyTools', 'Read-only tools')}
+ tools={readTools}
+ onBatchPermission={handleBatchPermission}
+ onPermissionChange={updateToolPermission}
+ />
+ <ToolPermissionGroup
+ label={t('connector.createTools', 'Create tools')}
+ tools={createTools}
+ onBatchPermission={handleBatchPermission}
+ onPermissionChange={updateToolPermission}
+ />
+ <ToolPermissionGroup
+ label={t('connector.updateTools', 'Update tools')}
+ tools={updateTools}
+ onBatchPermission={handleBatchPermission}
+ onPermissionChange={updateToolPermission}
+ />
+ <ToolPermissionGroup
+ label={t('connector.deleteTools', 'Delete tools')}
+ tools={deleteTools}
+ onBatchPermission={handleBatchPermission}
+ onPermissionChange={updateToolPermission}
+ />
+ </div>
+ ) : (
+ <div style={{ color: 'var(--lobe-colors-neutral-500)', fontSize: 14 }}>
+ {t('connector.noTools', 'No tool permissions to configure.')}
+ </div>
+ )}
+
+ {/* Edit modal — only http connectors have a server URL to edit */}
+ {isMcpConnector && connector?.mcpConnectionType === 'http' && (
+ <CustomConnectorModal
+ connectorId={connectorId}
+ open={customModalOpen}
+ onClose={() => setCustomModalOpen(false)}
+ onEditSuccess={() => {
+ fetchConnectors();
+ }}
/>
- </div>
- ) : (
- <div style={{ color: 'var(--lobe-colors-neutral-500)', fontSize: 14 }}>
- {t('connector.noTools', 'No tool permissions to configure.')}
- </div>
- )}
-
- {/* Edit modal — only http connectors have a server URL to edit */}
- {isMcpConnector && connector?.mcpConnectionType === 'http' && (
- <CustomConnectorModal
- connectorId={connectorId}
- open={customModalOpen}
- onClose={() => setCustomModalOpen(false)}
- onEditSuccess={() => {
- fetchConnectors();
- }}
- />
- )}
- </div>
- );
-});
+ )}
+ </div>
+ );
+ },
+);
ConnectorDetail.displayName = 'ConnectorDetail';
diff --git a/src/features/Connectors/ConnectorDetail/localization.test.ts b/src/features/Connectors/ConnectorDetail/localization.test.ts
new file mode 100644
index 00000000000..0fc411e89cd
--- /dev/null
+++ b/src/features/Connectors/ConnectorDetail/localization.test.ts
@@ -0,0 +1,114 @@
+import { type TFunction } from 'i18next';
+import { describe, expect, it, vi } from 'vitest';
+
+import { getLocalizedConnectorDetail } from './localization';
+
+const createTranslator = (translations: Record<string, string> = {}) =>
+ vi.fn(
+ (key: string, options?: { defaultValue?: string }) =>
+ translations[key] ?? options?.defaultValue ?? key,
+ ) as unknown as TFunction<'setting'>;
+
+describe('getLocalizedConnectorDetail', () => {
+ it('localizes builtin connector name and description with setting keys', () => {
+ const t = createTranslator({
+ 'tools.builtins.lobe-web-browsing.description': '搜索网页获取最新信息',
+ 'tools.builtins.lobe-web-browsing.title': '网页浏览',
+ });
+
+ const result = getLocalizedConnectorDetail({
+ connector: {
+ identifier: 'lobe-web-browsing',
+ metadata: { description: 'Search the web' },
+ name: 'Web Browsing',
+ sourceType: 'builtin',
+ },
+ t,
+ });
+
+ expect(result).toEqual({ description: '搜索网页获取最新信息', name: '网页浏览' });
+ expect(t).toHaveBeenCalledWith('tools.builtins.lobe-web-browsing.title', {
+ defaultValue: 'Web Browsing',
+ });
+ expect(t).toHaveBeenCalledWith('tools.builtins.lobe-web-browsing.description', {
+ defaultValue: 'Search the web',
+ });
+ });
+
+ it('localizes LobeHub marketplace connector descriptions from provider metadata', () => {
+ const t = createTranslator({
+ 'tools.lobehubSkill.providers.github.description': '连接 GitHub 代码仓库',
+ });
+
+ const result = getLocalizedConnectorDetail({
+ connector: {
+ identifier: 'github',
+ metadata: { description: 'Raw GitHub description' },
+ name: 'GitHub connector',
+ sourceType: 'marketplace',
+ },
+ lobehubProvider: { description: 'GitHub provider description', label: 'GitHub' },
+ t,
+ });
+
+ expect(result).toEqual({ description: '连接 GitHub 代码仓库', name: 'GitHub' });
+ expect(t).toHaveBeenCalledWith('tools.lobehubSkill.providers.github.description', {
+ defaultValue: 'GitHub provider description',
+ });
+ });
+
+ it('localizes Composio marketplace connector descriptions from app metadata', () => {
+ const t = createTranslator({
+ 'tools.composio.servers.gmail.description': '连接 Gmail 邮箱',
+ });
+
+ const result = getLocalizedConnectorDetail({
+ composioApp: { description: 'Gmail app description', label: 'Gmail' },
+ connector: {
+ identifier: 'gmail',
+ metadata: { description: 'Raw Gmail description' },
+ name: 'Gmail connector',
+ sourceType: 'marketplace',
+ },
+ t,
+ });
+
+ expect(result).toEqual({ description: '连接 Gmail 邮箱', name: 'Gmail' });
+ expect(t).toHaveBeenCalledWith('tools.composio.servers.gmail.description', {
+ defaultValue: 'Gmail app description',
+ });
+ });
+
+ it('keeps custom connector metadata unchanged', () => {
+ const t = createTranslator();
+
+ const result = getLocalizedConnectorDetail({
+ connector: {
+ identifier: 'custom-http',
+ metadata: { description: 'Custom server description' },
+ name: 'Custom HTTP',
+ sourceType: 'custom',
+ },
+ t,
+ });
+
+ expect(result).toEqual({ description: 'Custom server description', name: 'Custom HTTP' });
+ expect(t).not.toHaveBeenCalled();
+ });
+
+ it('ignores non-string descriptions', () => {
+ const t = createTranslator();
+
+ const result = getLocalizedConnectorDetail({
+ connector: {
+ identifier: 'custom-http',
+ metadata: { description: 42 },
+ name: 'Custom HTTP',
+ sourceType: 'custom',
+ },
+ t,
+ });
+
+ expect(result).toEqual({ description: undefined, name: 'Custom HTTP' });
+ });
+});
diff --git a/src/features/Connectors/ConnectorDetail/localization.ts b/src/features/Connectors/ConnectorDetail/localization.ts
new file mode 100644
index 00000000000..2077f718eb0
--- /dev/null
+++ b/src/features/Connectors/ConnectorDetail/localization.ts
@@ -0,0 +1,66 @@
+import { type TFunction } from 'i18next';
+
+interface LocalizableConnector {
+ identifier: string;
+ metadata?: Record<string, unknown> | null;
+ name: string;
+ sourceType: string;
+}
+
+interface LocalizableProvider {
+ description?: string;
+ label: string;
+}
+
+interface GetLocalizedConnectorDetailOptions {
+ composioApp?: LocalizableProvider;
+ connector: LocalizableConnector;
+ lobehubProvider?: LocalizableProvider;
+ t: TFunction<'setting'>;
+}
+
+export const getLocalizedConnectorDetail = ({
+ composioApp,
+ connector,
+ lobehubProvider,
+ t,
+}: GetLocalizedConnectorDetailOptions) => {
+ const rawDescription =
+ typeof connector.metadata?.description === 'string'
+ ? connector.metadata.description
+ : undefined;
+
+ if (connector.sourceType === 'builtin') {
+ return {
+ description: t(`tools.builtins.${connector.identifier}.description`, {
+ defaultValue: rawDescription || '',
+ }),
+ name: t(`tools.builtins.${connector.identifier}.title`, {
+ defaultValue: connector.name,
+ }),
+ };
+ }
+
+ if (lobehubProvider) {
+ return {
+ description: t(`tools.lobehubSkill.providers.${connector.identifier}.description`, {
+ defaultValue: lobehubProvider.description || rawDescription || '',
+ }),
+ name: lobehubProvider.label,
+ };
+ }
+
+ if (composioApp) {
+ return {
+ description: t(`tools.composio.servers.${connector.identifier}.description`, {
+ defaultValue: composioApp.description || rawDescription || '',
+ }),
+ name: composioApp.label,
+ };
+ }
+
+ return {
+ description: rawDescription,
+ name: connector.name,
+ };
+};
diff --git a/src/routes/(main)/settings/skill/features/SkillDetail/index.test.tsx b/src/routes/(main)/settings/skill/features/SkillDetail/index.test.tsx
index 996eef61884..d0efd482b89 100644
--- a/src/routes/(main)/settings/skill/features/SkillDetail/index.test.tsx
+++ b/src/routes/(main)/settings/skill/features/SkillDetail/index.test.tsx
@@ -124,6 +124,8 @@ vi.mock('react-i18next', () => ({
'tools.lobehubSkill.disconnect': 'Disconnect',
'tools.lobehubSkill.disconnectConfirm.desc': `Disconnect ${(options as { name?: string })?.name}?`,
'tools.lobehubSkill.disconnectConfirm.title': `Disconnect ${(options as { name?: string })?.name}`,
+ 'tools.noConfigurablePermissions':
+ 'This skill does not expose configurable tool permissions.',
};
if (translations[key]) return translations[key];
diff --git a/src/routes/(main)/settings/skill/features/SkillDetail/index.tsx b/src/routes/(main)/settings/skill/features/SkillDetail/index.tsx
index 7db73e84bca..0ac051eca38 100644
--- a/src/routes/(main)/settings/skill/features/SkillDetail/index.tsx
+++ b/src/routes/(main)/settings/skill/features/SkillDetail/index.tsx
@@ -17,6 +17,8 @@ import { useToolStore } from '@/store/tool';
import { builtinToolSelectors, lobehubSkillStoreSelectors } from '@/store/tool/selectors';
import { connectorSelectors } from '@/store/tool/slices/connector';
+import { getLocalizedBuiltinSkillDetail, getNoPermissionsTitle } from './localization';
+
const AgentSkillDetail = lazy(() => import('@/features/AgentSkillDetail'));
export type ToolDetailType =
@@ -150,6 +152,7 @@ LobehubConnectorAction.displayName = 'LobehubConnectorAction';
*/
const SkillDetail = memo<SkillDetailProps>(({ identifier, type, onDelete }) => {
const { t } = useTranslation('plugin');
+ const { t: ts } = useTranslation('setting');
const [syncing, setSyncing] = useState(false);
const [noManifest, setNoManifest] = useState(false);
@@ -187,6 +190,10 @@ const SkillDetail = memo<SkillDetailProps>(({ identifier, type, onDelete }) => {
type === 'mcp-connector' ||
type === 'lobehub-connector';
+ const { title: builtinSkillTitle, description: builtinSkillDescription } =
+ getLocalizedBuiltinSkillDetail(builtinSkill, identifier, ts);
+ const noPermissionsTitle = getNoPermissionsTitle(identifier, type, ts);
+
const renderLobehubConnectorAction = (onDisconnected?: () => void) => {
if (type !== 'lobehub-connector') return undefined;
@@ -318,9 +325,9 @@ const SkillDetail = memo<SkillDetailProps>(({ identifier, type, onDelete }) => {
<div style={{ alignItems: 'flex-start', display: 'flex', gap: 12 }}>
{builtinSkill?.avatar && <Avatar avatar={builtinSkill.avatar} size={40} />}
<div>
- <div className={styles.name}>{builtinSkill?.name || identifier}</div>
- {builtinSkill?.description && (
- <div className={styles.description}>{builtinSkill.description}</div>
+ <div className={styles.name}>{builtinSkillTitle}</div>
+ {builtinSkillDescription && (
+ <div className={styles.description}>{builtinSkillDescription}</div>
)}
</div>
</div>
@@ -363,10 +370,12 @@ const SkillDetail = memo<SkillDetailProps>(({ identifier, type, onDelete }) => {
return (
<div className={styles.noPermissions}>
<div className={styles.noPermissionsHeader}>
- <div className={styles.noPermissionsTitle}>{lobehubLabel}</div>
+ <div className={styles.noPermissionsTitle}>
+ {type === 'lobehub-connector' ? lobehubLabel : noPermissionsTitle}
+ </div>
{renderLobehubConnectorAction()}
</div>
- This skill does not expose configurable tool permissions.
+ {ts('tools.noConfigurablePermissions')}
</div>
);
}
diff --git a/src/routes/(main)/settings/skill/features/SkillDetail/localization.test.ts b/src/routes/(main)/settings/skill/features/SkillDetail/localization.test.ts
new file mode 100644
index 00000000000..e20e7741f5b
--- /dev/null
+++ b/src/routes/(main)/settings/skill/features/SkillDetail/localization.test.ts
@@ -0,0 +1,76 @@
+import { type TFunction } from 'i18next';
+import { describe, expect, it, vi } from 'vitest';
+
+import { getLocalizedBuiltinSkillDetail, getNoPermissionsTitle } from './localization';
+
+const createTranslator = (translations: Record<string, string> = {}) =>
+ vi.fn(
+ (key: string, options?: { defaultValue?: string }) =>
+ translations[key] ?? options?.defaultValue ?? key,
+ ) as unknown as TFunction<'setting'>;
+
+describe('SkillDetail localization helpers', () => {
+ it('localizes builtin skill title and description', () => {
+ const t = createTranslator({
+ 'tools.builtins.lobe-agent-browser.description': '浏览器自动化命令行工具',
+ 'tools.builtins.lobe-agent-browser.title': '助手浏览器',
+ });
+
+ const result = getLocalizedBuiltinSkillDetail(
+ {
+ content: '# Agent Browser',
+ description: 'Browser automation CLI for AI agents.',
+ identifier: 'lobe-agent-browser',
+ name: 'Agent Browser',
+ source: 'builtin',
+ },
+ 'lobe-agent-browser',
+ t,
+ );
+
+ expect(result).toEqual({ description: '浏览器自动化命令行工具', title: '助手浏览器' });
+ expect(t).toHaveBeenCalledWith('tools.builtins.lobe-agent-browser.title', {
+ defaultValue: 'Agent Browser',
+ });
+ expect(t).toHaveBeenCalledWith('tools.builtins.lobe-agent-browser.description', {
+ defaultValue: 'Browser automation CLI for AI agents.',
+ });
+ });
+
+ it('falls back to the identifier when the builtin skill is unavailable', () => {
+ const t = createTranslator();
+
+ expect(getLocalizedBuiltinSkillDetail(undefined, 'missing-skill', t)).toEqual({
+ description: undefined,
+ title: 'missing-skill',
+ });
+ expect(t).not.toHaveBeenCalled();
+ });
+
+ it('omits empty builtin skill descriptions', () => {
+ const t = createTranslator({ 'tools.builtins.task.title': '任务' });
+
+ expect(
+ getLocalizedBuiltinSkillDetail(
+ {
+ content: '# Task',
+ description: '',
+ identifier: 'task',
+ name: 'Task',
+ source: 'builtin',
+ },
+ 'task',
+ t,
+ ),
+ ).toEqual({ description: undefined, title: '任务' });
+ expect(t).toHaveBeenCalledTimes(1);
+ });
+
+ it('localizes the no-permissions title for builtin tools only', () => {
+ const t = createTranslator({ 'tools.builtins.lobe-calculator.title': '计算器' });
+
+ expect(getNoPermissionsTitle('lobe-calculator', 'builtin', t)).toBe('计算器');
+ expect(getNoPermissionsTitle('custom-http', 'mcp-connector', t)).toBe('custom-http');
+ expect(t).toHaveBeenCalledTimes(1);
+ });
+});
diff --git a/src/routes/(main)/settings/skill/features/SkillDetail/localization.ts b/src/routes/(main)/settings/skill/features/SkillDetail/localization.ts
new file mode 100644
index 00000000000..a606cc738f2
--- /dev/null
+++ b/src/routes/(main)/settings/skill/features/SkillDetail/localization.ts
@@ -0,0 +1,31 @@
+import { type BuiltinSkill } from '@lobechat/types';
+import { type TFunction } from 'i18next';
+
+type Translate = TFunction<'setting'>;
+
+export const getLocalizedBuiltinSkillDetail = (
+ builtinSkill: BuiltinSkill | undefined,
+ identifier: string,
+ t: Translate,
+) => {
+ if (!builtinSkill) {
+ return { description: undefined, title: identifier };
+ }
+
+ return {
+ description: builtinSkill.description
+ ? t(`tools.builtins.${builtinSkill.identifier}.description`, {
+ defaultValue: builtinSkill.description,
+ })
+ : undefined,
+ title: t(`tools.builtins.${builtinSkill.identifier}.title`, {
+ defaultValue: builtinSkill.name,
+ }),
+ };
+};
+
+export const getNoPermissionsTitle = (identifier: string, type: string, t: Translate) => {
+ if (type !== 'builtin') return identifier;
+
+ return t(`tools.builtins.${identifier}.title`, { defaultValue: identifier });
+};