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

@@ -103,7 +103,7 @@ const DateRangePicker = ({
mr={2}
onClick={() => setShowSelected(false)}
>
{t('common.Close')}
{t('common:common.Close')}
</Button>
<Button
size={'sm'}
@@ -112,7 +112,7 @@ const DateRangePicker = ({
setShowSelected(false);
}}
>
{t('common.Confirm')}
{t('common:common.Confirm')}
</Button>
</Flex>
}

View File

@@ -13,7 +13,7 @@ const EmptyTip = ({ text, ...props }: Props) => {
<Flex mt={5} flexDirection={'column'} alignItems={'center'} py={'10vh'} {...props}>
<MyIcon name="empty" w={'48px'} h={'48px'} color={'transparent'} />
<Box mt={2} color={'myGray.500'} fontSize={'sm'}>
{text || t('common.empty.Common Tip')}
{text || t('common:common.empty.Common Tip')}
</Box>
</Flex>
);

View File

@@ -41,10 +41,10 @@ const EditFolderModal = ({
() =>
isEdit
? {
title: t('dataset.Edit Folder')
title: t('common:dataset.Edit Folder')
}
: {
title: t('dataset.Create Folder')
title: t('common:dataset.Create Folder')
},
[isEdit, t]
);
@@ -67,7 +67,7 @@ const EditFolderModal = ({
<MyModal isOpen onClose={onClose} iconSrc="common/folderFill" title={typeMap.title}>
<ModalBody>
<Box>
<FormLabel mb={1}>{t('common.Input name')}</FormLabel>
<FormLabel mb={1}>{t('common:common.Input name')}</FormLabel>
<Input
{...register('name', { required: true })}
bg={'myGray.50'}
@@ -76,13 +76,13 @@ const EditFolderModal = ({
/>
</Box>
<Box mt={4}>
<FormLabel mb={1}>{t('common.Input folder description')}</FormLabel>
<FormLabel mb={1}>{t('common:common.Input folder description')}</FormLabel>
<Textarea {...register('intro')} bg={'myGray.50'} maxLength={200} />
</Box>
</ModalBody>
<ModalFooter>
<Button isLoading={loading} onClick={handleSubmit(onSave)} px={6}>
{t('common.Confirm')}
{t('common:common.Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -82,11 +82,11 @@ const PopoverConfirm = ({
<HStack mt={1} justifyContent={'flex-end'}>
{showCancel && (
<Button variant={'whiteBase'} size="sm" onClick={onClose}>
{t('common.Cancel')}
{t('common:common.Cancel')}
</Button>
)}
<Button isLoading={loading} variant={map.variant} size="sm" onClick={onclickConfirm}>
{t('common.Confirm')}
{t('common:common.Confirm')}
</Button>
</HStack>
</PopoverContent>

View File

@@ -80,7 +80,11 @@ const MultipleRowSelect = ({
</Flex>
))}
{list.length === 0 && (
<EmptyTip text={emptyTip ?? t('common.MultipleRowSelect.No data')} pt={1} pb={3} />
<EmptyTip
text={emptyTip ?? t('common:common.MultipleRowSelect.No data')}
pt={1}
pb={3}
/>
)}
</Box>
{children.length > 0 && <RenderList list={children} index={index + 1} />}

View File

@@ -96,13 +96,13 @@ const LeftRadio = ({
whiteSpace={'nowrap'}
fontSize={'sm'}
>
{typeof item.title === 'string' ? t(item.title) : item.title}
{typeof item.title === 'string' ? t(item.title as any) : item.title}
</Box>
{!!item.tooltip && <QuestionTip label={item.tooltip} ml={1} color={'myGray.600'} />}
</Flex>
{!!item.tooltip && <QuestionTip label={item.tooltip} ml={1} color={'myGray.600'} />}
{!!item.desc && (
<Box fontSize={'xs'} color={'myGray.500'} lineHeight={1.2}>
{t(item.desc)}
{t(item.desc as any)}
</Box>
)}
{item?.children}

View File

@@ -88,7 +88,7 @@ const LightRowTabs = <ValueType = string,>({
)}
</>
)}
{typeof item.label === 'string' ? t(item.label) : item.label}
{typeof item.label === 'string' ? t(item.label as any) : item.label}
</Flex>
))}
</Grid>

View File

@@ -17,7 +17,7 @@ const CodeEditor = (props: Props) => {
isOpen={isOpen}
onClose={onClose}
iconSrc="modal/edit"
title={t('Code editor')}
title={t('common:Code editor')}
w={'full'}
>
<ModalBody>
@@ -25,7 +25,7 @@ const CodeEditor = (props: Props) => {
</ModalBody>
<ModalFooter>
<Button mr={2} onClick={onClose} px={6}>
{t('common.Confirm')}
{t('common:common.Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -178,7 +178,7 @@ const JSONEditor = ({
} catch (error) {
toast({
status: 'warning',
title: t('common.jsonEditor.Parse error')
title: t('common:common.jsonEditor.Parse error')
});
}
}, [value]);

View File

@@ -79,7 +79,7 @@ const PromptEditor = ({
</ModalBody>
<ModalFooter>
<Button mr={2} onClick={onClose} px={6}>
{t('common.Confirm')}
{t('common:common.Confirm')}
</Button>
</ModalFooter>
</MyModal>