4.6.7 first pr (#726)

This commit is contained in:
Archer
2024-01-10 23:35:04 +08:00
committed by GitHub
parent 414b693303
commit 006ad17c6a
186 changed files with 2996 additions and 1838 deletions

View File

@@ -35,7 +35,7 @@ const ChatHeader = ({
() =>
chatContentReplaceBlock(history[history.length - 2]?.value)?.slice(0, 8) ||
appName ||
t('chat.New Chat'),
t('core.chat.New Chat'),
[appName, history]
);
@@ -56,8 +56,8 @@ const ChatHeader = ({
<MyIcon name={'history'} w={'14px'} />
<Box ml={1}>
{history.length === 0
? t('chat.Fresh Chat')
: t('chat.History Amount', { amount: history.length })}
? t('core.chat.New Chat')
: t('core.chat.History Amount', { amount: history.length })}
</Box>
</Tag>
{!!chatModels && chatModels.length > 0 && (

View File

@@ -74,18 +74,20 @@ const ChatHistorySlider = ({
// custom title edit
const { onOpenModal, EditModal: EditTitleModal } = useEditTitle({
title: t('chat.Custom History Title'),
placeholder: t('chat.Custom History Title Description')
title: t('core.chat.Custom History Title'),
placeholder: t('core.chat.Custom History Title Description')
});
const { openConfirm, ConfirmModal } = useConfirm({
content: isShare
? t('chat.Confirm to clear share chat history')
: t('chat.Confirm to clear history')
? t('core.chat.Confirm to clear share chat history')
: t('core.chat.Confirm to clear history')
});
const concatHistory = useMemo<HistoryItemType[]>(
() =>
!activeChatId ? [{ id: activeChatId, title: t('chat.New Chat') }].concat(history) : history,
!activeChatId
? [{ id: activeChatId, title: t('core.chat.New Chat') }].concat(history)
: history,
[activeChatId, history, t]
);
@@ -144,7 +146,7 @@ const ChatHistorySlider = ({
mr={2}
list={[
{ label: 'App', id: TabEnum.app },
{ label: 'chat.History', id: TabEnum.history }
{ label: t('core.chat.History'), id: TabEnum.history }
]}
activeId={currentTab}
onChange={(e) => setCurrentTab(e as `${TabEnum}`)}
@@ -160,7 +162,7 @@ const ChatHistorySlider = ({
overflow={'hidden'}
onClick={() => onChangeChat()}
>
{t('chat.New Chat')}
{t('core.chat.New Chat')}
</Button>
{(isPc || isShare) && (
@@ -240,7 +242,7 @@ const ChatHistorySlider = ({
}}
>
<MyIcon mr={2} name={'core/chat/setTopLight'} w={'16px'}></MyIcon>
{item.top ? t('chat.Unpin') : t('chat.Pin')}
{item.top ? t('core.chat.Unpin') : t('core.chat.Pin')}
</MenuItem>
)}
{onSetCustomTitle && (
@@ -336,7 +338,7 @@ const ChatHistorySlider = ({
borderRadius={'50%'}
aria-label={''}
/>
{t('chat.Exit Chat')}
{t('core.chat.Exit Chat')}
</Flex>
)}
<EditTitleModal />

View File

@@ -35,7 +35,7 @@ const SliderApps = ({ appId }: { appId: string }) => {
borderRadius={'50%'}
aria-label={''}
/>
{t('chat.Exit Chat')}
{t('core.chat.Exit Chat')}
</Flex>
</Box>
<Box flex={'1 0 0'} h={0} px={5} overflow={'overlay'}>

View File

@@ -15,7 +15,7 @@ const ToolMenu = ({ history }: { history: ChatItemType[] }) => {
() => [
{
icon: 'core/chat/chatLight',
label: t('chat.New Chat'),
label: t('core.chat.New Chat'),
onClick: () => {
router.replace({
query: {

View File

@@ -86,7 +86,7 @@ const Chat = ({ appId, chatId }: { appId: string; chatId: string }) => {
const newTitle =
chatContentReplaceBlock(prompts[0].content).slice(0, 20) ||
prompts[1]?.value?.slice(0, 20) ||
t('chat.New Chat');
t('core.chat.New Chat');
// new chat
if (completionChatId !== chatId) {
@@ -166,7 +166,7 @@ const Chat = ({ appId, chatId }: { appId: string; chatId: string }) => {
setLastChatAppId('');
setLastChatId('');
toast({
title: getErrText(e, t('chat.Failed to initialize chat')),
title: getErrText(e, t('core.chat.Failed to initialize chat')),
status: 'error'
});
if (e?.code === 501) {
@@ -210,7 +210,7 @@ const Chat = ({ appId, chatId }: { appId: string; chatId: string }) => {
if (apps.length === 0) {
toast({
status: 'error',
title: t('chat.You need to a chat app')
title: t('core.chat.You need to a chat app')
});
router.replace('/app/list');
} else {

View File

@@ -88,7 +88,7 @@ const OutLink = ({
const newTitle =
chatContentReplaceBlock(prompts[0].content).slice(0, 20) ||
prompts[1]?.value?.slice(0, 20) ||
t('chat.New Chat');
t('core.chat.New Chat');
// new chat
if (completionChatId !== chatId) {