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

@@ -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>

View File

@@ -362,9 +362,7 @@ export const useDebug = () => {
</Box>
</Box>
<Flex py={2} justifyContent={'flex-end'} px={6}>
<Button onClick={handleSubmit(onClickRun, onCheckRunError)}>
{t('common:common.Run')}
</Button>
<Button onClick={handleSubmit(onClickRun, onCheckRunError)}>{t('common:Run')}</Button>
</Flex>
</MyRightDrawer>
);

View File

@@ -190,7 +190,7 @@ const NodeLoop = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
return (
<NodeCard selected={selected} maxW="full" menuForbid={{ copy: true }} {...data}>
<Container position={'relative'} flex={1}>
<IOTitle text={t('common:common.Input')} />
<IOTitle text={t('common:Input')} />
{RenderInputDom}
{RenderChildrenNodes}
</Container>

View File

@@ -35,7 +35,7 @@ const NodeCQNode = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
{agents.map((item, i) => (
<Box key={item.key} mb={4}>
<Flex alignItems={'center'}>
<MyTooltip label={t('common:common.Delete')}>
<MyTooltip label={t('common:Delete')}>
<MyIcon
mt={1}
mr={2}

View File

@@ -135,7 +135,7 @@ const NodeCode = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
</Container>
)}
<Container>
<IOTitle text={t('common:common.Input')} mb={-1} />
<IOTitle text={t('common:Input')} mb={-1} />
<RenderInput
nodeId={nodeId}
flowInputList={commonInputs}
@@ -143,7 +143,7 @@ const NodeCode = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
/>
</Container>
<Container>
<IOTitle text={t('common:common.Output')} />
<IOTitle text={t('common:Output')} />
<RenderOutput nodeId={nodeId} flowOutputList={outputs} />
</Container>
<ResetTemplateConfirm />

View File

@@ -96,7 +96,7 @@ const NodeDatasetConcat = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
});
}}
>
{t('common:common.Add New')}
{t('common:add_new')}
</Button>
</HStack>
<Box mt={2}>
@@ -120,7 +120,7 @@ const NodeDatasetConcat = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
{/* {RenderQuoteList} */}
</Container>
<Container>
<IOTitle text={t('common:common.Output')} />
<IOTitle text={t('common:Output')} />
<RenderOutput nodeId={nodeId} flowOutputList={outputs} />
</Container>
</NodeCard>

View File

@@ -114,7 +114,7 @@ const ExtractFieldModal = ({
<Box mt={5}>
<Flex alignItems={'center'}>
<FormLabel>
{t('common:core.module.extract.Enum Value')}({t('common:common.choosable')})
{t('common:core.module.extract.Enum Value')}({t('common:choosable')})
</FormLabel>
<QuestionTip
ml={1}
@@ -133,7 +133,7 @@ const ExtractFieldModal = ({
</ModalBody>
<ModalFooter>
<Button onClick={handleSubmit(onSubmit)}>{t('common:common.Confirm')}</Button>
<Button onClick={handleSubmit(onSubmit)}>{t('common:Confirm')}</Button>
</ModalFooter>
</MyModal>
);

View File

@@ -158,7 +158,7 @@ const NodeExtract = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
)}
<>
<Container>
<IOTitle text={t('common:common.Input')} />
<IOTitle text={t('common:Input')} />
<RenderInput
nodeId={nodeId}
flowInputList={commonInputs}
@@ -168,7 +168,7 @@ const NodeExtract = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
</>
<>
<Container>
<IOTitle text={t('common:common.Output')} />
<IOTitle text={t('common:Output')} />
<RenderOutput nodeId={nodeId} flowOutputList={outputs} />
</Container>
</>

View File

@@ -100,7 +100,7 @@ const InputFormEditModal = ({
onSubmit(data);
toast({
status: 'success',
title: t('common:common.Add Success')
title: t('common:Add Success')
});
reset(defaultFormInput);
}

View File

@@ -142,7 +142,7 @@ const NodeFormInput = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
setEditField(defaultFormInput);
}}
>
{t('common:common.Add_new_input')}
{t('common:Add_new_input')}
</Button>
{!!editField && (
<InputFormEditModal
@@ -246,11 +246,11 @@ const NodeFormInput = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
return (
<NodeCard minW={'400px'} selected={selected} {...data}>
<Container>
<IOTitle text={t('common:common.Input')} />
<IOTitle text={t('common:Input')} />
<RenderInput nodeId={nodeId} flowInputList={inputs} CustomComponent={CustomComponent} />
</Container>
<Container>
<IOTitle text={t('common:common.Output')} />
<IOTitle text={t('common:Output')} />
<RenderOutput nodeId={nodeId} flowOutputList={outputs} />
</Container>
</NodeCard>

View File

@@ -95,12 +95,12 @@ const CurlImportModal = ({
onClose();
toast({
title: t('common:common.Import success'),
title: t('common:import_success'),
status: 'success'
});
} catch (error: any) {
toast({
title: t('common:common.Import failed'),
title: t('common:import_failed'),
description: error.message,
status: 'error'
});
@@ -126,7 +126,7 @@ const CurlImportModal = ({
</ModalBody>
<ModalFooter>
<Button onClick={handleSubmit((data) => handleFileProcessing(data.curlContent))}>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -845,7 +845,7 @@ const NodeHttp = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
)}
<>
<Container>
<IOTitle text={t('common:common.Input')} />
<IOTitle text={t('common:Input')} />
<RenderInput
nodeId={nodeId}
flowInputList={commonInputs}
@@ -855,7 +855,7 @@ const NodeHttp = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
</>
<>
<Container>
<IOTitle text={t('common:common.Output')} />
<IOTitle text={t('common:Output')} />
<RenderOutput flowOutputList={outputs} nodeId={nodeId} />
</Container>
</>

View File

@@ -31,7 +31,6 @@ import { Position, useReactFlow } from 'reactflow';
import { getRefData } from '@/web/core/workflow/utils';
import DragIcon from '@fastgpt/web/components/common/DndDrag/DragIcon';
import { AppContext } from '@/pageComponents/app/detail/context';
import { useI18n } from '@/web/context/I18n';
const ListItem = ({
provided,
@@ -418,7 +417,7 @@ const ConditionValueInput = ({
condition?: VariableConditionEnum;
onChange: (e: string) => void;
}) => {
const { workflowT } = useI18n();
const { t } = useTranslation();
const nodeList = useContextSelector(WorkflowContext, (v) => v.nodeList);
// get value type
@@ -443,7 +442,7 @@ const ConditionValueInput = ({
]}
onChange={onChange}
value={value}
placeholder={workflowT('ifelse.Select value')}
placeholder={t('workflow:ifelse.Select value')}
isDisabled={
condition === VariableConditionEnum.isEmpty ||
condition === VariableConditionEnum.isNotEmpty
@@ -457,7 +456,7 @@ const ConditionValueInput = ({
placeholder={
condition === VariableConditionEnum.reg
? '/^((+|00)86)?1[3-9]d{9}$/'
: workflowT('ifelse.Input value')
: t('workflow:ifelse.Input value')
}
w={'100%'}
bg={'white'}
@@ -469,7 +468,7 @@ const ConditionValueInput = ({
/>
);
}
}, [condition, onChange, value, valueType, workflowT]);
}, [condition, onChange, value, valueType, t]);
return Render;
};

View File

@@ -214,7 +214,7 @@ const NodeLaf = (props: NodeProps<FlowNodeItemType>) => {
});
},
{
successToast: t('common:common.Sync success')
successToast: t('common:sync_success')
}
);
@@ -347,13 +347,13 @@ const RenderIO = ({ data }: NodeProps<FlowNodeItemType>) => {
)}
<>
<Container>
<IOTitle text={t('common:common.Input')} />
<IOTitle text={t('common:Input')} />
<RenderInput nodeId={nodeId} flowInputList={commonInputs} />
</Container>
</>
<>
<Container>
<IOTitle text={t('common:common.Output')} />
<IOTitle text={t('common:Output')} />
<RenderOutput flowOutputList={outputs} nodeId={nodeId} />
</Container>
</>

View File

@@ -219,7 +219,7 @@ const FieldEditModal = ({
onSubmit(data);
toast({
status: 'success',
title: t('common:common.Add Success')
title: t('common:Add Success')
});
reset(defaultInput);
}

View File

@@ -588,7 +588,7 @@ const InputTypeConfig = ({
<Flex justify={'flex-end'} gap={3} pb={8} pr={8}>
<Button variant={'whiteBase'} fontWeight={'medium'} onClick={onClose} w={20}>
{t('common:common.Close')}
{t('common:Close')}
</Button>
<Button
variant={'primaryOutline'}
@@ -596,7 +596,7 @@ const InputTypeConfig = ({
onClick={handleSubmit((data) => onSubmitSuccess(data, 'confirm'), onSubmitError)}
w={20}
>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
{!isEdit && (
<Button
@@ -604,7 +604,7 @@ const InputTypeConfig = ({
onClick={handleSubmit((data) => onSubmitSuccess(data, 'continue'), onSubmitError)}
w={20}
>
{t('common:common.Continue_Adding')}
{t('common:Continue_Adding')}
</Button>
)}
</Flex>

View File

@@ -108,7 +108,7 @@ const NodePluginInput = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
size={'sm'}
onClick={() => setEditField(defaultInput)}
>
{t('common:common.Add New')}
{t('common:add_new')}
</Button>
</HStack>
<VariableTable
@@ -143,7 +143,7 @@ const NodePluginInput = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
</Container>
{outputs.length != inputs.length && (
<Container>
<IOTitle text={t('common:common.Output')} />
<IOTitle text={t('common:Output')} />
<RenderOutput nodeId={nodeId} flowOutputList={outputs} />
</Container>
)}

View File

@@ -16,7 +16,6 @@ import MyIcon from '@fastgpt/web/components/common/Icon';
import ValueTypeLabel from '../render/ValueTypeLabel';
import QuestionTip from '@fastgpt/web/components/common/MyTooltip/QuestionTip';
import FormLabel from '@fastgpt/web/components/common/MyBox/FormLabel';
import { useI18n } from '@/web/context/I18n';
import { useConfirm } from '@fastgpt/web/hooks/useConfirm';
import PluginOutputEditModal, { defaultOutput } from './PluginOutputEditModal';
import MyTooltip from '@fastgpt/web/components/common/MyTooltip';
@@ -56,7 +55,7 @@ const NodePluginOutput = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
size={'sm'}
onClick={() => setEditField(defaultOutput)}
>
{t('common:common.Add New')}
{t('common:add_new')}
</Button>
</Flex>
@@ -100,10 +99,9 @@ function Reference({
input: FlowNodeInputItemType;
}) {
const { t } = useTranslation();
const { workflowT } = useI18n();
const { ConfirmModal, openConfirm } = useConfirm({
type: 'delete',
content: workflowT('confirm_delete_field_tip')
content: t('workflow:confirm_delete_field_tip')
});
const onChangeNode = useContextSelector(WorkflowContext, (v) => v.onChangeNode);

View File

@@ -179,10 +179,10 @@ const PluginOutputEditModal = ({
</ModalBody>
<ModalFooter gap={3}>
<Button variant={'whiteBase'} onClick={onClose}>
{t('common:common.Close')}
{t('common:Close')}
</Button>
<Button onClick={handleSubmit(onSubmitSuccess, onSubmitError)}>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -38,7 +38,7 @@ const NodeSimple = ({
{filterHiddenInputs.length > 0 && (
<>
<Container>
<IOTitle text={t('common:common.Input')} />
<IOTitle text={t('common:Input')} />
<RenderInput nodeId={nodeId} flowInputList={commonInputs} />
</Container>
</>
@@ -46,7 +46,7 @@ const NodeSimple = ({
{outputs.filter((output) => output.type !== FlowNodeOutputTypeEnum.hidden).length > 0 && (
<>
<Container>
<IOTitle text={t('common:common.Output')} />
<IOTitle text={t('common:Output')} />
<RenderOutput nodeId={nodeId} flowOutputList={outputs} />
</Container>
</>

View File

@@ -29,13 +29,13 @@ const NodeTool = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
)}
<>
<Container>
<IOTitle text={t('common:common.Input')} />
<IOTitle text={t('common:Input')} />
<RenderInput nodeId={nodeId} flowInputList={commonInputs} />
</Container>
</>
<>
<Container>
<IOTitle text={t('common:common.Output')} />
<IOTitle text={t('common:Output')} />
<RenderOutput flowOutputList={outputs} nodeId={nodeId} />
</Container>
</>

View File

@@ -169,10 +169,10 @@ const ToolParamsEditModal = ({
</ModalBody>
<ModalFooter>
<Button variant={'whiteBase'} mr={2} onClick={onClose}>
{t('common:common.Close')}
{t('common:Close')}
</Button>
<Button onClick={handleSubmit((data) => onClickSubmit(data), onClickSubmitError)}>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -18,11 +18,11 @@ const NodeTools = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
return (
<NodeCard minW={'350px'} selected={selected} {...data}>
<Container>
<IOTitle text={t('common:common.Input')} />
<IOTitle text={t('common:Input')} />
<RenderInput nodeId={nodeId} flowInputList={inputs} />
</Container>
<Container>
<IOTitle text={t('common:common.Output')} />
<IOTitle text={t('common:Output')} />
<RenderOutput nodeId={nodeId} flowOutputList={outputs} />
</Container>
<Box position={'relative'}>

View File

@@ -115,7 +115,7 @@ const NodeUserSelect = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
<RenderInput nodeId={nodeId} flowInputList={inputs} CustomComponent={CustomComponent} />
</Container>
<Container>
<IOTitle text={t('common:common.Output')} />
<IOTitle text={t('common:Output')} />
<RenderOutput nodeId={nodeId} flowOutputList={outputs} />
</Container>
</NodeCard>
@@ -154,7 +154,7 @@ const OptionItem = ({
}}
>
<HStack spacing={1} {...provided.dragHandleProps}>
<MyTooltip label={t('common:common.Delete')}>
<MyTooltip label={t('common:Delete')}>
<MyIcon
mt={0.5}
name={'minus'}

View File

@@ -313,7 +313,7 @@ const NodeVariableUpdate = ({ data, selected }: NodeProps<FlowNodeItemType>) =>
]);
}}
>
{t('common:common.Add New')}
{t('common:add_new')}
</Button>
</Flex>
</Box>

View File

@@ -73,7 +73,7 @@ const NodeStart = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
{...data}
>
<Container>
<IOTitle text={t('common:common.Output')} />
<IOTitle text={t('common:Output')} />
<RenderOutput nodeId={nodeId} flowOutputList={outputs} />
</Container>
<Container>

View File

@@ -78,7 +78,7 @@ const NodeCard = (props: Props) => {
// custom title edit
const { onOpenModal: onOpenCustomTitleModal, EditModal: EditTitleModal } = useEditTitle({
title: t('common:common.Custom Title'),
title: t('common:custom_title'),
placeholder: t('app:module.Custom Title Tip') || ''
});
@@ -533,7 +533,7 @@ const MenuRender = React.memo(function MenuRender({
: [
{
icon: 'copy',
label: t('common:common.Copy'),
label: t('common:Copy'),
variant: 'whiteBase',
onClick: () => onCopyNode(nodeId)
}
@@ -543,7 +543,7 @@ const MenuRender = React.memo(function MenuRender({
: [
{
icon: 'delete',
label: t('common:common.Delete'),
label: t('common:Delete'),
variant: 'whiteDanger',
onClick: () => onDelNode(nodeId)
}

View File

@@ -55,7 +55,7 @@ const RenderUserFormInteractive = React.memo(function RenderFormInput({
})()
}
>
{t('common:common.Next Step')}
{t('common:next_step')}
</Button>
)}
/>
@@ -218,7 +218,7 @@ const NodeDebugResponse = ({ nodeId, debugResult }: NodeDebugResponseProps) => {
variant={'primary'}
onClick={() => onNextNodeDebug(workflowDebugData)}
>
{t('common:common.Next Step')}
{t('common:next_step')}
</Button>
)}
{workflowDebugData?.nextRunNodes &&

View File

@@ -167,10 +167,10 @@ const FieldModal = ({
</ModalBody>
<ModalFooter gap={3}>
<Button variant={'whiteBase'} onClick={onClose}>
{t('common:common.Close')}
{t('common:Close')}
</Button>
<Button onClick={handleSubmit(onSubmitSuccess, onSubmitError)}>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -15,14 +15,12 @@ import FormLabel from '@fastgpt/web/components/common/MyBox/FormLabel';
import ValueTypeLabel from '../../../ValueTypeLabel';
import MyIcon from '@fastgpt/web/components/common/Icon';
import { useConfirm } from '@fastgpt/web/hooks/useConfirm';
import { useI18n } from '@/web/context/I18n';
const FieldEditModal = dynamic(() => import('../../FieldEditModal'));
const DynamicInputs = (props: RenderInputProps) => {
const { item, inputs = [], nodeId } = props;
const { t } = useTranslation();
const { workflowT } = useI18n();
const onChangeNode = useContextSelector(WorkflowContext, (v) => v.onChangeNode);
const dynamicInputs = useMemo(() => inputs.filter((item) => item.canEdit), [inputs]);
@@ -55,7 +53,7 @@ const DynamicInputs = (props: RenderInputProps) => {
<Box borderBottom={'base'} pb={3}>
<HStack className="nodrag" cursor={'default'} position={'relative'}>
<HStack spacing={1} position={'relative'} fontWeight={'medium'} color={'myGray.600'}>
<Box>{item.label || workflowT('custom_input')}</Box>
<Box>{item.label || t('workflow:custom_input')}</Box>
{item.description && <QuestionTip label={t(item.description as any)} />}
</HStack>
<Box flex={'1 0 0'} />
@@ -71,7 +69,7 @@ const DynamicInputs = (props: RenderInputProps) => {
})
}
>
{t('common:common.Add New')}
{t('common:add_new')}
</Button>
</HStack>
{/* field render */}
@@ -94,7 +92,7 @@ const DynamicInputs = (props: RenderInputProps) => {
)}
</Box>
);
}, [editField, dynamicInputs, item, keys, onAddField, props, t, workflowT]);
}, [editField, dynamicInputs, item, keys, onAddField, props, t, t]);
return Render;
};
@@ -109,10 +107,9 @@ function Reference({
}) {
const { nodeId, inputs = [], item } = props;
const { t } = useTranslation();
const { workflowT } = useI18n();
const { ConfirmModal, openConfirm } = useConfirm({
type: 'delete',
content: workflowT('confirm_delete_field_tip')
content: t('workflow:confirm_delete_field_tip')
});
const onChangeNode = useContextSelector(WorkflowContext, (v) => v.onChangeNode);

View File

@@ -66,7 +66,7 @@ export const SelectDatasetRender = React.memo(function SelectDatasetRender({
leftIcon={<MyIcon name={'common/selectLight'} w={'14px'} />}
onClick={onOpenDatasetSelect}
>
{t('common:common.Choose')}
{t('common:Choose')}
</Button>
{selectedDatasets.map((item) => (
<Flex

View File

@@ -242,7 +242,7 @@ const EditModal = ({ onClose, ...props }: RenderInputProps & { onClose: () => vo
})
}
>
{t('common:common.Select template')}
{t('common:select_template')}
</Box>
</Flex>
@@ -283,9 +283,9 @@ const EditModal = ({ onClose, ...props }: RenderInputProps & { onClose: () => vo
</ModalBody>
<ModalFooter>
<Button variant={'whiteBase'} mr={2} onClick={onClose}>
{t('common:common.Close')}
{t('common:Close')}
</Button>
<Button onClick={handleSubmit(onSubmit)}>{t('common:common.Confirm')}</Button>
<Button onClick={handleSubmit(onSubmit)}>{t('common:Confirm')}</Button>
</ModalFooter>
</MyModal>
{/* Prompt template */}

View File

@@ -162,10 +162,10 @@ const FieldModal = ({
</ModalBody>
<ModalFooter gap={3}>
<Button variant={'whiteBase'} onClick={onClose}>
{t('common:common.Close')}
{t('common:Close')}
</Button>
<Button onClick={handleSubmit(onSubmitSuccess, onSubmitError)}>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -114,7 +114,7 @@ const RenderOutput = ({
setEditField(defaultOutput);
}}
>
{t('common:common.Add New')}
{t('common:add_new')}
</Button>
</Flex>
<VariableTable

View File

@@ -129,10 +129,10 @@ const EditFieldModal = ({
</ModalBody>
<ModalFooter>
<Button variant={'whiteBase'} mr={2} onClick={onClose}>
{t('common:common.Close')}
{t('common:Close')}
</Button>
<Button onClick={handleSubmit((data) => onclickSubmit(data), onclickSubmitError)}>
{t('common:common.Confirm')}
{t('common:Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -104,7 +104,7 @@ const WorkflowStatusContextProvider = ({ children }: { children: ReactNode }) =>
};
}, []);
useBeforeunload({
tip: t('common:core.common.tip.leave page'),
tip: t('common:core.tip.leave page'),
callback: autoSaveFn
});

View File

@@ -191,8 +191,8 @@ const AppContextProvider = ({ children }: { children: ReactNode }) => {
onSuccess() {
router.replace(`/dashboard/apps`);
},
successToast: t('common:common.Delete Success'),
errorToast: t('common:common.Delete Failed')
successToast: t('common:delete_success'),
errorToast: t('common:delete_failed')
}
);
const onDelApp = useCallback(

View File

@@ -254,7 +254,7 @@ const ChatHistorySlider = ({ confirmClearText }: { confirmClearText: string }) =
},
{
label: t('common:common.Custom Title'),
label: t('common:custom_title'),
icon: 'common/customTitleLight',
onClick: () => {
onOpenModal({
@@ -268,7 +268,7 @@ const ChatHistorySlider = ({ confirmClearText }: { confirmClearText: string }) =
}
},
{
label: t('common:common.Delete'),
label: t('common:Delete'),
icon: 'delete',
onClick: () => {
onDelHistory(item.id);

View File

@@ -147,7 +147,7 @@ const CollectionQuoteItem = ({
</Flex>
</MyTooltip>
)}
<MyTooltip label={t('common:common.Copy')}>
<MyTooltip label={t('common:Copy')}>
<Flex
alignItems={'center'}
fontSize={'10px'}

View File

@@ -165,7 +165,7 @@ const CollectionReader = ({
}
})}
>
{sourceName || t('common:common.UnKnow Source')}
{sourceName || t('common:unknow_source')}
</Box>
<Box ml={3}>
<DownloadButton

View File

@@ -136,7 +136,7 @@ const QuoteItem = ({
{q.length + (a?.length || 0)}
</Flex>
</MyTooltip>
<MyTooltip label={t('common:common.Copy')}>
<MyTooltip label={t('common:Copy')}>
<Flex
alignItems={'center'}
fontSize={'10px'}

View File

@@ -97,7 +97,7 @@ const QuoteReader = ({
color={'myGray.900'}
fontWeight={'medium'}
>
{metadata.sourceName || t('common:common.UnKnow Source')}
{metadata.sourceName || t('common:unknow_source')}
</Box>
</>
) : (

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