fix i18next.d.ts (#2064)

* fix i18next.d.ts

* feat: packages web i18n

* delete file
This commit is contained in:
jingyang
2024-07-17 15:27:51 +08:00
committed by GitHub
parent 36f8755d09
commit 982325d066
75 changed files with 216 additions and 204 deletions

View File

@@ -121,7 +121,7 @@ const Header = ({}: {}) => {
FirstPathDom={
<>
<Box fontWeight={'bold'} fontSize={['sm', 'md']}>
{t(DatasetTypeMap[datasetDetail?.type]?.collectionLabel)}({total})
{t(DatasetTypeMap[datasetDetail?.type]?.collectionLabel as any)}({total})
</Box>
{datasetDetail?.websiteConfig?.url && (
<Flex fontSize={'sm'}>

View File

@@ -137,7 +137,7 @@ const CollectionCard = () => {
getData(pageNum);
toast({
status: 'success',
title: t(DatasetCollectionSyncResultMap[res]?.label)
title: t(DatasetCollectionSyncResultMap[res]?.label as any)
});
},
errorToast: t('common:core.dataset.error.Start Sync Failed')
@@ -247,7 +247,7 @@ const CollectionCard = () => {
</Td>
<Td py={2}>
{!checkCollectionIsFolder(collection.type) ? (
<>{t(getTrainingTypeLabel(collection.trainingType) || '-')}</>
<>{t((getTrainingTypeLabel(collection.trainingType) || '-') as any)}</>
) : (
'-'
)}
@@ -259,7 +259,7 @@ const CollectionCard = () => {
</Td>
<Td py={2}>
<MyTag showDot colorSchema={collection.colorSchema as any} type={'borderFill'}>
{t(collection.statusText)}
{t(collection.statusText as any)}
</MyTag>
</Td>
<Td py={2} onClick={(e) => e.stopPropagation()}>

View File

@@ -142,7 +142,7 @@ const DataCard = () => {
return [
{
label: t('common:core.dataset.collection.metadata.source'),
value: t(DatasetCollectionTypeMap[collection.type]?.name)
value: t(DatasetCollectionTypeMap[collection.type]?.name as any)
},
{
label: t('common:core.dataset.collection.metadata.source name'),
@@ -166,7 +166,7 @@ const DataCard = () => {
},
{
label: t('common:core.dataset.collection.metadata.Training Type'),
value: t(TrainingTypeMap[collection.trainingType]?.label)
value: t(TrainingTypeMap[collection.trainingType]?.label as any)
},
{
label: t('common:core.dataset.collection.metadata.Chunk Size'),

View File

@@ -85,9 +85,9 @@ function DataProcess({ showPreviewChunks = true }: { showPreviewChunks: boolean
<FormLabel flex={'0 0 100px'}>{t('common:core.dataset.import.Training mode')}</FormLabel>
<LeftRadio
list={trainingModeList.map(([key, value]) => ({
title: t(value.label),
title: t(value.label as any),
value: key,
tooltip: t(value.tooltip)
tooltip: t(value.tooltip as any)
}))}
px={3}
py={2}

View File

@@ -81,7 +81,7 @@ const InputDataModal = ({
icon: 'common/overviewLight'
},
{
label: t('dataset.data.edit.Index', { amount: indexes.length }),
label: t('common:dataset.data.edit.Index', { amount: indexes.length }),
value: TabEnum.index,
icon: 'kbTest'
},
@@ -126,7 +126,7 @@ const InputDataModal = ({
onError(err) {
toast({
status: 'error',
title: t(getErrText(err))
title: t(getErrText(err) as any)
});
onClose();
}

View File

@@ -196,7 +196,7 @@ const Test = ({ datasetId }: { datasetId: string }) => {
size={'sm'}
onClick={onOpenSelectMode}
>
{t(searchModeData.title)}
{t(searchModeData.title as any)}
</Button>
</Flex>
@@ -371,7 +371,7 @@ const TestHistories = React.memo(function TestHistories({
w={'12px'}
mr={'1px'}
/>
{t(DatasetSearchModeMap[item.searchMode].title)}
{t(DatasetSearchModeMap[item.searchMode].title as any)}
</Flex>
) : (
'-'
@@ -382,7 +382,7 @@ const TestHistories = React.memo(function TestHistories({
</Box>
<Box flex={'0 0 70px'}>
{formatTimeToChatTime(item.time).includes('.')
? t(formatTimeToChatTime(item.time))
? t(formatTimeToChatTime(item.time) as any)
: formatTimeToChatTime(item.time)}
</Box>
<MyTooltip label={t('common:core.dataset.test.delete test history')}>

View File

@@ -45,7 +45,7 @@ const Detail = ({ datasetId, currentTab }: Props) => {
onError(err: any) {
router.replace(`/dataset/list`);
toast({
title: t(getErrText(err, t('common:common.Load Failed'))),
title: t(getErrText(err, t('common:common.Load Failed')) as any),
status: 'error'
});
}