diff --git a/src/app.tsx b/src/app.tsx index 5a4c133..24f1eb3 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -5,6 +5,7 @@ import { calculate_token_length, Message } from "./chatgpt"; import getDefaultParams from "./getDefaultParam"; import ChatBOX from "./chatbox"; import models from "./models"; +import { Tr, langCodeContext, LANG_OPTIONS } from "./translate"; import CHATGPT_API_WEB_VERSION from "./CHATGPT_API_WEB_VERSION"; @@ -245,7 +246,7 @@ export function App() { className="bg-violet-300 p-1 rounded hover:bg-violet-400" onClick={handleNewChatStore} > - NEW + {Tr("NEW")}
- 请先在上方设置 (OPENAI) API KEY + {Tr("Please click above to set")} (OpenAI) API KEY
)} {!chatStore.apiEndpoint && (- 请先在上方设置 API Endpoint + {Tr("Please click above to set")} API Endpoint
)} {templateAPIs.length > 0 && @@ -321,7 +322,7 @@ export default function ChatBOX(props: { !chatStore.apiEndpoint || !chatStore.apiKey) && (-
-
- 暂无历史对话记录
-
- ⚙Model: {chatStore.model}
-
- ⬆点击上方更改此对话的参数(请勿泄漏)
-
- ↖点击左上角 NEW 新建对话
-
- 请注意,使用 ChatGPT API
- 的生成文本质量和速度会受到会话上下文的影响,同时历史上下文过长会被裁切。API
- 会根据发送的上下文总量进行计费,因此建议您为不相关的问题或者不需要上文的问题创建新的对话,以避免不必要的计费。
-
- ⚠所有历史对话与参数储存在浏览器本地
-
- ⚠详细文档与源代码:{" "}
+ {Tr("No chat history here")}
+
⚙{Tr("Model")}: {chatStore.model}
+
⬆{Tr("Click above to change the settings of this chat")}
+
↖{Tr("Click the conor to create a new chat")}
+
⚠
+ {Tr(
+ "All chat history and settings are stored in the local browser"
+ )}
+
⚠{Tr("Documents and source code are avaliable here")}:{" "}
- {generatingMessage || "生成中,最长可能需要一分钟,请保持网络稳定"}
+ {generatingMessage || Tr("Generating...")}
...
{chatStore.responseModelName && (
- <>Generated by {chatStore.responseModelName}>
+ <>
+ {Tr("Generated by")} {chatStore.responseModelName}
+ >
)}
{chatStore.postBeginIndex !== 0 && (
<>
- 提示:会话过长,已裁切前 {chatStore.postBeginIndex} 条消息
+ {Tr("Info: chat history is too long, forget messages")}:{" "}
+ {chatStore.postBeginIndex}
>
)}
- 提示:当前会话版本 {chatStore.chatgpt_api_web_version}。
+ {Tr("Warning: current chatStore version")}:{" "}
+ {chatStore.chatgpt_api_web_version} {"< v1.3.0"}
v1.3.0
引入与旧版不兼容的消息裁切算法。继续使用旧版可能会导致消息裁切过多或过少(表现为失去上下文或输出不完整)。
@@ -535,8 +534,8 @@ export default function ChatBOX(props: {
{chatStore.chatgpt_api_web_version < "v1.4.0" && (
- 提示:当前会话版本 {chatStore.chatgpt_api_web_version} {"< v1.4.0"}
- 。
+ {Tr("Warning: current chatStore version")}:{" "}
+ {chatStore.chatgpt_api_web_version} {"< v1.4.0"}
v1.4.0 增加了更多参数,继续使用旧版可能因参数确实导致未定义的行为
@@ -546,7 +545,9 @@ export default function ChatBOX(props: {
{chatStore.chatgpt_api_web_version < "v1.6.0" && (
- 提示:当前会话版本 {chatStore.chatgpt_api_web_version} {"< v1.6.0"}
+ 提示:当前会话版本 {chatStore.chatgpt_api_web_version}
+ {Tr("Warning: current chatStore version")}:{" "}
+ {chatStore.chatgpt_api_web_version} {"< v1.6.0"}
。
v1.6.0 开始保存会话模板时会将 apiKey 和 apiEndpoint
@@ -564,7 +565,7 @@ export default function ChatBOX(props: {
await complete();
}}
>
- Retry
+ {Tr("Retry")}
- Total cost in this session ${props.chatStore.cost.toFixed(4)} + {Tr("Total cost in this session")} ${props.chatStore.cost.toFixed(4)}
- Accumulated cost in all sessions ${totalCost.toFixed(4)} + {Tr("Accumulated cost in all sessions")} ${totalCost.toFixed(4)}
@@ -361,14 +412,14 @@ export default (props: { downloadAnchorNode.remove(); }} > - Export + {Tr("Export")}
- chatgpt-api-web ChatStore Version{" "} + chatgpt-api-web ChatStore {Tr("Version")}{" "} {props.chatStore.chatgpt_api_web_version}