I18n Translations (#2267)

* rebase

* i18n-1

* add error info i18n

* fix

* fix

* refactor: 删除error.json

* delete useI18n
This commit is contained in:
papapatrick
2024-08-05 18:42:21 +08:00
committed by GitHub
parent 025d405fe2
commit 10dcdb5491
107 changed files with 1128 additions and 416 deletions

View File

@@ -46,7 +46,7 @@ const ExtraPlan = () => {
if (datasetSizePayAmount === 0) {
return toast({
status: 'warning',
title: '购买数量不能为0'
title: t('common:support.wallet.amount_0')
});
}
setLoading(true);
@@ -91,7 +91,7 @@ const ExtraPlan = () => {
if (payAmount === 0) {
return toast({
status: 'warning',
title: '购买数量不能为0'
title: t('common:support.wallet.amount_0')
});
}
setLoading(true);
@@ -147,7 +147,7 @@ const ExtraPlan = () => {
{t('common:support.wallet.subscription.Extra dataset size')}
</Box>
<Box mt={3} fontSize={['28px', '32px']} fontWeight={'bold'}>
{extraDatasetPrice}/1000{' '}
{`${extraDatasetPrice}/1000` + t('common:core.dataset.data.group')}
<Box ml={1} as={'span'} fontSize={'md'} color={'myGray.600'} fontWeight={'normal'}>
/{t('common:common.month')}
</Box>
@@ -164,7 +164,7 @@ const ExtraPlan = () => {
<Box h={'120px'} w={'100%'}>
<Flex mt={4}>
<MyIcon mr={2} name={'support/bill/shoppingCart'} w={'16px'} color={'primary.600'} />
{t('common:support.wallet.buy_resource')}
</Flex>
<Flex mt={4} alignItems={'center'}>
<Box flex={['0 0 100px', '1 0 0']}>
@@ -252,7 +252,7 @@ const ExtraPlan = () => {
{t('common:support.wallet.subscription.Extra ai points')}
</Box>
<Box mt={3} fontSize={['28px', '32px']} fontWeight={'bold'}>
{extraPointsPrice}/1000{' '}
{`${extraDatasetPrice}/1000` + t('common:support.wallet.subscription.point')}
<Box ml={1} as={'span'} fontSize={'md'} color={'myGray.600'} fontWeight={'normal'}>
/{t('common:common.month')}
</Box>
@@ -269,7 +269,7 @@ const ExtraPlan = () => {
<Box h={'120px'} w={'100%'}>
<Flex mt={4}>
<MyIcon mr={2} name={'support/bill/shoppingCart'} w={'16px'} color={'primary.600'} />
{t('common:support.wallet.buy_resource')}
</Flex>
{/* <Flex mt={4} alignItems={'center'}>
<Box flex={['0 0 100px', '1 0 0']}>
@@ -325,7 +325,7 @@ const ExtraPlan = () => {
</NumberInputStepper>
</NumberInput>
<Box position={'absolute'} right={'20px'} color={'myGray.500'} fontSize={'xs'}>
000
{'000' + t('common:support.wallet.subscription.point')}
</Box>
</Flex>
</Flex>

View File

@@ -6,36 +6,36 @@ const FAQ = () => {
const { t } = useTranslation();
const faqs = [
{
title: '订阅套餐会自动续费么?',
desc: '当前套餐过期后,系统会自动根据“未来套餐”进行续费,系统会尝试从账户余额进行扣费,如果您需要自动续费,请在账户余额中预留额度。'
title: t('common:FAQ.auto_renew_q'),
desc: t('common:FAQ.auto_renew_a')
},
{
title: '能否切换订阅套餐?',
desc: '当前套餐价格大于新套餐时,无法立即切换,将会在当前套餐过期后以“续费”形式进行切换。\n当前套餐价格小于新套餐时系统会自动计算当前套餐剩余余额您可支付差价进行套餐切换。'
title: t('common:FAQ.change_package_q'),
desc: t('common:FAQ.change_package_a')
},
{
title: '什么是AI积分',
desc: '每次调用AI模型时都会消耗一定的AI积分。具体的计算标准可参考上方的“AI 积分计算标准”。\nToken计算采用GPT3.5相同公式1Token≈0.7中文字符≈0.9英文单词连续出现的字符可能被认为是1个Tokens。'
title: t('common:FAQ.ai_point_q'),
desc: t('common:FAQ.ai_point_a')
},
{
title: 'AI积分会过期么',
desc: '会过期。当前套餐过期后AI积分将会清空并更新为新套餐的AI积分。年度套餐的AI积分时长为1年而不是每个月。'
title: t('common:FAQ.ai_point_expire_q'),
desc: t('common:FAQ.ai_point_expire_a')
},
{
title: '知识库存储怎么计算?',
desc: '1条知识库存储等于1条知识库索引。一条知识库数据可以包含1条或多条知识库索引。增强训练中1条数据会生成5条索引。'
title: t('common:FAQ.dataset_compute_q'),
desc: t('common:FAQ.dataset_compute_a')
},
{
title: '知识库索引超出会删除么?',
desc: '不会。但知识库索引超出时,无法插入和更新知识库内容。'
title: t('common:FAQ.dataset_index_q'),
desc: t('common:FAQ.dataset_index_a')
},
{
title: '额外资源包可以叠加么?',
desc: '可以的。每次购买的资源包都是独立的在其有效期内将会叠加使用。AI积分会优先扣除最先过期的资源包。'
title: t('common:FAQ.package_overlay_q'),
desc: t('common:FAQ.package_overlay_a')
},
{
title: '免费版数据会清除么?',
desc: '免费版用户免费版且未购买额外套餐30天无使用记录后系统会自动清除账号下所有知识库内容。'
title: t('common:FAQ.free_user_clean_q'),
desc: t('common:FAQ.free_user_clean_a')
}
];

View File

@@ -1,7 +1,6 @@
import React from 'react';
import { Box, Flex, Grid, Link } from '@chakra-ui/react';
import { useTranslation } from 'next-i18next';
import { useSystemStore } from '@/web/common/system/useSystemStore';
const Points = () => {
@@ -19,7 +18,7 @@ const Points = () => {
{t('common:support.wallet.subscription.Ai points')}
</Box>
<Link href="https://tiktokenizer.vercel.app/" target="_blank">
线 Tokens
{t('common:support.wallet.subscription.token_compute')}
</Link>
<Grid gap={6} mt={['30px', '40px']} w={'100%'}>
<Box
@@ -39,13 +38,17 @@ const Points = () => {
fontSize={'md'}
fontWeight={'bold'}
>
AI语言模型
{t('common:support.wallet.subscription.ai_model')}
</Box>
<Box flex={4} textAlign={'center'}>
{llmModelList?.map((item, i) => (
<Flex key={item.model} py={4} bg={i % 2 !== 0 ? 'myGray.50' : ''}>
<Box flex={'1 0 0'}>{item.name}</Box>
<Box flex={'1 0 0'}>{item.charsPointsPrice} / 1000 Tokens</Box>
<Box flex={'1 0 0'}>
{item.charsPointsPrice +
t('common:support.wallet.subscription.point') +
' / 1000 Tokens'}
</Box>
</Flex>
))}
</Box>
@@ -60,17 +63,21 @@ const Points = () => {
>
<Box flex={1} borderRightWidth={'1px'} borderRightColor={'myGray.150'} py={4} px={6}>
<Box fontSize={'md'} fontWeight={'bold'}>
{t('common:core.ai.model.Vector Model')}
</Box>
<Box fontSize={'sm'} mt={1} color={'myGray.500'}>
&
{t('common:core.ai.model.doc_index_and_dialog')}
</Box>
</Box>
<Box flex={4} textAlign={'center'}>
{vectorModelList?.map((item, i) => (
<Flex key={item.model} py={4} bg={i % 2 !== 0 ? 'myGray.50' : ''}>
<Box flex={'1 0 0'}>{item.name}</Box>
<Box flex={'1 0 0'}>{item.charsPointsPrice} / 1000 Tokens</Box>
<Box flex={'1 0 0'}>
{item.charsPointsPrice +
t('common:support.wallet.subscription.point') +
' / 1000 Tokens'}
</Box>
</Flex>
))}
</Box>
@@ -85,14 +92,19 @@ const Points = () => {
>
<Box flex={1} borderRightWidth={'1px'} borderRightColor={'myGray.150'} py={4} px={6}>
<Box fontSize={'md'} fontWeight={'bold'}>
{t('common:core.app.TTS')}
</Box>
</Box>
<Box flex={4} textAlign={'center'}>
{audioSpeechModelList?.map((item, i) => (
<Flex key={item.model} py={4} bg={i % 2 !== 0 ? 'myGray.50' : ''}>
<Box flex={'1 0 0'}>{item.name}</Box>
<Box flex={'1 0 0'}>{item.charsPointsPrice} / 1000</Box>
<Box flex={'1 0 0'}>
{item.charsPointsPrice +
t('common:support.wallet.subscription.point') +
' / 1000' +
t('common:unit.character')}
</Box>
</Flex>
))}
</Box>
@@ -107,13 +119,18 @@ const Points = () => {
>
<Box flex={1} borderRightWidth={'1px'} borderRightColor={'myGray.150'} py={4} px={6}>
<Box fontSize={'md'} fontWeight={'bold'}>
{t('common:core.app.Whisper')}
</Box>
</Box>
<Box flex={4} textAlign={'center'} h={'100%'}>
<Flex py={4}>
<Box flex={'1 0 0'}>{whisperModel?.name}</Box>
<Box flex={'1 0 0'}>{whisperModel?.charsPointsPrice} / </Box>
<Box flex={'1 0 0'}>
{whisperModel?.charsPointsPrice +
t('common:support.wallet.subscription.point') +
' / 1000' +
t('common:unit.minute')}
</Box>
</Flex>
</Box>
</Box>

View File

@@ -309,6 +309,7 @@ const ConfirmPayModal = ({
onConfirmPay
}: ConfirmPayModalProps & { onClose: () => void; onConfirmPay: () => void }) => {
const { t } = useTranslation();
const [qrPayData, setQRPayData] = useState<QRPayProps>();
const formatPayPrice = Math.ceil(formatStorePrice2Read(payPrice));
@@ -340,16 +341,24 @@ const ConfirmPayModal = ({
>
<ModalBody py={5} px={9}>
<Flex>
<Box flex={'0 0 100px'}></Box>
<Box>{formatStorePrice2Read(totalPrice)}</Box>
<Box flex={'0 0 100px'}>{t('common:pay.new_package_price')}</Box>
<Box>{t('common:pay.yuan', { amount: formatStorePrice2Read(totalPrice) })}</Box>
</Flex>
<Flex mt={6}>
<Box flex={'0 0 100px'}></Box>
<Box>{Math.floor(formatStorePrice2Read(totalPrice - payPrice))}</Box>
<Box flex={'0 0 100px'}>{t('common:pay.old_package_price')}</Box>
<Box>
{t('common:pay.yuan', {
amount: Math.floor(formatStorePrice2Read(totalPrice - payPrice))
})}
</Box>
</Flex>
<Flex mt={6}>
<Box flex={'0 0 100px'}></Box>
<Box>{formatPayPrice}</Box>
<Box flex={'0 0 100px'}>{t('common:pay.balance_notice')}</Box>
<Box>
{t('common:pay.yuan', {
amount: formatPayPrice
})}
</Box>
</Flex>
</ModalBody>
<ModalFooter
@@ -359,13 +368,15 @@ const ConfirmPayModal = ({
justifyContent={'flex-start'}
px={0}
>
<Box>: </Box>
<Box>{t('common:pay.balance') + ': '}</Box>
<Box ml={2} flex={1}>
{formatTeamBalance}
{t('common:pay.yuan', {
amount: formatTeamBalance
})}
</Box>
{teamBalance >= payPrice ? (
<Button size={'sm'} onClick={onConfirmPay}>
{t('common:pay.confirm_pay')}
</Button>
) : (
<Button
@@ -375,7 +386,7 @@ const ConfirmPayModal = ({
handleClickPay(Math.ceil(formatStorePrice2Read(payPrice - teamBalance)));
}}
>
{t('common:pay.to_recharge')}
</Button>
)}
</ModalFooter>