chore: replace all cn comments of fe to en version by volc api (#320)

This commit is contained in:
tecvan
2025-07-31 10:32:15 +08:00
committed by GitHub
parent 716ec0cba8
commit 71f6245a01
2960 changed files with 15545 additions and 15545 deletions

View File

@@ -20,7 +20,7 @@ import { KnowledgeApi } from '@coze-arch/bot-api';
import { type ViewOnlinePageDetailProps } from '@/types';
/**
* 将API返回的网页信息转换为视图数据
* Convert the web page information returned by the API into view data
*/
const transformWebInfoToViewData = (webInfo: {
id?: string;
@@ -47,7 +47,7 @@ export const useGetWebInfo = (): {
include_content: true,
});
// 如果没有数据,返回空数组
// If there is no data, return an empty array
if (!responseData?.[webID]?.web_info) {
return [] as ViewOnlinePageDetailProps[];
}
@@ -56,7 +56,7 @@ export const useGetWebInfo = (): {
const mainPageData = transformWebInfoToViewData(webInfo);
const result = [mainPageData];
// 处理子页面数据
// Processing subpage data
if (webInfo?.subpages?.length) {
const subpagesData = webInfo.subpages.map(transformWebInfoToViewData);
result.push(...subpagesData);

View File

@@ -28,7 +28,7 @@ export type CardRadioGroupProps<T = unknown> = PropsWithChildren<
};
/**
* 始终使用卡片风格,并符合 UI 设计样式的 {@link RadioGroup}
* Always use the card style and conform to the UI design style {@link RadioGroup}
*/
export function CardRadioGroup<T = unknown>({
value,

View File

@@ -26,7 +26,7 @@ export interface CollapsePanelProps extends PropsWithChildren {
}
/**
* 用 Collapsible 封装的更符合 UI 设计的折叠面板
* A collapsible panel with Collapsible for better UI design
*/
export function CollapsePanel({
header,

View File

@@ -30,10 +30,10 @@ interface FilterPageConfig {
}
interface Document {
// TODO: 扩充
// TODO: Expansion
id: string;
title: string;
/** 是否存在过滤内容 */
/** Is there filtered content? */
filterPageConfigList: FilterPageConfig[];
}

View File

@@ -148,7 +148,7 @@
padding: 9px 16px !important;
}
/** 去掉hover行样式 */
/** Remove hover line style */
.semi-table-tbody .semi-table-row:hover>.semi-table-row-cell {
background-color: transparent !important;
background-image: none !important;

View File

@@ -54,17 +54,17 @@ export const TablePreview: React.FC<TablePreviewProps> = ({
}) => {
const { sheet_list = [], table_meta = {}, preview_data = {} } = data;
const startRow = Number(settings[TableSettingFormFields.DATA_START_ROW]) || 0;
// 选中的表id
// Selected table id
const sheetId = useMemo(
() => settings[TableSettingFormFields.SHEET] || 0,
[settings],
);
// 选中的表名
// Selected table name
const sheetName = useMemo(
() => (sheet_list || []).find(sheet => sheet?.id === sheetId)?.sheet_name,
[sheet_list, sheetId],
);
// 选中的表的数据量
// The amount of data for the selected table
const total = useMemo(
() =>
Number(

View File

@@ -90,7 +90,7 @@ export const TableSettingBar: React.FC<TableSettingBarProps> = ({
e2e: KnowledgeE2e.TableLocalTableConfigurationStarRow,
field: TableSettingFormFields.DATA_START_ROW,
label: I18n.t('datasets_createFileModel_tab_dataStarRow'),
// 数据起始行需大于表头行
// The starting row of the data must be larger than the header row
options: options.slice(
Number(tableSettings[TableSettingFormFields.KEY_START_ROW]) + 1,
),
@@ -112,7 +112,7 @@ export const TableSettingBar: React.FC<TableSettingBarProps> = ({
TableSettingFormFields.KEY_START_ROW,
);
if (isNumber(curSheet) && formApi.current) {
// 修改sheet,初始化表头行和数据行
// Modify the sheet, initialize the header and data rows
formApi.current.setValue(TableSettingFormFields.KEY_START_ROW, 0);
formApi.current.setValue(TableSettingFormFields.DATA_START_ROW, 1);
}

View File

@@ -26,7 +26,7 @@
}
}
/** 暂时注释,后续还要用,待讨论 */
/** Temporary comment, to be used later, to be discussed */
// &:hover {
// background: var(--coz-mg-secondary-hovered) !important;
@@ -171,7 +171,7 @@
}
}
/** table去掉背景色 */
/** Table remove background color */
.semi-table-thead>.semi-table-row>.semi-table-row-head, .semi-table-tbody>.semi-table-row, .semi-table-tbody>.semi-table-row>.semi-table-cell-fixed-left,.semi-table-thead>.semi-table-row>.semi-table-row-head.semi-table-cell-fixed-left::before {
background-color: transparent !important;
}

View File

@@ -221,7 +221,7 @@ const InputRender = ({
);
};
// TODO 待解
// TODO to be solved
// eslint-disable-next-line @coze-arch/max-line-per-function
export const TableStructure: React.FC<TableStructureProps> = ({
data = [],
@@ -487,7 +487,7 @@ export const TableStructure: React.FC<TableStructureProps> = ({
},
];
// 预览场景下,不需要操作列
// In the preview scenario, no operation column is required
if (isPreview) {
columns.pop();
}

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
// 组件相关
// component related
export {
TableSettingBar,
type TableSettingBarProps,

View File

@@ -79,7 +79,7 @@ const renderSubText = (
}
let subDesc = '';
if (hasURLImport) {
// 更新频率
// update frequency
const updateInterval = hoursToDays(item?.update_interval || 0);
subDesc = getFrequencyMap(updateInterval);
} else {

View File

@@ -30,7 +30,7 @@ interface UploadFooterProps {
controls: FooterControlsProps;
}
/** 类型断言 入参是不是 按钮数组 */
/** Type assertion imported parameter yes no, button array */
function isBtnArray(controls: unknown): controls is FooterBtnProps[] {
return !!controls && isArray(controls);
}

View File

@@ -24,12 +24,12 @@ interface UploadActionNavbarProps {
title: string;
}
// 上传页面导航栏
// Upload page navigation bar
export const UploadActionNavbar = ({ title }: UploadActionNavbarProps) => {
const params = useKnowledgeParams();
const resourceNavigate = useDataNavigate();
// TODO: hzf biz的分化在Scene层维护
// TODO: Scene layer maintenance of hzf biz differentiation
const fromProject = params.biz === 'project';
const handleBack = () => {
const query = getKnowledgeIDEQuery() as Record<string, string>;

View File

@@ -29,8 +29,8 @@ export const getBeforeUpload: (params: {
}) => UploadProps['beforeUpload'] =
({ maxSizeMB }) =>
async fileInfo => {
// 不通过 maxSize 属性来限制的原因是
// 只有 beforeUpload 钩子能改 validateMessage
// The reason for not limiting by the maxSize property is
// Only the beforeUpload hook can change validateMessage
const res = {
fileInstance: fileInfo.file.fileInstance,
status: fileInfo.file.status,
@@ -73,7 +73,7 @@ export const getBeforeUpload: (params: {
if (getFileExtension(fileInstance.name).toLowerCase() === 'pdf') {
try {
// TODO: 后续其他位置的 pdfjs 调用也都应该改成异步加载
// TODO: Subsequent pdfjs calls from other locations should also be changed to asynchronous loading
const pdfjs = await import('@coze-arch/pdfjs-shadow');
const { getDocument, initPdfJsWorker } = pdfjs;

View File

@@ -28,7 +28,7 @@ export const customRequest: UploadProps['customRequest'] = async options => {
const { onSuccess, onError, onProgress, file } = options;
try {
// 业务
// business
const { name, fileInstance } = file;
if (fileInstance) {
@@ -47,7 +47,7 @@ export const customRequest: UploadProps['customRequest'] = async options => {
onUploadProgress: e => {
const status = file?.status;
const response = file?.response;
// 成功或失败、检验失败后,或者有返回接口数据,不再更新进度条
// Success or failure, after the inspection fails, or if the interface data is returned, the progress bar will not be updated.
if (
status === UploadStatus.SUCCESS ||
status === UploadStatus.UPLOAD_FAIL ||

View File

@@ -38,7 +38,7 @@ const getFileListMap = (fileList: FileItem[]): GetFileListMapRes =>
return acc;
}, {});
/** 过滤 fileList仅保留在 unitList 中的文件,即上传成功的文件 */
/** Filter the fileList to keep only the files in the unitList, that is, the files that were uploaded successfully. */
export const filterFileListByUnitList = (
fileList: FileItem[],
unitList: UnitItem[],

View File

@@ -34,7 +34,7 @@ export const UnitName: React.FC<UnitNameProps> = ({
formatType,
}) => {
const { type, name, validateMessage } = record;
const [value, setValue] = useState(name); // 需要用自身state否则出现无法输入中文的bug
const [value, setValue] = useState(name); // You need to use your own state, otherwise there will be a bug that cannot enter Chinese.
const getValidateMessage = (val: string) =>
!val ? I18n.t('datasets_unit_exception_name_empty') : validateMessage;
useEffect(() => {

View File

@@ -39,7 +39,7 @@ export const UnitName: FC<UnitNameProps> = ({
inModal = false,
}) => {
const { type, name, validateMessage, dynamicErrorMessage } = record;
const [value, setValue] = useState(name); // 需要用自身state否则出现无法输入中文的bug
const [value, setValue] = useState(name); // You need to use your own state, otherwise there will be a bug that cannot enter Chinese.
const [validData, setValidData] = useState({ valid: true, errorMsg: '' });
const getValidateMessage = (val: string) =>

View File

@@ -30,7 +30,7 @@ export interface UploadStateProps {
needLoading?: boolean;
overlayClassName?: string;
disableRetry?: boolean;
// 不显示重试文案
// Do not show retry copy
noRetry?: boolean;
}

View File

@@ -56,7 +56,7 @@ export const UploadUnitTable: FC<UploadUnitTableProps> = props => {
const curStatus = getProcessStatus(item?.status);
const statusDescript = item?.statusDescript || '';
// 使用getColumns获取每个项目的信息
// Use getColumns to obtain information for each item
const columnInfo: ColumnInfo = getColumns
? getColumns(item, index)
: {};