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

@@ -45,7 +45,7 @@ const BillTable = () => {
[
{ label: t('common:common.All'), value: '' },
...Object.entries(billTypeMap).map(([key, value]) => ({
label: t(value.label),
label: t(value.label as any),
value: key
}))
] as {
@@ -130,12 +130,12 @@ const BillTable = () => {
{bills.map((item, i) => (
<Tr key={item._id}>
<Td>{i + 1}</Td>
<Td>{t(billTypeMap[item.type]?.label)}</Td>
<Td>{t(billTypeMap[item.type]?.label as any)}</Td>
<Td>
{item.createTime ? dayjs(item.createTime).format('YYYY/MM/DD HH:mm:ss') : '-'}
</Td>
<Td>{formatStorePrice2Read(item.price)}</Td>
<Td>{t(billStatusMap[item.status]?.label)}</Td>
<Td>{t(billStatusMap[item.status]?.label as any)}</Td>
<Td>
{item.status === 'NOTPAY' && (
<Button mr={4} onClick={() => handleRefreshPayOrder(item._id)} size={'sm'}>
@@ -201,12 +201,12 @@ function BillDetailModal({ bill, onClose }: { bill: BillSchemaType; onClose: ()
</Flex>
<Flex alignItems={'center'} pb={4}>
<FormLabel flex={'0 0 120px'}>{t('common:support.wallet.bill.Status')}:</FormLabel>
<Box>{t(billStatusMap[bill.status]?.label)}</Box>
<Box>{t(billStatusMap[bill.status]?.label as any)}</Box>
</Flex>
{!!bill.metadata?.payWay && (
<Flex alignItems={'center'} pb={4}>
<FormLabel flex={'0 0 120px'}>{t('common:support.wallet.bill.payWay.Way')}:</FormLabel>
<Box>{t(billPayWayMap[bill.metadata.payWay]?.label)}</Box>
<Box>{t(billPayWayMap[bill.metadata.payWay]?.label as any)}</Box>
</Flex>
)}
<Flex alignItems={'center'} pb={4}>
@@ -215,14 +215,14 @@ function BillDetailModal({ bill, onClose }: { bill: BillSchemaType; onClose: ()
</Flex>
<Flex alignItems={'center'} pb={4}>
<FormLabel flex={'0 0 120px'}>{t('common:support.wallet.bill.Type')}:</FormLabel>
<Box>{t(billTypeMap[bill.type]?.label)}</Box>
<Box>{t(billTypeMap[bill.type]?.label as any)}</Box>
</Flex>
{!!bill.metadata?.subMode && (
<Flex alignItems={'center'} pb={4}>
<FormLabel flex={'0 0 120px'}>
{t('common:support.wallet.subscription.mode.Period')}:
</FormLabel>
<Box>{t(subModeMap[bill.metadata.subMode]?.label)}</Box>
<Box>{t(subModeMap[bill.metadata.subMode]?.label as any)}</Box>
</Flex>
)}
{!!bill.metadata?.standSubLevel && (
@@ -230,7 +230,7 @@ function BillDetailModal({ bill, onClose }: { bill: BillSchemaType; onClose: ()
<FormLabel flex={'0 0 120px'}>
{t('common:support.wallet.subscription.Stand plan level')}:
</FormLabel>
<Box>{t(standardSubLevelMap[bill.metadata.standSubLevel]?.label)}</Box>
<Box>{t(standardSubLevelMap[bill.metadata.standSubLevel]?.label as any)}</Box>
</Flex>
)}
{bill.metadata?.month !== undefined && (

View File

@@ -404,7 +404,7 @@ const PlanUsage = () => {
{t('common:support.wallet.subscription.Current plan')}
</Box>
<Box fontWeight={'bold'} fontSize="lg">
{t(planName)}
{t(planName as any)}
</Box>
{isFreeTeam ? (

View File

@@ -77,11 +77,11 @@ const UsageDetail = ({ usage, onClose }: { usage: UsageItemType; onClose: () =>
</Flex>
<Flex alignItems={'center'} pb={4}>
<FormLabel flex={'0 0 80px'}>{t('common:support.wallet.usage.App name')}:</FormLabel>
<Box>{t(usage.appName) || '-'}</Box>
<Box>{t(usage.appName as any) || '-'}</Box>
</Flex>
<Flex alignItems={'center'} pb={4}>
<FormLabel flex={'0 0 80px'}>{t('common:support.wallet.usage.Source')}:</FormLabel>
<Box>{t(UsageSourceMap[usage.source]?.label)}</Box>
<Box>{t(UsageSourceMap[usage.source]?.label as any)}</Box>
</Flex>
<Flex alignItems={'center'} pb={4}>
<FormLabel flex={'0 0 80px'}>{t('common:support.wallet.usage.Total points')}:</FormLabel>
@@ -106,7 +106,7 @@ const UsageDetail = ({ usage, onClose }: { usage: UsageItemType; onClose: () =>
<Tbody>
{filterBillList.map((item, i) => (
<Tr key={i}>
<Td>{t(item.moduleName)}</Td>
<Td>{t(item.moduleName as any)}</Td>
{hasModel && <Td>{item.model ?? '-'}</Td>}
{hasToken && <Td>{item.tokens ?? '-'}</Td>}
{hasCharsLen && <Td>{item.charsLength ?? '-'}</Td>}

View File

@@ -51,7 +51,7 @@ const UsageTable = () => {
[
{ label: t('common:common.All'), value: '' },
...Object.entries(UsageSourceMap).map(([key, value]) => ({
label: t(value.label),
label: t(value.label as any),
value: key
}))
] as {
@@ -169,8 +169,8 @@ const UsageTable = () => {
<Tr key={item.id}>
{/* <Td>{item.memberName}</Td> */}
<Td>{dayjs(item.time).format('YYYY/MM/DD HH:mm:ss')}</Td>
<Td>{t(UsageSourceMap[item.source]?.label) || '-'}</Td>
<Td>{t(item.appName) || '-'}</Td>
<Td>{t(UsageSourceMap[item.source]?.label as any) || '-'}</Td>
<Td>{t(item.appName as any) || '-'}</Td>
<Td>{formatNumber(item.totalPoints) || 0}</Td>
<Td>
<Button size={'sm'} variant={'whitePrimary'} onClick={() => setUsageDetail(item)}>

View File

@@ -73,8 +73,9 @@ const StandDetailModal = ({ onClose }: { onClose: () => void }) => {
w={'20px'}
color={'myGray.800'}
/>
{t(subTypeMap[type]?.label)}
{currentSubLevel && `(${t(standardSubLevelMap[currentSubLevel]?.label)})`}
{t(subTypeMap[type]?.label as any)}
{currentSubLevel &&
`(${t(standardSubLevelMap[currentSubLevel]?.label as any)})`}
</Td>
<Td>{datasetSize ? `${datasetSize}` : '-'}</Td>
<Td>