From e3c3cd3d18b1641a6a248863b8b7358c5771e052 Mon Sep 17 00:00:00 2001 From: Yifei Zhang Date: Sun, 2 Apr 2023 18:02:03 +0000 Subject: [PATCH] fixup: translation context --- app/components/chat.tsx | 6 +++--- app/locales/cn.ts | 5 +++++ app/locales/en.ts | 7 ++++++- app/locales/es.ts | 5 +++++ app/locales/index.ts | 2 +- app/locales/tw.ts | 5 +++++ 6 files changed, 25 insertions(+), 5 deletions(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 2294f39b..4a80fe14 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -133,13 +133,13 @@ function PromptToast(props: { > - 已设置 {context.length} 条前置上下文 + {Locale.Context.Toast(context.length)} {props.showModal && (
props.setShowModal(false)} actions={[ } - text="新增" + text={Locale.Context.Add} bordered className={chatStyle["context-prompt-button"]} onClick={() => diff --git a/app/locales/cn.ts b/app/locales/cn.ts index afdcba43..2feed51a 100644 --- a/app/locales/cn.ts +++ b/app/locales/cn.ts @@ -146,6 +146,11 @@ const cn = { Success: "已写入剪切板", Failed: "复制失败,请赋予剪切板权限", }, + Context: { + Toast: (x: any) => `已设置 ${x} 条前置上下文`, + Edit: "前置上下文和历史记忆", + Add: "新增一条", + }, }; export type LocaleType = typeof cn; diff --git a/app/locales/en.ts b/app/locales/en.ts index 87b73b49..06a39765 100644 --- a/app/locales/en.ts +++ b/app/locales/en.ts @@ -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; diff --git a/app/locales/es.ts b/app/locales/es.ts index f195969b..a42a3021 100644 --- a/app/locales/es.ts +++ b/app/locales/es.ts @@ -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; diff --git a/app/locales/index.ts b/app/locales/index.ts index bcd06c9c..dd9b74d6 100644 --- a/app/locales/index.ts +++ b/app/locales/index.ts @@ -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"; diff --git a/app/locales/tw.ts b/app/locales/tw.ts index 371bca34..44f65adb 100644 --- a/app/locales/tw.ts +++ b/app/locales/tw.ts @@ -145,6 +145,11 @@ const tw: LocaleType = { Success: "已複製到剪貼簿中", Failed: "複製失敗,請賦予剪貼簿權限", }, + Context: { + Toast: (x: any) => `已設置 ${x} 條前置上下文`, + Edit: "前置上下文和歷史記憶", + Add: "新增壹條", + }, }; export default tw;