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(connector): localize connector detail and permission labels (#20598)

YuTengjingdad1af63ff1b
diff --git a/AGENTS.md b/AGENTS.md
index 33b3a176181..b543bd54416 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -88,6 +88,7 @@ Use `bun run check [changed-files...]`.
Use the `acceptance` skill to decide whether the delivery needs product verification and whether existing evidence already covers it. Opening or marking a PR ready is a checkpoint for that decision, not a trigger to rerun verification.
- Documentation/instruction-only changes, pure refactors or tooling changes with no product behavior change, and gitlink-only syncs do not require a new acceptance run. State the reason in the PR; for a gitlink sync, link the upstream change and its existing acceptance when available.
+- Changes to rendered UI text, including locale keys and translations, change product behavior and are not exempt. A test that only asserts key presence does not show that the page renders the text.
- Reuse a completed acceptance that covers the delivered behavior. If its report and evidence exist only locally, inspect and upload them with `lh acceptance run ingest`; if already published, reuse the link. Do not rerun the product merely to open a PR or obtain a report URL.
- For new or changed product behavior not covered by valid evidence, verify the affected outcomes on the real product, capture the required evidence, and publish the result. The skill owns reuse criteria and the execution workflow.
- Agent tool results shown in chat are Web UI outcomes even when the implementation is server-side. Verify the rendered tool card and parent reply, including the failure state when recovery is the goal.
diff --git a/locales/en-US/tool.json b/locales/en-US/tool.json
index d1514ad3984..389f80f7d5e 100644
--- a/locales/en-US/tool.json
+++ b/locales/en-US/tool.json
@@ -80,11 +80,54 @@
"codeInterpreter.output": "Output:",
"codeInterpreter.returnValue": "Return Value:",
"connector.actionFailed": "Operation failed, please try again",
+ "connector.add.advanced": "Advanced settings",
+ "connector.add.authError": "Authorization failed: {{reason}}",
+ "connector.add.authFailed": "Could not connect. This server may require an OAuth Client ID in Advanced settings.",
+ "connector.add.cancel": "Cancel",
+ "connector.add.cancelled": "Authorization was not completed",
+ "connector.add.clientId": "OAuth Client ID (optional)",
+ "connector.add.clientSecret": "OAuth Client Secret (optional)",
+ "connector.add.confirm": "Add",
+ "connector.add.editTitle": "Edit Connector",
+ "connector.add.name": "Name",
+ "connector.add.namePlaceholder": "My connector",
+ "connector.add.popupBlocked": "Please allow popups for this site and try again.",
+ "connector.add.redirectHint": "Redirect URI to register with your OAuth app:",
+ "connector.add.success": "Connector connected",
+ "connector.add.syncFailed": "Authorized, but tools could not be synced. Click Sync to retry.",
"connector.add.title": "Add Custom Connector",
+ "connector.add.unknownError": "unknown error",
+ "connector.add.update": "Save",
+ "connector.add.url": "Remote MCP server URL",
+ "connector.connected": "Connected",
+ "connector.createTools": "Create tools",
+ "connector.delete": "Delete",
"connector.deleteAccountConfirmContent": "This removes the connector and its authorization from your account. Any agent that uses it will need to be re-authorized afterwards.",
"connector.deleteAgentConfirmContent": "This connector belongs to the agent “{{agent}}”. Deleting it will also remove this tool from that agent.",
+ "connector.deleteConfirm": "Delete this connector?",
+ "connector.deleteTools": "Delete tools",
+ "connector.disconnect": "Disconnect",
+ "connector.edit": "Edit",
+ "connector.edit.success": "Connector updated",
"connector.manageOnlyCreator": "Only the creator or a workspace owner can manage this connector",
+ "connector.noTools": "No tool permissions to configure.",
+ "connector.notConnected": "Not connected",
+ "connector.permission.approvalAll": "Needs approval all",
+ "connector.permission.auto": "Auto — AI calls directly",
+ "connector.permission.autoAll": "Auto all",
+ "connector.permission.custom": "Custom",
+ "connector.permission.disableAll": "Disable all",
+ "connector.permission.disabled": "Disabled — hidden from AI",
+ "connector.permission.needsApproval": "Needs approval",
+ "connector.readOnlyTools": "Read-only tools",
+ "connector.refresh": "Refresh",
+ "connector.resetPermissions": "Reset permissions",
+ "connector.sync": "Sync",
"connector.thisAgent": "this agent",
+ "connector.title": "Connectors",
+ "connector.uninstall": "Uninstall",
+ "connector.uninstallConfirm": "Uninstall this tool?",
+ "connector.updateTools": "Update tools",
"credsInput.approveFailed": "The credential was saved, but the conversation couldn't continue. Please try again.",
"credsInput.notice.lookupFailed": "Couldn't check whether this credential already exists, so it can't be saved safely right now. Skip, or try again later.",
"credsInput.notice.noPermission": "Only workspace admins can save workspace credentials. Skip this request, or ask an admin to add the credential in the workspace settings.",
diff --git a/locales/zh-CN/tool.json b/locales/zh-CN/tool.json
index 4c733bd181b..3da2782f7fb 100644
--- a/locales/zh-CN/tool.json
+++ b/locales/zh-CN/tool.json
@@ -80,11 +80,54 @@
"codeInterpreter.output": "输出:",
"codeInterpreter.returnValue": "返回值:",
"connector.actionFailed": "操作失败,请重试",
+ "connector.add.advanced": "高级设置",
+ "connector.add.authError": "授权失败:{{reason}}",
+ "connector.add.authFailed": "无法连接。该服务器可能需要在高级设置中填写 OAuth Client ID。",
+ "connector.add.cancel": "取消",
+ "connector.add.cancelled": "授权未完成",
+ "connector.add.clientId": "OAuth Client ID(可选)",
+ "connector.add.clientSecret": "OAuth Client Secret(可选)",
+ "connector.add.confirm": "添加",
+ "connector.add.editTitle": "编辑连接器",
+ "connector.add.name": "名称",
+ "connector.add.namePlaceholder": "我的连接器",
+ "connector.add.popupBlocked": "请允许此网站打开弹出窗口后重试。",
+ "connector.add.redirectHint": "需在你的 OAuth 应用中登记的回调地址(Redirect URI):",
+ "connector.add.success": "连接器已连接",
+ "connector.add.syncFailed": "已完成授权,但工具同步失败。请点击「同步」重试。",
"connector.add.title": "添加自定义连接器",
+ "connector.add.unknownError": "未知错误",
+ "connector.add.update": "保存",
+ "connector.add.url": "远程 MCP 服务器地址",
+ "connector.connected": "已连接",
+ "connector.createTools": "创建类工具",
+ "connector.delete": "删除",
"connector.deleteAccountConfirmContent": "此操作会移除该连接器及其在你账号下的授权。之后任何使用它的助理都需要重新授权。",
"connector.deleteAgentConfirmContent": "该连接器归属于助理「{{agent}}」。删除它会同时把这个工具从该助理中移除。",
+ "connector.deleteConfirm": "确定删除此连接器?",
+ "connector.deleteTools": "删除类工具",
+ "connector.disconnect": "断开连接",
+ "connector.edit": "编辑",
+ "connector.edit.success": "连接器已更新",
"connector.manageOnlyCreator": "仅创建者或工作区 Owner 可以管理此连接器",
+ "connector.noTools": "暂无可配置权限的工具。",
+ "connector.notConnected": "未连接",
+ "connector.permission.approvalAll": "全部需审批",
+ "connector.permission.auto": "自动:AI 直接调用",
+ "connector.permission.autoAll": "全部自动",
+ "connector.permission.custom": "自定义",
+ "connector.permission.disableAll": "全部禁用",
+ "connector.permission.disabled": "禁用:对 AI 隐藏",
+ "connector.permission.needsApproval": "需要审批",
+ "connector.readOnlyTools": "只读工具",
+ "connector.refresh": "刷新",
+ "connector.resetPermissions": "重置权限",
+ "connector.sync": "同步",
"connector.thisAgent": "该助理",
+ "connector.title": "连接器",
+ "connector.uninstall": "卸载",
+ "connector.uninstallConfirm": "确定卸载此工具?",
+ "connector.updateTools": "更新类工具",
"credsInput.approveFailed": "凭据已保存,但对话没能继续。请重试。",
"credsInput.notice.lookupFailed": "无法确认这个凭据是否已存在,暂时不能安全保存。你可以跳过,或稍后再试。",
"credsInput.notice.noPermission": "只有工作区管理员可以保存工作区凭据。你可以跳过,或请管理员在工作区设置中添加这个凭据。",
diff --git a/packages/locales/src/default/tool.ts b/packages/locales/src/default/tool.ts
index 07292f0591f..68ec5b08d23 100644
--- a/packages/locales/src/default/tool.ts
+++ b/packages/locales/src/default/tool.ts
@@ -87,13 +87,57 @@ export default {
'codeInterpreter.output': 'Output:',
'codeInterpreter.returnValue': 'Return Value:',
'connector.actionFailed': 'Operation failed, please try again',
+ 'connector.add.advanced': 'Advanced settings',
+ 'connector.add.authError': 'Authorization failed: {{reason}}',
+ 'connector.add.authFailed':
+ 'Could not connect. This server may require an OAuth Client ID in Advanced settings.',
+ 'connector.add.cancel': 'Cancel',
+ 'connector.add.cancelled': 'Authorization was not completed',
+ 'connector.add.clientId': 'OAuth Client ID (optional)',
+ 'connector.add.clientSecret': 'OAuth Client Secret (optional)',
+ 'connector.add.confirm': 'Add',
+ 'connector.add.editTitle': 'Edit Connector',
+ 'connector.add.name': 'Name',
+ 'connector.add.namePlaceholder': 'My connector',
+ 'connector.add.popupBlocked': 'Please allow popups for this site and try again.',
+ 'connector.add.redirectHint': 'Redirect URI to register with your OAuth app:',
+ 'connector.add.success': 'Connector connected',
+ 'connector.add.syncFailed': 'Authorized, but tools could not be synced. Click Sync to retry.',
'connector.add.title': 'Add Custom Connector',
+ 'connector.add.unknownError': 'unknown error',
+ 'connector.add.update': 'Save',
+ 'connector.add.url': 'Remote MCP server URL',
+ 'connector.connected': 'Connected',
+ 'connector.createTools': 'Create tools',
+ 'connector.delete': 'Delete',
'connector.deleteAccountConfirmContent':
'This removes the connector and its authorization from your account. Any agent that uses it will need to be re-authorized afterwards.',
'connector.deleteAgentConfirmContent':
'This connector belongs to the agent “{{agent}}”. Deleting it will also remove this tool from that agent.',
+ 'connector.deleteConfirm': 'Delete this connector?',
+ 'connector.deleteTools': 'Delete tools',
+ 'connector.disconnect': 'Disconnect',
+ 'connector.edit': 'Edit',
+ 'connector.edit.success': 'Connector updated',
'connector.manageOnlyCreator': 'Only the creator or a workspace owner can manage this connector',
+ 'connector.noTools': 'No tool permissions to configure.',
+ 'connector.notConnected': 'Not connected',
+ 'connector.permission.approvalAll': 'Needs approval all',
+ 'connector.permission.auto': 'Auto — AI calls directly',
+ 'connector.permission.autoAll': 'Auto all',
+ 'connector.permission.custom': 'Custom',
+ 'connector.permission.disableAll': 'Disable all',
+ 'connector.permission.disabled': 'Disabled — hidden from AI',
+ 'connector.permission.needsApproval': 'Needs approval',
+ 'connector.readOnlyTools': 'Read-only tools',
+ 'connector.refresh': 'Refresh',
+ 'connector.resetPermissions': 'Reset permissions',
+ 'connector.sync': 'Sync',
'connector.thisAgent': 'this agent',
+ 'connector.title': 'Connectors',
+ 'connector.uninstall': 'Uninstall',
+ 'connector.uninstallConfirm': 'Uninstall this tool?',
+ 'connector.updateTools': 'Update tools',
'credsInput.approveFailed':
"The credential was saved, but the conversation couldn't continue. Please try again.",
'credsInput.notice.lookupFailed':
diff --git a/src/features/Connectors/ConnectorDetail/ToolPermissionRow.tsx b/src/features/Connectors/ConnectorDetail/ToolPermissionRow.tsx
index 24cca55cb3e..da34f686130 100644
--- a/src/features/Connectors/ConnectorDetail/ToolPermissionRow.tsx
+++ b/src/features/Connectors/ConnectorDetail/ToolPermissionRow.tsx
@@ -2,6 +2,7 @@ import { Tooltip } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { BanIcon, CheckIcon, HandIcon } from 'lucide-react';
import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
import { ConnectorToolPermission } from '@/database/schemas';
import type { ConnectorTool } from '@/store/tool/slices/connector';
@@ -88,6 +89,7 @@ interface ToolPermissionRowProps {
}
const ToolPermissionRow = memo<ToolPermissionRowProps>(({ disabled, tool, onPermissionChange }) => {
+ const { t } = useTranslation('tool');
const btnClass = (permission: ConnectorToolPermission) =>
tool.permission === permission ? `${styles.btn} ${styles.btnActive}` : styles.btn;
@@ -117,7 +119,7 @@ const ToolPermissionRow = memo<ToolPermissionRowProps>(({ disabled, tool, onPerm
<div
className={btnClass(ConnectorToolPermission.auto)}
style={disabled ? { pointerEvents: 'none' } : undefined}
- title="Auto — AI calls directly"
+ title={t('connector.permission.auto')}
onClick={() => handleChange(ConnectorToolPermission.auto)}
>
<CheckIcon size={15} />
@@ -125,7 +127,7 @@ const ToolPermissionRow = memo<ToolPermissionRowProps>(({ disabled, tool, onPerm
<div
className={btnClass(ConnectorToolPermission.needs_approval)}
style={disabled ? { pointerEvents: 'none' } : undefined}
- title="Needs approval"
+ title={t('connector.permission.needsApproval')}
onClick={() => handleChange(ConnectorToolPermission.needs_approval)}
>
<HandIcon size={15} />
@@ -133,7 +135,7 @@ const ToolPermissionRow = memo<ToolPermissionRowProps>(({ disabled, tool, onPerm
<div
className={btnClass(ConnectorToolPermission.disabled)}
style={disabled ? { pointerEvents: 'none' } : undefined}
- title="Disabled — hidden from AI"
+ title={t('connector.permission.disabled')}
onClick={() => handleChange(ConnectorToolPermission.disabled)}
>
<BanIcon size={15} />
diff --git a/src/features/Connectors/i18nKeys.test.ts b/src/features/Connectors/i18nKeys.test.ts
new file mode 100644
index 00000000000..e40a2f3525f
--- /dev/null
+++ b/src/features/Connectors/i18nKeys.test.ts
@@ -0,0 +1,45 @@
+import { readdirSync, readFileSync } from 'node:fs';
+import path from 'node:path';
+
+import { describe, expect, it } from 'vitest';
+
+import tool from '@/locales/default/tool';
+
+import zhCN from '../../../locales/zh-CN/tool.json';
+
+const collectSourceFiles = (dir: string): string[] =>
+ readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
+ const fullPath = path.join(dir, entry.name);
+ if (entry.isDirectory()) return collectSourceFiles(fullPath);
+ if (!/\.tsx?$/.test(entry.name) || /\.test\.tsx?$/.test(entry.name)) return [];
+ return [fullPath];
+ });
+
+/**
+ * Connector UI calls `t('connector.*', 'English default')` in the `tool` namespace. The inline
+ * default hides a missing locale key, so non-English users silently see English text.
+ */
+const collectConnectorKeys = () => {
+ const keys = new Set<string>();
+ for (const file of collectSourceFiles(__dirname)) {
+ const source = readFileSync(file, 'utf8');
+ for (const match of source.matchAll(/\bt\(\s*'(connector\.[\w.]+)'/g)) keys.add(match[1]);
+ }
+ return [...keys].sort();
+};
+
+describe('Connectors i18n keys', () => {
+ const keys = collectConnectorKeys();
+
+ it('finds connector keys in the feature source', () => {
+ expect(keys.length).toBeGreaterThan(0);
+ });
+
+ it('defines every connector key in the default tool locale', () => {
+ expect(keys.filter((key) => !(key in tool))).toEqual([]);
+ });
+
+ it('ships every connector key in the zh-CN tool locale', () => {
+ expect(keys.filter((key) => !(key in zhCN))).toEqual([]);
+ });
+});