fixup: translation context

This commit is contained in:
Yifei Zhang 2023-04-02 18:02:03 +00:00
parent b85245e317
commit e3c3cd3d18
6 changed files with 25 additions and 5 deletions

View File

@ -133,13 +133,13 @@ function PromptToast(props: {
>
<BrainIcon />
<span className={chatStyle["prompt-toast-content"]}>
{context.length}
{Locale.Context.Toast(context.length)}
</span>
</div>
{props.showModal && (
<div className="modal-mask">
<Modal
title="编辑前置上下文"
title={Locale.Context.Edit}
onClose={() => props.setShowModal(false)}
actions={[
<IconButton
@ -194,7 +194,7 @@ function PromptToast(props: {
<div className={chatStyle["context-prompt-row"]}>
<IconButton
icon={<AddIcon />}
text="新增"
text={Locale.Context.Add}
bordered
className={chatStyle["context-prompt-button"]}
onClick={() =>

View File

@ -146,6 +146,11 @@ const cn = {
Success: "已写入剪切板",
Failed: "复制失败,请赋予剪切板权限",
},
Context: {
Toast: (x: any) => `已设置 ${x} 条前置上下文`,
Edit: "前置上下文和历史记忆",
Add: "新增一条",
},
};
export type LocaleType = typeof cn;

View File

@ -54,7 +54,7 @@ const en: LocaleType = {
Close: "Close",
},
Lang: {
Name: "Language",
Name: "Language", // ATTENTION: if you wanna add a new translation, please do not translate this value, leave it as `Language`
Options: {
cn: "简体中文",
en: "English",
@ -150,6 +150,11 @@ const en: LocaleType = {
Success: "Copied to clipboard",
Failed: "Copy failed, please grant permission to access clipboard",
},
Context: {
Toast: (x: any) => `With ${x} contextual prompts`,
Edit: "Contextual and Memory Prompts",
Add: "Add One",
},
};
export default en;

View File

@ -152,6 +152,11 @@ const es: LocaleType = {
Failed:
"La copia falló, por favor concede permiso para acceder al portapapeles",
},
Context: {
Toast: (x: any) => `With ${x} contextual prompts`,
Edit: "Contextual and Memory Prompts",
Add: "Add One",
},
};
export default es;

View File

@ -5,7 +5,7 @@ import ES from "./es";
export type { LocaleType } from "./cn";
export const AllLangs = ["en", "cn", "tw", "es"] as const;
export const AllLangs = ["cn", "tw", "en", "es"] as const;
type Lang = (typeof AllLangs)[number];
const LANG_KEY = "lang";

View File

@ -145,6 +145,11 @@ const tw: LocaleType = {
Success: "已複製到剪貼簿中",
Failed: "複製失敗,請賦予剪貼簿權限",
},
Context: {
Toast: (x: any) => `已設置 ${x} 條前置上下文`,
Edit: "前置上下文和歷史記憶",
Add: "新增壹條",
},
};
export default tw;