chore: replace all cn comments of fe to en version by volc api (#320)
This commit is contained in:
@@ -66,7 +66,7 @@ export const useBatchCheckboxDoc = (props: IBatchCheckboxDocProps) => {
|
||||
}
|
||||
return (checkboxOptions?.map(v => v.document_id) ?? []) as string[];
|
||||
}, [checkboxOptions, disabled]);
|
||||
// 初始化所有选中
|
||||
// Initialize all selections
|
||||
const initCheckedList = () => {
|
||||
setCheckedList(plainOptions);
|
||||
setCheckAll(plainOptions?.length > 0);
|
||||
|
||||
@@ -53,7 +53,7 @@ export interface AddTypeContentProps {
|
||||
export const CozeKnowledgeAddTypeContent = (params: AddTypeContentProps) => {
|
||||
const { onImportKnowledgeTypeChange, onSelectFormatTypeChange } = params;
|
||||
const formApi = useFormApi<CozeKnowledgeAddTypeContentFormData>();
|
||||
// 使用 useState 保证能重新渲染
|
||||
// Use useState to ensure re-rendering
|
||||
const [currentFormatType, setCurrentFormatType] = useState(FormatType.Text);
|
||||
const [iconInfoGenerate, setIconInfoGenerate] = useState<{
|
||||
name: string;
|
||||
|
||||
@@ -108,7 +108,7 @@ export const useKnowledgeListModal = ({
|
||||
canCreate,
|
||||
defaultType,
|
||||
knowledgeTypeConfigList,
|
||||
// 需要优化属性选择方式
|
||||
// Need to optimize attribute selection
|
||||
projectID: category === 'project' ? projectID : '',
|
||||
createKnowledgeModal,
|
||||
});
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/* eslint-disable max-lines-per-function */
|
||||
/* eslint-disable max-lines -- 待拆分 */
|
||||
/* eslint-disable max-lines -- to be split */
|
||||
/* eslint-disable @coze-arch/max-line-per-function */
|
||||
import {
|
||||
type FC,
|
||||
@@ -311,7 +311,7 @@ const useKnowledgeFilter = ({
|
||||
};
|
||||
|
||||
const renderContent = () => {
|
||||
/** 有数据则展示列表 */
|
||||
/** Show the list if you have data */
|
||||
if (data?.total) {
|
||||
return (
|
||||
<>
|
||||
@@ -335,7 +335,7 @@ const useKnowledgeFilter = ({
|
||||
</>
|
||||
);
|
||||
}
|
||||
/** 无数据且未在加载则展示空状态 */
|
||||
/** Show empty state if no data and not loading */
|
||||
if (!loading) {
|
||||
return (
|
||||
<EmptyToCreate
|
||||
@@ -348,7 +348,7 @@ const useKnowledgeFilter = ({
|
||||
/>
|
||||
);
|
||||
}
|
||||
/** 无数据且加载中则不展示 */
|
||||
/** No data and no display while loading */
|
||||
return null;
|
||||
};
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ export function RagModeConfiguration({
|
||||
recall_strategy = {},
|
||||
} = dataSetInfo;
|
||||
|
||||
// undefined 默认为 true
|
||||
// Undefined defaults to true
|
||||
const {
|
||||
use_nl2sql = true,
|
||||
use_rerank = true,
|
||||
@@ -362,7 +362,7 @@ export function RagModeConfiguration({
|
||||
onDataSetInfoChange({
|
||||
...dataSetInfo,
|
||||
show_source: v,
|
||||
// 展示方式没有值且打开展示来源,默认选中卡片
|
||||
// Display method has no value and open the display source, the card is selected by default
|
||||
...(!show_source_mode && v
|
||||
? {
|
||||
show_source_mode: KnowledgeShowSourceMode.CardList,
|
||||
|
||||
@@ -26,7 +26,7 @@ interface AccountFrequencyItemProps {
|
||||
onFrequencyChange: (account: AuthFrequencyInfo) => void;
|
||||
}
|
||||
|
||||
// TODO: hzf 需要修改为i18n
|
||||
// TODO: hzf needs to be changed to i18n.
|
||||
const FREQUENCY_OPTIONS = [
|
||||
{ label: I18n.t('knowledge_weixin_015'), value: FrequencyType.None },
|
||||
{ label: I18n.t('knowledge_weixin_016'), value: FrequencyType.EveryDay },
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { useState, useEffect } from 'react';
|
||||
|
||||
import { I18n } from '@coze-arch/i18n';
|
||||
@@ -45,7 +45,7 @@ export const SetAppendFrequencyModal = (props: {
|
||||
|
||||
return (
|
||||
<Modal
|
||||
// @ts-expect-error --TODO:hzf 需要修改为i18n
|
||||
// @ts-expect-error --TODO: hzf needs to be changed to i18n.
|
||||
title={I18n.t('设置追加频率')}
|
||||
className="w-[520px]"
|
||||
centered
|
||||
@@ -78,7 +78,7 @@ export const SetAppendFrequencyModal = (props: {
|
||||
>
|
||||
<>
|
||||
<div className="text-[14px] coz-fg-primary mb-[30px]">
|
||||
{/**@ts-expect-error --TODO:hzf 需要修改为i18n */}
|
||||
{/* @ts-expect-error --TODO: hzf needs to be changed to i18n. */}
|
||||
{I18n.t('设置追加频率后,当前频率自动追加')}
|
||||
</div>
|
||||
<div className="flex flex-col gap-2">
|
||||
|
||||
@@ -250,7 +250,7 @@ export const useTableSegmentModal = ({
|
||||
const newData = [...tableData];
|
||||
newData[index].value = newValue;
|
||||
|
||||
// 针对语义匹配行进行检验
|
||||
// Verify against semantic matching rows
|
||||
if (newData[index]?.is_semantic) {
|
||||
if (newValue.length === 0) {
|
||||
newData[index].error = I18n.t('knowledge_table_content_empty');
|
||||
|
||||
@@ -59,10 +59,10 @@ export const getSrcFromImg = (str: string): string[] => {
|
||||
return [];
|
||||
}
|
||||
const imgRegx = /<img[^>]+src\s*=\s*['"]([^'"]+)['"][^>]*>/g;
|
||||
// 使用正则表达式进行匹配
|
||||
// Matching using regular expressions
|
||||
const matches = str.match(imgRegx);
|
||||
|
||||
// 提取匹配结果中的src属性值
|
||||
// Extract the value of the src attribute from the matching result
|
||||
const srcList: string[] = [];
|
||||
if (matches) {
|
||||
for (const match of matches) {
|
||||
|
||||
@@ -21,8 +21,8 @@ export const transSliceContentOutput = (
|
||||
ignoreImg = false,
|
||||
): string => {
|
||||
/**
|
||||
* 1. 处理img标签
|
||||
* 2. 删除多余的div/span/br标签
|
||||
* 1. Handling img tags
|
||||
* 2. Remove redundant div/span/br tags
|
||||
*/
|
||||
const imgPattern = /<img.*?(?:>|\/>)/gi;
|
||||
const divSPattern = /<div[^>]*>/g;
|
||||
@@ -60,10 +60,10 @@ export const transSliceContentInput = (content: string): string => {
|
||||
};
|
||||
|
||||
export const transSliceContentInputWithSave = (content: string) => {
|
||||
// 将 <br> 替换成 \n
|
||||
// Replace < br > with\ n
|
||||
const contentWithNewLine = content.replace(/<br>/g, '\n');
|
||||
|
||||
// 将 <span> 替换为空
|
||||
// Replace < span > with empty
|
||||
const finalContent = contentWithNewLine
|
||||
.replace(/<span>/g, '')
|
||||
.replace(/<\/span>/g, '');
|
||||
|
||||
Reference in New Issue
Block a user