mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-01 11:58:38 +00:00
feat: Optimize i18n keys and remove unused keys, supporting static files in I18nT (#2092)
* feat: packages web i18n * delete file * feat:i18n add i18nT * handle keys * delete unusedKeys * fix build * update dev.md
This commit is contained in:
@@ -86,11 +86,11 @@ const InputGuideConfig = ({
|
||||
<Flex alignItems={'center'}>
|
||||
<MyIcon name={'core/app/inputGuides'} mr={2} w={'20px'} />
|
||||
<Flex alignItems={'center'}>
|
||||
<FormLabel>{chatT('Input guide')}</FormLabel>
|
||||
<FormLabel>{chatT('input_guide')}</FormLabel>
|
||||
<ChatFunctionTip type={'inputGuide'} />
|
||||
</Flex>
|
||||
<Box flex={1} />
|
||||
<MyTooltip label={chatT('Config input guide')}>
|
||||
<MyTooltip label={chatT('config_input_guide')}>
|
||||
<Button
|
||||
variant={'transparentBase'}
|
||||
iconSpacing={1}
|
||||
@@ -102,7 +102,7 @@ const InputGuideConfig = ({
|
||||
</Button>
|
||||
</MyTooltip>
|
||||
<MyModal
|
||||
title={chatT('Input guide')}
|
||||
title={chatT('input_guide')}
|
||||
iconSrc="core/app/inputGuides"
|
||||
isOpen={isOpen}
|
||||
onClose={onClose}
|
||||
@@ -124,7 +124,7 @@ const InputGuideConfig = ({
|
||||
{isOpenQuestionGuide && (
|
||||
<>
|
||||
<Flex mt={8} alignItems={'center'}>
|
||||
<FormLabel>{chatT('Input guide lexicon')}</FormLabel>
|
||||
<FormLabel>{chatT('input_guide_lexicon')}</FormLabel>
|
||||
<Box fontSize={'xs'} px={2} bg={'myGray.100'} ml={1} rounded={'full'}>
|
||||
{total}
|
||||
</Box>
|
||||
@@ -137,12 +137,12 @@ const InputGuideConfig = ({
|
||||
onOpenLexiconConfig();
|
||||
}}
|
||||
>
|
||||
{chatT('Config input guide lexicon')}
|
||||
{chatT('config_input_guide_lexicon')}
|
||||
</Button>
|
||||
</Flex>
|
||||
<>
|
||||
<Flex mt={8} alignItems={'center'}>
|
||||
<FormLabel>{chatT('Custom input guide url')}</FormLabel>
|
||||
<FormLabel>{chatT('custom_input_guide_url')}</FormLabel>
|
||||
<Flex
|
||||
onClick={() => window.open(getDocPath('/docs/course/chat_input_guide'))}
|
||||
color={'primary.700'}
|
||||
@@ -226,7 +226,7 @@ const LexiconConfigModal = ({ appId, onClose }: { appId: string; onClose: () =>
|
||||
if (res.insertLength < textList.length) {
|
||||
toast({
|
||||
status: 'warning',
|
||||
title: chatT('Insert input guide, Some data already exists', { len: res.insertLength })
|
||||
title: chatT('insert_input_guide,_some_data_already_exists', { len: res.insertLength })
|
||||
});
|
||||
} else {
|
||||
toast({
|
||||
@@ -289,7 +289,7 @@ const LexiconConfigModal = ({ appId, onClose }: { appId: string; onClose: () =>
|
||||
|
||||
return (
|
||||
<MyModal
|
||||
title={chatT('Config input guide lexicon title')}
|
||||
title={chatT('config_input_guide_lexicon_title')}
|
||||
iconSrc="core/app/inputGuides"
|
||||
isOpen={true}
|
||||
onClose={onClose}
|
||||
@@ -326,7 +326,7 @@ const LexiconConfigModal = ({ appId, onClose }: { appId: string; onClose: () =>
|
||||
});
|
||||
}}
|
||||
>
|
||||
<QuestionTip ml={-2} label={chatT('Csv input lexicon tip')} />
|
||||
<QuestionTip ml={-2} label={chatT('csv_input_lexicon_tip')} />
|
||||
</Box>
|
||||
</Flex>
|
||||
<Box px={8}>
|
||||
@@ -364,7 +364,7 @@ const LexiconConfigModal = ({ appId, onClose }: { appId: string; onClose: () =>
|
||||
<MyInput
|
||||
autoFocus
|
||||
rightIcon={<MyIcon name={'save'} w={'14px'} cursor={'pointer'} />}
|
||||
placeholder={chatT('New input guide lexicon')}
|
||||
placeholder={chatT('new_input_guide_lexicon')}
|
||||
onBlur={(e) => {
|
||||
createNewData([e.target.value.trim()]);
|
||||
}}
|
||||
@@ -381,7 +381,7 @@ const LexiconConfigModal = ({ appId, onClose }: { appId: string; onClose: () =>
|
||||
px={8}
|
||||
flex={'1 0 0'}
|
||||
fontSize={'sm'}
|
||||
EmptyChildren={<EmptyTip text={chatT('Chat input guide lexicon is empty')} />}
|
||||
EmptyChildren={<EmptyTip text={chatT('chat_input_guide_lexicon_is_empty')} />}
|
||||
>
|
||||
{list.map((data, index) => {
|
||||
const item = data.data;
|
||||
|
@@ -19,8 +19,8 @@ const ChatFunctionTip = ({ type }: { type: `${FnTypeEnum}` }) => {
|
||||
const map = useRef({
|
||||
[FnTypeEnum.inputGuide]: {
|
||||
icon: '/imgs/app/inputGuide-icon.svg',
|
||||
title: chatT('Input guide'),
|
||||
desc: chatT('Input guide tip'),
|
||||
title: chatT('input_guide'),
|
||||
desc: chatT('input_guide_tip'),
|
||||
imgUrl: '/imgs/app/inputGuide.svg'
|
||||
},
|
||||
[FnTypeEnum.nextQuestion]: {
|
||||
|
@@ -2,7 +2,7 @@ import { Box, Flex, Divider } from '@chakra-ui/react';
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
|
||||
const CoseTooltip = ({ cost }: { cost?: number }) => {
|
||||
const CostTooltip = ({ cost }: { cost?: number }) => {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<>
|
||||
@@ -21,4 +21,4 @@ const CoseTooltip = ({ cost }: { cost?: number }) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default CoseTooltip;
|
||||
export default CostTooltip;
|
@@ -65,7 +65,7 @@ export default function InputGuideBox({
|
||||
>
|
||||
<Flex alignItems={'center'} fontSize={'sm'} color={'myGray.600'} gap={2} mb={2} px={2}>
|
||||
<MyIcon name={'union'} />
|
||||
<Box>{chatT('Input guide')}</Box>
|
||||
<Box>{chatT('input_guide')}</Box>
|
||||
</Flex>
|
||||
{data.map((item, index) => (
|
||||
<Flex
|
||||
|
@@ -31,7 +31,7 @@ const RawSourceBox = ({
|
||||
|
||||
return (
|
||||
<MyTooltip
|
||||
label={canPreview ? fileT('Click to view raw source') : ''}
|
||||
label={canPreview ? fileT('click_to_view_raw_source') : ''}
|
||||
shouldWrapChildren={false}
|
||||
>
|
||||
<Box
|
||||
|
@@ -334,13 +334,13 @@ function EditKeyModal({
|
||||
<MyModal
|
||||
isOpen={true}
|
||||
iconSrc="/imgs/modal/key.svg"
|
||||
title={isEdit ? publishT('Edit API Key') : publishT('Create API Key')}
|
||||
title={isEdit ? publishT('edit_api_key') : publishT('create_api_key')}
|
||||
>
|
||||
<ModalBody>
|
||||
<Flex alignItems={'center'}>
|
||||
<FormLabel flex={'0 0 90px'}>{t('common:Name')}</FormLabel>
|
||||
<Input
|
||||
placeholder={publishT('key alias') || 'key alias'}
|
||||
placeholder={publishT('key_alias') || 'key_alias'}
|
||||
maxLength={20}
|
||||
{...register('name', {
|
||||
required: t('common:common.name_is_empty') || 'name_is_empty'
|
||||
|
Reference in New Issue
Block a user