From 7e650d86a538e396689ddff88d49a824d891c55e Mon Sep 17 00:00:00 2001 From: zhaoying Date: Wed, 4 Feb 2026 10:27:27 +0800 Subject: [PATCH] style(web): translate the comments in the src/views directory into English --- web/src/i18n/en.ts | 1 + web/src/i18n/zh.ts | 1 + .../components/ApiKeyDetailModal.tsx | 3 +- .../components/ApiKeyModal.tsx | 5 +- web/src/views/ApplicationConfig/Agent.tsx | 6 +- web/src/views/ApplicationConfig/Api.tsx | 4 +- .../views/ApplicationConfig/ReleasePage.tsx | 2 +- .../components/Editor/index.tsx | 2 +- .../VariableList/VariableEditModal.tsx | 20 +- .../ForgettingEngine/components/LineChart.tsx | 5 +- web/src/views/InviteRegister/index.tsx | 6 +- .../components/Result.tsx | 42 +- .../views/MemoryExtractionEngine/constant.ts | 915 +----------------- .../components/OntologyClassExtractModal.tsx | 3 - .../components/OntologyClassModal.tsx | 3 - .../Ontology/components/OntologyModal.tsx | 3 - web/src/views/OrderPayment/index.tsx | 24 +- web/src/views/Prompt/Prompt.tsx | 2 +- web/src/views/SelfReflectionEngine/index.tsx | 14 +- web/src/views/UserMemoryDetail/Rag.tsx | 6 +- .../components/EmotionTags.tsx | 3 +- .../components/NodeStatistics.tsx | 2 +- .../components/RelationshipNetwork.tsx | 36 +- .../UserMemoryDetail/components/WordCloud.tsx | 2 +- 24 files changed, 115 insertions(+), 995 deletions(-) diff --git a/web/src/i18n/en.ts b/web/src/i18n/en.ts index 03d68016..8a5f1f38 100644 --- a/web/src/i18n/en.ts +++ b/web/src/i18n/en.ts @@ -2153,6 +2153,7 @@ Memory Bear: After the rebellion, regional warlordism intensified for several re resilience: 'Resilience', suggestions: 'Personalized Suggestions', suggestionLoading: 'Your personalized suggestions are being generated', + item: 'item', }, reflectionEngine: { reflectionEngineConfig: 'Reflection Engine Configuration', diff --git a/web/src/i18n/zh.ts b/web/src/i18n/zh.ts index 30d9481b..d44aff70 100644 --- a/web/src/i18n/zh.ts +++ b/web/src/i18n/zh.ts @@ -2242,6 +2242,7 @@ export const zh = { resilience: '恢复力', suggestions: '个性化建议', suggestionLoading: '您的个性化建议正在生成中', + item: '个', }, reflectionEngine: { reflectionEngineConfig: '反思引擎配置', diff --git a/web/src/views/ApiKeyManagement/components/ApiKeyDetailModal.tsx b/web/src/views/ApiKeyManagement/components/ApiKeyDetailModal.tsx index 1126af4f..f9e1df51 100644 --- a/web/src/views/ApiKeyManagement/components/ApiKeyDetailModal.tsx +++ b/web/src/views/ApiKeyManagement/components/ApiKeyDetailModal.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-02-03 15:52:44 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-02-03 15:54:22 + * @Last Modified time: 2026-02-04 10:00:02 */ import { forwardRef, useImperativeHandle, useState } from 'react'; import { Switch, Button, Tooltip } from 'antd'; @@ -106,7 +106,6 @@ const ApiKeyDetailModal = forwardRef - {/* 高级设置 */} {data.expires_at && <>
{t('apiKey.advancedSettings')}
diff --git a/web/src/views/ApiKeyManagement/components/ApiKeyModal.tsx b/web/src/views/ApiKeyManagement/components/ApiKeyModal.tsx index 9b7bd5f8..9395df43 100644 --- a/web/src/views/ApiKeyManagement/components/ApiKeyModal.tsx +++ b/web/src/views/ApiKeyManagement/components/ApiKeyModal.tsx @@ -1,8 +1,8 @@ /* * @Author: ZhaoYing * @Date: 2026-02-03 15:52:47 - * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-02-03 15:52:47 + * @Last Modified by: ZhaoYing + * @Last Modified time: 2026-02-04 10:00:01 */ import { forwardRef, useImperativeHandle, useState } from 'react'; import { Form, Input, Switch, App, DatePicker } from 'antd'; @@ -162,7 +162,6 @@ const ApiKeyModal = forwardRef(({ - {/* 高级设置 */}
{t('apiKey.advancedSettings')}
((_props, ref) => { const { memory, knowledge_retrieval, tools, ...rest } = values const { knowledge_bases = [], ...knowledgeRest } = knowledge_retrieval || {} const { memory_content } = memory || {} - // 从原数据中获取memory的其他必要属性 + // Get other necessary properties of memory from original data const originalMemory = data.memory || ({} as MemoryConfig) const params: Config = { @@ -425,7 +425,7 @@ const Agent = forwardRef((_props, ref) => { - {/* 记忆配置 */} + {/* Memory Configuration */} @@ -442,7 +442,7 @@ const Agent = forwardRef((_props, ref) => { - {/* 工具配置 */} + {/* Tool Configuration */} diff --git a/web/src/views/ApplicationConfig/Api.tsx b/web/src/views/ApplicationConfig/Api.tsx index 5623f3d0..c4b0fefb 100644 --- a/web/src/views/ApplicationConfig/Api.tsx +++ b/web/src/views/ApplicationConfig/Api.tsx @@ -162,7 +162,7 @@ const Api: FC<{ application: Application | null }> = ({ application }) => { } >
{t('application.apiKeySubTitle')}
- {/* 总览数据 */} + {/* Overview Data */} @@ -171,7 +171,7 @@ const Api: FC<{ application: Application | null }> = ({ application }) => { - {/* API Key 列表 */} + {/* API Key List */} {apiKeyList.sort((a, b) => b.created_at - a.created_at).map(item => (
diff --git a/web/src/views/ApplicationConfig/ReleasePage.tsx b/web/src/views/ApplicationConfig/ReleasePage.tsx index b87abb52..63f6df71 100644 --- a/web/src/views/ApplicationConfig/ReleasePage.tsx +++ b/web/src/views/ApplicationConfig/ReleasePage.tsx @@ -146,7 +146,7 @@ const ReleasePage: FC<{data: Application; refresh: () => void}> = ({data, refres
- {/* 日志 */} + {/* Logs */} {selectedVersion && ( diff --git a/web/src/views/ApplicationConfig/components/Editor/index.tsx b/web/src/views/ApplicationConfig/components/Editor/index.tsx index e1bdde42..0f878678 100644 --- a/web/src/views/ApplicationConfig/components/Editor/index.tsx +++ b/web/src/views/ApplicationConfig/components/Editor/index.tsx @@ -69,7 +69,7 @@ const theme = { const EditorContent = forwardRef(({ className = '', value, - placeholder = "请输入内容...", + placeholder = "Please enter content...", onChange, }, ref) => { const [editor] = useLexicalComposerContext(); diff --git a/web/src/views/ApplicationConfig/components/VariableList/VariableEditModal.tsx b/web/src/views/ApplicationConfig/components/VariableList/VariableEditModal.tsx index 888248fe..793c6dc9 100644 --- a/web/src/views/ApplicationConfig/components/VariableList/VariableEditModal.tsx +++ b/web/src/views/ApplicationConfig/components/VariableList/VariableEditModal.tsx @@ -137,7 +137,7 @@ const VariableEditModal = forwardRef - {/* 变量类型 */} + {/* Variable Type */}
{props.label} {variableType[props.value as keyof typeof variableType]}
} />
- {/* 变量名称 */} + {/* Variable Name */} - {/* 显示名称 */} + {/* Display Name */} - {/* 描述 */} + {/* Description */} - {/* 最大长度 */} + {/* Max Length */} {['text', 'paragraph'].includes(values?.type) && ( )} - {/* 默认值 */} + {/* Default Value */} {/* {['text', 'paragraph', 'number', 'checkbox'].includes(values?.type) && ( } )} */} - {/* 选项 */} + {/* Options */} {['dropdownOptions'].includes(values?.type) && ( )} - {/* API 扩展 */} + {/* API Extension */} {['apiVariable'].includes(values?.type) && ( )} - {/* 是否必填 */} + {/* Required */} {t('application.required')} - {/* 是否隐藏 */} + {/* Hidden */} {/* = ({ config }) => { }, [t]) useEffect(() => { - // 语言切换时重新生成数据 if (config) { getCaculateData(config) } diff --git a/web/src/views/InviteRegister/index.tsx b/web/src/views/InviteRegister/index.tsx index bc304594..42cffff1 100644 --- a/web/src/views/InviteRegister/index.tsx +++ b/web/src/views/InviteRegister/index.tsx @@ -1,8 +1,8 @@ /* * @Author: ZhaoYing * @Date: 2026-02-03 16:37:12 - * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-02-03 16:37:12 + * @Last Modified by: ZhaoYing + * @Last Modified time: 2026-02-04 10:05:39 */ /** * Invite Register Page @@ -211,7 +211,7 @@ const InviteRegister: React.FC = () => { } const { error } = validatePasswordStrength(value); if (error && value.length >= 8) { - return Promise.resolve(); // 强度提示但不阻止提交 + return Promise.resolve(); } else if (error) { return Promise.reject(new Error(error)); } diff --git a/web/src/views/MemoryExtractionEngine/components/Result.tsx b/web/src/views/MemoryExtractionEngine/components/Result.tsx index 39ade6b3..6fdeb2af 100644 --- a/web/src/views/MemoryExtractionEngine/components/Result.tsx +++ b/web/src/views/MemoryExtractionEngine/components/Result.tsx @@ -1,8 +1,8 @@ /* * @Author: ZhaoYing * @Date: 2026-02-03 17:30:11 - * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-02-03 17:30:11 + * @Last Modified by: ZhaoYing + * @Last Modified time: 2026-02-04 10:08:49 */ /** * Result Component @@ -91,20 +91,20 @@ const Result: FC = ({ loading, handleSave }) => { list.forEach((data: AnyObject) => { switch(data.event) { - case 'text_preprocessing': // 开始预处理文本 + case 'text_preprocessing': // Start text preprocessing setTextPreprocessing(prev => ({ ...prev, status: 'processing', start_at: data.data.time })) break - case 'text_preprocessing_result': // 预处理文本分块中 + case 'text_preprocessing_result': // Text preprocessing in progress setTextPreprocessing(prev => ({ ...prev, data: [...prev.data, data.data?.data] })) break - case 'text_preprocessing_complete': // 预处理文本完成 + case 'text_preprocessing_complete': // Text preprocessing complete setTextPreprocessing(prev => ({ ...prev, result: data.data?.data, @@ -112,20 +112,20 @@ const Result: FC = ({ loading, handleSave }) => { end_at: data.data.time })) break - case 'knowledge_extraction': // 开始知识抽取 + case 'knowledge_extraction': // Start knowledge extraction setKnowledgeExtraction(prev => ({ ...prev, status: 'processing', start_at: data.data.time })) break - case 'knowledge_extraction_result': // 知识抽取中 + case 'knowledge_extraction_result': // Knowledge extraction in progress setKnowledgeExtraction(prev => ({ ...prev, data: [...prev.data, data.data?.data] })) break - case 'knowledge_extraction_complete': // 知识抽取完成 + case 'knowledge_extraction_complete': // Knowledge extraction complete setKnowledgeExtraction(prev => ({ ...prev, result: data.data?.data, @@ -133,20 +133,20 @@ const Result: FC = ({ loading, handleSave }) => { end_at: data.data.time })) break - case 'creating_nodes_edges': // 开始创建节点和边 + case 'creating_nodes_edges': // Start creating nodes and edges setCreatingNodesEdges(prev => ({ ...prev, status: 'processing', start_at: data.data.time })) break - case 'creating_nodes_edges_result': // 创建节点和边中 + case 'creating_nodes_edges_result': // Creating nodes and edges in progress setCreatingNodesEdges(prev => ({ ...prev, data: [...prev.data, data.data?.data] })) break - case 'creating_nodes_edges_complete': // 创建节点和边完成 + case 'creating_nodes_edges_complete': // Creating nodes and edges complete setCreatingNodesEdges(prev => ({ ...prev, result: data.data?.data, @@ -154,20 +154,20 @@ const Result: FC = ({ loading, handleSave }) => { end_at: data.data.time })) break - case 'deduplication': // 开始去重消歧 + case 'deduplication': // Start deduplication and disambiguation setDeduplication(prev => ({ ...prev, status: 'processing', start_at: data.data.time })) break - case 'dedup_disambiguation_result': // 去重消歧中 + case 'dedup_disambiguation_result': // Deduplication and disambiguation in progress setDeduplication(prev => ({ ...prev, data: [...prev.data, data.data.data] })) break - case 'dedup_disambiguation_complete': // 去重消歧完成 + case 'dedup_disambiguation_complete': // Deduplication and disambiguation complete setDeduplication(prev => ({ ...prev, result: data.data?.data, @@ -175,9 +175,9 @@ const Result: FC = ({ loading, handleSave }) => { end_at: data.data.time })) break - case 'generating_results': // 开始生成结果 + case 'generating_results': // Generating results break - case 'result': // 结果 + case 'result': // Result setTestResult(data.data?.extracted_result) break } @@ -228,7 +228,7 @@ const Result: FC = ({ loading, handleSave }) => { } className="rb:mb-3.5"> {t('memoryExtractionEngine.processing')} - {/* 整体进度 */} + {/* Overall Progress */}
{t('memoryExtractionEngine.overallProgress')} @@ -246,7 +246,7 @@ const Result: FC = ({ loading, handleSave }) => { } - {/* 文本预处理 */} + {/* Text Preprocessing */} = ({ loading, handleSave }) => { } - {/* 知识抽取 */} + {/* Knowledge Extraction */} = ({ loading, handleSave }) => { })} } - {/* 创建实体关系 */} + {/* Creating Entity Relationships */} = ({ loading, handleSave }) => { {t('memoryExtractionEngine.creating_nodes_edges_desc', {num: creatingNodesEdges.result.entity_entity_edges_count})} } - {/* 去重消歧 */} + {/* Deduplication and Disambiguation */} 宋朝军事弱势" - }, - { - "result_type": "relationship_creation", - "relationship_index": 2, - "source_entity": "宋朝军事弱势", - "relation_type": "RESULTED_IN", - "target_entity": "制度性因素", - "relationship_text": "宋朝军事弱势 -[RESULTED_IN]-> 制度性因素" - }, - { - "result_type": "relationship_creation", - "relationship_index": 3, - "source_entity": "记忆熊", - "relation_type": "MENTIONS", - "target_entity": "禁军由文官控制导致作战效率低下", - "relationship_text": "记忆熊 -[MENTIONS]-> 禁军由文官控制导致作战效率低下" - }, - { - "result_type": "relationship_creation", - "relationship_index": 4, - "source_entity": "禁军由文官控制", - "relation_type": "RESULTED_IN", - "target_entity": "作战效率低下", - "relationship_text": "禁军由文官控制 -[RESULTED_IN]-> 作战效率低下" - }, - { - "result_type": "relationship_creation", - "relationship_index": 5, - "source_entity": "记忆熊", - "relation_type": "MENTIONS", - "target_entity": "厢军装备不足", - "relationship_text": "记忆熊 -[MENTIONS]-> 厢军装备不足" - }, - { - "result_type": "relationship_creation", - "relationship_index": 6, - "source_entity": "记忆熊", - "relation_type": "MENTIONS", - "target_entity": "宋朝", - "relationship_text": "记忆熊 -[MENTIONS]-> 宋朝" - }, - { - "result_type": "relationship_creation", - "relationship_index": 7, - "source_entity": "记忆熊", - "relation_type": "MENTIONS", - "target_entity": "军费", - "relationship_text": "记忆熊 -[MENTIONS]-> 军费" - }, - { - "result_type": "relationship_creation", - "relationship_index": 8, - "source_entity": "军费", - "relation_type": "HAS_A", - "target_entity": "财政支出", - "relationship_text": "军费 -[HAS_A]-> 财政支出" - }, - { - "result_type": "relationship_creation", - "relationship_index": 9, - "source_entity": "宋朝", - "relation_type": "HAS_REVENUE", - "target_entity": "财政支出", - "relationship_text": "宋朝 -[HAS_REVENUE]-> 财政支出" - }, - { - "result_type": "relationship_creation", - "relationship_index": 10, - "source_entity": "持续战争", - "relation_type": "RESULTED_IN", - "target_entity": "财政压力", - "relationship_text": "持续战争 -[RESULTED_IN]-> 财政压力" - } - ], - "status": "completed", - "result": { - "dialogue_nodes_count": 1, - "chunk_nodes_count": 2, - "statement_nodes_count": 38, - "entity_nodes_count": 148, - "statement_chunk_edges_count": 38, - "statement_entity_edges_count": 148, - "entity_entity_edges_count": 88 - } - }, - { - "data": [ - { - "result_type": "entity_merge", - "merged_entity_name": "记忆熊", - "merged_count": 9, - "message": "记忆熊合并9个:相似实体已合并" - }, - { - "result_type": "entity_merge", - "merged_entity_name": "宋朝", - "merged_count": 4, - "message": "宋朝合并4个:相似实体已合并" - }, - { - "result_type": "entity_merge", - "merged_entity_name": "军费", - "merged_count": 2, - "message": "军费合并2个:相似实体已合并" - }, - { - "result_type": "entity_merge", - "merged_entity_name": "财政支出", - "merged_count": 2, - "message": "财政支出合并2个:相似实体已合并" - }, - { - "result_type": "entity_merge", - "merged_entity_name": "财政压力", - "merged_count": 3, - "message": "财政压力合并3个:相似实体已合并" - }, - { - "result_type": "entity_disambiguation", - "disambiguated_entity_name": "节度使", - "disambiguation_type": "消歧阻断:Role vs Person", - "confidence": "0.95", - "reason": "实体A类型为'Role',实体B类型为'Person',二者类型完全不同且无别名交集或名称-别名匹配。'节度使'是官职而非具体人物,语义上不应合并。尽管名称文本相似度高,但类型相似度为0.0,且上下文...", - "message": "节度使消歧完成:消歧阻断:Role vs Person" - } - ], - "status": "completed", - "result": { - "entities": { - "original_count": 148, - "final_count": 110, - "reduced_count": 38, - "reduction_rate": 25.7 - }, - "statement_entity_edges": { - "original_count": 148, - "final_count": 148, - "reduced_count": 0 - }, - "entity_entity_edges": { - "original_count": 88, - "final_count": 81, - "reduced_count": 7 - }, - "dedup_examples": [ - { - "type": "精确匹配", - "entity_name": "记忆熊", - "entity_type": "Person", - "merge_count": 8, - "description": "记忆熊实体去重合并8个" - }, - { - "type": "精确匹配", - "entity_name": "宋朝", - "entity_type": "Organization", - "merge_count": 2, - "description": "宋朝实体去重合并2个" - }, - { - "type": "精确匹配", - "entity_name": "军费", - "entity_type": "EconomicMetric", - "merge_count": 1, - "description": "军费实体去重合并1个" - }, - { - "type": "精确匹配", - "entity_name": "学生", - "entity_type": "Person", - "merge_count": 5, - "description": "学生实体去重合并5个" - }, - { - "type": "精确匹配", - "entity_name": "废除丞相制度", - "entity_type": "Event", - "merge_count": 3, - "description": "废除丞相制度实体去重合并3个" - } - ], - "disamb_examples": [ - { - "entity1_name": "节度使", - "entity1_type": "Role", - "entity2_name": "节度使", - "entity2_type": "Person", - "description": "节度使和节度使,消歧区分成功" - } - ], - "summary": { - "total_merges": 39, - "total_disambiguations": 1 - } - } - } -] /** * Group data by specified key * @param data - Array of data items diff --git a/web/src/views/Ontology/components/OntologyClassExtractModal.tsx b/web/src/views/Ontology/components/OntologyClassExtractModal.tsx index 1aba9c67..3a7ff8a7 100644 --- a/web/src/views/Ontology/components/OntologyClassExtractModal.tsx +++ b/web/src/views/Ontology/components/OntologyClassExtractModal.tsx @@ -29,7 +29,6 @@ const OntologyClassExtractModal = forwardRef([]); const [selectedKeys, setSelectedKeys] = useState([]); - // 封装取消方法,添加关闭弹窗逻辑 const handleClose = () => { setVisible(false); form.resetFields(); @@ -43,7 +42,6 @@ const OntologyClassExtractModal = forwardRef { if (!data?.scene_id) return; form @@ -104,7 +102,6 @@ const OntologyClassExtractModal = forwardRef ({ handleOpen, })); diff --git a/web/src/views/Ontology/components/OntologyClassModal.tsx b/web/src/views/Ontology/components/OntologyClassModal.tsx index 73e45060..d426f4f9 100644 --- a/web/src/views/Ontology/components/OntologyClassModal.tsx +++ b/web/src/views/Ontology/components/OntologyClassModal.tsx @@ -22,7 +22,6 @@ const OntologyClassModal = forwardRef(null) - // 封装取消方法,添加关闭弹窗逻辑 const handleClose = () => { setVisible(false); form.resetFields(); @@ -34,7 +33,6 @@ const OntologyClassModal = forwardRef { if (!scene_id) return; form @@ -56,7 +54,6 @@ const OntologyClassModal = forwardRef ({ handleOpen, })); diff --git a/web/src/views/Ontology/components/OntologyModal.tsx b/web/src/views/Ontology/components/OntologyModal.tsx index 82eebbd2..0d4b07f0 100644 --- a/web/src/views/Ontology/components/OntologyModal.tsx +++ b/web/src/views/Ontology/components/OntologyModal.tsx @@ -22,7 +22,6 @@ const OntologyModal = forwardRef(({ const [form] = Form.useForm(); const [loading, setLoading] = useState(false) - // 封装取消方法,添加关闭弹窗逻辑 const handleClose = () => { setVisible(false); form.resetFields(); @@ -39,7 +38,6 @@ const OntologyModal = forwardRef(({ } setVisible(true); }; - // 封装保存方法,添加提交逻辑 const handleSave = () => { form .validateFields() @@ -59,7 +57,6 @@ const OntologyModal = forwardRef(({ }); } - // 暴露给父组件的方法 useImperativeHandle(ref, () => ({ handleOpen, })); diff --git a/web/src/views/OrderPayment/index.tsx b/web/src/views/OrderPayment/index.tsx index 44e896e7..94ab9114 100644 --- a/web/src/views/OrderPayment/index.tsx +++ b/web/src/views/OrderPayment/index.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-02-03 17:37:31 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-02-03 17:37:51 + * @Last Modified time: 2026-02-04 10:16:42 */ /** * Order Payment Page @@ -227,7 +227,7 @@ const OrderPayment: React.FC = () => { return (
- {/* 订单信息 */} + {/* Order Information */}

{t('pricing.orderInformation')}

@@ -238,9 +238,9 @@ const OrderPayment: React.FC = () => {
- {/* 订单详情表格 */} + {/* Order Details Table */}
- {/* 桌面端表头 */} + {/* Desktop Table Header */}
{t('pricing.comboName')}
{t('pricing.spAndTa')}
@@ -248,15 +248,15 @@ const OrderPayment: React.FC = () => {
{t('pricing.orderCycle')}
{t('pricing.orderAmount')}
- {/* 表格内容 */} + {/* Table Content */}
- {/* 套餐名称 */} + {/* Package Name */}
{t('pricing.comboName')}
{orderInfo.comboName}
{orderInfo.comboEdition}
- {/* 解决方案和目标受众 */} + {/* Solutions and Target Audience */}
{t('pricing.spAndTa')}
@@ -268,7 +268,7 @@ const OrderPayment: React.FC = () => {
{orderInfo.targetAudience}
- {/* 版本信息 */} + {/* Version Information */}
{t('pricing.versionInformation')}
@@ -296,7 +296,7 @@ const OrderPayment: React.FC = () => { )}
- {/* 订购周期和金额 */} + {/* Subscription Period and Amount */}
{orderInfo.orderingCycle}
@@ -308,9 +308,9 @@ const OrderPayment: React.FC = () => {
- {/* 支付方式和支付凭证 */} + {/* Payment Method and Payment Voucher */}
- {/* 支付方式 */} + {/* Payment Method */}

{t('pricing.paymentMethod')}

@@ -352,7 +352,7 @@ const OrderPayment: React.FC = () => {
- {/* 支付凭证 */} + {/* Payment Voucher */}

{t('pricing.paymentVoucher')}

diff --git a/web/src/views/Prompt/Prompt.tsx b/web/src/views/Prompt/Prompt.tsx index 4101b031..ded9550c 100644 --- a/web/src/views/Prompt/Prompt.tsx +++ b/web/src/views/Prompt/Prompt.tsx @@ -110,7 +110,7 @@ const Prompt: FC<{ editVo: HistoryItem | null; refresh: () => void; }> = ({ edit break; case 'end': setLoading(false) - // 流结束时同步表单值 + // Sync form values when stream ends form.setFieldsValue({ current_prompt: currentPromptValueRef.current }) break } diff --git a/web/src/views/SelfReflectionEngine/index.tsx b/web/src/views/SelfReflectionEngine/index.tsx index 22906fc6..a6314009 100644 --- a/web/src/views/SelfReflectionEngine/index.tsx +++ b/web/src/views/SelfReflectionEngine/index.tsx @@ -27,19 +27,19 @@ import SwitchFormItem from '@/components/FormItem/SwitchFormItem' /** Configuration list */ const configList = [ - // 启用反思引擎 + // Enable reflection engine { key: 'reflection_enabled', type: 'switch', }, - // 反思模型 + // Reflection model { key: 'reflection_model_id', type: 'customSelect', url: getModelListUrl, params: { type: 'chat,llm', page: 1, pagesize: 100, is_active: true }, // chat,llm }, - // 迭代周期 + // Iteration period { key: 'reflection_period_in_hours', type: 'select', @@ -51,7 +51,7 @@ const configList = [ { label: 'daily', value: '24' }, ], }, - // 反思范围 + // Reflection scope { key: 'reflexion_range', type: 'select', @@ -61,7 +61,7 @@ const configList = [ { label: 'all', value: 'all' }, ], }, - // 反思基线 + // Reflection baseline { key: 'baseline', type: 'select', @@ -72,12 +72,12 @@ const configList = [ { label: 'HYBRID', value: 'HYBRID' }, ], }, - // 质量评估 + // Quality assessment { key: 'quality_assessment', type: 'switch', }, - // 质量评估 + // Quality assessment { key: 'memory_verify', type: 'switch', diff --git a/web/src/views/UserMemoryDetail/Rag.tsx b/web/src/views/UserMemoryDetail/Rag.tsx index f00df8d8..2d3443ce 100644 --- a/web/src/views/UserMemoryDetail/Rag.tsx +++ b/web/src/views/UserMemoryDetail/Rag.tsx @@ -159,13 +159,13 @@ const Rag: FC = () => { ))}
- {/* 记忆总量 */} + {/* Total Memory */}
{t('userMemory.totalNumOfMemories')}
{memory || 0}
- {/* 关于我 */} + {/* About Me */} <> { </> )} </> - {/* 记忆洞察 */} + {/* Memory Insights */} <> <Title type="memoryInsight" diff --git a/web/src/views/UserMemoryDetail/components/EmotionTags.tsx b/web/src/views/UserMemoryDetail/components/EmotionTags.tsx index acacde11..14d6f78f 100644 --- a/web/src/views/UserMemoryDetail/components/EmotionTags.tsx +++ b/web/src/views/UserMemoryDetail/components/EmotionTags.tsx @@ -134,11 +134,10 @@ const EmotionTags: FC = () => { <div ref={chartRef} className="rb:mt-6 rb:px-6" style={{ height: '320px', width: '100%' }} /> <div className="rb:flex rb:flex-wrap rb:items-center rb:justify-center rb:gap-10 rb:text-sm rb:mt-3 rb:p-3 rb:bg-[#F0F3F8] rb:rounded-[0_0_8px_8px]"> {Object.entries(emotionStats).map(([type, count]) => { - console.log(type) return ( <div key={type} className="rb:flex rb:items-center rb:gap-2"> <div className="rb:w-3 rb:h-3 rb:rounded-full" style={{ backgroundColor: getEmotionColor(type) }}></div> - <span className="rb:leading-5">{t(`statementDetail.${type || 'neutral'}`)} ({count}个)</span> + <span className="rb:leading-5">{t(`statementDetail.${type || 'neutral'}`)} ({count}{t('statementDetail.item')})</span> </div> ) })} diff --git a/web/src/views/UserMemoryDetail/components/NodeStatistics.tsx b/web/src/views/UserMemoryDetail/components/NodeStatistics.tsx index 349ed3b8..787d9ab8 100644 --- a/web/src/views/UserMemoryDetail/components/NodeStatistics.tsx +++ b/web/src/views/UserMemoryDetail/components/NodeStatistics.tsx @@ -69,7 +69,7 @@ const NodeStatistics: FC = () => { getNodeStatistics(id).then((res) => { const response = res as NodeStatisticsItem[] setData(response) - // 计算count总计 + // Calculate total count const totalCount = response.reduce((sum, item) => sum + (item.count || 0), 0) setTotal(totalCount) setLoading(false) diff --git a/web/src/views/UserMemoryDetail/components/RelationshipNetwork.tsx b/web/src/views/UserMemoryDetail/components/RelationshipNetwork.tsx index f1b07ddf..aa8b9d7c 100644 --- a/web/src/views/UserMemoryDetail/components/RelationshipNetwork.tsx +++ b/web/src/views/UserMemoryDetail/components/RelationshipNetwork.tsx @@ -51,19 +51,19 @@ const RelationshipNetwork:FC = () => { const curEdges: Edge[] = [] const curNodeTypes = Object.keys(statistics.node_types).filter(vo => vo !== 'Dialogue') - // 计算每个节点的连接数 + // Calculate connection count for each node const connectionCount: Record<string, number> = {} edges.forEach(edge => { connectionCount[edge.source] = (connectionCount[edge.source] || 0) + 1 connectionCount[edge.target] = (connectionCount[edge.target] || 0) + 1 }) - // 处理节点数据 + // Process node data nodes.filter(vo => vo.label !== 'Dialogue').forEach(node => { const connections = connectionCount[node.id] || 0 const categoryIndex = curNodeTypes.indexOf(node.label) - // 根据节点类型获取显示名称 + // Get display name based on node type let displayName = '' switch (node.label) { // case 'Statement': @@ -93,16 +93,16 @@ const RelationshipNetwork:FC = () => { ...node, name: displayName, category: categoryIndex >= 0 ? categoryIndex : 0, - symbolSize: symbolSize, // 根据连接数调整节点大小 + symbolSize: symbolSize, // Adjust node size based on connection count }) }) - // 创建节点ID到标签的映射 + // Create mapping from node ID to label const nodeIdToLabel: Record<string, string> = {} nodes.forEach(node => { nodeIdToLabel[node.id] = node.label }) - // 处理边数据 + // Process edge data edges.forEach(edge => { curEdges.push({ ...edge, @@ -112,7 +112,7 @@ const RelationshipNetwork:FC = () => { }) }) - // 设置分类 + // Set categories const curCategories = curNodeTypes.map(type => ({ name: type })) setNodes(curNodes) @@ -160,7 +160,7 @@ const RelationshipNetwork:FC = () => { return ( <Row gutter={16}> - {/* 关系网络 */} + {/* Relationship Network */} <Col span={16}> <RbCard title={t('userMemory.relationshipNetwork')} @@ -211,22 +211,22 @@ const RelationshipNetwork:FC = () => { }, force: { repulsion: 100, - // 启用类别聚合 + // Enable category aggregation edgeLength: 80, gravity: 0.3, - // 同类别的节点相互吸引 + // Nodes of the same category attract each other layoutAnimation: true, - // 防止点击时重新计算布局 + // Prevent layout recalculation on click preventOverlap: true, - // 点击节点后保持布局稳定 + // Keep layout stable after node click edgeSymbol: ['none', 'arrow'], edgeSymbolSize: [4, 10], - // 初始布局完成后关闭力导向 + // Disable force-directed after initial layout initLayout: 'force' }, selectedMode: 'single', draggable: true, - // 防止数据更新时重新计算布局 + // Prevent layout recalculation on data update animationDurationUpdate: 0, select: { itemStyle: { @@ -242,12 +242,12 @@ const RelationshipNetwork:FC = () => { notMerge={false} lazyUpdate={true} onEvents={{ - // 节点点击事件处理 + // Node click event handler click: (params: { dataType: string; data: Node; name: string }) => { if (params.dataType === 'node') { - // 处理节点点击事件 + // Handle node click event console.log('Node clicked:', params.data); - // 使用函数式更新避免状态依赖问题 + // Use functional update to avoid state dependency issues setSelectedNode(params.data) } } @@ -257,7 +257,7 @@ const RelationshipNetwork:FC = () => { </div> </RbCard> </Col> - {/* 记忆详情 */} + {/* Memory Details */} <Col span={8}> <RbCard title={t('userMemory.memoryDetails')} diff --git a/web/src/views/UserMemoryDetail/components/WordCloud.tsx b/web/src/views/UserMemoryDetail/components/WordCloud.tsx index aa2460e3..389fade8 100644 --- a/web/src/views/UserMemoryDetail/components/WordCloud.tsx +++ b/web/src/views/UserMemoryDetail/components/WordCloud.tsx @@ -79,7 +79,7 @@ const WordCloud: FC = () => { const radarOption = useMemo(() => { if (!wordCloud?.tags.length) return {} - // 将avg_intensity转换为1-100范围 + // Convert avg_intensity to 1-100 range const radarData = wordCloud.tags.map(item => ({ name: item.emotion_type, value: Math.round(item.avg_intensity * 100),