From be4144fab32b340595efb9a005841716e9920103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=AB=E3=82=99=E3=82=AA=E3=82=AB=E3=82=99=E3=82=AA?= Date: Tue, 4 Apr 2023 05:37:35 +0800 Subject: [PATCH] [opt] Optimize the display of exported chat history content. --- app/components/chat.tsx | 4 +++- app/locales/cn.ts | 2 ++ app/locales/en.ts | 2 ++ app/locales/es.ts | 2 ++ app/locales/it.ts | 2 ++ app/locales/tw.ts | 2 ++ 6 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 7aa8bfec..6cd229cc 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -60,7 +60,9 @@ function exportMessages(messages: Message[], topic: string) { `# ${topic}\n\n` + messages .map((m) => { - return m.role === "user" ? `## ${m.content}` : m.content.trim(); + return m.role === "user" + ? `## ${Locale.Export.MessageFromYou}:\n${m.content}` + : `## ${Locale.Export.MessageFromChatGPT}:\n${m.content.trim()}`; }) .join("\n\n"); const filename = `${topic}.md`; diff --git a/app/locales/cn.ts b/app/locales/cn.ts index 49bcce23..11e9d044 100644 --- a/app/locales/cn.ts +++ b/app/locales/cn.ts @@ -33,6 +33,8 @@ const cn = { Title: "导出聊天记录为 Markdown", Copy: "全部复制", Download: "下载文件", + MessageFromYou: "来自你的消息", + MessageFromChatGPT: "来自 ChatGPT 的消息", }, Memory: { Title: "历史记忆", diff --git a/app/locales/en.ts b/app/locales/en.ts index ae8e88c2..af820150 100644 --- a/app/locales/en.ts +++ b/app/locales/en.ts @@ -35,6 +35,8 @@ const en: LocaleType = { Title: "All Messages", Copy: "Copy All", Download: "Download", + MessageFromYou: "Message From You", + MessageFromChatGPT: "Message From ChatGPT", }, Memory: { Title: "Memory Prompt", diff --git a/app/locales/es.ts b/app/locales/es.ts index f3714ef3..5c73b608 100644 --- a/app/locales/es.ts +++ b/app/locales/es.ts @@ -35,6 +35,8 @@ const es: LocaleType = { Title: "Todos los mensajes", Copy: "Copiar todo", Download: "Descargar", + MessageFromYou: "Mensaje de ti", + MessageFromChatGPT: "Mensaje de ChatGPT", }, Memory: { Title: "Historial de memoria", diff --git a/app/locales/it.ts b/app/locales/it.ts index c4736c1e..ce87796d 100644 --- a/app/locales/it.ts +++ b/app/locales/it.ts @@ -35,6 +35,8 @@ const it: LocaleType = { Title: "Tutti i messaggi", Copy: "Copia tutto", Download: "Scarica", + MessageFromYou: "Messaggio da te", + MessageFromChatGPT: "Messaggio da ChatGPT", }, Memory: { Title: "Prompt di memoria", diff --git a/app/locales/tw.ts b/app/locales/tw.ts index fff2f15d..b33ace2f 100644 --- a/app/locales/tw.ts +++ b/app/locales/tw.ts @@ -34,6 +34,8 @@ const tw: LocaleType = { Title: "匯出聊天記錄為 Markdown", Copy: "複製全部", Download: "下載檔案", + MessageFromYou: "來自你的訊息", + MessageFromChatGPT: "來自 ChatGPT 的訊息", }, Memory: { Title: "上下文記憶 Prompt",