diff --git a/frontend/src/locale/i18n.ts b/frontend/src/locale/i18n.ts index 8ebfaf7..32b25db 100644 --- a/frontend/src/locale/i18n.ts +++ b/frontend/src/locale/i18n.ts @@ -4,6 +4,7 @@ import { initReactI18next } from 'react-i18next'; import en from './en.json'; //English import es from './es.json'; //Spanish import jp from './jp.json'; //Japanese +import zh from './zh.json'; //Mandarin i18n.use(initReactI18next).init({ resources: { @@ -16,6 +17,9 @@ i18n.use(initReactI18next).init({ jp: { translation: jp, }, + zh: { + translation: zh, + }, }, }); diff --git a/frontend/src/locale/zh.json b/frontend/src/locale/zh.json new file mode 100644 index 0000000..9555682 --- /dev/null +++ b/frontend/src/locale/zh.json @@ -0,0 +1,109 @@ +{ + "language": "普通话", + "chat": "聊天", + "chats": "聊天", + "newChat": "新聊天", + "myPlan": "我的计划", + "about": "关于", + "inputPlaceholder": "在这里输入您的消息...", + "tagline": "DocsGPT 使用 GenAI, 请使用来源审核关键信息.", + "sourceDocs": "来源文档", + "none": "无", + "cancel":"取消", + "demo": [ + { + "header": "了解 DocsGPT", + "query": "DocsGPT 是什么" + }, + { + "header": "总结文档", + "query": "总结当前情况" + }, + { + "header": "编写代码", + "query": "为 /api/answer API 请求编写代码" + }, + { + "header": "学习帮助", + "query": "为背景写出潜在问题" + } + ], + "settings": { + "label": "设置", + "general": { + "label": "般", + "selectTheme": "选择主题", + "light": "浅色", + "dark": "暗色", + "selectLanguage": "选择语言", + "chunks": "每个查询处理的块", + "prompt": "提示", + "deleteAllLabel": "删除所有对话", + "deleteAllBtn": "删除所有", + "addNew": "添加新的", + "convHistory":"对话历史", + "none":"无", + "low":"低", + "medium":"中", + "high":"高", + "unlimited":"无限", + "default":"默认" + }, + "documents": { + "label": "文件", + "name": "文件名称", + "date": "向量日期", + "type": "类型", + "tokenUsage": "令牌使用" + }, + "apiKeys": { + "label": "API 密钥", + "name": "名称", + "key": "API 密钥", + "sourceDoc": "源文档", + "createNew": "创建新的" + } + }, + "modals": { + "uploadDoc": { + "label": "上传新文档资料", + "file": "从文件", + "remote": "远程", + "name": "名称", + "choose": "选择文件", + "info": "请上传 .pdf, .txt, .rst, .docx, .md, .zip 文件,限 25MB", + "uploadedFiles": "已上传文件", + "cancel": "取消", + "train": "训练", + "link": "链接", + "urlLink": "URL 链接", + "reddit": { + "id": "客户端 ID", + "secret": "客户端密钥", + "agent": "用户代理", + "searchQueries": "搜索查询", + "numberOfPosts": "帖子数量" + } + }, + "createAPIKey": { + "label": "创建新的 API 密钥", + "apiKeyName": "API 密钥名称", + "chunks": "每个查询处理的块", + "prompt": "选择活动提示", + "sourceDoc": "源文档", + "create": "创建" + }, + "saveKey": { + "note": "请保存您的密钥", + "disclaimer": "这是您的密钥唯一一次展示机会。", + "copy": "复制", + "copied": "已复制", + "confirm": "我已保存密钥" + }, + "deleteConv": { + "confirm": "您确定要删除所有对话吗?", + "delete": "删除" + } + } + } + \ No newline at end of file diff --git a/frontend/src/settings/General.tsx b/frontend/src/settings/General.tsx index 6a4b1a9..eb5ac90 100644 --- a/frontend/src/settings/General.tsx +++ b/frontend/src/settings/General.tsx @@ -36,6 +36,10 @@ const General: React.FC = () => { label: 'Japanese', value: 'jp', }, + { + label: 'Mandarin', + value: 'zh', + }, ]; const chunks = ['0', '2', '4', '6', '8', '10']; const token_limits = new Map([