feat: i18n refactor and style adjustment

This commit is contained in:
Yidadaa 2023-04-28 00:34:37 +08:00
parent 6c1144f6f4
commit fb32770486
23 changed files with 266 additions and 156 deletions

View File

@ -18,6 +18,15 @@
cursor: not-allowed; cursor: not-allowed;
opacity: 0.5; opacity: 0.5;
} }
&.primary {
background-color: var(--primary);
color: white;
path {
fill: white !important;
}
}
} }
.shadow { .shadow {

View File

@ -5,10 +5,10 @@ import styles from "./button.module.scss";
export function IconButton(props: { export function IconButton(props: {
onClick?: () => void; onClick?: () => void;
icon?: JSX.Element; icon?: JSX.Element;
type?: "primary" | "danger";
text?: string; text?: string;
bordered?: boolean; bordered?: boolean;
shadow?: boolean; shadow?: boolean;
noDark?: boolean;
className?: string; className?: string;
title?: string; title?: string;
disabled?: boolean; disabled?: boolean;
@ -19,7 +19,7 @@ export function IconButton(props: {
styles["icon-button"] + styles["icon-button"] +
` ${props.bordered && styles.border} ${props.shadow && styles.shadow} ${ ` ${props.bordered && styles.border} ${props.shadow && styles.shadow} ${
props.className ?? "" props.className ?? ""
} clickable` } clickable ${styles[props.type ?? ""]}`
} }
onClick={props.onClick} onClick={props.onClick}
title={props.title} title={props.title}
@ -29,7 +29,8 @@ export function IconButton(props: {
{props.icon && ( {props.icon && (
<div <div
className={ className={
styles["icon-button-icon"] + ` ${props.noDark && "no-dark"}` styles["icon-button-icon"] +
` ${props.type === "primary" && "no-dark"}`
} }
> >
{props.icon} {props.icon}

View File

@ -14,6 +14,8 @@ import { useChatStore } from "../store";
import Locale from "../locales"; import Locale from "../locales";
import { Link, useNavigate } from "react-router-dom"; import { Link, useNavigate } from "react-router-dom";
import { Path } from "../constant"; import { Path } from "../constant";
import { MaskAvatar } from "./mask";
import { Mask } from "../store/mask";
export function ChatItem(props: { export function ChatItem(props: {
onClick?: () => void; onClick?: () => void;
@ -25,6 +27,7 @@ export function ChatItem(props: {
id: number; id: number;
index: number; index: number;
narrow?: boolean; narrow?: boolean;
mask: Mask;
}) { }) {
return ( return (
<Draggable draggableId={`${props.id}`} index={props.index}> <Draggable draggableId={`${props.id}`} index={props.index}>
@ -44,7 +47,7 @@ export function ChatItem(props: {
{props.narrow ? ( {props.narrow ? (
<div className={styles["chat-item-narrow"]}> <div className={styles["chat-item-narrow"]}>
<div className={styles["chat-item-avatar"] + " no-dark"}> <div className={styles["chat-item-avatar"] + " no-dark"}>
<BotIcon></BotIcon> <MaskAvatar mask={props.mask} />
</div> </div>
<div className={styles["chat-item-narrow-count"]}> <div className={styles["chat-item-narrow-count"]}>
{props.count} {props.count}
@ -129,6 +132,7 @@ export function ChatList(props: { narrow?: boolean }) {
} }
}} }}
narrow={props.narrow} narrow={props.narrow}
mask={item.mask}
/> />
))} ))}
{provided.placeholder} {provided.placeholder}

View File

@ -53,13 +53,16 @@ import { IconButton } from "./button";
import styles from "./home.module.scss"; import styles from "./home.module.scss";
import chatStyle from "./chat.module.scss"; import chatStyle from "./chat.module.scss";
import { Input, List, ListItem, Modal, Popover, showModal } from "./ui-lib"; import { ListItem, Modal, showModal } from "./ui-lib";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import { Path } from "../constant"; import { Path } from "../constant";
import { ModelConfigList } from "./model-config"; import { Avatar } from "./emoji";
import { Avatar, AvatarPicker } from "./emoji"; import { MaskAvatar, MaskConfig } from "./mask";
import { MaskConfig } from "./mask"; import {
import { DEFAULT_MASK_ID, useMaskStore } from "../store/mask"; DEFAULT_MASK_AVATAR,
DEFAULT_MASK_ID,
useMaskStore,
} from "../store/mask";
const Markdown = dynamic( const Markdown = dynamic(
async () => memo((await import("./markdown")).Markdown), async () => memo((await import("./markdown")).Markdown),
@ -668,10 +671,8 @@ export function Chat() {
<div className={styles["chat-message-avatar"]}> <div className={styles["chat-message-avatar"]}>
{message.role === "user" ? ( {message.role === "user" ? (
<Avatar avatar={config.avatar} /> <Avatar avatar={config.avatar} />
) : session.mask.id === DEFAULT_MASK_ID ? (
<Avatar model={message.model ?? "gpt-3.5-turbo"} />
) : ( ) : (
<Avatar avatar={session.mask.avatar} /> <MaskAvatar mask={session.mask} />
)} )}
</div> </div>
{showTyping && ( {showTyping && (
@ -778,7 +779,7 @@ export function Chat() {
icon={<SendWhiteIcon />} icon={<SendWhiteIcon />}
text={Locale.Chat.Send} text={Locale.Chat.Send}
className={styles["chat-input-send"]} className={styles["chat-input-send"]}
noDark type="primary"
onClick={onUserSubmit} onClick={onUserSubmit}
/> />
</div> </div>

View File

@ -2,7 +2,7 @@ import React from "react";
import { IconButton } from "./button"; import { IconButton } from "./button";
import GithubIcon from "../icons/github.svg"; import GithubIcon from "../icons/github.svg";
import ResetIcon from "../icons/reload.svg"; import ResetIcon from "../icons/reload.svg";
import { ISSUE_URL, StoreKey } from "../constant"; import { ISSUE_URL } from "../constant";
import Locale from "../locales"; import Locale from "../locales";
import { downloadAs } from "../utils"; import { downloadAs } from "../utils";
@ -24,22 +24,15 @@ export class ErrorBoundary extends React.Component<any, IErrorBoundaryState> {
} }
clearAndSaveData() { clearAndSaveData() {
const snapshot: Record<string, any> = {};
Object.values(StoreKey).forEach((key) => {
snapshot[key] = localStorage.getItem(key);
if (snapshot[key]) {
try {
snapshot[key] = JSON.parse(snapshot[key]);
} catch {}
}
});
try { try {
downloadAs(JSON.stringify(snapshot), "chatgpt-next-web-snapshot.json"); downloadAs(
} catch {} JSON.stringify(localStorage),
"chatgpt-next-web-snapshot.json",
localStorage.clear(); );
} finally {
localStorage.clear();
location.reload();
}
} }
render() { render() {
@ -65,7 +58,8 @@ export class ErrorBoundary extends React.Component<any, IErrorBoundaryState> {
icon={<ResetIcon />} icon={<ResetIcon />}
text="Clear All Data" text="Clear All Data"
onClick={() => onClick={() =>
confirm(Locale.Store.ConfirmClearAll) && this.clearAndSaveData() confirm(Locale.Settings.Actions.ConfirmClearAll) &&
this.clearAndSaveData()
} }
bordered bordered
/> />

View File

@ -269,7 +269,7 @@
.chat-item-avatar { .chat-item-avatar {
display: flex; display: flex;
justify-content: center; justify-content: center;
opacity: 0.1; opacity: 0.2;
position: absolute; position: absolute;
transform: scale(4); transform: scale(4);
} }

View File

@ -52,10 +52,18 @@
animation: slide-in ease 0.4s; animation: slide-in ease 0.4s;
} }
.search-bar { .actions {
margin-top: 5vh; margin-top: 5vh;
margin-bottom: 5vh; margin-bottom: 5vh;
animation: slide-in ease 0.45s; animation: slide-in ease 0.45s;
display: flex;
justify-content: center;
.search-bar {
font-size: 12px;
margin-right: 10px;
width: 40vw;
}
} }
.masks { .masks {

View File

@ -3,11 +3,14 @@ import { Path, SlotID } from "../constant";
import { IconButton } from "./button"; import { IconButton } from "./button";
import { EmojiAvatar } from "./emoji"; import { EmojiAvatar } from "./emoji";
import styles from "./new-chat.module.scss"; import styles from "./new-chat.module.scss";
import LeftIcon from "../icons/left.svg"; import LeftIcon from "../icons/left.svg";
import { useNavigate } from "react-router-dom"; import AddIcon from "../icons/lightning.svg";
import { useLocation, useNavigate } from "react-router-dom";
import { createEmptyMask, Mask, useMaskStore } from "../store/mask"; import { createEmptyMask, Mask, useMaskStore } from "../store/mask";
import Locale from "../locales"; import Locale from "../locales";
import { useChatStore } from "../store"; import { useAppConfig, useChatStore } from "../store";
import { MaskAvatar } from "./mask"; import { MaskAvatar } from "./mask";
function getIntersectionArea(aRect: DOMRect, bRect: DOMRect) { function getIntersectionArea(aRect: DOMRect, bRect: DOMRect) {
@ -93,10 +96,14 @@ function useMaskGroup(masks: Mask[]) {
export function NewChat() { export function NewChat() {
const chatStore = useChatStore(); const chatStore = useChatStore();
const maskStore = useMaskStore(); const maskStore = useMaskStore();
const masks = maskStore.getAll(); const masks = maskStore.getAll();
const groups = useMaskGroup(masks); const groups = useMaskGroup(masks);
const navigate = useNavigate(); const navigate = useNavigate();
const config = useAppConfig();
const { state } = useLocation();
const startChat = (mask?: Mask) => { const startChat = (mask?: Mask) => {
chatStore.newSession(mask); chatStore.newSession(mask);
@ -111,10 +118,19 @@ export function NewChat() {
text={Locale.NewChat.Return} text={Locale.NewChat.Return}
onClick={() => navigate(Path.Home)} onClick={() => navigate(Path.Home)}
></IconButton> ></IconButton>
<IconButton {!state?.fromHome && (
text={Locale.NewChat.Skip} <IconButton
onClick={() => startChat()} text={Locale.NewChat.NotShow}
></IconButton> onClick={() => {
if (confirm(Locale.NewChat.ConfirmNoShow)) {
startChat();
config.update(
(config) => (config.dontShowMaskSplashScreen = true),
);
}
}}
></IconButton>
)}
</div> </div>
<div className={styles["mask-cards"]}> <div className={styles["mask-cards"]}>
<div className={styles["mask-card"]}> <div className={styles["mask-card"]}>
@ -131,12 +147,22 @@ export function NewChat() {
<div className={styles["title"]}>{Locale.NewChat.Title}</div> <div className={styles["title"]}>{Locale.NewChat.Title}</div>
<div className={styles["sub-title"]}>{Locale.NewChat.SubTitle}</div> <div className={styles["sub-title"]}>{Locale.NewChat.SubTitle}</div>
<input <div className={styles["actions"]}>
className={styles["search-bar"]} <input
placeholder={Locale.NewChat.More} className={styles["search-bar"]}
type="text" placeholder={Locale.NewChat.More}
onClick={() => navigate(Path.Masks)} type="text"
/> onClick={() => navigate(Path.Masks)}
/>
<IconButton
text={Locale.NewChat.Skip}
onClick={() => startChat()}
icon={<AddIcon />}
type="primary"
shadow
/>
</div>
<div className={styles["masks"]}> <div className={styles["masks"]}>
{groups.map((masks, i) => ( {groups.map((masks, i) => (

View File

@ -137,10 +137,7 @@ export function Settings() {
const config = useAppConfig(); const config = useAppConfig();
const updateConfig = config.update; const updateConfig = config.update;
const resetConfig = config.reset; const resetConfig = config.reset;
const [clearAllData, clearSessions] = useChatStore((state) => [ const chatStore = useChatStore();
state.clearAllData,
state.clearSessions,
]);
const updateStore = useUpdateStore(); const updateStore = useUpdateStore();
const [checkingUpdate, setCheckingUpdate] = useState(false); const [checkingUpdate, setCheckingUpdate] = useState(false);
@ -160,9 +157,9 @@ export function Settings() {
subscription: updateStore.subscription, subscription: updateStore.subscription,
}; };
const [loadingUsage, setLoadingUsage] = useState(false); const [loadingUsage, setLoadingUsage] = useState(false);
function checkUsage() { function checkUsage(force = false) {
setLoadingUsage(true); setLoadingUsage(true);
updateStore.updateUsage().finally(() => { updateStore.updateUsage(force).finally(() => {
setLoadingUsage(false); setLoadingUsage(false);
}); });
} }
@ -216,11 +213,8 @@ export function Settings() {
<IconButton <IconButton
icon={<ClearIcon />} icon={<ClearIcon />}
onClick={() => { onClick={() => {
const confirmed = window.confirm( if (confirm(Locale.Settings.Actions.ConfirmClearAll)) {
`${Locale.Settings.Actions.ConfirmClearAll.Confirm}`, chatStore.clearAllData();
);
if (confirmed) {
clearSessions();
} }
}} }}
bordered bordered
@ -231,10 +225,7 @@ export function Settings() {
<IconButton <IconButton
icon={<ResetIcon />} icon={<ResetIcon />}
onClick={() => { onClick={() => {
const confirmed = window.confirm( if (confirm(Locale.Settings.Actions.ConfirmResetAll)) {
`${Locale.Settings.Actions.ConfirmResetAll.Confirm}`,
);
if (confirmed) {
resetConfig(); resetConfig();
} }
}} }}
@ -370,19 +361,10 @@ export function Settings() {
></InputRange> ></InputRange>
</ListItem> </ListItem>
<ListItem title={Locale.Settings.TightBorder}> <ListItem
<input title={Locale.Settings.SendPreviewBubble.Title}
type="checkbox" subTitle={Locale.Settings.SendPreviewBubble.SubTitle}
checked={config.tightBorder} >
onChange={(e) =>
updateConfig(
(config) => (config.tightBorder = e.currentTarget.checked),
)
}
></input>
</ListItem>
<ListItem title={Locale.Settings.SendPreviewBubble}>
<input <input
type="checkbox" type="checkbox"
checked={config.sendPreviewBubble} checked={config.sendPreviewBubble}
@ -394,6 +376,23 @@ export function Settings() {
} }
></input> ></input>
</ListItem> </ListItem>
<ListItem
title={Locale.Settings.Mask.Title}
subTitle={Locale.Settings.Mask.SubTitle}
>
<input
type="checkbox"
checked={!config.dontShowMaskSplashScreen}
onChange={(e) =>
updateConfig(
(config) =>
(config.dontShowMaskSplashScreen =
!e.currentTarget.checked),
)
}
></input>
</ListItem>
</List> </List>
<List> <List>
@ -448,7 +447,7 @@ export function Settings() {
<IconButton <IconButton
icon={<ResetIcon></ResetIcon>} icon={<ResetIcon></ResetIcon>}
text={Locale.Settings.Usage.Check} text={Locale.Settings.Usage.Check}
onClick={checkUsage} onClick={() => checkUsage(true)}
/> />
)} )}
</ListItem> </ListItem>

View File

@ -87,6 +87,8 @@ export function SideBar(props: { className?: string }) {
const { onDragMouseDown, shouldNarrow } = useDragSideBar(); const { onDragMouseDown, shouldNarrow } = useDragSideBar();
const navigate = useNavigate(); const navigate = useNavigate();
const config = useAppConfig();
return ( return (
<div <div
className={`${styles.sidebar} ${props.className} ${ className={`${styles.sidebar} ${props.className} ${
@ -106,14 +108,14 @@ export function SideBar(props: { className?: string }) {
<div className={styles["sidebar-header-bar"]}> <div className={styles["sidebar-header-bar"]}>
<IconButton <IconButton
icon={<MaskIcon />} icon={<MaskIcon />}
text="Mask" text={shouldNarrow ? undefined : Locale.Mask.Name}
className={styles["sidebar-bar-button"]} className={styles["sidebar-bar-button"]}
onClick={() => navigate(Path.Masks)} onClick={() => navigate(Path.NewChat, { state: { fromHome: true } })}
shadow shadow
/> />
<IconButton <IconButton
icon={<PluginIcon />} icon={<PluginIcon />}
text="Plugins" text={shouldNarrow ? undefined : Locale.Plugin.Name}
className={styles["sidebar-bar-button"]} className={styles["sidebar-bar-button"]}
onClick={() => showToast(Locale.WIP)} onClick={() => showToast(Locale.WIP)}
shadow shadow
@ -155,7 +157,11 @@ export function SideBar(props: { className?: string }) {
icon={<AddIcon />} icon={<AddIcon />}
text={shouldNarrow ? undefined : Locale.Home.NewChat} text={shouldNarrow ? undefined : Locale.Home.NewChat}
onClick={() => { onClick={() => {
navigate(Path.NewChat); if (config.dontShowMaskSplashScreen) {
chatStore.newSession();
} else {
navigate(Path.NewChat);
}
}} }}
shadow shadow
/> />

View File

@ -18,7 +18,7 @@
<use xlink:href="#path_1"></use> <use xlink:href="#path_1"></use>
</mask> </mask>
<g mask="url(#bg-mask-1)"> <g mask="url(#bg-mask-1)">
<path id="分组 1" fill-rule="evenodd" style="fill:#000000" <path id="分组 1" fill-rule="evenodd" style="fill:#333333"
transform="translate(0 0) rotate(0 10.227272727272725 10.227272727272725)" opacity="1" transform="translate(0 0) rotate(0 10.227272727272725 10.227272727272725)" opacity="1"
d="M19.11 8.37L19.11 8.37C19.28 7.85 19.37 7.31 19.37 6.76C19.37 5.86 19.13 4.97 18.66 4.19C17.73 2.59 16 1.6 14.13 1.6C13.76 1.6 13.4 1.64 13.04 1.71C12.06 0.62 10.65 0 9.17 0L9.14 0L9.13 0C6.86 0 4.86 1.44 4.16 3.57C2.7 3.86 1.44 4.76 0.71 6.04C0.24 6.83 0 7.72 0 8.63C0 9.9 0.48 11.14 1.35 12.08C1.17 12.6 1.08 13.15 1.08 13.69C1.08 14.6 1.33 15.49 1.79 16.27C2.92 18.21 5.2 19.21 7.42 18.74C8.4 19.83 9.8 20.45 11.28 20.45L11.31 20.45L11.33 20.45C13.59 20.45 15.6 19.01 16.3 16.88C17.76 16.59 19.01 15.69 19.75 14.41C20.21 13.63 20.45 12.74 20.45 11.83C20.45 10.55 19.97 9.32 19.11 8.37Z M8.94734 18.1579C8.90734 18.1879 8.86734 18.2079 8.82734 18.2279C9.52734 18.8079 10.3973 19.1179 11.3073 19.1179L11.3173 19.1179C13.4573 19.1179 15.1973 17.3979 15.1973 15.2879L15.1973 10.5279C15.1973 10.5079 15.1773 10.4879 15.1573 10.4779L13.4173 9.48792L13.4173 15.2379C13.4173 15.4679 13.2873 15.6879 13.0773 15.8079L8.94734 18.1579Z M8.27654 17.0048L12.4465 14.6248C12.4665 14.6148 12.4765 14.5948 12.4765 14.5748L12.4765 14.5748L12.4765 12.5848L7.43654 15.4548C7.22654 15.5748 6.96654 15.5748 6.75654 15.4548L2.62654 13.1048C2.58654 13.0848 2.53654 13.0448 2.50654 13.0348C2.46654 13.2448 2.44654 13.4648 2.44654 13.6848C2.44654 14.3548 2.62654 15.0148 2.96654 15.6048L2.96654 15.5948C3.66654 16.7848 4.94654 17.5148 6.33654 17.5148C7.01654 17.5148 7.68654 17.3348 8.27654 17.0048Z M3.90324 5.16818C3.90324 5.12818 3.90324 5.06818 3.90324 5.02818C3.05324 5.33818 2.33324 5.92818 1.88324 6.70818L1.88324 6.70818C1.54324 7.28818 1.36324 7.94818 1.36324 8.61818C1.36324 9.98818 2.10324 11.2582 3.30324 11.9482L7.47324 14.3182C7.49324 14.3282 7.51324 14.3282 7.53324 14.3182L9.28324 13.3182L4.24324 10.4482C4.03324 10.3382 3.90324 10.1182 3.90324 9.87818L3.90324 9.87818L3.90324 5.16818Z M17.1561 8.50521L12.9761 6.1252C12.9561 6.1252 12.9361 6.1252 12.9161 6.1352L11.1761 7.1252L16.2161 9.9952C16.4261 10.1152 16.5561 10.3352 16.5561 10.5752C16.5561 10.5752 16.5561 10.5752 16.5561 10.5752L16.5561 15.4252C18.0761 14.8652 19.0961 13.4352 19.0961 11.8252C19.0961 10.4552 18.3561 9.1952 17.1561 8.50521Z M8.01418 5.82927C7.99418 5.83927 7.98418 5.85927 7.98418 5.87927L7.98418 5.87927L7.98418 7.86927L13.0242 4.99927C13.1242 4.93927 13.2442 4.90927 13.3642 4.90927C13.4842 4.90927 13.5942 4.93927 13.7042 4.99927L17.8342 7.34927C17.8742 7.36927 17.9142 7.39927 17.9542 7.41927L17.9542 7.41927C17.9842 7.20927 18.0042 6.98927 18.0042 6.76927C18.0042 4.65927 16.2642 2.93927 14.1242 2.93927C13.4442 2.93927 12.7742 3.11927 12.1842 3.44927L8.01418 5.82927Z M9.14676 1.33731C6.99676 1.33731 5.25676 3.05731 5.25676 5.16731L5.25676 9.92731C5.25676 9.94731 5.27676 9.95731 5.28676 9.96731L7.03676 10.9673L7.03676 5.22731L7.03676 5.21731C7.03676 4.98731 7.16676 4.76731 7.37676 4.64731L11.5068 2.29731C11.5468 2.26731 11.5968 2.23731 11.6268 2.22731C10.9268 1.64731 10.0468 1.33731 9.14676 1.33731Z M7.98345 11.5093L10.2235 12.7793L12.4735 11.5093L12.4735 8.9493L10.2235 7.6693L7.98345 8.9493L7.98345 11.5093Z " /> d="M19.11 8.37L19.11 8.37C19.28 7.85 19.37 7.31 19.37 6.76C19.37 5.86 19.13 4.97 18.66 4.19C17.73 2.59 16 1.6 14.13 1.6C13.76 1.6 13.4 1.64 13.04 1.71C12.06 0.62 10.65 0 9.17 0L9.14 0L9.13 0C6.86 0 4.86 1.44 4.16 3.57C2.7 3.86 1.44 4.76 0.71 6.04C0.24 6.83 0 7.72 0 8.63C0 9.9 0.48 11.14 1.35 12.08C1.17 12.6 1.08 13.15 1.08 13.69C1.08 14.6 1.33 15.49 1.79 16.27C2.92 18.21 5.2 19.21 7.42 18.74C8.4 19.83 9.8 20.45 11.28 20.45L11.31 20.45L11.33 20.45C13.59 20.45 15.6 19.01 16.3 16.88C17.76 16.59 19.01 15.69 19.75 14.41C20.21 13.63 20.45 12.74 20.45 11.83C20.45 10.55 19.97 9.32 19.11 8.37Z M8.94734 18.1579C8.90734 18.1879 8.86734 18.2079 8.82734 18.2279C9.52734 18.8079 10.3973 19.1179 11.3073 19.1179L11.3173 19.1179C13.4573 19.1179 15.1973 17.3979 15.1973 15.2879L15.1973 10.5279C15.1973 10.5079 15.1773 10.4879 15.1573 10.4779L13.4173 9.48792L13.4173 15.2379C13.4173 15.4679 13.2873 15.6879 13.0773 15.8079L8.94734 18.1579Z M8.27654 17.0048L12.4465 14.6248C12.4665 14.6148 12.4765 14.5948 12.4765 14.5748L12.4765 14.5748L12.4765 12.5848L7.43654 15.4548C7.22654 15.5748 6.96654 15.5748 6.75654 15.4548L2.62654 13.1048C2.58654 13.0848 2.53654 13.0448 2.50654 13.0348C2.46654 13.2448 2.44654 13.4648 2.44654 13.6848C2.44654 14.3548 2.62654 15.0148 2.96654 15.6048L2.96654 15.5948C3.66654 16.7848 4.94654 17.5148 6.33654 17.5148C7.01654 17.5148 7.68654 17.3348 8.27654 17.0048Z M3.90324 5.16818C3.90324 5.12818 3.90324 5.06818 3.90324 5.02818C3.05324 5.33818 2.33324 5.92818 1.88324 6.70818L1.88324 6.70818C1.54324 7.28818 1.36324 7.94818 1.36324 8.61818C1.36324 9.98818 2.10324 11.2582 3.30324 11.9482L7.47324 14.3182C7.49324 14.3282 7.51324 14.3282 7.53324 14.3182L9.28324 13.3182L4.24324 10.4482C4.03324 10.3382 3.90324 10.1182 3.90324 9.87818L3.90324 9.87818L3.90324 5.16818Z M17.1561 8.50521L12.9761 6.1252C12.9561 6.1252 12.9361 6.1252 12.9161 6.1352L11.1761 7.1252L16.2161 9.9952C16.4261 10.1152 16.5561 10.3352 16.5561 10.5752C16.5561 10.5752 16.5561 10.5752 16.5561 10.5752L16.5561 15.4252C18.0761 14.8652 19.0961 13.4352 19.0961 11.8252C19.0961 10.4552 18.3561 9.1952 17.1561 8.50521Z M8.01418 5.82927C7.99418 5.83927 7.98418 5.85927 7.98418 5.87927L7.98418 5.87927L7.98418 7.86927L13.0242 4.99927C13.1242 4.93927 13.2442 4.90927 13.3642 4.90927C13.4842 4.90927 13.5942 4.93927 13.7042 4.99927L17.8342 7.34927C17.8742 7.36927 17.9142 7.39927 17.9542 7.41927L17.9542 7.41927C17.9842 7.20927 18.0042 6.98927 18.0042 6.76927C18.0042 4.65927 16.2642 2.93927 14.1242 2.93927C13.4442 2.93927 12.7742 3.11927 12.1842 3.44927L8.01418 5.82927Z M9.14676 1.33731C6.99676 1.33731 5.25676 3.05731 5.25676 5.16731L5.25676 9.92731C5.25676 9.94731 5.27676 9.95731 5.28676 9.96731L7.03676 10.9673L7.03676 5.22731L7.03676 5.21731C7.03676 4.98731 7.16676 4.76731 7.37676 4.64731L11.5068 2.29731C11.5468 2.26731 11.5968 2.23731 11.6268 2.22731C10.9268 1.64731 10.0468 1.33731 9.14676 1.33731Z M7.98345 11.5093L10.2235 12.7793L12.4735 11.5093L12.4735 8.9493L10.2235 7.6693L7.98345 8.9493L7.98345 11.5093Z " />
</g> </g>

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

1
app/icons/lightning.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16" fill="none"><g opacity="1" transform="translate(0 0) rotate(0)"><mask id="bg-mask-0" fill="white"><use xlink:href="#path_0"></use></mask><g mask="url(#bg-mask-0)" ><path id="路径 1" style="fill:#333333; opacity:1;" d="M2.24783,8.85208c-0.03406,-0.0275 -0.06511,-0.05806 -0.09315,-0.09167c-0.02804,-0.03362 -0.05253,-0.06965 -0.07347,-0.10809c-0.02095,-0.03843 -0.03794,-0.07854 -0.05098,-0.12033c-0.01304,-0.04179 -0.02188,-0.08445 -0.02652,-0.12798c-0.00464,-0.04353 -0.00499,-0.08709 -0.00104,-0.13068c0.00394,-0.04359 0.0121,-0.08639 0.02447,-0.12838c0.01237,-0.04199 0.02872,-0.08236 0.04905,-0.12113l3.67,-7c0.02824,-0.05386 0.06319,-0.10294 0.10486,-0.14724c0.04167,-0.0443 0.08852,-0.08218 0.14056,-0.11365c0.05204,-0.03147 0.10735,-0.05538 0.16593,-0.07172c0.05857,-0.01634 0.11827,-0.02451 0.17909,-0.02451h5.99997c0.07473,0 0.1474,0.01221 0.218,0.03663c0.0706,0.02442 0.13527,0.05971 0.194,0.10586c0.0344,0.02705 0.06583,0.05719 0.0943,0.09044c0.02847,0.03324 0.05343,0.06894 0.0749,0.1071c0.02147,0.03816 0.03897,0.07805 0.0525,0.11966c0.0136,0.04161 0.02303,0.08414 0.0283,0.12761c0.0052,0.04346 0.0061,0.08701 0.0027,0.13066c-0.00333,0.04364 -0.01093,0.08654 -0.0228,0.12869c-0.0118,0.04215 -0.0276,0.08274 -0.0474,0.12177c-0.0198,0.03903 -0.04323,0.07576 -0.0703,0.11017l-2.8224,3.59141h3.6282c0.08387,0 0.16483,0.01527 0.2429,0.04581c0.07807,0.03055 0.1479,0.07427 0.2095,0.13116c0.03213,0.0297 0.06107,0.06225 0.0868,0.09766c0.0258,0.03541 0.04787,0.07298 0.0662,0.11273c0.01833,0.03975 0.0326,0.0809 0.0428,0.12346c0.01027,0.04256 0.01627,0.08571 0.018,0.12945c0.00173,0.04374 -0.00083,0.08723 -0.0077,0.13047c-0.0068,0.04324 -0.01777,0.08539 -0.0329,0.12646c-0.01513,0.04108 -0.03413,0.08028 -0.057,0.11761c-0.02287,0.03733 -0.04917,0.07208 -0.0789,0.10423l-7.99998,8.65995c-0.04107,0.04447 -0.08735,0.08263 -0.13882,0.1145c-0.05147,0.03187 -0.10626,0.05627 -0.16438,0.0732c-0.05812,0.01693 -0.11744,0.0258 -0.17797,0.0266c-0.06053,0.00073 -0.12006,-0.0066 -0.17859,-0.022c-0.08548,-0.02253 -0.16339,-0.0606 -0.23373,-0.1142c-0.07035,-0.05353 -0.12777,-0.1185 -0.17227,-0.1949c-0.04449,-0.0764 -0.07268,-0.1584 -0.08456,-0.246c-0.01187,-0.0876 -0.00653,-0.17413 0.01602,-0.2596l1.44925,-5.49326h-3.80464c-0.10945,0 -0.21263,-0.02541 -0.30956,-0.07623c-0.03877,-0.02033 -0.07519,-0.04424 -0.10924,-0.07173zM3.76889,7.66671h3.56774c0.04377,0 0.08713,0.00427 0.13006,0.01281c0.04293,0.00854 0.08461,0.02118 0.12506,0.03793c0.04044,0.01675 0.07886,0.03729 0.11526,0.06161c0.03639,0.02432 0.07007,0.05196 0.10102,0.08291c0.03095,0.03095 0.05859,0.06463 0.08291,0.10102c0.02432,0.0364 0.04485,0.07482 0.0616,0.11526c0.01675,0.04044 0.0294,0.08213 0.03794,0.12506c0.00854,0.04293 0.01281,0.08629 0.01281,0.13006c0,0.05765 -0.00735,0.11434 -0.02205,0.17007l-0.9867,3.73996l5.14866,-5.57336h-3.47657c-0.04378,0 -0.08713,-0.00427 -0.13006,-0.01281c-0.04293,-0.00854 -0.08462,-0.02119 -0.12507,-0.03794c-0.04044,-0.01675 -0.07886,-0.03729 -0.11525,-0.0616c-0.0364,-0.02432 -0.07008,-0.05196 -0.10103,-0.08291c-0.03095,-0.03095 -0.05859,-0.06463 -0.08291,-0.10103c-0.02432,-0.03639 -0.04485,-0.07481 -0.0616,-0.11525c-0.01675,-0.04045 -0.0294,-0.08214 -0.03794,-0.12507c-0.00854,-0.04293 -0.01281,-0.08629 -0.01281,-0.13006c0,-0.07469 0.01221,-0.14734 0.03663,-0.21794c0.02442,-0.07059 0.05971,-0.13526 0.10586,-0.19399l2.82235,-3.5914h-4.22496z"></path></g></g><defs><rect id="path_0" x="0" y="0" width="16" height="16" /></defs></svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -45,7 +45,7 @@ const cn = {
Memory: { Memory: {
Title: "历史摘要", Title: "历史摘要",
EmptyContent: "对话内容过短,无需总结", EmptyContent: "对话内容过短,无需总结",
Send: "启用总结并发送摘要", Send: "自动压缩聊天记录并作为上下文发送",
Copy: "复制摘要", Copy: "复制摘要",
Reset: "重置对话", Reset: "重置对话",
ResetConfirm: "重置后将清空当前对话记录以及历史摘要,确认重置?", ResetConfirm: "重置后将清空当前对话记录以及历史摘要,确认重置?",
@ -63,12 +63,8 @@ const cn = {
ClearAll: "清除所有数据", ClearAll: "清除所有数据",
ResetAll: "重置所有选项", ResetAll: "重置所有选项",
Close: "关闭", Close: "关闭",
ConfirmResetAll: { ConfirmResetAll: "确认重置所有配置?",
Confirm: "确认清除所有配置?", ConfirmClearAll: "确认清除所有数据?",
},
ConfirmClearAll: {
Confirm: "确认清除所有聊天记录?",
},
}, },
Lang: { Lang: {
Name: "Language", Name: "Language",
@ -101,7 +97,14 @@ const cn = {
SendKey: "发送键", SendKey: "发送键",
Theme: "主题", Theme: "主题",
TightBorder: "无边框模式", TightBorder: "无边框模式",
SendPreviewBubble: "发送预览气泡", SendPreviewBubble: {
Title: "预览气泡",
SubTitle: "在预览气泡中预览 Markdown 内容",
},
Mask: {
Title: "面具启动页",
SubTitle: "新建聊天时,展示面具启动页",
},
Prompt: { Prompt: {
Disable: { Disable: {
Title: "禁用提示词自动补全", Title: "禁用提示词自动补全",
@ -130,6 +133,7 @@ const cn = {
SubTitle: "使用自己的 Key 可绕过密码访问限制", SubTitle: "使用自己的 Key 可绕过密码访问限制",
Placeholder: "OpenAI API Key", Placeholder: "OpenAI API Key",
}, },
Usage: { Usage: {
Title: "余额查询", Title: "余额查询",
SubTitle(used: any, total: any) { SubTitle(used: any, total: any) {
@ -170,7 +174,6 @@ const cn = {
Summarize: Summarize:
"简要总结一下你和用户的对话,用作后续的上下文提示 prompt控制在 200 字以内", "简要总结一下你和用户的对话,用作后续的上下文提示 prompt控制在 200 字以内",
}, },
ConfirmClearAll: "确认清除所有聊天、设置数据?",
}, },
Copy: { Copy: {
Success: "已写入剪切板", Success: "已写入剪切板",
@ -181,7 +184,11 @@ const cn = {
Edit: "当前对话设置", Edit: "当前对话设置",
Add: "新增预设对话", Add: "新增预设对话",
}, },
Plugin: {
Name: "插件",
},
Mask: { Mask: {
Name: "面具",
Page: { Page: {
Title: "预设角色面具", Title: "预设角色面具",
SubTitle: (count: number) => `${count} 个预设角色定义`, SubTitle: (count: number) => `${count} 个预设角色定义`,
@ -209,7 +216,9 @@ const cn = {
}, },
NewChat: { NewChat: {
Return: "返回", Return: "返回",
Skip: "跳过", Skip: "直接开始",
NotShow: "不再展示",
ConfirmNoShow: "确认禁用?禁用后可以随时在设置中重新启用。",
Title: "挑选一个面具", Title: "挑选一个面具",
SubTitle: "现在开始,与面具背后的灵魂思维碰撞", SubTitle: "现在开始,与面具背后的灵魂思维碰撞",
More: "搜索更多", More: "搜索更多",

View File

@ -65,12 +65,9 @@ const de: LocaleType = {
ClearAll: "Alle Daten löschen", ClearAll: "Alle Daten löschen",
ResetAll: "Alle Einstellungen zurücksetzen", ResetAll: "Alle Einstellungen zurücksetzen",
Close: "Schließen", Close: "Schließen",
ConfirmResetAll: { ConfirmResetAll:
Confirm: "Möchten Sie wirklich alle Konfigurationen zurücksetzen?", "Möchten Sie wirklich alle Konfigurationen zurücksetzen?",
}, ConfirmClearAll: "Möchten Sie wirklich alle Chats zurücksetzen?",
ConfirmClearAll: {
Confirm: "Möchten Sie wirklich alle Chats zurücksetzen?",
},
}, },
Lang: { Lang: {
Name: "Language", // ATTENTION: if you wanna add a new translation, please do not translate this value, leave it as `Language` Name: "Language", // ATTENTION: if you wanna add a new translation, please do not translate this value, leave it as `Language`
@ -102,7 +99,14 @@ const de: LocaleType = {
SendKey: "Senden-Taste", SendKey: "Senden-Taste",
Theme: "Erscheinungsbild", Theme: "Erscheinungsbild",
TightBorder: "Enger Rahmen", TightBorder: "Enger Rahmen",
SendPreviewBubble: "Vorschau-Bubble senden", SendPreviewBubble: {
Title: "Vorschau-Bubble senden",
SubTitle: "Preview markdown in bubble",
},
Mask: {
Title: "Mask Splash Screen",
SubTitle: "Show a mask splash screen before starting new chat",
},
Prompt: { Prompt: {
Disable: { Disable: {
Title: "Autovervollständigung deaktivieren", Title: "Autovervollständigung deaktivieren",
@ -176,8 +180,6 @@ const de: LocaleType = {
Summarize: Summarize:
"Fassen Sie unsere Diskussion kurz in 200 Wörtern oder weniger zusammen, um sie als Pronpt für zukünftige Gespräche zu verwenden.", "Fassen Sie unsere Diskussion kurz in 200 Wörtern oder weniger zusammen, um sie als Pronpt für zukünftige Gespräche zu verwenden.",
}, },
ConfirmClearAll:
"Bestätigen Sie, um alle Chat- und Einstellungsdaten zu löschen?",
}, },
Copy: { Copy: {
Success: "In die Zwischenablage kopiert", Success: "In die Zwischenablage kopiert",
@ -189,7 +191,11 @@ const de: LocaleType = {
Edit: "Kontext- und Gedächtnis-Prompts", Edit: "Kontext- und Gedächtnis-Prompts",
Add: "Hinzufügen", Add: "Hinzufügen",
}, },
Plugin: {
Name: "Plugin",
},
Mask: { Mask: {
Name: "Mask",
Page: { Page: {
Title: "Prompt Template", Title: "Prompt Template",
SubTitle: (count: number) => `${count} prompt templates`, SubTitle: (count: number) => `${count} prompt templates`,
@ -221,6 +227,8 @@ const de: LocaleType = {
Title: "Pick a Mask", Title: "Pick a Mask",
SubTitle: "Chat with the Soul behind the Mask", SubTitle: "Chat with the Soul behind the Mask",
More: "Find More", More: "Find More",
NotShow: "Not Show Again",
ConfirmNoShow: "Confirm to disableYou can enable it in settings later.",
}, },
}; };

View File

@ -65,12 +65,8 @@ const en: LocaleType = {
ClearAll: "Clear All Data", ClearAll: "Clear All Data",
ResetAll: "Reset All Settings", ResetAll: "Reset All Settings",
Close: "Close", Close: "Close",
ConfirmResetAll: { ConfirmResetAll: "Are you sure you want to reset all configurations?",
Confirm: "Are you sure you want to reset all configurations?", ConfirmClearAll: "Are you sure you want to reset all data?",
},
ConfirmClearAll: {
Confirm: "Are you sure you want to reset all chat?",
},
}, },
Lang: { Lang: {
Name: "Language", // ATTENTION: if you wanna add a new translation, please do not translate this value, leave it as `Language` Name: "Language", // ATTENTION: if you wanna add a new translation, please do not translate this value, leave it as `Language`
@ -102,7 +98,14 @@ const en: LocaleType = {
SendKey: "Send Key", SendKey: "Send Key",
Theme: "Theme", Theme: "Theme",
TightBorder: "Tight Border", TightBorder: "Tight Border",
SendPreviewBubble: "Send Preview Bubble", SendPreviewBubble: {
Title: "Send Preview Bubble",
SubTitle: "Preview markdown in bubble",
},
Mask: {
Title: "Mask Splash Screen",
SubTitle: "Show a mask splash screen before starting new chat",
},
Prompt: { Prompt: {
Disable: { Disable: {
Title: "Disable auto-completion", Title: "Disable auto-completion",
@ -174,7 +177,6 @@ const en: LocaleType = {
Summarize: Summarize:
"Summarize our discussion briefly in 200 words or less to use as a prompt for future context.", "Summarize our discussion briefly in 200 words or less to use as a prompt for future context.",
}, },
ConfirmClearAll: "Confirm to clear all chat and setting data?",
}, },
Copy: { Copy: {
Success: "Copied to clipboard", Success: "Copied to clipboard",
@ -185,7 +187,11 @@ const en: LocaleType = {
Edit: "Contextual and Memory Prompts", Edit: "Contextual and Memory Prompts",
Add: "Add a Prompt", Add: "Add a Prompt",
}, },
Plugin: {
Name: "Plugin",
},
Mask: { Mask: {
Name: "Mask",
Page: { Page: {
Title: "Prompt Template", Title: "Prompt Template",
SubTitle: (count: number) => `${count} prompt templates`, SubTitle: (count: number) => `${count} prompt templates`,
@ -217,6 +223,8 @@ const en: LocaleType = {
Title: "Pick a Mask", Title: "Pick a Mask",
SubTitle: "Chat with the Soul behind the Mask", SubTitle: "Chat with the Soul behind the Mask",
More: "Find More", More: "Find More",
NotShow: "Not Show Again",
ConfirmNoShow: "Confirm to disableYou can enable it in settings later.",
}, },
}; };

View File

@ -65,12 +65,8 @@ const es: LocaleType = {
ClearAll: "Borrar todos los datos", ClearAll: "Borrar todos los datos",
ResetAll: "Restablecer todas las configuraciones", ResetAll: "Restablecer todas las configuraciones",
Close: "Cerrar", Close: "Cerrar",
ConfirmResetAll: { ConfirmResetAll: "Are you sure you want to reset all configurations?",
Confirm: "Are you sure you want to reset all configurations?", ConfirmClearAll: "Are you sure you want to reset all chat?",
},
ConfirmClearAll: {
Confirm: "Are you sure you want to reset all chat?",
},
}, },
Lang: { Lang: {
Name: "Language", Name: "Language",
@ -102,7 +98,14 @@ const es: LocaleType = {
SendKey: "Tecla de envío", SendKey: "Tecla de envío",
Theme: "Tema", Theme: "Tema",
TightBorder: "Borde ajustado", TightBorder: "Borde ajustado",
SendPreviewBubble: "Enviar burbuja de vista previa", SendPreviewBubble: {
Title: "Enviar burbuja de vista previa",
SubTitle: "Preview markdown in bubble",
},
Mask: {
Title: "Mask Splash Screen",
SubTitle: "Show a mask splash screen before starting new chat",
},
Prompt: { Prompt: {
Disable: { Disable: {
Title: "Desactivar autocompletado", Title: "Desactivar autocompletado",
@ -174,8 +177,6 @@ const es: LocaleType = {
Summarize: Summarize:
"Resuma nuestra discusión brevemente en 200 caracteres o menos para usarlo como un recordatorio para futuros contextos.", "Resuma nuestra discusión brevemente en 200 caracteres o menos para usarlo como un recordatorio para futuros contextos.",
}, },
ConfirmClearAll:
"¿Confirmar para borrar todos los datos de chat y configuración?",
}, },
Copy: { Copy: {
Success: "Copiado al portapapeles", Success: "Copiado al portapapeles",
@ -187,7 +188,11 @@ const es: LocaleType = {
Edit: "Contextual and Memory Prompts", Edit: "Contextual and Memory Prompts",
Add: "Add One", Add: "Add One",
}, },
Plugin: {
Name: "Plugin",
},
Mask: { Mask: {
Name: "Mask",
Page: { Page: {
Title: "Prompt Template", Title: "Prompt Template",
SubTitle: (count: number) => `${count} prompt templates`, SubTitle: (count: number) => `${count} prompt templates`,
@ -219,6 +224,8 @@ const es: LocaleType = {
Title: "Pick a Mask", Title: "Pick a Mask",
SubTitle: "Chat with the Soul behind the Mask", SubTitle: "Chat with the Soul behind the Mask",
More: "Find More", More: "Find More",
NotShow: "Not Show Again",
ConfirmNoShow: "Confirm to disableYou can enable it in settings later.",
}, },
}; };

View File

@ -65,12 +65,8 @@ const it: LocaleType = {
ClearAll: "Cancella tutti i dati", ClearAll: "Cancella tutti i dati",
ResetAll: "Resetta tutte le impostazioni", ResetAll: "Resetta tutte le impostazioni",
Close: "Chiudi", Close: "Chiudi",
ConfirmResetAll: { ConfirmResetAll: "Sei sicuro vuoi cancellare tutte le impostazioni?",
Confirm: "Sei sicuro vuoi cancellare tutte le impostazioni?", ConfirmClearAll: "Sei sicuro vuoi cancellare tutte le chat?",
},
ConfirmClearAll: {
Confirm: "Sei sicuro vuoi cancellare tutte le chat?",
},
}, },
Lang: { Lang: {
Name: "Lingue", Name: "Lingue",
@ -102,7 +98,14 @@ const it: LocaleType = {
SendKey: "Tasto invia", SendKey: "Tasto invia",
Theme: "Tema", Theme: "Tema",
TightBorder: "Schermo intero", TightBorder: "Schermo intero",
SendPreviewBubble: "Anteprima di digitazione", SendPreviewBubble: {
Title: "Anteprima di digitazione",
SubTitle: "Preview markdown in bubble",
},
Mask: {
Title: "Mask Splash Screen",
SubTitle: "Show a mask splash screen before starting new chat",
},
Prompt: { Prompt: {
Disable: { Disable: {
Title: "Disabilita l'auto completamento", Title: "Disabilita l'auto completamento",
@ -175,8 +178,6 @@ const it: LocaleType = {
Summarize: Summarize:
"Riassumi brevemente la nostra discussione in 200 caratteri o meno per usarla come spunto per una futura conversazione.", "Riassumi brevemente la nostra discussione in 200 caratteri o meno per usarla come spunto per una futura conversazione.",
}, },
ConfirmClearAll:
"Confermi la cancellazione di tutti i dati della chat e delle impostazioni?",
}, },
Copy: { Copy: {
Success: "Copiato sugli appunti", Success: "Copiato sugli appunti",
@ -188,7 +189,11 @@ const it: LocaleType = {
Edit: "Prompt contestuali e di memoria", Edit: "Prompt contestuali e di memoria",
Add: "Aggiungi altro", Add: "Aggiungi altro",
}, },
Plugin: {
Name: "Plugin",
},
Mask: { Mask: {
Name: "Mask",
Page: { Page: {
Title: "Prompt Template", Title: "Prompt Template",
SubTitle: (count: number) => `${count} prompt templates`, SubTitle: (count: number) => `${count} prompt templates`,
@ -220,6 +225,8 @@ const it: LocaleType = {
Title: "Pick a Mask", Title: "Pick a Mask",
SubTitle: "Chat with the Soul behind the Mask", SubTitle: "Chat with the Soul behind the Mask",
More: "Find More", More: "Find More",
NotShow: "Not Show Again",
ConfirmNoShow: "Confirm to disableYou can enable it in settings later.",
}, },
}; };

View File

@ -65,12 +65,8 @@ const jp: LocaleType = {
ClearAll: "すべてのデータをクリア", ClearAll: "すべてのデータをクリア",
ResetAll: "すべてのオプションをリセット", ResetAll: "すべてのオプションをリセット",
Close: "閉じる", Close: "閉じる",
ConfirmResetAll: { ConfirmResetAll: "すべての設定をリセットしてもよろしいですか?",
Confirm: "すべての設定をリセットしてもよろしいですか?", ConfirmClearAll: "すべてのチャットをリセットしてもよろしいですか?",
},
ConfirmClearAll: {
Confirm: "すべてのチャットをリセットしてもよろしいですか?",
},
}, },
Lang: { Lang: {
Name: "Language", Name: "Language",
@ -103,7 +99,14 @@ const jp: LocaleType = {
SendKey: "送信キー", SendKey: "送信キー",
Theme: "テーマ", Theme: "テーマ",
TightBorder: "ボーダーレスモード", TightBorder: "ボーダーレスモード",
SendPreviewBubble: "プレビューバブルの送信", SendPreviewBubble: {
Title: "プレビューバブルの送信",
SubTitle: "在预览气泡中预览 Markdown 内容",
},
Mask: {
Title: "面具启动页",
SubTitle: "新建聊天时,展示面具启动页",
},
Prompt: { Prompt: {
Disable: { Disable: {
Title: "プロンプトの自動補完を無効にする", Title: "プロンプトの自動補完を無効にする",
@ -176,8 +179,6 @@ const jp: LocaleType = {
Summarize: Summarize:
"あなたとユーザの会話を簡潔にまとめて、後続のコンテキストプロンプトとして使ってください。200字以内に抑えてください。", "あなたとユーザの会話を簡潔にまとめて、後続のコンテキストプロンプトとして使ってください。200字以内に抑えてください。",
}, },
ConfirmClearAll:
"すべてのチャット、設定データをクリアしてもよろしいですか?",
}, },
Copy: { Copy: {
Success: "クリップボードに書き込みました", Success: "クリップボードに書き込みました",
@ -188,7 +189,9 @@ const jp: LocaleType = {
Edit: "前置コンテキストと履歴メモリ", Edit: "前置コンテキストと履歴メモリ",
Add: "新規追加", Add: "新規追加",
}, },
Plugin: { Name: "插件" },
Mask: { Mask: {
Name: "面具",
Page: { Page: {
Title: "预设角色面具", Title: "预设角色面具",
SubTitle: (count: number) => `${count} 个预设角色定义`, SubTitle: (count: number) => `${count} 个预设角色定义`,
@ -220,6 +223,8 @@ const jp: LocaleType = {
Title: "挑选一个面具", Title: "挑选一个面具",
SubTitle: "现在开始,与面具背后的灵魂思维碰撞", SubTitle: "现在开始,与面具背后的灵魂思维碰撞",
More: "搜索更多", More: "搜索更多",
NotShow: "不再展示",
ConfirmNoShow: "确认禁用?禁用后可以随时在设置中重新启用。",
}, },
}; };

View File

@ -65,12 +65,8 @@ const tr: LocaleType = {
ClearAll: "Tüm Verileri Temizle", ClearAll: "Tüm Verileri Temizle",
ResetAll: "Tüm Ayarları Sıfırla", ResetAll: "Tüm Ayarları Sıfırla",
Close: "Kapat", Close: "Kapat",
ConfirmResetAll: { ConfirmResetAll: "Tüm ayarları sıfırlamak istediğinizden emin misiniz?",
Confirm: "Tüm ayarları sıfırlamak istediğinizden emin misiniz?", ConfirmClearAll: "Tüm sohbeti sıfırlamak istediğinizden emin misiniz?",
},
ConfirmClearAll: {
Confirm: "Tüm sohbeti sıfırlamak istediğinizden emin misiniz?",
},
}, },
Lang: { Lang: {
Name: "Language", // ATTENTION: if you wanna add a new translation, please do not translate this value, leave it as `Language` Name: "Language", // ATTENTION: if you wanna add a new translation, please do not translate this value, leave it as `Language`
@ -102,7 +98,14 @@ const tr: LocaleType = {
SendKey: "Gönder Tuşu", SendKey: "Gönder Tuşu",
Theme: "Tema", Theme: "Tema",
TightBorder: "Tam Ekran", TightBorder: "Tam Ekran",
SendPreviewBubble: "Mesaj Önizleme Balonu", SendPreviewBubble: {
Title: "Mesaj Önizleme Balonu",
SubTitle: "Preview markdown in bubble",
},
Mask: {
Title: "Mask Splash Screen",
SubTitle: "Show a mask splash screen before starting new chat",
},
Prompt: { Prompt: {
Disable: { Disable: {
Title: "Otomatik tamamlamayı devre dışı bırak", Title: "Otomatik tamamlamayı devre dışı bırak",
@ -176,8 +179,6 @@ const tr: LocaleType = {
Summarize: Summarize:
"Gelecekteki bağlam için bir bilgi istemi olarak kullanmak üzere tartışmamızı en fazla 200 kelimeyle özetleyin.", "Gelecekteki bağlam için bir bilgi istemi olarak kullanmak üzere tartışmamızı en fazla 200 kelimeyle özetleyin.",
}, },
ConfirmClearAll:
"Tüm sohbet ve ayar verilerini temizlemeyi onaylıyor musunuz?",
}, },
Copy: { Copy: {
Success: "Panoya kopyalandı", Success: "Panoya kopyalandı",
@ -188,7 +189,11 @@ const tr: LocaleType = {
Edit: "Bağlamsal ve Bellek Komutları", Edit: "Bağlamsal ve Bellek Komutları",
Add: "Yeni Ekle", Add: "Yeni Ekle",
}, },
Plugin: {
Name: "Plugin",
},
Mask: { Mask: {
Name: "Mask",
Page: { Page: {
Title: "Prompt Template", Title: "Prompt Template",
SubTitle: (count: number) => `${count} prompt templates`, SubTitle: (count: number) => `${count} prompt templates`,
@ -220,6 +225,8 @@ const tr: LocaleType = {
Title: "Pick a Mask", Title: "Pick a Mask",
SubTitle: "Chat with the Soul behind the Mask", SubTitle: "Chat with the Soul behind the Mask",
More: "Find More", More: "Find More",
NotShow: "Not Show Again",
ConfirmNoShow: "Confirm to disableYou can enable it in settings later.",
}, },
}; };

View File

@ -63,12 +63,8 @@ const tw: LocaleType = {
ClearAll: "清除所有資料", ClearAll: "清除所有資料",
ResetAll: "重設所有設定", ResetAll: "重設所有設定",
Close: "關閉", Close: "關閉",
ConfirmResetAll: { ConfirmResetAll: "您確定要重設所有設定嗎?",
Confirm: "您確定要重設所有設定嗎?", ConfirmClearAll: "您確定要清除所有数据嗎?",
},
ConfirmClearAll: {
Confirm: "您確定要清除所有聊天嗎?",
},
}, },
Lang: { Lang: {
Name: "Language", Name: "Language",
@ -100,7 +96,14 @@ const tw: LocaleType = {
SendKey: "發送鍵", SendKey: "發送鍵",
Theme: "主題", Theme: "主題",
TightBorder: "緊湊邊框", TightBorder: "緊湊邊框",
SendPreviewBubble: "發送預覽氣泡", SendPreviewBubble: {
Title: "預覽氣泡",
SubTitle: "在预览气泡中预览 Markdown 内容",
},
Mask: {
Title: "面具启动页",
SubTitle: "新建聊天时,展示面具启动页",
},
Prompt: { Prompt: {
Disable: { Disable: {
Title: "停用提示詞自動補齊", Title: "停用提示詞自動補齊",
@ -169,7 +172,6 @@ const tw: LocaleType = {
Summarize: Summarize:
"Use the language used by the user (e.g. en-us for english conversation, zh-hant for chinese conversation, etc.) to summarise the conversation in at most 200 words. The summary will be used as prompt for you to continue the conversation in the future.", "Use the language used by the user (e.g. en-us for english conversation, zh-hant for chinese conversation, etc.) to summarise the conversation in at most 200 words. The summary will be used as prompt for you to continue the conversation in the future.",
}, },
ConfirmClearAll: "確認清除所有對話、設定?",
}, },
Copy: { Copy: {
Success: "已複製到剪貼簿中", Success: "已複製到剪貼簿中",
@ -180,7 +182,9 @@ const tw: LocaleType = {
Edit: "前置上下文和歷史記憶", Edit: "前置上下文和歷史記憶",
Add: "新增一條", Add: "新增一條",
}, },
Plugin: { Name: "插件" },
Mask: { Mask: {
Name: "面具",
Page: { Page: {
Title: "预设角色面具", Title: "预设角色面具",
SubTitle: (count: number) => `${count} 个预设角色定义`, SubTitle: (count: number) => `${count} 个预设角色定义`,
@ -212,6 +216,8 @@ const tw: LocaleType = {
Title: "挑选一个面具", Title: "挑选一个面具",
SubTitle: "现在开始,与面具背后的灵魂思维碰撞", SubTitle: "现在开始,与面具背后的灵魂思维碰撞",
More: "搜索更多", More: "搜索更多",
NotShow: "不再展示",
ConfirmNoShow: "确认禁用?禁用后可以随时在设置中重新启用。",
}, },
}; };

View File

@ -319,7 +319,10 @@ export const useChatStore = create<ChatStore>()(
return { return {
role: "system", role: "system",
content: Locale.Store.Prompt.History(session.memoryPrompt), content:
session.memoryPrompt.length > 0
? Locale.Store.Prompt.History(session.memoryPrompt)
: "",
date: "", date: "",
} as Message; } as Message;
}, },
@ -481,10 +484,8 @@ export const useChatStore = create<ChatStore>()(
}, },
clearAllData() { clearAllData() {
if (confirm(Locale.Store.ConfirmClearAll)) { localStorage.clear();
localStorage.clear(); location.reload();
location.reload();
}
}, },
}), }),
{ {

View File

@ -28,6 +28,8 @@ export const DEFAULT_CONFIG = {
disablePromptHint: false, disablePromptHint: false,
dontShowMaskSplashScreen: false, // dont show splash screen when create chat
modelConfig: { modelConfig: {
model: "gpt-3.5-turbo" as ModelType, model: "gpt-3.5-turbo" as ModelType,
temperature: 1, temperature: 1,
@ -138,6 +140,7 @@ export const useAppConfig = create<ChatConfigStore>()(
state.modelConfig.sendMemory = true; state.modelConfig.sendMemory = true;
state.modelConfig.historyMessageCount = 4; state.modelConfig.historyMessageCount = 4;
state.modelConfig.compressMessageLengthThreshold = 1000; state.modelConfig.compressMessageLengthThreshold = 1000;
state.dontShowMaskSplashScreen = false;
return state; return state;
}, },