Merge pull request #24 from Mindires/main

Create Chinese translation
This commit is contained in:
Muhammed Nazeem 2024-03-27 19:34:44 +05:30 committed by GitHub
commit 65774fe844
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 325 additions and 1 deletions

View File

@ -0,0 +1,52 @@
{
"pageAssist": "Page Assist",
"selectAModel": "选择一个模型",
"save": "保存",
"saved": "已保存",
"cancel": "取消",
"retry": "重试",
"share": {
"tooltip": {
"share": "分享"
},
"modal": {
"title": "为聊天创建分享链接"
},
"form": {
"defaultValue": {
"name": "匿名",
"title": "未命名聊天"
},
"title": {
"label": "聊天标题",
"placeholder": "输入聊天标题",
"required": "聊天标题是必填的"
},
"name": {
"label": "您的名字",
"placeholder": "输入您的名字",
"required": "您的名字是必填的"
},
"btn": {
"save": "生成链接",
"saving": "正在生成链接..."
}
},
"notification": {
"successGenerate": "链接已复制到剪贴板",
"failGenerate": "生成链接失败"
}
},
"copyToClipboard": "复制到剪贴板",
"webSearch": "搜索网络",
"regenerate": "重新生成",
"edit": "编辑",
"saveAndSubmit": "保存 & 提交",
"editMessage": {
"placeholder": "输入一条消息..."
},
"submit": "提交",
"noData": "无数据",
"noHistory": "无聊天记录",
"chatWithCurrentPage": "与当前页面聊天"
}

View File

@ -0,0 +1,12 @@
{
"newChat": "新聊天",
"selectAPrompt": "选择一个提示词",
"githubRepository": "GitHub 仓库",
"settings": "设置",
"sidebarTitle": "聊天历史",
"error": "错误",
"somethingWentWrong": "出现了错误",
"validationSelectModel": "请选择一个模型以继续",
"deleteHistoryConfirmation": "你确定要删除这个历史记录吗?",
"editHistoryTitle": "输入一个新的标题"
}

View File

@ -0,0 +1,27 @@
{
"ollamaState": {
"searching": "正在搜索您的Ollama 🦙",
"running": "Ollama正在运行 🦙",
"notRunning": "无法连接到Ollama 🦙"
},
"formError": {
"noModel": "请选择一个模型",
"noEmbeddingModel": "请在设置>Ollama页面设置一个文本嵌入模型"
},
"form": {
"textarea": {
"placeholder": "输入一条消息..."
},
"webSearch": {
"on": "开",
"off": "关"
}
},
"tooltip": {
"searchInternet": "搜索互联网",
"speechToText": "语音到文本",
"uploadImage": "上传图片",
"stopStreaming": "停止流媒体"
},
"sendWhenEnter": "按Enter发送"
}

View File

@ -0,0 +1,208 @@
{
"generalSettings": {
"title": "一般设置",
"heading": "Web UI 设置",
"settings": {
"speechRecognitionLang": {
"label": "语音识别语言",
"placeholder": "选择一种语言"
},
"language": {
"label": "语言",
"placeholder": "选择一种语言"
},
"darkMode": {
"label": "更改主题",
"options": {
"light": "亮色",
"dark": "暗色"
}
},
"searchMode": {
"label": "使用简化的互联网搜索"
},
"deleteChatHistory": {
"label": "删除聊天历史记录",
"button": "删除",
"confirm": "您确定要删除聊天历史记录吗?这个操作不能撤销。"
}
}
},
"manageModels": {
"title": "管理模型",
"addBtn": "添加新模型",
"columns": {
"name": "名称",
"digest": "摘要",
"modifiedAt": "修改时间",
"size": "大小",
"actions": "操作"
},
"expandedColumns": {
"parentModel": "父模型",
"format": "格式",
"family": "家族",
"parameterSize": "参数大小",
"quantizationLevel": "量化级别"
},
"tooltip": {
"delete": "删除模型",
"repull": "重新拉取模型"
},
"confirm": {
"delete": "您确定要删除此模型吗?",
"repull": "您确定要重新拉取此模型吗?"
},
"modal": {
"title": "添加新模型",
"placeholder": "输入模型名称",
"pull": "拉取模型"
},
"notification": {
"pullModel": "正在拉取模型",
"pullModelDescription": "正在拉取 {{modelName}} ,请查看扩展图标。",
"success": "成功",
"error": "错误",
"successDescription": "成功拉取了模型",
"successDeleteDescription": "成功删除了模型",
"someError": "出现了问题。请稍后再试。"
}
},
"managePrompts": {
"title": "管理提示词",
"addBtn": "添加新提示词",
"option1": "普通",
"option2": "RAG",
"questionPrompt": "问题提示词",
"columns": {
"title": "标题",
"prompt": "提示词",
"type": "提示词类型",
"actions": "操作"
},
"systemPrompt": "系统提示词",
"quickPrompt": "快速提示词",
"tooltip": {
"delete": "删除提示词",
"edit": "编辑提示词"
},
"confirm": {
"delete": "您确定要删除此提示词吗?这个操作不能撤销。"
},
"modal": {
"addTitle": "添加新提示词",
"editTitle": "编辑提示词"
},
"form": {
"title": {
"label": "标题",
"placeholder": "我厉害的提示词",
"required": "请输入标题",
"help": "您可以在提示词中使用 {key} 作为变量。"
},
"prompt": {
"label": "提示词",
"placeholder": "输入提示词",
"required": "请输入提示词",
"help": "您可以在提示词中使用 {key} 作为变量。"
},
"isSystem": {
"label": "是否为系统提示词"
},
"btnSave": {
"saving": "添加提示词中...",
"save": "添加提示词"
},
"btnEdit": {
"saving": "更新提示词中...",
"save": "更新提示词"
}
},
"notification": {
"addSuccess": "提示词已添加",
"addSuccessDesc": "提示词已成功添加",
"error": "错误",
"someError": "出现了问题。请稍后再试。",
"updatedSuccess": "提示词已更新",
"updatedSuccessDesc": "提示词已成功更新",
"deletedSuccess": "提示词已删除",
"deletedSuccessDesc": "提示词已成功删除"
}
},
"manageShare": {
"title": "管理共享",
"heading": "配置对话共享服务 URL",
"form": {
"url": {
"label": "对话共享服务 URL",
"placeholder": "输入对话共享服务 URL",
"required": "请输入您的对话共享服务 URL",
"help": "出于隐私原因,您可以自行托管对话共享服务并在此处提供 URL<anchor>了解更多</anchor>。"
}
},
"webshare": {
"heading": "对话共享",
"columns": {
"title": "标题",
"url": "URL",
"actions": "操作"
},
"tooltip": {
"delete": "删除对话共享"
},
"confirm": {
"delete": "您确定要删除此对话共享吗?这个操作不能撤销。"
}
},
"notification": {
"pageShareSuccess": "对话共享服务 URL 已成功更新",
"someError": "出现了问题。请稍后再试。",
"webShareDeleteSuccess": "对话共享已成功删除"
}
},
"ollamaSettings": {
"title": "Ollama 设置",
"heading": "配置 Ollama",
"settings": {
"ollamaUrl": {
"label": "Ollama URL",
"placeholder": "输入 Ollama URL"
},
"ragSettings": {
"label": "RAG 设置",
"model": {
"label": "文本嵌入模型",
"required": "请选择一个模型",
"help": "建议使用文本嵌入模型,如 `nomic-embed-text`。",
"placeholder": "选择一个模型"
},
"chunkSize": {
"label": "嵌入大小",
"placeholder": "1024-∞",
"required": "请输入块大小"
},
"chunkOverlap": {
"label": "嵌入重叠",
"placeholder": "256-∞",
"required": "请输入嵌入重叠"
}
},
"prompt": {
"label": "配置 RAG 提示词",
"option1": "普通",
"option2": "搜索",
"alert": "在此配置系统提示词已过时。请使用管理提示词部分添加或编辑提示词。此部分将在未来版本中删除",
"systemPrompt": "系统提示词",
"systemPromptPlaceholder": "输入系统提示词",
"webSearchPrompt": "网页搜索提示词",
"webSearchPromptHelp": "请勿从提示词中删除 `{search_results}`。",
"webSearchPromptError": "请输入一个网页搜索提示词",
"webSearchPromptPlaceholder": "输入网页搜索提示词",
"webSearchFollowUpPrompt": "网页搜索追问提示词",
"webSearchFollowUpPromptHelp": "请勿从提示词中删除 `{chat_history}` 和 `{question}`。",
"webSearchFollowUpPromptError": "请输入您的网页搜索追问提示词!",
"webSearchFollowUpPromptPlaceholder": "您的网页搜索追问提示词"
}
}
}
}

View File

@ -0,0 +1,5 @@
{
"tooltip": {
"embed": "可能需要几分钟才能嵌入搜索结果。请稍候..."
}
}

View File

@ -2,13 +2,15 @@ import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import { en } from "./lang/en";
import { ml } from "./lang/ml";
import { zh } from "./lang/zh";
i18n
.use(initReactI18next)
.init({
resources: {
en: en,
ml: ml
ml: ml,
zh: zh
},
fallbackLng: "en",
lng: localStorage.getItem("i18nextLng") || "en",

14
src/i18n/lang/zh.ts Normal file
View File

@ -0,0 +1,14 @@
import option from "@/assets/locale/zh/option.json";
import playground from "@/assets/locale/zh/playground.json";
import common from "@/assets/locale/zh/common.json";
import sidepanel from "@/assets/locale/zh/sidepanel.json";
import settings from "@/assets/locale/zh/settings.json";
export const zh = {
option,
playground,
common,
sidepanel,
settings
}

View File

@ -8,4 +8,8 @@ export const supportLanguage = [
label: "മലയാളം",
value: "ml"
}
{
label: "Chinese",
value: "zh"
}
]