Skip to content

Commit

Permalink
update common key
Browse files Browse the repository at this point in the history
  • Loading branch information
zjy365 committed Jul 16, 2024
1 parent 921e50a commit 154a459
Show file tree
Hide file tree
Showing 195 changed files with 1,290 additions and 1,177 deletions.
7 changes: 6 additions & 1 deletion projects/app/src/components/CommunityModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ const CommunityModal = ({ onClose }: { onClose: () => void }) => {
const { feConfigs } = useSystemStore();

return (
<MyModal isOpen={true} onClose={onClose} iconSrc="modal/concat" title={t('system.Concat us')}>
<MyModal
isOpen={true}
onClose={onClose}
iconSrc="modal/concat"
title={t('common:system.Concat us')}
>
<ModalBody textAlign={'center'}>
<Markdown source={feConfigs?.concatMd || ''} />
</ModalBody>
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/components/Layout/auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const Auth = ({ children }: { children: JSX.Element }) => {
);
toast({
status: 'warning',
title: t('support.user.Need to login')
title: t('common:support.user.Need to login')
});
}
}
Expand Down
10 changes: 5 additions & 5 deletions projects/app/src/components/Layout/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,28 @@ const Navbar = ({ unread }: { unread: number }) => {
const navbarList = useMemo(
() => [
{
label: t('navbar.Chat'),
label: t('common:navbar.Chat'),
icon: 'core/chat/chatLight',
activeIcon: 'core/chat/chatFill',
link: `/chat?appId=${lastChatAppId}&chatId=${lastChatId}`,
activeLink: ['/chat']
},
{
label: t('navbar.Studio'),
label: t('common:navbar.Studio'),
icon: 'core/app/aiLight',
activeIcon: 'core/app/aiFill',
link: `/app/list`,
activeLink: ['/app/list', '/app/detail']
},
{
label: t('navbar.Datasets'),
label: t('common:navbar.Datasets'),
icon: 'core/dataset/datasetLight',
activeIcon: 'core/dataset/datasetFill',
link: `/dataset/list`,
activeLink: ['/dataset/list', '/dataset/detail']
},
{
label: t('navbar.Account'),
label: t('common:navbar.Account'),
icon: 'support/user/userLight',
activeIcon: 'support/user/userFill',
link: '/account',
Expand Down Expand Up @@ -163,7 +163,7 @@ const Navbar = ({ unread }: { unread: number }) => {
</Box>
)}
{(feConfigs?.docUrl || feConfigs?.chatbotUrl) && (
<MyTooltip label={t('common.system.Use Helper')} placement={'right-end'}>
<MyTooltip label={t('common:common.system.Use Helper')} placement={'right-end'}>
<Link
{...itemStyles}
{...hoverStyle}
Expand Down
8 changes: 4 additions & 4 deletions projects/app/src/components/Layout/navbarPhone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,31 @@ const NavbarPhone = ({ unread }: { unread: number }) => {
const navbarList = useMemo(
() => [
{
label: t('navbar.Chat'),
label: t('common:navbar.Chat'),
icon: 'core/chat/chatLight',
activeIcon: 'core/chat/chatFill',
link: `/chat?appId=${lastChatAppId}&chatId=${lastChatId}`,
activeLink: ['/chat'],
unread: 0
},
{
label: t('navbar.Studio'),
label: t('common:navbar.Studio'),
icon: 'core/app/aiLight',
activeIcon: 'core/app/aiFill',
link: `/app/list`,
activeLink: ['/app/list', '/app/detail'],
unread: 0
},
{
label: t('navbar.Tools'),
label: t('common:navbar.Tools'),
icon: 'phoneTabbar/tool',
activeIcon: 'phoneTabbar/toolFill',
link: '/tools',
activeLink: ['/tools'],
unread: 0
},
{
label: t('navbar.Account'),
label: t('common:navbar.Account'),
icon: 'support/user/userLight',
activeIcon: 'support/user/userFill',
link: '/account',
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/components/Markdown/CodeLight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,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.Copy')}</Box>
<Box ml={1}>{t('common:common.Copy')}</Box>
</Flex>
</Flex>
<SyntaxHighlighter style={codeLight as any} language={match?.[1]} PreTag="pre">
Expand Down
6 changes: 3 additions & 3 deletions projects/app/src/components/Markdown/chat/QuestionGuide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const QuestionGuide = ({ text }: { text: string }) => {

return questionGuides.length > 0 ? (
<Box mt={2}>
<ChatBoxDivider icon="core/chat/QGFill" text={t('core.chat.Question Guide')} />
<ChatBoxDivider icon="core/chat/QGFill" text={t('common:core.chat.Question Guide')} />
<Flex alignItems={'center'} flexWrap={'wrap'} gap={2}>
{questionGuides.map((text) => (
<Flex
Expand Down Expand Up @@ -60,7 +60,7 @@ const QuestionGuide = ({ text }: { text: string }) => {
lineHeight={0}
bg={`linear-gradient(to left, white,white min(60px,100%),rgba(255,255,255,0) 80%)`}
>
<MyTooltip label={t('core.chat.markdown.Edit Question')}>
<MyTooltip label={t('common:core.chat.markdown.Edit Question')}>
<MyIcon
name={'edit'}
w={'14px'}
Expand All @@ -71,7 +71,7 @@ const QuestionGuide = ({ text }: { text: string }) => {
onClick={() => eventBus.emit(EventNameEnum.editQuestion, { text })}
/>
</MyTooltip>
<MyTooltip label={t('core.chat.markdown.Send Question')}>
<MyTooltip label={t('common:core.chat.markdown.Send Question')}>
<MyIcon
ml={4}
name={'core/chat/sendLight'}
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/components/Markdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const A = React.memo(function A({ children, ...props }: any) {
const text = useMemo(() => String(children), [children]);

return (
<MyTooltip label={t('core.chat.markdown.Quick Question')}>
<MyTooltip label={t('common:core.chat.markdown.Quick Question')}>
<Button
variant={'whitePrimary'}
size={'xs'}
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/components/Select/AIModelSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const AIModelSelector = ({ list, onchange, disableTip, ...props }: Props) => {
label: (
<Flex alignItems={'center'}>
<Avatar borderRadius={'0'} mr={2} src={LOGO_ICON} w={'18px'} />
<Box>{t('support.user.Price')}</Box>
<Box>{t('common:support.user.Price')}</Box>
</Flex>
),
value: 'price'
Expand Down
10 changes: 5 additions & 5 deletions projects/app/src/components/common/Modal/EditResourceModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const EditResourceModal = ({
setValue('avatar', src);
} catch (err: any) {
toast({
title: getErrText(err, t('common.error.Select avatar failed')),
title: getErrText(err, t('common:common.error.Select avatar failed')),
status: 'warning'
});
}
Expand All @@ -76,9 +76,9 @@ const EditResourceModal = ({
<MyModal isOpen onClose={onClose} iconSrc={avatar} title={title}>
<ModalBody>
<Box>
<FormLabel mb={1}>{t('core.app.Name and avatar')}</FormLabel>
<FormLabel mb={1}>{t('common:core.app.Name and avatar')}</FormLabel>
<HStack spacing={4}>
<MyTooltip label={t('common.Set Avatar')}>
<MyTooltip label={t('common:common.Set Avatar')}>
<Avatar
flexShrink={0}
src={avatar}
Expand All @@ -98,13 +98,13 @@ const EditResourceModal = ({
</HStack>
</Box>
<Box mt={4}>
<FormLabel mb={1}>{t('common.Intro')}</FormLabel>
<FormLabel mb={1}>{t('common:common.Intro')}</FormLabel>
<Textarea {...register('intro')} bg={'myGray.50'} maxLength={200} />
</Box>
</ModalBody>
<ModalFooter>
<Button isLoading={loading} onClick={handleSubmit(onSave)} px={6}>
{t('common.Confirm')}
{t('common:common.Confirm')}
</Button>
</ModalFooter>

Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/components/common/ParentPaths/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const ParentPaths = (props: {
const { t } = useTranslation();
const {
paths = [],
rootName = t('common.folder.Root Path'),
rootName = t('common:common.folder.Root Path'),
FirstPathDom,
onClick,
fontSize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const MyTextarea = React.forwardRef<HTMLTextAreaElement, Props>(function MyTexta
const TextareaRef = useRef<HTMLTextAreaElement>(null);

const { t } = useTranslation();
const { title = t('core.app.edit.Prompt Editor'), ...childProps } = props;
const { title = t('common:core.app.edit.Prompt Editor'), ...childProps } = props;

const { isOpen, onOpen, onClose } = useDisclosure();

Expand Down Expand Up @@ -52,7 +52,7 @@ const MyTextarea = React.forwardRef<HTMLTextAreaElement, Props>(function MyTexta
onClose();
}}
>
{t('common.Confirm')}
{t('common:common.Confirm')}
</Button>
</ModalFooter>
</MyModal>
Expand Down Expand Up @@ -85,7 +85,7 @@ const Editor = React.memo(function Editor({
cursor={'pointer'}
onClick={onOpenModal}
>
<MyTooltip label={t('common.ui.textarea.Magnifying')}>
<MyTooltip label={t('common:common.ui.textarea.Magnifying')}>
<MyIcon name={'common/fullScreenLight'} w={'14px'} color={'myGray.600'} />
</MyTooltip>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const TagTextarea = ({ defaultValues, onUpdate, ...props }: Props) => {
if (tags.includes(value)) {
return toast({
status: 'warning',
title: t('common.input.Repeat Value')
title: t('common:common.input.Repeat Value')
});
}
setTags([...tags, value]);
Expand Down
6 changes: 3 additions & 3 deletions projects/app/src/components/common/folder/MoveModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const MoveModal = ({ moveResourceId, title, server, onConfirm, onClose }: Props)
setFolderList([
{
id: rootId,
name: t('common.folder.Root Path'),
name: t('common:common.folder.Root Path'),
open: true,
children: data.map((item) => ({
id: item.id,
Expand Down Expand Up @@ -156,7 +156,7 @@ const MoveModal = ({ moveResourceId, title, server, onConfirm, onClose }: Props)
onSuccess: () => {
onClose();
},
successToast: t('common.folder.Move Success')
successToast: t('common:common.folder.Move Success')
}
);

Expand All @@ -174,7 +174,7 @@ const MoveModal = ({ moveResourceId, title, server, onConfirm, onClose }: Props)
</ModalBody>
<ModalFooter>
<Button isLoading={confirming} isDisabled={!selectedId} onClick={onConfirmSelect}>
{t('common.Confirm')}
{t('common:common.Confirm')}
</Button>
</ModalFooter>
</MyModal>
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/components/common/folder/Path.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const FolderPath = (props: {
const { t } = useTranslation();
const {
paths,
rootName = t('common.folder.Root Path'),
rootName = t('common:common.folder.Root Path'),
FirstPathDom,
onClick,
fontSize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const SelectOneResource = ({
id: rootId,
open: true,
avatar: FolderImgUrl,
name: t('common.folder.Root Path'),
name: t('common:common.folder.Root Path'),
isFolder: true,
children: dataList
};
Expand Down
16 changes: 8 additions & 8 deletions projects/app/src/components/common/folder/SlideCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const FolderSlideCard = ({
<MyDivider my={6} />

<Box>
<FormLabel>{t('common.Operation')}</FormLabel>
<FormLabel>{t('common:common.Operation')}</FormLabel>

<Button
variant={'transparentBase'}
Expand All @@ -101,7 +101,7 @@ const FolderSlideCard = ({
mt={4}
onClick={onMove}
>
{t('common.Move')}
{t('common:common.Move')}
</Button>
{managePer.permission.isOwner && (
<Button
Expand All @@ -118,7 +118,7 @@ const FolderSlideCard = ({
openConfirm(onDelete)();
}}
>
{t('common.Delete folder')}
{t('common:common.Delete folder')}
</Button>
)}
</Box>
Expand All @@ -130,7 +130,7 @@ const FolderSlideCard = ({
<MyDivider my={6} />

<Box>
<FormLabel>{t('support.permission.Permission')}</FormLabel>
<FormLabel>{t('common:support.permission.Permission')}</FormLabel>

{!isInheritPermission && (
<Box mt={2}>
Expand All @@ -141,7 +141,7 @@ const FolderSlideCard = ({
{managePer.permission.hasManagePer && (
<Box mt={5}>
<Box fontSize={'sm'} color={'myGray.500'}>
{t('permission.Default permission')}
{t('common:permission.Default permission')}
</Box>
<DefaultPermissionList
mt="1"
Expand All @@ -166,11 +166,11 @@ const FolderSlideCard = ({
<>
<Flex alignItems="center" justifyContent="space-between">
<Box fontSize={'sm'} color={'myGray.500'}>
{t('permission.Collaborator')}
{t('common:permission.Collaborator')}
</Box>
{managePer.permission.hasManagePer && (
<HStack spacing={3}>
<MyTooltip label={t('permission.Manage')}>
<MyTooltip label={t('common:permission.Manage')}>
<MyIcon
w="1rem"
name="common/settingLight"
Expand All @@ -179,7 +179,7 @@ const FolderSlideCard = ({
onClick={onOpenManageModal}
/>
</MyTooltip>
<MyTooltip label={t('common.Add')}>
<MyTooltip label={t('common:common.Add')}>
<MyIcon
w="1rem"
name="support/permission/collaborator"
Expand Down
Loading

0 comments on commit 154a459

Please sign in to comment.