perf: i18n (#4740)
* feat: login limit time config * doc * perf: code * i18n update * update lock * fix: ts * update package
This commit is contained in:
@@ -54,7 +54,7 @@ const EditFolderModal = ({
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button isLoading={isLoading} onClick={onSave}>
|
||||
{t('common:common.Confirm')}
|
||||
{t('common:Confirm')}
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
</MyModal>
|
||||
|
||||
@@ -91,8 +91,8 @@ const Header = ({ hasTrainingData }: { hasTrainingData: boolean }) => {
|
||||
onSuccess() {
|
||||
getData(pageNum);
|
||||
},
|
||||
successToast: t('common:common.Create Success'),
|
||||
errorToast: t('common:common.Create Failed')
|
||||
successToast: t('common:create_success'),
|
||||
errorToast: t('common:create_failed')
|
||||
}
|
||||
);
|
||||
|
||||
@@ -155,7 +155,7 @@ const Header = ({ hasTrainingData }: { hasTrainingData: boolean }) => {
|
||||
flex={1}
|
||||
size={'sm'}
|
||||
h={'36px'}
|
||||
placeholder={t('common:common.Search') || ''}
|
||||
placeholder={t('common:Search') || ''}
|
||||
value={searchText}
|
||||
leftIcon={
|
||||
<MyIcon
|
||||
|
||||
@@ -71,8 +71,8 @@ const TagManageModal = ({ onClose }: { onClose: () => void }) => {
|
||||
setSearchTagKey('');
|
||||
loadAllDatasetTags();
|
||||
},
|
||||
successToast: t('common:common.Delete Success'),
|
||||
errorToast: t('common:common.Delete Failed')
|
||||
successToast: t('common:delete_success'),
|
||||
errorToast: t('common:delete_failed')
|
||||
}
|
||||
);
|
||||
|
||||
@@ -114,8 +114,8 @@ const TagManageModal = ({ onClose }: { onClose: () => void }) => {
|
||||
onFinally() {
|
||||
getData(pageNum);
|
||||
},
|
||||
successToast: t('common:common.Save Success'),
|
||||
errorToast: t('common:common.Save Failed')
|
||||
successToast: t('common:save_success'),
|
||||
errorToast: t('common:save_failed')
|
||||
}
|
||||
);
|
||||
|
||||
@@ -211,7 +211,7 @@ const TagManageModal = ({ onClose }: { onClose: () => void }) => {
|
||||
setNewTag('');
|
||||
}}
|
||||
>
|
||||
{t('dataset:tag.Add New')}
|
||||
{t('dataset:tag.add_new')}
|
||||
</Button>
|
||||
</Flex>
|
||||
<Flex px={8} w={'full'}>
|
||||
@@ -464,7 +464,7 @@ const AddTagToCollections = ({
|
||||
}
|
||||
<Box flex={'1 0 0'}></Box>
|
||||
<MyInput
|
||||
placeholder={t('common:common.Search')}
|
||||
placeholder={t('common:Search')}
|
||||
w={'200px'}
|
||||
mr={2}
|
||||
onChange={(e) => {
|
||||
@@ -482,7 +482,7 @@ const AddTagToCollections = ({
|
||||
setOriginCollections(selectedCollections);
|
||||
}}
|
||||
>
|
||||
{t('common:common.Save')}
|
||||
{t('common:Save')}
|
||||
</Button>
|
||||
</Flex>
|
||||
<ScrollListCollections
|
||||
|
||||
@@ -429,7 +429,7 @@ const EditView = ({
|
||||
)}
|
||||
<Flex justifyContent={'flex-end'} gap={4}>
|
||||
<Button variant={'outline'} onClick={onCancel}>
|
||||
{t('common:common.Cancel')}
|
||||
{t('common:Cancel')}
|
||||
</Button>
|
||||
<Button variant={'primary'} onClick={handleSubmit(onSave)}>
|
||||
{t('dataset:dataset.ReTrain')}
|
||||
|
||||
@@ -134,7 +134,7 @@ const WebsiteConfigModal = ({
|
||||
textDecoration={'underline'}
|
||||
color={'blue.700'}
|
||||
>
|
||||
{t('common:common.course.Read Course')}
|
||||
{t('common:read_course')}
|
||||
</Link>
|
||||
)}
|
||||
</Box>
|
||||
@@ -149,7 +149,7 @@ const WebsiteConfigModal = ({
|
||||
</Box>
|
||||
<Box mt={3}>
|
||||
<Box>
|
||||
{t('common:core.dataset.website.Selector')}({t('common:common.choosable')})
|
||||
{t('common:core.dataset.website.Selector')}({t('common:choosable')})
|
||||
</Box>
|
||||
<Input {...websiteInfoForm('selector')} placeholder="body .content #document" />
|
||||
</Box>
|
||||
@@ -161,7 +161,7 @@ const WebsiteConfigModal = ({
|
||||
{activeStep == 0 && (
|
||||
<>
|
||||
<Button variant={'whiteBase'} onClick={onClose}>
|
||||
{t('common:common.Close')}
|
||||
{t('common:Close')}
|
||||
</Button>
|
||||
<Button
|
||||
ml={2}
|
||||
@@ -171,20 +171,20 @@ const WebsiteConfigModal = ({
|
||||
if (!strIsLink(data.url)) {
|
||||
return toast({
|
||||
status: 'warning',
|
||||
title: t('common:common.link.UnValid')
|
||||
title: t('common:link.UnValid')
|
||||
});
|
||||
}
|
||||
goToNext();
|
||||
})}
|
||||
>
|
||||
{t('common:common.Next Step')}
|
||||
{t('common:next_step')}
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
{activeStep == 1 && (
|
||||
<>
|
||||
<Button variant={'whiteBase'} onClick={goToPrevious}>
|
||||
{t('common:common.Last Step')}
|
||||
{t('common:last_step')}
|
||||
</Button>
|
||||
<Button
|
||||
ml={2}
|
||||
@@ -250,7 +250,7 @@ const PromptTextarea = ({
|
||||
onClose();
|
||||
}}
|
||||
>
|
||||
{t('common:common.Confirm')}
|
||||
{t('common:Confirm')}
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
</MyModal>
|
||||
|
||||
@@ -117,7 +117,7 @@ const CollectionCard = () => {
|
||||
onSuccess() {
|
||||
getData(pageNum);
|
||||
},
|
||||
successToast: t('common:common.Update Success')
|
||||
successToast: t('common:update_success')
|
||||
}
|
||||
);
|
||||
|
||||
@@ -135,8 +135,8 @@ const CollectionCard = () => {
|
||||
onSuccess() {
|
||||
getData(pageNum);
|
||||
},
|
||||
successToast: t('common:common.Delete Success'),
|
||||
errorToast: t('common:common.Delete Failed')
|
||||
successToast: t('common:delete_success'),
|
||||
errorToast: t('common:delete_failed')
|
||||
}
|
||||
);
|
||||
|
||||
@@ -203,11 +203,11 @@ const CollectionCard = () => {
|
||||
<Table variant={'simple'} draggable={false}>
|
||||
<Thead draggable={false}>
|
||||
<Tr>
|
||||
<Th py={4}>{t('common:common.Name')}</Th>
|
||||
<Th py={4}>{t('common:Name')}</Th>
|
||||
<Th py={4}>{t('dataset:collection.training_type')}</Th>
|
||||
<Th py={4}>{t('dataset:collection_data_count')}</Th>
|
||||
<Th py={4}>{t('dataset:collection.Create update time')}</Th>
|
||||
<Th py={4}>{t('common:common.Status')}</Th>
|
||||
<Th py={4}>{t('common:Status')}</Th>
|
||||
<Th py={4}>{t('dataset:Enable')}</Th>
|
||||
<Th py={4} />
|
||||
</Tr>
|
||||
@@ -246,10 +246,7 @@ const CollectionCard = () => {
|
||||
<Td minW={'150px'} maxW={['200px', '300px']} draggable py={2}>
|
||||
<Flex alignItems={'center'}>
|
||||
<MyIcon name={collection.icon as any} w={'1.25rem'} mr={2} />
|
||||
<MyTooltip
|
||||
label={t('common:common.folder.Drag Tip')}
|
||||
shouldWrapChildren={false}
|
||||
>
|
||||
<MyTooltip label={t('common:click_drag_tip')} shouldWrapChildren={false}>
|
||||
<Box color={'myGray.900'} fontWeight={'500'} className="textEllipsis">
|
||||
{collection.name}
|
||||
</Box>
|
||||
@@ -400,7 +397,7 @@ const CollectionCard = () => {
|
||||
w={'0.9rem'}
|
||||
_hover={{ color: 'red.600' }}
|
||||
/>
|
||||
<Box>{t('common:common.Delete')}</Box>
|
||||
<Box>{t('common:Delete')}</Box>
|
||||
</Flex>
|
||||
),
|
||||
type: 'danger',
|
||||
@@ -458,7 +455,7 @@ const CollectionCard = () => {
|
||||
setMoveCollectionData(undefined);
|
||||
toast({
|
||||
status: 'success',
|
||||
title: t('common:common.folder.Move Success')
|
||||
title: t('common:move_success')
|
||||
});
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -102,7 +102,7 @@ const DataCard = () => {
|
||||
return prev.filter((data) => data._id !== dataId);
|
||||
});
|
||||
toast({
|
||||
title: t('common:common.Delete Success'),
|
||||
title: t('common:delete_success'),
|
||||
status: 'success'
|
||||
});
|
||||
} catch (error) {
|
||||
|
||||
@@ -77,7 +77,7 @@ const PromptTextarea = ({
|
||||
onClose();
|
||||
}}
|
||||
>
|
||||
{t('common:common.Confirm')}
|
||||
{t('common:Confirm')}
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
</MyModal>
|
||||
|
||||
@@ -338,7 +338,7 @@ const DatasetImportContextProvider = ({ children }: { children: React.ReactNode
|
||||
})
|
||||
}
|
||||
/>
|
||||
{t('common:common.Exit')}
|
||||
{t('common:Exit')}
|
||||
</Flex>
|
||||
) : (
|
||||
<Button
|
||||
@@ -346,7 +346,7 @@ const DatasetImportContextProvider = ({ children }: { children: React.ReactNode
|
||||
leftIcon={<MyIcon name={'common/backFill'} w={'14px'} />}
|
||||
onClick={goToPrevious}
|
||||
>
|
||||
{t('common:common.Last Step')}
|
||||
{t('common:last_step')}
|
||||
</Button>
|
||||
)}
|
||||
<Box flex={1} />
|
||||
|
||||
@@ -106,7 +106,7 @@ function DataProcess() {
|
||||
goToNext();
|
||||
}}
|
||||
>
|
||||
{t('common:common.Next Step')}
|
||||
{t('common:next_step')}
|
||||
</Button>
|
||||
</Flex>
|
||||
</Accordion>
|
||||
|
||||
@@ -167,7 +167,7 @@ const PreviewData = () => {
|
||||
</Flex>
|
||||
</Flex>
|
||||
<Flex mt={2} justifyContent={'flex-end'}>
|
||||
<Button onClick={goToNext}>{t('common:common.Next Step')}</Button>
|
||||
<Button onClick={goToNext}>{t('common:next_step')}</Button>
|
||||
</Flex>
|
||||
</Flex>
|
||||
);
|
||||
|
||||
@@ -184,7 +184,7 @@ const Upload = () => {
|
||||
title:
|
||||
importSource === ImportDataSourceEnum.reTraining
|
||||
? t('dataset:retrain_task_submitted')
|
||||
: t('common:core.dataset.import.Import success'),
|
||||
: t('common:core.dataset.import.import_success'),
|
||||
status: 'success'
|
||||
});
|
||||
}
|
||||
@@ -227,7 +227,7 @@ const Upload = () => {
|
||||
{t('common:core.dataset.import.Upload status')}
|
||||
</Th>
|
||||
<Th borderRightRadius={'md'} borderBottom={'none'} py={4}>
|
||||
{t('common:common.Action')}
|
||||
{t('common:Action')}
|
||||
</Th>
|
||||
</Tr>
|
||||
</Thead>
|
||||
@@ -247,20 +247,20 @@ const Upload = () => {
|
||||
{item.errorMsg ? (
|
||||
<Tooltip label={item.errorMsg} fontSize="md">
|
||||
<Flex alignItems="center">
|
||||
<MyTag colorSchema={'red'}>{t('common:common.Error')}</MyTag>
|
||||
<MyTag colorSchema={'red'}>{t('common:Error')}</MyTag>
|
||||
<QuestionOutlineIcon ml={2} color="red.500" w="14px" />
|
||||
</Flex>
|
||||
</Tooltip>
|
||||
) : (
|
||||
<>
|
||||
{item.createStatus === 'waiting' && (
|
||||
<MyTag colorSchema={'gray'}>{t('common:common.Waiting')}</MyTag>
|
||||
<MyTag colorSchema={'gray'}>{t('common:Waiting')}</MyTag>
|
||||
)}
|
||||
{item.createStatus === 'creating' && (
|
||||
<MyTag colorSchema={'blue'}>{t('common:common.Creating')}</MyTag>
|
||||
<MyTag colorSchema={'blue'}>{t('common:Creating')}</MyTag>
|
||||
)}
|
||||
{item.createStatus === 'finish' && (
|
||||
<MyTag colorSchema={'green'}>{t('common:common.Finish')}</MyTag>
|
||||
<MyTag colorSchema={'green'}>{t('common:Finish')}</MyTag>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -13,7 +13,6 @@ import { useSystemStore } from '@/web/common/system/useSystemStore';
|
||||
import { uploadFile2DB } from '@/web/common/file/controller';
|
||||
import { BucketNameEnum } from '@fastgpt/global/common/file/constants';
|
||||
import { ImportSourceItemType } from '@/web/core/dataset/type';
|
||||
import { useI18n } from '@/web/context/I18n';
|
||||
import { useContextSelector } from 'use-context-selector';
|
||||
import { DatasetPageContext } from '@/web/core/dataset/context/datasetPageContext';
|
||||
import { getErrText } from '@fastgpt/global/common/error/utils';
|
||||
@@ -39,7 +38,6 @@ const FileSelector = ({
|
||||
onFinishSelect: () => void;
|
||||
} & FlexProps) => {
|
||||
const { t } = useTranslation();
|
||||
const { fileT } = useI18n();
|
||||
|
||||
const { toast } = useToast();
|
||||
const { feConfigs } = useSystemStore();
|
||||
@@ -157,7 +155,7 @@ const FileSelector = ({
|
||||
files = files.slice(0, maxCount - selectFiles.length);
|
||||
toast({
|
||||
status: 'warning',
|
||||
title: fileT('some_file_count_exceeds_limit', { maxCount })
|
||||
title: t('file:some_file_count_exceeds_limit', { maxCount })
|
||||
});
|
||||
}
|
||||
// size check
|
||||
@@ -169,13 +167,13 @@ const FileSelector = ({
|
||||
if (filterFiles.length < files.length) {
|
||||
toast({
|
||||
status: 'warning',
|
||||
title: fileT('some_file_size_exceeds_limit', { maxSize: formatFileSize(maxSize) })
|
||||
title: t('file:some_file_size_exceeds_limit', { maxSize: formatFileSize(maxSize) })
|
||||
});
|
||||
}
|
||||
|
||||
return onSelectFile(filterFiles);
|
||||
},
|
||||
[fileT, maxCount, maxSize, onSelectFile, selectFiles.length, toast]
|
||||
[t, maxCount, maxSize, onSelectFile, selectFiles.length, toast]
|
||||
);
|
||||
|
||||
const handleDragEnter = (e: DragEvent<HTMLDivElement>) => {
|
||||
@@ -270,7 +268,7 @@ const FileSelector = ({
|
||||
);
|
||||
} else {
|
||||
return toast({
|
||||
title: fileT('upload_error_description'),
|
||||
title: t('file:upload_error_description'),
|
||||
status: 'error'
|
||||
});
|
||||
}
|
||||
@@ -318,18 +316,18 @@ const FileSelector = ({
|
||||
<>
|
||||
<Box fontWeight={'bold'}>
|
||||
{isDragging
|
||||
? fileT('release_the_mouse_to_upload_the_file')
|
||||
: fileT('select_and_drag_file_tip')}
|
||||
? t('file:release_the_mouse_to_upload_the_file')
|
||||
: t('file:select_and_drag_file_tip')}
|
||||
</Box>
|
||||
{/* file type */}
|
||||
<Box color={'myGray.500'} fontSize={'xs'}>
|
||||
{fileT('support_file_type', { fileType })}
|
||||
{t('file:support_file_type', { fileType })}
|
||||
</Box>
|
||||
<Box color={'myGray.500'} fontSize={'xs'}>
|
||||
{/* max count */}
|
||||
{maxCount && fileT('support_max_count', { maxCount })}
|
||||
{maxCount && t('file:support_max_count', { maxCount })}
|
||||
{/* max size */}
|
||||
{maxSize && fileT('support_max_size', { maxSize: formatFileSize(maxSize) })}
|
||||
{maxSize && t('file:support_max_size', { maxSize: formatFileSize(maxSize) })}
|
||||
</Box>
|
||||
|
||||
<File
|
||||
|
||||
@@ -55,7 +55,7 @@ const FileModeSelector = ({ onClose }: { onClose: () => void }) => {
|
||||
})
|
||||
}
|
||||
>
|
||||
{t('common:common.Confirm')}
|
||||
{t('common:Confirm')}
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
</MyModal>
|
||||
|
||||
@@ -15,10 +15,8 @@ import {
|
||||
import { ImportSourceItemType } from '@/web/core/dataset/type.d';
|
||||
import MyIcon from '@fastgpt/web/components/common/Icon';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
import { useI18n } from '@/web/context/I18n';
|
||||
import MyTooltip from '@fastgpt/web/components/common/MyTooltip';
|
||||
import MyTag from '@fastgpt/web/components/common/Tag/index';
|
||||
import { QuestionOutlineIcon } from '@chakra-ui/icons';
|
||||
|
||||
export const RenderUploadFiles = ({
|
||||
files,
|
||||
@@ -28,7 +26,6 @@ export const RenderUploadFiles = ({
|
||||
setFiles: React.Dispatch<React.SetStateAction<ImportSourceItemType[]>>;
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const { fileT } = useI18n();
|
||||
|
||||
return files.length > 0 ? (
|
||||
<>
|
||||
@@ -37,16 +34,16 @@ export const RenderUploadFiles = ({
|
||||
<Thead draggable={false}>
|
||||
<Tr bg={'myGray.100'} mb={2}>
|
||||
<Th borderLeftRadius={'md'} borderBottom={'none'} py={4}>
|
||||
{fileT('file_name')}
|
||||
{t('file:file_name')}
|
||||
</Th>
|
||||
<Th borderBottom={'none'} py={4}>
|
||||
{t('common:core.dataset.import.Upload file progress')}
|
||||
</Th>
|
||||
<Th borderBottom={'none'} py={4}>
|
||||
{fileT('file_size')}
|
||||
{t('file:file_size')}
|
||||
</Th>
|
||||
<Th borderRightRadius={'md'} borderBottom={'none'} py={4}>
|
||||
{t('common:common.Action')}
|
||||
{t('common:Action')}
|
||||
</Th>
|
||||
</Tr>
|
||||
</Thead>
|
||||
@@ -63,7 +60,7 @@ export const RenderUploadFiles = ({
|
||||
{item.errorMsg ? (
|
||||
<MyTooltip label={item.errorMsg}>
|
||||
<MyTag colorSchema={'red'}>
|
||||
<Box mr={1}>{t('common:common.Error')}</Box>
|
||||
<Box mr={1}>{t('common:Error')}</Box>
|
||||
<MyIcon name={'help'} w={'0.9rem'} color={'red.500'} />
|
||||
</MyTag>
|
||||
</MyTooltip>
|
||||
|
||||
@@ -277,7 +277,7 @@ const CustomAPIFileInput = () => {
|
||||
{selectFiles.length > 0
|
||||
? `${t('dataset:total_num_files', { total: selectFiles.length })} | `
|
||||
: ''}
|
||||
{t('common:common.Next Step')}
|
||||
{t('common:next_step')}
|
||||
</Button>
|
||||
</Box>
|
||||
</Flex>
|
||||
|
||||
@@ -180,7 +180,7 @@ const CustomLinkInput = () => {
|
||||
goToNext();
|
||||
})}
|
||||
>
|
||||
{t('common:common.Next Step')}
|
||||
{t('common:next_step')}
|
||||
</Button>
|
||||
</Flex>
|
||||
</Box>
|
||||
|
||||
@@ -99,9 +99,7 @@ const CustomTextInput = () => {
|
||||
/>
|
||||
</Box>
|
||||
<Flex mt={5} justifyContent={'flex-end'}>
|
||||
<Button onClick={handleSubmit((data) => onSubmit(data))}>
|
||||
{t('common:common.Next Step')}
|
||||
</Button>
|
||||
<Button onClick={handleSubmit((data) => onSubmit(data))}>{t('common:next_step')}</Button>
|
||||
</Flex>
|
||||
</Box>
|
||||
);
|
||||
|
||||
@@ -147,7 +147,7 @@ const CustomLinkImport = () => {
|
||||
goToNext();
|
||||
})}
|
||||
>
|
||||
{t('common:common.Next Step')}
|
||||
{t('common:next_step')}
|
||||
</Button>
|
||||
</Flex>
|
||||
</Box>
|
||||
|
||||
@@ -71,7 +71,7 @@ const SelectFile = React.memo(function SelectFile() {
|
||||
{selectFiles.length > 0
|
||||
? `${t('dataset:total_num_files', { total: selectFiles.length })} | `
|
||||
: ''}
|
||||
{t('common:common.Next Step')}
|
||||
{t('common:next_step')}
|
||||
</Button>
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
@@ -93,7 +93,7 @@ const SelectFile = React.memo(function SelectFile() {
|
||||
{selectFiles.length > 0
|
||||
? `${t('dataset:total_num_files', { total: selectFiles.length })} | `
|
||||
: ''}
|
||||
{t('common:common.Next Step')}
|
||||
{t('common:next_step')}
|
||||
</Button>
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
@@ -45,7 +45,7 @@ const EditAPIDatasetInfoModal = ({
|
||||
{
|
||||
onSuccess: (res) => {
|
||||
toast({
|
||||
title: t('common:common.Update Success'),
|
||||
title: t('common:update_success'),
|
||||
status: 'success'
|
||||
});
|
||||
onClose();
|
||||
@@ -74,7 +74,7 @@ const EditAPIDatasetInfoModal = ({
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button isLoading={loading} onClick={form.handleSubmit(onSave)} px={6}>
|
||||
{t('common:common.Confirm')}
|
||||
{t('common:Confirm')}
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
</MyModal>
|
||||
|
||||
@@ -60,13 +60,13 @@ const Info = ({ datasetId }: { datasetId: string }) => {
|
||||
type: 'delete'
|
||||
});
|
||||
const { openConfirm: onOpenConfirmRebuild, ConfirmModal: ConfirmRebuildModal } = useConfirm({
|
||||
title: t('common:common.confirm.Common Tip'),
|
||||
title: t('common:action_confirm'),
|
||||
content: t('dataset:confirm_to_rebuild_embedding_tip'),
|
||||
type: 'delete'
|
||||
});
|
||||
const { openConfirm: onOpenConfirmSyncSchedule, ConfirmModal: ConfirmSyncScheduleModal } =
|
||||
useConfirm({
|
||||
title: t('common:common.confirm.Common Tip')
|
||||
title: t('common:action_confirm')
|
||||
});
|
||||
|
||||
const { runAsync: onSave } = useRequest2(
|
||||
@@ -79,8 +79,8 @@ const Info = ({ datasetId }: { datasetId: string }) => {
|
||||
});
|
||||
},
|
||||
{
|
||||
successToast: t('common:common.Update Success'),
|
||||
errorToast: t('common:common.Update Failed')
|
||||
successToast: t('common:update_success'),
|
||||
errorToast: t('common:update_failed')
|
||||
}
|
||||
);
|
||||
|
||||
@@ -97,7 +97,7 @@ const Info = ({ datasetId }: { datasetId: string }) => {
|
||||
loadDatasetDetail(datasetId);
|
||||
},
|
||||
successToast: t('dataset:rebuild_embedding_start_tip'),
|
||||
errorToast: t('common:common.Update Failed')
|
||||
errorToast: t('common:update_failed')
|
||||
}
|
||||
);
|
||||
|
||||
@@ -105,8 +105,8 @@ const Info = ({ datasetId }: { datasetId: string }) => {
|
||||
onSuccess() {
|
||||
setEditedDataset(undefined);
|
||||
},
|
||||
successToast: t('common:common.Update Success'),
|
||||
errorToast: t('common:common.Update Failed')
|
||||
successToast: t('common:update_success'),
|
||||
errorToast: t('common:update_failed')
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -168,14 +168,14 @@ const InputDataModal = ({
|
||||
});
|
||||
onSuccess(e);
|
||||
},
|
||||
errorToast: t('common:common.error.unKnow')
|
||||
errorToast: t('common:error.unKnow')
|
||||
}
|
||||
);
|
||||
|
||||
// update
|
||||
const { runAsync: onUpdateData, loading: isUpdating } = useRequest2(
|
||||
async (e: InputDataType) => {
|
||||
if (!dataId) return Promise.reject(t('common:common.error.unKnow'));
|
||||
if (!dataId) return Promise.reject(t('common:error.unKnow'));
|
||||
|
||||
await putDatasetDataById({
|
||||
dataId,
|
||||
@@ -229,7 +229,7 @@ const InputDataModal = ({
|
||||
overflow={'hidden'}
|
||||
textOverflow={'ellipsis'}
|
||||
>
|
||||
{collection.sourceName || t('common:common.UnKnow Source')}
|
||||
{collection.sourceName || t('common:unknow_source')}
|
||||
</Box>
|
||||
</Flex>
|
||||
}
|
||||
@@ -417,7 +417,7 @@ const InputDataModal = ({
|
||||
// @ts-ignore
|
||||
onClick={handleSubmit(dataId ? onUpdateData : sureImportData)}
|
||||
>
|
||||
{dataId ? t('common:common.Confirm Update') : t('common:common.Confirm Import')}
|
||||
{dataId ? t('common:confirm_update') : t('common:comfirm_import')}
|
||||
</Button>
|
||||
</MyTooltip>
|
||||
</ModalFooter>
|
||||
|
||||
@@ -96,7 +96,7 @@ const NavBar = ({ currentTab }: { currentTab: TabEnum }) => {
|
||||
},
|
||||
{ label: t('common:core.dataset.test.Search Test'), value: TabEnum.test },
|
||||
...(datasetDetail.permission.hasManagePer && !isPc
|
||||
? [{ label: t('common:common.Config'), value: TabEnum.info }]
|
||||
? [{ label: t('common:Config'), value: TabEnum.info }]
|
||||
: [])
|
||||
];
|
||||
|
||||
|
||||
@@ -106,8 +106,8 @@ const CreateModal = ({
|
||||
const { run: onclickCreate, loading: creating } = useRequest2(
|
||||
async (data: CreateDatasetParams) => await postCreateDataset(data),
|
||||
{
|
||||
successToast: t('common:common.Create Success'),
|
||||
errorToast: t('common:common.Create Failed'),
|
||||
successToast: t('common:create_success'),
|
||||
errorToast: t('common:create_failed'),
|
||||
onSuccess(id) {
|
||||
router.push(`/dataset/detail?datasetId=${id}`);
|
||||
}
|
||||
@@ -137,7 +137,7 @@ const CreateModal = ({
|
||||
<Box>
|
||||
<Flex justify={'space-between'}>
|
||||
<Box color={'myGray.900'} fontWeight={500} fontSize={'sm'}>
|
||||
{t('common:common.Set Name')}
|
||||
{t('common:input_name')}
|
||||
</Box>
|
||||
{datasetTypeCourseMap[type] && (
|
||||
<Flex
|
||||
@@ -154,7 +154,7 @@ const CreateModal = ({
|
||||
)}
|
||||
</Flex>
|
||||
<Flex mt={'12px'} alignItems={'center'}>
|
||||
<MyTooltip label={t('common:common.avatar.Select Avatar')}>
|
||||
<MyTooltip label={t('common:click_select_avatar')}>
|
||||
<Avatar
|
||||
flexShrink={0}
|
||||
src={avatar}
|
||||
@@ -170,7 +170,7 @@ const CreateModal = ({
|
||||
flex={1}
|
||||
autoFocus
|
||||
bg={'myWhite.600'}
|
||||
placeholder={t('common:common.Name')}
|
||||
placeholder={t('common:Name')}
|
||||
maxLength={30}
|
||||
{...register('name', {
|
||||
required: true
|
||||
@@ -281,10 +281,10 @@ const CreateModal = ({
|
||||
|
||||
<ModalFooter px={9}>
|
||||
<Button variant={'whiteBase'} mr={3} onClick={onClose}>
|
||||
{t('common:common.Close')}
|
||||
{t('common:Close')}
|
||||
</Button>
|
||||
<Button isLoading={creating} onClick={handleSubmit((data) => onclickCreate(data))}>
|
||||
{t('common:common.Confirm Create')}
|
||||
{t('common:comfirn_create')}
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
|
||||
|
||||
@@ -161,8 +161,8 @@ function List() {
|
||||
<Flex flexDirection={'column'} alignItems={'center'}>
|
||||
<Box fontSize={'xs'} color={'myGray.500'}>
|
||||
{dataset.type === DatasetTypeEnum.folder
|
||||
? t('common:common.folder.Open folder')
|
||||
: t('common:common.folder.open_dataset')}
|
||||
? t('common:open_folder')
|
||||
: t('common:folder.open_dataset')}
|
||||
</Box>
|
||||
</Flex>
|
||||
}
|
||||
@@ -373,7 +373,7 @@ function List() {
|
||||
children: [
|
||||
{
|
||||
icon: 'delete',
|
||||
label: t('common:common.Delete'),
|
||||
label: t('common:Delete'),
|
||||
type: 'danger' as 'danger',
|
||||
onClick: () => onClickDeleteDataset(dataset._id)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user