-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added English Version #188
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,9 @@ import { getErrText, useCopyData } from '@/utils/tools'; | |
import { useToast } from '@/hooks/useToast'; | ||
import MyIcon from '../Icon'; | ||
import MyModal from '../MyModal'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
const { t } = useTranslation(); | ||
const APIKeyModal = ({ onClose }: { onClose: () => void }) => { | ||
const { Loading } = useLoading(); | ||
const { toast } = useToast(); | ||
|
@@ -63,7 +65,7 @@ const APIKeyModal = ({ onClose }: { onClose: () => void }) => { | |
API 秘钥管理 | ||
</Box> | ||
<Box fontSize={'sm'} color={'myGray.600'}> | ||
如果你不想 API 秘钥被滥用,请勿将秘钥直接放置在前端使用~ | ||
{t('如果你不想 API 秘钥被滥用,请勿将秘钥直接放置在前端使用~')} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need to write it in English. en: If you do not want the API key to be abused, do not place the key directly on the front end zh: 如果你不想 API 秘钥被滥用,请勿将秘钥直接放置在前端使用~ |
||
</Box> | ||
</Box> | ||
<ModalBody minH={'300px'} maxH={['70vh', '500px']} overflow={'overlay'}> | ||
|
@@ -72,8 +74,8 @@ const APIKeyModal = ({ onClose }: { onClose: () => void }) => { | |
<Thead> | ||
<Tr> | ||
<Th>Api Key</Th> | ||
<Th>创建时间</Th> | ||
<Th>最后一次使用时间</Th> | ||
<Th>{t('创建时间')}</Th> | ||
<Th>{t('最后一次使用时间')}</Th> | ||
<Th /> | ||
</Tr> | ||
</Thead> | ||
|
@@ -85,7 +87,7 @@ const APIKeyModal = ({ onClose }: { onClose: () => void }) => { | |
<Td> | ||
{lastUsedTime | ||
? dayjs(lastUsedTime).format('YYYY/MM/DD HH:mm:ss') | ||
: '没有使用过'} | ||
: t('没有使用过')} | ||
</Td> | ||
<Td> | ||
<IconButton | ||
|
@@ -110,18 +112,18 @@ const APIKeyModal = ({ onClose }: { onClose: () => void }) => { | |
leftIcon={<AddIcon color={'myGray.600'} fontSize={'sm'} />} | ||
onClick={() => onclickCreateApiKey()} | ||
> | ||
新建秘钥 | ||
{t('新建秘钥')} | ||
</Button> | ||
</ModalFooter> | ||
|
||
<Loading loading={isGetting || isCreating || isDeleting} fixed={false} /> | ||
<MyModal isOpen={!!apiKey} w={'400px'} onClose={() => setApiKey('')}> | ||
<Box py={3} px={5}> | ||
<Box fontWeight={'bold'} fontSize={'2xl'}> | ||
新的 API 秘钥 | ||
{t('新的 API 秘钥')} | ||
</Box> | ||
<Box fontSize={'sm'} color={'myGray.600'}> | ||
请保管好你的秘钥,秘钥不会再次展示~ | ||
{t('请保管好你的秘钥,秘钥不会再次展示~')} | ||
</Box> | ||
</Box> | ||
<ModalBody> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ const ContextModal = ({ | |
<MyModal | ||
isOpen={true} | ||
onClose={onClose} | ||
title={`完整对话记录(${context.length}条)`} | ||
title={t(`full conversation log(${context.length}strip)`)} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it is a translation with variables, you need to write: en.json: "chat":{
"Full Context n strip": "Full context ({{length}}) strip"
} zh.json "chat":{
"Full Context n strip": "完整对话记录 ({{length}}) 条"
} |
||
h={['90vh', '80vh']} | ||
minW={['90vw', '600px']} | ||
isCentered | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The server error prompt can not be translated first, I think about the server error how to implement i18n