cn.ts 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  1. import { getClientConfig } from "../config/client";
  2. import { SubmitKey } from "../store/config";
  3. const isApp = !!getClientConfig()?.isApp;
  4. const cn = {
  5. WIP: "该功能仍在开发中……",
  6. Error: {
  7. Unauthorized: isApp
  8. ? "检测到无效 API Key,请前往[设置](/#/settings)页检查 API Key 是否配置正确。"
  9. : "访问密码不正确或为空,请前往[登录](/#/auth)页输入正确的访问密码,或者在[设置](/#/settings)页填入你自己的 OpenAI API Key。",
  10. },
  11. Auth: {
  12. Title: "需要密码",
  13. Tips: "管理员开启了密码验证,请在下方填入访问码",
  14. SubTips: "或者输入你的 OpenAI API 密钥",
  15. Input: "在此处填写访问码",
  16. Confirm: "确认",
  17. Later: "稍后再说",
  18. },
  19. ChatItem: {
  20. ChatItemCount: (count: number) => `${count} 条对话`,
  21. },
  22. Chat: {
  23. SubTitle: (count: number) => `共 ${count} 条对话`,
  24. EditMessage: {
  25. Title: "编辑消息记录",
  26. Topic: {
  27. Title: "聊天主题",
  28. SubTitle: "更改当前聊天主题",
  29. },
  30. },
  31. Actions: {
  32. ChatList: "查看消息列表",
  33. CompressedHistory: "查看压缩后的历史 Prompt",
  34. Export: "导出聊天记录",
  35. Copy: "复制",
  36. Stop: "停止",
  37. Retry: "重试",
  38. Pin: "固定",
  39. PinToastContent: "已将 1 条对话固定至预设提示词",
  40. PinToastAction: "查看",
  41. Delete: "删除",
  42. Edit: "编辑",
  43. },
  44. Commands: {
  45. new: "新建聊天",
  46. newm: "从模板新建聊天",
  47. next: "下一个聊天",
  48. prev: "上一个聊天",
  49. clear: "清除上下文",
  50. del: "删除聊天",
  51. },
  52. InputActions: {
  53. Stop: "停止响应",
  54. ToBottom: "滚到最新",
  55. Theme: {
  56. auto: "自动主题",
  57. light: "亮色模式",
  58. dark: "深色模式",
  59. },
  60. Prompt: "快捷指令",
  61. Masks: "所有模板",
  62. Clear: "清除聊天",
  63. Settings: "对话设置",
  64. },
  65. Rename: "重命名对话",
  66. Typing: "正在输入…",
  67. Input: (submitKey: string) => {
  68. var inputHints = `${submitKey} 发送`;
  69. if (submitKey === String(SubmitKey.Enter)) {
  70. inputHints += ",Shift + Enter 换行";
  71. }
  72. return inputHints + ",/ 触发补全,: 触发命令";
  73. },
  74. Send: "发送",
  75. Config: {
  76. Reset: "清除记忆",
  77. SaveAs: "存为模板",
  78. },
  79. IsContext: "预设提示词",
  80. },
  81. Export: {
  82. Title: "分享聊天记录",
  83. Copy: "全部复制",
  84. Download: "下载文件",
  85. Share: "分享到 ShareGPT",
  86. MessageFromYou: "用户",
  87. MessageFromChatGPT: "ChatGPT",
  88. Format: {
  89. Title: "导出格式",
  90. SubTitle: "可以导出 Markdown 文本或者 PNG 图片",
  91. },
  92. IncludeContext: {
  93. Title: "包含模板上下文",
  94. SubTitle: "是否在消息中展示模板上下文",
  95. },
  96. Steps: {
  97. Select: "选取",
  98. Preview: "预览",
  99. },
  100. Image: {
  101. Toast: "正在生成截图",
  102. Modal: "长按或右键保存图片",
  103. },
  104. },
  105. Select: {
  106. Search: "搜索消息",
  107. All: "选取全部",
  108. Latest: "最近几条",
  109. Clear: "清除选中",
  110. },
  111. Memory: {
  112. Title: "历史摘要",
  113. EmptyContent: "对话内容过短,无需总结",
  114. Send: "自动压缩聊天记录并作为上下文发送",
  115. Copy: "复制摘要",
  116. Reset: "[unused]",
  117. ResetConfirm: "确认清空历史摘要?",
  118. },
  119. Home: {
  120. NewChat: "新的聊天",
  121. DeleteChat: "确认删除选中的对话?",
  122. DeleteToast: "已删除会话",
  123. Revert: "撤销",
  124. },
  125. Settings: {
  126. Title: "设置",
  127. SubTitle: "所有设置选项",
  128. Danger: {
  129. Reset: {
  130. Title: "重置所有设置",
  131. SubTitle: "重置所有设置项回默认值",
  132. Action: "立即重置",
  133. Confirm: "确认重置所有设置?",
  134. },
  135. Clear: {
  136. Title: "清除所有数据",
  137. SubTitle: "清除所有聊天、设置数据",
  138. Action: "立即清除",
  139. Confirm: "确认清除所有聊天、设置数据?",
  140. },
  141. },
  142. Lang: {
  143. Name: "Language", // ATTENTION: if you wanna add a new translation, please do not translate this value, leave it as `Language`
  144. All: "所有语言",
  145. },
  146. Avatar: "头像",
  147. FontSize: {
  148. Title: "字体大小",
  149. SubTitle: "聊天内容的字体大小",
  150. },
  151. InjectSystemPrompts: {
  152. Title: "注入系统级提示信息",
  153. SubTitle: "强制给每次请求的消息列表开头添加一个模拟 ChatGPT 的系统提示",
  154. },
  155. InputTemplate: {
  156. Title: "用户输入预处理",
  157. SubTitle: "用户最新的一条消息会填充到此模板",
  158. },
  159. Update: {
  160. Version: (x: string) => `当前版本:${x}`,
  161. IsLatest: "已是最新版本",
  162. CheckUpdate: "检查更新",
  163. IsChecking: "正在检查更新...",
  164. FoundUpdate: (x: string) => `发现新版本:${x}`,
  165. GoToUpdate: "前往更新",
  166. },
  167. SendKey: "发送键",
  168. Theme: "主题",
  169. TightBorder: "无边框模式",
  170. SendPreviewBubble: {
  171. Title: "预览气泡",
  172. SubTitle: "在预览气泡中预览 Markdown 内容",
  173. },
  174. AutoGenerateTitle: {
  175. Title: "自动生成标题",
  176. SubTitle: "根据对话内容生成合适的标题",
  177. },
  178. Sync: {
  179. CloudState: "云端数据",
  180. NotSyncYet: "还没有进行过同步",
  181. Success: "同步成功",
  182. Fail: "同步失败",
  183. Config: {
  184. Modal: {
  185. Title: "配置云同步",
  186. Check: "检查可用性",
  187. },
  188. SyncType: {
  189. Title: "同步类型",
  190. SubTitle: "选择喜爱的同步服务器",
  191. },
  192. Proxy: {
  193. Title: "启用代理",
  194. SubTitle: "在浏览器中同步时,必须启用代理以避免跨域限制",
  195. },
  196. ProxyUrl: {
  197. Title: "代理地址",
  198. SubTitle: "仅适用于本项目自带的跨域代理",
  199. },
  200. WebDav: {
  201. Endpoint: "WebDAV 地址",
  202. UserName: "用户名",
  203. Password: "密码",
  204. },
  205. UpStash: {
  206. Endpoint: "UpStash Redis REST Url",
  207. UserName: "备份名称",
  208. Password: "UpStash Redis REST Token",
  209. },
  210. },
  211. LocalState: "本地数据",
  212. Overview: (overview: any) => {
  213. return `${overview.chat} 次对话,${overview.message} 条消息,${overview.prompt} 条提示词,${overview.mask} 个模板`;
  214. },
  215. ImportFailed: "导入失败",
  216. },
  217. Mask: {
  218. Splash: {
  219. Title: "模板启动页",
  220. SubTitle: "新建聊天时,展示模板启动页",
  221. },
  222. Builtin: {
  223. Title: "隐藏内置模板",
  224. SubTitle: "在所有模板列表中隐藏内置模板",
  225. },
  226. },
  227. Prompt: {
  228. Disable: {
  229. Title: "禁用提示词自动补全",
  230. SubTitle: "在输入框开头输入 / 即可触发自动补全",
  231. },
  232. List: "自定义提示词列表",
  233. ListCount: (builtin: number, custom: number) =>
  234. `内置 ${builtin} 条,用户定义 ${custom} 条`,
  235. Edit: "编辑",
  236. Modal: {
  237. Title: "提示词列表",
  238. Add: "新建",
  239. Search: "搜索提示词",
  240. },
  241. EditModal: {
  242. Title: "编辑提示词",
  243. },
  244. },
  245. HistoryCount: {
  246. Title: "附带历史消息数",
  247. SubTitle: "每次请求携带的历史消息数",
  248. },
  249. CompressThreshold: {
  250. Title: "历史消息长度压缩阈值",
  251. SubTitle: "当未压缩的历史消息超过该值时,将进行压缩",
  252. },
  253. Usage: {
  254. Title: "余额查询",
  255. SubTitle(used: any, total: any) {
  256. return `本月已使用 $${used},订阅总额 $${total}`;
  257. },
  258. IsChecking: "正在检查…",
  259. Check: "重新检查",
  260. NoAccess: "输入 API Key 或访问密码查看余额",
  261. },
  262. Access: {
  263. AccessCode: {
  264. Title: "访问密码",
  265. SubTitle: "管理员已开启加密访问",
  266. Placeholder: "请输入访问密码",
  267. },
  268. CustomEndpoint: {
  269. Title: "自定义接口",
  270. SubTitle: "是否使用自定义 Azure 或 OpenAI 服务",
  271. },
  272. Provider: {
  273. Title: "模型服务商",
  274. SubTitle: "切换不同的服务商",
  275. },
  276. OpenAI: {
  277. ApiKey: {
  278. Title: "API Key",
  279. SubTitle: "使用自定义 OpenAI Key 绕过密码访问限制",
  280. Placeholder: "OpenAI API Key",
  281. },
  282. Endpoint: {
  283. Title: "接口地址",
  284. SubTitle: "除默认地址外,必须包含 http(s)://",
  285. },
  286. },
  287. Azure: {
  288. ApiKey: {
  289. Title: "接口密钥",
  290. SubTitle: "使用自定义 Azure Key 绕过密码访问限制",
  291. Placeholder: "Azure API Key",
  292. },
  293. Endpoint: {
  294. Title: "接口地址",
  295. SubTitle: "样例:",
  296. },
  297. ApiVerion: {
  298. Title: "接口版本 (azure api version)",
  299. SubTitle: "选择指定的部分版本",
  300. },
  301. },
  302. CustomModel: {
  303. Title: "自定义模型名",
  304. SubTitle: "增加自定义模型可选项,使用英文逗号隔开",
  305. },
  306. },
  307. Model: "模型 (model)",
  308. Temperature: {
  309. Title: "随机性 (temperature)",
  310. SubTitle: "值越大,回复越随机",
  311. },
  312. TopP: {
  313. Title: "核采样 (top_p)",
  314. SubTitle: "与随机性类似,但不要和随机性一起更改",
  315. },
  316. MaxTokens: {
  317. Title: "单次回复限制 (max_tokens)",
  318. SubTitle: "单次交互所用的最大 Token 数",
  319. },
  320. PresencePenalty: {
  321. Title: "话题新鲜度 (presence_penalty)",
  322. SubTitle: "值越大,越有可能扩展到新话题",
  323. },
  324. FrequencyPenalty: {
  325. Title: "频率惩罚度 (frequency_penalty)",
  326. SubTitle: "值越大,越有可能降低重复字词",
  327. },
  328. },
  329. Store: {
  330. DefaultTopic: "新的聊天",
  331. BotHello: "有什么可以帮你的吗",
  332. Error: "出错了,稍后重试吧",
  333. Prompt: {
  334. History: (content: string) => "这是历史聊天总结作为前情提要:" + content,
  335. Topic:
  336. "使用四到五个字直接返回这句话的简要主题,不要解释、不要标点、不要语气词、不要多余文本,如果没有主题,请直接返回“闲聊”",
  337. Summarize:
  338. "简要总结一下对话内容,用作后续的上下文提示 prompt,控制在 200 字以内",
  339. },
  340. },
  341. Copy: {
  342. Success: "已写入剪切板",
  343. Failed: "复制失败,请赋予剪切板权限",
  344. },
  345. Download: {
  346. Success: "内容已下载到您的目录。",
  347. Failed: "下载失败。",
  348. },
  349. Context: {
  350. Toast: (x: any) => `包含 ${x} 条预设提示词`,
  351. Edit: "当前对话设置",
  352. Add: "新增一条对话",
  353. Clear: "上下文已清除",
  354. Revert: "恢复上下文",
  355. },
  356. Plugin: {
  357. Name: "插件",
  358. },
  359. FineTuned: {
  360. Sysmessage: "你是一个助手",
  361. },
  362. Mask: {
  363. Name: "模板",
  364. Page: {
  365. Title: "预设角色模板",
  366. SubTitle: (count: number) => `${count} 个预设角色定义`,
  367. Search: "搜索角色模板",
  368. Create: "新建",
  369. },
  370. Item: {
  371. Info: (count: number) => `包含 ${count} 条预设对话`,
  372. Chat: "对话",
  373. View: "查看",
  374. Edit: "编辑",
  375. Delete: "删除",
  376. DeleteConfirm: "确认删除?",
  377. },
  378. EditModal: {
  379. Title: (readonly: boolean) =>
  380. `编辑预设模板 ${readonly ? "(只读)" : ""}`,
  381. Download: "下载预设",
  382. Clone: "克隆预设",
  383. },
  384. Config: {
  385. Avatar: "角色头像",
  386. Name: "角色名称",
  387. Sync: {
  388. Title: "使用全局设置",
  389. SubTitle: "当前对话是否使用全局模型设置",
  390. Confirm: "当前对话的自定义设置将会被自动覆盖,确认启用全局设置?",
  391. },
  392. HideContext: {
  393. Title: "隐藏预设对话",
  394. SubTitle: "隐藏后预设对话不会出现在聊天界面",
  395. },
  396. Share: {
  397. Title: "分享此模板",
  398. SubTitle: "生成此模板的直达链接",
  399. Action: "复制链接",
  400. },
  401. },
  402. },
  403. NewChat: {
  404. Return: "返回",
  405. Skip: "直接开始",
  406. NotShow: "不再展示",
  407. ConfirmNoShow: "确认禁用?禁用后可以随时在设置中重新启用。",
  408. Title: "挑选一个模板",
  409. SubTitle: "现在开始,与模板背后的灵魂思维碰撞",
  410. More: "查看全部",
  411. },
  412. URLCommand: {
  413. Code: "检测到链接中已经包含访问码,是否自动填入?",
  414. Settings: "检测到链接中包含了预制设置,是否自动填入?",
  415. },
  416. UI: {
  417. Confirm: "确认",
  418. Cancel: "取消",
  419. Close: "关闭",
  420. Create: "新建",
  421. Edit: "编辑",
  422. Export: "导出",
  423. Import: "导入",
  424. Sync: "同步",
  425. Config: "配置",
  426. },
  427. Exporter: {
  428. Description: {
  429. Title: "只有清除上下文之后的消息会被展示",
  430. },
  431. Model: "模型",
  432. Messages: "消息",
  433. Topic: "主题",
  434. Time: "时间",
  435. },
  436. };
  437. type DeepPartial<T> = T extends object
  438. ? {
  439. [P in keyof T]?: DeepPartial<T[P]>;
  440. }
  441. : T;
  442. export type LocaleType = typeof cn;
  443. export type PartialLocaleType = DeepPartial<typeof cn>;
  444. export default cn;