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.

🌐 chore: translate non-English comments to English in plugindevmodal and image-config (#13169)

LobeHub Bot89a0211adf7a
diff --git a/src/features/PluginDevModal/LocalForm.tsx b/src/features/PluginDevModal/LocalForm.tsx
index b40d04f5bad..a0187a07e6c 100644
--- a/src/features/PluginDevModal/LocalForm.tsx
+++ b/src/features/PluginDevModal/LocalForm.tsx
@@ -29,7 +29,7 @@ const LocalForm = memo<{ form: FormInstance; mode?: 'edit' | 'create' }>(({ form
message: t('dev.meta.identifier.pattenErrorMessage'),
pattern: /^[\w-]+$/,
},
- // 编辑模式下,不进行重复校验
+ // In edit mode, skip duplicate validation
isEditMode
? {}
: {
diff --git a/src/features/PluginDevModal/MCPManifestForm/CollapsibleSection.tsx b/src/features/PluginDevModal/MCPManifestForm/CollapsibleSection.tsx
index ffc8bf06700..8cd1dc2d315 100644
--- a/src/features/PluginDevModal/MCPManifestForm/CollapsibleSection.tsx
+++ b/src/features/PluginDevModal/MCPManifestForm/CollapsibleSection.tsx
@@ -33,11 +33,11 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
}));
interface CollapsibleSectionProps {
- /** 子组件内容 */
+ /** Child component content */
children: ReactNode;
- /** 默认是否展开 */
+ /** Whether expanded by default */
defaultExpanded?: boolean;
- /** 标题文本 */
+ /** Title text */
title: string;
}
diff --git a/src/features/PluginDevModal/MCPManifestForm/index.tsx b/src/features/PluginDevModal/MCPManifestForm/index.tsx
index 958e02cdce3..6782f8cbb61 100644
--- a/src/features/PluginDevModal/MCPManifestForm/index.tsx
+++ b/src/features/PluginDevModal/MCPManifestForm/index.tsx
@@ -28,10 +28,10 @@ const STDIO_ARGS = ['customParams', 'mcp', 'args'];
const STDIO_ENV = ['customParams', 'mcp', 'env'];
const MCP_TYPE = ['customParams', 'mcp', 'type'];
const DESC_TYPE = ['customParams', 'description'];
-// 新增认证相关常量
+// Authentication-related constants
const AUTH_TYPE = ['customParams', 'mcp', 'auth', 'type'];
const AUTH_TOKEN = ['customParams', 'mcp', 'auth', 'token'];
-// 新增 headers 相关常量
+// Headers-related constants
const HEADERS = ['customParams', 'mcp', 'headers'];
const MCPManifestForm = ({ form, isEditMode }: MCPManifestFormProps) => {
@@ -43,7 +43,7 @@ const MCPManifestForm = ({ form, isEditMode }: MCPManifestFormProps) => {
const [isTesting, setIsTesting] = useState(false);
const testMcpConnection = useToolStore((s) => s.testMcpConnection);
- // 使用 identifier 来跟踪测试状态(如果表单中有的话)
+ // Use identifier to track test state (if present in the form)
const formValues = form.getFieldsValue();
const identifier = formValues?.identifier || 'temp-test-id';
const testState = useToolStore(mcpStoreSelectors.getMCPConnectionTestState(identifier), isEqual);
@@ -63,7 +63,7 @@ const MCPManifestForm = ({ form, isEditMode }: MCPManifestFormProps) => {
...(mcpType === 'http' ? [HTTP_URL_KEY] : [STDIO_COMMAND, STDIO_ARGS]),
];
- // 如果是 HTTP 类型,还需要验证认证字段
+ // For HTTP type, also validate authentication fields
if (mcpType === 'http') {
fieldsToValidate.push(AUTH_TYPE);
const currentAuthType = form.getFieldValue(AUTH_TYPE);
@@ -90,7 +90,7 @@ const MCPManifestForm = ({ form, isEditMode }: MCPManifestFormProps) => {
const description = values.customParams?.description;
const avatar = values.customParams?.avatar;
- // 使用 mcpStore 的 testMcpConnection 方法
+ // Use mcpStore's testMcpConnection method
const result = await testMcpConnection({
connection: mcp,
identifier: id,
@@ -101,10 +101,10 @@ const MCPManifestForm = ({ form, isEditMode }: MCPManifestFormProps) => {
// Optionally update form if manifest ID differs or to store the fetched manifest
// Be careful about overwriting user input if not desired
form.setFieldsValue({ manifest: result.manifest });
- setConnectionError(null); // 清除本地错误状态
+ setConnectionError(null); // Clear local error state
setErrorMetadata(null);
} else if (result.error) {
- // Store 已经处理了错误状态,这里可以选择显示额外的用户友好提示
+ // Store has already handled the error state; optionally show additional user-friendly messages here
const errorMessage = t('error.testConnectionFailed', {
error: result.error,
});
@@ -199,7 +199,7 @@ const MCPManifestForm = ({ form, isEditMode }: MCPManifestFormProps) => {
validator: async (_, value) => {
if (!value) return true;
- // 如果不是 URL 就会自动抛出错误
+ // Throws automatically if the value is not a valid URL
new URL(value);
},
},
diff --git a/src/features/PluginDevModal/MCPManifestForm/utils.ts b/src/features/PluginDevModal/MCPManifestForm/utils.ts
index e0f20c90408..f6554db18e6 100644
--- a/src/features/PluginDevModal/MCPManifestForm/utils.ts
+++ b/src/features/PluginDevModal/MCPManifestForm/utils.ts
@@ -2,7 +2,7 @@ import { type LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk';
import { safeParseJSON } from '@/utils/safeParseJSON';
-// (McpConfig, McpServers, ParsedMcpInput 接口定义保持不变)
+// (McpConfig, McpServers, ParsedMcpInput interface definitions remain unchanged)
interface McpConfig {
args?: string[];
command?: string;
@@ -18,7 +18,7 @@ interface ParsedMcpInput {
mcpServers?: McpServers;
}
-// 移除 DuplicateIdentifier
+// Removed DuplicateIdentifier
export enum McpParseErrorCode {
EmptyMcpServers = 'EmptyMcpServers',
InvalidJsonStructure = 'InvalidJsonStructure',
@@ -26,7 +26,7 @@ export enum McpParseErrorCode {
ManifestNotSupported = 'ManifestNotSupported',
}
-// 移除 isDuplicate
+// Removed isDuplicate
interface ParseSuccessResult {
identifier: string;
mcpConfig: McpConfig & { type: 'stdio' | 'http' };
@@ -35,7 +35,7 @@ interface ParseSuccessResult {
interface ParseErrorResult {
errorCode: McpParseErrorCode;
- // identifier 字段仍然可能有用,用于在结构错误时也能显示用户输入的 ID
+ // identifier field may still be useful for displaying the user-input ID when structure errors occur
identifier?: string;
status: 'error';
}
@@ -60,7 +60,7 @@ export const parseMcpInput = (value: string): ParseResult => {
if (mcpKeys.length > 0) {
const identifier = mcpKeys[0];
- // @ts-expect-error type 不一样
+ // @ts-expect-error type mismatch
const mcpConfig = parsedJson.mcpServers[identifier];
if (mcpConfig && typeof mcpConfig === 'object' && !Array.isArray(mcpConfig)) {
diff --git a/src/features/PluginDevModal/UrlManifestForm.tsx b/src/features/PluginDevModal/UrlManifestForm.tsx
index 39d9073a340..421b1ba08d0 100644
--- a/src/features/PluginDevModal/UrlManifestForm.tsx
+++ b/src/features/PluginDevModal/UrlManifestForm.tsx
@@ -89,7 +89,7 @@ const UrlManifestForm = memo<{ form: FormInstance; isEditMode: boolean }>(
}
},
},
- // 编辑模式下,不进行重复校验
+ // In edit mode, skip duplicate validation
isEditMode
? {}
: {
diff --git a/src/routes/(main)/(create)/image/features/ConfigPanel/components/DimensionControlGroup.tsx b/src/routes/(main)/(create)/image/features/ConfigPanel/components/DimensionControlGroup.tsx
index dcc34f836f1..9d07708a77d 100644
--- a/src/routes/(main)/(create)/image/features/ConfigPanel/components/DimensionControlGroup.tsx
+++ b/src/routes/(main)/(create)/image/features/ConfigPanel/components/DimensionControlGroup.tsx
@@ -34,7 +34,7 @@ const DimensionControlGroup = memo(() => {
options,
} = useDimensionControl();
- // 构建宽高比选择器的选项
+ // Build aspect ratio selector options
const aspectRatioOptions = useMemo(
() =>
options.map((ratio) => ({
@@ -50,7 +50,7 @@ const DimensionControlGroup = memo(() => {
return (
<Flexbox gap={16}>
- {/* 宽高比选择器 */}
+ {/* Aspect ratio selector */}
<Flexbox gap={8}>
<Flexbox horizontal align="center" distribution="space-between">
<span style={styles.label}>{t('config.aspectRatio.label')}</span>
@@ -70,7 +70,7 @@ const DimensionControlGroup = memo(() => {
/>
</Flexbox>
- {/* 宽度滑块 */}
+ {/* Width slider */}
{widthSchema && (
<Flexbox gap={8}>
<span style={styles.label}>{t('config.width.label')}</span>
@@ -83,7 +83,7 @@ const DimensionControlGroup = memo(() => {
</Flexbox>
)}
- {/* 高度滑块 */}
+ {/* Height slider */}
{heightSchema && (
<Flexbox gap={8}>
<span style={styles.label}>{t('config.height.label')}</span>
diff --git a/src/routes/(main)/(create)/image/features/ConfigPanel/components/ImageUpload.tsx b/src/routes/(main)/(create)/image/features/ConfigPanel/components/ImageUpload.tsx
index 6424ca55927..32ca1446824 100644
--- a/src/routes/(main)/(create)/image/features/ConfigPanel/components/ImageUpload.tsx
+++ b/src/routes/(main)/(create)/image/features/ConfigPanel/components/ImageUpload.tsx
@@ -213,7 +213,7 @@ const isLocalBlobUrl = (url: string): boolean => url.startsWith('blob:');
// ======== Sub-Components ======== //
/**
- * 圆形进度条组件 (复用自 MultiImagesUpload)
+ * Circular progress bar component (reused from MultiImagesUpload)
*/
interface CircularProgressProps {
showText?: boolean; // 0-100
@@ -303,7 +303,7 @@ const CircularProgress: FC<CircularProgressProps> = memo(
CircularProgress.displayName = 'CircularProgress';
/**
- * 占位视图组件
+ * Placeholder view component
*/
interface PlaceholderProps {
height?: number;
@@ -340,7 +340,7 @@ const Placeholder: FC<PlaceholderProps> = memo(({ isDragOver, onClick, height })
Placeholder.displayName = 'Placeholder';
/**
- * 上传中视图组件
+ * Uploading view component
*/
interface UploadingDisplayProps {
previewUrl: string;
@@ -367,7 +367,7 @@ const UploadingDisplay: FC<UploadingDisplayProps> = memo(({ previewUrl, progress
UploadingDisplay.displayName = 'UploadingDisplay';
/**
- * 成功视图组件
+ * Success view component
*/
interface SuccessDisplayProps {
imageUrl: string;
diff --git a/src/routes/(main)/(create)/image/features/ConfigPanel/components/MultiImagesUpload/ImageManageModal.tsx b/src/routes/(main)/(create)/image/features/ConfigPanel/components/MultiImagesUpload/ImageManageModal.tsx
index 9918e34cf12..12aa04c4ccb 100644
--- a/src/routes/(main)/(create)/image/features/ConfigPanel/components/MultiImagesUpload/ImageManageModal.tsx
+++ b/src/routes/(main)/(create)/image/features/ConfigPanel/components/MultiImagesUpload/ImageManageModal.tsx
@@ -335,14 +335,14 @@ const ImageManageModal: FC<ImageManageModalProps> = memo(
style={{ objectFit: 'cover' }}
/>
- {/* 新文件标识 */}
+ {/* New file indicator */}
{isNewFile && (
<div className={styles.newFileIndicator}>
{t('MultiImagesUpload.modal.newFileIndicator')}
</div>
)}
- {/* 删除按钮 */}
+ {/* Delete button */}
<div
className={cx(styles.thumbnailDelete, 'thumbnail-delete')}
onClick={(e) => handleThumbnailDelete(index, e)}
diff --git a/src/routes/(main)/(create)/image/features/ConfigPanel/components/MultiImagesUpload/index.tsx b/src/routes/(main)/(create)/image/features/ConfigPanel/components/MultiImagesUpload/index.tsx
index 5d265a20182..c5f6817f6be 100644
--- a/src/routes/(main)/(create)/image/features/ConfigPanel/components/MultiImagesUpload/index.tsx
+++ b/src/routes/(main)/(create)/image/features/ConfigPanel/components/MultiImagesUpload/index.tsx
@@ -423,10 +423,10 @@ const ImageUploadProgress: FC<ImageUploadProgressProps> = memo(
return (
<Center className={styles.progress} gap={16} horizontal={false}>
- {/* 圆形进度条 */}
+ {/* Circular progress bar */}
<CircularProgress size={60} strokeWidth={6} value={currentProgress} />
- {/* 进度文本 */}
+ {/* Progress text */}
<div className={styles.progressText}>
{showCount ? (
<div className={styles.progressPrimary}>
diff --git a/src/routes/(main)/agent/features/Conversation/ChatHydration/index.tsx b/src/routes/(main)/agent/features/Conversation/ChatHydration/index.tsx
index 000986714cf..002e1b4cc94 100644
--- a/src/routes/(main)/agent/features/Conversation/ChatHydration/index.tsx
+++ b/src/routes/(main)/agent/features/Conversation/ChatHydration/index.tsx
@@ -34,7 +34,7 @@ const ChatHydration = memo(() => {
unsubscribeTopic();
unsubscribeThread();
};
- }, [setTopic, setThread]); // ✅ 现在 setValue 是稳定的,可以安全地添加到依赖数组
+ }, [setTopic, setThread]); // ✅ Now setValue is stable and can be safely added to the dependency array
return null;
});
diff --git a/src/routes/(main)/group/features/Conversation/ChatHydration/index.tsx b/src/routes/(main)/group/features/Conversation/ChatHydration/index.tsx
index 000986714cf..002e1b4cc94 100644
--- a/src/routes/(main)/group/features/Conversation/ChatHydration/index.tsx
+++ b/src/routes/(main)/group/features/Conversation/ChatHydration/index.tsx
@@ -34,7 +34,7 @@ const ChatHydration = memo(() => {
unsubscribeTopic();
unsubscribeThread();
};
- }, [setTopic, setThread]); // ✅ 现在 setValue 是稳定的,可以安全地添加到依赖数组
+ }, [setTopic, setThread]); // ✅ Now setValue is stable and can be safely added to the dependency array
return null;
});