style(web): translate Chinese comments to English in KnowledgeBase views

- Translate all Chinese comments to English in CreateDataset component
- Translate Chinese comments in DocumentDetails, Private, and Share pages
- Translate Chinese comments in all KnowledgeBase modal components (CreateContentModal, CreateDatasetModal, CreateFolderModal, etc.)
- Translate Chinese comments in KnowledgeGraph, RecallTest, and related components
- Translate Chinese comments in datasets and index files
- Improve code readability and maintain consistency with existing English codebase
- Ensure all inline comments and console logs use English for better maintainability
This commit is contained in:
yujiangping
2026-02-03 17:08:22 +08:00
parent 8697498b32
commit 6e0407f404
22 changed files with 415 additions and 416 deletions

View File

@@ -30,7 +30,7 @@ const ShareModal = forwardRef<ShareModalRef,ShareModalRefProps>(({ handleShare:
const [knowledgeBase, setKnowledgeBase] = useState<KnowledgeBase | null>(null);
const [spaceList, setSpaceList] = useState<SpaceItem[]>([]);
// 封装取消方法,添加关闭弹窗逻辑
// Close modal and reset state
const handleClose = () => {
setCurIndex(-1);
setLoading(false)
@@ -51,10 +51,10 @@ const ShareModal = forwardRef<ShareModalRef,ShareModalRefProps>(({ handleShare:
}
const handleShare = async() => {
// 获取所有 checked true 的数据
// Get all data with checked = true
const checkedItems = spaceList.filter(item => item.is_active);
debugger
// 获取当前选中的项(curIndex 对应的数据)
// Get currently selected item (corresponding to curIndex)
const selectedItem = curIndex !== -1 ? spaceList[curIndex] : null;
if(!selectedItem){
messageApi.error(t('knowledgeBase.selectSpace'));
@@ -70,13 +70,13 @@ const ShareModal = forwardRef<ShareModalRef,ShareModalRefProps>(({ handleShare:
}else{
messageApi.error(t('knowledgeBase.shareFailed'));
}
// 调用父组件传递的回调函数,传递选中的数据
// Call parent component's callback function with selected data
onShare?.({
checkedItems,
selectedItem
});
// 分享后关闭弹窗
// Close modal after sharing
handleClose();
}
const handleClick = (index: number, checked: boolean) => {
@@ -84,7 +84,7 @@ const ShareModal = forwardRef<ShareModalRef,ShareModalRefProps>(({ handleShare:
setCurIndex(index);
}
// 暴露给父组件的方法
// Expose methods to parent component
useImperativeHandle(ref, () => ({
handleOpen,
handleClose,