perf: i18n (#4740)

* feat: login limit time config

* doc

* perf: code

* i18n update

* update lock

* fix: ts

* update package
This commit is contained in:
Archer
2025-05-05 16:16:59 +08:00
committed by GitHub
parent fdd4e9edbd
commit 864eff47c7
229 changed files with 1128 additions and 1293 deletions

View File

@@ -22,7 +22,7 @@ const CommunityModal = ({ onClose }: { onClose: () => void }) => {
<ModalFooter>
<Button variant={'whiteBase'} onClick={onClose}>
{t('common:common.Close')}
{t('common:Close')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -328,7 +328,7 @@ const CodeLight = ({
<Box flex={1}>{codeBoxName}</Box>
<Flex cursor={'pointer'} onClick={() => copyData(String(children))} alignItems={'center'}>
<Icon name={'copy'} width={15} height={15}></Icon>
<Box ml={1}>{t('common:common.Copy')}</Box>
<Box ml={1}>{t('common:Copy')}</Box>
</Flex>
</Flex>
<SyntaxHighlighter style={codeLight as any} language={match?.[1]} PreTag="pre">

View File

@@ -173,7 +173,7 @@ const IframeHtmlCodeBlock = ({
</Flex>
</Box>
<StyledButton
label={t('common:common.Code')}
label={t('common:Code')}
iconName="code"
onClick={() => setViewMode('source')}
isActive={viewMode === 'source'}
@@ -181,7 +181,7 @@ const IframeHtmlCodeBlock = ({
isMobile={isMobile}
/>
<StyledButton
label={t('common:common.Preview')}
label={t('common:Preview')}
iconName="preview"
onClick={() => setViewMode('iframe')}
isActive={viewMode === 'iframe'}
@@ -189,7 +189,7 @@ const IframeHtmlCodeBlock = ({
isMobile={isMobile}
/>
<StyledButton
label={t('common:common.FullScreen')}
label={t('common:FullScreen')}
iconName="fullScreen"
onClick={onOpen}
viewMode={viewMode}
@@ -221,7 +221,7 @@ const IframeHtmlCodeBlock = ({
height="60px"
>
<Box fontSize="lg" color="myGray.900">
{t('common:common.FullScreenLight')}
{t('common:FullScreenLight')}
</Box>
<ModalCloseButton zIndex={1} position={'relative'} top={0} right={0} />
</ModalHeader>

View File

@@ -56,7 +56,7 @@ const EditResourceModal = ({
<Box>
<FormLabel mb={1}>{t('common:core.app.Name and avatar')}</FormLabel>
<HStack spacing={4}>
<MyTooltip label={t('common:common.Set Avatar')}>
<MyTooltip label={t('common:set_avatar')}>
<Avatar
flex={'0 0 2rem'}
src={avatar}
@@ -76,13 +76,13 @@ const EditResourceModal = ({
</HStack>
</Box>
<Box mt={4}>
<FormLabel mb={1}>{t('common:common.Intro')}</FormLabel>
<FormLabel mb={1}>{t('common:Intro')}</FormLabel>
<Textarea {...register('intro')} bg={'myGray.50'} maxLength={200} />
</Box>
</ModalBody>
<ModalFooter>
<Button isLoading={loading} onClick={handleSubmit(onSave)} px={6}>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>

View File

@@ -11,13 +11,7 @@ const ParentPaths = (props: {
fontSize?: string;
}) => {
const { t } = useTranslation();
const {
paths = [],
rootName = t('common:common.folder.Root Path'),
FirstPathDom,
onClick,
fontSize
} = props;
const { paths = [], rootName = t('common:root_folder'), FirstPathDom, onClick, fontSize } = props;
const concatPaths = useMemo(
() => [
{

View File

@@ -74,7 +74,7 @@ const MyTextarea = React.forwardRef<HTMLTextAreaElement, Props>(function MyTexta
onClose();
}}
>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>
@@ -134,7 +134,7 @@ const Editor = React.memo(function Editor({
cursor={'pointer'}
onClick={onOpenModal}
>
<MyTooltip label={t('common:common.ui.textarea.Magnifying')}>
<MyTooltip label={t('common:ui.textarea.Magnifying')}>
<MyIcon name={'common/fullScreenLight'} w={'14px'} color={'myGray.600'} />
</MyTooltip>
</Box>

View File

@@ -31,7 +31,7 @@ const TagTextarea = ({ defaultValues, onUpdate, ...props }: Props) => {
if (tags.includes(value)) {
return toast({
status: 'warning',
title: t('common:common.input.Repeat Value')
title: t('common:input.Repeat Value')
});
}
setTags([...tags, value]);

View File

@@ -51,7 +51,7 @@ const MoveModal = ({ moveResourceId, title, server, onConfirm, onClose, moveHint
setFolderList([
{
id: rootId,
name: t('common:common.folder.Root Path'),
name: t('common:root_folder'),
open: true,
children: data.map((item) => ({
id: item.id,
@@ -158,7 +158,7 @@ const MoveModal = ({ moveResourceId, title, server, onConfirm, onClose, moveHint
onSuccess: () => {
onClose();
},
successToast: t('common:common.folder.Move Success')
successToast: t('common:move_success')
}
);
@@ -181,7 +181,7 @@ const MoveModal = ({ moveResourceId, title, server, onConfirm, onClose, moveHint
</ModalBody>
<ModalFooter>
<Button isLoading={confirming} isDisabled={!selectedId} onClick={onConfirmSelect}>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -16,7 +16,7 @@ const FolderPath = (props: {
const { t } = useTranslation();
const {
paths,
rootName = t('common:common.folder.Root Path'),
rootName = t('common:root_folder'),
FirstPathDom,
onClick,
fontSize,

View File

@@ -40,7 +40,7 @@ const SelectOneResource = ({
id: rootId,
open: true,
avatar: FolderImgUrl,
name: t('common:common.folder.Root Path'),
name: t('common:root_folder'),
isFolder: true,
children: dataList
};

View File

@@ -90,7 +90,7 @@ const FolderSlideCard = ({
mt={4}
onClick={onMove}
>
{t('common:common.Move')}
{t('common:Move')}
</Button>
{managePer.permission.isOwner && (
<Button
@@ -107,7 +107,7 @@ const FolderSlideCard = ({
openConfirm(onDelete)();
}}
>
{t('common:common.Delete folder')}
{t('common:delete_folder')}
</Button>
)}
</Box>
@@ -150,7 +150,7 @@ const FolderSlideCard = ({
onClick={onOpenManageModal}
/>
</MyTooltip>
<MyTooltip label={t('common:common.Add')}>
<MyTooltip label={t('common:Add')}>
<MyIcon
w="1rem"
name="support/permission/collaborator"

View File

@@ -220,8 +220,8 @@ const AIChatSettingsModal = ({
</Td>
<Td pt={0} pb={2}>
{selectedModel?.toolChoice || selectedModel?.functionCall
? t('common:common.support')
: t('common:common.not_support')}
? t('common:support')
: t('common:not_support')}
</Td>
</Tr>
</Tbody>
@@ -470,10 +470,10 @@ const AIChatSettingsModal = ({
</ModalBody>
<ModalFooter>
<Button variant={'whiteBase'} onClick={onClose}>
{t('common:common.Close')}
{t('common:Close')}
</Button>
<Button ml={4} onClick={handleSubmit(onSuccess)}>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -34,7 +34,7 @@ const ModelTable = () => {
const { t } = useTranslation();
const [provider, setProvider] = useState<ModelProviderIdType | ''>('');
const providerList = useRef<{ label: any; value: ModelProviderIdType | '' }[]>([
{ label: t('common:common.All'), value: '' },
{ label: t('common:All'), value: '' },
...ModelProviderList.map((item) => ({
label: (
<HStack>
@@ -48,7 +48,7 @@ const ModelTable = () => {
const [modelType, setModelType] = useState<ModelTypeEnum | ''>('');
const selectModelTypeList = useRef<{ label: string; value: ModelTypeEnum | '' }[]>([
{ label: t('common:common.All'), value: '' },
{ label: t('common:All'), value: '' },
...modelTypeList.map((item) => ({ label: t(item.label), value: item.value }))
]);
@@ -65,14 +65,14 @@ const ModelTable = () => {
typeof item.inputPrice === 'number' ? (
<Box>
<Flex>
{`${t('common:common.Input')}:`}
{`${t('common:Input')}:`}
<Box fontWeight={'bold'} color={'myGray.900'} mr={0.5} ml={2}>
{item.inputPrice || 0}
</Box>
{`${t('common:support.wallet.subscription.point')} / 1K Tokens`}
</Flex>
<Flex>
{`${t('common:common.Output')}:`}
{`${t('common:Output')}:`}
<Box fontWeight={'bold'} color={'myGray.900'} mr={0.5} ml={2}>
{item.outputPrice || 0}
</Box>
@@ -94,7 +94,7 @@ const ModelTable = () => {
typeLabel: t('common:model.type.embedding'),
priceLabel: (
<Flex color={'myGray.700'}>
{`${t('common:common.Input')}: `}
{`${t('common:Input')}: `}
<Box fontWeight={'bold'} color={'myGray.900'} mr={0.5}>
{item.charsPointsPrice || 0}
</Box>
@@ -134,7 +134,7 @@ const ModelTable = () => {
typeLabel: t('common:model.type.reRank'),
priceLabel: item.charsPointsPrice ? (
<Flex color={'myGray.700'}>
{`${t('common:common.Input')}: `}
{`${t('common:Input')}: `}
<Box fontWeight={'bold'} color={'myGray.900'} mr={0.5}>
{item.charsPointsPrice}
</Box>

View File

@@ -78,7 +78,7 @@ const DatasetParamsModal = ({
defaultValues: {
searchMode,
embeddingWeight: embeddingWeight || 0.5,
usingReRank: usingReRank || true,
usingReRank: !!usingReRank,
rerankModel: rerankModel || defaultModels?.rerank?.model,
rerankWeight: rerankWeight || 0.5,
limit,
@@ -393,7 +393,7 @@ const DatasetParamsModal = ({
</ModalBody>
<ModalFooter>
<Button variant={'whiteBase'} mr={3} onClick={onClose}>
{t('common:common.Close')}
{t('common:Close')}
</Button>
<Button
onClick={() => {
@@ -401,7 +401,7 @@ const DatasetParamsModal = ({
handleSubmit(onSuccess)();
}}
>
{t('common:common.Done')}
{t('common:Done')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -199,7 +199,7 @@ export const DatasetSelectModal = ({
})()
)}
</Grid>
{unSelectedDatasets.length === 0 && <EmptyTip text={t('common:common.folder.empty')} />}
{unSelectedDatasets.length === 0 && <EmptyTip text={t('common:folder.empty')} />}
</ModalBody>
<ModalFooter>
@@ -209,7 +209,7 @@ export const DatasetSelectModal = ({
onChange(selectedDatasets);
}}
>
{t('common:common.Done')}
{t('common:Done')}
</Button>
</ModalFooter>

View File

@@ -188,7 +188,7 @@ const FileSelect = ({
</ModalBody>
<ModalFooter>
<Button onClick={onClose} px={8}>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -16,7 +16,6 @@ import type { ChatInputGuideConfigType } from '@fastgpt/global/core/app/type.d';
import MyModal from '@fastgpt/web/components/common/MyModal';
import MyInput from '@/components/MyInput';
import QuestionTip from '@fastgpt/web/components/common/MyTooltip/QuestionTip';
import { useI18n } from '@/web/context/I18n';
import { fileDownload } from '@/web/common/file/utils';
import { getDocPath } from '@/web/common/system/doc';
import {
@@ -151,7 +150,7 @@ const InputGuideConfig = ({
cursor={'pointer'}
>
<MyIcon name={'book'} w={'17px'} ml={4} mr={1} color={'myGray.600'} />
{t('common:common.Documents')}
{t('common:Documents')}
</Flex>
<Box flex={'1 0 0'} />
</Flex>
@@ -180,7 +179,6 @@ const InputGuideConfig = ({
export default React.memo(InputGuideConfig);
const LexiconConfigModal = ({ appId, onClose }: { appId: string; onClose: () => void }) => {
const { commonT } = useI18n();
const { t } = useTranslation();
const { toast } = useToast();
const { File, onOpen: onOpenSelectFile } = useSelectFile({
@@ -236,7 +234,7 @@ const LexiconConfigModal = ({ appId, onClose }: { appId: string; onClose: () =>
} else {
toast({
status: 'success',
title: t('common:common.Add Success')
title: t('common:Add Success')
});
}
fetchData(1);
@@ -315,7 +313,7 @@ const LexiconConfigModal = ({ appId, onClose }: { appId: string; onClose: () =>
bg={'myGray.50'}
w={'full'}
h={9}
placeholder={commonT('common.Search')}
placeholder={t('common:Search')}
onChange={(e) => setSearchKey(e.target.value)}
/>
</Box>
@@ -325,7 +323,7 @@ const LexiconConfigModal = ({ appId, onClose }: { appId: string; onClose: () =>
size={'sm'}
leftIcon={<MyIcon name={'common/importLight'} boxSize={4} />}
>
{commonT('common.Import')}
{t('common:Import')}
</Button>
<Box
cursor={'pointer'}
@@ -355,7 +353,7 @@ const LexiconConfigModal = ({ appId, onClose }: { appId: string; onClose: () =>
setSelectedRows([]);
}}
>
{commonT('common.Delete')}
{t('common:Delete')}
</Button>
<Button
variant={'whiteBase'}
@@ -383,7 +381,7 @@ const LexiconConfigModal = ({ appId, onClose }: { appId: string; onClose: () =>
size={'sm'}
leftIcon={<MyIcon name={'common/addLight'} boxSize={4} />}
>
{commonT('common.Add')}
{t('common:Add')}
</Button>
</Flex>
</Flex>

View File

@@ -146,7 +146,7 @@ const QGConfigModal = ({
leftIcon={<MyIcon name={'edit'} w={'14px'} />}
onClick={onOpenCustomPrompt}
>
{t('common:common.Edit')}
{t('common:Edit')}
</Button>
</Flex>
<Box

View File

@@ -147,7 +147,7 @@ const VariableEdit = ({
onChange(onChangeVariable);
toast({
status: 'success',
title: t('common:common.Add Success')
title: t('common:Add Success')
});
reset({
...addVariable(),
@@ -194,7 +194,7 @@ const VariableEdit = ({
reset(addVariable());
}}
>
{t('common:common.Add New')}
{t('common:add_new')}
</Button>
</Flex>
{/* Form render */}

View File

@@ -1,7 +1,6 @@
import { Box, Flex } from '@chakra-ui/react';
import React from 'react';
import MyIcon from '@fastgpt/web/components/common/Icon';
import { useI18n } from '@/web/context/I18n';
import { useRequest2 } from '@fastgpt/web/hooks/useRequest';
import { queryChatInputGuideList } from '@/web/core/chat/inputGuide/api';
import MyTooltip from '@fastgpt/web/components/common/MyTooltip';

View File

@@ -80,7 +80,7 @@ const ChatController = ({
}
})}
>
<MyTooltip label={t('common:common.Copy')}>
<MyTooltip label={t('common:Copy')}>
<MyIcon
{...controlIconStyle}
name={'copy'}
@@ -100,7 +100,7 @@ const ChatController = ({
/>
</MyTooltip>
)}
<MyTooltip label={t('common:common.Delete')}>
<MyTooltip label={t('common:Delete')}>
<MyIcon
{...controlIconStyle}
name={'delete'}
@@ -132,7 +132,7 @@ const ChatController = ({
}
if (isPlayingChat && audioLoading) {
return (
<MyTooltip label={t('common:common.Loading')}>
<MyTooltip label={t('common:Loading')}>
<MyIcon {...controlIconStyle} name={'common/loading'} />
</MyTooltip>
);

View File

@@ -381,7 +381,7 @@ const ChatItem = (props: Props) => {
right={0}
transform={'translateX(100%)'}
>
<MyTooltip label={t('common:common.Copy')}>
<MyTooltip label={t('common:Copy')}>
<MyIcon
w={'1rem'}
cursor="pointer"

View File

@@ -54,7 +54,7 @@ const FeedbackModal = ({
</ModalBody>
<ModalFooter>
<Button variant={'whiteBase'} mr={2} onClick={onClose}>
{t('common:common.Close')}
{t('common:Close')}
</Button>
<Button isLoading={isLoading} onClick={mutate}>
{t('common:core.chat.Feedback Submit')}

View File

@@ -118,7 +118,7 @@ const SelectMarkCollection = ({
});
}}
>
{t('common:common.Last Step')}
{t('common:last_step')}
</Button>
</ModalFooter>
}

View File

@@ -86,7 +86,7 @@ const VariablePopover = ({
)}
<Flex w={'full'} justifyContent={'flex-end'}>
<Button size={'sm'} onClick={onClose}>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</Flex>
</Box>

View File

@@ -841,7 +841,7 @@ const ChatBox = ({
return {
status: chatContent.status || ChatStatusEnum.loading,
name: t(chatContent.moduleName || ('' as any)) || t('common:common.Loading')
name: t(chatContent.moduleName || ('' as any)) || t('common:Loading')
};
}, [chatRecords, isChatting, t]);

View File

@@ -267,7 +267,7 @@ const RenderInput = () => {
})();
}}
>
{isDisabledInput ? t('common:common.Restart') : t('common:common.Run')}
{isDisabledInput ? t('common:Restart') : t('common:Run')}
</Button>
</Flex>
)}

View File

@@ -72,7 +72,7 @@ const RawSourceBox = ({
className={props.className ?? 'textEllipsis'}
wordBreak={'break-all'}
>
{sourceName || t('common:common.UnKnow Source')}
{sourceName || t('common:unknow_source')}
</Box>
</Box>
</MyTooltip>

View File

@@ -103,7 +103,7 @@ const ApiKeyTable = ({ tips, appId }: { tips: string; appId?: string }) => {
color={'primary.500'}
fontSize={'sm'}
>
{t('common:common.Read document')}
{t('common:read_doc')}
</Link>
)}
</Flex>
@@ -153,12 +153,12 @@ const ApiKeyTable = ({ tips, appId }: { tips: string; appId?: string }) => {
<Th>{t('common:support.outlink.Usage points')}</Th>
{feConfigs?.isPlus && (
<>
<Th>{t('common:common.Expired Time')}</Th>
<Th>{t('common:expired_time')}</Th>
</>
)}
<Th>{t('common:common.Create Time')}</Th>
<Th>{t('common:common.Last use time')}</Th>
<Th>{t('common:create_time')}</Th>
<Th>{t('common:last_use_time')}</Th>
<Th />
</Tr>
</Thead>
@@ -171,7 +171,7 @@ const ApiKeyTable = ({ tips, appId }: { tips: string; appId?: string }) => {
{Math.round(usagePoints)}/
{feConfigs?.isPlus && limit?.maxUsagePoints && limit?.maxUsagePoints > -1
? `${limit?.maxUsagePoints}`
: t('common:common.Unlimited')}
: t('common:Unlimited')}
</Td>
{feConfigs?.isPlus && (
<>
@@ -186,7 +186,7 @@ const ApiKeyTable = ({ tips, appId }: { tips: string; appId?: string }) => {
<Td whiteSpace={'pre-wrap'}>
{lastUsedTime
? dayjs(lastUsedTime).format('YYYY/MM/DD\nHH:mm:ss')
: t('common:common.Un used')}
: t('common:un_used')}
</Td>
<Td>
<MyMenu
@@ -204,7 +204,7 @@ const ApiKeyTable = ({ tips, appId }: { tips: string; appId?: string }) => {
{
children: [
{
label: t('common:common.Edit'),
label: t('common:Edit'),
icon: 'edit',
onClick: () =>
setEditData({
@@ -215,7 +215,7 @@ const ApiKeyTable = ({ tips, appId }: { tips: string; appId?: string }) => {
})
},
{
label: t('common:common.Delete'),
label: t('common:Delete'),
icon: 'delete',
type: 'danger',
onClick: () => openConfirm(() => onclickRemove(_id))()
@@ -279,7 +279,7 @@ const ApiKeyTable = ({ tips, appId }: { tips: string; appId?: string }) => {
</ModalBody>
<ModalFooter>
<Button variant="whiteBase" onClick={() => setApiKey('')}>
{t('common:common.OK')}
{t('common:OK')}
</Button>
</ModalFooter>
</MyModal>
@@ -340,7 +340,7 @@ function EditKeyModal({
placeholder={t('publish:key_alias') || 'key_alias'}
maxLength={100}
{...register('name', {
required: t('common:common.name_is_empty') || 'name_is_empty'
required: t('common:name_is_empty') || 'name_is_empty'
})}
/>
</Flex>
@@ -364,7 +364,7 @@ function EditKeyModal({
/>
</Flex>
<Flex alignItems={'center'} mt={4}>
<FormLabel flex={'0 0 90px'}>{t('common:common.Expired Time')}</FormLabel>
<FormLabel flex={'0 0 90px'}>{t('common:expired_time')}</FormLabel>
<Input
type="datetime-local"
defaultValue={
@@ -383,14 +383,14 @@ function EditKeyModal({
<ModalFooter>
<Button variant={'whiteBase'} mr={3} onClick={onClose}>
{t('common:common.Close')}
{t('common:Close')}
</Button>
<Button
isLoading={creating || updating}
onClick={submitShareChat((data) => (isEdit ? onclickUpdate(data) : onclickCreate(data)))}
>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -91,8 +91,8 @@ const LafAccountModal = ({
initUserInfo();
onClose();
},
successToast: t('common:common.Update Success'),
errorToast: t('common:common.Update Failed')
successToast: t('common:update_success'),
errorToast: t('common:update_failed')
});
return (
@@ -180,11 +180,11 @@ const LafAccountModal = ({
onClose();
}}
>
{t('common:common.Close')}
{t('common:Close')}
</Button>
{appid && (
<Button ml={3} isLoading={isUpdating} onClick={handleSubmit((data) => onSubmit(data))}>
{t('common:common.Update')}
{t('common:Update')}
</Button>
)}
</ModalFooter>

View File

@@ -166,9 +166,9 @@ export function ChangeOwnerModal({
<ModalFooter>
<HStack>
<Button onClick={onClose} variant={'whiteBase'}>
{t('common:common.Cancel')}
{t('common:Cancel')}
</Button>
<Button onClick={onConfirm}>{t('common:common.Confirm')}</Button>
<Button onClick={onConfirm}>{t('common:Confirm')}</Button>
</HStack>
</ModalFooter>
</MyModal>

View File

@@ -90,7 +90,7 @@ const ConfigPerModal = ({
leftIcon={<MyIcon w="4" name="support/permission/collaborator" />}
onClick={onOpenAddMember}
>
{t('common:common.Add')}
{t('common:Add')}
</Button>
</Flex>
</Flex>

View File

@@ -27,7 +27,7 @@ function ManageModal({ onClose }: ManageModalProps) {
const { runAsync: onDelete, loading: isDeleting } = useRequest2(onDelOneCollaborator);
const { runAsync: onUpdate, loading: isUpdating } = useRequest2(onUpdateCollaborators, {
successToast: t('common.Update Success'),
successToast: t('common:update_success'),
errorToast: 'Error'
});

View File

@@ -122,7 +122,7 @@ function MemberModal({
permission: addOnly ? undefined : selectedPermission!
} as UpdateClbPermissionProps<ValueOf<typeof addOnly>>),
{
successToast: t('common:common.Add Success'),
successToast: t('common:Add Success'),
onSuccess() {
onClose();
}
@@ -255,7 +255,7 @@ function MemberModal({
onPathClick(parentId);
}
}}
rootName={t('common:common.Team')}
rootName={t('common:Team')}
/>
</Box>
)}
@@ -452,7 +452,7 @@ function MemberModal({
</HStack>
)}
<Button isLoading={isUpdating} ml="4" h={'32px'} onClick={onConfirm}>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -239,7 +239,7 @@ function PermissionSelect({
}}
>
<MyIcon name="delete" w="20px" color="red.600" />
<Box color="red.600">{t('common:common.Remove')}</Box>
<Box color="red.600">{t('common:Remove')}</Box>
</HStack>
</>
)}

View File

@@ -17,8 +17,8 @@ import MemberListCard, { type MemberListCardProps } from './MemberListCard';
import { useRequest2 } from '@fastgpt/web/hooks/useRequest';
import { useSystemStore } from '@/web/common/system/useSystemStore';
import { useConfirm } from '@fastgpt/web/hooks/useConfirm';
import { useI18n } from '@/web/context/I18n';
import type { RequireOnlyOne } from '@fastgpt/global/common/type/utils';
import { useTranslation } from 'next-i18next';
const MemberModal = dynamic(() => import('./MemberModal'));
const ManageModal = dynamic(() => import('./ManageModal'));
@@ -89,6 +89,7 @@ const CollaboratorContextProvider = ({
hasParent?: boolean;
addPermissionOnly?: boolean;
}) => {
const { t } = useTranslation();
const onUpdateCollaboratorsThen = async (props: UpdateClbPermissionProps) => {
await onUpdateCollaborators(props);
refetchCollaboratorList();
@@ -101,7 +102,6 @@ const CollaboratorContextProvider = ({
};
const { feConfigs } = useSystemStore();
const { commonT } = useI18n();
const {
data: collaboratorList = [],
@@ -187,7 +187,7 @@ const CollaboratorContextProvider = ({
onOpenAddMember();
},
undefined,
commonT('permission.Remove InheritPermission Confirm')
t('common:permission.Remove InheritPermission Confirm')
)();
} else {
onOpenAddMember();
@@ -200,7 +200,7 @@ const CollaboratorContextProvider = ({
onOpenManageModal();
},
undefined,
commonT('permission.Remove InheritPermission Confirm')
t('common:permission.Remove InheritPermission Confirm')
)();
} else {
onOpenManageModal();

View File

@@ -1,8 +1,8 @@
import { useI18n } from '@/web/context/I18n';
import { Box, BoxProps } from '@chakra-ui/react';
import { useConfirm } from '@fastgpt/web/hooks/useConfirm';
import { useToast } from '@fastgpt/web/hooks/useToast';
import React from 'react';
import { useTranslation } from 'next-i18next';
const ResumeInherit = ({
onResume,
@@ -10,13 +10,13 @@ const ResumeInherit = ({
}: BoxProps & {
onResume?: () => Promise<any> | any;
}) => {
const { commonT } = useI18n();
const { t } = useTranslation();
const { toast } = useToast();
const { ConfirmModal: CommonConfirmModal, openConfirm: openCommonConfirm } = useConfirm({});
return onResume ? (
<Box display={'inline'} fontSize={'sm'} {...props}>
{commonT('permission.No InheritPermission')}
{t('common:permission.No InheritPermission')}
<Box
display={'inline'}
textDecoration={'underline'}
@@ -27,16 +27,16 @@ const ResumeInherit = ({
() =>
onResume()?.then(() => {
toast({
title: commonT('permission.Resume InheritPermission Success'),
title: t('common:permission.Resume InheritPermission Success'),
status: 'success'
});
}),
undefined,
commonT('permission.Resume InheritPermission Confirm')
t('common:permission.Resume InheritPermission Confirm')
)();
}}
>
{commonT('click_to_resume')}
{t('common:click_to_resume')}
</Box>
<CommonConfirmModal />

View File

@@ -115,14 +115,14 @@ const UpdateContactModal = ({
</ModalBody>
<ModalFooter>
<Button mr={3} variant={'whiteBase'} onClick={onClose}>
{t('common:common.Cancel')}
{t('common:Cancel')}
</Button>
<Button
isLoading={isLoading}
isDisabled={!account || !verifyCode}
onClick={handleSubmit((data) => onSubmit(data))}
>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -59,7 +59,7 @@ const SendCodeAuthModal = ({
</ModalBody>
<ModalFooter gap={2}>
<Button isLoading={onSending} variant={'whiteBase'} onClick={onClose}>
{t('common:common.Cancel')}
{t('common:Cancel')}
</Button>
<Button
isLoading={onSending}
@@ -74,7 +74,7 @@ const SendCodeAuthModal = ({
}
)}
>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -63,7 +63,7 @@ const TeamTagsAsync = ({ onClose }: { onClose: () => void }) => {
initUserInfo();
onClose();
},
errorToast: t('common:common.Create Failed')
errorToast: t('common:create_failed')
});
const { mutate: onclickTagAsync, isLoading: isSyncing } = useRequest({
mutationFn: (data: FormType) => loadTeamTagsByDomain(data.teamDomain),
@@ -187,7 +187,7 @@ const TeamTagsAsync = ({ onClose }: { onClose: () => void }) => {
</ModalBody>
<ModalFooter mb={2}>
<Button variant={'whiteBase'} mr={3} onClick={onClose}>
{t('common:common.Close')}
{t('common:Close')}
</Button>
<Button isLoading={isUpdating} onClick={handleSubmit((data) => onclickUpdate(data))}>
{t('common:user.team.Tags Async')}

View File

@@ -37,16 +37,11 @@ const NotSufficientModal = ({ type }: { type: NotSufficientModalType }) => {
return (
<>
<MyModal
isOpen
iconSrc="common/confirm/deleteTip"
title={t('common:common.Warning')}
w={'420px'}
>
<MyModal isOpen iconSrc="common/confirm/deleteTip" title={t('common:Warning')} w={'420px'}>
<ModalBody>{textMap[type]}</ModalBody>
<ModalFooter>
<Button variant={'whiteBase'} mr={2} onClick={onClose}>
{t('common:common.Close')}
{t('common:Close')}
</Button>
<Button
onClick={() => {

View File

@@ -112,7 +112,7 @@ const AccountContainer = ({
: []),
{
icon: 'common/settingLight',
label: t('common:common.Setting'),
label: t('common:Setting'),
value: TabEnum.setting
},
{

View File

@@ -22,7 +22,7 @@ const RedeemCouponModal = ({
onSuccess();
onClose();
},
successToast: t('common:common.Success')
successToast: t('common:Success')
});
return (

View File

@@ -153,7 +153,7 @@ export const ModelEditModal = ({
onSuccess: () => {
onClose();
},
successToast: t('common:common.Success')
successToast: t('common:Success')
}
);
@@ -741,10 +741,10 @@ export const ModelEditModal = ({
</Button>
)}
<Button variant={'whiteBase'} mr={4} onClick={onClose}>
{t('common:common.Cancel')}
{t('common:Cancel')}
</Button>
<Button isLoading={updatingModel} onClick={handleSubmit(updateModel)}>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -158,7 +158,7 @@ const EditChannelModal = ({
onSuccess();
onClose();
},
successToast: isEdit ? t('common:common.Update Success') : t('common:common.Create Success'),
successToast: isEdit ? t('common:update_success') : t('common:create_success'),
manual: true
}
);
@@ -285,10 +285,10 @@ const EditChannelModal = ({
</ModalBody>
<ModalFooter>
<Button variant={'outline'} onClick={onClose} mr={4}>
{t('common:common.Cancel')}
{t('common:Cancel')}
</Button>
<Button variant={'primary'} onClick={handleSubmit(onSubmit)}>
{isEdit ? t('common:common.Update') : t('common:new_create')}
{isEdit ? t('common:Update') : t('common:new_create')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -59,11 +59,11 @@ const ModelTest = ({
colorSchema: 'blue'
},
success: {
label: t('common:common.Success'),
label: t('common:Success'),
colorSchema: 'green'
},
error: {
label: t('common:common.failed'),
label: t('common:failed'),
colorSchema: 'red'
}
});
@@ -246,7 +246,7 @@ const ModelTest = ({
</ModalBody>
<ModalFooter>
<Button mr={4} variant={'whiteBase'} onClick={onClose}>
{t('common:common.Cancel')}
{t('common:Cancel')}
</Button>
<Button isLoading={isTesting} variant={'primary'} onClick={onStartTest}>
{t('account_model:start_test', { num: testModelList.length })}

View File

@@ -215,7 +215,7 @@ const ChannelTable = ({ Tab }: { Tab: React.ReactNode }) => {
{
type: 'danger',
icon: 'delete',
label: t('common:common.Delete'),
label: t('common:Delete'),
onClick: () =>
openConfirm(
() => onDeleteChannel(item.id),

View File

@@ -89,7 +89,7 @@ const ChannelLog = ({ Tab }: { Tab: React.ReactNode }) => {
);
return [
{
label: t('common:common.All'),
label: t('common:All'),
value: ''
},
...res
@@ -118,7 +118,7 @@ const ChannelLog = ({ Tab }: { Tab: React.ReactNode }) => {
.sort((a, b) => a.order - b.order);
return [
{
label: t('common:common.All'),
label: t('common:All'),
value: ''
},
...res
@@ -229,9 +229,9 @@ const ChannelLog = ({ Tab }: { Tab: React.ReactNode }) => {
<MySelect<'all' | 'success' | 'error'>
bg={'myGray.50'}
list={[
{ label: t('common:common.All'), value: 'all' },
{ label: t('common:common.Success'), value: 'success' },
{ label: t('common:common.failed'), value: 'error' }
{ label: t('common:All'), value: 'all' },
{ label: t('common:Success'), value: 'success' },
{ label: t('common:failed'), value: 'error' }
]}
value={filterProps.code_type}
onChange={(val) => setFilterProps({ ...filterProps, code_type: val })}

View File

@@ -67,7 +67,7 @@ const ModelTable = ({ Tab }: { Tab: React.ReactNode }) => {
const [provider, setProvider] = useState<ModelProviderIdType | ''>('');
const providerList = useRef<{ label: any; value: ModelProviderIdType | '' }[]>([
{ label: t('common:common.All'), value: '' },
{ label: t('common:All'), value: '' },
...ModelProviderList.map((item) => ({
label: (
<HStack>
@@ -81,7 +81,7 @@ const ModelTable = ({ Tab }: { Tab: React.ReactNode }) => {
const [modelType, setModelType] = useState<ModelTypeEnum | ''>('');
const selectModelTypeList = useRef<{ label: string; value: ModelTypeEnum | '' }[]>([
{ label: t('common:common.All'), value: '' },
{ label: t('common:All'), value: '' },
...modelTypeList.map((item) => ({ label: t(item.label), value: item.value }))
]);
@@ -110,14 +110,14 @@ const ModelTable = ({ Tab }: { Tab: React.ReactNode }) => {
typeof item.inputPrice === 'number' ? (
<Box>
<Flex>
{`${t('common:common.Input')}:`}
{`${t('common:Input')}:`}
<Box fontWeight={'bold'} color={'myGray.900'} mr={0.5} ml={2}>
{item.inputPrice || 0}
</Box>
{`${t('common:support.wallet.subscription.point')} / 1K Tokens`}
</Flex>
<Flex>
{`${t('common:common.Output')}:`}
{`${t('common:Output')}:`}
<Box fontWeight={'bold'} color={'myGray.900'} mr={0.5} ml={2}>
{item.outputPrice || 0}
</Box>
@@ -141,7 +141,7 @@ const ModelTable = ({ Tab }: { Tab: React.ReactNode }) => {
typeLabel: t('common:model.type.embedding'),
priceLabel: (
<Flex color={'myGray.700'}>
{`${t('common:common.Input')}: `}
{`${t('common:Input')}: `}
<Box fontWeight={'bold'} color={'myGray.900'} mr={0.5}>
{item.charsPointsPrice || 0}
</Box>
@@ -187,7 +187,7 @@ const ModelTable = ({ Tab }: { Tab: React.ReactNode }) => {
typeLabel: t('common:model.type.reRank'),
priceLabel: item.charsPointsPrice ? (
<Flex color={'myGray.700'}>
{`${t('common:common.Input')}: `}
{`${t('common:Input')}: `}
<Box fontWeight={'bold'} color={'myGray.900'} mr={0.5}>
{item.charsPointsPrice}
</Box>
@@ -254,7 +254,7 @@ const ModelTable = ({ Tab }: { Tab: React.ReactNode }) => {
const { runAsync: onTestModel, loading: testingModel } = useRequest2(getTestModel, {
manual: true,
successToast: t('common:common.Success')
successToast: t('common:Success')
});
const { runAsync: updateModel, loading: updatingModel } = useRequest2(putSystemModel, {
onSuccess: refreshModels
@@ -540,7 +540,7 @@ const JsonConfigModal = ({
</ModalBody>
<ModalFooter>
<Button variant={'whiteBase'} mr={4} onClick={onClose}>
{t('common:common.Cancel')}
{t('common:Cancel')}
</Button>
<Button
onClick={() =>
@@ -549,7 +549,7 @@ const JsonConfigModal = ({
})()
}
>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
@@ -591,7 +591,7 @@ const DefaultModelModal = ({
onSuccess();
onClose();
},
successToast: t('common:common.Update Success')
successToast: t('common:update_success')
});
return (
@@ -745,7 +745,7 @@ const DefaultModelModal = ({
</ModalBody>
<ModalFooter>
<Button variant={'whiteBase'} mr={4} onClick={onClose}>
{t('common:common.Cancel')}
{t('common:Cancel')}
</Button>
<Button
isLoading={loading}
@@ -761,7 +761,7 @@ const DefaultModelModal = ({
})
}
>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -67,8 +67,8 @@ function EditModal({
onSuccess();
onClose();
},
successToast: t('common:common.Create Success'),
errorToast: t('common:common.Create Failed')
successToast: t('common:create_success'),
errorToast: t('common:create_failed')
});
const { mutate: onclickUpdate, isLoading: updating } = useRequest({
mutationFn: async (data: EditTeamFormDataType) => {
@@ -82,8 +82,8 @@ function EditModal({
onSuccess();
onClose();
},
successToast: t('common:common.Update Success'),
errorToast: t('common:common.Update Failed')
successToast: t('common:update_success'),
errorToast: t('common:update_failed')
});
const { isOpen: isOpenContact, onClose: onCloseContact, onOpen: onOpenContact } = useDisclosure();
@@ -101,7 +101,7 @@ function EditModal({
{t('account_team:set_name_avatar')}
</Box>
<Flex mt={3} alignItems={'center'}>
<MyTooltip label={t('common:common.Set Avatar')}>
<MyTooltip label={t('common:set_avatar')}>
<Avatar
flexShrink={0}
src={avatar}
@@ -120,7 +120,7 @@ function EditModal({
maxLength={100}
placeholder={t('user:team.Team Name')}
{...register('name', {
required: t('common:common.Please Input Name')
required: t('common:Please Input Name')
})}
/>
</Flex>
@@ -153,7 +153,7 @@ function EditModal({
onOpenContact();
}}
>
{t('common:common.Setting')}
{t('common:Setting')}
</Button>
</HStack>
</ModalBody>
@@ -163,10 +163,10 @@ function EditModal({
<>
<Box flex={1} />
<Button variant={'whiteBase'} mr={3} onClick={onClose}>
{t('common:common.Close')}
{t('common:Close')}
</Button>
<Button isLoading={updating} onClick={handleSubmit((data) => onclickUpdate(data))}>
{t('common:common.Confirm Update')}
{t('common:confirm_update')}
</Button>
</>
) : (
@@ -175,7 +175,7 @@ function EditModal({
isLoading={creating}
onClick={handleSubmit((data) => onclickCreate(data))}
>
{t('common:common.Confirm Create')}
{t('common:comfirn_create')}
</Button>
)}
</ModalFooter>

View File

@@ -118,7 +118,7 @@ function GroupInfoModal({
}
})}
>
{editGroup ? t('common:common.Save') : t('common:new_create')}
{editGroup ? t('common:Save') : t('common:new_create')}
</Button>
</ModalFooter>
<AvatarSelect onSelect={onSelectAvatar} />

View File

@@ -294,10 +294,10 @@ function GroupEditModal({
</ModalBody>
<ModalFooter>
<Button variant={'whiteBase'} mr={3} onClick={onClose}>
{t('common:common.Close')}
{t('common:Close')}
</Button>
<Button isLoading={isLoading} onClick={onUpdate}>
{t('common:common.Save')}
{t('common:Save')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -180,10 +180,10 @@ export function ChangeOwnerModal({
<ModalFooter>
<HStack>
<Button onClick={onClose} variant={'whiteBase'}>
{t('common:common.Cancel')}
{t('common:Cancel')}
</Button>
<Button isLoading={loading} isDisabled={!selectedMember} onClick={onConfirm}>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</HStack>
</ModalFooter>

View File

@@ -116,7 +116,7 @@ function MemberTable({ Tabs }: { Tabs: React.ReactNode }) {
<Th bg="myGray.100">{t('account_team:owner')}</Th>
<Th bg="myGray.100">{t('account_team:member')}</Th>
<Th bg="myGray.100" borderRightRadius="6px">
{t('common:common.Action')}
{t('common:Action')}
</Th>
</Tr>
</Thead>
@@ -185,7 +185,7 @@ function MemberTable({ Tabs }: { Tabs: React.ReactNode }) {
type: 'primary' as MenuItemType
},
{
label: t('common:common.Delete'),
label: t('common:Delete'),
icon: 'delete',
onClick: () => {
openDeleteGroupModal(() => delDeleteGroup(group._id))();

View File

@@ -49,7 +49,7 @@ function CreateInvitationModal({
const { runAsync: createInvitationLink, loading } = useRequest2(postCreateInvitationLink, {
manual: true,
errorToast: t('common:common.Create Failed'),
errorToast: t('common:create_failed'),
onSuccess: (data) => {
onSuccess(data);
onClose();
@@ -100,10 +100,10 @@ function CreateInvitationModal({
</ModalBody>
<ModalFooter>
<Button isLoading={loading} onClick={() => onClose()} variant="outline">
{t('common:common.Cancel')}
{t('common:Cancel')}
</Button>
<Button isLoading={loading} onClick={handleSubmit(createInvitationLink)} ml="4">
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -27,7 +27,7 @@ function Invite({ invitelinkid }: { invitelinkid: string }) {
() => postAcceptInvitationLink(invitelinkid),
{
manual: true,
successToast: t('common:common.Success'),
successToast: t('common:Success'),
onSuccess: async () => {
onSwitchTeam(invitationInfo!.teamId);
onClose();

View File

@@ -110,7 +110,7 @@ const InviteModal = ({ onClose }: { onClose: () => void }) => {
<Th bgColor="myGray.100">{t('account_team:used_times_limit')}</Th>
<Th bgColor="myGray.100">{t('account_team:invited')}</Th>
<Th bgColor="myGray.100" borderRightRadius="6px">
{t('common:common.Action')}
{t('common:Action')}
</Th>
</Tr>
</Thead>
@@ -213,7 +213,7 @@ const InviteModal = ({ onClose }: { onClose: () => void }) => {
</Box>
<Flex gap={2} mt={2} justifyContent={'flex-end'}>
<Button variant="outline" onClick={onClosePopover}>
{t('common:common.Cancel')}
{t('common:Cancel')}
</Button>
<Button
isLoading={forbiding}

View File

@@ -66,7 +66,7 @@ function MemberTable({ Tabs }: { Tabs: React.ReactNode }) {
// Member status selector
const statusOptions = [
{
label: t('common:common.All'),
label: t('common:All'),
value: undefined
},
{
@@ -147,7 +147,7 @@ function MemberTable({ Tabs }: { Tabs: React.ReactNode }) {
});
const { runAsync: onRestore } = useRequest2(postRestoreMember, {
onSuccess: onRefreshMembers,
successToast: t('common:common.Success'),
successToast: t('common:Success'),
errorToast: t('common:user.team.invite.Reject')
});
@@ -276,7 +276,7 @@ function MemberTable({ Tabs }: { Tabs: React.ReactNode }) {
</Th>
<Th bgColor="myGray.100">{t('account_team:join_update_time')}</Th>
<Th borderRightRadius="6px" bgColor="myGray.100">
{t('common:common.Action')}
{t('common:Action')}
</Th>
</Tr>
</Thead>

View File

@@ -62,7 +62,7 @@ function OrgInfoModal({
});
},
{
successToast: t('common:common.Create Success'),
successToast: t('common:create_success'),
onSuccess: () => {
onClose();
onSuccess();
@@ -81,7 +81,7 @@ function OrgInfoModal({
});
},
{
successToast: t('common:common.Update Success'),
successToast: t('common:update_success'),
onSuccess: () => {
onClose();
onSuccess();
@@ -155,7 +155,7 @@ function OrgInfoModal({
}
})}
>
{isEdit ? t('common:common.Save') : t('common:new_create')}
{isEdit ? t('common:Save') : t('common:new_create')}
</Button>
</ModalFooter>
<AvatarSelect onSelect={onSelectAvatar} />

View File

@@ -79,7 +79,7 @@ function OrgMemberManageModal({
});
},
{
successToast: t('common:common.Update Success'),
successToast: t('common:update_success'),
onSuccess() {
refetchOrgs();
onClose();
@@ -193,10 +193,10 @@ function OrgMemberManageModal({
</ModalBody>
<ModalFooter>
<Button variant={'whiteBase'} mr={3} onClick={onClose}>
{t('common:common.Close')}
{t('common:Close')}
</Button>
<Button isLoading={isLoading} onClick={onUpdate}>
{t('common:common.Save')}
{t('common:Save')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -51,7 +51,7 @@ function OrgMoveModal({
});
}}
>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -150,7 +150,7 @@ function OrgTable({ Tabs }: { Tabs: React.ReactNode }) {
{t('common:Name')}
</Th>
<Th bg="myGray.100" borderRightRadius="6px">
{t('common:common.Action')}
{t('common:Action')}
</Th>
</Tr>
</Thead>
@@ -298,13 +298,13 @@ function OrgTable({ Tabs }: { Tabs: React.ReactNode }) {
)}
</HStack>
{currentOrg?.path !== '' && (
<Box fontSize={'xs'}>{currentOrg?.description || t('common:common.no_intro')}</Box>
<Box fontSize={'xs'}>{currentOrg?.description || t('common:no_intro')}</Box>
)}
<Divider my={'20px'} />
<Box fontWeight={500} fontSize="sm" color="myGray.900">
{t('common:common.Action')}
{t('common:Action')}
</Box>
{isTeamAdmin && (
<VStack gap="13px" w="100%">

View File

@@ -239,7 +239,7 @@ function PermissionManage({
</Th>
<Th bg="myGray.100" borderRightRadius="md">
<Box mx="auto" w="fit-content">
{t('common:common.Action')}
{t('common:Action')}
</Box>
</Th>
</Tr>

View File

@@ -33,8 +33,8 @@ const OpenAIAccountModal = ({
initUserInfo();
onClose();
},
successToast: t('common:common.Update Success'),
errorToast: t('common:common.Update Failed')
successToast: t('common:update_success'),
errorToast: t('common:update_failed')
}
);
@@ -64,10 +64,10 @@ const OpenAIAccountModal = ({
</ModalBody>
<ModalFooter>
<Button mr={3} variant={'whiteBase'} onClick={onClose}>
{t('common:common.Cancel')}
{t('common:Cancel')}
</Button>
<Button isLoading={loading} onClick={handleSubmit(onSubmit)}>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -38,8 +38,8 @@ const WorkflowVariableModal = ({
initUserInfo();
onClose();
},
successToast: t('common:common.Update Success'),
errorToast: t('common:common.Update Failed')
successToast: t('common:update_success'),
errorToast: t('common:update_failed')
}
);
@@ -68,10 +68,10 @@ const WorkflowVariableModal = ({
</ModalBody>
<ModalFooter>
<Button mr={3} variant={'whiteBase'} onClick={onClose}>
{t('common:common.Cancel')}
{t('common:Cancel')}
</Button>
<Button isLoading={loading} onClick={handleSubmit(onSubmit)}>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -99,12 +99,12 @@ const ImportAppConfigEditor = ({ value, onChange, rows = 16 }: Props) => {
<Box>
<Flex justify={'space-between'} align={'center'} pb={3}>
<Box fontSize={'sm'} color={'myGray.900'} fontWeight={'500'}>
{t('common:common.json_config')}
{t('common:json_config')}
</Box>
<Button onClick={onOpen} variant={'whiteBase'} p={0}>
<Flex px={'0.88rem'} py={'0.44rem'} color={'myGray.600'} fontSize={'mini'}>
<MyIcon name={'file/uploadFile'} w={'1rem'} mr={'0.38rem'} />
{t('common:common.upload_file')}
{t('common:upload_file')}
</Flex>
</Button>
</Flex>

View File

@@ -100,7 +100,7 @@ const ExportConfigPopover = ({
onClick={() => onExportWorkflow('copy')}
>
<MyIcon name={'copy'} w={'1rem'} mr={2} />
<Box fontSize={'mini'}>{t('common:common.copy_to_clipboard')}</Box>
<Box fontSize={'mini'}>{t('common:copy_to_clipboard')}</Box>
</Flex>
<Flex
py={'0.38rem'}
@@ -115,7 +115,7 @@ const ExportConfigPopover = ({
onClick={() => onExportWorkflow('json')}
>
<MyIcon name={'configmap'} w={'1rem'} mr={2} />
<Box fontSize={'mini'}>{t('common:common.export_to_json')}</Box>
<Box fontSize={'mini'}>{t('common:export_to_json')}</Box>
</Flex>
</Box>
)}

View File

@@ -2,7 +2,6 @@ import CollaboratorContextProvider from '@/components/support/permission/MemberM
import ResumeInherit from '@/components/support/permission/ResumeInheritText';
import { AppContext } from './context';
import { useSelectFile } from '@/web/common/file/hooks/useSelectFile';
import { useI18n } from '@/web/context/I18n';
import { resumeInheritPer } from '@/web/core/app/api';
import {
deleteAppCollaborators,
@@ -35,7 +34,6 @@ import { useContextSelector } from 'use-context-selector';
const InfoModal = ({ onClose }: { onClose: () => void }) => {
const { t } = useTranslation();
const { commonT } = useI18n();
const { toast } = useToast();
const { updateAppDetail, appDetail, reloadApp } = useContextSelector(AppContext, (v) => v);
@@ -71,19 +69,19 @@ const InfoModal = ({ onClose }: { onClose: () => void }) => {
{
onSuccess() {
toast({
title: t('common:common.Update Success'),
title: t('common:update_success'),
status: 'success'
});
reloadApp();
},
errorToast: t('common:common.Update Failed')
errorToast: t('common:update_failed')
}
);
const saveSubmitError = useCallback(() => {
// deep search message
const deepSearch = (obj: any): string => {
if (!obj) return t('common:common.Submit failed');
if (!obj) return t('common:submit_failed');
if (!!obj.message) {
return obj.message;
}
@@ -153,7 +151,7 @@ const InfoModal = ({ onClose }: { onClose: () => void }) => {
cursor={'pointer'}
borderRadius={'md'}
mr={4}
title={t('common:common.Set Avatar')}
title={t('common:set_avatar')}
onClick={() => onOpenSelectFile()}
/>
<FormControl>
@@ -212,7 +210,7 @@ const InfoModal = ({ onClose }: { onClose: () => void }) => {
justifyContent="space-between"
w="full"
>
<Box fontSize={'sm'}>{commonT('permission.Collaborator')}</Box>
<Box fontSize={'sm'}>{t('common:permission.Collaborator')}</Box>
<Flex flexDirection="row" gap="2">
<Button
size="sm"
@@ -228,7 +226,7 @@ const InfoModal = ({ onClose }: { onClose: () => void }) => {
leftIcon={<MyIcon w="4" name="support/permission/collaborator" />}
onClick={onOpenAddMember}
>
{t('common:common.Add')}
{t('common:Add')}
</Button>
</Flex>
</Flex>
@@ -244,10 +242,10 @@ const InfoModal = ({ onClose }: { onClose: () => void }) => {
<ModalFooter>
<Button variant={'whiteBase'} mr={3} onClick={onClose}>
{t('common:common.Close')}
{t('common:Close')}
</Button>
<Button isLoading={btnLoading} onClick={saveUpdateModel}>
{t('common:common.Save')}
{t('common:Save')}
</Button>
</ModalFooter>

View File

@@ -100,11 +100,11 @@ const DetailLogsModal = ({ appId, chatId, onClose }: Props) => {
>
<LightRowTabs<PluginRunBoxTabEnum>
list={[
{ label: t('common:common.Input'), value: PluginRunBoxTabEnum.input },
{ label: t('common:Input'), value: PluginRunBoxTabEnum.input },
...(chatRecords.length > 0
? [
{ label: t('common:common.Output'), value: PluginRunBoxTabEnum.output },
{ label: t('common:common.all_result'), value: PluginRunBoxTabEnum.detail }
{ label: t('common:Output'), value: PluginRunBoxTabEnum.output },
{ label: t('common:all_result'), value: PluginRunBoxTabEnum.detail }
]
: [])
]}

View File

@@ -47,7 +47,7 @@ const AppCard = () => {
leftIcon={<MyIcon name={'common/settingLight'} w={'16px'} />}
onClick={onOpenInfoEdit}
>
{t('common:common.Setting')}
{t('common:Setting')}
</Button>
)}
{appDetail.permission.isOwner && (
@@ -67,7 +67,7 @@ const AppCard = () => {
{
icon: 'delete',
type: 'danger',
label: t('common:common.Delete'),
label: t('common:Delete'),
onClick: onDelApp
}
]

View File

@@ -81,7 +81,7 @@ const ChatTest = ({ currentTool, url }: { currentTool: ToolType | null; url: str
{Object.keys(currentTool?.inputSchema.properties || {}).length > 0 && (
<>
<Box color={'myGray.900'} fontSize={'16px'} fontWeight={'medium'} mb={3}>
{t('common:common.Input')}
{t('common:Input')}
</Box>
<Box border={'1px solid'} borderColor={'myGray.200'} borderRadius={'8px'} p={3}>
{Object.entries(currentTool?.inputSchema.properties || {}).map(
@@ -116,13 +116,13 @@ const ChatTest = ({ currentTool, url }: { currentTool: ToolType | null; url: str
)}
<Button mt={3} isLoading={isRunning} onClick={handleSubmit(runTool)}>
{t('common:common.Run')}
{t('common:Run')}
</Button>
{output && (
<>
<Box color={'myGray.900'} fontSize={'16px'} fontWeight={'medium'} mb={3} mt={8}>
{t('common:common.Output')}
{t('common:Output')}
</Box>
<Box>
<Markdown source={`~~~json\n${output}`} />

View File

@@ -69,7 +69,7 @@ const EditForm = ({
runGetMCPTools({ url });
}}
>
{t('common:common.Parse')}
{t('common:Parse')}
</Button>
</Flex>
@@ -215,7 +215,7 @@ const ToolDetailModal = ({ tool, onClose }: { tool: ToolType; onClose: () => voi
</Flex>
<Box mt={6} color={'myGray.900'} fontWeight={'medium'}>
{t('common:common.Params')}
{t('common:Params')}
</Box>
<Box mt={3}>
@@ -256,7 +256,7 @@ const ToolDetailModal = ({ tool, onClose }: { tool: ToolType; onClose: () => voi
</ModalBody>
<ModalFooter>
<Button size={'md'} onClick={onClose}>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -44,7 +44,7 @@ const Header = ({ url, toolList }: { url: string; toolList: ToolType[] }) => {
return await postUpdateMCPTools({ appId, url, toolList });
},
{
successToast: t('common:common.Update Success')
successToast: t('common:update_success')
}
);
@@ -71,7 +71,7 @@ const Header = ({ url, toolList }: { url: string; toolList: ToolType[] }) => {
</Box>
)} */}
<Button size={'sm'} isLoading={isSavingMCPTools} onClick={() => saveMCPTools()}>
{t('common:common.Save')}
{t('common:Save')}
</Button>
</Flex>
</Box>

View File

@@ -237,7 +237,7 @@ const Header = () => {
isOpen={isOpenBackConfirm}
onClose={onCloseBackConfirm}
iconSrc="common/warn"
title={t('common:common.Exit')}
title={t('common:Exit')}
w={'400px'}
>
<ModalBody>
@@ -245,7 +245,7 @@ const Header = () => {
</ModalBody>
<ModalFooter gap={3}>
<Button variant={'whiteDanger'} onClick={onBack}>
{t('common:common.Exit Directly')}
{t('common:exit_directly')}
</Button>
<Button
isLoading={loading}
@@ -262,7 +262,7 @@ const Header = () => {
} catch (error) {}
}}
>
{t('common:common.Save_and_exit')}
{t('common:Save_and_exit')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -49,8 +49,8 @@ const DingTalkEditModal = ({
}
}),
{
errorToast: t('common:common.Create Failed'),
successToast: t('common:common.Create Success'),
errorToast: t('common:create_failed'),
successToast: t('common:create_success'),
onSuccess: onCreate
}
);
@@ -65,8 +65,8 @@ const DingTalkEditModal = ({
}
}),
{
errorToast: t('common:common.Update Failed'),
successToast: t('common:common.Update Success'),
errorToast: t('common:update_failed'),
successToast: t('common:update_success'),
onSuccess: onEdit
}
);
@@ -101,7 +101,7 @@ const DingTalkEditModal = ({
>
<Flex alignItems={'center'}>
<MyIcon w={'17px'} h={'17px'} name="book" mr="1" />
{t('common:common.Read document')}
{t('common:read_doc')}
</Flex>
</Link>
)}
@@ -132,7 +132,7 @@ const DingTalkEditModal = ({
<Flex justifyContent={'end'}>
<Button variant={'whiteBase'} mr={3} onClick={onClose}>
{t('common:common.Close')}
{t('common:Close')}
</Button>
<Button
isLoading={creating || updating}
@@ -140,7 +140,7 @@ const DingTalkEditModal = ({
isEdit ? onclickUpdate(data) : onclickCreate(data)
)}
>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</Flex>
</Flex>

View File

@@ -84,7 +84,7 @@ const DingTalk = ({ appId }: { appId: string }) => {
>
<Flex alignItems={'center'}>
<MyIcon name="book" mr="1" w={'1rem'} />
{t('common:common.Read document')}
{t('common:read_doc')}
</Flex>
</Link>
)}
@@ -113,15 +113,15 @@ const DingTalk = ({ appId }: { appId: string }) => {
<Table variant={'simple'} w={'100%'} overflowX={'auto'} fontSize={'sm'}>
<Thead>
<Tr>
<Th>{t('common:common.Name')}</Th>
<Th>{t('common:Name')}</Th>
<Th>{t('common:support.outlink.Usage points')}</Th>
{feConfigs?.isPlus && (
<>
<Th>{t('common:core.app.share.Ip limit title')}</Th>
<Th>{t('common:common.Expired Time')}</Th>
<Th>{t('common:expired_time')}</Th>
</>
)}
<Th>{t('common:common.Last use time')}</Th>
<Th>{t('common:last_use_time')}</Th>
<Th></Th>
</Tr>
</Thead>
@@ -135,7 +135,7 @@ const DingTalk = ({ appId }: { appId: string }) => {
? `${
item.limit?.maxUsagePoints && item.limit.maxUsagePoints > -1
? ` / ${item.limit.maxUsagePoints}`
: ` / ${t('common:common.Unlimited')}`
: ` / ${t('common:Unlimited')}`
}`
: ''}
</Td>
@@ -152,7 +152,7 @@ const DingTalk = ({ appId }: { appId: string }) => {
<Td>
{item.lastTime
? t(formatTimeToChatTime(item.lastTime) as any).replace('#', ':')
: t('common:common.Un used')}
: t('common:un_used')}
</Td>
<Td display={'flex'} alignItems={'center'}>
<Button
@@ -181,7 +181,7 @@ const DingTalk = ({ appId }: { appId: string }) => {
{
children: [
{
label: t('common:common.Edit'),
label: t('common:Edit'),
icon: 'edit',
onClick: () => {
setEditDingTalkLinkData({
@@ -197,7 +197,7 @@ const DingTalk = ({ appId }: { appId: string }) => {
}
},
{
label: t('common:common.Delete'),
label: t('common:Delete'),
icon: 'delete',
onClick: async () => {
setIsLoading(true);

View File

@@ -50,8 +50,8 @@ const FeiShuEditModal = ({
}
}),
{
errorToast: t('common:common.Create Failed'),
successToast: t('common:common.Create Success'),
errorToast: t('common:create_failed'),
successToast: t('common:create_success'),
onSuccess: onCreate
}
);
@@ -67,8 +67,8 @@ const FeiShuEditModal = ({
}
}),
{
errorToast: t('common:common.Update Failed'),
successToast: t('common:common.Update Success'),
errorToast: t('common:update_failed'),
successToast: t('common:update_success'),
onSuccess: onEdit
}
);
@@ -101,7 +101,7 @@ const FeiShuEditModal = ({
>
<Flex alignItems={'center'}>
<MyIcon w={'17px'} h={'17px'} name="book" mr="1" />
{t('common:common.Read document')}
{t('common:read_doc')}
</Flex>
</Link>
)}
@@ -137,7 +137,7 @@ const FeiShuEditModal = ({
<Flex justifyContent={'end'}>
<Button variant={'whiteBase'} mr={3} onClick={onClose}>
{t('common:common.Close')}
{t('common:Close')}
</Button>
<Button
isLoading={creating || updating}
@@ -145,7 +145,7 @@ const FeiShuEditModal = ({
isEdit ? onclickUpdate(data) : onclickCreate(data)
)}
>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</Flex>
</Flex>

View File

@@ -83,7 +83,7 @@ const FeiShu = ({ appId }: { appId: string }) => {
>
<Flex alignItems={'center'}>
<MyIcon name="book" mr="1" w={'1rem'} />
{t('common:common.Read document')}
{t('common:read_doc')}
</Flex>
</Link>
)}
@@ -112,15 +112,15 @@ const FeiShu = ({ appId }: { appId: string }) => {
<Table variant={'simple'} w={'100%'} overflowX={'auto'} fontSize={'sm'}>
<Thead>
<Tr>
<Th>{t('common:common.Name')}</Th>
<Th>{t('common:Name')}</Th>
<Th>{t('common:support.outlink.Usage points')}</Th>
{feConfigs?.isPlus && (
<>
<Th>{t('common:core.app.share.Ip limit title')}</Th>
<Th>{t('common:common.Expired Time')}</Th>
<Th>{t('common:expired_time')}</Th>
</>
)}
<Th>{t('common:common.Last use time')}</Th>
<Th>{t('common:last_use_time')}</Th>
<Th></Th>
</Tr>
</Thead>
@@ -134,7 +134,7 @@ const FeiShu = ({ appId }: { appId: string }) => {
? `${
item.limit?.maxUsagePoints && item.limit.maxUsagePoints > -1
? ` / ${item.limit.maxUsagePoints}`
: ` / ${t('common:common.Unlimited')}`
: ` / ${t('common:Unlimited')}`
}`
: ''}
</Td>
@@ -151,7 +151,7 @@ const FeiShu = ({ appId }: { appId: string }) => {
<Td>
{item.lastTime
? t(formatTimeToChatTime(item.lastTime) as any).replace('#', ':')
: t('common:common.Un used')}
: t('common:un_used')}
</Td>
<Td display={'flex'} alignItems={'center'}>
<Button
@@ -180,7 +180,7 @@ const FeiShu = ({ appId }: { appId: string }) => {
{
children: [
{
label: t('common:common.Edit'),
label: t('common:Edit'),
icon: 'edit',
onClick: () => {
setEditFeiShuLinkData({
@@ -196,7 +196,7 @@ const FeiShu = ({ appId }: { appId: string }) => {
}
},
{
label: t('common:common.Delete'),
label: t('common:Delete'),
icon: 'delete',
onClick: async () => {
setIsLoading(true);

View File

@@ -99,10 +99,10 @@ const Share = ({ appId }: { appId: string; type: PublishChannelEnum }) => {
<Table variant={'simple'} w={'100%'} overflowX={'auto'} fontSize={'sm'}>
<Thead>
<Tr>
<Th>{t('common:common.Name')}</Th>
<Th>{t('common:Name')}</Th>
{feConfigs?.isPlus && (
<>
<Th>{t('common:common.Expired Time')}</Th>
<Th>{t('common:expired_time')}</Th>
</>
)}
<Th>{t('common:support.outlink.Usage points')}</Th>
@@ -113,7 +113,7 @@ const Share = ({ appId }: { appId: string; type: PublishChannelEnum }) => {
<Th>{t('common:core.app.share.Role check')}</Th>
</>
)}
<Th>{t('common:common.Last use time')}</Th>
<Th>{t('common:last_use_time')}</Th>
<Th></Th>
</Tr>
</Thead>
@@ -136,7 +136,7 @@ const Share = ({ appId }: { appId: string; type: PublishChannelEnum }) => {
? `${
item.limit?.maxUsagePoints && item.limit.maxUsagePoints > -1
? ` / ${item.limit.maxUsagePoints}`
: ` / ${t('common:common.Unlimited')}`
: ` / ${t('common:Unlimited')}`
}`
: ''}
</Td>
@@ -151,7 +151,7 @@ const Share = ({ appId }: { appId: string; type: PublishChannelEnum }) => {
<Td>
{item.lastTime
? t(formatTimeToChatTime(item.lastTime) as any).replace('#', ':')
: t('common:common.Un used')}
: t('common:un_used')}
</Td>
<Td display={'flex'} alignItems={'center'}>
<Button
@@ -176,7 +176,7 @@ const Share = ({ appId }: { appId: string; type: PublishChannelEnum }) => {
{
children: [
{
label: t('common:common.Edit'),
label: t('common:Edit'),
icon: 'edit',
onClick: () =>
setEditLinkData({
@@ -190,7 +190,7 @@ const Share = ({ appId }: { appId: string; type: PublishChannelEnum }) => {
})
},
{
label: t('common:common.Delete'),
label: t('common:Delete'),
icon: 'delete',
type: 'danger',
onClick: () =>
@@ -233,7 +233,7 @@ const Share = ({ appId }: { appId: string; type: PublishChannelEnum }) => {
onEdit={() => {
toast({
status: 'success',
title: t('common:common.Update Success')
title: t('common:update_success')
});
refetchShareChatList();
setEditLinkData(undefined);
@@ -293,12 +293,12 @@ function EditLinkModal({
type
}),
{
errorToast: t('common:common.Create Failed'),
errorToast: t('common:create_failed'),
onSuccess: onCreate
}
);
const { runAsync: onclickUpdate, loading: updating } = useRequest2(putShareChat, {
errorToast: t('common:common.Update Failed'),
errorToast: t('common:update_failed'),
onSuccess: onEdit
});
@@ -328,7 +328,7 @@ function EditLinkModal({
placeholder={t('publish:link_name')}
maxLength={100}
{...register('name', {
required: t('common:common.name_is_empty')
required: t('common:name_is_empty')
})}
/>
</Flex>
@@ -336,7 +336,7 @@ function EditLinkModal({
<>
<Flex alignItems={'center'} mt={4}>
<FormLabel flex={'0 0 90px'} alignItems={'center'}>
{t('common:common.Expired Time')}
{t('common:expired_time')}
</FormLabel>
<Input
type="datetime-local"
@@ -479,13 +479,13 @@ function EditLinkModal({
<ModalFooter>
<Button variant={'whiteBase'} mr={3} onClick={onClose}>
{t('common:common.Close')}
{t('common:Close')}
</Button>
<Button
isLoading={creating || updating}
onClick={submitShareChat((data) => (isEdit ? onclickUpdate(data) : onclickCreate(data)))}
>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -52,8 +52,8 @@ const OffiAccountEditModal = ({
});
},
{
errorToast: t('common:common.Create Failed'),
successToast: t('common:common.Create Success'),
errorToast: t('common:create_failed'),
successToast: t('common:create_success'),
onSuccess: onCreate
}
);
@@ -69,8 +69,8 @@ const OffiAccountEditModal = ({
return updateShareChat(e);
},
{
errorToast: t('common:common.Update Failed'),
successToast: t('common:common.Update Success'),
errorToast: t('common:update_failed'),
successToast: t('common:update_success'),
onSuccess: onEdit
}
);
@@ -107,7 +107,7 @@ const OffiAccountEditModal = ({
>
<Flex alignItems={'center'}>
<MyIcon name="book" w={'17px'} h={'17px'} mr="1" />
{t('common:common.Read document')}
{t('common:read_doc')}
</Flex>
</Link>
)}
@@ -154,7 +154,7 @@ const OffiAccountEditModal = ({
<Flex justifyContent={'end'}>
<Button variant={'whiteBase'} mr={3} onClick={onClose}>
{t('common:common.Close')}
{t('common:Close')}
</Button>
<Button
isLoading={creating || updating}
@@ -162,7 +162,7 @@ const OffiAccountEditModal = ({
isEdit ? onclickUpdate(data) : onclickCreate(data)
)}
>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</Flex>
</Flex>

View File

@@ -86,7 +86,7 @@ const OffiAccount = ({ appId }: { appId: string }) => {
>
<Flex alignItems={'center'}>
<MyIcon name="book" mr="1" w={'1rem'} />
{t('common:common.Read document')}
{t('common:read_doc')}
</Flex>
</Link>
)}
@@ -115,15 +115,15 @@ const OffiAccount = ({ appId }: { appId: string }) => {
<Table variant={'simple'} w={'100%'} overflowX={'auto'} fontSize={'sm'}>
<Thead>
<Tr>
<Th>{t('common:common.Name')} </Th>
<Th>{t('common:Name')} </Th>
<Th> {t('common:support.outlink.Usage points')} </Th>
{feConfigs?.isPlus && (
<>
<Th>{t('common:core.app.share.Ip limit title')} </Th>
<Th> {t('common:common.Expired Time')} </Th>
<Th> {t('common:expired_time')} </Th>
</>
)}
<Th>{t('common:common.Last use time')} </Th>
<Th>{t('common:last_use_time')} </Th>
<Th> </Th>
</Tr>
</Thead>
@@ -137,7 +137,7 @@ const OffiAccount = ({ appId }: { appId: string }) => {
? `${
item.limit?.maxUsagePoints && item.limit.maxUsagePoints > -1
? ` / ${item.limit.maxUsagePoints}`
: ` / ${t('common:common.Unlimited')}`
: ` / ${t('common:Unlimited')}`
}`
: ''}
</Td>
@@ -154,7 +154,7 @@ const OffiAccount = ({ appId }: { appId: string }) => {
<Td>
{item.lastTime
? t(formatTimeToChatTime(item.lastTime) as any).replace('#', ':')
: t('common:common.Un used')}
: t('common:un_used')}
</Td>
<Td display={'flex'} alignItems={'center'}>
<Button
@@ -183,7 +183,7 @@ const OffiAccount = ({ appId }: { appId: string }) => {
{
children: [
{
label: t('common:common.Edit'),
label: t('common:Edit'),
icon: 'edit',
onClick: () => {
setEditOffiAccountData({
@@ -199,7 +199,7 @@ const OffiAccount = ({ appId }: { appId: string }) => {
}
},
{
label: t('common:common.Delete'),
label: t('common:Delete'),
icon: 'delete',
onClick: async () => {
setIsLoading(true);

View File

@@ -46,15 +46,15 @@ const WecomEditModal = ({
type: PublishChannelEnum.wecom
}),
{
errorToast: t('common:common.Create Failed'),
successToast: t('common:common.Create Success'),
errorToast: t('common:create_failed'),
successToast: t('common:create_success'),
onSuccess: onCreate
}
);
const { runAsync: onclickUpdate, loading: updating } = useRequest2((e) => updateShareChat(e), {
errorToast: t('common:common.Update Failed'),
successToast: t('common:common.Update Success'),
errorToast: t('common:update_failed'),
successToast: t('common:update_success'),
onSuccess: onEdit
});
@@ -83,7 +83,7 @@ const WecomEditModal = ({
>
<Flex alignItems={'center'}>
<MyIcon name="book" w={'17px'} h={'17px'} mr="1" />
{t('common:common.Read document')}
{t('common:read_doc')}
</Flex>
</Link>
)}
@@ -146,7 +146,7 @@ const WecomEditModal = ({
<Flex justifyContent={'end'}>
<Button variant={'whiteBase'} mr={3} onClick={onClose}>
{t('common:common.Close')}
{t('common:Close')}
</Button>
<Button
isLoading={creating || updating}
@@ -154,7 +154,7 @@ const WecomEditModal = ({
isEdit ? onclickUpdate(data) : onclickCreate(data)
)}
>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</Flex>
</Flex>

View File

@@ -88,15 +88,15 @@ const Wecom = ({ appId }: { appId: string }) => {
<Table variant={'simple'} w={'100%'} overflowX={'auto'} fontSize={'sm'}>
<Thead>
<Tr>
<Th>{t('common:common.Name')} </Th>
<Th>{t('common:Name')} </Th>
<Th> {t('common:support.outlink.Usage points')} </Th>
{feConfigs?.isPlus && (
<>
<Th>{t('common:core.app.share.Ip limit title')} </Th>
<Th> {t('common:common.Expired Time')} </Th>
<Th> {t('common:expired_time')} </Th>
</>
)}
<Th>{t('common:common.Last use time')} </Th>
<Th>{t('common:last_use_time')} </Th>
<Th> </Th>
</Tr>
</Thead>
@@ -110,7 +110,7 @@ const Wecom = ({ appId }: { appId: string }) => {
? `${
item.limit?.maxUsagePoints && item.limit.maxUsagePoints > -1
? ` / ${item.limit.maxUsagePoints}`
: ` / ${t('common:common.Unlimited')}`
: ` / ${t('common:Unlimited')}`
}`
: ''}
</Td>
@@ -127,7 +127,7 @@ const Wecom = ({ appId }: { appId: string }) => {
<Td>
{item.lastTime
? t(formatTimeToChatTime(item.lastTime) as any).replace('#', ':')
: t('common:common.Un used')}
: t('common:un_used')}
</Td>
<Td display={'flex'} alignItems={'center'}>
<Button
@@ -156,7 +156,7 @@ const Wecom = ({ appId }: { appId: string }) => {
{
children: [
{
label: t('common:common.Edit'),
label: t('common:Edit'),
icon: 'edit',
onClick: () => {
setEditWecomData({
@@ -172,7 +172,7 @@ const Wecom = ({ appId }: { appId: string }) => {
}
},
{
label: t('common:common.Delete'),
label: t('common:Delete'),
icon: 'delete',
onClick: async () => {
setIsLoading(true);

View File

@@ -28,7 +28,7 @@ function BasicInfo({
placeholder={t('publish:publish_name')}
maxLength={100}
{...register('name', {
required: t('common:common.name_is_empty')
required: t('common:name_is_empty')
})}
/>
</Flex>
@@ -66,7 +66,7 @@ function BasicInfo({
</Flex>
<Flex alignItems={'center'}>
<FormLabel flex={'0 0 6.25rem'} alignItems={'center'}>
{t('common:common.Expired Time')}
{t('common:expired_time')}
</FormLabel>
<Input
type="datetime-local"

View File

@@ -167,7 +167,7 @@ const MyEdit = <T extends SimpleAppSnapshotType | WorkflowSnapshotsType>({
);
})}
<Box py={2} textAlign={'center'} color={'myGray.600'} fontSize={'xs'}>
{t('common:common.No more data')}
{t('common:no_more_data')}
</Box>
</Flex>
</Flex>

View File

@@ -72,7 +72,7 @@ const AppCard = ({
router.reload();
}
},
successToast: t('common:common.Success')
successToast: t('common:Success')
}
);
@@ -114,7 +114,7 @@ const AppCard = ({
leftIcon={<MyIcon name={'common/settingLight'} w={'16px'} />}
onClick={onOpenInfoEdit}
>
{t('common:common.Setting')}
{t('common:Setting')}
</Button>
)}
{appDetail.permission.isOwner && (
@@ -151,7 +151,7 @@ const AppCard = ({
? [
{
icon: 'core/chat/fileSelect',
label: t('common:common.Team Tags Set'),
label: t('app:team_tags_set'),
onClick: () => setTeamTagsSet(appDetail)
}
]
@@ -163,7 +163,7 @@ const AppCard = ({
{
icon: 'delete',
type: 'danger',
label: t('common:common.Delete'),
label: t('common:Delete'),
onClick: onDelApp
}
]
@@ -198,10 +198,10 @@ const AppCard = ({
</ModalBody>
<ModalFooter>
<Button variant={'whiteBase'} onClick={() => setTransitionCreateNew(undefined)} mr={3}>
{t('common:common.Close')}
{t('common:Close')}
</Button>
<Button variant={'dangerFill'} isLoading={transiting} onClick={() => onTransition()}>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -216,7 +216,7 @@ const EditForm = ({
fontSize={'sm'}
onClick={onOpenKbSelect}
>
{t('common:common.Choose')}
{t('common:Choose')}
</Button>
<Button
variant={'transparentBase'}
@@ -226,7 +226,7 @@ const EditForm = ({
fontSize={'sm'}
onClick={onOpenDatasetParams}
>
{t('common:common.Params')}
{t('common:Params')}
</Button>
</Flex>
{appForm.dataset.datasets?.length > 0 && (

View File

@@ -181,7 +181,7 @@ const Header = ({
};
}, []);
useBeforeunload({
tip: t('common:core.common.tip.leave page'),
tip: t('common:core.tip.leave page'),
callback: onLeaveAutoSave
});

View File

@@ -105,7 +105,7 @@ const ConfigToolModal = ({
</ModalBody>
<ModalFooter gap={6}>
<Button onClick={onCloseConfigTool} variant={'whiteBase'}>
{t('common:common.Cancel')}
{t('common:Cancel')}
</Button>
<Button
variant={'primary'}
@@ -120,7 +120,7 @@ const ConfigToolModal = ({
onCloseConfigTool();
})}
>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -56,7 +56,7 @@ const ToolSelect = ({
fontSize={'sm'}
onClick={onOpenToolsSelect}
>
{t('common:common.Choose')}
{t('common:Choose')}
</Button>
</Flex>
<Grid

View File

@@ -469,7 +469,7 @@ const RenderList = React.memo(function RenderList({
px={2}
fontSize={'mini'}
>
{t('common:common.Remove')}
{t('common:Remove')}
</Button>
) : template.flowNodeType === 'toolSet' ? (
<Flex gap={2}>
@@ -482,7 +482,7 @@ const RenderList = React.memo(function RenderList({
px={2}
fontSize={'mini'}
>
{t('common:common.Open')}
{t('common:Open')}
</Button>
<Button
size={'sm'}
@@ -493,7 +493,7 @@ const RenderList = React.memo(function RenderList({
px={2}
fontSize={'mini'}
>
{t('common:common.Add')}
{t('common:Add')}
</Button>
</Flex>
) : template.isFolder ? (
@@ -505,7 +505,7 @@ const RenderList = React.memo(function RenderList({
px={2}
fontSize={'mini'}
>
{t('common:common.Open')}
{t('common:Open')}
</Button>
) : (
<Button
@@ -517,7 +517,7 @@ const RenderList = React.memo(function RenderList({
px={2}
fontSize={'mini'}
>
{t('common:common.Add')}
{t('common:Add')}
</Button>
)}
</Flex>

View File

@@ -41,11 +41,11 @@ const TagsEditModal = ({ onClose }: { onClose: () => void }) => {
onSuccess() {
onClose();
toast({
title: t('common:common.Update Success'),
title: t('common:update_success'),
status: 'success'
});
},
errorToast: t('common:common.Update Failed')
errorToast: t('common:update_failed')
});
const { data: teamTags = [] } = useQuery(['getTeamsTags'], getTeamsTags);
@@ -131,10 +131,10 @@ const TagsEditModal = ({ onClose }: { onClose: () => void }) => {
</ModalBody>
<ModalFooter>
<Button variant={'whiteBase'} mr={3} onClick={onClose}>
{t('common:common.Close')}
{t('common:Close')}
</Button>
<Button isLoading={btnLoading} onClick={(e) => saveSubmitSuccess(e)}>
{t('common:common.Save')}
{t('common:Save')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -242,7 +242,7 @@ const Header = () => {
isOpen={isOpenBackConfirm}
onClose={onCloseBackConfirm}
iconSrc="common/warn"
title={t('common:common.Exit')}
title={t('common:Exit')}
w={'400px'}
>
<ModalBody>
@@ -250,7 +250,7 @@ const Header = () => {
</ModalBody>
<ModalFooter gap={3}>
<Button variant={'whiteDanger'} onClick={onBack}>
{t('common:common.Exit Directly')}
{t('common:exit_directly')}
</Button>
<Button
isLoading={loading}
@@ -267,7 +267,7 @@ const Header = () => {
} catch (error) {}
}}
>
{t('common:common.Save_and_exit')}
{t('common:Save_and_exit')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -50,7 +50,7 @@ const SaveButton = ({
/>
}
>
<Box>{t('common:common.Save')}</Box>
<Box>{t('common:Save')}</Box>
</Button>
}
>

View File

@@ -134,7 +134,7 @@ const AppCard = ({ showSaveStatus, isSaved }: { showSaveStatus: boolean; isSaved
onClick={onDelApp}
>
<MyIcon name={'delete'} w={'16px'} mr={2} />
<Box fontSize={'sm'}>{t('common:common.Delete')}</Box>
<Box fontSize={'sm'}>{t('common:Delete')}</Box>
</MyBox>
</>
)}

View File

@@ -90,11 +90,11 @@ const ChatTest = ({ isOpen, nodes = [], edges = [], onClose }: Props) => {
>
<LightRowTabs<PluginRunBoxTabEnum>
list={[
{ label: t('common:common.Input'), value: PluginRunBoxTabEnum.input },
{ label: t('common:Input'), value: PluginRunBoxTabEnum.input },
...(chatRecords.length > 0
? [
{ label: t('common:common.Output'), value: PluginRunBoxTabEnum.output },
{ label: t('common:common.all_result'), value: PluginRunBoxTabEnum.detail }
{ label: t('common:Output'), value: PluginRunBoxTabEnum.output },
{ label: t('common:all_result'), value: PluginRunBoxTabEnum.detail }
]
: [])
]}
@@ -133,7 +133,7 @@ const ChatTest = ({ isOpen, nodes = [], edges = [], onClose }: Props) => {
onClick={restartChat}
/>
</MyTooltip>
<MyTooltip label={t('common:common.Close')}>
<MyTooltip label={t('common:Close')}>
<IconButton
ml={4}
icon={<SmallCloseIcon fontSize={'22px'} />}

View File

@@ -58,7 +58,7 @@ const ImportSettings = ({ onClose }: Props) => {
}}
fontWeight={'500'}
>
{t('common:common.Save')}
{t('common:Save')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -62,7 +62,7 @@ const SelectAppModal = ({
</ModalBody>
<ModalFooter>
<Button variant={'whiteBase'} onClick={onClose}>
{t('common:common.Cancel')}
{t('common:Cancel')}
</Button>
<Button
ml={2}
@@ -73,7 +73,7 @@ const SelectAppModal = ({
onClose();
}}
>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -150,7 +150,7 @@ const FlowController = React.memo(function FlowController() {
<Box w="1px" h="20px" bg="gray.200" mx={1.5}></Box>
{/* undo */}
<MyTooltip label={isMac ? t('common:common.undo_tip_mac') : t('common:common.undo_tip')}>
<MyTooltip label={isMac ? t('common:undo_tip_mac') : t('common:undo_tip')}>
<ControlButton
onClick={undo}
style={buttonStyle}
@@ -162,7 +162,7 @@ const FlowController = React.memo(function FlowController() {
</MyTooltip>
{/* redo */}
<MyTooltip label={isMac ? t('common:common.redo_tip_mac') : t('common:common.redo_tip')}>
<MyTooltip label={isMac ? t('common:redo_tip_mac') : t('common:redo_tip')}>
<ControlButton
onClick={redo}
style={buttonStyle}
@@ -176,9 +176,7 @@ const FlowController = React.memo(function FlowController() {
<Box w="1px" h="20px" bg="gray.200" mx={1.5}></Box>
{/* zoom out */}
<MyTooltip
label={isMac ? t('common:common.zoomin_tip_mac') : t('common:common.zoomin_tip')}
>
<MyTooltip label={isMac ? t('common:zoomin_tip_mac') : t('common:zoomin_tip')}>
<ControlButton
onClick={() => zoomOut()}
style={buttonStyle}
@@ -190,9 +188,7 @@ const FlowController = React.memo(function FlowController() {
</MyTooltip>
{/* zoom in */}
<MyTooltip
label={isMac ? t('common:common.zoomout_tip_mac') : t('common:common.zoomout_tip')}
>
<MyTooltip label={isMac ? t('common:zoomout_tip_mac') : t('common:zoomout_tip')}>
<ControlButton
onClick={() => zoomIn()}
style={buttonStyle}
@@ -206,7 +202,7 @@ const FlowController = React.memo(function FlowController() {
<Box w="1px" h="20px" bg="gray.200" mx={1.5}></Box>
{/* fit view */}
<MyTooltip label={t('common:common.page_center')}>
<MyTooltip label={t('common:page_center')}>
<ControlButton
onClick={() => fitView()}
style={buttonStyle}

View File

@@ -43,7 +43,7 @@ const SaveAndPublishModal = ({
>
<ModalBody>
<Box mb={2.5} color={'myGray.900'} fontSize={'14px'} fontWeight={'500'}>
{t('common:common.Name')}
{t('common:Name')}
</Box>
<Box mb={3}>
<Input
@@ -64,7 +64,7 @@ const SaveAndPublishModal = ({
}}
variant={'whiteBase'}
>
{t('common:common.Cancel')}
{t('common:Cancel')}
</Button>
<Button
isLoading={isLoading}
@@ -79,7 +79,7 @@ const SaveAndPublishModal = ({
onClose();
})}
>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>

Some files were not shown because too many files have changed in this diff Show More