} bordered text={Locale.Export.Copy} onClick={() => copyToClipboard(mdText)} />,
+
} bordered text={Locale.Export.Download} onClick={() => downloadAs(mdText, filename)} />
]
})
}
function showMemoryPrompt(session: ChatSession) {
showModal({
- title: `上下文记忆 Prompt (${session.lastSummarizeIndex} of ${session.messages.length})`, children:
-
{session.memoryPrompt || '无'}
+ title: `${Locale.Memory.Title} (${session.lastSummarizeIndex} of ${session.messages.length})`, children:
+
{session.memoryPrompt || Locale.Memory.EmptyContent}
, actions: [
-
} bordered text="全部复制" onClick={() => copyToClipboard(session.memoryPrompt)} />,
+
} bordered text={Locale.Memory.Copy} onClick={() => copyToClipboard(session.memoryPrompt)} />,
]
})
}
@@ -405,7 +406,7 @@ export function Home() {
}
- text={"新的聊天"}
+ text={Locale.Home.NewChat}
onClick={createNewSession}
/>
diff --git a/app/components/settings.tsx b/app/components/settings.tsx
index b88d3ff6..ebbe8837 100644
--- a/app/components/settings.tsx
+++ b/app/components/settings.tsx
@@ -1,6 +1,6 @@
import { useState, useRef, useEffect } from "react";
-import EmojiPicker, { Emoji, Theme as EmojiTheme } from "emoji-picker-react";
+import EmojiPicker, { Theme as EmojiTheme } from "emoji-picker-react";
import styles from "./settings.module.scss";
@@ -14,6 +14,8 @@ import { IconButton } from "./button";
import { SubmitKey, useChatStore, Theme } from "../store";
import { Avatar } from "./home";
+import Locale, { changeLang, getLang } from '../locales'
+
export function Settings(props: { closeSettings: () => void }) {
const [showEmojiPicker, setShowEmojiPicker] = useState(false);
const [config, updateConfig, resetConfig, clearAllData] = useChatStore((state) => [
@@ -27,8 +29,8 @@ export function Settings(props: { closeSettings: () => void }) {
<>
-
设置
-
设置选项
+
{Locale.Settings.Title}
+
{Locale.Settings.SubTitle}
@@ -36,7 +38,7 @@ export function Settings(props: { closeSettings: () => void }) {
icon={}
onClick={clearAllData}
bordered
- title="清除所有数据"
+ title={Locale.Settings.Actions.ClearAll}
/>
@@ -44,7 +46,7 @@ export function Settings(props: { closeSettings: () => void }) {
icon={}
onClick={resetConfig}
bordered
- title="重置所有选项"
+ title={Locale.Settings.Actions.ResetAll}
/>
@@ -52,7 +54,7 @@ export function Settings(props: { closeSettings: () => void }) {
icon={}
onClick={props.closeSettings}
bordered
- title="关闭"
+ title={Locale.Settings.Actions.Close}
/>
@@ -60,7 +62,7 @@ export function Settings(props: { closeSettings: () => void }) {
- 头像
+ {Locale.Settings.Avatar}
setShowEmojiPicker(false)}
content={
@@ -85,7 +87,7 @@ export function Settings(props: { closeSettings: () => void }) {
- 发送键
+ {Locale.Settings.SendKey}