feat: add n18n

This commit is contained in:
qixinbo
2026-03-21 21:26:57 +08:00
parent 40f84fc98e
commit 5ab9884bf6
22 changed files with 823 additions and 273 deletions
+22
View File
@@ -0,0 +1,22 @@
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import LanguageDetector from 'i18next-browser-languagedetector';
import en from './locales/en.json';
import zh from './locales/zh.json';
i18n
.use(LanguageDetector)
.use(initReactI18next)
.init({
resources: {
en: { translation: en },
zh: { translation: zh }
},
fallbackLng: 'zh',
interpolation: {
escapeValue: false // React already escapes by default
}
});
export default i18n;
+208
View File
@@ -0,0 +1,208 @@
{
"selectAllOrCancel": "Select All / Cancel",
"invertSelection": "Invert Selection",
"batchDelete": "Batch Delete",
"cancel": "Cancel",
"rename": "Rename",
"pin": "Pin",
"unpin": "Unpin",
"archive": "Archive",
"unarchive": "Unarchive",
"deleteSession": "Delete Session",
"confirmDeleteSession": "Are you sure you want to delete this session?",
"confirmBatchDeleteSessions": "Are you sure you want to delete the selected {{count}} sessions?",
"filterSessionName": "Filter session name",
"renameSession": "Rename Session",
"enterNewSessionTitle": "Enter new session title",
"save": "Save",
"lobsterDataQA": "DataClaw",
"skillCenter": "Skill Center",
"projectManagement": "Project Management",
"dataSourceManagement": "Data Sources",
"personalSettings": "Settings",
"modelConfig": "Model Config",
"userManagement": "Users",
"logout": "Logout",
"searchModel": "Search model...",
"modelNotFound": "Model not found",
"availableModels": "Available Models",
"dataSource": "Data Source",
"clearSelected": "Clear Selected",
"clearSelectedWithCount": "Clear Selected ({{count}})",
"noAvailableSkills": "No available skills",
"askAnything": "Ask anything...",
"dataClawDisclaimer": "DataClaw can make mistakes. Consider verifying important information.",
"processing": "Processing...",
"processCompleted": "Completed",
"thinkingProcess": "Thinking Process",
"modelThinking": "Model is thinking, please wait...",
"openReportInNewTab": "Open report in new tab",
"outputInterrupted": "Output interrupted",
"requestSubmittedRouting": "Request submitted, preparing to route...",
"routingInfo": "Routing: {{selected}} {{reason}}",
"sqlAnalysis": "SQL Analysis",
"generalConversation": "General Conversation",
"answerGenerationCompleted": "Answer generation completed",
"noReply": "No reply",
"chartGenerationCompleted": "Chart generation completed",
"dataQueryCompleted": "Data query completed",
"streamResponseFailed": "Stream response failed",
"streamResponseError": "Stream response error",
"userUploadedFile": "User uploaded file",
"fileContentSummary": "File content summary",
"none": "None",
"dataColumns": "Data columns",
"fileDownloadLink": "File download link",
"spreadsheet": "Spreadsheet",
"name": "Name",
"myDataSource": "My Data Source",
"type": "Type",
"uploadFileOrEnterPath": "Upload file or enter server path",
"unsupportedDataSourceType": "Unsupported data source type",
"dataSourceConnectorInDevelopment": "This data source connector is under development. Please try PostgreSQL, ClickHouse, or file upload.",
"testConnection": "Test Connection",
"uploadFailed": "Upload failed",
"connectionSuccess": "Connection successful",
"connectionFailed": "Connection failed",
"orUseSupabaseConnectionString": "Or use the Connection String (URI) provided by Supabase console:",
"orUseConnectionString": "Or use connection string (overrides above settings):",
"fileUpload": "File Upload",
"noDescription": "No description",
"confirmAddToDashboard": "Confirm Add to Dashboard",
"confirmAddChartToDashboardDesc": "Add the current chart to Dashboard, continue?",
"confirmAdd": "Confirm Add",
"visualizationResult": "Visualization Result",
"sqlQueryDescription": "The data query statement used to generate the current chart.",
"copied": "Copied",
"copy": "Copy",
"resultNotSuitableForChart": "This result is not suitable for chart display.",
"noStructuredDataToRender": "No structured data to render in the current result.",
"pageRenderFailed": "Page render failed",
"chinese": "Chinese",
"chartIntentPattern": "(图表|可视化|画图|作图|柱状图|折线图|饼图|趋势|分布|chart|plot|visuali[sz]e)",
"processingIndicator": "正在",
"confirmDeleteDataSource": "Are you sure you want to delete this data source?",
"saveFailed": "Save failed: ",
"editDataSource": "Edit Data Source",
"createNewDataSourceWithType": "Create {{type}} Data Source",
"editDataSourceWithType": "Edit {{type}} Data Source",
"backToList": "Back to List",
"dataSourceConfig": "Data Source Configuration",
"manageDataSourceConnections": "Manage data source connections for Q&A",
"newDataSource": "New Data Source",
"noDataSources": "No data sources",
"clickTopRightToAddFirstDataSource": "Click the button on the top right to add your first data source",
"newProject": "New Project",
"projectList": "Project List",
"manageProjectsDesc": "Manage your projects, different projects have independent data sources",
"loading": "Loading...",
"noProjectsCreateOne": "No projects, please create one first",
"description": "Description",
"createdAt": "Created At",
"actions": "Actions",
"manageDataSources": "Manage Data Sources",
"editProject": "Edit Project",
"deleteProject": "Delete Project",
"enterProjectName": "Enter project name",
"descriptionOptional": "Description (Optional)",
"enterProjectDescription": "Enter project description",
"creating": "Creating...",
"create": "Create",
"saving": "Saving...",
"confirmDeleteProject": "Are you sure you want to delete this project? All associated data sources will be deleted.",
"selectProjectToViewDashboard": "Please select a project to view the dashboard.",
"noChartsInCurrentProject": "No charts in the current project.",
"goToChatToAddCharts": "Go to the chat page and add visualization results!",
"currentTableNoData": "Current table has no data to display",
"currentTableMissingFields": "Current table data is missing fields to display",
"previewTableRows": "Preview first {{previewLimit}} rows / Total {{rowCount}} rows, {{colCount}} columns",
"totalTableRows": "Total {{rowCount}} rows, {{colCount}} columns",
"currentChartMissingFields": "Current chart data is missing fields to plot",
"passwordsDoNotMatch": "The two passwords entered do not match",
"personalSettingsSaved": "Personal settings saved successfully!",
"personalSettingsAndPasswordSaved": "Personal settings and password modified successfully!",
"failedToSaveSettings": "Failed to save settings",
"accountInfo": "Account Information",
"modifyLoginEmailAndPassword": "Modify your login email and password",
"username": "Username",
"usernameCannotBeModified": "Username cannot be modified",
"emailAddress": "Email Address",
"newPassword": "New Password",
"leaveBlankIfNotModifying": "Leave blank if not modifying",
"confirmNewPassword": "Confirm New Password",
"saveSettings": "Save Settings",
"confirmDeleteUser": "Are you sure you want to delete this user?",
"newUserMustHavePassword": "New users must have a password",
"anErrorOccurred": "An error occurred",
"addUser": "Add User",
"editUser": "Edit User",
"addNewUser": "Add New User",
"email": "Email",
"password": "Password",
"activeStatus": "Active Status",
"adminPrivileges": "Admin Privileges",
"id": "ID",
"status": "Status",
"role": "Role",
"noUserData": "No user data",
"normal": "Normal",
"disabled": "Disabled",
"admin": "Admin",
"regularUser": "Regular User",
"fillRequiredInfoFirst": "Please fill in required information first (Provider, Model ID)",
"extraConfigMustBeValidJson": "Extra config must be valid JSON",
"connectionTestSuccessful": "Connection test successful!",
"connectionTestFailed": "Connection test failed",
"fillRequiredFields": "Please fill in required fields",
"failedToSaveConfig": "Failed to save config",
"confirmDeleteModel": "Are you sure you want to delete this model?",
"noPermissionAdminOnly": "No permission to access this page, please log in with an admin account.",
"addModel": "Add Model",
"modelName": "Model Name",
"provider": "Provider",
"modelIdentifier": "Model Identifier",
"noModelData": "No model data",
"currentDefaultModel": "Current default model",
"clickToSetDefault": "Click to set as default",
"default": "Default",
"setDefault": "Set as Default",
"editModel": "Edit Model",
"providerRequired": "Provider *",
"egGpt4": "e.g., GPT-4",
"modelIdRequired": "Model ID *",
"egGpt4Turbo": "e.g., gpt-4-turbo",
"apiDomain": "API Domain",
"egApiDomain": "e.g., https://api.openai.com/v1",
"extraConfigJson": "Extra Config (JSON)",
"unknownError": "Unknown error",
"confirmDeleteSkill": "Are you sure you want to delete this skill?",
"selectProjectToManageSkills": "Please select a project at the top first to manage its skills",
"skillsRepository": "Skills Repository - {{project}}",
"manageAiSkillsDesc": "Manage AI skills and tools for this project, supports file uploads conforming to the agentskills.io standard",
"uploadSkill": "Upload Skill",
"source": "Source",
"installationTime": "Installation Time",
"noSkillsInProjectClickImport": "No skills in this project yet, click \"Upload Skill\" to start",
"viewOrEditSkill": "View/Edit Skill",
"addNewSkill": "Add New Skill",
"skillName": "Skill Name",
"selectType": "Select Type",
"selectStatus": "Select Status",
"brieflyDescribeSkillFunction": "Briefly describe the function of the skill...",
"content": "Content",
"pythonSqlApiContentPlaceholder": "Python code, SQL query template or API specification...",
"saveSkill": "Save Skill",
"safe": "Safe",
"lowRisk": "Low Risk",
"localImport": "Local Import",
"zhipuAi": "ZhipuAI",
"dashScope": "DashScope",
"volcengine": "Volcengine",
"tableRowColDesc": "TABLE · {{rowCount}} rows · {{colCount}} columns",
"projectName": "Project Name",
"dashboardMenu": "Dashboard",
"newThread": "New Thread",
"threads": "THREADS",
"archivedThreads": "ARCHIVED THREADS",
"defaultUser": "User"
}
+208
View File
@@ -0,0 +1,208 @@
{
"selectAllOrCancel": "全选/取消全选",
"invertSelection": "反选",
"batchDelete": "批量删除",
"cancel": "取消",
"rename": "重命名",
"pin": "置顶",
"unpin": "取消置顶",
"archive": "归档",
"unarchive": "取消归档",
"deleteSession": "删除会话",
"confirmDeleteSession": "确定要删除这个会话吗?",
"confirmBatchDeleteSessions": "确定要删除选中的 {{count}} 个会话吗?",
"filterSessionName": "过滤会话名称",
"renameSession": "重命名会话",
"enterNewSessionTitle": "输入新的会话标题",
"save": "保存",
"lobsterDataQA": "龙虾问数",
"skillCenter": "技能中心",
"projectManagement": "项目管理",
"dataSourceManagement": "数据源管理",
"personalSettings": "个人设置",
"modelConfig": "模型配置",
"userManagement": "用户管理",
"logout": "退出登录",
"searchModel": "搜索模型...",
"modelNotFound": "未找到模型",
"availableModels": "可用模型",
"dataSource": "数据源",
"clearSelected": "清除已选",
"clearSelectedWithCount": "清除已选 ({{count}})",
"noAvailableSkills": "暂无可用技能",
"askAnything": "有问题,尽管问",
"dataClawDisclaimer": "DataClaw 可能会出错。请核查重要信息。",
"processing": "正在处理中",
"processCompleted": "处理完成",
"thinkingProcess": "思考过程",
"modelThinking": "模型思考中,请稍候...",
"openReportInNewTab": "在新标签页中打开分析报告",
"outputInterrupted": "已中断输出",
"requestSubmittedRouting": "请求已提交,准备路由...",
"routingInfo": "路由:{{selected}}{{reason}}",
"sqlAnalysis": "SQL 分析",
"generalConversation": "通用对话",
"answerGenerationCompleted": "回答生成完成",
"noReply": "暂无回复",
"chartGenerationCompleted": "图表生成完成",
"dataQueryCompleted": "数据查询完成",
"streamResponseFailed": "流式响应失败",
"streamResponseError": "流式响应错误",
"userUploadedFile": "用户上传了文件",
"fileContentSummary": "文件内容摘要",
"none": "无",
"dataColumns": "数据列",
"fileDownloadLink": "文件下载链接",
"spreadsheet": "电子表格",
"name": "名称",
"myDataSource": "我的数据源",
"type": "类型",
"uploadFileOrEnterPath": "上传文件或输入服务器路径",
"unsupportedDataSourceType": "暂不支持该数据源类型",
"dataSourceConnectorInDevelopment": "该数据源连接器正在开发中。请尝试使用 PostgreSQL, ClickHouse 或文件上传。",
"testConnection": "测试连接",
"uploadFailed": "上传失败",
"connectionSuccess": "连接成功",
"connectionFailed": "连接失败",
"orUseSupabaseConnectionString": "或者直接使用 Supabase 控制台提供的 Connection String (URI):",
"orUseConnectionString": "或者使用连接字符串 (覆盖上述设置):",
"fileUpload": "文件上传",
"noDescription": "无描述",
"confirmAddToDashboard": "确认加入 Dashboard",
"confirmAddChartToDashboardDesc": "将当前图表添加到 Dashboard,是否继续?",
"confirmAdd": "确认添加",
"visualizationResult": "可视化结果",
"sqlQueryDescription": "用于生成当前图表的数据查询语句。",
"copied": "已复制",
"copy": "复制",
"resultNotSuitableForChart": "本次结果不适合图表展示。",
"noStructuredDataToRender": "当前结果没有可渲染的结构化数据。",
"pageRenderFailed": "页面渲染失败",
"chinese": "中文",
"chartIntentPattern": "(图表|可视化|画图|作图|柱状图|折线图|饼图|趋势|分布|chart|plot|visuali[sz]e)",
"processingIndicator": "正在",
"confirmDeleteDataSource": "确定要删除这个数据源吗?",
"saveFailed": "保存失败: ",
"editDataSource": "编辑数据源",
"createNewDataSourceWithType": "新建 {{type}} 数据源",
"editDataSourceWithType": "编辑 {{type}} 数据源",
"backToList": "返回列表",
"dataSourceConfig": "数据源配置",
"manageDataSourceConnections": "管理可用于问答的数据源连接",
"newDataSource": "新建数据源",
"noDataSources": "暂无数据源",
"clickTopRightToAddFirstDataSource": "点击右上角按钮添加第一个数据源",
"newProject": "新建项目",
"projectList": "项目列表",
"manageProjectsDesc": "管理您的项目,不同项目拥有独立的数据源",
"loading": "加载中...",
"noProjectsCreateOne": "暂无项目,请先创建一个",
"description": "描述",
"createdAt": "创建时间",
"actions": "操作",
"manageDataSources": "管理数据源",
"editProject": "编辑项目",
"deleteProject": "删除项目",
"enterProjectName": "输入项目名称",
"descriptionOptional": "描述 (可选)",
"enterProjectDescription": "输入项目描述",
"creating": "创建中...",
"create": "创建",
"saving": "保存中...",
"confirmDeleteProject": "确定要删除这个项目吗?所有相关的数据源都将被删除。",
"selectProjectToViewDashboard": "请选择一个项目以查看仪表板。",
"noChartsInCurrentProject": "当前项目暂无图表。",
"goToChatToAddCharts": "前往对话页并添加可视化结果!",
"currentTableNoData": "当前表格没有可展示数据",
"currentTableMissingFields": "当前表格数据缺少可展示字段",
"previewTableRows": "预览前 {{previewLimit}} 行 / 共 {{rowCount}} 行,{{colCount}} 列",
"totalTableRows": "共 {{rowCount}} 行,{{colCount}} 列",
"currentChartMissingFields": "当前图表数据缺少可绘制字段",
"passwordsDoNotMatch": "两次输入的密码不一致",
"personalSettingsSaved": "个人设置保存成功!",
"personalSettingsAndPasswordSaved": "个人设置及密码修改成功!",
"failedToSaveSettings": "保存设置失败",
"accountInfo": "账号信息",
"modifyLoginEmailAndPassword": "修改您的登录邮箱和密码",
"username": "用户名",
"usernameCannotBeModified": "用户名不可修改",
"emailAddress": "邮箱地址",
"newPassword": "新密码",
"leaveBlankIfNotModifying": "如不修改请留空",
"confirmNewPassword": "确认新密码",
"saveSettings": "保存设置",
"confirmDeleteUser": "确认删除该用户吗?",
"newUserMustHavePassword": "新建用户必须填写密码",
"anErrorOccurred": "发生错误",
"addUser": "添加用户",
"editUser": "编辑用户",
"addNewUser": "添加新用户",
"email": "邮箱",
"password": "密码",
"activeStatus": "激活状态",
"adminPrivileges": "管理员权限",
"id": "ID",
"status": "状态",
"role": "角色",
"noUserData": "暂无用户数据",
"normal": "正常",
"disabled": "禁用",
"admin": "管理员",
"regularUser": "普通用户",
"fillRequiredInfoFirst": "请先填写必要信息(供应商、模型ID)",
"extraConfigMustBeValidJson": "额外配置必须是有效的JSON",
"connectionTestSuccessful": "连接测试成功!",
"connectionTestFailed": "连接测试失败",
"fillRequiredFields": "请填写必填项",
"failedToSaveConfig": "保存配置失败",
"confirmDeleteModel": "确认删除该模型吗?",
"noPermissionAdminOnly": "无权限访问此页面,请使用管理员账号登录。",
"addModel": "添加模型",
"modelName": "模型名称",
"provider": "供应商",
"modelIdentifier": "模型标识",
"noModelData": "暂无模型数据",
"currentDefaultModel": "当前默认模型",
"clickToSetDefault": "点击设为默认",
"default": "默认",
"setDefault": "设为默认",
"editModel": "编辑模型",
"providerRequired": "供应商 *",
"egGpt4": "如:GPT-4",
"modelIdRequired": "模型ID *",
"egGpt4Turbo": "如:gpt-4-turbo",
"apiDomain": "API 域名",
"egApiDomain": "如:https://api.openai.com/v1",
"extraConfigJson": "额外配置 (JSON)",
"unknownError": "未知错误",
"confirmDeleteSkill": "确定要删除这个技能吗?",
"selectProjectToManageSkills": "请先在顶部选择一个项目以管理其技能",
"skillsRepository": "Skills 仓库 - {{project}}",
"manageAiSkillsDesc": "管理该项目的 AI 技能和工具,支持符合 agentskills.io 标准的文件上传",
"uploadSkill": "上传 Skill",
"source": "来源",
"installationTime": "安装时间",
"noSkillsInProjectClickImport": "该项目尚无技能,点击“导入 Skill”开始",
"viewOrEditSkill": "查看/编辑技能",
"addNewSkill": "添加新技能",
"skillName": "技能名称",
"selectType": "选择类型",
"selectStatus": "选择状态",
"brieflyDescribeSkillFunction": "简要描述技能的功能...",
"content": "内容",
"pythonSqlApiContentPlaceholder": "Python 代码、SQL 查询模板或 API 规范...",
"saveSkill": "保存技能",
"safe": "安全",
"lowRisk": "低风险",
"localImport": "本地导入",
"zhipuAi": "ZhipuAI (智谱)",
"dashScope": "DashScope (通义千问)",
"volcengine": "Volcengine (火山引擎)",
"tableRowColDesc": "TABLE · {{rowCount}} 行 · {{colCount}} 列",
"projectName": "项目名称",
"dashboardMenu": "仪表盘",
"newThread": "新会话",
"threads": "会话",
"archivedThreads": "已归档会话",
"defaultUser": "用户"
}