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={() => {