🤯 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.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
🌐 chore: translate non-English comments to English in ProfileEditor and related features (#13048)
LobeHub Bot91ec7b412b9e
diff --git a/src/features/AvatarWithUpload/index.tsx b/src/features/AvatarWithUpload/index.tsxindex 0ccf93f6a36..fc13980d01f 100644--- a/src/features/AvatarWithUpload/index.tsx+++ b/src/features/AvatarWithUpload/index.tsx@@ -25,20 +25,20 @@ const AvatarWithUpload = memo<AvatarWithUploadProps>(createUploadImageHandler(async (avatar) => {try {setUploading(true);- // 准备图像+ // Prepare imageconst img = new Image();img.src = avatar;- // 使用 Promise 等待图片加载+ // Use Promise to wait for image loadawait new Promise((resolve, reject) => {img.addEventListener('load', resolve);img.addEventListener('error', reject);});- // 压缩图像+ // Compress imageconst webpBase64 = imageToBase64({ img, size: compressSize });- // 上传头像+ // Upload avatarawait updateAvatar(webpBase64);setUploading(false);diff --git a/src/features/Conversation/Messages/GroupTasks/index.tsx b/src/features/Conversation/Messages/GroupTasks/index.tsxindex 437363eaa9c..c16aa8f8eb9 100644--- a/src/features/Conversation/Messages/GroupTasks/index.tsx+++ b/src/features/Conversation/Messages/GroupTasks/index.tsx@@ -91,7 +91,7 @@ const GroupTasksMessage = memo<GroupTasksMessageProps>(({ id, index }) => {.filter(Boolean) as { avatar?: string; background?: string; title?: string }[];}, isEqual);- // Build title: "Agent1 / Agent2 等 N 个 agents tasks" (show max 2 agents)+ // Build title: "Agent1 / Agent2 and N more agents tasks" (show max 2 agents)const title = useMemo(() => {const agentNames = taskAgents.map((a) => a.title).filter(Boolean);if (agentNames.length === 0) return '';@@ -108,7 +108,7 @@ const GroupTasksMessage = memo<GroupTasksMessageProps>(({ id, index }) => {});}- // Show "Agent1 / Agent2 等 X 个 agents tasks" when more than 2+ // Show "Agent1 / Agent2 and X more agents tasks" when more than 2return t('task.groupTasksTitle', {agents: displayedAgents,count: totalAgents,diff --git a/src/features/DevPanel/features/FloatPanel.tsx b/src/features/DevPanel/features/FloatPanel.tsxindex 5236cde2a80..1ae54a1fdf0 100644--- a/src/features/DevPanel/features/FloatPanel.tsx+++ b/src/features/DevPanel/features/FloatPanel.tsx@@ -10,7 +10,7 @@ import { Rnd } from 'react-rnd';import { isDesktop } from '@/const/version';import { usePathname } from '@/libs/next/navigation';-// 定义样式+// Define stylesconst styles = createStaticStyles(({ css }) => {return {collapsed: css`@@ -108,7 +108,7 @@ const CollapsibleFloatPanel = memo<CollapsibleFloatPanelProps>(({ items }) => {return (<>{- // desktop devtools 下隐藏+ // Hide under desktop devtoolspathname !== '/desktop/devtools' && isDesktop && (<divclassName={styles.debugButton}diff --git a/src/features/DevPanel/features/Table/TableCell.tsx b/src/features/DevPanel/features/Table/TableCell.tsxindex 4c4eee41096..8f89c5dccfa 100644--- a/src/features/DevPanel/features/Table/TableCell.tsx+++ b/src/features/DevPanel/features/Table/TableCell.tsx@@ -30,7 +30,7 @@ const TableCell = ({ dataItem, column }: TableCellProps) => {return (<td key={column}>- {/* 不能使用 antd 的 Text, 会有大量的重渲染导致滚动极其卡顿 */}+ {/* Cannot use antd's Text component — it causes excessive re-renders that make scrolling extremely sluggish */}{content}</td>);diff --git a/src/features/EditorCanvas/DocumentIdMode.tsx b/src/features/EditorCanvas/DocumentIdMode.tsxindex 1698d0b4f86..436c3c28f22 100644--- a/src/features/EditorCanvas/DocumentIdMode.tsx+++ b/src/features/EditorCanvas/DocumentIdMode.tsx@@ -114,13 +114,13 @@ const DocumentIdMode = memo<DocumentIdModeProps>(const contentChangeLockRef = useRef(false);const initRunIdRef = useRef(0);- // 追踪已经为哪个 documentId 调用过 onEditorInit+ // Track which documentId has already had onEditorInit calledconst initializedDocIdRef = useRef<string | null>(null);- // 关键修复:如果 editor 已经初始化,需要主动调用 onEditorInit- // 因为 onInit 回调只在 editor 首次初始化时触发+ // Critical fix: if the editor is already initialized, we need to manually call onEditorInit+ // because the onInit callback only fires on the first editor initializationuseEffect(() => {- // 避免重复调用:只在 documentId 变化且 editor 已初始化时调用+ // Avoid duplicate calls: only invoke when documentId changes and editor is initializedif (editor &&isEditorInitialized &&diff --git a/src/features/OllamaModelDownloader/index.tsx b/src/features/OllamaModelDownloader/index.tsxindex e1536ed363a..002928ed4eb 100644--- a/src/features/OllamaModelDownloader/index.tsx+++ b/src/features/OllamaModelDownloader/index.tsx@@ -32,7 +32,7 @@ const OllamaModelDownloader = memo<OllamaModelDownloaderProps>(return total ? Number(((completed / total) * 100).toFixed(1)) : 0;}, [completed, total]);- // 定义进度回调函数+ // Define progress callback functionconst handleProgress = useCallback((progress: ModelProgressInfo) => {if (progress.completed) setCompleted(progress.completed);if (progress.total) setTotal(progress.total);diff --git a/src/features/PluginTag/PluginStatus.tsx b/src/features/PluginTag/PluginStatus.tsxindex 5522f05b1c4..9357721565b 100644--- a/src/features/PluginTag/PluginStatus.tsx+++ b/src/features/PluginTag/PluginStatus.tsx@@ -53,12 +53,12 @@ const PluginStatus = memo<PluginStatusProps>(({ title, id, deprecated }) => {}, [status]);const tag =- // 拒绝标签+ // Deprecated tagdeprecated ? (<Tag color={'red'} style={{ marginRight: 0 }} variant={'filled'}>{t('list.item.deprecated.title', { ns: 'plugin' })}</Tag>- ) : // 自定义标签+ ) : // Custom tagisCustom ? (<Tag color={'gold'} variant={'filled'}>{t('list.item.local.title', { ns: 'plugin' })}diff --git a/src/features/ProfileEditor/AgentTool.tsx b/src/features/ProfileEditor/AgentTool.tsxindex 6e0b7844dc0..f9c600db236 100644--- a/src/features/ProfileEditor/AgentTool.tsx+++ b/src/features/ProfileEditor/AgentTool.tsx@@ -91,15 +91,15 @@ const AgentTool = memo<AgentToolProps>(chatConfigByIdSelectors.isEnableSearchById(effectiveAgentId),);- // Klavis 相关状态+ // Klavis-related stateconst allKlavisServers = useToolStore(klavisStoreSelectors.getServers, isEqual);const isKlavisEnabledInEnv = useServerConfigStore(serverConfigSelectors.enableKlavis);- // LobeHub Skill 相关状态+ // LobeHub Skill-related stateconst allLobehubSkillServers = useToolStore(lobehubSkillStoreSelectors.getServers, isEqual);const isLobehubSkillEnabled = useServerConfigStore(serverConfigSelectors.enableLobehubSkill);- // Agent Skills 相关状态+ // Agent Skills-related stateconst installedBuiltinSkills = useToolStore(builtinToolSelectors.installedBuiltinSkills,isEqual,@@ -134,10 +134,10 @@ const AgentTool = memo<AgentToolProps>(useFetchAgentSkills(true);useCheckPluginsIsInstalled(plugins);- // 使用 SWR 加载用户的 Klavis 集成(从数据库)+ // Load user's Klavis integrations via SWR (from database)useFetchUserKlavisServers(isKlavisEnabledInEnv);- // 使用 SWR 加载用户的 LobeHub Skill 连接+ // Load user's LobeHub Skill connections via SWRuseFetchLobehubSkillConnections(isLobehubSkillEnabled);// Toggle web browsing via searchMode - use byId action@@ -201,18 +201,18 @@ const AgentTool = memo<AgentToolProps>(}}, [plugins.length]);- // 根据 identifier 获取已连接的服务器+ // Get connected server by identifierconst getServerByName = (identifier: string) => {return allKlavisServers.find((server) => server.identifier === identifier);};- // 获取所有 Klavis 服务器类型的 identifier 集合(用于过滤 builtinList)+ // Get all Klavis server type identifiers (used to filter builtinList)const allKlavisTypeIdentifiers = useMemo(() => new Set(KLAVIS_SERVER_TYPES.map((type) => type.identifier)),[],);- // 获取所有 skill 的 identifier 集合(用于过滤 builtinList)+ // Get all skill identifiers (used to filter builtinList)const allSkillIdentifiers = useMemo(() => {const ids = new Set<string>();for (const s of installedBuiltinSkills) ids.add(s.identifier);@@ -221,8 +221,8 @@ const AgentTool = memo<AgentToolProps>(return ids;}, [installedBuiltinSkills, marketAgentSkills, userAgentSkills]);- // 过滤掉 builtinList 中的 klavis 工具和 skill(它们会单独显示)- // 根据配置,可选地过滤掉 availableInWeb: false 的工具(如 LocalSystem 仅桌面版可用)+ // Filter out Klavis tools and skills from builtinList (they are displayed separately)+ // Optionally filter out tools with availableInWeb: false based on config (e.g., LocalSystem is desktop-only)const filteredBuiltinList = useMemo(() => {// Cast to LobeToolMetaWithAvailability for type safety when filterAvailableInWeb is usedtype ListType = typeof builtinList;@@ -253,7 +253,7 @@ const AgentTool = memo<AgentToolProps>(allSkillIdentifiers,]);- // Klavis 服务器列表项+ // Klavis server list itemsconst klavisServerItems = useMemo(() =>isKlavisEnabledInEnv@@ -274,7 +274,7 @@ const AgentTool = memo<AgentToolProps>([isKlavisEnabledInEnv, allKlavisServers, effectiveAgentId],);- // LobeHub Skill Provider 列表项+ // LobeHub Skill Provider list itemsconst lobehubSkillItems = useMemo(() =>isLobehubSkillEnabled@@ -286,7 +286,7 @@ const AgentTool = memo<AgentToolProps>(size={SKILL_ICON_SIZE}/>),- key: provider.id, // 使用 provider.id 作为 key,与 pluginId 保持一致+ key: provider.id, // Use provider.id as key, consistent with pluginIdlabel: (<LobehubSkillServerItemagentId={effectiveAgentId}@@ -316,7 +316,7 @@ const AgentTool = memo<AgentToolProps>(}};- // Builtin Agent Skills 列表项(归入 LobeHub 分组)+ // Builtin Agent Skills list items (grouped under LobeHub)const builtinAgentSkillItems = useMemo(() =>installedBuiltinSkills.map((skill) => ({@@ -344,7 +344,7 @@ const AgentTool = memo<AgentToolProps>([installedBuiltinSkills, isToolEnabled, handleToggleTool],);- // Market Agent Skills 列表项(归入 Community 分组)+ // Market Agent Skills list items (grouped under Community)const marketAgentSkillItems = useMemo(() =>marketAgentSkills.map((skill) => ({@@ -366,7 +366,7 @@ const AgentTool = memo<AgentToolProps>([marketAgentSkills, isToolEnabled, handleToggleTool],);- // User Agent Skills 列表项(归入 Custom 分组)+ // User Agent Skills list items (grouped under Custom)const userAgentSkillItems = useMemo(() =>userAgentSkills.map((skill) => ({@@ -388,12 +388,12 @@ const AgentTool = memo<AgentToolProps>([userAgentSkills, isToolEnabled, handleToggleTool],);- // 合并 Builtin Agent Skills、builtin 工具、LobeHub Skill Providers 和 Klavis 服务器+ // Merge Builtin Agent Skills, builtin tools, LobeHub Skill Providers, and Klavis serversconst builtinItems = useMemo(() => [// 1. Builtin Agent Skills...builtinAgentSkillItems,- // 2. 原有的 builtin 工具+ // 2. Original builtin tools...filteredBuiltinList.map((item) => ({icon: (<Avatar@@ -418,7 +418,7 @@ const AgentTool = memo<AgentToolProps>(})),// 3. LobeHub Skill Providers...lobehubSkillItems,- // 4. Klavis 服务器+ // 4. Klavis servers...klavisServerItems,],[@@ -431,11 +431,11 @@ const AgentTool = memo<AgentToolProps>(],);- // 区分社区插件和自定义插件+ // Distinguish community plugins from custom pluginsconst communityPlugins = installedPluginList.filter((item) => item.type !== 'customPlugin');const customPlugins = installedPluginList.filter((item) => item.type === 'customPlugin');- // 生成插件列表项的函数+ // Function to generate plugin list itemsconst mapPluginToItem = useCallback((item: (typeof installedPluginList)[0]) => ({icon: item?.avatar ? (@@ -464,34 +464,34 @@ const AgentTool = memo<AgentToolProps>([plugins, togglePlugin],);- // Community 插件列表项+ // Community plugin list itemsconst communityPluginItems = useMemo(() => communityPlugins.map(mapPluginToItem),[communityPlugins, mapPluginToItem],);- // Custom 插件列表项+ // Custom plugin list itemsconst customPluginItems = useMemo(() => customPlugins.map(mapPluginToItem),[customPlugins, mapPluginToItem],);- // Community 分组 children(Market Agent Skills + 社区插件)+ // Community group children (Market Agent Skills + community plugins)const communityGroupChildren = useMemo(() => [...marketAgentSkillItems, ...communityPluginItems],[marketAgentSkillItems, communityPluginItems],);- // Custom 分组 children(User Agent Skills + 自定义插件)+ // Custom group children (User Agent Skills + custom plugins)const customGroupChildren = useMemo(() => [...userAgentSkillItems, ...customPluginItems],[userAgentSkillItems, customPluginItems],);- // All tab items (市场 tab)+ // All tab items (marketplace tab)const allTabItems: ItemType[] = useMemo(() => [- // LobeHub 分组+ // LobeHub group...(builtinItems.length > 0? [{@@ -502,7 +502,7 @@ const AgentTool = memo<AgentToolProps>(},]: []),- // Community 分组(Market Agent Skills + 社区插件)+ // Community group (Market Agent Skills + community plugins)...(communityGroupChildren.length > 0? [{@@ -513,7 +513,7 @@ const AgentTool = memo<AgentToolProps>(},]: []),- // Custom 分组(User Agent Skills + 自定义插件)+ // Custom group (User Agent Skills + custom plugins)...(customGroupChildren.length > 0? [{@@ -528,11 +528,11 @@ const AgentTool = memo<AgentToolProps>([builtinItems, communityGroupChildren, customGroupChildren, t],);- // Installed tab items - 只显示已启用的+ // Installed tab items - only show enabled itemsconst installedTabItems: ItemType[] = useMemo(() => {const items: ItemType[] = [];- // 已启用的 builtin 工具+ // Enabled builtin toolsconst enabledBuiltinItems = filteredBuiltinList.filter((item) => isToolEnabled(item.identifier)).map((item) => ({@@ -558,17 +558,17 @@ const AgentTool = memo<AgentToolProps>(),}));- // 已连接且已启用的 Klavis 服务器+ // Connected and enabled Klavis serversconst connectedKlavisItems = klavisServerItems.filter((item) =>plugins.includes(item.key as string),);- // 已连接的 LobeHub Skill Providers+ // Connected LobeHub Skill Providersconst connectedLobehubSkillItems = lobehubSkillItems.filter((item) =>plugins.includes(item.key as string),);- // 已启用的 Builtin Agent Skills+ // Enabled Builtin Agent Skillsconst enabledBuiltinAgentSkillItems = installedBuiltinSkills.filter((skill) => isToolEnabled(skill.identifier)).map((skill) => ({@@ -594,7 +594,7 @@ const AgentTool = memo<AgentToolProps>(),}));- // LobeHub 分组(Builtin Agent Skills + builtin + LobeHub Skill + Klavis)+ // LobeHub group (Builtin Agent Skills + builtin + LobeHub Skill + Klavis)const lobehubGroupItems = [...enabledBuiltinAgentSkillItems,...enabledBuiltinItems,@@ -611,7 +611,7 @@ const AgentTool = memo<AgentToolProps>(});}- // 已启用的社区插件+ // Enabled community pluginsconst enabledCommunityPlugins = communityPlugins.filter((item) => plugins.includes(item.identifier)).map((item) => ({@@ -635,7 +635,7 @@ const AgentTool = memo<AgentToolProps>(),}));- // 已启用的 Market Agent Skills+ // Enabled Market Agent Skillsconst enabledMarketAgentSkillItems = marketAgentSkills.filter((skill) => isToolEnabled(skill.identifier)).map((skill) => ({@@ -655,7 +655,7 @@ const AgentTool = memo<AgentToolProps>(),}));- // Community 分组(Market Agent Skills + 社区插件)+ // Community group (Market Agent Skills + community plugins)const allCommunityItems = [...enabledMarketAgentSkillItems, ...enabledCommunityPlugins];if (allCommunityItems.length > 0) {items.push({@@ -666,7 +666,7 @@ const AgentTool = memo<AgentToolProps>(});}- // 已启用的自定义插件+ // Enabled custom pluginsconst enabledCustomPlugins = customPlugins.filter((item) => plugins.includes(item.identifier)).map((item) => ({@@ -690,7 +690,7 @@ const AgentTool = memo<AgentToolProps>(),}));- // 已启用的 User Agent Skills+ // Enabled User Agent Skillsconst enabledUserAgentSkillItems = userAgentSkills.filter((skill) => isToolEnabled(skill.identifier)).map((skill) => ({@@ -710,7 +710,7 @@ const AgentTool = memo<AgentToolProps>(),}));- // Custom 分组(User Agent Skills + 自定义插件)+ // Custom group (User Agent Skills + custom plugins)const allCustomItems = [...enabledUserAgentSkillItems, ...enabledCustomPlugins];if (allCustomItems.length > 0) {items.push({diff --git a/src/features/ProfileEditor/PluginTag.tsx b/src/features/ProfileEditor/PluginTag.tsxindex 816bae7a00d..31752a3c662 100644--- a/src/features/ProfileEditor/PluginTag.tsx+++ b/src/features/ProfileEditor/PluginTag.tsx@@ -23,7 +23,7 @@ import {import { type LobeToolMetaWithAvailability } from '@/store/tool/slices/builtin/selectors';/**- * Klavis 服务器图标组件+ * Klavis server icon component*/const KlavisIcon = memo<Pick<KlavisServerType, 'icon' | 'label'>>(({ icon, label }) => {if (typeof icon === 'string') {@@ -34,7 +34,7 @@ const KlavisIcon = memo<Pick<KlavisServerType, 'icon' | 'label'>>(({ icon, label});/**- * LobeHub Skill Provider 图标组件+ * LobeHub Skill Provider icon component*/const LobehubSkillIcon = memo<Pick<LobehubSkillProviderType, 'icon' | 'label'>>(({ icon, label }) => {@@ -106,11 +106,11 @@ const PluginTag = memo<PluginTagProps>();const installedPluginList = useToolStore(pluginSelectors.installedPluginMetaList, isEqual);- // Klavis 相关状态+ // Klavis-related stateconst allKlavisServers = useToolStore(klavisStoreSelectors.getServers, isEqual);const isKlavisEnabledInEnv = useServerConfigStore(serverConfigSelectors.enableKlavis);- // LobeHub Skill 相关状态+ // LobeHub Skill-related stateconst allLobehubSkillServers = useToolStore(lobehubSkillStoreSelectors.getServers, isEqual);const isLobehubSkillEnabled = useServerConfigStore(serverConfigSelectors.enableLobehubSkill);