### What problem does this PR solve? change language Issue link: #245 - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@@ -134,12 +134,8 @@ const ChunkMethodModal: React.FC<IProps> = ({
|
||||
{showPages && (
|
||||
<>
|
||||
<Space>
|
||||
<p>Page Ranges:</p>
|
||||
<Tooltip
|
||||
title={
|
||||
'page ranges: Define the page ranges that need to be parsed. The pages that not included in these ranges will be ignored.'
|
||||
}
|
||||
>
|
||||
<p>{t('pageRanges')}:</p>
|
||||
<Tooltip title={t('pageRangesTip')}>
|
||||
<QuestionCircleOutlined
|
||||
className={styles.questionIcon}
|
||||
></QuestionCircleOutlined>
|
||||
@@ -163,7 +159,7 @@ const ChunkMethodModal: React.FC<IProps> = ({
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: 'Missing start page number',
|
||||
message: t('fromMessage'),
|
||||
},
|
||||
({ getFieldValue }) => ({
|
||||
validator(_, value) {
|
||||
@@ -175,16 +171,14 @@ const ChunkMethodModal: React.FC<IProps> = ({
|
||||
return Promise.resolve();
|
||||
}
|
||||
return Promise.reject(
|
||||
new Error(
|
||||
'The current value must be greater than the previous to!',
|
||||
),
|
||||
new Error(t('greaterThanPrevious')),
|
||||
);
|
||||
},
|
||||
}),
|
||||
]}
|
||||
>
|
||||
<InputNumber
|
||||
placeholder="from"
|
||||
placeholder={t('fromPlaceholder')}
|
||||
min={0}
|
||||
precision={0}
|
||||
className={styles.pageInputNumber}
|
||||
@@ -197,7 +191,7 @@ const ChunkMethodModal: React.FC<IProps> = ({
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: 'Missing end page number(excluded)',
|
||||
message: t('toMessage'),
|
||||
},
|
||||
({ getFieldValue }) => ({
|
||||
validator(_, value) {
|
||||
@@ -208,16 +202,14 @@ const ChunkMethodModal: React.FC<IProps> = ({
|
||||
return Promise.resolve();
|
||||
}
|
||||
return Promise.reject(
|
||||
new Error(
|
||||
'The current value must be greater than to!',
|
||||
),
|
||||
new Error(t('greaterThan')),
|
||||
);
|
||||
},
|
||||
}),
|
||||
]}
|
||||
>
|
||||
<InputNumber
|
||||
placeholder="to"
|
||||
placeholder={t('toPlaceholder')}
|
||||
min={0}
|
||||
precision={0}
|
||||
className={styles.pageInputNumber}
|
||||
@@ -235,7 +227,7 @@ const ChunkMethodModal: React.FC<IProps> = ({
|
||||
block
|
||||
icon={<PlusOutlined />}
|
||||
>
|
||||
Add page
|
||||
{t('addPage')}
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</>
|
||||
@@ -246,12 +238,10 @@ const ChunkMethodModal: React.FC<IProps> = ({
|
||||
{showOne && (
|
||||
<Form.Item
|
||||
name={['parser_config', 'layout_recognize']}
|
||||
label="Layout recognize"
|
||||
label={t('layoutRecognize')}
|
||||
initialValue={true}
|
||||
valuePropName="checked"
|
||||
tooltip={
|
||||
'Use visual models for layout analysis to better identify document structure, find where the titles, text blocks, images, and tables are. Without this feature, only the plain text of the PDF can be obtained.'
|
||||
}
|
||||
tooltip={t('layoutRecognizeTip')}
|
||||
>
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
@@ -265,14 +255,13 @@ const ChunkMethodModal: React.FC<IProps> = ({
|
||||
getFieldValue(['parser_config', 'layout_recognize']) && (
|
||||
<Form.Item
|
||||
name={['parser_config', 'task_page_size']}
|
||||
label="Task page size"
|
||||
tooltip={`If using layout recognize, the PDF file will be split into groups of successive. Layout analysis will be performed parallelly between groups to increase the processing speed.
|
||||
The 'Task page size' determines the size of groups. The larger the page size is, the lower the chance of splitting continuous text between pages into different chunks.`}
|
||||
label={t('taskPageSize')}
|
||||
tooltip={t('taskPageSizeTip')}
|
||||
initialValue={12}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: 'Please input your task page size!',
|
||||
message: t('taskPageSizeMessage'),
|
||||
},
|
||||
]}
|
||||
>
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import { useTranslate } from '@/hooks/commonHooks';
|
||||
import { Flex, Form, InputNumber, Slider } from 'antd';
|
||||
|
||||
const MaxTokenNumber = () => {
|
||||
const { t } = useTranslate('knowledgeConfiguration');
|
||||
|
||||
return (
|
||||
<Form.Item
|
||||
label="Chunk token number"
|
||||
tooltip="It determine the token number of a chunk approximately."
|
||||
>
|
||||
<Form.Item label={t('chunkTokenNumber')} tooltip={t('chunkTokenNumberTip')}>
|
||||
<Flex gap={20} align="center">
|
||||
<Flex flex={1}>
|
||||
<Form.Item
|
||||
name={['parser_config', 'chunk_token_num']}
|
||||
noStyle
|
||||
initialValue={128}
|
||||
rules={[{ required: true, message: 'Province is required' }]}
|
||||
rules={[{ required: true, message: t('chunkTokenNumberMessage') }]}
|
||||
>
|
||||
<Slider max={2048} style={{ width: '100%' }} />
|
||||
</Form.Item>
|
||||
@@ -20,7 +20,7 @@ const MaxTokenNumber = () => {
|
||||
<Form.Item
|
||||
name={['parser_config', 'chunk_token_num']}
|
||||
noStyle
|
||||
rules={[{ required: true, message: 'Street is required' }]}
|
||||
rules={[{ required: true, message: t('chunkTokenNumberMessage') }]}
|
||||
>
|
||||
<InputNumber max={2048} min={0} />
|
||||
</Form.Item>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { useTranslate } from '@/hooks/commonHooks';
|
||||
import { Form, Input, Modal } from 'antd';
|
||||
import { useEffect } from 'react';
|
||||
import { IModalManagerChildrenProps } from '../modal-manager';
|
||||
@@ -17,6 +18,7 @@ const RenameModal = ({
|
||||
onOk,
|
||||
}: IProps) => {
|
||||
const [form] = Form.useForm();
|
||||
const { t } = useTranslate('common');
|
||||
|
||||
type FieldType = {
|
||||
name?: string;
|
||||
@@ -48,7 +50,7 @@ const RenameModal = ({
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title="Rename"
|
||||
title={t('rename')}
|
||||
open={visible}
|
||||
onOk={handleOk}
|
||||
onCancel={handleCancel}
|
||||
@@ -66,9 +68,9 @@ const RenameModal = ({
|
||||
form={form}
|
||||
>
|
||||
<Form.Item<FieldType>
|
||||
label="Name"
|
||||
label={t('name')}
|
||||
name="name"
|
||||
rules={[{ required: true, message: 'Please input name!' }]}
|
||||
rules={[{ required: true, message: t('namePlaceholder') }]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
|
||||
Reference in New Issue
Block a user