🤯 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 GenerationItem (#12745)
LobeHub Botc1757e2e192d
diff --git a/src/routes/(main)/image/features/GenerationFeed/GenerationItem/ActionButtons.tsx b/src/routes/(main)/image/features/GenerationFeed/GenerationItem/ActionButtons.tsxindex dee82c9dc77..83db2fb1b03 100644--- a/src/routes/(main)/image/features/GenerationFeed/GenerationItem/ActionButtons.tsx+++ b/src/routes/(main)/image/features/GenerationFeed/GenerationItem/ActionButtons.tsx@@ -12,7 +12,7 @@ import { type ActionButtonsProps } from './types';const actionIconProps: Partial<Omit<ActionIconProps, 'size' | 'ref' | 'icon'>> = {tooltipProps: { placement: 'left' },};-// 操作按钮组件+// Action buttons componentexport const ActionButtons = memo<ActionButtonsProps>(({onDelete,diff --git a/src/routes/(main)/image/features/GenerationFeed/GenerationItem/ElapsedTime.tsx b/src/routes/(main)/image/features/GenerationFeed/GenerationItem/ElapsedTime.tsxindex 16b2669d050..746899cbd44 100644--- a/src/routes/(main)/image/features/GenerationFeed/GenerationItem/ElapsedTime.tsx+++ b/src/routes/(main)/image/features/GenerationFeed/GenerationItem/ElapsedTime.tsx@@ -11,10 +11,10 @@ interface ElapsedTimeProps {const getSessionStorageKey = (generationId: string) => `generation_start_time_${generationId}`;/**- * 显示图片生成的耗时- * - 少于1分钟:显示秒数,精度0.1秒- * - 1分钟或以上:显示分钟数,精度1位小数- * - 使用 sessionStorage 在页面刷新时保持准确计时+ * Display elapsed time for image generation+ * - Less than 1 minute: show seconds with 0.1s precision+ * - 1 minute or more: show minutes with 1 decimal precision+ * - Uses sessionStorage to maintain accurate timing across page refreshes*/export function ElapsedTime({ generationId, isActive }: ElapsedTimeProps) {const [elapsedTime, setElapsedTime] = useState<number | null>(null);@@ -23,13 +23,13 @@ export function ElapsedTime({ generationId, isActive }: ElapsedTimeProps) {useEffect(() => {if (!isActive) {- // 如果不是活跃状态,清理计时器并重置时间+ // If not active, clear the timer and reset elapsed timeif (frameRef.current) {cancelAnimationFrame(frameRef.current);frameRef.current = null;}- // 清理 sessionStorage 中的数据+ // Clear data from sessionStorageconst storageKey = getSessionStorageKey(generationId);sessionStorage.removeItem(storageKey);setElapsedTime(null);@@ -38,7 +38,7 @@ export function ElapsedTime({ generationId, isActive }: ElapsedTimeProps) {const storageKey = getSessionStorageKey(generationId);- // 只在组件挂载时设置开始时间+ // Only set start time when the component mountsconst clientStartTime = (() => {const stored = sessionStorage.getItem(storageKey);if (stored) return Number(stored);@@ -66,18 +66,18 @@ export function ElapsedTime({ generationId, isActive }: ElapsedTimeProps) {};}, [generationId, isActive]);- // 格式化耗时显示+ // Format elapsed time displayconst formattedTime = (() => {if (elapsedTime === null) return '';const totalSeconds = elapsedTime / 10;- // 少于60秒,显示秒数,精度0.1秒+ // Less than 60 seconds: show seconds with 0.1s precisionif (totalSeconds < 60) {return `${totalSeconds.toFixed(1)}s`;}- // 60秒或以上,显示分钟数,精度1位小数+ // 60 seconds or more: show minutes with 1 decimal precisionconst minutes = totalSeconds / 60;return `${minutes.toFixed(1)}min`;})();diff --git a/src/routes/(main)/image/features/GenerationFeed/GenerationItem/ErrorState.tsx b/src/routes/(main)/image/features/GenerationFeed/GenerationItem/ErrorState.tsxindex 5e4e43cb628..9162a1d14fc 100644--- a/src/routes/(main)/image/features/GenerationFeed/GenerationItem/ErrorState.tsx+++ b/src/routes/(main)/image/features/GenerationFeed/GenerationItem/ErrorState.tsx@@ -12,7 +12,7 @@ import { styles } from './styles';import { type ErrorStateProps } from './types';import { getThumbnailMaxWidth } from './utils';-// 错误状态组件+// Error state componentexport const ErrorState = memo<ErrorStateProps>(({ generation, generationBatch, aspectRatio, onDelete, onCopyError }) => {const { t } = useTranslation('image');diff --git a/src/routes/(main)/image/features/GenerationFeed/GenerationItem/LoadingState.tsx b/src/routes/(main)/image/features/GenerationFeed/GenerationItem/LoadingState.tsxindex 455019a5942..457479cdc8f 100644--- a/src/routes/(main)/image/features/GenerationFeed/GenerationItem/LoadingState.tsx+++ b/src/routes/(main)/image/features/GenerationFeed/GenerationItem/LoadingState.tsx@@ -13,7 +13,7 @@ import { styles } from './styles';import { type LoadingStateProps } from './types';import { getThumbnailMaxWidth } from './utils';-// 加载状态组件+// Loading state componentexport const LoadingState = memo<LoadingStateProps>(({ generation, generationBatch, aspectRatio, onDelete }) => {const isGenerating =diff --git a/src/routes/(main)/image/features/GenerationFeed/GenerationItem/SuccessState.tsx b/src/routes/(main)/image/features/GenerationFeed/GenerationItem/SuccessState.tsxindex 89a260f3e6a..9fdc0b82d8d 100644--- a/src/routes/(main)/image/features/GenerationFeed/GenerationItem/SuccessState.tsx+++ b/src/routes/(main)/image/features/GenerationFeed/GenerationItem/SuccessState.tsx@@ -10,7 +10,7 @@ import { styles } from './styles';import { type SuccessStateProps } from './types';import { getThumbnailMaxWidth } from './utils';-// 成功状态组件+// Success state componentexport const SuccessState = memo<SuccessStateProps>(({generation,diff --git a/src/routes/(main)/image/features/GenerationFeed/GenerationItem/index.tsx b/src/routes/(main)/image/features/GenerationFeed/GenerationItem/index.tsxindex 2f179998686..f8ed9f43a9b 100644--- a/src/routes/(main)/image/features/GenerationFeed/GenerationItem/index.tsx+++ b/src/routes/(main)/image/features/GenerationFeed/GenerationItem/index.tsx@@ -39,7 +39,7 @@ export const GenerationItem = memo<GenerationItemProps>(const aspectRatio = getAspectRatio(generation, generationBatch);- // 事件处理函数+ // Event handler functionsconst handleDeleteGeneration = useCallback(async () => {try {await deleteGeneration(generation.id);@@ -104,7 +104,7 @@ export const GenerationItem = memo<GenerationItemProps>(}}, [generation.task.error, message, t]);- // 根据状态渲染对应组件+ // Render corresponding component based on statusif (generation.task.status === AsyncTaskStatus.Success && generation.asset?.url) {const seedTooltip = isSupportSeed? t('generation.actions.applySeed')@@ -136,7 +136,7 @@ export const GenerationItem = memo<GenerationItemProps>();}- // Loading state (Processing 或 Pending)+ // Loading state (Processing or Pending)return (<LoadingStateaspectRatio={aspectRatio}diff --git a/src/routes/(main)/image/features/GenerationFeed/GenerationItem/styles.ts b/src/routes/(main)/image/features/GenerationFeed/GenerationItem/styles.tsindex d9e93a42866..5f68e389ff3 100644--- a/src/routes/(main)/image/features/GenerationFeed/GenerationItem/styles.ts+++ b/src/routes/(main)/image/features/GenerationFeed/GenerationItem/styles.ts@@ -1,7 +1,7 @@import { createStaticStyles, cx } from 'antd-style';export const styles = createStaticStyles(({ css, cssVar }) => ({- // 图片操作按钮的公共样式+ // Common styles for image action buttonsgenerationActionButton: cx('generation-actions',css`