feat: add English interface localization and fix preview crashes

This commit is contained in:
ji ruo committed 2026-11-10 20:03:14 +08:00
1 parent a05a886d3d
commit 9ccaa81497
163 files changed
+17100 -6944

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
# 界面国际化逐页检查
更新:2026-11-10。范围:固定界面文字、标签、辅助说明、校验和日期显示。AI 提示词/输出、报告正文、用户数据、命令与请求响应保留原文。
**浏览器实际点击:全部待验收。** 当前工具禁止本地浏览器使用;指定内置浏览器同样返回禁用。以下“通过”仅指真实 React 组件在 Node 中的自动渲染,不代表浏览器布局、点击或数据加载后已验证。
| 页面 | 固定 UI 代码迁移 | 英文初始渲染及中英切换 | 实际点击 |
| --- | --- | --- | --- |
| 仪表盘 `/dashboard` | 已接入 | 通过 | 待验收 |
| 对话 `/chat` | 已接入 | 通过 | 待验收 |
| 任务 `/function/tasks` | 已接入 | 通过 | 待验收 |
| 任务详情 `/function/tasks/detail` | 已接入 | 初始加载态通过;11 个子标签独立渲染通过;含情报空列表和带数据列表 | 待验收 |
| 计划任务 `/function/schedules` | 已接入 | 通过 | 待验收 |
| 发现 `/function/findings` | 已接入 | 通过;含带数据的表格单独检查 | 待验收 |
| 发现详情 `/function/findings/detail` | 已接入 | 初始加载态通过 | 待验收 |
| 归并详情 `/function/findings/case` | 已接入 | 初始加载态通过 | 待验收 |
| 流量 `/function/traffic` | 已接入 | 通过 | 待验收 |
| 请求重发 `/function/repeater` | 已接入 | 初始加载态、保存草稿及导航单独渲染通过 | 待验收 |
| 工具执行 `/function/commands` | 已接入 | 通过 | 待验收 |
| LLM 录制 `/function/llm-records` | 已接入 | 通过 | 待验收 |
| 资产 `/function/assets` | 已接入 | 通过 | 待验收 |
| 资产同步 `/function/sync` | 已接入 | 通过 | 待验收 |
| 工作空间 `/function/workspace` | 已接入 | 通过 | 待验收 |
| LLM `/system/llm` | 已接入 | 通过 | 待验收 |
| Agent `/system/agents` | 已接入 | 通过 | 待验收 |
| Agent 详情 `/system/agents/detail` | 已接入 | 通过 | 待验收 |
| MCP `/system/mcp` | 已接入 | 通过 | 待验收 |
| Skill `/system/skills` | 已接入 | 通过 | 待验收 |
| 工具 `/system/tools` | 已接入 | 通过 | 待验收 |
| 命令拦截 `/system/intercept` | 已接入 | 通过 | 待验收 |
| 审批记录 `/system/intercept/approvals` | 已接入 | 通过;含旁路快捷问题中英文及原始问题提交检查 | 待验收 |
| 资产拦截 `/system/intercept/assets` | 已接入 | 通过 | 待验收 |
| 日志 `/system/logs` | 已接入 | 通过 | 待验收 |
| 通知 `/system/notify` | 已接入 | 通过 | 待验收 |
| 设置 `/system/settings` | 已接入 | 通过 | 待验收 |
任务详情子标签:会话、总览、探索图、播报、发现、复测、测试资产、资产覆盖图、拦截审批、报告、情报。情报复用共享 IntelligencePanel;已补充演示接口真实响应、注入加载后状态的列表渲染及异常响应提示检查。这些检查不代表浏览器实际点击。
资产覆盖图另有生命周期回归检查:使用真实组件的 effect/回调和模拟 G6 事件,覆盖视口初始化事件早于首次渲染、动态加载时离开、首次渲染前离开,以及居中/复位过程中离开。只在当前实例完成首次渲染后读取视口;退出时先解绑事件并清空引用。这些检查不包含真实画布的视觉或交互验收。
自动渲染检查发现并修复的遗漏:发现主页面、任务内发现、任务内复测的严重度选项仍从中文常量显示;日期辅助函数固定中文;探索图边文字在切换后缓存;Repeater 默认分组保留中文;内置 Agent 默认名称中文。原始数据不因此改写。
剩余验收:逐个导航、筛选、打开详情、展开行、各新增/编辑/导出/删除确认弹窗,刷新后的语言记忆、窄屏及长英文;需要浏览器操作可用。后端业务错误/系统事件、CSV/Markdown 导出固定列名和默认推送正文另需补齐。日志正文保持原始记录,当前只翻译日志界面控件。
+51
View File
@@ -0,0 +1,51 @@
# 英文国际化:接入进度
采用 i18next + react-i18next,保留 Next 静态导出及现有 URL。Go 服务继续提供同一份静态文件。
范围更新(2026-11-10):按用户要求,AI 输出和提示词不纳入国际化。继续处理界面、非 AI 系统文案、内置展示说明、导出固定文案与通知;不修改模型输出正文和提示词。
## 已接入
- 登录、初始化、使用须知、账户操作、侧栏导航、页面搜索、主题与布局控件。
- 登录前及全局顶栏右上角的语言选择;浏览器记忆选择、跨标签页同步、网页 lang/title/description 更新。
- 通用状态、分页、日期/时间控件及部分基础组件的辅助文案。
- 九类 `@` 引用的中英文搜索别名与显示名称。新文本使用 `@[finding#123 名称]` 等稳定 kind;前后端继续识别历史中文格式。
- 认证及 HTTP Basic Auth 接口增加 `code`/`params`,保留旧 `error` 字段;前端保留原错误消息作为未知错误码的回退。
- 系统设置各分类及搜索、版本与更新、访问验证、代理池、出口 IP、运行时开关、快捷键等固定界面文案;设置搜索同时接受中英文。代理出口提醒增加结构化码,兼容旧提醒字符串。
- 仪表盘固定标题、图例、统计标签、空态与相对时间;对话列表、创建/删除/重命名/置顶、输入区、附件操作、执行记录的固定标签、旁路问答、Todo 面板与审批定位提示。
- 计划任务页的列表、创建/编辑表单、日期/时区、运行时间线、批量操作,以及名称/备注编辑器;已知后端提示和已保存历史系统文案在展示时按语言转换。
- 任务列表、创建任务、分类管理、并发设置、归档/还原/删除确认、任务模板控件、LLM 配置链和任务级资产规则编辑器。AI 描述、目标、模板正文和上传清单协议保持原文。
- 通知推送页的六类渠道表单、全局设置、过滤条件摘要、投递列表、状态与时间、常见校验错误及演示模式提示;Webhook 模板语法和第三方响应保留原文。
- 数量文案的英文单复数;切换语言时设置表单不重新加载,已展开的执行记录按新语言显示标签,原始命令与输出保持原文。
中文是默认语言。静态 HTML 和首次客户端渲染使用中文,挂载后读取 `localStorage.artex_locale`。保存过英文偏好的用户在刷新时可能短暂看到中文。
## 页面覆盖(2026-11-10 本轮)
27 个主页面入口及任务详情 11 个标签页(含情报)已接入固定 UI 文案,详见 [逐页验收清单](./PAGE-AUDIT.md)。发现列表的四种视图、发现详情/归并详情、复测、证据、导出选项;资产、流量、请求重发、工具执行、LLM 录制、同步、工作空间;Agent/MCP/Skill/工具/LLM 编辑器、命令/资产拦截、审批记录和系统日志的界面标签也已迁移。
补充约 2,000 条成对界面资源 `screen-catalog.json`。`useUITranslation()` 的 `ui` 随渲染语言更新,`liveUI` 用于稳定的轮询/请求回调。日期显示、探索图边标签、资产图文字、内置 Agent 默认名称及说明也随语言更新。用户编辑的 Agent 名称/说明保持原文。
已知固定校验错误与 Repeater 默认分组仅在展示边界转换,不翻译请求正文和协议。后台返回的其他系统事件、业务错误、导出文件固定标题/列名和默认通知正文仍需继续覆盖,不能据此宣称全站国际化完成。
浏览器操作工具两次返回 `Local browser use is disabled in Work settings`(包括指定内置浏览器)。因此本轮实际逐页点击、打开全部弹窗、数据加载后的全量验收、窄屏和长英文布局均未完成。自动渲染测试检查初始页面、任务标签、带数据的漏洞表格和 Repeater;不能替代实际浏览器验收。
## 后续开发约定
- 在 `messages.ts`(或其拆分模块)同时登记中英文。组件内调用 `useTranslation()` 或 `useLiveTranslation()` 的 `t`,动态派生导航、状态和选项,避免模块级缓存译文。`t` 保留随语言变化的函数身份以兼容 React Compiler;仅生命周期回调使用稳定的 `liveT`,避免语言变化引起表单数据重载。
- 对象 ID、枚举、API 字段、工具 key、DSL 与引用 kind 保持稳定。用户名称、备注、自定义模板、历史报告、请求响应和原始命令输出保持原文。
- 使用 `useDateLocale()` 处理展示日期;存储日期、API 格式和时区语义保持原样。数量文案使用 `count` 和复数资源。
- 审批解释在 `intercept/prompt.go` 仍按中文固定短语解析,按现有协议保留提示词与解析行为;只翻译界面上的固定标签。`[模型]`、人工审批来源、默认“新对话”和“超过”截断判断等历史约定在迁移展示文案时仍需保留兼容。执行记录已用稳定的 `command`/`output` 类型替代 `label === "命令"` 判断,避免英文标签影响命令提取。
- 界面语言不会改变 AI 输出语言;AI 输出和提示词均在本次范围之外。
## 检查
在 `web` 目录执行 `npm run test:i18n`、`node --test src/lib/api-*.test.cjs`、`npx tsc --noEmit --incremental false`、`npm run build:static`。
在仓库根目录执行 `go test ./server -run 'TestBasicAuth|TestEgress|TestChatMention|TestValidatePassword|TestProductError|TestPasswordValidationCodes' -count=1`。
仍需在浏览器手动检查:登录/设置页切换,导航搜索,刷新与跨标签页记忆,九类引用与旧中文草稿,以及侧栏折叠和移动端布局。当前自动化检查不覆盖这些实际浏览器交互。新增 `screen-pages.test.cjs` 覆盖全部主页面英文初始渲染、中英往返切换、任务详情标签、填充数据的漏洞表格与 Repeater、固定文案资源存在性和用户内容保留。
2026-11-10 补充检查:已迁移的计划任务、任务列表及通知页面增加硬编码文案和缺失资源键检查;覆盖计划窗口/历史系统消息、任务归档及清理摘要、通知字段与 Webhook 模板语法。浏览器自动化当前不可用,尚未完成实际点击和窄屏视觉验收。
本地演示补充:计划任务支持创建、编辑名称/备注、暂停/启用、删除和时间线;任务创建时附加的计划也会保存。演示任务的别名通过 numeric_id 对应到计划使用的数字编号,避免选择时产生 NaN。演示状态仅保存在当前运行时内存,不执行真实定时任务。
+31
View File
@@ -0,0 +1,31 @@
import catalog from "./screen-catalog.json";
import type { UITranslate } from "./use-ui-translation";
// These are shipped names, not arbitrary Agent names or prompt content. Match
// both the reserved key and the original value so user edits remain untouched.
const shippedNames: Record<string, string[]> = {
goals: ["目标拆解", "目标拆解器"],
planner: ["规划", "规划者"],
mainagent: ["主", "主 Agent"],
worker: ["执行", "Work Agent"],
auto: ["Auto"],
asset_mapper: ["资产梳理"],
pentest: ["渗透测试"],
retester: ["漏洞复测"],
};
export function agentDisplayName(agent: { key: string; name: string }, ui: (key: string) => string): string {
return shippedNames[agent.key]?.includes(agent.name) ? ui(`builtinAgent.${agent.key}.name`) : agent.name;
}
const shippedDescriptions = new Map(
Object.entries(catalog)
.filter(([key]) => key.startsWith("builtinAgentDescription."))
.map(([key, pair]) => [pair[0], key]),
);
export function agentDisplayDescription(agent: { key: string; description?: string }, ui: UITranslate): string {
const text = agent.description ?? "";
const key = shippedNames[agent.key] ? shippedDescriptions.get(text) : undefined;
return key ? ui(key) : text;
}
+102
View File
@@ -0,0 +1,102 @@
// Fixed conversation UI only. Model output and prompts are kept unchanged.
export const chatUIMessages = {
"chatUI.preparing": ["正在准备上下文…", "Preparing context…"],
"chatUI.summarizingHistory": ["正在整理早期旁路问答…", "Summarizing earlier side questions…"],
"chatUI.compressingSnapshot": ["正在压缩旁路上下文副本…", "Compressing the context copy…"],
"chatUI.retrying": ["模型上下文超限,正在缩减后重试…", "Context limit reached. Reducing context and retrying…"],
"chatUI.answering": ["正在回答…", "Answering…"],
"chatUI.status.running": ["回答中", "Answering"],
"chatUI.status.completed": ["已完成", "Completed"],
"chatUI.status.failed": ["失败", "Failed"],
"chatUI.status.cancelled": ["已停止", "Stopped"],
"chatUI.status.interrupted": ["已中断", "Interrupted"],
"chatUI.panel": ["旁路提问面板", "Side question panel"],
"chatUI.clearLabel": ["清空旁路历史", "Clear side question history"],
"chatUI.closePanel": ["关闭旁路面板", "Close side question panel"],
"chatUI.noSnapshot": ["主 Agent 首次运行后即可提问", "Ask a question after the main Agent has run once"],
"chatUI.description": [
"根据当前 Agent 的上下文回答,主任务继续运行。",
"Answers using the current Agent’s context while the main task continues.",
],
"chatUI.historySummary": [" · 含早期问答摘要", " · Includes a summary of earlier questions"],
"chatUI.snapshotSummary": [" · 使用主上下文摘要", " · Uses a summary of the main context"],
"chatUI.questionLabel": ["旁路问题", "Side question"],
"chatUI.questionPlaceholder": ["询问当前上下文…", "Ask about the current context…"],
"chatUI.stopSide": ["停止旁路回答", "Stop side answer"],
"chatUI.sendSide": ["发送旁路问题", "Send side question"],
"chatUI.suggestions": ["快捷问题", "Suggested questions"],
"chatUI.approval.scriptPurpose": ["此脚本的作用是什么?", "What does this script do?"],
"chatUI.approval.scriptChanges": ["脚本会修改哪些文件或数据?", "Which files or data will this script change?"],
"chatUI.approval.decisionReason": ["为什么这次被放行或拦截?", "Why was this execution allowed or blocked?"],
"chatUI.approval.uncertainBehavior": ["脚本中有哪些未确定行为?", "Which script behaviors are uncertain?"],
"chatUI.contextUpdated": ["上下文更新于 {{date}}", "Context updated {{date}}"],
"chatUI.contextTime": ["上下文 {{time}}", "Context {{time}}"],
"chatUI.recentExchanges": ["最近 {{count}} 组问答原文", "{{count}} recent exchanges verbatim"],
"chatUI.recentExchanges_one": ["最近 {{count}} 组问答原文", "{{count}} recent exchange verbatim"],
"chatUI.recentExchanges_other": ["最近 {{count}} 组问答原文", "{{count}} recent exchanges verbatim"],
"chatUI.drawerDescription": ["{{label}} 的独立问答", "Side questions for {{label}}"],
"chatUI.sideQuestion": ["旁路提问", "Side question"],
"chatUI.loadEarlier": ["加载更早的旁路问答", "Load earlier side questions"],
"chatUI.askAnytime": ["随时问一个问题", "Ask a question anytime"],
"chatUI.noTools": ["独立问答 · 无工具执行", "Separate Q&A · No tools run"],
"chatUI.clearTitle": ["清空旁路历史?", "Clear side question history?"],
"chatUI.clearDescription": [
"删除当前 Agent 的旁路问答,并停止正在生成的旁路回答。主会话和上下文快照会保留。",
"Deletes this Agent’s side questions and stops any answer in progress. The main conversation and context snapshot are retained.",
],
"chatUI.clearHistory": ["清空历史", "Clear history"],
"chatUI.cancel": ["取消", "Cancel"],
"chatUI.todoParseFailed": ["解析 Todo 失败", "Could not parse the todo list"],
"chatUI.noTodo": ["本会话暂无 Todo", "No todos in this session"],
"chatUI.recentTodoHint": ["查看最近 Todo", "View latest todos"],
"chatUI.todoLoading": [" · 加载中…", " · Loading…"],
"chatUI.recentTodo": ["最近 Todo", "Latest todos"],
"chatUI.empty": ["(空)", "(Empty)"],
"chatUI.sideParseFailed": [
"旁路数据解析失败,请重新打开面板",
"Could not read side question data. Reopen the panel.",
],
"chatUI.focusWrongOrigin": ["审批来源与当前会话不一致", "The approval belongs to another session"],
"chatUI.focusUnavailable": ["无法定位原始执行", "Could not locate the original execution"],
"chatUI.focusMissingDeleted": [
"会话中未找到对应工具调用,记录可能已删除",
"The tool call was not found in this session. It may have been deleted.",
],
"chatUI.focusMissing": ["会话中未找到对应工具调用", "The tool call was not found in this session"],
"chatUI.focusError": ["无法定位:{{error}}", "Could not locate execution: {{error}}"],
"chatUI.focusReady": ["已展开审批 #{{id}} 对应的工具调用", "Expanded the tool call for approval #{{id}}"],
"chatUI.focusLoading": [
"正在加载审批 #{{id}} 所在的对话位置…",
"Loading the conversation location for approval #{{id}}…",
],
"chatUI.focusRetry": ["重试定位", "Retry locating"],
"chatUI.focusCancel": ["取消定位", "Cancel locating"],
"chatUI.thinking": ["推理", "Reasoning"],
"chatUI.summary": ["总结", "Summary"],
"chatUI.explanation": ["说明", "Explanation"],
"chatUI.newRound": ["新一轮", "New round"],
"chatUI.approvalLoadFailed": ["审批详情加载失败", "Could not load approval details"],
"chatUI.command": ["命令", "Command"],
"chatUI.output": ["输出", "Output"],
"chatUI.loadFailed": ["(加载失败)", "(Could not load)"],
"chatUI.focusedCall": ["定位的工具调用 #{{seq}}", "Located tool call #{{seq}}"],
"chatUI.allowedExecution": ["已允许执行", "Execution allowed"],
"chatUI.deniedExecution": ["已拒绝执行", "Execution denied"],
"chatUI.allowed": ["已允许", "Allowed"],
"chatUI.timeout": ["已超时", "Timed out"],
"chatUI.denied": ["已拒绝", "Denied"],
"chatUI.collapseApproval": ["收起审批详情", "Collapse approval details"],
"chatUI.expandApproval": ["展开审批详情", "Expand approval details"],
"chatUI.tool": ["工具", "Tool"],
"chatUI.executing": ["执行中…", "Running…"],
"chatUI.executionFailed": ["✕ 失败", "✕ Failed"],
"chatUI.loading": ["加载中…", "Loading…"],
"chatUI.approvalRequest": ["审批请求", "Approval request"],
"chatUI.readOnlyHistory": ["历史记录 · 只读", "History · Read only"],
"chatUI.allow": ["允许", "Allow"],
"chatUI.deny": ["拒绝", "Deny"],
"chatUI.retryDetails": ["重试详情", "Retry details"],
"chatUI.loadingApproval": ["正在加载审批详情…", "Loading approval details…"],
"chatUI.includesThinking": ["· 含推理", "· Includes reasoning"],
"chatUI.streaming": ["实时流式中…", "Streaming live…"],
} satisfies Record<string, readonly [string, string]>;
+8
View File
@@ -0,0 +1,8 @@
export const DEFAULT_LOCALE = "zh-CN";
export const SUPPORTED_LOCALES = [DEFAULT_LOCALE, "en"] as const;
export type AppLocale = (typeof SUPPORTED_LOCALES)[number];
export const LOCALE_STORAGE_KEY = "artex_locale";
export function resolveLocale(value: string | null | undefined): AppLocale {
return /^en(?:-|$)/i.test(value ?? "") ? "en" : DEFAULT_LOCALE;
}
+34
View File
@@ -0,0 +1,34 @@
export const errorMessages = {
"error.intelligence_response_invalid": [
"情报数据响应不完整,请刷新后重试",
"The intelligence response is incomplete. Refresh to try again.",
],
"error.basic_auth_required": ["请先完成 HTTP Basic Auth 验证", "Complete HTTP Basic Auth verification first"],
"error.auth_session_failed": ["认证会话生成失败", "Unable to create an authentication session"],
"error.basic_auth_username_invalid": [
"Basic Auth 用户名不能为空、超过 128 字节或包含冒号及控制字符",
"The Basic Auth username is required, must not exceed 128 bytes, and cannot contain colons or control characters",
],
"error.basic_auth_password_required": ["请先设置 Basic Auth 密码", "Set a Basic Auth password first"],
"error.basic_auth_save_failed": ["Basic Auth 配置保存失败,请重试", "Could not save Basic Auth settings. Try again."],
"error.unauthorized": ["未授权", "Unauthorized"],
"error.token_expired": ["token 无效或已过期", "Your sign-in token is invalid or expired"],
"error.data_unavailable": [
"数据源暂时不可用,请稍后重试",
"The data source is temporarily unavailable. Try again later.",
],
"error.password_already_set": ["密码已设置", "A password has already been set"],
"error.password_required": ["密码不能为空", "Password is required"],
"error.password_too_short": ["密码长度至少 {{min}} 位", "Password must contain at least {{min}} characters"],
"error.password_too_long": ["密码长度不能超过 {{max}} 字节", "Password must not exceed {{max}} bytes"],
"error.password_hash_failed": ["密码加密失败", "Unable to secure the password"],
"error.save_failed": ["保存失败", "Unable to save changes"],
"error.token_failed": ["token 生成失败", "Unable to create a sign-in token"],
"error.invalid_request": ["请求格式错误", "Invalid request format"],
"error.new_password_required": ["新密码不能为空", "New password is required"],
"error.password_not_initialized": ["密码未初始化,请先设置密码", "Set up a password first"],
"error.current_password_incorrect": ["当前密码错误", "The current password is incorrect"],
"error.invalid_credentials": ["用户名或密码错误", "Incorrect username or password"],
"update.available": ["新版本", "Update available"],
"update.hint": ["发现新版本 {{version}},点击前往更新", "Version {{version}} is available. Click to update."],
} satisfies Record<string, readonly [string, string]>;
+10
View File
@@ -0,0 +1,10 @@
import type { TFunction } from "i18next";
export function localizedError(error: unknown, translate: TFunction): string {
if (typeof error === "string") return translate(error, { defaultValue: error });
if (error instanceof Error) {
const { code, params } = error as Error & { code?: string; params?: Record<string, unknown> };
return code ? translate(`error.${code}`, { ...params, defaultValue: error.message }) : error.message;
}
return translate("auth.backendUnavailable");
}
+18
View File
@@ -0,0 +1,18 @@
import catalog from "./screen-catalog.json";
import type { UITranslate } from "./use-ui-translation";
// Translate only product-authored messages at explicit UI boundaries. Never run
// this over reports, prompts, request bodies, user names or arbitrary AI output.
const fixedKeys = new Map(Object.entries(catalog).map(([key, pair]) => [pair[0], key]));
export function translateFixedUIText(text: string, ui: UITranslate): string {
const key = fixedKeys.get(text);
if (key) return ui(key);
const limit = /^最多 (\d+) 个字符$/.exec(text);
if (limit) return ui("screen.scopeCharacterLimit", { count: Number(limit[1]) });
return text;
}
export function repeaterGroupLabel(group: { id: string; name: string }, ui: UITranslate): string {
return group.id === "default" && group.name === "默认" ? translateFixedUIText(group.name, ui) : group.name;
}
+459
View File
@@ -0,0 +1,459 @@
const assert = require("node:assert/strict");
const fs = require("node:fs");
const path = require("node:path");
const vm = require("node:vm");
const test = require("node:test");
const ts = require("typescript");
function loadSource(file, cache = new Map()) {
const filename = path.resolve(__dirname, file);
if (filename.endsWith(".json")) return { default: JSON.parse(fs.readFileSync(filename, "utf8")) };
if (cache.has(filename)) return cache.get(filename);
const exports = {};
cache.set(filename, exports);
const compiled = ts.transpileModule(fs.readFileSync(filename, "utf8"), {
compilerOptions: { target: ts.ScriptTarget.ES2022, module: ts.ModuleKind.CommonJS },
}).outputText;
vm.runInNewContext(
compiled,
{
exports,
Error,
require: (id) =>
id.startsWith("@/")
? loadSource(path.resolve(__dirname, "..", `${id.slice(2)}.ts`), cache)
: id.startsWith(".")
? loadSource(path.resolve(path.dirname(filename), id.endsWith(".json") ? id : `${id}.ts`), cache)
: require(id),
},
{ filename },
);
return exports;
}
const { createAppI18n } = loadSource("instance.ts");
const { resources } = loadSource("messages.ts");
const { resolveLocale } = loadSource("config.ts");
const { localizedError } = loadSource("errors.ts");
const { matchesSettingsQuery } = loadSource("settings-search.ts");
const { useLiveTranslation } = loadSource("use-live-translation.ts");
test("translation resources are complete and preserve interpolation parameters", () => {
assert.deepEqual(Object.keys(resources.en.translation).sort(), Object.keys(resources["zh-CN"].translation).sort());
for (const key of Object.keys(resources.en.translation)) {
const english = resources.en.translation[key];
assert.ok(english.trim(), key);
const params = (text) => [...text.matchAll(/\{\{(.*?)\}\}/g)].map((m) => m[1]).sort();
assert.deepEqual(params(english), params(resources["zh-CN"].translation[key]), key);
}
});
test("instances start in Chinese, switch synchronously and remain isolated", async () => {
const first = createAppI18n();
const second = createAppI18n();
assert.equal(first.t("auth.login"), "登录");
await first.changeLanguage("en");
assert.equal(first.t("auth.login"), "Sign in");
assert.equal(second.t("auth.login"), "登录");
assert.equal(first.t("mention.searchType", { kind: "Endpoint" }), "Search Endpoint");
assert.equal(first.t("pagination.range", { from: 1, to: 10, total: 23 }), "1–10 of 23 records");
assert.equal(first.t("pagination.range", { from: 1, to: 1, total: 1, count: 1 }), "1–1 of 1 record");
assert.equal(first.t("mention.all", { count: 1 }), "Showing 1 record");
await first.changeLanguage("zh-CN");
assert.equal(first.t("auth.login"), "登录");
});
test("unsupported saved locale values use the deterministic static default", () => {
for (const value of [undefined, null, "", "fr", "corrupted", "zh-TW"]) assert.equal(resolveLocale(value), "zh-CN");
for (const value of ["en", "en-US", "EN-gb"]) assert.equal(resolveLocale(value), "en");
});
test("localized error text keeps raw server details as fallback", async () => {
const i18n = createAppI18n();
await i18n.changeLanguage("en");
const raw = "original server detail";
assert.equal(localizedError(raw, i18n.t.bind(i18n)), raw);
assert.equal(localizedError("auth.passwordMismatch", i18n.t.bind(i18n)), "The passwords do not match");
const structured = Object.assign(new Error("密码长度至少 8 位"), { code: "password_too_short", params: { min: 8 } });
assert.equal(localizedError(structured, i18n.t.bind(i18n)), "Password must contain at least 8 characters");
structured.code = "future_error";
assert.equal(localizedError(structured, i18n.t.bind(i18n)), "密码长度至少 8 位");
});
test("settings search accepts both languages independently of the display language", async () => {
const i18n = createAppI18n();
for (const locale of ["en", "zh-CN"]) {
await i18n.changeLanguage(locale);
for (const query of ["截图", "SCREENSHOTS", " OpSec "]) {
assert.ok(matchesSettingsQuery(i18n, "settings.keywords.browserSecurity", query), `${locale}: ${query}`);
}
assert.ok(matchesSettingsQuery(i18n, "settings.keywords.globalProxy", "reconnection"));
assert.ok(matchesSettingsQuery(i18n, "settings.keywords.globalProxy", "代理"));
assert.equal(matchesSettingsQuery(i18n, "settings.keywords.python", "screenshots"), false);
assert.ok(matchesSettingsQuery(i18n, "settings.keywords.python", " "));
}
});
test("settings translation callbacks read the active provider's language after switching", async () => {
const React = require("react");
const { renderToStaticMarkup } = require("react-dom/server");
const { I18nextProvider } = require("react-i18next");
const i18n = createAppI18n();
let callback;
function Probe() {
callback = useLiveTranslation().liveT;
return React.createElement("span", null, callback("settings.category.system"));
}
assert.equal(
renderToStaticMarkup(React.createElement(I18nextProvider, { i18n }, React.createElement(Probe))),
"<span>系统与账号</span>",
);
await i18n.changeLanguage("en");
// In-flight callbacks do not retain the language from the original render.
assert.equal(callback("settings.category.system"), "System and account");
assert.equal(callback("settings.workerTotal", { count: 1 }), "Total: 1 Worker session");
assert.equal(callback("settings.workerTotal", { count: 3 }), "Total: 3 Worker sessions");
assert.equal(callback("settings.failureCount", { count: 1 }), "1 failure");
});
test("migrated pages reference existing keys and contain no hardcoded Chinese display text", () => {
const root = path.resolve(__dirname, "..");
const files = [
"app/(main)/system/settings/page.tsx",
"app/(main)/chat/page.tsx",
"app/(main)/function/schedules/page.tsx",
"components/remark-editor.tsx",
"app/(main)/function/tasks/page.tsx",
"components/task-template-controls.tsx",
"components/task-llm-profile-chain.tsx",
"app/(main)/system/notify/page.tsx",
"app/(main)/system/notify/_components/channel-form.tsx",
"app/(main)/system/notify/_components/channel-fields.ts",
"app/(main)/system/notify/_components/delivery-list.tsx",
"app/(main)/system/notify/_components/stat-tile.tsx",
"lib/schedule-display.ts",
"components/side-question-workspace.tsx",
"components/transcript.tsx",
"components/todo-popover.tsx",
"components/approval-execution-focus.tsx",
"hooks/use-side-questions.ts",
"app/(main)/dashboard/page.tsx",
"app/(main)/system/settings/_components/basic-auth-card.tsx",
"app/(main)/system/settings/_components/update-card.tsx",
"app/(main)/_components/egress-ip-banner.tsx",
];
for (const file of files) {
const source = fs.readFileSync(path.join(root, file), "utf8");
const tree = ts.createSourceFile(file, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX);
const visit = (node) => {
// Upload manifests are Agent-facing protocol text, outside UI translation.
if (ts.isFunctionDeclaration(node) && node.name?.text === "appendUploads") return;
if (ts.isVariableDeclaration(node) && node.name.getText(tree) === "UPLOAD_MARKER") return;
if (
ts.isCallExpression(node) &&
["t", "liveT", "translate"].includes(node.expression.getText(tree)) &&
ts.isStringLiteral(node.arguments[0])
) {
assert.ok(
Object.hasOwn(resources.en.translation, node.arguments[0].text) ||
Object.hasOwn(resources.en.translation, `${node.arguments[0].text}_other`),
`${file}: ${node.arguments[0].text}`,
);
}
if (ts.isStringLiteral(node) && /^(taskUI|schedule|notify)\./.test(node.text)) {
assert.ok(
Object.hasOwn(resources.en.translation, node.text) ||
Object.hasOwn(resources.en.translation, `${node.text}_other`),
`${file}: ${node.text}`,
);
}
if (ts.isJsxText(node) || ts.isStringLiteral(node) || ts.isNoSubstitutionTemplateLiteral(node)) {
assert.equal(/[\u3400-\u9fff]/u.test(node.text), false, `${file}: ${node.text.trim()}`);
}
ts.forEachChild(node, visit);
};
visit(tree);
}
});
test("overview and conversation counts use English singular and plural forms", async () => {
const i18n = createAppI18n();
await i18n.changeLanguage("en");
for (const [key, singular, plural] of [
["overview.taskCount", "1 task", "2 tasks"],
["overview.rounds", "1 turn", "2 turns"],
["overview.conversationsDeleted", "Deleted 1 conversation", "Deleted 2 conversations"],
["overview.deleteSelected", "Delete 1 selected conversation?", "Delete 2 selected conversations?"],
["chatUI.recentExchanges", "1 recent exchange verbatim", "2 recent exchanges verbatim"],
]) {
assert.equal(i18n.t(key, { count: 1 }), singular);
assert.equal(i18n.t(key, { count: 2 }), plural);
}
assert.equal(i18n.t("overview.deleteConversation", { title: "用户的名称" }), "Delete conversation “用户的名称”?");
});
test("render translations invalidate caches while lifecycle translations keep a stable identity", async () => {
const i18n = createAppI18n();
let memo;
let memoDependencies;
const exports = {};
const source = ts.transpileModule(fs.readFileSync(path.join(__dirname, "use-live-translation.ts"), "utf8"), {
compilerOptions: { target: ts.ScriptTarget.ES2022, module: ts.ModuleKind.CommonJS },
}).outputText;
vm.runInNewContext(source, {
exports,
require: (id) => {
if (id === "react")
return {
useMemo: (factory, dependencies) => {
if (!memoDependencies || dependencies.some((value, index) => value !== memoDependencies[index])) {
memo = factory();
memoDependencies = dependencies;
}
return memo;
},
};
if (id === "react-i18next") return { useTranslation: () => ({ i18n, t: i18n.getFixedT(i18n.language) }) };
throw new Error(`Unexpected dependency: ${id}`);
},
});
const chinese = exports.useLiveTranslation();
assert.equal(chinese.t("settings.category.system"), "系统与账号");
await i18n.changeLanguage("en");
const english = exports.useLiveTranslation();
// React Compiler can now invalidate text cached against the render function.
assert.notEqual(english.t, chinese.t);
assert.equal(english.t("settings.category.system"), "System and account");
// Switching languages does not retrigger effects that populate editable fields.
assert.equal(english.liveT, chinese.liveT);
assert.equal(chinese.liveT("settings.category.system"), "System and account");
});
test("execution labels switch language without translating cached commands or tool output", async () => {
const { formatToolDetail, toolInputText } = loadSource("../lib/execution-display.ts");
const i18n = createAppI18n();
const command = 'printf "用户输入"';
const output = "原始工具输出\nAI 输出也保持原文";
const parts = [
{ kind: "command", text: JSON.stringify({ command, description: "原始描述" }) },
{ kind: "output", text: output },
];
assert.equal(
formatToolDetail(parts, "Bash", false, i18n.t.bind(i18n)),
`【命令】\n${command}\n\n【输出 ✓】\n${output}`,
);
await i18n.changeLanguage("en");
assert.equal(
formatToolDetail(parts, "Bash", false, i18n.t.bind(i18n)),
`【Command】\n${command}\n\n【Output ✓】\n${output}`,
);
assert.equal(toolInputText("Bash", '{"command":"echo 中文'), "echo 中文");
assert.equal(toolInputText("Read", parts[0].text), parts[0].text);
assert.equal(
formatToolDetail([{ kind: "output", text: "", failed: true }], "Bash", true, i18n.t.bind(i18n)),
"【Output ✕】\n(Could not load)",
);
});
test("schedule windows, counts and stored system messages follow the selected language", async () => {
const { scheduleDisplay } = loadSource("../lib/schedule-display.ts");
const i18n = createAppI18n();
const weekly = {
schedule_type: "weekly",
weekdays: [1, 6],
start_time: "18:00:00",
end_time: "06:00:00",
status: "running",
timezone_mode: "beijing",
};
const zh = scheduleDisplay(i18n.getFixedT("zh-CN"), "zh-CN");
assert.match(zh.periodLabel(weekly), /周一.*周六/);
assert.equal(zh.endLabel(weekly), "06:00(次日)");
assert.equal(zh.statusText(weekly), "窗口运行中");
await i18n.changeLanguage("en");
const en = scheduleDisplay(i18n.getFixedT("en"), "en");
assert.match(en.periodLabel(weekly), /Weekly.*Mon.*Sat/);
assert.equal(en.endLabel(weekly), "06:00 (next day)");
assert.equal(en.windowLabel({ ...weekly, end_time: "" }), "Runs continuously from 18:00");
assert.equal(en.statusText(weekly), "Window active");
assert.equal(en.historyActionText("resume"), "Task resumed");
assert.equal(en.historyActionText("future-action"), "Status changed");
assert.equal(en.timezoneLabel(weekly), "Beijing time (UTC+8)");
assert.equal(en.formatDateValue("2026-11-10"), "November 10, 2026");
assert.equal(en.formatDateValue("invalid-date"), "invalid-date");
assert.equal(
en.endLabel({ ...weekly, schedule_type: "once", run_date: "2026-11-10", end_date: "2026-11-11", end_time: "" }),
"November 11, 2026 24:00",
);
assert.equal(en.nextWindowLabel("2026-11-10T10:00:00Z", "Asia/Shanghai"), "11/10/2026, 18:00");
assert.equal(en.nextWindowLabel("2026-11-10T10:00:00Z", "invalid-zone"), en.formatTime("2026-11-10T10:00:00Z"));
assert.equal(en.scheduleErrorText("手动立即运行"), "Manually started immediately");
assert.equal(en.scheduleErrorText("任务 #42 已结束,无法立即运行"), "Task #42 has ended and cannot run immediately");
assert.equal(
en.scheduleErrorText("任务 #42: 状态读取失败; 任务 #43: 人工暂停优先"),
"Task #42: Could not read task state; Task #43: Manual pause takes priority",
);
const original = "用户的计划与备注,包含 start_time";
assert.equal(en.scheduleErrorText(original), original);
assert.equal(en.scheduleErrorText("任务 #42:unknown original detail"), "Task #42: unknown original detail");
for (const [key, singular, plural] of [
["schedule.started", "Started 1 task immediately", "Started 2 tasks immediately"],
["schedule.deleted", "Deleted 1 schedule", "Deleted 2 schedules"],
["schedule.confirmBulkDelete", "Delete 1 selected schedule?", "Delete 2 selected schedules?"],
["schedule.recentRecords", "Latest 1 record", "Latest 2 records"],
]) {
assert.equal(i18n.t(key, { count: 1 }), singular);
assert.equal(i18n.t(key, { count: 2 }), plural);
}
assert.equal(i18n.t("inlineEditor.fieldLabel", { field: "Notes", label: "用户计划" }), "Notes for 用户计划");
});
test("notification fields and filters translate without changing API values or template syntax", async () => {
const { CHANNEL_FIELDS, SEVERITY_OPTIONS, KIND_LABEL, parseKV, parseIDs, parseKeywords } = loadSource(
"../app/(main)/system/notify/_components/channel-fields.ts",
);
const { notificationError } = loadSource("notify-runtime.ts");
const i18n = createAppI18n();
await i18n.changeLanguage("en");
const translate = i18n.t.bind(i18n);
for (const key of Object.values(KIND_LABEL)) assert.ok(!/[\u3400-\u9fff]/u.test(translate(key)));
for (const field of Object.values(CHANNEL_FIELDS).flat()) {
assert.ok(!/[\u3400-\u9fff]/u.test(translate(field.label)));
if (field.help) assert.ok(Object.hasOwn(resources.en.translation, field.help), field.help);
for (const option of field.options ?? [])
assert.ok(Object.hasOwn(resources.en.translation, option.label), option.label);
}
for (const option of SEVERITY_OPTIONS) assert.ok(Object.hasOwn(resources.en.translation, option.label));
assert.equal(translate(KIND_LABEL.dingtalk), "DingTalk");
assert.equal(
translate(CHANNEL_FIELDS.email.find((field) => field.key === "password").label),
"Password / app password",
);
const method = CHANNEL_FIELDS.webhook.find((field) => field.key === "method");
assert.equal(method.options[0].value, "POST");
assert.equal(translate(method.options[0].label), "POST (with body)");
const help = translate("notify.fields.bodyTemplateHelp", {
variables: "{{.Title}} {{.Batch}} {{.Count}} {{.HomeURL}} {{.SentAt}}",
fields: ".Name/.VulnClass/.Severity/.Summary/.Assets/.DetailURL/.StatusLabel",
jsonExample: "{{json .Xxx}}",
rawExample: "{{.Xxx}}",
});
assert.ok(help.includes("{{.Title}}"));
assert.ok(help.includes("{{json .Xxx}} instead of {{.Xxx}}"));
assert.equal(notificationError(new Error("缺少 Webhook 地址"), translate), "Webhook URL is required");
assert.equal(
notificationError(new Error("演示模式不会发送真实通知,请在实际部署中测试"), translate),
"Demo mode does not send notifications. Test this channel in a deployed instance.",
);
assert.equal(notificationError(new Error("Webhook 地址无效: 原始错误"), translate), "Invalid webhook URL: 原始错误");
assert.equal(notificationError(new Error("原始第三方响应"), translate), "原始第三方响应");
assert.equal(
JSON.stringify(parseKV("Authorization=Bearer abc\nX-Test=中文值")),
JSON.stringify({ Authorization: "Bearer abc", "X-Test": "中文值" }),
);
assert.equal(JSON.stringify(parseIDs("1,2 3")), "[1,2,3]");
assert.equal(
JSON.stringify(parseKeywords("SQL注入\nCommand execution")),
JSON.stringify(["SQL注入", "Command execution"]),
);
for (const [key, singular, plural] of [
["notify.tasks", "1 task", "2 tasks"],
["notify.assets", "1 asset", "2 assets"],
["notify.minutes", "1 minute", "2 minutes"],
["notify.includeWords", "Type matches 1 keyword", "Type matches 2 keywords"],
["notify.total", "1 record", "2 records"],
]) {
assert.equal(translate(key, { count: 1 }), singular);
assert.equal(translate(key, { count: 2 }), plural);
}
await i18n.changeLanguage("zh-CN");
assert.equal(translate(KIND_LABEL.dingtalk), "钉钉");
assert.equal(translate(CHANNEL_FIELDS.email.find((field) => field.key === "password").label), "密码 / 授权码");
});
test("task summaries, archive eligibility and category scope labels switch without altering user content", async () => {
const filename = path.resolve(__dirname, "../app/(main)/function/tasks/page.tsx");
const source = fs.readFileSync(filename, "utf8");
const tree = ts.createSourceFile(filename, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX);
const names = [
"deleteDetails",
"deleteSummary",
"archiveBlockReason",
"archiveStateLabel",
"formatArchiveBytes",
"archiveCompressionLabel",
"companyScopeSummary",
];
const declarations = tree.statements.filter(
(node) =>
(ts.isFunctionDeclaration(node) && names.includes(node.name?.text)) ||
(ts.isVariableStatement(node) &&
node.declarationList.declarations.some((declaration) =>
["ARCHIVABLE_STATUSES", "COMPANY_SCOPE_LABELS"].includes(declaration.name.getText(tree)),
)),
);
const helpers = vm.runInNewContext(
ts.transpileModule(declarations.map((node) => node.getText(tree)).join("\n") + `\n;({${names.join(",")}})`, {
compilerOptions: { target: ts.ScriptTarget.ES2022 },
}).outputText,
);
const i18n = createAppI18n();
const translate = i18n.t.bind(i18n);
const counts = {
assets_deleted: 1,
assets_detached: 2,
traffic_deleted: 0,
files_deleted: false,
findings_deleted: 1,
llm_records_deleted: 0,
};
assert.match(helpers.deleteSummary(counts, translate), /任务已删除.*删除资产 1 条/);
await i18n.changeLanguage("en");
assert.equal(
helpers.deleteSummary(counts, translate),
"Task deleted (Deleted 1 asset, Unlinked 2 shared assets, Deleted 1 finding)",
);
assert.equal(helpers.archiveBlockReason({ status: "queued", queued: true }, translate), "Pause queued tasks first");
assert.equal(helpers.archiveBlockReason({ status: "running" }, translate), "Pause active or unfinished tasks first");
assert.equal(helpers.archiveBlockReason({ status: "done" }, translate), "");
assert.match(helpers.archiveBlockReason({ status: "done", archive_blocked_by_task_id: 42 }, translate), /Task #42/);
assert.equal(helpers.archiveStateLabel("restore_queued", translate), "Queued for restoration");
assert.equal(
helpers.archiveCompressionLabel({ original_size: 2048, compressed_size: 1024 }, translate),
"1.0 KB · 50% saved",
);
const company = {
scope: [
{ kind: "domain", raw: "用户.example.com" },
{ kind: "keyword", raw: "用户关键词" },
],
};
assert.equal(helpers.companyScopeSummary(company, translate), "Domain: 用户.example.com · Keyword: 用户关键词");
assert.equal(translate("taskUI.confirmDeleteCategory", { name: "用户分类" }), "Delete category “用户分类”?");
assert.equal(translate("taskUI.deletedTasks", { count: 1 }), "Deleted 1 task");
assert.equal(translate("taskUI.deletedTasks", { count: 2 }), "Deleted 2 tasks");
assert.equal(translate("taskUI.uncategorizedCount", { count: 1 }), "1 task is uncategorized.");
assert.equal(
translate("taskUI.categoryUsed", { count: 1 }),
"1 task uses this category. Renaming updates the task list.",
);
for (const kind of ["exact_domain", "exact_ip", "exact_url", "fuzzy_domain", "fuzzy_ip", "fuzzy_url", "cidr"])
assert.ok(Object.hasOwn(resources.en.translation, `taskUI.assetRule.${kind}`));
const upload = tree.statements.find((node) => ts.isFunctionDeclaration(node) && node.name?.text === "appendUploads");
assert.ok(upload.getText(tree).includes("worker 可用 Read/Bash 按路径打开"));
});
test("task runtime validation preserves unknown details and schedule validation remains bilingual", async () => {
const { taskError } = loadSource("task-runtime.ts");
const i18n = createAppI18n();
await i18n.changeLanguage("en");
const translate = i18n.t.bind(i18n);
assert.equal(taskError(new Error("分类名称已存在"), translate), "A category with this name already exists");
assert.equal(taskError(new Error("备注最多 200 个字符"), translate), "Notes must be 200 characters or fewer");
assert.equal(taskError(new Error("截止日期不能早于开始日期"), translate), "End date cannot be before start date");
assert.equal(taskError(new Error("原始系统或第三方详细信息"), translate), "原始系统或第三方详细信息");
assert.equal(translate("taskUI.phase.snapshot_database"), "Creating database snapshot");
await i18n.changeLanguage("zh-CN");
assert.equal(taskError(new Error("备注最多 200 个字符"), translate), "备注最多 200 个字符");
assert.equal(translate("taskUI.phase.snapshot_database"), "创建数据库快照");
});
+23
View File
@@ -0,0 +1,23 @@
export const inlineEditorMessages = {
"inlineEditor.remark": ["备注", "Notes"],
"inlineEditor.name": ["名称", "Name"],
"inlineEditor.addRemark": ["添加备注", "Add notes"],
"inlineEditor.unnamed": ["未命名", "Untitled"],
"inlineEditor.nameRequired": ["名称不能为空", "Name is required"],
"inlineEditor.tooLong": ["{{field}}最多 {{max}} 个字符", "{{field}} must be {{max}} characters or fewer"],
"inlineEditor.saved": ["{{field}}已保存", "{{field}} saved"],
"inlineEditor.saveFailed": ["{{field}}保存失败:{{message}}", "Could not save {{field}}: {{message}}"],
"inlineEditor.fieldLabel": ["{{label}}{{field}}", "{{field}} for {{label}}"],
"inlineEditor.multilineHelp": [
"Enter 保存,Shift+Enter 换行,Esc 取消;留空可清除备注",
"Enter to save, Shift+Enter for a new line, Esc to cancel; leave empty to clear notes",
],
"inlineEditor.singleHelp": ["Enter 或失焦保存,Esc 取消", "Enter or click elsewhere to save, Esc to cancel"],
"inlineEditor.clickLabel": ["{{label}}{{field}},点击编辑", "{{field}} for {{label}}; click to edit"],
"inlineEditor.clickEdit": ["点击编辑{{field}}", "Click to edit {{field}}"],
"inlineEditor.editLabel": ["编辑{{label}}的{{field}}", "Edit {{field}} for {{label}}"],
"inlineEditor.editHelp": [
"编辑{{field}}:输入完成后按 Enter 或点击其他位置保存,按 Esc 取消。",
"Edit {{field}}: press Enter or click elsewhere to save, or press Esc to cancel.",
],
} as const;
+21
View File
@@ -0,0 +1,21 @@
import { createInstance } from "i18next";
import { initReactI18next } from "react-i18next";
import { DEFAULT_LOCALE, SUPPORTED_LOCALES } from "./config";
import { resources } from "./messages";
export function createAppI18n() {
const instance = createInstance();
void instance.use(initReactI18next).init({
resources,
lng: DEFAULT_LOCALE,
fallbackLng: DEFAULT_LOCALE,
supportedLngs: [...SUPPORTED_LOCALES],
load: "currentOnly",
initAsync: false,
keySeparator: false,
interpolation: { escapeValue: false },
react: { useSuspense: false },
});
return instance;
}
+300
View File
@@ -0,0 +1,300 @@
import { chatUIMessages } from "./chat-ui-messages";
import { errorMessages } from "./error-messages";
import { inlineEditorMessages } from "./inline-editor-messages";
import { notifyMessages } from "./notify-messages";
import { overviewMessages } from "./overview-messages";
import { scheduleMessages } from "./schedule-messages";
import screenCatalog from "./screen-catalog.json";
import { settingsMessages } from "./settings-messages";
import { settingsRuntimeMessages } from "./settings-runtime-messages";
import { taskMessages } from "./task-messages";
import { termsMessages } from "./terms";
// Keep both languages together so each product message has an explicit translation.
export const messages = {
...(screenCatalog as unknown as Record<string, readonly [string, string]>),
...termsMessages,
...taskMessages,
...notifyMessages,
...inlineEditorMessages,
...scheduleMessages,
...chatUIMessages,
...errorMessages,
...overviewMessages,
...settingsMessages,
...settingsRuntimeMessages,
"common.cancel": ["取消", "Cancel"],
"common.retry": ["重试", "Retry"],
"common.close": ["关闭", "Close"],
"common.loading": ["加载中…", "Loading…"],
"common.search": ["搜索", "Search"],
"common.all": ["全部", "All"],
"common.other": ["其他", "Other"],
"common.previous": ["上一页", "Previous page"],
"common.next": ["下一页", "Next page"],
"common.version": ["版本", "Version"],
"meta.title": ["ARTEX — 自主渗透测试控制台", "ARTEX — Autonomous Pentesting Console"],
"meta.description": ["LLM 驱动的自主渗透测试系统控制台", "An LLM-powered autonomous penetration testing console"],
"language.label": ["语言", "Language"],
"language.change": ["切换语言", "Change language"],
"nav.features": ["功能", "Features"],
"nav.system": ["系统", "System"],
"nav.dashboard": ["仪表盘", "Dashboard"],
"nav.chat": ["对话", "Chat"],
"nav.tasks": ["任务", "Tasks"],
"nav.schedules": ["计划任务", "Schedules"],
"nav.findings": ["发现", "Findings"],
"nav.traffic": ["流量", "Traffic"],
"nav.repeater": ["请求重发", "Repeater"],
"nav.commands": ["工具执行", "Tool executions"],
"nav.llm-records": ["LLM 录制", "LLM recordings"],
"nav.assets": ["资产", "Assets"],
"nav.sync": ["资产同步", "Asset sync"],
"nav.workspace": ["工作空间", "Workspace"],
"nav.llm": ["LLM", "LLM"],
"nav.agents": ["Agent", "Agents"],
"nav.mcp": ["MCP", "MCP"],
"nav.skills": ["Skill", "Skills"],
"nav.tools": ["工具", "Tools"],
"nav.notify": ["通知推送", "Notifications"],
"nav.intercept": ["拦截规则", "Interception rules"],
"nav.asset-intercept": ["资产拦截", "Asset interception"],
"nav.approvals": ["审批记录", "Approval history"],
"nav.logs": ["日志", "Logs"],
"nav.settings": ["系统配置", "Settings"],
"search.placeholder": ["搜索页面与功能…", "Search pages and features…"],
"search.empty": ["没有匹配结果", "No results found"],
"account.changePassword": ["修改密码", "Change password"],
"account.logout": ["退出登录", "Sign out"],
"account.currentPassword": ["当前密码", "Current password"],
"account.newPassword": ["新密码", "New password"],
"account.confirmNewPassword": ["确认新密码", "Confirm new password"],
"account.passwordRequired": ["请填写当前密码和新密码", "Enter your current and new passwords"],
"account.passwordMismatch": ["两次输入的新密码不一致", "The new passwords do not match"],
"account.passwordChanged": ["密码已修改", "Password changed"],
"account.changing": ["修改中…", "Changing…"],
"account.confirmChange": ["确认修改", "Confirm change"],
"account.usernameFixed": ["用户名固定为", "The username is"],
"account.tokenNotice": [
"。需先输入当前密码验证;修改后已签发的登录 token 仍有效直至过期。",
". Enter your current password to verify your identity. Existing sign-in tokens remain valid until they expire.",
],
"account.changeFailed": ["修改失败:{{message}}", "Could not change password: {{message}}"],
"auth.backendUnavailable": ["无法连接到后端服务", "Unable to connect to the backend service"],
"auth.agreementRequired": ["请先阅读并同意《使用须知》", "Read and accept the Terms of Use first"],
"auth.invalidCredentials": ["用户名或密码错误", "Incorrect username or password"],
"auth.checking": ["正在检查登录状态…", "Checking sign-in status…"],
"auth.login": ["登录", "Sign in"],
"auth.welcome": [
"欢迎回来,请输入密码以继续使用 ARTEX",
"Welcome back. Enter your password to continue using ARTEX.",
],
"auth.username": ["用户名", "Username"],
"auth.password": ["密码", "Password"],
"auth.enterPassword": ["请输入密码", "Enter your password"],
"auth.agreePrefix": ["我已阅读并同意", "I have read and accept the"],
"auth.termsLink": ["《使用须知》", "Terms of Use"],
"auth.signingIn": ["登录中...", "Signing in…"],
"auth.passwordMismatch": ["两次输入的密码不一致", "The passwords do not match"],
"auth.passwordMin": ["密码长度至少 8 位", "Use at least 8 characters"],
"auth.initFailed": ["初始化失败", "Setup failed"],
"auth.statusUnknown": ["无法确认初始化状态", "Unable to determine setup status"],
"auth.initPassword": ["初始化密码", "Set up your password"],
"auth.setupUnavailable": [
"后端或数据库暂时不可用。为避免覆盖实例上已有的密码,初始化入口已临时关闭——请恢复服务后重试。",
"The backend or database is temporarily unavailable. Setup is disabled to protect any existing password. Restore the service and try again.",
],
"auth.setupWelcome": [
"首次使用 ARTEX,请为账户设置一个登录密码(至少 8 位)",
"Welcome to ARTEX. Set a sign-in password with at least 8 characters.",
],
"auth.minPlaceholder": ["至少 8 位", "At least 8 characters"],
"auth.confirmPassword": ["确认密码", "Confirm password"],
"auth.reenterPassword": ["再次输入密码", "Enter your password again"],
"auth.saving": ["保存中...", "Saving…"],
"auth.setupAndLogin": ["设置密码并登录", "Set password and sign in"],
"mention.finding": ["漏洞", "Finding"],
"mention.asset": ["资产", "Asset"],
"mention.company": ["企业", "Company"],
"mention.endpoint": ["接口", "Endpoint"],
"mention.ip": ["IP", "IP"],
"mention.app": ["应用", "Application"],
"mention.root_domain": ["域名", "Root domain"],
"mention.subdomain": ["子域名", "Subdomain"],
"mention.service": ["服务", "Service"],
"mention.messageLabel": ["消息,输入 @ 引用记录", "Message; type @ to reference a record"],
"mention.chooseRecord": ["选择引用记录", "Choose a record to reference"],
"mention.chooseType": ["选择引用类型", "Choose a reference type"],
"mention.searchType": ["搜索{{kind}}", "Search {{kind}}"],
"mention.allRecords": ["全部记录", "all records"],
"mention.keyboard": ["↑↓ 选择 · Enter 确认 · Esc 关闭", "↑↓ select · Enter confirm · Esc close"],
"mention.candidates": ["引用候选", "Reference suggestions"],
"mention.searching": ["搜索中…", "Searching…"],
"mention.searchFailed": [
"搜索失败:{{error}}。请重新输入重试。",
"Search failed: {{error}}. Edit the query to retry.",
],
"mention.empty": ["没有匹配记录,请更换名称、地址或 ID", "No records found. Try another name, address or ID."],
"mention.loadingMore": ["正在加载更多…", "Loading more…"],
"mention.retryPage": ["加载失败,点击重试", "Loading failed. Click to retry."],
"mention.more": ["已显示 {{count}} 条,向下滚动加载更多", "Showing {{count}} records. Scroll down for more."],
"mention.more_one": ["已显示 {{count}} 条,向下滚动加载更多", "Showing {{count}} record. Scroll down for more."],
"mention.more_other": ["已显示 {{count}} 条,向下滚动加载更多", "Showing {{count}} records. Scroll down for more."],
"mention.all": ["已显示全部 {{count}} 条", "Showing all {{count}} records"],
"mention.all_one": ["已显示全部 {{count}} 条", "Showing {{count}} record"],
"mention.all_other": ["已显示全部 {{count}} 条", "Showing all {{count}} records"],
"mention.searchHelp": ["输入名称、地址或 ID 搜索记录", "Search records by name, address or ID"],
"mention.remove": ["移除引用 {{label}}", "Remove reference {{label}}"],
"mention.limit": ["发送时读取最新详情 · 最多 10 条", "Latest details are loaded when sent · Up to 10 references"],
"pagination.perPage": ["条/页", "per page"],
"pagination.range": ["{{from}}–{{to}} / 共 {{total}} 条", "{{from}}–{{to}} of {{total}} records"],
"pagination.range_one": ["{{from}}–{{to}} / 共 {{total}} 条", "{{from}}–{{to}} of {{total}} record"],
"pagination.range_other": ["{{from}}–{{to}} / 共 {{total}} 条", "{{from}}–{{to}} of {{total}} records"],
"pagination.empty": ["共 0 条", "0 records"],
"date.select": ["选择日期", "Select date"],
"date.clear": ["清除日期", "Clear date"],
"date.placeholder": ["年 / 月 / 日", "Year / Month / Day"],
"date.unboundedStart": ["开始不限", "No start date"],
"date.unboundedEnd": ["结束不限", "No end date"],
"date.filter": ["时间筛选", "Date filter"],
"date.filterLabel": ["按时间筛选", "Filter by date"],
"date.filterTitle": ["按发现时间筛选", "Filter by discovery time"],
"date.filterHelp": ["选择年月日和时分,范围包含起止时刻。", "Choose dates and times. Both endpoints are included."],
"date.startTime": ["开始时间", "Start time"],
"date.endTime": ["结束时间", "End time"],
"date.startDate": ["开始日期", "Start date"],
"date.endDate": ["结束日期", "End date"],
"date.startHourMinute": ["开始时分", "Start time"],
"date.endHourMinute": ["结束时分", "End time"],
"date.clearFilter": ["清除时间筛选", "Clear date filter"],
"time.select": ["选择时间", "Select time"],
"time.hour": ["小时", "Hour"],
"time.minute": ["分钟", "Minute"],
"time.hourLabel": ["{{label}} 小时", "{{label}} hour"],
"time.minuteLabel": ["{{label}} 分钟", "{{label}} minute"],
"time.clearEnd": ["清除结束时间", "Clear end time"],
"time.noEnd": ["不设置结束时间", "No end time"],
"clock.current": ["当前时间", "Current time"],
"clock.local": ["当前本地时间", "Current local time"],
"theme.light": ["浅色", "Light"],
"theme.dark": ["深色", "Dark"],
"theme.system": ["跟随系统", "System"],
"theme.cycle": ["当前主题:{{theme}},点击切换主题", "Current theme: {{theme}}. Click to cycle themes."],
"layout.preferences": ["偏好设置", "Preferences"],
"layout.description": ["自定义控制台布局与外观。", "Customize your console layout and appearance."],
"layout.preset": ["主题预设", "Theme preset"],
"layout.fonts": ["字体", "Fonts"],
"layout.selectFont": ["选择字体", "Select font"],
"layout.themeMode": ["主题模式", "Theme mode"],
"layout.pageLayout": ["页面布局", "Page layout"],
"layout.centered": ["居中", "Centered"],
"layout.fullWidth": ["全宽", "Full width"],
"layout.navbar": ["顶栏行为", "Navbar behavior"],
"layout.sticky": ["固定", "Sticky"],
"layout.scroll": ["随页面滚动", "Scroll"],
"layout.sidebarStyle": ["侧栏样式", "Sidebar style"],
"layout.inset": ["内嵌", "Inset"],
"layout.sidebar": ["侧栏", "Sidebar"],
"layout.floating": ["悬浮", "Floating"],
"layout.collapse": ["侧栏折叠方式", "Sidebar collapse mode"],
"layout.icon": ["图标", "Icons"],
"layout.offcanvas": ["完全收起", "Off-canvas"],
"layout.restore": ["恢复默认", "Restore defaults"],
"ui.previousSlide": ["上一张", "Previous slide"],
"ui.nextSlide": ["下一张", "Next slide"],
"ui.mobileSidebar": ["移动端侧栏", "Mobile sidebar"],
"ui.toggleSidebar": ["切换侧栏", "Toggle sidebar"],
"ui.morePages": ["更多页面", "More pages"],
"ui.commandTitle": ["搜索页面与功能", "Search pages and features"],
"ui.commandDescription": ["输入关键词搜索可用页面与功能。", "Type a keyword to search available pages and features."],
"ui.sortDescending": ["按{{label}}倒序排序", "Sort {{label}} in descending order"],
"ui.sortActive": [
"{{label}}当前{{direction}},点击切换排序方向",
"{{label}} is sorted {{direction}}. Click to reverse the order.",
],
"ui.ascending": ["正序", "ascending"],
"ui.descending": ["倒序", "descending"],
} satisfies Record<string, readonly [string, string]>;
const statuses: Record<string, readonly (readonly [string, string, string])[]> = {
intent: [
["open", "待领", "Unclaimed"],
["running", "执行中", "Running"],
["paused", "已暂停", "Paused"],
["done", "已完成", "Completed"],
["blocked", "执行出错", "Execution error"],
["exhausted", "预算耗尽", "Budget exhausted"],
["stopped", "已停止", "Stopped"],
["deleted", "已删除", "Deleted"],
],
task: [
["created", "已创建", "Created"],
["queued", "排队中", "Queued"],
["running", "运行中", "Running"],
["paused", "已暂停", "Paused"],
["done", "已完成", "Completed"],
["failed", "失败", "Failed"],
["timeout", "已超时", "Timed out"],
],
severity: [
["critical", "严重", "Critical"],
["high", "高危", "High"],
["medium", "中危", "Medium"],
["low", "低危", "Low"],
],
finding: [
["pending", "待处理", "Pending"],
["in_progress", "处理中", "In progress"],
["confirmed", "已确认", "Confirmed"],
["resolved", "已处理", "Resolved"],
["fixed", "已修复", "Fixed"],
["false_positive", "误报", "False positive"],
["ignored", "忽略", "Ignored"],
["duplicate", "重复", "Duplicate"],
["risk_accepted", "风险接受", "Risk accepted"],
],
engine: [
["exploring", "探索中", "Exploring"],
["paused", "已暂停", "Paused"],
["stalled", "停滞", "Stalled"],
["idle", "空闲", "Idle"],
],
goal: [
["open", "进行中", "In progress"],
["met", "已达成", "Met"],
["abandoned", "已放弃", "Abandoned"],
],
audit: [
["allow", "放行", "Allowed"],
["block", "拦截", "Blocked"],
],
node: [
["observed", "观测", "Observed"],
["confirmed", "确认", "Confirmed"],
["tombstoned", "废弃", "Discarded"],
],
delivery: [
["pending", "待发送", "Pending"],
["sending", "发送中", "Sending"],
["sent", "已送达", "Delivered"],
["failed", "失败", "Failed"],
["skipped", "已跳过", "Skipped"],
],
intelligence: [
["credential", "凭据", "Credential"],
["lead", "重要线索", "Lead"],
["sensitive_data", "敏感数据", "Sensitive data"],
],
};
export const resources = {
"zh-CN": { translation: Object.fromEntries(Object.entries(messages).map(([key, pair]) => [key, pair[0]])) },
en: { translation: Object.fromEntries(Object.entries(messages).map(([key, pair]) => [key, pair[1]])) },
};
for (const [domain, entries] of Object.entries(statuses)) {
for (const [value, zh, en] of entries) {
resources["zh-CN"].translation[`status.${domain}.${value}`] = zh;
resources.en.translation[`status.${domain}.${value}`] = en;
}
}
+242
View File
@@ -0,0 +1,242 @@
export const notifyMessages = {
"notify.nameRequired": ["请填写渠道名称", "Enter a channel name"],
"notify.saved": ["已保存", "Saved"],
"notify.added": ["已添加渠道", "Channel added"],
"notify.enabled": ["推送已开启", "Notifications enabled"],
"notify.paused": ["推送已暂停", "Notifications paused"],
"notify.title": ["通知推送", "Notifications"],
"notify.description": [
"发现漏洞时推送到钉钉 / 飞书 / 企业微信等渠道 · 每个渠道可独立设推送时机与过滤规则",
"Send findings to DingTalk, Feishu, WeCom and other channels. Set delivery timing and filters for each channel.",
],
"notify.masterSwitch": ["总开关", "Master switch"],
"notify.masterSwitchLabel": ["推送总开关", "Enable notifications"],
"notify.channels": ["渠道", "Channels"],
"notify.enabledTotal": ["启用 / 总数", "Enabled / total"],
"notify.sentToday": ["今日送达", "Delivered today"],
"notify.pending": ["待发送", "Pending"],
"notify.failed": ["失败", "Failed"],
"notify.oldestBacklog": ["最久积压", "Oldest pending"],
"notify.backlogWarning": ["推送可能卡住了", "Delivery may be stalled"],
"notify.globalSettings": ["全局设置", "Global settings"],
"notify.baseUrl": ["回链地址", "Console URL"],
"notify.baseUrlHelp": [
"消息里「查看详情」按钮指向的地址。留空则不带按钮。",
"The address used by “View details” buttons in messages. Leave empty to omit the buttons.",
],
"notify.digestInterval": ["汇总周期(分钟)", "Digest interval (minutes)"],
"notify.digestIntervalHelp": ["仅对「汇总」模式的渠道生效。", "Applies only to channels in digest mode."],
"notify.saveGlobal": ["保存全局设置", "Save global settings"],
"notify.deliveries": ["投递记录", "Delivery history"],
"notify.addChannel": ["添加渠道", "Add channel"],
"notify.enable": ["启用", "Enable"],
"notify.delete": ["删除", "Delete"],
"notify.digest": ["汇总", "Digest"],
"notify.realtime": ["实时", "Real time"],
"notify.disabled": ["已停用", "Disabled"],
"notify.addNotificationChannel": ["添加通知渠道", "Add notification channel"],
"notify.unlimitedSuffix": [" · 不限流", " · No rate limit"],
"notify.channelType": ["渠道类型", "Channel type"],
"notify.channelTypeHelp": [
"渠道类型不可修改——改了类型等于换一套凭据,请新建渠道。",
"To use a different channel type and credentials, create a new channel.",
],
"notify.channelName": ["渠道名称", "Channel name"],
"notify.channelNameExample": ["应急响应群 / 日常播报群", "Incident response / Daily updates"],
"notify.missingFields": [
"该渠道的表单尚未定义(前端缺 CHANNEL_FIELDS 条目),请补全后再试。",
"Configuration for this channel type is not available yet.",
],
"notify.timing": ["推送时机", "Delivery timing"],
"notify.realtimeOption": ["实时 · 每条漏洞单独发一条", "Real time · Send each finding separately"],
"notify.digestOption": ["汇总 · 按周期合并成一条", "Digest · Combine findings at each interval"],
"notify.timingHelp": [
"想做「高危实时、其余汇总」就建两个渠道:一个实时 + 门槛高危,一个汇总 + 不限级别。",
"For immediate high-severity alerts and regular digests, create two channels: one real-time channel with a high-severity threshold and one digest channel with no severity limit.",
],
"notify.rateLimit": ["限流(条/分钟)", "Rate limit (messages/minute)"],
"notify.unlimited": ["0 = 不限", "0 = unlimited"],
"notify.rateHelp": [
"留空用渠道默认值;0 表示不限流。超限不会丢消息,只会推迟发送。",
"Leave empty to use the channel default, or enter 0 for no limit. Messages above the limit are delayed.",
],
"notify.filterRules": ["过滤规则(留空即不过滤)", "Filters (leave empty for no filtering)"],
"notify.minSeverity": ["最低级别", "Minimum severity"],
"notify.includeTypes": ["只推这些漏洞类型", "Include finding types"],
"notify.includeExample": ["SQL注入\n命令执行", "SQL injection\nCommand execution"],
"notify.includeHelp": [
"每行一个关键词,大小写不敏感的子串匹配。留空=全部类型。",
"One keyword per line. Matches substrings without case sensitivity. Leave empty for all types.",
],
"notify.excludeTypes": ["排除这些漏洞类型", "Exclude finding types"],
"notify.excludeExample": ["信息泄露", "Information disclosure"],
"notify.excludeHelp": ["排除优先于包含:同时命中时会被排除。", "Exclusions take priority when both filters match."],
"notify.taskIds": ["限定任务 ID", "Restrict to task IDs"],
"notify.assetIds": ["限定资产 ID", "Restrict to asset IDs"],
"notify.idsHelp": [
"任务/资产留空=不限;填写后要求与漏洞有交集。",
"Leave task and asset IDs empty for no restriction. Otherwise, findings must match the specified IDs.",
],
"notify.statusChangesLabel": ["接收状态变更", "Receive status changes"],
"notify.statusChangesHelp": [
"漏洞处置状态变更时也推送(仅实时模式)",
"Also notify when a finding’s resolution status changes (real-time mode only)",
],
"notify.enableChannel": ["启用该渠道", "Enable this channel"],
"notify.save": ["保存", "Save"],
"notify.add": ["添加", "Add"],
"notify.test": ["发送测试消息", "Send test message"],
"notify.withStatusChanges": ["含状态变更", "Includes status changes"],
"notify.allFindings": ["全部漏洞", "All findings"],
"notify.kinds.dingtalk": ["钉钉", "DingTalk"],
"notify.kinds.feishu": ["飞书", "Feishu"],
"notify.kinds.wecom": ["企业微信", "WeCom"],
"notify.kinds.webhook": ["通用 Webhook", "Generic webhook"],
"notify.kinds.email": ["邮件", "Email"],
"notify.fields.webhook": ["Webhook 地址", "Webhook URL"],
"notify.fields.signingSecret": ["加签密钥", "Signing secret"],
"notify.fields.dingtalkSecretHelp": [
"机器人安全设置选「加签」时填写;选「自定义关键词」或未开启安全设置则留空",
"Enter when the bot uses signing security. Leave empty for custom keywords or no security setting.",
],
"notify.fields.verificationSecret": ["签名校验密钥", "Signature verification secret"],
"notify.fields.feishuSecretHelp": [
"机器人开启「签名校验」时填写,否则留空",
"Enter when signature verification is enabled for the bot; otherwise leave empty.",
],
"notify.fields.targetUrl": ["目标 URL", "Target URL"],
"notify.fields.method": ["请求方法", "Request method"],
"notify.fields.post": ["POST(带请求体)", "POST (with body)"],
"notify.fields.put": ["PUT(带请求体)", "PUT (with body)"],
"notify.fields.patch": ["PATCH(带请求体)", "PATCH (with body)"],
"notify.fields.get": ["GET(不带请求体)", "GET (without body)"],
"notify.fields.headers": ["自定义请求头", "Custom headers"],
"notify.fields.headersHelp": [
"每行 KEY=VALUE,例如 Authorization=Bearer xxx",
"One KEY=VALUE per line, for example Authorization=Bearer xxx",
],
"notify.fields.bodyTemplate": ["请求体模板", "Body template"],
"notify.fields.apiUrl": ["API 地址", "API URL"],
"notify.fields.apiUrlHelp": [
"留空用官方地址;自建 Bot API 反代时填写",
"Leave empty to use the official API, or enter a custom Bot API proxy URL.",
],
"notify.fields.smtpHost": ["SMTP 服务器", "SMTP server"],
"notify.fields.port": ["端口", "Port"],
"notify.fields.portHelp": [
"587 走 STARTTLS;465 请把「隐式 TLS」打开",
"Port 587 uses STARTTLS; enable implicit TLS for port 465.",
],
"notify.fields.username": ["账号", "Username"],
"notify.fields.password": ["密码 / 授权码", "Password / app password"],
"notify.fields.from": ["发件人", "Sender"],
"notify.fields.to": ["收件人", "Recipients"],
"notify.fields.toHelp": ["多个地址用逗号分隔", "Separate multiple addresses with commas"],
"notify.fields.tls": ["隐式 TLS", "Implicit TLS"],
"notify.fields.tlsHelp": [
"465 端口打开;587 保持关闭(会自动 STARTTLS)",
"Enable for port 465; keep disabled for port 587 (STARTTLS is automatic).",
],
"notify.severity.any": ["不限", "Any severity"],
"notify.severity.low": ["低危及以上", "Low and above"],
"notify.severity.medium": ["中危及以上", "Medium and above"],
"notify.severity.high": ["高危及以上", "High and above"],
"notify.severity.critical": ["仅严重", "Critical only"],
"notify.requeued": ["已重新入队", "Queued again"],
"notify.allChannels": ["全部渠道", "All channels"],
"notify.allStates": ["全部状态", "All statuses"],
"notify.refresh": ["刷新", "Refresh"],
"notify.time": ["时间", "Time"],
"notify.finding": ["漏洞", "Finding"],
"notify.status": ["状态", "Status"],
"notify.attempts": ["尝试", "Attempts"],
"notify.error": ["错误", "Error"],
"notify.loading": ["加载中…", "Loading…"],
"notify.emptyDeliveries": ["暂无投递记录", "No delivery records yet"],
"notify.untitled": ["(无标题)", "(Untitled)"],
"notify.statusChanged": ["状态变更", "Status changed"],
"notify.retry": ["重发", "Retry"],
"notify.previous": ["上一页", "Previous page"],
"notify.next": ["下一页", "Next page"],
"notify.loadMetaFailed": ["读取推送配置失败:{{message}}", "Could not load notification settings: {{message}}"],
"notify.loadChannelsFailed": ["读取渠道列表失败:{{message}}", "Could not load channels: {{message}}"],
"notify.saveFailed": ["保存失败:{{message}}", "Could not save: {{message}}"],
"notify.testFailed": ["测试失败:{{message}}", "Test failed: {{message}}"],
"notify.deleteFailed": ["删除失败:{{message}}", "Could not delete: {{message}}"],
"notify.actionFailed": ["操作失败:{{message}}", "Operation failed: {{message}}"],
"notify.loadDeliveriesFailed": ["读取投递记录失败:{{message}}", "Could not load delivery history: {{message}}"],
"notify.retryFailed": ["重发失败:{{message}}", "Could not retry delivery: {{message}}"],
"notify.testSent": [
"已发出测试消息({{latency}} ms),请到群里确认",
"Test message sent ({{latency}} ms). Check the destination to confirm delivery.",
],
"notify.deletedChannel": ["已删除:{{name}}", "Deleted: {{name}}"],
"notify.defaultRate_one": [" · 默认限流 {{count}} 条/分钟", " · Default rate limit: {{count}} message/minute"],
"notify.defaultRate_other": [" · 默认限流 {{count}} 条/分钟", " · Default rate limit: {{count}} messages/minute"],
"notify.maskedHint": [
"已保存{{tail}} · 填入新值即覆盖,清空则删除该项",
"Saved{{tail}} · Enter a new value to replace it, or clear it to remove it",
],
"notify.maskedTail": ["(尾号 {{tail}})", " (ending in {{tail}})"],
"notify.includeWords_one": ["类型含 {{count}} 词", "Type matches {{count}} keyword"],
"notify.includeWords_other": ["类型含 {{count}} 词", "Type matches {{count}} keywords"],
"notify.excludeWords_one": ["排除 {{count}} 词", "Excludes {{count}} keyword"],
"notify.excludeWords_other": ["排除 {{count}} 词", "Excludes {{count}} keywords"],
"notify.tasks_one": ["{{count}} 个任务", "{{count}} task"],
"notify.tasks_other": ["{{count}} 个任务", "{{count}} tasks"],
"notify.assets_one": ["{{count}} 个资产", "{{count}} asset"],
"notify.assets_other": ["{{count}} 个资产", "{{count}} assets"],
"notify.total_one": ["共 {{count}} 条", "{{count}} record"],
"notify.total_other": ["共 {{count}} 条", "{{count}} records"],
"notify.seconds_one": ["{{count}} 秒", "{{count}} second"],
"notify.seconds_other": ["{{count}} 秒", "{{count}} seconds"],
"notify.minutes_one": ["{{count}} 分钟", "{{count}} minute"],
"notify.minutes_other": ["{{count}} 分钟", "{{count}} minutes"],
"notify.hours_one": ["{{count}} 小时", "{{count}} hour"],
"notify.hours_other": ["{{count}} 小时", "{{count}} hours"],
"notify.fields.bodyTemplateHelp": [
"留空用内置默认模板。变量:{{variables}},以及 range .Items 下的 {{fields}}。插入字符串请用 {{jsonExample}} 而不是 {{rawExample}},否则标题里的引号会破坏 JSON。",
"Leave empty to use the default template. Variables: {{variables}}, plus {{fields}} within range .Items. Insert strings using {{jsonExample}} instead of {{rawExample}} so quotes in titles do not break JSON.",
],
"notify.runtime.invalidKind": ["渠道类型无效", "Invalid channel type"],
"notify.runtime.nameMissing": ["缺少渠道名称", "Channel name is required"],
"notify.runtime.emptyName": ["渠道名称不能为空", "Channel name is required"],
"notify.runtime.notFound": ["通知渠道不存在", "Notification channel not found"],
"notify.runtime.invalidChannelId": ["渠道 id 无效", "Invalid channel ID"],
"notify.runtime.invalidDeliveryId": ["投递 id 无效", "Invalid delivery ID"],
"notify.runtime.invalidMode": [
"推送模式无效,可选:realtime / digest",
"Invalid delivery mode. Choose realtime or digest",
],
"notify.runtime.negativeRate": ["限流值不能为负", "Rate limit cannot be negative"],
"notify.runtime.invalidMeta": [
"通知配置响应不完整,请刷新后重试",
"Notification settings are incomplete. Refresh and try again.",
],
"notify.runtime.demoTest": [
"演示模式不会发送真实通知,请在实际部署中测试",
"Demo mode does not send notifications. Test this channel in a deployed instance.",
],
"notify.runtime.demoRecord": ["演示模式中没有对应的通知记录", "No matching notification record in demo mode"],
"notify.runtime.webhookRequired": ["缺少 Webhook 地址", "Webhook URL is required"],
"notify.runtime.smtpRequired": ["缺少 SMTP 服务器地址", "SMTP server is required"],
"notify.runtime.smtpPort": ["SMTP 端口无效(应为 1-65535)", "SMTP port must be between 1 and 65535"],
"notify.runtime.senderRequired": ["缺少发件人地址", "Sender address is required"],
"notify.runtime.recipientRequired": ["至少需要一个收件人地址", "At least one recipient is required"],
"notify.runtime.botTokenRequired": ["缺少 Bot Token", "Bot token is required"],
"notify.runtime.chatIdRequired": ["缺少 Chat ID", "Chat ID is required"],
"notify.runtime.targetRequired": ["缺少目标 URL", "Target URL is required"],
"notify.runtime.invalidTemplateJson": [
"请求体模板渲染结果不是合法 JSON",
"The rendered body template is not valid JSON",
],
"notify.runtime.hostRequired": ["缺少主机名", "Hostname is required"],
"notify.runtime.redirectLimit": ["重定向次数过多", "Too many redirects"],
"notify.runtime.kindOptions": ["渠道类型无效,可选:{{detail}}", "Invalid channel type. Choose: {{detail}}"],
"notify.runtime.webhookInvalid": ["Webhook 地址无效: {{detail}}", "Invalid webhook URL: {{detail}}"],
"notify.runtime.apiInvalid": ["API 地址无效: {{detail}}", "Invalid API URL: {{detail}}"],
"notify.runtime.targetInvalid": ["目标 URL 无效: {{detail}}", "Invalid target URL: {{detail}}"],
"notify.runtime.templateSyntax": ["请求体模板语法错误: {{detail}}", "Body template syntax error: {{detail}}"],
"notify.runtime.templateRender": ["渲染请求体模板失败: {{detail}}", "Could not render body template: {{detail}}"],
"notify.runtime.requestJson": ["请求体不是合法 JSON: {{detail}}", "Request body is not valid JSON: {{detail}}"],
} as const;
+46
View File
@@ -0,0 +1,46 @@
import type { TFunction } from "i18next";
import { localizedError } from "./errors";
// Only recognize messages owned by ARTEX. Provider responses remain verbatim.
const messages: Record<string, string> = {
渠道类型无效: "notify.runtime.invalidKind",
缺少渠道名称: "notify.runtime.nameMissing",
渠道名称不能为空: "notify.runtime.emptyName",
通知渠道不存在: "notify.runtime.notFound",
"渠道 id 无效": "notify.runtime.invalidChannelId",
"投递 id 无效": "notify.runtime.invalidDeliveryId",
"推送模式无效,可选:realtime / digest": "notify.runtime.invalidMode",
限流值不能为负: "notify.runtime.negativeRate",
"通知配置响应不完整,请刷新后重试": "notify.runtime.invalidMeta",
"演示模式不会发送真实通知,请在实际部署中测试": "notify.runtime.demoTest",
演示模式中没有对应的通知记录: "notify.runtime.demoRecord",
"缺少 Webhook 地址": "notify.runtime.webhookRequired",
"缺少 SMTP 服务器地址": "notify.runtime.smtpRequired",
"SMTP 端口无效(应为 1-65535)": "notify.runtime.smtpPort",
缺少发件人地址: "notify.runtime.senderRequired",
至少需要一个收件人地址: "notify.runtime.recipientRequired",
"缺少 Bot Token": "notify.runtime.botTokenRequired",
"缺少 Chat ID": "notify.runtime.chatIdRequired",
"缺少目标 URL": "notify.runtime.targetRequired",
"请求体模板渲染结果不是合法 JSON": "notify.runtime.invalidTemplateJson",
缺少主机名: "notify.runtime.hostRequired",
重定向次数过多: "notify.runtime.redirectLimit",
};
const prefixes: [string, string][] = [
["渠道类型无效,可选:", "notify.runtime.kindOptions"],
["Webhook 地址无效: ", "notify.runtime.webhookInvalid"],
["API 地址无效: ", "notify.runtime.apiInvalid"],
["目标 URL 无效: ", "notify.runtime.targetInvalid"],
["请求体模板语法错误: ", "notify.runtime.templateSyntax"],
["渲染请求体模板失败: ", "notify.runtime.templateRender"],
["请求体不是合法 JSON: ", "notify.runtime.requestJson"],
];
export function notificationError(error: unknown, translate: TFunction): string {
const value = localizedError(error, translate);
if (messages[value]) return translate(messages[value]);
for (const [prefix, key] of prefixes) {
if (value.startsWith(prefix)) return translate(key, { detail: value.slice(prefix.length) });
}
return value;
}
+204
View File
@@ -0,0 +1,204 @@
// Fixed chat and dashboard UI text; conversation content is kept unchanged.
export const overviewMessages = {
"overview.live": ["实时", "Live"],
"overview.remove": ["移除", "Remove"],
"overview.uploadFile": ["上传文件", "Upload file"],
"overview.sendSideQuestion": ["发送旁路问题", "Send side question"],
"overview.stopRun": ["停止本次运行", "Stop this run"],
"overview.sendMessage": ["发送消息", "Send message"],
"overview.change": ["更换", "Change"],
"overview.chooseProfile": ["选择 LLM 配置", "Select LLM profile"],
"overview.default": ["默认", "Default"],
"overview.sendFailedPrefix": ["发送失败:", "Could not send: "],
"overview.uploadFailedPrefix": ["上传失败:", "Upload failed: "],
"overview.chooseAgent": ["选择 Agent…", "Select Agent…"],
"overview.custom": ["自定义", "Custom"],
"overview.messagePlaceholder": [
"输入消息,@ 引用记录,Enter 发送",
"Type a message, use @ to reference records, Enter to send",
],
"overview.switchProfileFailedPrefix": ["切换 LLM 失败:", "Could not switch LLM: "],
"overview.stopFailedPrefix": ["停止失败:", "Could not stop: "],
"overview.sideQuestionUnavailable": [
"主 Agent 首次运行后即可提问",
"Ask a question after the main Agent has run once",
],
"overview.sideQuestionHelp": [
"根据当前 Agent 的上下文回答,主任务继续运行。",
"Answers using the current Agent’s context while the main task continues.",
],
"overview.roundsHint": ["agent 循环轮次(模型调用次数)", "Agent loop turns (model calls)"],
"overview.olderMessages": ["向上滚动加载更早的消息…", "Scroll up to load earlier messages…"],
"overview.runningPlaceholder": [
"Agent 正在回复,可输入 /btw 提问…",
"Agent is replying. Type /btw to ask a side question…",
],
"overview.selectConversation": ["选择对话「{{title}}」", "Select conversation “{{title}}”"],
"overview.renameHint": ["双击重命名", "Double-click to rename"],
"overview.pinned": ["已置顶", "Pinned"],
"overview.newConversation": ["新对话", "New conversation"],
"overview.agentRunning": ["Agent 正在运行", "Agent is running"],
"overview.running": ["运行中", "Running"],
"overview.manageConversation": ["管理对话「{{title}}」", "Manage conversation “{{title}}”"],
"overview.rename": ["重命名", "Rename"],
"overview.unpin": ["取消置顶", "Unpin"],
"overview.pin": ["置顶", "Pin"],
"overview.delete": ["删除", "Delete"],
"overview.irreversible": ["此操作不可撤销。", "This action cannot be undone."],
"overview.cancel": ["取消", "Cancel"],
"overview.expandGroup": ["展开「{{name}}」", "Expand “{{name}}”"],
"overview.collapseGroup": ["收起「{{name}}」", "Collapse “{{name}}”"],
"overview.activeConversationGroup": ["当前对话在此分组内", "The current conversation is in this group"],
"overview.runningConversations": ["{{count}} 个对话运行中", "{{count}} conversations running"],
"overview.totalConversations": ["共 {{count}} 个", "{{count}} total"],
"overview.filteredConversations": ["{{visible}} / {{total}} 个", "{{visible}} of {{total}}"],
"overview.deleteFailedPrefix": ["删除失败:", "Could not delete: "],
"overview.conversationNotFound": ["对话不存在", "Conversation not found"],
"overview.conversationsDeleted": ["已删除 {{count}} 个对话", "Deleted {{count}} conversations"],
"overview.conversationsDeleteFailed": [
"{{count}} 个对话删除失败:{{details}}{{more}}",
"Could not delete {{count}} conversations: {{details}}{{more}}",
],
"overview.bulkDeleteFailed": ["批量删除失败:{{message}}", "Bulk deletion failed: {{message}}"],
"overview.pinFailed": ["{{action}}失败:{{message}}", "Could not {{action}}: {{message}}"],
"overview.renameFailedPrefix": ["重命名失败:", "Could not rename: "],
"overview.createConversation": ["新建对话", "New conversation"],
"overview.filterAgents": ["按 Agent 筛选对话", "Filter conversations by Agent"],
"overview.allAgents": ["全部 Agent", "All Agents"],
"overview.selectFilteredConversations": ["选择当前筛选的全部对话", "Select all filtered conversations"],
"overview.selectedConversations": ["已选 {{count}} 个", "{{count}} selected"],
"overview.done": ["完成", "Done"],
"overview.selectMultiple": ["多选", "Select multiple"],
"overview.emptyConversations": ["暂无对话", "No conversations yet"],
"overview.emptyAgentConversations": ["该 Agent 暂无对话", "No conversations for this Agent"],
"overview.loadMore": ["加载更多", "Load more"],
"overview.conversationDeleted": ["对话已被删除", "This conversation was deleted"],
"overview.loadingConversation": ["正在加载对应对话…", "Loading conversation…"],
"overview.deleteConversationHelp": [
"对话消息和执行记录将一并删除,此操作不可撤销。",
"Conversation messages and execution history will also be deleted. This action cannot be undone.",
],
"overview.deleting": ["删除中", "Deleting"],
"overview.confirmDelete": ["确认删除", "Confirm deletion"],
"overview.input": ["输入", "Input"],
"overview.output": ["输出", "Output"],
"overview.cacheRead": ["缓存读", "Cache read"],
"overview.secondsAgo": ["{{count}}s 前", "{{count}}s ago"],
"overview.minutesAgo": ["{{count}}m 前", "{{count}}m ago"],
"overview.hoursAgo": ["{{count}}h 前", "{{count}}h ago"],
"overview.daysAgo": ["{{count}}d 前", "{{count}}d ago"],
"overview.asset.root_domain": ["根域名", "Root domain"],
"overview.asset.subdomain": ["子域名", "Subdomain"],
"overview.asset.app": ["应用", "Application"],
"overview.asset.service": ["服务", "Service"],
"overview.asset.endpoint": ["端点", "Endpoint"],
"overview.resourceUnsupported": ["资源状态:暂不支持", "Resource metrics are unavailable on this platform"],
"overview.memory": ["内存", "Memory"],
"overview.disk": ["磁盘", "Disk"],
"overview.containerResources": ["容器资源", "Container resources"],
"overview.title": ["总览", "Overview"],
"overview.subtitle": ["系统全局状态 · 实时刷新", "Global system status · Updates live"],
"overview.activeTasks": ["活跃任务", "Active tasks"],
"overview.exploring": ["探索", "Exploring"],
"overview.paused": ["暂停", "Paused"],
"overview.emptyTasks": ["暂无任务", "No tasks yet"],
"overview.confirmedFindings": ["确认发现", "Confirmed findings"],
"overview.critical": ["严重", "Critical"],
"overview.high": ["高危", "High"],
"overview.medium": ["中危", "Medium"],
"overview.low": ["低危", "Low"],
"overview.assetNodes": ["资产节点", "Asset nodes"],
"overview.sharedAcrossTasks": ["跨任务共享", "Shared across tasks"],
"overview.trafficExchanges": ["流量交互", "Traffic exchanges"],
"overview.recording": ["录制中", "Recording"],
"overview.captureDisabled": ["捕获未开启", "Capture disabled"],
"overview.tokenUsage": ["Token 用量", "Token usage"],
"overview.llmTokens": ["LLM Token 消耗", "LLM token usage"],
"overview.legacyMetrics": ["旧版", "Legacy"],
"overview.ledgerMetrics": ["新版", "Ledger"],
"overview.ledgerMetricsHelp": [
"新版:来自 llm_usage 计量账本,逐次调用精确、含中断消耗;仅覆盖启用后的数据",
"Ledger: precise per-call accounting from llm_usage, including interrupted calls; covers data collected since it was enabled",
],
"overview.legacyMetricsHelp": [
"旧版:来自 activity 统计(含历史任务),中断消耗不计、无法精确到模型",
"Legacy: activity-based totals, including historical tasks; excludes interrupted calls and cannot identify exact models",
],
"overview.all": ["全部", "All"],
"overview.totalTokens": ["合计 (输入+输出)", "Total (input + output)"],
"overview.uncachedInput": ["输入(未命中)", "Input (cache miss)"],
"overview.cacheHit": ["缓存命中", "Cache hit"],
"overview.cacheHitRate": ["缓存命中率", "Cache hit rate"],
"overview.sevenDays": ["7天", "7 days"],
"overview.thirtyDays": ["30天", "30 days"],
"overview.threeMonths": ["3月", "3 months"],
"overview.sixMonths": ["6月", "6 months"],
"overview.oneYear": ["一年", "1 year"],
"overview.noData": ["暂无数据", "No data yet"],
"overview.activity": ["活动流", "Activity"],
"overview.viewTasks": ["查看任务", "View tasks"],
"overview.emptyActivity": ["暂无活动记录", "No activity yet"],
"overview.findings": ["发现", "Findings"],
"overview.emptyFindings": ["暂无发现", "No findings yet"],
"overview.tasks": ["任务", "Tasks"],
"overview.status": ["状态", "Status"],
"overview.engine": ["引擎", "Engine"],
"overview.goalProgress": ["目标进度", "Goal progress"],
"overview.inFlight": ["在途", "In flight"],
"overview.lastActivity": ["最近活动", "Last activity"],
"overview.byType": ["按类型", "By type"],
"overview.assetDistribution": ["资产分布", "Asset distribution"],
"overview.emptyAssets": ["暂无资产数据", "No asset data yet"],
"overview.requestCount": ["{{count}} 次请求", "{{count}} requests"],
"overview.trafficStatusCodes": ["流量状态码", "Traffic status codes"],
"overview.emptyTraffic": ["暂无流量数据", "No traffic data yet"],
"overview.recentRequests": ["最近请求", "Recent requests"],
"overview.systemStatus": ["系统状态", "System status"],
"overview.llmProfiles": ["LLM 配置", "LLM profiles"],
"overview.configured": ["已配置", "Configured"],
"overview.notConfigured": ["未配置", "Not configured"],
"overview.trafficCapture": ["流量捕获", "Traffic capture"],
"overview.enabled": ["开启", "Enabled"],
"overview.disabled": ["关闭", "Disabled"],
"overview.activeModel": ["激活模型", "Active model"],
"overview.noPendingApprovals": ["无待审批拦截", "No pending approvals"],
"overview.moreSuffix": [" 等", " and others"],
"overview.defaultProfileWithName": ["默认({{name}})", "Default ({{name}})"],
"overview.startChat": ["开始和「{{name}}」对话", "Start a conversation with “{{name}}”"],
"overview.deleteConversation": ["删除对话「{{title}}」?", "Delete conversation “{{title}}”?"],
"overview.deleteSelected": ["删除选中的 {{count}} 个对话?", "Delete {{count}} selected conversations?"],
"overview.deleteSelected_one": ["删除选中的 {{count}} 个对话?", "Delete {{count}} selected conversation?"],
"overview.deleteSelected_other": ["删除选中的 {{count}} 个对话?", "Delete {{count}} selected conversations?"],
"overview.rounds": ["{{count}} 轮", "{{count}} turns"],
"overview.rounds_one": ["{{count}} 轮", "{{count}} turn"],
"overview.rounds_other": ["{{count}} 轮", "{{count}} turns"],
"overview.taskCount": ["{{count}} 个任务", "{{count}} tasks"],
"overview.taskCount_one": ["{{count}} 个任务", "{{count}} task"],
"overview.taskCount_other": ["{{count}} 个任务", "{{count}} tasks"],
"overview.eventCount": ["{{count}} 条事件", "{{count}} events"],
"overview.eventCount_one": ["{{count}} 条事件", "{{count}} event"],
"overview.eventCount_other": ["{{count}} 条事件", "{{count}} events"],
"overview.nodeTotal": ["共 {{count}} 个节点", "Total: {{count}} nodes"],
"overview.nodeTotal_one": ["共 {{count}} 个节点", "Total: {{count}} node"],
"overview.nodeTotal_other": ["共 {{count}} 个节点", "Total: {{count}} nodes"],
"overview.pendingApprovals": ["待审批({{count}})", "Pending approvals ({{count}})"],
"overview.moreApprovals": ["还有 {{count}} 条…", "Plus {{count}} more…"],
"overview.tokenBreakdown": [
"入 {{input}}(含缓存 {{cache}})· 出 {{output}}",
"In {{input}} (including cache {{cache}}) · Out {{output}}",
],
"overview.runningConversations_one": ["{{count}} 个对话运行中", "{{count}} conversation running"],
"overview.runningConversations_other": ["{{count}} 个对话运行中", "{{count}} conversations running"],
"overview.conversationsDeleted_one": ["已删除 {{count}} 个对话", "Deleted {{count}} conversation"],
"overview.conversationsDeleted_other": ["已删除 {{count}} 个对话", "Deleted {{count}} conversations"],
"overview.conversationsDeleteFailed_one": [
"{{count}} 个对话删除失败:{{details}}{{more}}",
"Could not delete {{count}} conversation: {{details}}{{more}}",
],
"overview.conversationsDeleteFailed_other": [
"{{count}} 个对话删除失败:{{details}}{{more}}",
"Could not delete {{count}} conversations: {{details}}{{more}}",
],
"overview.requestCount_one": ["{{count}} 次请求", "{{count}} request"],
"overview.requestCount_other": ["{{count}} 次请求", "{{count}} requests"],
} satisfies Record<string, readonly [string, string]>;
+41
View File
@@ -0,0 +1,41 @@
"use client";
import { type ReactNode, useEffect, useState } from "react";
import { I18nextProvider } from "react-i18next";
import { LOCALE_STORAGE_KEY, resolveLocale } from "./config";
import { createAppI18n } from "./instance";
export function AppI18nProvider({ children }: { children: ReactNode }) {
// A per-tree instance keeps prerenders isolated. The first browser render
// matches static HTML; saved preferences are applied after hydration.
const [instance] = useState(createAppI18n);
useEffect(() => {
const updateDocument = () => {
document.documentElement.lang = resolveLocale(instance.resolvedLanguage);
document.title = instance.t("meta.title");
document.querySelector('meta[name="description"]')?.setAttribute("content", instance.t("meta.description"));
};
instance.on("languageChanged", updateDocument);
updateDocument();
try {
void instance.changeLanguage(resolveLocale(localStorage.getItem(LOCALE_STORAGE_KEY)));
} catch {
// Language selection still works when browser storage is unavailable.
}
const syncPreference = (event: StorageEvent) => {
if (event.key === LOCALE_STORAGE_KEY || event.key === null) {
void instance.changeLanguage(resolveLocale(event.newValue));
}
};
window.addEventListener("storage", syncPreference);
return () => {
instance.off("languageChanged", updateDocument);
window.removeEventListener("storage", syncPreference);
};
}, [instance]);
return <I18nextProvider i18n={instance}>{children}</I18nextProvider>;
}
+205
View File
@@ -0,0 +1,205 @@
export const scheduleMessages = {
"schedule.loadingTimeline": ["加载运行时间线…", "Loading run timeline…"],
"schedule.emptyTimeline": [
"暂无运行记录,计划进入第一个窗口后会显示时间线。",
"No runs yet. The timeline appears after the first scheduled window.",
],
"schedule.timeline": ["运行时间线", "Run timeline"],
"schedule.title": ["计划任务", "Schedules"],
"schedule.noTasks": ["暂无任务", "No tasks yet"],
"schedule.noMatchingTasks": ["没有匹配的任务", "No matching tasks"],
"schedule.name": ["计划名称", "Schedule name"],
"schedule.nameExample": ["例如:周末持续扫描", "For example: Weekend continuous scan"],
"schedule.rule": ["规则", "Rule"],
"schedule.weekly": ["按周", "Weekly"],
"schedule.once": ["指定日期", "Specific date"],
"schedule.timezone": ["时区", "Time zone"],
"schedule.beijing": ["中国北京时间", "Beijing time (UTC+8)"],
"schedule.systemTimezone": ["系统当前时区", "System time zone"],
"schedule.startDate": ["开始日期", "Start date"],
"schedule.endDateOptional": ["截止日期(可选)", "End date (optional)"],
"schedule.noEndDate": ["不设置截止日期", "No end date"],
"schedule.endDateAccessible": ["截止日期,可选", "End date, optional"],
"schedule.weekdays": ["星期", "Days of the week"],
"schedule.startTime": ["开始时间", "Start time"],
"schedule.endTime": ["结束时间", "End time"],
"schedule.endTimeOptional": ["结束时间(可选)", "End time (optional)"],
"schedule.endTimeAccessible": ["结束时间,可选", "End time, optional"],
"schedule.windowHelp": [
"一次性计划可设置截止日期;截止日期为空时仅按结束时间控制。结束时间为空表示持续运行,结束时间早于开始时间表示跨午夜窗口。",
"A one-time schedule can have an end date. Without one, only the end time controls when it stops. Leave the end time empty to run continuously. An end time earlier than the start time runs past midnight.",
],
"schedule.startImmediately": [
"创建后立即启动,不等待第一个窗口",
"Start immediately after creation, before the first scheduled window",
],
"schedule.boundTasks": ["绑定任务", "Linked tasks"],
"schedule.searchTasks": ["检索任务名称、描述或 ID", "Search task names, descriptions or IDs"],
"schedule.cancel": ["取消", "Cancel"],
"schedule.save": ["保存计划", "Save schedule"],
"schedule.required": [
"请补全计划名称、日期/星期和开始时间",
"Enter a schedule name, date or weekdays, and start time",
],
"schedule.saved": ["计划已保存", "Schedule saved"],
"schedule.confirmDelete": ["确定删除这个计划吗?", "Delete this schedule?"],
"schedule.loading": ["加载计划中…", "Loading schedules…"],
"schedule.empty": ["暂无计划任务,点击“新建计划”开始。", "No schedules yet. Click “New schedule” to get started."],
"schedule.search": ["检索计划名称、计划 ID 或任务 ID", "Search schedule names, schedule IDs or task IDs"],
"schedule.perPage": ["每页", "Per page"],
"schedule.runNow": ["立即运行", "Run now"],
"schedule.delete": ["删除", "Delete"],
"schedule.clearSelection": ["清空选择", "Clear selection"],
"schedule.noMatches": ["没有匹配的计划任务。", "No matching schedules."],
"schedule.selectPage": ["选择当前页计划", "Select schedules on this page"],
"schedule.remark": ["备注", "Notes"],
"schedule.timelineColumn": ["时间线", "Timeline"],
"schedule.period": ["运行周期", "Run period"],
"schedule.runCount": ["运行次数", "Run count"],
"schedule.statusLabel": ["状态", "Status"],
"schedule.actions": ["操作", "Actions"],
"schedule.collapse": ["收起", "Collapse"],
"schedule.view": ["查看", "View"],
"schedule.none": ["无", "None"],
"schedule.edit": ["编辑", "Edit"],
"schedule.pause": ["暂停", "Pause"],
"schedule.enable": ["启用", "Enable"],
"schedule.previous": ["上一页", "Previous page"],
"schedule.next": ["下一页", "Next page"],
"schedule.description": [
"按北京时间或系统时区控制扫描任务的开始、暂停和恢复。",
"Start, pause and resume scan tasks using Beijing time or the system time zone.",
],
"schedule.create": ["新建计划", "New schedule"],
"schedule.editSchedule": ["编辑计划", "Edit schedule"],
"schedule.pauseHelp": [
"计划结束时会暂停任务,下一次有效窗口自动继续。",
"Tasks pause when the window ends and resume automatically in the next scheduled window.",
],
"schedule.notSet": ["未设置", "Not set"],
"schedule.onceRange": ["一次性 · {{from}} 至 {{to}}", "Once · {{from}} to {{to}}"],
"schedule.onceDate": ["一次性 · {{date}}", "Once · {{date}}"],
"schedule.weeklyDays": ["每周 · {{days}}", "Weekly · {{days}}"],
"schedule.noWeekdays": ["未选择星期", "No weekdays selected"],
"schedule.continuous": ["持续运行", "Runs continuously"],
"schedule.endClock": ["{{time}}{{nextDay}}", "{{time}}{{nextDay}}"],
"schedule.nextDay": ["(次日)", " (next day)"],
"schedule.windowRange": ["{{start}} 至 {{end}}", "{{start}} to {{end}}"],
"schedule.continuousFrom": ["{{start}} 起持续运行", "Runs continuously from {{start}}"],
"schedule.systemTimezoneWithName": ["系统时区({{timezone}})", "System time zone ({{timezone}})"],
"schedule.unknownStatus": ["未知状态", "Unknown status"],
"schedule.statusChanged": ["状态变化", "Status changed"],
"schedule.recentRecords_one": ["最近 {{count}} 条记录", "Latest {{count}} record"],
"schedule.recentRecords_other": ["最近 {{count}} 条记录", "Latest {{count}} records"],
"schedule.taskId": ["任务 #{{id}}", "Task #{{id}}"],
"schedule.scheduleId": ["计划 #{{id}}", "Schedule #{{id}}"],
"schedule.scheduleLabel": ["计划 #{{id}} {{name}}", "Schedule #{{id}} {{name}}"],
"schedule.selectedTasks_one": ["已选 {{count}} 个", "{{count}} selected"],
"schedule.selectedTasks_other": ["已选 {{count}} 个", "{{count}} selected"],
"schedule.startedWithErrors": [
"已启动 {{started}} 个任务,但有 {{failed}} 个任务未启动:{{errors}}",
"Tasks started: {{started}}; tasks that could not start: {{failed}}. {{errors}}",
],
"schedule.started_one": ["已立即运行 {{count}} 个任务", "Started {{count}} task immediately"],
"schedule.started_other": ["已立即运行 {{count}} 个任务", "Started {{count}} tasks immediately"],
"schedule.scheduleError": ["计划 #{{id}}:{{message}}", "Schedule #{{id}}: {{message}}"],
"schedule.bulkStartedWithErrors": [
"已启动 {{started}} 个任务,但有 {{failed}} 项未完成:{{errors}}",
"Tasks started: {{started}}; incomplete operations: {{failed}}. {{errors}}",
],
"schedule.confirmBulkDelete_one": ["确定删除选中的 {{count}} 个计划吗?", "Delete {{count}} selected schedule?"],
"schedule.confirmBulkDelete_other": ["确定删除选中的 {{count}} 个计划吗?", "Delete {{count}} selected schedules?"],
"schedule.deletedWithErrors": [
"已删除 {{deleted}} 个计划,{{failed}} 个计划删除失败",
"Schedules deleted: {{deleted}}; schedules that could not be deleted: {{failed}}",
],
"schedule.deleted_one": ["已删除 {{count}} 个计划", "Deleted {{count}} schedule"],
"schedule.deleted_other": ["已删除 {{count}} 个计划", "Deleted {{count}} schedules"],
"schedule.rows_one": ["{{count}} 条", "{{count}} row"],
"schedule.rows_other": ["{{count}} 条", "{{count}} rows"],
"schedule.total_one": ["共 {{count}} 条", "{{count}} record"],
"schedule.total_other": ["共 {{count}} 条", "{{count}} records"],
"schedule.selectedSchedules_one": ["已选 {{count}} 个计划", "{{count}} schedule selected"],
"schedule.selectedSchedules_other": ["已选 {{count}} 个计划", "{{count}} schedules selected"],
"schedule.selectSchedule": ["选择计划 {{name}}", "Select schedule {{name}}"],
"schedule.nextWindow": ["下次:{{time}}", "Next: {{time}}"],
"schedule.lastRun": ["最近 {{time}}", "Last run: {{time}}"],
"schedule.lastTransition": ["最近:{{time}}", "Last change: {{time}}"],
"schedule.page": ["第 {{page}} / {{totalPages}} 页", "Page {{page}} of {{totalPages}}"],
"schedule.weekday.1": ["周一", "Mon"],
"schedule.weekday.2": ["周二", "Tue"],
"schedule.weekday.3": ["周三", "Wed"],
"schedule.weekday.4": ["周四", "Thu"],
"schedule.weekday.5": ["周五", "Fri"],
"schedule.weekday.6": ["周六", "Sat"],
"schedule.weekday.7": ["周日", "Sun"],
"schedule.status.waiting": ["等待窗口", "Waiting for window"],
"schedule.status.running": ["窗口运行中", "Window active"],
"schedule.status.outside": ["窗口外", "Outside window"],
"schedule.status.completed": ["已完成", "Completed"],
"schedule.status.error": ["错误", "Error"],
"schedule.status.paused": ["已暂停", "Paused"],
"schedule.history.running": ["窗口开始", "Window started"],
"schedule.history.outside": ["窗口结束", "Window ended"],
"schedule.history.completed": ["计划完成", "Schedule completed"],
"schedule.history.waiting": ["等待窗口", "Waiting for window"],
"schedule.history.paused": ["计划暂停", "Schedule paused"],
"schedule.history.resume": ["恢复任务", "Task resumed"],
"schedule.history.pause": ["暂停任务", "Task paused"],
"schedule.history.error": ["执行错误", "Execution error"],
"schedule.field.end_date": ["截止日期", "End date"],
"schedule.field.run_date": ["开始日期", "Start date"],
"schedule.field.start_time": ["开始时间", "Start time"],
"schedule.field.end_time": ["结束时间", "End time"],
"schedule.field.weekdays": ["星期", "Weekdays"],
"schedule.field.timezone_mode": ["时区", "Time zone"],
"schedule.field.schedule_type": ["规则", "Rule"],
"schedule.runtime.invalidId": ["计划编号无效", "Invalid schedule ID"],
"schedule.runtime.notFound": ["计划不存在", "Schedule not found"],
"schedule.runtime.cannotStart": ["无法启动计划任务", "Could not start schedule"],
"schedule.runtime.nameRequired": ["计划名称不能为空", "Schedule name is required"],
"schedule.runtime.timezoneRequired": [
"时区必须选择北京时间或系统当前时区",
"Choose Beijing time or the system time zone",
],
"schedule.runtime.ruleRequired": ["规则必须选择一次性或按周", "Choose a one-time or weekly schedule"],
"schedule.runtime.startTimeInvalid": ["开始时间格式不正确,请使用 HH:MM", "Invalid start time. Use HH:MM"],
"schedule.runtime.endTimeInvalid": ["结束时间格式不正确,请使用 HH:MM", "Invalid end time. Use HH:MM"],
"schedule.runtime.startDateInvalid": ["开始日期格式不正确", "Invalid start date"],
"schedule.runtime.endDateInvalid": ["截止日期格式不正确", "Invalid end date"],
"schedule.runtime.endDateBeforeStart": ["截止日期不能早于开始日期", "End date cannot be before start date"],
"schedule.runtime.endTimeBeforeStart": [
"同一天的结束时间必须晚于开始时间",
"End time must be after start time on the same day",
],
"schedule.runtime.weekdaysInvalid": [
"星期选择必须为周一至周日且不能重复",
"Choose each weekday at most once, from Monday to Sunday",
],
"schedule.runtime.weekdaysRequired": ["按周计划至少选择一天", "Select at least one weekday"],
"schedule.runtime.taskIdsInvalid": ["绑定任务编号无效或重复", "Linked task IDs are invalid or duplicated"],
"schedule.runtime.tooManyTasks": ["最多选择100个任务", "Select up to 100 tasks"],
"schedule.runtime.taskIdInvalid": ["task_id 无效", "Invalid task ID"],
"schedule.runtime.manualRun": ["手动立即运行", "Manually started immediately"],
"schedule.runtime.stateFailed": ["状态读取失败", "Could not read task state"],
"schedule.runtime.manualPause": ["人工暂停优先", "Manual pause takes priority"],
"schedule.runtime.runNow": ["立即运行", "Run now"],
"schedule.runtime.forceResume": ["立即运行(显式恢复人工暂停)", "Run now (explicitly resume manually paused tasks)"],
"schedule.runtime.window": ["计划窗口", "Scheduled window"],
"schedule.runtime.taskNotFound": ["任务 #{{id}} 未找到", "Task #{{id}} not found"],
"schedule.runtime.taskMissing": ["任务 #{{id}} 不存在", "Task #{{id}} does not exist"],
"schedule.runtime.taskEnded": [
"任务 #{{id}} 已结束,无法立即运行",
"Task #{{id}} has ended and cannot run immediately",
],
"schedule.runtime.taskStateFailed": ["任务 #{{id}} 状态读取失败", "Could not read the state of task #{{id}}"],
"schedule.runtime.taskManualPause": [
"任务 #{{id}} 由人工暂停,计划不能强制恢复",
"Task #{{id}} was paused manually and cannot be resumed by the schedule",
],
"schedule.runtime.taskError": ["任务 #{{id}}:{{message}}", "Task #{{id}}: {{message}}"],
"schedule.runtime.demoNoExecution": [
"演示模式不会执行计划任务,请在实际部署中运行",
"Demo mode does not execute schedules. Run this schedule in a deployed instance.",
],
} as const;
+58
View File
@@ -0,0 +1,58 @@
import type { TFunction } from "i18next";
// Recognize existing server-owned schedule messages, including stored history.
// Unknown details and user content are preserved verbatim.
const messages: Record<string, string> = {
"演示模式不会执行计划任务,请在实际部署中运行": "schedule.runtime.demoNoExecution",
计划编号无效: "schedule.runtime.invalidId",
计划不存在: "schedule.runtime.notFound",
无法启动计划任务: "schedule.runtime.cannotStart",
计划名称不能为空: "schedule.runtime.nameRequired",
时区必须选择北京时间或系统当前时区: "schedule.runtime.timezoneRequired",
规则必须选择一次性或按周: "schedule.runtime.ruleRequired",
"开始时间格式不正确,请使用 HH:MM": "schedule.runtime.startTimeInvalid",
"结束时间格式不正确,请使用 HH:MM": "schedule.runtime.endTimeInvalid",
开始日期格式不正确: "schedule.runtime.startDateInvalid",
截止日期格式不正确: "schedule.runtime.endDateInvalid",
截止日期不能早于开始日期: "schedule.runtime.endDateBeforeStart",
同一天的结束时间必须晚于开始时间: "schedule.runtime.endTimeBeforeStart",
星期选择必须为周一至周日且不能重复: "schedule.runtime.weekdaysInvalid",
按周计划至少选择一天: "schedule.runtime.weekdaysRequired",
绑定任务编号无效或重复: "schedule.runtime.taskIdsInvalid",
最多选择100个任务: "schedule.runtime.tooManyTasks",
"task_id 无效": "schedule.runtime.taskIdInvalid",
手动立即运行: "schedule.runtime.manualRun",
状态读取失败: "schedule.runtime.stateFailed",
人工暂停优先: "schedule.runtime.manualPause",
立即运行: "schedule.runtime.runNow",
"立即运行(显式恢复人工暂停)": "schedule.runtime.forceResume",
计划窗口: "schedule.runtime.window",
};
const taskMessages: [RegExp, string][] = [
[/^任务 #(\d+) 未找到$/, "schedule.runtime.taskNotFound"],
[/^任务 #(\d+) 不存在$/, "schedule.runtime.taskMissing"],
[/^任务 #(\d+) 已结束,无法立即运行$/, "schedule.runtime.taskEnded"],
[/^任务 #(\d+) 状态读取失败$/, "schedule.runtime.taskStateFailed"],
[/^任务 #(\d+) 由人工暂停,计划不能强制恢复$/, "schedule.runtime.taskManualPause"],
];
export function scheduleRuntimeText(value: string, translate: TFunction): string {
const key = messages[value];
if (key) return translate(key);
for (const [pattern, message] of taskMessages) {
const match = pattern.exec(value);
if (match) return translate(message, { id: match[1] });
}
// Scheduler summaries join several task failures with semicolons.
if (value.includes("; ") && value.startsWith("任务 #"))
return value
.split("; ")
.map((part) => scheduleRuntimeText(part, translate))
.join("; ");
const taskError = /^任务 #(\d+)[::]\s*([\s\S]*)$/.exec(value);
if (taskError)
return translate("schedule.runtime.taskError", {
id: taskError[1],
message: scheduleRuntimeText(taskError[2], translate),
});
return value;
}
File diff suppressed because it is too large. Load diff
+368
View File
@@ -0,0 +1,368 @@
const fs = require("node:fs"),
path = require("node:path"),
vm = require("node:vm"),
{ createRequire } = require("node:module");
const base = path.resolve(__dirname, "../.."),
req = createRequire(base + "/package.json"),
ts = req("typescript"),
React = req("react"),
{ renderToStaticMarkup } = req("react-dom/server"),
{ I18nextProvider } = req("react-i18next");
let route = "/function/findings";
const cache = new Map();
const stateSnapshots = new Map();
const noop = () => undefined;
function load(inputFile) {
let file = path.resolve(inputFile);
if (!path.extname(file) || !fs.existsSync(file))
file = [".ts", ".tsx", ".json", "/index.ts", "/index.tsx"].map((x) => file + x).find(fs.existsSync) || file;
if (file.endsWith(".css")) return {};
if (cache.has(file)) return cache.get(file).exports;
if (file.endsWith(".json")) return JSON.parse(fs.readFileSync(file, "utf8"));
const mod = { exports: {} };
cache.set(file, mod);
const compiled = ts.transpileModule(fs.readFileSync(file, "utf8"), {
fileName: file,
compilerOptions: {
target: ts.ScriptTarget.ES2022,
module: ts.ModuleKind.CommonJS,
jsx: ts.JsxEmit.ReactJSX,
esModuleInterop: true,
resolveJsonModule: true,
},
}).outputText;
const custom = (id) =>
id.endsWith(".css")
? {}
: id === "next/navigation"
? {
useRouter: () => ({ push: noop, replace: noop, refresh: noop, back: noop }),
useSearchParams: () => new URLSearchParams("id=1"),
usePathname: () => route,
useParams: () => ({}),
redirect: noop,
notFound: noop,
}
: id.startsWith("@/")
? load(base + "/src/" + id.slice(2))
: id.startsWith(".")
? load(path.resolve(path.dirname(file), id))
: id === "react" && file.endsWith("/components/intelligence-panel.tsx")
? {
...React,
useState(initial) {
// Supply the post-fetch state only to this component. Child
// components and React's actual rendering remain unchanged.
const snapshot = stateSnapshots.get(file);
const index = snapshot ? snapshot.next++ : -1;
return React.useState(snapshot?.values.has(index) ? snapshot.values.get(index) : initial);
},
}
: req(id);
vm.runInThisContext("(function(require,module,exports,__filename,__dirname){" + compiled + "\n})", {
filename: file,
})(custom, mod, mod.exports, file, path.dirname(file));
return mod.exports;
}
const { EgressIpProvider } = load(base + "/src/app/(main)/_components/egress-ip-banner.tsx");
const { createAppI18n } = load(base + "/src/i18n/instance.ts");
const i18n = createAppI18n();
const assert = require("node:assert/strict"),
test = require("node:test");
function render(Component, props = {}) {
return renderToStaticMarkup(
React.createElement(
I18nextProvider,
{ i18n },
React.createElement(EgressIpProvider, null, React.createElement(Component, props)),
),
);
}
function visible(html) {
return html
.replace(/<script[\s\S]*?<\/script>/g, "")
.replace(/<style[\s\S]*?<\/style>/g, "")
.replace(/<[^>]+>/g, " ")
.replace(/\s+/g, " ");
}
// These checks execute real components in Node. Navigation and styles are
// replaced. They validate rendering, not browser clicks or post-fetch behavior.
test("all main pages render English fixed labels and switch back", async () => {
const main = base + "/src/app/(main)";
const files = fs.readdirSync(main, { recursive: true }).filter((f) => f.endsWith("page.tsx"));
assert.ok(files.length >= 27);
for (const f of files) {
route = "/" + f.replace("/page.tsx", "");
const Page = load(main + "/" + f).default;
await i18n.changeLanguage("en");
const english = visible(render(Page));
assert.doesNotMatch(english, /[\p{Script=Han}]/u, `${route}: ${english}`);
assert.doesNotMatch(english, /screen\.[a-z\d]{14}/, route);
await i18n.changeLanguage("zh-CN");
const chinese = visible(render(Page));
if (english.trim()) assert.notEqual(chinese, english, route);
await i18n.changeLanguage("en");
assert.equal(visible(render(Page)), english, route);
}
});
test("all task detail tabs render their English fixed UI", async () => {
await i18n.changeLanguage("en");
for (const [file, name] of [
["overview", "OverviewTab"],
["sessions", "SessionsTab"],
["broadcast", "BroadcastTab"],
["findings", "FindingsTab"],
["retests", "RetestsTab"],
["assets", "AssetsTab"],
["coverage-graph", "CoverageGraphTab"],
["intercept", "InterceptTab"],
["report", "ReportTab"],
["graph", "GraphTab"],
]) {
const Component = load(base + `/src/app/(main)/function/tasks/detail/_tabs/${file}-tab.tsx`)[name];
const html = visible(render(Component, { taskId: "1" }));
assert.doesNotMatch(html, /[\p{Script=Han}]/u, `${name}: ${html}`);
}
const { IntelligencePanel } = load(base + "/src/components/intelligence-panel.tsx");
assert.doesNotMatch(visible(render(IntelligencePanel, { scope: "tasks", scopeId: "1" })), /[\p{Script=Han}]/u);
});
test("intelligence renders real preview responses, populated records and localized errors", async () => {
const file = base + "/src/components/intelligence-panel.tsx";
const { IntelligencePanel } = load(file);
const transport = load(base + "/src/lib/mock/handler.ts");
const original = "原始情报内容";
const fixture = {
enabled: true,
credential_agent_enabled: false,
credential_traffic_binding: false,
counts: { credential: 1, lead: 1, sensitive_data: 1 },
total: 3,
items: ["credential", "lead", "sensitive_data"].map((kind, i) => ({
id: i + 1,
task_id: 1,
kind,
title: `Record ${i + 1}`,
content: original,
evidence: "Original evidence",
confidence: "observed",
status: ["unverified", "pending", "suspected"][i],
asset_ids: [],
worker: "worker",
created_at: "2026-11-10T12:30:00Z",
updated_at: "2026-11-10T12:30:00Z",
inherited: false,
})),
};
const empty = await transport.mockHandle("GET", "/tasks/t-vpn-edge/intelligence");
const output = (data, error = null) => {
stateSnapshots.set(file, {
next: 0,
values: new Map([
[5, data],
[6, error],
]),
});
try {
return visible(render(IntelligencePanel, { scope: "tasks", scopeId: "t-vpn-edge" }));
} finally {
stateSnapshots.delete(file);
}
};
await i18n.changeLanguage("en");
assert.doesNotMatch(output(empty), /[\p{Script=Han}]/u);
const english = output(fixture);
assert.match(english, /Record 1/);
assert.match(english, /Record 3/);
assert.ok(english.includes(original));
assert.doesNotMatch(english.replaceAll(original, ""), /[\p{Script=Han}]/u);
const error = Object.assign(new Error("情报数据响应不完整,请刷新后重试"), { code: "intelligence_response_invalid" });
assert.match(output(null, error), /intelligence response is incomplete/);
await i18n.changeLanguage("zh-CN");
assert.match(output(null, error), /情报数据响应不完整/);
assert.notEqual(output(fixture), english);
});
test("approval suggestions translate their buttons and keep the original submitted questions", async () => {
const hooks = load(base + "/src/hooks/use-side-questions.ts");
const workspace = load(base + "/src/components/side-question-workspace.tsx");
const buttons = load(base + "/src/components/ui/button.tsx");
const { ApprovalDetail } = load(base + "/src/components/approval-records.tsx");
const saved = [hooks.useSideQuestions, workspace.SideQuestionWorkspace, buttons.Button];
const sent = [],
handlers = new Map();
const questions = [
"此脚本的作用是什么?",
"脚本会修改哪些文件或数据?",
"为什么这次被放行或拦截?",
"脚本中有哪些未确定行为?",
];
hooks.useSideQuestions = () => ({
enabled: true,
open: true,
items: [],
snapshot: { available: true, model: { model: "demo-model" }, captured_at: "2026-11-10T12:30:00Z" },
busy: false,
draft: "",
setOpen: noop,
setDraft: noop,
ask: (question) => sent.push(question),
});
// Render the same side panel without relying on browser panel measurements.
workspace.SideQuestionWorkspace = (props) => React.createElement(saved[1], { ...props, mode: "floating" });
buttons.Button = (props) => {
if (typeof props.children === "string" && props.onClick) handlers.set(props.children, props.onClick);
return React.createElement(saved[2], props);
};
const row = {
id: 90,
status: "allowed",
tool_name: "execute",
tool_input: {},
worker: "worker",
reason: "",
created_at: "2026-11-10T12:30:00Z",
};
try {
await i18n.changeLanguage("en");
const english = visible(render(ApprovalDetail, { row, busy: false, decide: noop, revision: 0 }));
for (const key of ["scriptPurpose", "scriptChanges", "decisionReason", "uncertainBehavior"]) {
const label = i18n.t(`chatUI.approval.${key}`);
assert.ok(english.includes(label), label);
assert.ok(handlers.has(label), label);
handlers.get(label)();
}
assert.deepEqual(sent, questions);
for (const question of questions) assert.ok(!english.includes(question));
await i18n.changeLanguage("zh-CN");
const chinese = visible(render(ApprovalDetail, { row, busy: false, decide: noop, revision: 0 }));
for (const question of questions) assert.ok(chinese.includes(question), question);
} finally {
[hooks.useSideQuestions, workspace.SideQuestionWorkspace, buttons.Button] = saved;
}
});
test("populated findings translate actions and headers while retaining original content", async () => {
const { FindingsTable } = load(base + "/src/app/(main)/function/findings/_components/findings-table.tsx");
const finding = {
id: "1",
finding_id: "1",
task_id: "1",
severity: "high",
status: "confirmed",
name: "Original title",
vulnclass: "SQL Injection",
summary: "原始 AI 发现内容",
ts: "2026-11-10T12:30:00Z",
assets: [],
};
const props = {
items: [finding],
selectedIds: new Set(),
expandedKey: null,
reports: {},
edit: null,
saving: false,
activeRetests: {},
};
for (const k of [
"onToggleSelected",
"onToggleSelectedPage",
"onToggleRow",
"onEditChange",
"onSave",
"onStatusChange",
"onRetest",
"onDeepen",
"onDelete",
])
props[k] = noop;
await i18n.changeLanguage("en");
const english = visible(render(FindingsTable, props));
for (const word of ["Finding name", "Retest", "Investigate", "Original title", "原始 AI 发现内容"])
assert.ok(english.includes(word), word);
assert.doesNotMatch(english.replaceAll("原始 AI 发现内容", ""), /[\p{Script=Han}]/u);
await i18n.changeLanguage("zh-CN");
assert.match(visible(render(FindingsTable, props)), /漏洞名称/);
});
test("scope errors, source labels and Repeater defaults translate only at UI boundaries", async () => {
await i18n.changeLanguage("en");
const ui = (key, values) => i18n.t(key, values);
const { translateFixedUIText, repeaterGroupLabel } = load(base + "/src/i18n/fixed-ui-text.ts");
const { agentDisplayName } = load(base + "/src/i18n/agent-display.ts");
assert.equal(translateFixedUIText("请输入有效 IP", ui), "Enter a valid IP address");
assert.equal(translateFixedUIText("最多 1024 个字符", ui), "Use at most 1024 characters");
assert.equal(
translateFixedUIText("请求首行应为:POST /path HTTP/1.1", ui),
"The request line should look like: POST /path HTTP/1.1",
);
assert.equal(translateFixedUIText("Custom upstream response 原文", ui), "Custom upstream response 原文");
assert.equal(repeaterGroupLabel({ id: "default", name: "默认" }, ui), "Default");
assert.equal(repeaterGroupLabel({ id: "custom", name: "默认" }, ui), "默认");
assert.equal(repeaterGroupLabel({ id: "default", name: "我的分组" }, ui), "我的分组");
assert.equal(agentDisplayName({ key: "goals", name: "目标拆解" }, ui), "Goal decomposition");
assert.equal(agentDisplayName({ key: "custom", name: "目标拆解" }, ui), "目标拆解");
assert.equal(agentDisplayName({ key: "goals", name: "自定义名称" }, ui), "自定义名称");
const { taskAssetSourceLabel, taskAssetTypeLabel } = load(base + "/src/lib/task-assets.ts");
assert.equal(taskAssetSourceLabel("manual", ui), "Added manually");
assert.equal(taskAssetTypeLabel("root_domain", ui), "Root domain");
assert.equal(taskAssetSourceLabel("future-source", ui), "future-source");
});
test("every fixed UI key resolves and English resources contain no untranslated Chinese", () => {
const { resources } = load(base + "/src/i18n/messages.ts");
const catalog = require("./screen-catalog.json");
for (const [key, pair] of Object.entries(catalog)) assert.doesNotMatch(pair[1], /[\p{Script=Han}]/u, key);
for (const dir of ["app", "components"])
for (const relative of fs.readdirSync(base + "/src/" + dir, { recursive: true })) {
if (!relative.endsWith(".tsx")) continue;
const file = base + "/src/" + dir + "/" + relative;
const source = fs.readFileSync(file, "utf8");
const tree = ts.createSourceFile(file, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX);
const walk = (n) => {
if (
ts.isCallExpression(n) &&
/^(ui|liveUI)$/.test(n.expression.getText(tree)) &&
ts.isStringLiteral(n.arguments[0])
)
assert.ok(resources.en.translation[n.arguments[0].text], `${file}: ${n.arguments[0].text}`);
if (ts.isJsxText(n) && /[\p{Script=Han}]/u.test(n.text))
assert.ok(
file.endsWith("/language-switcher.tsx") && n.text.trim() === "简体中文",
`${file}: ${n.text.trim()}`,
);
ts.forEachChild(n, walk);
};
walk(tree);
}
});
test("Repeater renders persisted drafts with translated default group and preserves raw packets", async () => {
await i18n.changeLanguage("en");
const storeModule = load(base + "/src/components/repeater/repeater-store.ts");
const { useRepeaterStore } = storeModule;
const { defaultWorkspace } = load(base + "/src/components/repeater/repeater-state.ts");
const { RepeaterWorkspace } = load(base + "/src/components/repeater/repeater-workspace.tsx");
const workspace = defaultWorkspace();
workspace.tabs[0].rawRequest = "GET / HTTP/1.1\nHost: example.test\n\n";
useRepeaterStore.setState({ workspace });
// Supply the saved browser snapshot for this server render. Zustand normally
// returns its empty pre-hydration snapshot on the server.
storeModule.useRepeaterStore = Object.assign(
(selector) => (selector ? selector(useRepeaterStore.getState()) : useRepeaterStore.getState()),
useRepeaterStore,
);
let english;
try {
const { RepeaterNavigator } = load(base + "/src/components/repeater/repeater-navigator.tsx");
english = visible(render(RepeaterWorkspace)) + visible(render(RepeaterNavigator, { workspace, onRename: noop }));
} finally {
storeModule.useRepeaterStore = useRepeaterStore;
}
assert.doesNotMatch(english, /[\p{Script=Han}]/u);
assert.match(english, /Repeater/);
assert.match(english, /Default/);
assert.match(english, /Send/);
assert.equal(workspace.groups[0].name, "默认");
assert.equal(useRepeaterStore.getState().workspace.tabs[0].rawRequest, "GET / HTTP/1.1\nHost: example.test\n\n");
useRepeaterStore.setState({ workspace: null });
});
+642
View File
@@ -0,0 +1,642 @@
// Settings display text only. API values, prompts and model output remain unchanged.
export const settingsMessages = {
"settings.workerConfigLoadFailed": [
"设置加载失败,请刷新后再保存 Worker 配置",
"Settings could not be loaded. Refresh before saving the Worker configuration.",
],
"settings.choosePoolProfile": ["请选择每个模型池的 LLM 配置", "Select an LLM profile for every model pool"],
"settings.positivePoolWorkers": [
"每个模型池的 Worker 数必须是大于 0 的整数",
"Each model pool must have a positive whole number of Workers",
],
"settings.workerLimit": ["Worker 总数不能超过 50", "The total number of Workers cannot exceed 50"],
"settings.duplicatePoolProfile": ["不能重复选择同一个 LLM 配置", "Each LLM profile can only be selected once"],
"settings.workerPoolsSaved": [
"已保存多模型 Worker 池(对之后启动的任务生效)",
"Model pools saved; applies to tasks started afterward",
],
"settings.saveFailed": ["保存失败:{{message}}", "Could not save: {{message}}"],
"settings.positiveConcurrency": ["并发数必须是大于 0 的整数", "Concurrency must be a positive whole number"],
"settings.workersSaved": [
"已保存并发工作 agent 数(对之后启动的任务生效)",
"Worker count saved; applies to tasks started afterward",
],
"settings.saveFailedPrefix": ["保存失败:", "Could not save: "],
"settings.pythonSaved": ["已保存 Python 解释器配置", "Python interpreter settings saved"],
"settings.workerConfigLocked": [
"设置加载失败,Worker 配置已锁定,避免覆盖服务器上的模型池",
"Settings could not be loaded. Worker configuration is locked to protect the model pools on the server.",
],
"settings.screenshotsEnabled": ["已开启浏览器截图工具", "Browser screenshot tool enabled"],
"settings.screenshotsDisabled": ["已关闭浏览器截图工具", "Browser screenshot tool disabled"],
"settings.timestampsEnabled": ["已开启截图时间标记", "Screenshot timestamps enabled"],
"settings.timestampsDisabled": ["已关闭截图时间标记", "Screenshot timestamps disabled"],
"settings.opsecEnabled": ["已开启 OPSEC 准则", "OPSEC guidelines enabled"],
"settings.opsecDisabled": ["已关闭 OPSEC 准则", "OPSEC guidelines disabled"],
"settings.category.system": ["系统与账号", "System and account"],
"settings.category.systemHint": ["版本、登录与基础配置", "Version, sign-in and basic settings"],
"settings.category.traffic": ["流量与安全", "Traffic and security"],
"settings.category.trafficHint": ["流量、代理、截图与 OPSEC", "Traffic, proxies, screenshots and OPSEC"],
"settings.category.agent": ["Agent 行为", "Agent behavior"],
"settings.category.agentHint": ["约束、情报与自动化", "Constraints, intelligence and automation"],
"settings.category.network": ["网络与工具", "Network and tools"],
"settings.category.networkHint": ["搜索、脚本与并发", "Search, scripts and concurrency"],
"settings.category.chat": ["对话与界面", "Chat and interface"],
"settings.category.chatHint": ["输入与交互偏好", "Input and interaction preferences"],
"settings.trafficBindingEnabled": ["已开启 Agent 自动绑定流量", "Automatic traffic binding enabled"],
"settings.trafficBindingDisabled": ["已关闭 Agent 自动绑定流量", "Automatic traffic binding disabled"],
"settings.noaEnabled": [
"已开启 noa 上下文压缩(对之后启动的运行生效)",
"noa context compaction enabled; applies to runs started afterward",
],
"settings.noaDisabled": [
"已关闭 noa 上下文压缩(恢复内置压缩)",
"noa context compaction disabled; built-in compaction restored",
],
"settings.webSearchSaved": ["已保存网络搜索配置", "Web search settings saved"],
"settings.braveKeySaved": ["已保存 Brave API Key", "Brave API key saved"],
"settings.tavilyKeySaved": ["已保存 Tavily API Key", "Tavily API key saved"],
"settings.deepSeekKeySaved": ["已保存 DeepSeek Search API Key", "DeepSeek Search API key saved"],
"settings.searchProxySaved": ["已保存出口代理", "Outbound proxy saved"],
"settings.searchProxyCleared": ["已清除出口代理(改为直连)", "Outbound proxy cleared; using a direct connection"],
"settings.poolOverridesProxy": [
"代理池非空时,全局代理输入框仅用于回显,请在代理池中编辑或切换",
"When the proxy pool has entries, this field only shows the active proxy. Edit or switch proxies in the pool.",
],
"settings.globalProxySaved": ["已保存全局代理", "Global proxy saved"],
"settings.globalProxyCleared": ["已清除全局代理(改为直连)", "Global proxy cleared; using a direct connection"],
"settings.importLineError": ["第{{line}}行:{{message}}", "Line {{line}}: {{message}}"],
"settings.proxyPoolImported": ["代理池已导入", "Proxy pool imported"],
"settings.importFailedPrefix": ["导入失败:", "Could not import: "],
"settings.invalidRotationInterval": [
"定时轮换间隔必须是大于等于 3 秒的整数",
"The rotation interval must be a whole number of at least 3 seconds",
],
"settings.rotationSaved": ["代理池轮换策略已保存", "Proxy pool rotation settings saved"],
"settings.allProxiesTested": ["已完成全部代理探测", "All proxy tests completed"],
"settings.probeFailedPrefix": ["探测失败:", "Probe failed: "],
"settings.updateFailedPrefix": ["更新失败:", "Update failed: "],
"settings.deleteFailedPrefix": ["删除失败:", "Could not delete: "],
"settings.reconnectSaved": ["已保存代理重连策略", "Proxy reconnection settings saved"],
"settings.probeServiceSaved": ["已保存 IP 探测服务", "IP probe service saved"],
"settings.probeServiceReset": ["已恢复默认 IP 探测服务", "Default IP probe service restored"],
"settings.probeServiceSaveFailed": [
"保存 IP 探测服务失败:{{message}}",
"Could not save IP probe service: {{message}}",
],
"settings.egressResult": ["出口 IP {{ip}}", "Outbound IP: {{ip}}"],
"settings.probeSucceeded": ["探测通过", "Probe successful"],
"settings.egressFailed": ["出口探测失败", "Outbound IP probe failed"],
"settings.egressShown": ["已在顶栏显示出口 IP", "Outbound IP is now shown in the header"],
"settings.egressHidden": ["已关闭顶栏出口 IP显示", "Outbound IP is now hidden from the header"],
"settings.egressVisibilityFailed": ["保存顶栏出口 IP设置失败:", "Could not save header IP preference: "],
"settings.searchTestSucceeded": [
"搜索测试成功 · {{backend}} 返回 {{count}} 条结果",
"Search test passed · {{backend}} returned {{count}} results",
],
"settings.searchTestFailedPrefix": ["搜索测试失败:", "Search test failed: "],
"settings.unknownError": ["未知错误", "Unknown error"],
"settings.credentialsSaved": ["凭据处理设置已保存", "Credential processing settings saved"],
"settings.title": ["系统配置", "System settings"],
"settings.subtitle": ["全局运行时开关", "Global runtime controls"],
"settings.searchPlaceholder": [
"搜索设置,例如:截图、OPSEC、代理、流量",
"Search settings, e.g. screenshots, OPSEC, proxies, traffic",
],
"settings.searchLabel": ["搜索系统设置", "Search system settings"],
"settings.directory": ["配置目录", "Settings directory"],
"settings.categoriesLabel": ["系统配置分类", "System settings categories"],
"settings.searchResults": ["搜索结果", "Search results"],
"settings.matchingSettings": ["匹配“{{query}}”的设置项", "Settings matching “{{query}}”"],
"settings.clearSearch": ["清除搜索", "Clear search"],
"settings.keywords.update": ["更新 版本 升级", "update version upgrade"],
"settings.keywords.basicAuth": [
"基础认证 登录 用户名 密码",
"basic auth authentication sign-in login username password",
],
"settings.trafficCapture": ["流量捕获", "Traffic capture"],
"settings.trafficCaptureHelp": [
"开启后,所有 Agent 的 HTTP 流量经记录代理全量落库,并向 Agent 注入 traffic_search / traffic_get 工具与代理配置(提示词含代理说明)。",
"When enabled, all Agent HTTP traffic is recorded through the capture proxy. Agents receive traffic_search / traffic_get tools and proxy settings, including proxy instructions.",
],
"settings.trafficCaptureOffStart": [
"关闭(默认)时不记录任何流量:Agent",
"When disabled (the default), no traffic is recorded. Agents ",
],
"settings.willNot": ["不会", "do not"],
"settings.trafficCaptureOffMiddle": [
"拿到代理配置与流量工具,提示词也",
" receive proxy settings or traffic tools, and their instructions ",
],
"settings.doNotContain": ["不含", "exclude"],
"settings.trafficCaptureOffEnd": [
"代理相关内容。切换后会即时重建 Agent 生效。",
" proxy information. Changing this setting immediately rebuilds the Agents.",
],
"settings.captureOn": ["已开启 · 正在记录流量并注入代理", "Enabled · Recording traffic and providing proxy settings"],
"settings.captureOff": ["已关闭 · 不记录、不注入代理", "Disabled · No recording or proxy settings"],
"settings.trafficBinding": ["Agent 自动绑定流量", "Automatic Agent traffic binding"],
"settings.trafficBindingHelp": [
"默认关闭。开启后,漏洞入库时触发的报告 Agent 会核对已有 HTTP 请求/响应,关联对应流量后再编写报告。",
"Disabled by default. When a finding is saved, the report Agent reviews existing HTTP requests and responses and links matching traffic before writing the report. ",
],
"settings.trafficBindingCost": [
"查阅数据包及额外的工具调用会增加 Token 消耗。",
"Reviewing packets and making extra tool calls uses additional tokens.",
],
"settings.trafficBindingDetails": [
"TCP、未抓包或没有匹配流量时仍可正常上报。此开关不影响流量捕获、人工绑定及已保存证据的查看。 对下一轮 Agent 生效;关闭后会立即拒绝新的自动绑定。",
"Reports can still be submitted for TCP, uncaptured requests or unmatched traffic. This setting does not affect traffic capture, manual binding or viewing saved evidence. It applies on the next Agent turn; disabling it immediately rejects new automatic bindings.",
],
"settings.bindingOn": ["已开启 · 会增加 Token 消耗", "Enabled · Uses additional tokens"],
"settings.bindingOff": ["已关闭 · 可继续人工绑定", "Disabled · Manual binding remains available"],
"settings.browserSecurity": ["浏览器与报告安全", "Browser and report security"],
"settings.browserSecurityHelp": [
"集中管理报告截图、截图时间和目标交互的 OPSEC 准则。开关只影响后续 Agent 运行。",
"Manage report screenshots, timestamps and OPSEC guidelines for target interactions. Changes only affect subsequent Agent runs.",
],
"settings.browserScreenshots": ["浏览器截图", "Browser screenshots"],
"settings.browserScreenshotsHelp": [
"报告撰写 Agent 可使用 browser MCP 为复现步骤保存截图。",
"The report Agent can use the browser MCP to save screenshots of reproduction steps.",
],
"settings.screenshotTimestamp": ["截图时间标记", "Screenshot timestamp"],
"settings.screenshotTimestampHelp": [
"在截图右上角显示年月日时分秒,不修改原始文件。",
"Show the date and time in the top-right corner of screenshots without modifying the original file.",
],
"settings.opsec": ["OPSEC 准则", "OPSEC guidelines"],
"settings.opsecHelp": [
"要求执行型 Agent 复用流量和浏览器特征、控制请求噪声,并遵守平台代理与授权范围。",
"Require execution Agents to reuse traffic and browser characteristics, reduce request noise, and respect platform proxy settings and authorized scope.",
],
"settings.globalProxy": ["全局代理", "Global proxy"],
"settings.globalProxyHelp": [
"设置 Agent 目标流量的统一出口。留空时直连;网络搜索和 LLM 代理不受影响。",
"Set a shared outbound proxy for Agent traffic to targets. Leave blank for a direct connection. Web search and LLM proxies are configured separately.",
],
"settings.proxyAddress": ["代理地址", "Proxy address"],
"settings.globalProxyPlaceholder": [
"socks5://user:pass@host:1080 或 http://host:port(留空=直连)",
"socks5://user:pass@host:1080 or http://host:port (blank = direct)",
],
"settings.save": ["保存", "Save"],
"settings.testing": ["测试中…", "Testing…"],
"settings.testProxy": ["测试代理", "Test proxy"],
"settings.proxyConfigured": ["已配置 · 所有目标流量经此代理出网", "Configured · All target traffic uses this proxy"],
"settings.proxyUnconfigured": ["未配置 · 目标流量直连出网", "Not configured · Target traffic connects directly"],
"settings.howProxyWorks": ["代理工作方式", "How the proxy works"],
"settings.howProxyWorksHelp": [
"开启流量捕获时,此代理作为记录代理的上游;关闭时,代理会注入 Agent 的 bash / WebFetch 出网。支持 http、https 和 socks5,可带账号密码。关闭流量捕获使用 socks5 时,命令行工具需支持 ALL_PROXY;Python urllib 等工具可能不支持,开启流量捕获可避免此限制。",
"With traffic capture enabled, this proxy is upstream of the capture proxy. Otherwise, it is provided to Agent bash / WebFetch requests. HTTP, HTTPS and SOCKS5 are supported, with optional credentials. When capture is disabled, command-line tools must support ALL_PROXY to use SOCKS5; tools such as Python urllib may not support it. Enable traffic capture to avoid this limitation.",
],
"settings.reconnection": ["异常重连策略", "Reconnection after failure"],
"settings.reconnectionHelp": [
"代理异常暂停的任务按此策略探测;次数耗尽后保持暂停,可手动恢复。",
"Tasks paused by a proxy failure retry according to this policy. After all attempts are exhausted, tasks remain paused and can be resumed manually.",
],
"settings.reconnectAttempts": ["最大重连次数", "Maximum reconnection attempts"],
"settings.reconnectInterval": ["重连间隔(秒)", "Reconnection interval (seconds)"],
"settings.savePolicy": ["保存策略", "Save policy"],
"settings.showEgress": ["在顶栏显示出口 IP", "Show outbound IP in the header"],
"settings.showEgressHelp": [
"开启后显示直连 IP 和全局代理 IP,使用已保存的全局代理探测。",
"Show the direct IP and global proxy IP, probing through the saved global proxy.",
],
"settings.egressTestDetails": ["出口 IP 测试说明", "About outbound IP tests"],
"settings.egressTestHelp": [
"测试会访问 IP 回显服务。未设置自定义地址时,默认访问 api.ipify.org,失败时改用 ifconfig.me。 配置自定义地址后仅使用该服务。结果中的直连 IP 与代理 IP 可用于确认代理是否生效。修改地址后无需保存即可测试。",
"Tests contact an IP echo service. Without a custom URL, api.ipify.org is used first, then ifconfig.me if it fails. When a custom URL is set, only that service is used. Compare the direct and proxy IPs to confirm the proxy is working. You can test a changed URL before saving it.",
],
"settings.customProbe": ["自定义 IP 探测服务(可选)", "Custom IP probe service (optional)"],
"settings.probeUrl": ["IP 探测服务地址", "IP probe service URL"],
"settings.probePlaceholder": [
"留空使用默认服务;内网可填 http://<内网IP>:<端口>/",
"Blank = default service; for a private network: http://<private-IP>:<port>/",
],
"settings.saving": ["保存中…", "Saving…"],
"settings.saveProbe": ["保存探测服务", "Save probe service"],
"settings.probePersistenceHelp": [
"保存后用于顶栏出口 IP、代理测试、健康检查和自动重连,刷新页面或重启后仍生效。清空地址并保存可恢复默认服务。",
"After saving, this service is used for header IPs, proxy tests, health checks and automatic reconnection, including after a refresh or restart. Clear the URL and save to restore the default service.",
],
"settings.probeResponseStart": [
"自定义 IP 探测服务需返回纯文本 IP 或",
"A custom probe service must return a plain-text IP or JSON in the form ",
],
"settings.probeResponseEnd": [
"格式的 JSON。 若内网环境下无法访问公网,或本机和内网代理共用同一个公网出口, 则可替换为内网 IP 探测服务,此时 ① 和 ② 的 IP 不同,就说明流量走了内网代理。",
". If public services are unreachable, or the computer and private-network proxy share the same public IP, use a private-network probe service. Different IPs for ① and ② confirm that traffic uses the private-network proxy.",
],
"settings.directProbeHint": ["不经过任何代理,用来和 ② 对比", "Connects without a proxy, for comparison with ②"],
"settings.captureProbeHint": [
"实际探测地址:{{path}}(请求经流量捕获转发)",
"Actual probe address: {{path}} (forwarded through traffic capture)",
],
"settings.proxyProbeHint": ["经这个代理出去,不需要先保存", "Connects through this proxy; no need to save first"],
"settings.outboundIpHint": [
"外界看到的出口 IP(探测站点回显的客户端地址)",
"The public-facing outbound IP returned by the probe service",
],
"settings.latencyHint": [
"从 ARTEX 发出请求到拿到响应的完整往返耗时;经代理时包含代理那一跳",
"Full round-trip time from ARTEX to the response, including the proxy hop when used",
],
"settings.viaPrefix": ["· 经", " · via "],
"settings.proxyPool": ["代理池", "Proxy pool"],
"settings.currentProxyPrefix": ["当前:", "Current: "],
"settings.selectedProxy": ["已选择代理", "Selected proxy"],
"settings.direct": ["直连", "Direct"],
"settings.testAll": ["测试全部", "Test all"],
"settings.importProxies": ["批量导入代理", "Import proxies in bulk"],
"settings.importPlaceholder": ["每行一个代理:URL|名称|备注", "One proxy per line: URL|name|notes"],
"settings.import": ["导入", "Import"],
"settings.proxyCredentialsHidden": [
"显示代理地址时会隐藏账号密码。",
"Credentials are hidden when proxy addresses are displayed.",
],
"settings.emptyProxyPool": ["暂无代理池条目。", "No proxies in the pool."],
"settings.enableProxy": ["启用代理", "Enable proxy"],
"settings.testOutboundIp": ["测试出口 IP", "Test outbound IP"],
"settings.probeFailed": ["探测失败", "Probe failed"],
"settings.notTested": ["尚未测试", "Not tested"],
"settings.disabled": ["已停用", "Disabled"],
"settings.healthy": ["健康", "Healthy"],
"settings.coolingDown": ["冷却中", "Cooling down"],
"settings.pendingCheck": ["待检测", "Awaiting check"],
"settings.activeProxy": ["当前使用", "Active"],
"settings.noLatency": ["暂无延迟数据", "No latency data"],
"settings.test": ["测试", "Test"],
"settings.delete": ["删除", "Delete"],
"settings.rotationHealth": ["轮换与健康检查策略", "Rotation and health checks"],
"settings.rotationHealthHelp": [
"设置代理池的切换条件与健康检查频率。",
"Configure proxy rotation conditions and health check frequency.",
],
"settings.timedRotation": ["定时轮换", "Scheduled rotation"],
"settings.failureRotation": ["失效轮换", "Rotate on failure"],
"settings.rotationOrder": ["切换顺序", "Rotation order"],
"settings.sequential": ["顺序", "Sequential"],
"settings.random": ["随机", "Random"],
"settings.rotationInterval": ["轮换间隔(秒,≥3)", "Rotation interval (seconds, ≥3)"],
"settings.failureThreshold": ["连续失败阈值(次)", "Consecutive failure threshold"],
"settings.cooldown": ["故障冷却时间(秒)", "Failure cooldown (seconds)"],
"settings.healthInterval": ["健康检查间隔(秒)", "Health check interval (seconds)"],
"settings.saveRotation": ["保存轮换策略", "Save rotation policy"],
"settings.constraintInjection": ["操作约束注入", "Operation constraint injection"],
"settings.constraintHelpStart": ["开启后,把每个任务的", "When enabled, each task’s "],
"settings.constraints": ["操作约束", "operation constraints"],
"settings.constraintHelpMiddle": [
"(在任务总览「操作约束」里维护的 allow/deny 条目)拼进对应 Agent 的系统提示,用来框定探索边界(如「仅测当前端口」「禁止爆破」)。",
" (allow/deny entries maintained in the task overview) are added to the relevant Agent instructions to define exploration boundaries, such as “current port only” or “no brute force”.",
],
"settings.constraintTargetsStart": ["可分别控制注入到", "Apply constraints independently to the "],
"settings.planner": ["规划者(planner)", "planner"],
"settings.and": ["与", " and "],
"settings.worker": ["执行者(worker)", "worker"],
"settings.constraintTargetsEnd": [
";默认都开。切换即时生效(下一轮读取),无需重建 Agent。关闭后该 Agent 不再看到约束。",
". Both are enabled by default. Changes take effect on the next turn without rebuilding Agents. A disabled Agent no longer receives the constraints.",
],
"settings.injectPlanner": ["注入规划者(planner)", "Apply to planner"],
"settings.enabledSuffix": [" · 已开启", " · Enabled"],
"settings.disabledSuffix": [" · 已关闭", " · Disabled"],
"settings.injectWorker": ["注入执行者(worker)", "Apply to worker"],
"settings.experimental": ["实验功能", "Experimental features"],
"settings.experimentalHelp": [
"尚在验证中的机制,默认关闭。可能改变 Agent 行为或影响稳定性,请在了解影响后启用。",
"Features still under evaluation, disabled by default. They may change Agent behavior or affect stability. Enable them only after understanding the effects.",
],
"settings.noa": ["noa 上下文压缩", "noa context compaction"],
"settings.noaHelpStart": [
":由模型主动压缩长对话历史(norma v0.4.0)。开启后平台接入的四类 Agent(",
": Let the model compact long conversation history (norma v0.4.0). When enabled, four types of Agent (",
],
"settings.noaAgentTypes": ["规划者 / 执行者 / 主 Agent / 对话", "planner / worker / main Agent / chat"],
"settings.noaHelpEnd": [
")改用 noa 接管上下文,取代内置压缩, 压缩原文会归档到任务工作目录下便于回溯。切换即时生效(对之后启动的运行生效),无需重建 Agent; 关闭后立即恢复内置压缩。",
") use noa context management instead of built-in compaction. Original content is archived in the task working directory for reference. Changes apply to runs started afterward without rebuilding Agents. Disabling this immediately restores built-in compaction.",
],
"settings.autoTitles": ["自动标题", "Automatic titles"],
"settings.autoTitlesHelp": [
"为 Agent 创建的任务和对话首条消息生成简短标题。两个开关独立生效,默认关闭。",
"Generate short names for Agent-created tasks and titles after the first chat message. These switches are independent and disabled by default.",
],
"settings.taskNames": ["任务名称", "Task names"],
"settings.taskNamesHelp": [
"Agent 创建任务时自动生成任务名称;失败时保留未命名任务。",
"Generate a name when an Agent creates a task. On failure, keep the unnamed task.",
],
"settings.chatTitles": ["会话标题", "Conversation titles"],
"settings.chatTitlesHelp": [
"对话首条消息后自动生成会话标题;先显示消息截断文本,失败时保留截断标题。",
"Generate a title after the first message. A shortened message is shown first and kept if title generation fails.",
],
"settings.intelligence": ["任务情报", "Task intelligence"],
"settings.intelligenceHelp": [
"自动记录任务中获取的凭据、重要线索和敏感数据,并保留来源证据。",
"Automatically record credentials, leads and sensitive data found during a task, along with source evidence.",
],
"settings.autoRecord": ["Agent 自动记录", "Automatic Agent recording"],
"settings.autoRecordHelp": [
"默认关闭。任务执行时上报凭据、重要线索和敏感数据,会增加任务 Agent 的提示与上报 Token。仅负责记录,不启动凭据整理。关闭后同时停用下方 Agent 与流量绑定,已有情报和整理结果仍可查看。",
"Disabled by default. Reporting credentials, leads and sensitive data uses additional Agent instruction and reporting tokens. This only records data; it does not start credential processing. Disabling it also disables the Agent and traffic binding below. Existing intelligence and processed results remain available.",
],
"settings.autoRecordEnabled": ["任务情报自动记录已开启", "Automatic intelligence recording enabled"],
"settings.autoRecordDisabled": ["任务情报自动记录已关闭", "Automatic intelligence recording disabled"],
"settings.credentialAgent": ["Agent 开关", "Credential processing Agent"],
"settings.credentialAgentHelp": [
"默认关闭。独立整理已有和新增凭据,拆分并高亮账号、密码、Token 和 Cookie,不改变原始上报或验证状态。复杂文本会使用额外模型 Token;可解析的 JSON 无需模型。需先开启上方自动记录。模型可在「Agent → 凭据整理」中配置。",
"Disabled by default. Organize existing and new credentials, separating and highlighting usernames, passwords, tokens and cookies without changing the original report or verification status. Complex text uses extra model tokens; parseable JSON does not. Enable automatic recording above first. Configure the model under Agents → Credential processing.",
],
"settings.bindTraffic": ["绑定流量", "Bind traffic"],
"settings.bindTrafficHelp": [
"默认关闭,仅在 Agent 开关开启时可用。核对已抓取流量中的资产与凭据,关联真实请求或响应并保存匹配片段;不主动登录,也不把匹配流量视为验证成功。关闭 Agent 时同时停用,已有绑定保留。",
"Disabled by default and available only when the Agent is enabled. Match assets and credentials to captured traffic, link real requests or responses, and save matching excerpts. This does not sign in or treat matching traffic as successful verification. Disabling the Agent also disables this; existing bindings remain.",
],
"settings.webSearch": ["网络搜索", "Web search"],
"settings.searchOn": [
"总开关已开启 · 可在各 Agent 配置里单独启用",
"Enabled · Can be enabled individually in Agent settings",
],
"settings.searchOff": ["已关闭 · 各 Agent 无法启用网络搜索", "Disabled · Web search is unavailable to all Agents"],
"settings.searchProvider": ["搜索来源", "Search provider"],
"settings.chooseProvider": ["选择来源", "Select provider"],
"settings.duckDuckGo": ["DuckDuckGo(ddgs · 免费无 Key)", "DuckDuckGo (ddgs · free, no key)"],
"settings.braveOption": ["Brave(免费版 · 需 Key)", "Brave (free tier · key required)"],
"settings.tavilyOption": ["Tavily(需 Key)", "Tavily (key required)"],
"settings.deepSeekOption": ["DeepSeek(官方)", "DeepSeek (official)"],
"settings.deepSeekSearch": ["DeepSeek 联网搜索", "DeepSeek web search"],
"settings.deepSeekHelp": [
"通过 DeepSeek 独立 Search / Fetch API 提供搜索与网页提取,使用当前 Agent 选择的模型生成查询和整理结果。",
"Use the separate DeepSeek Search / Fetch API for search and page extraction. The current Agent’s model generates queries and organizes results.",
],
"settings.deepSeekNetworkHelp": [
"搜索请求由 ARTEX 服务端发往 DeepSeek,可使用上方独立出口代理。API Key 只保存于服务端设置,不会回显。",
"ARTEX sends requests to DeepSeek from the server, using the separate outbound proxy above if configured. API keys are stored on the server and never shown.",
],
"settings.keyConfiguredPlaceholder": ["已配置(留空则不变)", "Configured (leave blank to keep)"],
"settings.keyConfigured": ["API Key 已配置", "API key configured"],
"settings.configured": ["已配置", "Configured"],
"settings.braveKeyPlaceholder": ["输入 Brave API Key", "Enter Brave API key"],
"settings.braveMissingKey": [
"已选择 Brave 但尚未配置 Key —— 在保存 Key 之前,搜索工具不会启用。",
"Brave is selected but no key is configured. The search tool stays disabled until a key is saved.",
],
"settings.braveQuota": [
"免费版额度约 2,000 次/月。前往 https://brave.com/search/api/ 获取 Key。",
"The free tier provides approximately 2,000 requests per month. Get a key at https://brave.com/search/api/.",
],
"settings.tavilyKeyPlaceholder": ["输入 Tavily API Key(tvly-…)", "Enter Tavily API key (tvly-…)"],
"settings.tavilyMissingKey": [
"已选择 Tavily 但尚未配置 Key —— 在保存 Key 之前,搜索工具不会启用。",
"Tavily is selected but no key is configured. The search tool stays disabled until a key is saved.",
],
"settings.tavilySignup": [
"前往 https://tavily.com 注册并获取 API Key。",
"Register at https://tavily.com to get an API key.",
],
"settings.outboundProxy": ["出口代理(可选)", "Outbound proxy (optional)"],
"settings.proxyPlaceholder": [
"http://host:port 或 socks5://host:port(留空=直连)",
"http://host:port or socks5://host:port (blank = direct)",
],
"settings.searchProxyHelp": [
"独立出口代理,仅用于访问搜索端点(VPN/SOCKS 等)。与记录流量的 MITM 代理无关;网络不通时经此代理访问。",
"A separate outbound proxy for search endpoints (VPN/SOCKS, etc.), independent of the MITM capture proxy. Use it when search services are otherwise unreachable.",
],
"settings.searchTestHelp": [
"用当前配置(来源 + 代理 + Key)实际搜索一次「test」,验证是否可用。",
"Search for “test” with the current provider, proxy and key to verify the configuration.",
],
"settings.testSearch": ["测试搜索", "Test search"],
"settings.python": ["自定义脚本 · Python 解释器", "Custom scripts · Python interpreter"],
"settings.custom": ["自定义", "Custom "],
"settings.pythonHelp": [
"类型工具用它跑 Python。开机会自动检测(python3 优先);此处可手填 venv / 特定版本的绝对路径,留空则运行时自动检测。",
" tools use this interpreter to run Python. ARTEX detects it at startup, preferring python3. Enter an absolute path for a virtual environment or specific version, or leave blank for automatic detection at runtime.",
],
"settings.pythonPlaceholder": ["/usr/bin/python3(留空=自动检测)", "/usr/bin/python3 (blank = automatic detection)"],
"settings.detectAgain": ["重新检测", "Detect again"],
"settings.workers": ["工作并发 · Work Agent 数", "Concurrency · Worker count"],
"settings.workersHelpStart": [
"每个任务并发运行的工作 agent 数量(默认 3)。数值越大并发探测越多、消耗也越高。修改后",
"The number of Workers running concurrently per task (default: 3). More Workers mean more parallel probes and higher usage. Changes ",
],
"settings.futureTasksOnly": ["对之后启动的任务生效", "apply to tasks started afterward"],
"settings.runningTasksUnchanged": [",正在运行的任务不受影响。", "; running tasks are unaffected."],
"settings.workerPools": ["多模型 Worker 池", "Model pools"],
"settings.addPool": ["添加模型池", "Add model pool"],
"settings.unavailableProfile": ["配置 #{{id}} 已删除/不可用", "Profile #{{id}} deleted or unavailable"],
"settings.chooseProfile": ["选择 LLM 配置", "Select LLM profile"],
"settings.profilePrefix": ["配置 #", "Profile #"],
"settings.profileUnavailableSuffix": ["已删除/不可用", " deleted or unavailable"],
"settings.poolConcurrencyHelp": [
"已配置模型池时由各池数量决定并发。",
"When model pools are configured, their Worker counts determine concurrency.",
],
"settings.workerConfigLockedHelp": [
"设置加载失败,Worker 配置已锁定;刷新成功后才能编辑或保存。",
"Settings could not be loaded. Worker configuration is locked until a successful refresh.",
],
"settings.chatSendShortcut": ["会话输入框发送键位", "Chat send shortcut"],
"settings.chatSendShortcutHelp": [
"对话页与任务详情的主 Agent 会话输入框共用此设置,选择后立即生效、无需保存。",
"Shared by the chat page and main Agent input in task details. Changes take effect immediately, with no need to save.",
],
"settings.preferenceScopeStart": ["该偏好", "This preference is "],
"settings.browserOnly": ["只存在本浏览器", "stored only in this browser"],
"settings.preferenceScopeEnd": [
",不随账号同步,换浏览器或清理站点数据后需重新设置。",
" and is not synced with your account. Set it again after switching browsers or clearing site data.",
],
"settings.sendMode": ["发送方式", "Send mode"],
"settings.readFailed": ["读取失败:{{message}}", "Could not load: {{message}}"],
"settings.basicAuthEnabled": [
"HTTP Basic Auth 已开启,当前浏览器保持访问",
"HTTP Basic Auth enabled; this browser retains access",
],
"settings.basicAuthDisabled": ["HTTP Basic Auth 已关闭", "HTTP Basic Auth disabled"],
"settings.basicAuthHelp": [
"开启后,访客需先通过浏览器原生账号密码验证,再进入 ARTEX 登录页。默认关闭,保存后立即生效。",
"When enabled, visitors must pass the browser’s native credential prompt before reaching the ARTEX sign-in page. Disabled by default. Saved changes take effect immediately.",
],
"settings.enableBasicAuth": ["启用访问验证", "Enable access authentication"],
"settings.basicAuthUsername": ["验证用户名", "Authentication username"],
"settings.basicAuthUsernamePlaceholder": ["独立于 ARTEX 登录账号", "Separate from your ARTEX sign-in account"],
"settings.basicAuthUsernameHelp": ["不能包含冒号,最长 128 字节。", "Cannot contain a colon. Maximum 128 bytes."],
"settings.basicAuthPassword": ["验证密码", "Authentication password"],
"settings.keepPassword": ["已设置,留空保持原密码", "Already set; leave blank to keep"],
"settings.basicAuthPasswordPlaceholder": ["至少 8 位,最多 72 字节", "At least 8 characters, at most 72 bytes"],
"settings.basicAuthPasswordHelp": [
"与 ARTEX 登录密码独立。公网访问请使用 HTTPS。",
"Separate from your ARTEX password. Use HTTPS for public access.",
],
"settings.basicAuthSessionHelp": [
"保存不会中断当前浏览器访问。可用无痕窗口检查验证弹窗;浏览器可能缓存凭据。关闭后保留账号密码,便于再次开启。",
"Saving does not interrupt access in this browser. Use a private window to check the credential prompt; browsers may cache credentials. Disabling authentication keeps the credentials for future use.",
],
"settings.saveBasicAuth": ["保存访问验证", "Save access authentication"],
"settings.reload": ["重新加载", "Reload"],
"settings.updateNetworkLoadFailedPrefix": ["读取更新网络设置失败:", "Could not load update network settings: "],
"settings.updateCheckFailedPrefix": ["检查更新失败:", "Could not check for updates: "],
"settings.newVersion": ["发现新版本 {{version}}", "Version {{version}} is available"],
"settings.upToDate": ["当前已是最新版本", "You are using the latest version"],
"settings.updateNetworkSaved": ["更新网络设置已保存", "Update network settings saved"],
"settings.updatedVersion": ["已更新到 {{version}},正在重新加载页面", "Updated to {{version}}. Reloading the page…"],
"settings.restartTimeout": [
"等待服务重启超时。请检查后端日志,或确认 artex 是通过 start.sh / start.bat 启动的。",
"Timed out waiting for the service to restart. Check the backend logs and confirm ARTEX was started with start.sh / start.bat.",
],
"settings.confirmUpdateVersion": ["确定更新到 {{version}}?\n\n", "Update to {{version}}?\n\n"],
"settings.updateInterruptWarning": [
"更新会重启程序,正在运行的任务会被中断。\n",
"The application will restart and running tasks will be interrupted.\n",
],
"settings.dockerUpdateWarningStart": [
"\n注意:容器内更新只替换程序本身,不会更新镜像里的 playwright / nmap 等工具链;",
"\nNote: Updating inside a container replaces only ARTEX, not tools such as playwright / nmap in the image. ",
],
"settings.dockerUpdateWarningEnd": [
"若新版本依赖新工具,请改用 docker compose pull。",
"Use docker compose pull if the new version requires new tools.",
],
"settings.preparing": ["准备中…", "Preparing…"],
"settings.updateStartFailedPrefix": ["启动更新失败:", "Could not start update: "],
"settings.confirmRollback": [
"回滚到上一版本?\n\n程序会重启,正在运行的任务会被中断。\n注意:数据库结构不会回退,旧版本可能无法识别新版写入的数据。",
"Roll back to the previous version?\n\nThe application will restart and running tasks will be interrupted.\nNote: The database schema will not be rolled back. The old version may not recognize data written by the new version.",
],
"settings.rollingBack": ["已切换到上一版本,正在重启…", "Switched to the previous version. Restarting…"],
"settings.rollbackFailedPrefix": ["回滚失败:", "Rollback failed: "],
"settings.versionUpdates": ["版本与更新", "Version and updates"],
"settings.versionUpdatesHelp": [
"从 GitHub 检查并安装新版本。更新会重启程序,正在运行的任务会被中断。",
"Check GitHub for new releases and install updates. Updates restart the application and interrupt running tasks.",
],
"settings.updateProxy": ["更新代理(可选)", "Update proxy (optional)"],
"settings.updateProxyHelp": [
"独立出口代理,仅用于检查版本和下载更新,支持 HTTP / HTTPS / SOCKS5。留空保存后直连;不影响任务、网络搜索或 LLM 的代理。",
"A separate outbound proxy for version checks and update downloads, supporting HTTP / HTTPS / SOCKS5. Clear and save for a direct connection. Task, web search and LLM proxies are unaffected.",
],
"settings.unsavedUpdateNetwork": [
"修改尚未保存,保存后将自动检查更新。",
"Unsaved changes. Saving will automatically check for updates.",
],
"settings.currentVersion": ["当前版本", "Current version"],
"settings.standalone": ["独立程序", "Standalone"],
"settings.latestVersion": ["最新版本", "Latest version"],
"settings.changelog": ["更新日志", "Changelog"],
"settings.githubUnavailablePrefix": ["无法连接 GitHub:", "Unable to connect to GitHub: "],
"settings.retryUpdateNetwork": [
"可配置更新代理或切换为直连后重试。",
"Configure an update proxy or switch to a direct connection and try again.",
],
"settings.missingPackageStart": ["没有提供", " does not provide a package for "],
"settings.missingPackageMiddle": ["的发布包(缺少", " (missing "],
"settings.missingPackageEnd": ["),无法自动更新。", "). Automatic updates are unavailable."],
"settings.downloadStart": ["将下载", "ARTEX will download "],
"settings.downloadEnd": [
",校验 SHA256 并冒烟测试后才会替换,失败自动保留当前版本。",
", verify SHA256 and run a smoke test before replacing the program. The current version is kept if any step fails.",
],
"settings.upToDateDetail": ["当前已是最新版本。", "You are using the latest version."],
"settings.dockerUpdateHelpStart": [
"Docker 下的更新只替换程序本身,不更新镜像里的 playwright / nmap 等工具链,且",
"Updates in Docker replace only ARTEX, not tools such as playwright / nmap in the image. Running ",
],
"settings.dockerUpdateHelpMiddle": [
"重建容器后会退回镜像自带的版本。需要连镜像一起升级请执行",
" to recreate the container restores the version in the image. To upgrade the image as well, run ",
],
"settings.restarting": [
"正在重启并应用新版本,请稍候(页面会自动刷新)…",
"Restarting and applying the new version. Please wait; the page will reload automatically…",
],
"settings.checkUpdates": ["检查更新", "Check for updates"],
"settings.updateTo": ["更新到 {{version}}", "Update to {{version}}"],
"settings.updateNow": ["立即更新", "Update now"],
"settings.rollback": ["回滚到上一版本", "Roll back to previous version"],
"settings.restartScriptHelpStart": [
"一键更新依赖守护脚本重启程序。请通过",
"One-click updates require a supervisor script to restart ARTEX. Start ARTEX using ",
],
"settings.restartScriptHelpMiddle": ["(Windows 为", " (Windows: "],
"settings.restartScriptHelpEnd": [
")启动 ARTEX;直接运行 artex 本体时,程序退出后不会被自动拉起。",
"). If you run the artex binary directly, it will not restart automatically after exiting.",
],
"settings.keywords.trafficCapture": ["流量 捕获 traffic proxy HTTP 代理", "traffic capture recording proxy HTTP"],
"settings.keywords.trafficBinding": [
"Agent 自动绑定流量 数据包 报告 evidence",
"Agent automatic traffic binding packets report evidence",
],
"settings.keywords.browserSecurity": [
"截图 浏览器报告时间 OPSEC 请求头 代理 TLS 流量",
"screenshots browser report timestamp OPSEC headers proxy TLS traffic",
],
"settings.keywords.globalProxy": [
"全局代理 出口 IP socks5 http https",
"global proxy outbound IP egress SOCKS5 HTTP HTTPS pool rotation health check reconnection",
],
"settings.keywords.constraints": [
"操作约束 allow deny planner worker 爆破",
"operation constraints allow deny planner worker brute force",
],
"settings.keywords.noa": ["实验 noa 压缩", "experimental noa compaction context compression"],
"settings.keywords.autoTitles": ["自动标题 任务 对话", "automatic titles task names conversations chat"],
"settings.keywords.intelligence": ["任务情报 凭据 线索", "task intelligence credentials leads sensitive data"],
"settings.keywords.webSearch": [
"网络搜索 Brave Tavily DuckDuckGo DeepSeek web_search",
"web search Brave Tavily DuckDuckGo DeepSeek web_search",
],
"settings.keywords.python": ["Python 解释器 自定义脚本 script", "Python interpreter custom scripts script"],
"settings.keywords.workers": ["工作并发 Worker 并发模型池", "Worker concurrency model pools parallel"],
"settings.keywords.chatSend": [
"会话输入框 发送键位 Enter Shift",
"chat input send shortcut keyboard Enter Shift Ctrl",
],
"settings.failureCount": ["失败 {{count}} 次", "{{count}} failures"],
"settings.failureCount_one": ["失败 {{count}} 次", "{{count}} failure"],
"settings.failureCount_other": ["失败 {{count}} 次", "{{count}} failures"],
"settings.switchHistory": ["最近切换记录({{count}})", "Recent switches ({{count}})"],
"settings.workerTotal": ["当前合计:{{count}} 个 Worker 会话", "Total: {{count}} Worker sessions"],
"settings.workerTotal_one": ["当前合计:{{count}} 个 Worker 会话", "Total: {{count}} Worker session"],
"settings.workerTotal_other": ["当前合计:{{count}} 个 Worker 会话", "Total: {{count}} Worker sessions"],
"settings.sendMode.enter": ["Enter 发送,Shift+Enter 换行", "Enter to send, Shift+Enter for a new line"],
"settings.sendMode.ctrl-enter": ["Ctrl+Enter 发送,Enter 换行", "Ctrl+Enter to send, Enter for a new line"],
"settings.webSearchOverview": [
"这是网络搜索的总开关 + 来源配置。开启后,才能在每个 Agent 的配置里单独选择是否启用 web_search(仅返回标题/链接/摘要,不抓取正文;抓取由 WebFetch 负责)。网络搜索不走记录代理,独立于流量捕获。",
"This is the master switch and provider configuration for web search. Once enabled, you can turn on web_search in each Agent’s settings. It returns titles, links and summaries; WebFetch retrieves page content. Web search is independent of traffic capture and does not use the capture proxy.",
],
"settings.searchProviderHelp": [
"来源可选 DuckDuckGo(ddgs)(无需 Key)、Brave(免费版)(需填写 Brave API Key)、Tavily(需填写 Tavily API Key)或 DeepSeek(需单独配置 Search API Key)。总开关关闭时,各 Agent 的网络搜索开关不可用。",
"Choose DuckDuckGo (ddgs, no key required), Brave (free tier, Brave API key required), Tavily (Tavily API key required), or DeepSeek (a separate Search API key is required). When the master switch is off, web search is unavailable to all Agents.",
],
"settings.updateNetworkLoadFailed": [
"读取更新网络设置失败:{{message}}",
"Could not load update network settings: {{message}}",
],
"settings.nonReleaseVersion": [
"当前版本 {{version}} 不是正式发布版本,已禁用一键更新",
"Version {{version}} is not an official release. One-click updates are disabled.",
],
"settings.progress.idle": ["准备中…", "Preparing…"],
"settings.progress.downloading": ["正在下载更新…", "Downloading update…"],
"settings.progress.verifying": ["校验 SHA256…", "Verifying SHA256…"],
"settings.progress.extracting": ["解压并冒烟测试…", "Extracting and running a smoke test…"],
"settings.progress.staged": ["新版本已就绪,正在重启…", "The new version is ready. Restarting…"],
"settings.progress.failed": ["更新失败", "Update failed"],
"settings.directIp": ["直连 IP", "Direct IP"],
"settings.globalProxyIp": ["全局代理 IP", "Global proxy IP"],
"settings.probingIp": ["正在探测出口 IP…", "Probing outbound IP…"],
"settings.noEgressResults": ["出口 IP 暂无结果", "No outbound IP results yet"],
"settings.refreshEgress": ["刷新出口 IP", "Refresh outbound IP"],
"settings.hideEgress": ["关闭出口 IP显示", "Hide outbound IP"],
"settings.noProbeResult": ["未返回结果", "No result returned"],
"settings.notConfigured": ["未配置", "Not configured"],
"settings.connected": ["已连通", "Connected"],
"settings.egressCheck.direct": ["① 直连出口 IP", "① Direct outbound IP"],
"settings.egressCheck.global": ["② 全局代理出口 IP", "② Global proxy outbound IP"],
"settings.noGlobalProxy": ["未配置全局代理", "No global proxy configured"],
} satisfies Record<string, readonly [string, string]>;
+51
View File
@@ -0,0 +1,51 @@
export const settingsRuntimeMessages = {
"settings.progress.rollback_unprotected": [
"警告:写入升级标记失败,本次升级将没有自动回滚保护",
"Warning: The update marker could not be written. This update will not have automatic rollback protection.",
],
"settings.searchTestSucceeded_one": [
"搜索测试成功 · {{backend}} 返回 {{count}} 条结果",
"Search test passed · {{backend}} returned {{count}} result",
],
"settings.searchTestSucceeded_other": [
"搜索测试成功 · {{backend}} 返回 {{count}} 条结果",
"Search test passed · {{backend}} returned {{count}} results",
],
"settings.egressSkip.no_proxy": ["输入框为空,未配置代理", "The field is empty; no proxy is configured"],
"settings.egressSkip.saved_proxy_active": [
"输入框为空;已保存的代理仍在生效",
"The field is empty; the saved proxy is still active",
],
"settings.egressWarning.pending_direct": [
"此地址尚未保存,Agent 当前仍使用 {{proxy}}。保存后即改为直连。",
"This change is not saved. Agents still use {{proxy}}. Saving will switch to a direct connection.",
],
"settings.egressWarning.pending_proxy": [
"此地址尚未保存,Agent 当前仍为直连。上方结果对应输入框中的值,保存后生效。",
"This address is not saved. Agents still connect directly. The test uses the value in the field; save it to apply.",
],
"settings.egressWarning.pending_change": [
"此地址尚未保存,Agent 当前仍使用 {{proxy}}。上方结果对应输入框中的值,保存后生效。",
"This address is not saved. Agents still use {{proxy}}. The test uses the value in the field; save it to apply.",
],
"settings.egressWarning.socks_without_capture": [
"当前是「关闭捕获 + socks5」:本测试用的是 Go 客户端(一定遵守代理),但 agent 的工具不一定——curl 能走,python urllib 会直接报错。所以这里通不代表工具都能走;要稳定生效请开启流量捕获(由 MITM 亲自拨号)。",
"Traffic capture is disabled with SOCKS5. This test uses a Go client that respects the proxy, but Agent tools may behave differently: curl supports it, while Python urllib may fail. A successful test does not guarantee all tools will work. Enable traffic capture to let the MITM proxy handle connections.",
],
"settings.egressWarning.same_ip": [
"直连与代理的出口 IP 相同({{ip}}):可能代理未生效、只是透明转发,也可能跳板机与本机在同一 NAT 后面(出口本来就相同)。要区分:在「自定义 IP 探测服务」里填一台内网回显服务,看它看到的源 IP 是否变成了跳板机。",
"Direct and proxy connections have the same outbound IP ({{ip}}). The proxy may be inactive, forwarding transparently, or sharing the same NAT as this computer. Use a private-network echo service as the custom probe and check whether it sees the proxy host’s source IP.",
],
"settings.egressWarning.capture_direct": [
"已开启流量捕获,但全局代理为空:捕获只负责记录,出口仍是直连。",
"Traffic capture is enabled, but no global proxy is configured. Capture records traffic; outbound connections are still direct.",
],
"settings.egressWarning.loopback_proxy": [
"代理地址是回环地址(127.0.0.1 / localhost)。如果 ARTEX 跑在容器里,这里的 127.0.0.1 指容器自身,连不到宿主机上的代理;请改用宿主机的可达 IP(如 http://192.168.x.x:端口)。",
"The proxy uses a loopback address (127.0.0.1 / localhost). Inside a container this refers to the container itself, not the host proxy. Use a reachable host IP, such as http://192.168.x.x:port.",
],
"error.demo_basic_auth_disabled": [
"演示模式不支持修改 HTTP Basic Auth,请在实际部署中配置",
"HTTP Basic Auth cannot be changed in the demo. Configure it in a deployed instance.",
],
} satisfies Record<string, readonly [string, string]>;
+8
View File
@@ -0,0 +1,8 @@
import type { i18n } from "i18next";
export function matchesSettingsQuery(instance: Pick<i18n, "t">, keywordKey: string, query: string): boolean {
const normalized = query.trim().toLowerCase();
if (!normalized) return true;
const keywords = [instance.t(keywordKey, { lng: "zh-CN" }), instance.t(keywordKey, { lng: "en" })].join(" ");
return keywords.toLowerCase().includes(normalized);
}
+845
View File
@@ -0,0 +1,845 @@
export const taskMessages = {
"taskUI.filesDeleted": ["删除任务文件", "Task files deleted"],
"taskUI.taskDeleted": ["任务已删除", "Task deleted"],
"taskUI.created": ["已创建", "Created"],
"taskUI.queued": ["排队中", "Queued"],
"taskUI.running": ["运行中", "Running"],
"taskUI.paused": ["已暂停", "Paused"],
"taskUI.done": ["已完成", "Completed"],
"taskUI.failed": ["失败", "Failed"],
"taskUI.timeout": ["已超时", "Timed out"],
"taskUI.name": ["名称", "Name"],
"taskUI.remark": ["备注", "Notes"],
"taskUI.description": ["描述", "Description"],
"taskUI.goal": ["目标", "Goal"],
"taskUI.status": ["状态", "Status"],
"taskUI.progress": ["目标进度", "Goal progress"],
"taskUI.findings": ["漏洞", "Findings"],
"taskUI.workers": ["运行中 Worker", "Active Workers"],
"taskUI.createdAt": ["创建时间", "Created"],
"taskUI.duration": ["运行时长", "Run duration"],
"taskUI.batchLimit": ["一次最多控制 100 个任务", "Control up to 100 tasks at a time"],
"taskUI.categoryBatchLimit": ["一次最多修改 100 个任务的分类", "Move up to 100 tasks at a time"],
"taskUI.uncategorized": ["未分类", "Uncategorized"],
"taskUI.currentTasks": ["当前任务", "Current tasks"],
"taskUI.archived": ["已归档", "Archived"],
"taskUI.search": ["搜索描述 / 目标 / ID", "Search description / goal / ID"],
"taskUI.clearSearch": ["清除搜索", "Clear search"],
"taskUI.allStates": ["全部状态", "All statuses"],
"taskUI.category": ["任务分类", "Task category"],
"taskUI.allCategories": ["全部分类", "All categories"],
"taskUI.deselect": ["取消选择", "Clear selection"],
"taskUI.pause": ["暂停", "Pause"],
"taskUI.resume": ["继续", "Resume"],
"taskUI.archive": ["归档", "Archive"],
"taskUI.empty": [
"暂无任务,点击右上角「新建任务」开始。",
"No tasks yet. Click “New task” at the top right to get started.",
],
"taskUI.noMatches": ["没有匹配的任务。", "No matching tasks."],
"taskUI.selectPage": ["选择本页全部任务", "Select all tasks on this page"],
"taskUI.findingSeverity": ["独立漏洞:严重 / 高 / 中 / 低", "Distinct findings: Critical / High / Medium / Low"],
"taskUI.severityShort": ["严/高/中/低", "Crit/High/Med/Low"],
"taskUI.actions": ["操作", "Actions"],
"taskUI.columnsSettings": ["列表显示设置", "Task list display settings"],
"taskUI.columns": ["列表显示", "Columns"],
"taskUI.columnsHelp": [
"选择当前任务列表要显示的列,设置会保存在当前浏览器中。",
"Choose columns for the current task list. Your preferences are saved in this browser.",
],
"taskUI.reset": ["恢复默认", "Reset defaults"],
"taskUI.finish": ["完成", "Done"],
"taskUI.concurrencyDisabled": ["已关闭任务并发限制", "Task concurrency limit disabled"],
"taskUI.concurrencySettings": ["任务并发设置", "Task concurrency settings"],
"taskUI.concurrency": ["并发设置", "Concurrency"],
"taskUI.concurrencyLimit": ["任务并发限制", "Task concurrency limit"],
"taskUI.concurrencyHelp": [
"限制同时运行的任务数量。达到上限后,新任务会按创建顺序排队并在空位出现时自动启动。",
"Limit the number of tasks running at once. New tasks wait in creation order and start automatically when a slot opens.",
],
"taskUI.enableConcurrency": ["开启任务并发限制", "Enable task concurrency limit"],
"taskUI.offByDefault": ["默认关闭", "Off by default"],
"taskUI.maxConcurrent": ["同时运行上限", "Maximum concurrent tasks"],
"taskUI.cancel": ["取消", "Cancel"],
"taskUI.save": ["保存", "Save"],
"taskUI.pinned": ["已置顶", "Pinned"],
"taskUI.inputShort": ["入", "In"],
"taskUI.cacheShort": ["· 缓", "· Cache"],
"taskUI.outputShort": ["· 出", "· Out"],
"taskUI.viewTask": ["查看任务详情", "View task details"],
"taskUI.viewTaskHelp": [
"查看任务进度、探索记录、测试资产和发现的漏洞。",
"View task progress, exploration history, test assets and findings.",
],
"taskUI.untitled": ["未命名", "Untitled"],
"taskUI.rename": ["重命名任务", "Rename task"],
"taskUI.renameHelp": ["修改任务名称,便于识别和查找。", "Give the task a name that is easy to recognize and find."],
"taskUI.unpin": ["取消置顶", "Unpin"],
"taskUI.pin": ["置顶任务", "Pin task"],
"taskUI.unpinHelp": ["取消此任务的置顶,恢复正常排序。", "Unpin this task to restore its normal sort order."],
"taskUI.pinHelp": [
"将此任务固定在列表顶部,便于快速查看。",
"Keep this task at the top of the list for quick access.",
],
"taskUI.on": ["已开启", "On"],
"taskUI.off": ["已关闭", "Off"],
"taskUI.shareHelp": [
"开启后可查询全局资产库;关闭后仅使用本任务已关联的资产及直接关联任务的资产。",
"Enable access to the global asset library. When disabled, only assets linked to this task and its directly linked tasks are used.",
],
"taskUI.stopSharing": ["点击关闭共享", "Click to stop sharing"],
"taskUI.startSharing": ["点击开启共享", "Click to start sharing"],
"taskUI.resumeTask": ["继续任务", "Resume task"],
"taskUI.pauseTask": ["暂停任务", "Pause task"],
"taskUI.pauseHelp": ["暂停当前任务的执行,之后可继续。", "Pause this task. You can resume it later."],
"taskUI.resumeHelp": [
"继续已暂停的任务;等待中的任务将重新进入调度。",
"Resume a paused task. Waiting tasks return to scheduling.",
],
"taskUI.controlUnavailable": [
"当前任务状态不支持暂停或继续。",
"This task cannot be paused or resumed in its current state.",
],
"taskUI.pauseQueuedFirst": ["排队中的任务必须先暂停", "Pause queued tasks first"],
"taskUI.pauseActiveFirst": ["运行中或尚未结束的任务必须先暂停", "Pause active or unfinished tasks first"],
"taskUI.archiveTask": ["归档任务", "Archive task"],
"taskUI.archiveHelp": [
"归档会停止任务调度,将图谱、LLM 历史、文件以及独占资产和流量压缩到本地冷存储。归档完成后可从“已归档”中还原。",
"Archiving stops task scheduling and compresses the graph, LLM history, files, exclusive assets and traffic into local storage. Restore the task later from Archived.",
],
"taskUI.confirmArchive": ["确认归档", "Confirm archive"],
"taskUI.cannotArchive": ["暂不可归档", "Cannot archive yet"],
"taskUI.archiveTooltip": [
"将任务及相关记录压缩保存,之后可从“已归档”中还原。点击后需确认。",
"Compress and save this task and its records for later restoration from Archived. Confirmation is required.",
],
"taskUI.archiveQueued": ["等待归档", "Queued for archiving"],
"taskUI.archiving": ["归档中", "Archiving"],
"taskUI.archiveFailed": ["归档失败", "Archiving failed"],
"taskUI.ready": ["可还原", "Ready to restore"],
"taskUI.restoreQueued": ["等待还原", "Queued for restoration"],
"taskUI.restoring": ["还原中", "Restoring"],
"taskUI.restoreFailed": ["还原失败", "Restoration failed"],
"taskUI.deleteQueued": ["等待删除", "Queued for deletion"],
"taskUI.deleting": ["删除中", "Deleting"],
"taskUI.deleteFailed": ["删除失败", "Deletion failed"],
"taskUI.permanentDelete": ["永久删除", "Delete permanently"],
"taskUI.archiveNotFound": ["归档不存在", "Archive not found"],
"taskUI.requeued": ["已重新加入处理队列", "Queued again for processing"],
"taskUI.archiveSearch": ["搜索任务名称 / 描述 / ID", "Search task name / description / ID"],
"taskUI.processingState": ["处理状态", "Processing status"],
"taskUI.restore": ["还原", "Restore"],
"taskUI.noArchives": ["暂无任务归档", "No task archives yet"],
"taskUI.noArchivesHelp": [
"暂停或终态任务可从当前任务列表归档。",
"Paused and finished tasks can be archived from the current task list.",
],
"taskUI.selectArchivePage": ["选择当前页归档", "Select archives on this page"],
"taskUI.task": ["任务", "Task"],
"taskUI.originalState": ["原状态", "Original status"],
"taskUI.categoryLabel": ["分类", "Category"],
"taskUI.archivedAt": ["归档时间", "Archived"],
"taskUI.compressedSize": ["压缩大小", "Compressed size"],
"taskUI.dataCount": ["数据量", "Data count"],
"taskUI.retryArchive": ["重试归档操作", "Retry archive operation"],
"taskUI.retryArchiveHelp": [
"重新执行上次失败的归档、还原或删除操作。",
"Retry the last failed archive, restore or delete operation.",
],
"taskUI.restoreTask": ["还原任务", "Restore task"],
"taskUI.restoreHelp": [
"将归档中的任务及相关记录恢复到当前任务列表。",
"Restore this task and its records to the current task list.",
],
"taskUI.deleteArchive": ["永久删除归档", "Delete archive permanently"],
"taskUI.deleteArchiveHelp": [
"删除此归档及其保存的数据,删除后无法还原。点击后需确认。",
"Permanently delete this archive and its stored data. Confirmation is required.",
],
"taskUI.cleanup": ["同时清理关联数据", "Also clean up related data"],
"taskUI.deleteAll": ["全部删除", "Delete all"],
"taskUI.deleteAllHelp": [
"选中下方全部关联数据,包括资产、流量、文件、漏洞和 LLM 请求/响应记录。",
"Select all related data below, including assets, traffic, files, findings and LLM request/response records.",
],
"taskUI.linkedAssets": ["关联资产", "Linked assets"],
"taskUI.deleteAssetsHelp": [
"删除仅属于该任务的资产;共享资产只解除当前任务关联。",
"Delete assets exclusive to this task. Shared assets are unlinked from this task.",
],
"taskUI.linkedTraffic": ["关联流量", "Linked traffic"],
"taskUI.deleteTrafficHelp": [
"按关联资产的精确主机名删除;仍被其他任务引用的共享主机流量会保留。",
"Delete traffic matching the exact hostnames of linked assets. Traffic for hosts still used by other tasks is retained.",
],
"taskUI.taskFiles": ["任务文件", "Task files"],
"taskUI.deleteFilesHelp": [
"删除该任务工作目录中的上传文件、命令输出和其他产物。",
"Delete uploaded files, command output and other artifacts in this task’s working directory.",
],
"taskUI.linkedFindings": ["关联漏洞", "Linked findings"],
"taskUI.deleteFindingsHelp": [
"永久删除该任务产生的独立漏洞记录与漏洞报告。",
"Permanently delete distinct findings and finding reports produced by this task.",
],
"taskUI.llmRecords": ["LLM 请求/响应记录", "LLM request/response records"],
"taskUI.deleteLLMHelp": [
"永久删除该任务录制的 LLM 请求、响应、Token 与错误详情。",
"Permanently delete this task’s recorded LLM requests, responses, token usage and error details.",
],
"taskUI.deleteTask": ["删除任务", "Delete task"],
"taskUI.deleteTaskHelp": [
"删除任务及执行记录;可在确认窗口选择是否同时清理关联数据。",
"Delete the task and execution history. Choose whether to clean up related data in the confirmation dialog.",
],
"taskUI.thisTask": ["该任务", "this task"],
"taskUI.delete": ["删除", "Delete"],
"taskUI.changeCategory": ["修改分类", "Change category"],
"taskUI.changeCategoryHelp": [
"目标分类对所选任务统一生效;选「未分类」会把它们移出当前分类。",
"Apply one category to all selected tasks. Choose Uncategorized to remove their current category.",
],
"taskUI.targetCategory": ["目标分类", "Target category"],
"taskUI.selectCategory": ["选择分类", "Select category"],
"taskUI.noCategoriesHelp": [
"还没有任何分类,先用「分类管理」创建一个。",
"No categories yet. Create one in Manage categories.",
],
"taskUI.move": ["移动", "Move"],
"taskUI.deleteSelectedHelp": [
"这些任务的执行记录与探索链路将被永久删除,下方清理选项对所选任务统一生效。",
"Permanently delete the execution history and exploration paths of these tasks. The cleanup options below apply to all selected tasks.",
],
"taskUI.sourceSearch": ["搜索任务 ID、描述或目标", "Search task ID, description or goal"],
"taskUI.sourceNoMatches": ["没有匹配的任务", "No matching tasks"],
"taskUI.unknownTask": ["未知任务", "Unknown task"],
"taskUI.unknownCategory": ["未知分类", "Unknown category"],
"taskUI.categorySearch": [
"搜索分类,或输入新名称后回车创建",
"Search categories, or enter a new name and press Enter to create one",
],
"taskUI.categorySearchHelp": ["输入名称以搜索或创建分类", "Enter a name to find or create a category"],
"taskUI.domain": ["域名", "Domain"],
"taskUI.keyword": ["关键词", "Keyword"],
"taskUI.noScope": ["未配置资产范围", "No asset scope configured"],
"taskUI.companySearch": ["搜索企业名称或资产范围", "Search company name or asset scope"],
"taskUI.companyNoMatches": ["没有匹配的企业", "No matching companies"],
"taskUI.dropToMove": ["松开以移动", "Release to move"],
"taskUI.moveCategory": ["移动任务分类", "Move task to category"],
"taskUI.dragHelp": ["按住并拖动此图标,将任务移动到目标分类。", "Drag this icon to move the task to a category."],
"taskUI.categoryCreated": ["分类已创建", "Category created"],
"taskUI.categoryUpdated": ["分类已更新", "Category updated"],
"taskUI.categoryDeleted": [
"分类已删除,关联任务已移入未分类",
"Category deleted. Linked tasks moved to Uncategorized.",
],
"taskUI.targetCategoryMissing": [
"目标分类不存在,请刷新后重试",
"The target category no longer exists. Refresh and try again.",
],
"taskUI.saving": ["保存中", "Saving"],
"taskUI.createCategory": ["创建分类", "Create category"],
"taskUI.saveChanges": ["保存修改", "Save changes"],
"taskUI.manageCategories": ["分类管理", "Manage categories"],
"taskUI.categoryManagement": ["任务分类管理", "Manage task categories"],
"taskUI.categoryManagementHelp": [
"分类用于任务筛选与归档;修改不会影响任务执行,删除后任务会移入未分类。",
"Use categories to filter and organize tasks. Editing a category does not affect execution. Deleting it moves its tasks to Uncategorized.",
],
"taskUI.newCategory": ["新建分类", "New category"],
"taskUI.categoryName": ["分类名称", "Category name"],
"taskUI.categoryExample": ["例如:外网评估", "For example: External assessment"],
"taskUI.categoryCreateHelp": [
"创建后可在新建任务和任务列表筛选中使用。",
"Use the category when creating or filtering tasks.",
],
"taskUI.categoryTasks": ["分类任务", "Tasks in category"],
"taskUI.uncategorizedTasks": ["未分类任务", "Uncategorized tasks"],
"taskUI.categoryEmpty": ["该分类暂无任务", "No tasks in this category"],
"taskUI.uncategorizedEmpty": ["暂无未分类任务", "No uncategorized tasks"],
"taskUI.categoryEmptyHelp": [
"此处将在任务归入后显示内容。",
"Tasks appear here when they are added to the category.",
],
"taskUI.deleteCategory": ["删除分类", "Delete category"],
"taskUI.close": ["关闭", "Close"],
"taskUI.untitledCategory": ["未命名分类", "Untitled category"],
"taskUI.defaultSchedule": ["新建任务计划", "New task schedule"],
"taskUI.descriptionGoalRequired": ["请填写描述与目标", "Enter a description and goal"],
"taskUI.taskCreated": ["任务已创建", "Task created"],
"taskUI.newTask": ["新建任务", "New task"],
"taskUI.newTaskHelp": [
"填写测试对象与目标,高级参数可按需展开。",
"Enter the test target and goal. Expand advanced settings as needed.",
],
"taskUI.nameOptional": ["名称(可选)", "Name (optional)"],
"taskUI.nameExample": [
"给任务起个便于识别的名字,例如:Acme 官网渗透",
"Choose a recognizable name, for example: Acme website assessment",
],
"taskUI.remarkOptional": ["备注(可选)", "Notes (optional)"],
"taskUI.remarkExample": [
"补充说明、环境信息等,便于在任务列表识别",
"Add context or environment details to identify this task in the list",
],
"taskUI.categoryHelp": [
"可选,单个分类;用于任务列表筛选和归档,不影响 Agent 执行。",
"Optionally choose one category for filtering and organization. This does not affect Agent execution.",
],
"taskUI.scheduleOptional": ["计划启动(可选)", "Scheduled start (optional)"],
"taskUI.scheduleEnable": [
"创建时附加计划,按时间窗口启动和暂停",
"Attach a schedule to start and pause the task in time windows",
],
"taskUI.scheduleName": ["计划名称", "Schedule name"],
"taskUI.rule": ["规则", "Rule"],
"taskUI.weekly": ["按周", "Weekly"],
"taskUI.once": ["指定日期", "Specific date"],
"taskUI.timezone": ["时区", "Time zone"],
"taskUI.beijing": ["北京时间", "Beijing time"],
"taskUI.systemTimezone": ["系统时区", "System time zone"],
"taskUI.startDate": ["开始日期", "Start date"],
"taskUI.endDateOptional": ["截止日期(可选)", "End date (optional)"],
"taskUI.noEndDate": ["不设置截止日期", "No end date"],
"taskUI.endDateAccessible": ["截止日期,可选", "End date, optional"],
"taskUI.weekdays": ["星期(1=周一,7=周日)", "Weekdays (1=Monday, 7=Sunday)"],
"taskUI.weekdaysExample": ["例如 6,7", "For example: 6,7"],
"taskUI.startTime": ["开始时间", "Start time"],
"taskUI.endTimeOptional": ["结束时间(可选)", "End time (optional)"],
"taskUI.endTimeAccessible": ["结束时间,可选", "End time, optional"],
"taskUI.startImmediately": [
"创建后立即启动,否则等待第一个计划窗口",
"Start immediately after creation; otherwise wait for the first scheduled window",
],
"taskUI.descriptionExample": [
"测试对象与背景,例如:测试 example.com 这个站点",
"Test target and context, for example: Assess example.com",
],
"taskUI.upload": ["上传文件", "Upload files"],
"taskUI.uploadHelp": [
"可多选;上传后把文件的绝对路径追加到描述,供 worker 用 Read/Bash 打开",
"Select multiple files. Their absolute paths are appended to the description so the Worker can open them with Read/Bash.",
],
"taskUI.goalExample": [
"要达成什么,例如:拿下后台管理权限、获取服务器权限",
"Desired outcome, for example: Assess access to the admin panel or server",
],
"taskUI.shareGlobal": ["共享全局资产", "Share global assets"],
"taskUI.shareGlobalHelp": [
"默认关闭,仅使用本任务及明确关联任务的资产。开启后可查询全局资产库,测试仍须遵守授权范围。",
"Off by default. Use assets from this task and explicitly linked tasks. Enable to query the global asset library; testing still follows the authorized scope.",
],
"taskUI.linkedTasks": ["关联任务", "Linked tasks"],
"taskUI.companyScope": ["关联企业资产范围", "Link company asset scope"],
"taskUI.companyScopeHelp": [
"创建任务时会将所选企业当前已有资产加入“测试资产”,并将域名、IP、CIDR、ICP 和企业关键词提供给 Agent 作为范围上下文;不会自动生成意图或强制改变执行目标。",
"When the task is created, existing assets of the selected companies are added to Test assets. Domain, IP, CIDR, ICP and company keywords provide scope context to the Agent without automatically creating intents or changing the goal.",
],
"taskUI.interceptOptional": ["任务级资产拦截 / 允许规则(可选)", "Task asset block / allow rules (optional)"],
"taskUI.interceptHelp": [
"仅对本任务生效,不写入全局规则。判定顺序:先按「拦截」规则(含全局)匹配,命中即禁止测试;未命中且本任务配置了「允许」规则时,须命中某条允许规则才放行,否则同样不允许测试;未配置任何允许规则则不启用白名单。",
"Applies only to this task. Block rules, including global rules, are checked first. If none match and task allow rules exist, an asset must match an allow rule before testing. Without allow rules, no allowlist is enforced.",
],
"taskUI.llmChain": ["LLM 配置链", "LLM configuration chain"],
"taskUI.llmChainHelp": [
"按列表顺序故障转移;第一项为当前配置,仅在明确额度不足时切换下一项。",
"Fail over in list order. The first configuration is current; switch to the next only when quota is confirmed insufficient.",
],
"taskUI.advanced": ["高级设置", "Advanced settings"],
"taskUI.advancedSummary": ["超时 · 心跳 · Worker · 首个意图", "Timeout · Heartbeat · Workers · First intent"],
"taskUI.timeoutOptional": ["任务超时(分钟,可选)", "Task timeout (minutes, optional)"],
"taskUI.noTimeout": ["留空 = 不限时", "Leave empty for no timeout"],
"taskUI.timeoutHelp": [
"到点后触发优雅收尾(各 agent 写回 + planner 终局判定),任务进入 timeout 终态。",
"At the timeout, Agents write back and the Planner makes a final decision before the task ends with timeout status.",
],
"taskUI.heartbeat": ["planner 心跳(分钟)", "Planner heartbeat (minutes)"],
"taskUI.defaultTen": ["默认 10", "Default: 10"],
"taskUI.heartbeatHelp": [
"距上轮规划结束/任务开始满该时长且期间无触发,自动触发一轮规划(兜底卡死 + 唤醒去监督在跑的 worker)。下限 10 分钟。",
"Automatically trigger planning after this interval from the task start or previous planning cycle if no other trigger occurs. This helps recover stalled work and supervise active Workers. Minimum: 10 minutes.",
],
"taskUI.workerCount": ["Worker 运行数量(可选)", "Worker count (optional)"],
"taskUI.globalDefault": ["留空 = 全局默认", "Leave empty for global default"],
"taskUI.workerCountHelp": [
"单独设置本任务并发运行的工作 Agent 数量;留空或 0 = 用全局默认(系统设置里的工作并发,默认 3)。上限 50。",
"Set concurrent Workers for this task. Leave empty or enter 0 to use the global Worker concurrency setting (default: 3). Maximum: 50.",
],
"taskUI.seedIntent": ["直接下发首个意图(描述+目标)", "Send the first intent directly (description + goal)"],
"taskUI.seedIntentHelp": [
"开启后创建即把「描述+目标」作为一条意图下发,worker 免等首轮规划直接开跑,跑完再由 planner 接手判定/补充。CTF 等常一个 work 直接解决的场景推荐开启;关闭则走标准的先规划再执行。",
"Immediately send the description and goal as the first intent so a Worker can start before the first planning cycle. The Planner reviews and follows up afterward. Useful for CTF tasks that often need one work item. When disabled, planning runs before execution.",
],
"taskUI.coverage": ["资产覆盖度功能", "Asset coverage"],
"taskUI.coverageHelp": [
"默认开启:计算并展示测试覆盖度、态势图显示测试进度、自动累积测试范围。关闭后不再计算/展示覆盖度, 态势图仅展示资产不显示进度,agent 也不再获得范围类工具。关闭不影响「关联企业资产范围」。",
"On by default. Calculate coverage, show test progress on the asset graph and accumulate test scope. When disabled, the graph shows assets without progress, coverage is not calculated and Agents do not receive scope tools. Linked company scopes are unaffected.",
],
"taskUI.creating": ["创建中", "Creating"],
"taskUI.create": ["创建", "Create"],
"taskUI.queueSuffix": [",已进入队列", ", queued"],
"taskUI.queueSome": [",部分任务已进入队列", ", some tasks queued"],
"taskUI.andMore": [" 等", " and more"],
"taskUI.stateChanged": ["状态已变化", "Status changed"],
"taskUI.taskMissing": ["任务已不存在", "Task no longer exists"],
"taskUI.pinAction": ["置顶", "Pin"],
"taskUI.enableAction": ["开启", "enabled"],
"taskUI.updateAction": ["更新", "Update"],
"taskUI.batchPause": ["批量暂停", "Batch pause"],
"taskUI.batchResume": ["批量继续", "Batch resume"],
"taskUI.ascending": ["正序", "ascending"],
"taskUI.descending": ["倒序", "descending"],
"taskUI.rawReports": ["原始上报", "Raw reports"],
"taskUI.distinctFindings": ["独立漏洞", "Distinct findings"],
"taskUI.shareOnLabel": ["已开启,点击关闭", "enabled; click to disable"],
"taskUI.shareOffLabel": ["未开启,点击开启", "disabled; click to enable"],
"taskUI.deletedAssets": ["删除资产 {{count}} 条", "Deleted {{count}} assets"],
"taskUI.detachedAssets": ["解除共享资产关联 {{count}} 条", "Unlinked {{count}} shared assets"],
"taskUI.deletedTraffic": ["删除流量 {{count}} 条", "Deleted {{count}} traffic records"],
"taskUI.deletedFindings": ["删除漏洞 {{count}} 条", "Deleted {{count}} findings"],
"taskUI.deletedLLM": ["删除 LLM 请求/响应记录 {{count}} 条", "Deleted {{count}} LLM request/response records"],
"taskUI.deletedDetails": ["任务已删除({{details}})", "Task deleted ({{details}})"],
"taskUI.cleanupWarning": [
"{{summary}};部分外部数据清理未完成:{{message}}",
"{{summary}}; some external data could not be cleaned up: {{message}}",
],
"taskUI.taskPaused": ["任务 #{{id}} 已暂停", "Task #{{id}} paused"],
"taskUI.taskResumed": ["任务 #{{id}} 已继续{{queue}}", "Task #{{id}} resumed{{queue}}"],
"taskUI.actionFailed": ["{{action}}失败:{{message}}", "{{action}} failed: {{message}}"],
"taskUI.taskRenamed": ["任务 #{{id}} 已重命名", "Task #{{id}} renamed"],
"taskUI.renameFailed": ["重命名失败:{{message}}", "Could not rename: {{message}}"],
"taskUI.taskUnpinned": ["任务 #{{id}} 已取消置顶", "Task #{{id}} unpinned"],
"taskUI.taskPinned": ["任务 #{{id}} 已置顶", "Task #{{id}} pinned"],
"taskUI.settingFailed": ["设置失败:{{message}}", "Could not update setting: {{message}}"],
"taskUI.taskArchiveQueued": ["任务 #{{id}} 已进入归档队列", "Task #{{id}} queued for archiving"],
"taskUI.archiveError": ["归档失败:{{message}}", "Could not archive: {{message}}"],
"taskUI.deletedTasks": ["已删除 {{count}} 个任务", "Deleted {{count}} tasks"],
"taskUI.deleteFailures": [
"{{count}} 个任务删除失败:{{details}}{{more}}",
"Could not delete {{count}} tasks: {{details}}{{more}}",
],
"taskUI.tasksArchiveQueued": ["已将 {{count}} 个任务加入归档队列", "Queued {{count}} tasks for archiving"],
"taskUI.archiveFailures": ["{{count}} 个任务无法归档:{{details}}", "Could not archive {{count}} tasks: {{details}}"],
"taskUI.itemError": ["#{{id}}({{message}})", "#{{id}} ({{message}})"],
"taskUI.tasksPaused": ["已暂停 {{count}} 个任务", "Paused {{count}} tasks"],
"taskUI.tasksResumed": ["已继续 {{count}} 个任务{{queue}}", "Resumed {{count}} tasks{{queue}}"],
"taskUI.controlFailures": [
"{{count}} 个任务操作失败:{{details}}{{more}}",
"Could not update {{count}} tasks: {{details}}{{more}}",
],
"taskUI.tasksMoved": ["已将 {{count}} 个任务移动到「{{category}}」", "Moved {{count}} tasks to “{{category}}”"],
"taskUI.moveFailures": [
"{{count}} 个任务未能移动:{{details}}{{more}}",
"Could not move {{count}} tasks: {{details}}{{more}}",
],
"taskUI.categoryChangeFailed": ["修改分类失败:{{message}}", "Could not change category: {{message}}"],
"taskUI.sortDescending": ["按{{label}}倒序排序", "Sort {{label}} in descending order"],
"taskUI.sortCurrent": [
"{{label}}当前{{direction}},点击切换排序方向",
"{{label}} is {{direction}}; click to change sort direction",
],
"taskUI.concurrencyEnabled": [
"已开启并发限制:最多同时运行 {{count}} 个任务",
"Concurrency limit enabled: up to {{count}} tasks at once",
],
"taskUI.saveFailed": ["保存失败:{{message}}", "Could not save: {{message}}"],
"taskUI.selectTask": ["选择任务 {{id}}", "Select task {{id}}"],
"taskUI.taskId": ["任务 #{{id}}", "Task #{{id}}"],
"taskUI.findingSummary": [
"{{source}}:严重 / 高 / 中 / 低;上报 {{reports}} 条;待评估 {{pending}} 个",
"{{source}}: Critical / High / Medium / Low; reports: {{reports}}; pending assessment: {{pending}}",
],
"taskUI.unassessed": [" · 待评估 {{count}}", " · Pending assessment: {{count}}"],
"taskUI.tokens": [
"输入 {{input}} · 缓存 {{cache}} · 输出 {{output}}",
"Input {{input}} · Cache {{cache}} · Output {{output}}",
],
"taskUI.taskNameLabel": ["任务 #{{id}} 名称", "Name for task #{{id}}"],
"taskUI.renameTaskId": ["重命名任务 #{{id}}", "Rename task #{{id}}"],
"taskUI.unpinTaskId": ["取消置顶任务 #{{id}}", "Unpin task #{{id}}"],
"taskUI.pinTaskId": ["置顶任务 #{{id}}", "Pin task #{{id}}"],
"taskUI.shareStateLabel": ["共享全局资产:{{state}}", "Share global assets: {{state}}"],
"taskUI.archiveDependency": [
"任务被未归档任务 #{{id}} 直接继承,请先归档依赖任务",
"Task #{{id}} directly inherits this task and is not archived. Archive that dependent task first.",
],
"taskUI.archiveTasks": ["归档 {{count}} 个任务", "Archive {{count}} tasks"],
"taskUI.archiveTaskId": ["归档任务 #{{id}}", "Archive task #{{id}}"],
"taskUI.compression": ["{{size}} · 节省 {{saved}}%", "{{size}} · {{saved}}% saved"],
"taskUI.loadArchivesFailed": ["读取归档列表失败:{{message}}", "Could not load archives: {{message}}"],
"taskUI.tasksRestoreQueued": ["已将 {{count}} 个任务加入还原队列", "Queued {{count}} tasks for restoration"],
"taskUI.restoreFailures": ["{{count}} 个任务无法还原", "Could not restore {{count}} tasks"],
"taskUI.restoreError": ["还原失败:{{message}}", "Could not restore: {{message}}"],
"taskUI.archivesDeleteQueued": [
"已将 {{count}} 个归档加入永久删除队列",
"Queued {{count}} archives for permanent deletion",
],
"taskUI.archiveDeleteFailures": ["{{count}} 个归档无法删除", "Could not delete {{count}} archives"],
"taskUI.permanentDeleteFailed": ["永久删除失败:{{message}}", "Could not permanently delete: {{message}}"],
"taskUI.retryFailed": ["重试失败:{{message}}", "Could not retry: {{message}}"],
"taskUI.selectArchive": ["选择任务归档 #{{id}}", "Select archive for task #{{id}}"],
"taskUI.beforeCompression": ["压缩前 {{size}}", "Original size: {{size}}"],
"taskUI.deleteProgress": ["删除中 {{done}}/{{total}}", "Deleting {{done}}/{{total}}"],
"taskUI.deleteTasks": ["删除 {{count}} 个任务", "Delete {{count}} tasks"],
"taskUI.sourceLimit": ["最多关联 {{count}} 个任务", "Link up to {{count}} tasks"],
"taskUI.categoryCreatedName": ["已创建分类「{{name}}」", "Created category “{{name}}”"],
"taskUI.createCategoryFailed": ["创建分类失败:{{message}}", "Could not create category: {{message}}"],
"taskUI.scopeMore": [" · 另 {{count}} 条", " · {{count}} more"],
"taskUI.companyId": ["企业 #{{id}}", "Company #{{id}}"],
"taskUI.taskCount": ["{{count}} 个任务", "{{count}} tasks"],
"taskUI.dragTask": ["拖动任务 #{{id}}", "Drag task #{{id}}"],
"taskUI.categorySaveFailed": ["{{action}}分类失败:{{message}}", "{{action}} category failed: {{message}}"],
"taskUI.deleteCategoryFailed": ["删除分类失败:{{message}}", "Could not delete category: {{message}}"],
"taskUI.taskMoved": ["任务 #{{id}} 已移至「{{category}}」", "Task #{{id}} moved to “{{category}}”"],
"taskUI.moveTaskFailed": ["移动任务失败:{{message}}", "Could not move task: {{message}}"],
"taskUI.categoryUsed": [
"当前有 {{count}} 个任务使用该分类。重命名后会同步更新任务列表。",
"{{count}} tasks use this category. Renaming updates the task list.",
],
"taskUI.categoryContains": ["该分类包含 {{count}} 个任务。", "This category contains {{count}} tasks."],
"taskUI.uncategorizedCount": ["当前有 {{count}} 个任务尚未分类。", "{{count}} tasks are uncategorized."],
"taskUI.sourceTaskLimit": ["最多关联 {{count}} 个来源任务", "Link up to {{count}} source tasks"],
"taskUI.invalidWorkers": [
"Worker 运行数量必须是 0-{{max}} 的整数",
"Worker count must be an integer from 0 to {{max}}",
],
"taskUI.uploaded": [
"已上传 {{count}} 个文件,绝对路径已追加到描述末尾(可编辑)",
"Uploaded {{count}} files. Absolute paths are appended to the description and can be edited.",
],
"taskUI.globalAssetsDisabled": ["任务 #{{id}} 已关闭共享全局资产", "Global asset sharing disabled for task #{{id}}"],
"taskUI.globalAssetsEnabled": ["任务 #{{id}} 已开启共享全局资产", "Global asset sharing enabled for task #{{id}}"],
"taskUI.deleteError": ["删除失败:{{message}}", "Could not delete: {{message}}"],
"taskUI.uploadError": ["上传失败:{{message}}", "Could not upload: {{message}}"],
"taskUI.createError": ["创建失败:{{message}}", "Could not create: {{message}}"],
"taskUI.filteredCount": ["{{visible}}/{{total}} 条", "{{visible}}/{{total}} records"],
"taskUI.selectedCount": ["已选 {{count}} 个", "{{count}} selected"],
"taskUI.archiveCount": ["{{count}} 个归档", "{{count}} archives"],
"taskUI.sharingOn": ["共享全局资产 · 已开启", "Share global assets · On"],
"taskUI.sharingOff": ["共享全局资产 · 已关闭", "Share global assets · Off"],
"taskUI.confirmDeleteArchives": ["永久删除 {{count}} 个任务归档?", "Permanently delete {{count}} task archives?"],
"taskUI.deleteArchiveDetails": [
"将永久删除约 {{size}} 的归档包及 {{rows}} 条关联数据快照。此操作不可恢复。",
"Permanently delete approximately {{size}} of archives and {{rows}} related data snapshots. This cannot be undone.",
],
"taskUI.confirmDeleteTask": ["确认删除任务 #{{id}}?", "Delete task #{{id}}?"],
"taskUI.deleteTaskDetails": [
"“{{name}}”的执行记录与探索链路将被永久删除。",
"Permanently delete execution history and exploration paths for “{{name}}”.",
],
"taskUI.moveCategoryTitle": ["修改所选 {{count}} 个任务的分类", "Change category for {{count}} selected tasks"],
"taskUI.deleteSelectedCount": ["删除所选 {{count}}", "Delete selected ({{count}})"],
"taskUI.confirmDeleteSelected": ["确认删除所选 {{count}} 个任务?", "Delete {{count}} selected tasks?"],
"taskUI.moreSelected": ["…等 {{count}} 个", "… {{count}} selected in total"],
"taskUI.createCategoryName": ["创建分类「{{name}}」", "Create category “{{name}}”"],
"taskUI.assetCount": ["{{count}} 个资产", "{{count}} assets"],
"taskUI.confirmDeleteCategory": ["删除分类「{{name}}」?", "Delete category “{{name}}”?"],
"taskUI.deleteCategoryDetails": [
"分类删除后,其中 {{count}} 个任务会自动移入“未分类”,任务数据不会被删除。",
"{{count}} tasks will move to Uncategorized. Their data will be retained.",
],
"taskUI.sourceHelp": [
"最多关联 {{count}} 个任务。实时只读继承所选任务的持久化黑板、资产范围及相关流量;新任务写入独立黑板。",
"Link up to {{count}} tasks for live read-only access to their persisted blackboards, asset scopes and related traffic. The new task writes to its own blackboard.",
],
"taskUI.findingCounts": ["· {{count}} 漏洞 / {{reports}} 上报", "· {{count}} findings / {{reports}} reports"],
"taskUI.templateRequired": ["请填写模板名称、描述和目标", "Enter a template name, description and goal"],
"taskUI.templateCreated": ["模板已创建", "Template created"],
"taskUI.templateUpdated": ["模板已更新", "Template updated"],
"taskUI.templateDeleted": ["模板已删除", "Template deleted"],
"taskUI.createTemplate": ["创建模板", "Create template"],
"taskUI.templateManagement": ["任务模板管理", "Manage task templates"],
"taskUI.templateManagementHelp": [
"模板保存描述、目标、备注、Worker 数量、分类与任务级拦截/允许规则;修改不会影响已经创建的任务。",
"Templates save descriptions, goals, notes, Worker counts, categories and task block/allow rules. Editing a template does not affect existing tasks.",
],
"taskUI.newTemplate": ["新建模板", "New template"],
"taskUI.noTemplates": ["暂无模板", "No templates yet"],
"taskUI.templateName": ["模板名称", "Template name"],
"taskUI.templateExample": ["例如:外部 Web 渗透", "For example: External web assessment"],
"taskUI.targetContext": ["测试对象与背景", "Test target and context"],
"taskUI.goalPlaceholder": ["任务需要达成的目标", "The goal this task should achieve"],
"taskUI.templateNotesPlaceholder": [
"预设备注,应用模板时写入新任务",
"Notes to copy into new tasks when applying this template",
],
"taskUI.templateWorkersHelp": [
"应用模板时预填本任务 Worker 数;留空或 0 = 用全局默认。",
"Prefill the Worker count when applying this template. Leave empty or enter 0 to use the global default.",
],
"taskUI.templateCategoryHelp": [
"应用模板时预填此分类(可再改)。",
"Prefill this category when applying the template. You can change it afterward.",
],
"taskUI.templateRules": ["任务级拦截 / 允许规则", "Task block / allow rules"],
"taskUI.templateRulesHelp": [
"应用模板时预填这些任务级规则(拦截/允许,仅对新任务生效,不进全局)。",
"Copy these task block/allow rules into new tasks when applying this template. They do not affect global rules.",
],
"taskUI.deleteTemplate": ["删除模板", "Delete template"],
"taskUI.untitledTemplate": ["未命名模板", "Untitled template"],
"taskUI.deleteTemplateHelp": [
"已由该模板创建的任务不会受到影响。",
"Tasks already created from this template are unaffected.",
],
"taskUI.loadingTemplates": ["正在加载模板", "Loading templates"],
"taskUI.noTaskTemplates": ["暂无任务模板", "No task templates yet"],
"taskUI.searchTemplates": ["搜索并选择任务模板", "Search and select a task template"],
"taskUI.taskTemplates": ["任务模板", "Task templates"],
"taskUI.manageTemplates": ["管理模板", "Manage templates"],
"taskUI.saveAsTemplate": ["另存为模板", "Save as template"],
"taskUI.noMatchingTemplates": ["没有匹配的模板", "No matching templates"],
"taskUI.applyTemplateHelp": [
"选择后会复制模板的描述、目标、备注、Worker 数量、分类与任务级规则,不与模板保持关联。",
"Copy the template’s description, goal, notes, Worker count, category and task rules. The new task stays independent of the template.",
],
"taskUI.overwriteTemplateHelp": [
"当前已填写的描述、目标、备注和 Worker 数量将被模板内容覆盖。",
"The template replaces the current description, goal, notes and Worker count.",
],
"taskUI.overwrite": ["覆盖并使用", "Replace and apply"],
"taskUI.profileCurrent": ["当前", "Current"],
"taskUI.profileSkippedHelp": [
"当前游标之前的配置不会被自动故障转移选中",
"Automatic failover skips configurations before the current one",
],
"taskUI.profileSkipped": ["已跳过", "Skipped"],
"taskUI.profileSearch": ["搜索并添加 LLM 配置", "Search and add LLM configurations"],
"taskUI.profileNone": ["暂无可用 LLM 配置", "No LLM configurations available"],
"taskUI.profileNoMatches": ["没有匹配的 LLM 配置", "No matching LLM configurations"],
"taskUI.profileActive": ["(激活)", " (active)"],
"taskUI.profileDefaultHelp": [
"未指定配置时,任务跟随 Agent 或全局激活配置。",
"Without a selected configuration, this task follows the Agent or globally active configuration.",
],
"taskUI.profileUnavailable": ["配置已不可用", "Configuration unavailable"],
"taskUI.profileUp": ["上移配置", "Move configuration up"],
"taskUI.profileDown": ["下移配置", "Move configuration down"],
"taskUI.profileRemove": ["移除配置", "Remove configuration"],
"taskUI.currentProfile": ["当前配置", "Current configuration"],
"taskUI.templateRemark": ["备注:{{remark}}", "Notes: {{remark}}"],
"taskUI.confirmDeleteTemplate": ["删除模板「{{name}}」?", "Delete template “{{name}}”?"],
"taskUI.confirmApplyTemplate": ["使用模板「{{name}}」?", "Apply template “{{name}}”?"],
"taskUI.loadTemplatesFailed": ["加载模板失败:{{message}}", "Could not load templates: {{message}}"],
"taskUI.profileId": ["配置 #{{id}}", "Configuration #{{id}}"],
"taskUI.profileBackup": ["备用 {{index}}", "Backup {{index}}"],
"taskUI.assetRule.block": ["拦截", "Block"],
"taskUI.assetRule.allow": ["允许", "Allow"],
"taskUI.assetRule.noteOptional": ["备注(可选)", "Notes (optional)"],
"taskUI.assetRule.add": ["添加一条", "Add rule"],
"taskUI.assetRule.remove": ["删除规则", "Remove rule"],
"taskUI.assetRule.action": ["规则操作", "Rule action"],
"taskUI.assetRule.kind": ["匹配类型", "Match type"],
"taskUI.assetRule.pattern": ["匹配内容", "Match value"],
"taskUI.assetRule.exact_domain": ["域名(全等)", "Domain (exact)"],
"taskUI.assetRule.exact_ip": ["IP(全等)", "IP (exact)"],
"taskUI.assetRule.exact_url": ["URL(全等)", "URL (exact)"],
"taskUI.assetRule.fuzzy_domain": ["域名(模糊)", "Domain (partial)"],
"taskUI.assetRule.fuzzy_ip": ["IP(模糊)", "IP (partial)"],
"taskUI.assetRule.fuzzy_url": ["URL(模糊)", "URL (partial)"],
"taskUI.assetRule.cidr": ["CIDR 网段", "CIDR range"],
"taskUI.deletedAssets_one": ["删除资产 {{count}} 条", "Deleted {{count}} asset"],
"taskUI.deletedAssets_other": ["删除资产 {{count}} 条", "Deleted {{count}} assets"],
"taskUI.detachedAssets_one": ["解除共享资产关联 {{count}} 条", "Unlinked {{count}} shared asset"],
"taskUI.detachedAssets_other": ["解除共享资产关联 {{count}} 条", "Unlinked {{count}} shared assets"],
"taskUI.deletedTraffic_one": ["删除流量 {{count}} 条", "Deleted {{count}} traffic record"],
"taskUI.deletedTraffic_other": ["删除流量 {{count}} 条", "Deleted {{count}} traffic records"],
"taskUI.deletedFindings_one": ["删除漏洞 {{count}} 条", "Deleted {{count}} finding"],
"taskUI.deletedFindings_other": ["删除漏洞 {{count}} 条", "Deleted {{count}} findings"],
"taskUI.deletedLLM_one": ["删除 LLM 请求/响应记录 {{count}} 条", "Deleted {{count}} LLM request/response record"],
"taskUI.deletedLLM_other": ["删除 LLM 请求/响应记录 {{count}} 条", "Deleted {{count}} LLM request/response records"],
"taskUI.deletedTasks_one": ["已删除 {{count}} 个任务", "Deleted {{count}} task"],
"taskUI.deletedTasks_other": ["已删除 {{count}} 个任务", "Deleted {{count}} tasks"],
"taskUI.deleteFailures_one": [
"{{count}} 个任务删除失败:{{details}}{{more}}",
"Could not delete {{count}} task: {{details}}{{more}}",
],
"taskUI.deleteFailures_other": [
"{{count}} 个任务删除失败:{{details}}{{more}}",
"Could not delete {{count}} tasks: {{details}}{{more}}",
],
"taskUI.tasksArchiveQueued_one": ["已将 {{count}} 个任务加入归档队列", "Queued {{count}} task for archiving"],
"taskUI.tasksArchiveQueued_other": ["已将 {{count}} 个任务加入归档队列", "Queued {{count}} tasks for archiving"],
"taskUI.archiveFailures_one": [
"{{count}} 个任务无法归档:{{details}}",
"Could not archive {{count}} task: {{details}}",
],
"taskUI.archiveFailures_other": [
"{{count}} 个任务无法归档:{{details}}",
"Could not archive {{count}} tasks: {{details}}",
],
"taskUI.tasksPaused_one": ["已暂停 {{count}} 个任务", "Paused {{count}} task"],
"taskUI.tasksPaused_other": ["已暂停 {{count}} 个任务", "Paused {{count}} tasks"],
"taskUI.tasksResumed_one": ["已继续 {{count}} 个任务{{queue}}", "Resumed {{count}} task{{queue}}"],
"taskUI.tasksResumed_other": ["已继续 {{count}} 个任务{{queue}}", "Resumed {{count}} tasks{{queue}}"],
"taskUI.controlFailures_one": [
"{{count}} 个任务操作失败:{{details}}{{more}}",
"Could not update {{count}} task: {{details}}{{more}}",
],
"taskUI.controlFailures_other": [
"{{count}} 个任务操作失败:{{details}}{{more}}",
"Could not update {{count}} tasks: {{details}}{{more}}",
],
"taskUI.tasksMoved_one": ["已将 {{count}} 个任务移动到「{{category}}」", "Moved {{count}} task to “{{category}}”"],
"taskUI.tasksMoved_other": ["已将 {{count}} 个任务移动到「{{category}}」", "Moved {{count}} tasks to “{{category}}”"],
"taskUI.moveFailures_one": [
"{{count}} 个任务未能移动:{{details}}{{more}}",
"Could not move {{count}} task: {{details}}{{more}}",
],
"taskUI.moveFailures_other": [
"{{count}} 个任务未能移动:{{details}}{{more}}",
"Could not move {{count}} tasks: {{details}}{{more}}",
],
"taskUI.concurrencyEnabled_one": [
"已开启并发限制:最多同时运行 {{count}} 个任务",
"Concurrency limit enabled: up to {{count}} task at once",
],
"taskUI.concurrencyEnabled_other": [
"已开启并发限制:最多同时运行 {{count}} 个任务",
"Concurrency limit enabled: up to {{count}} tasks at once",
],
"taskUI.unassessed_one": [" · 待评估 {{count}}", " · Pending assessment: {{count}}"],
"taskUI.unassessed_other": [" · 待评估 {{count}}", " · Pending assessment: {{count}}"],
"taskUI.archiveTasks_one": ["归档 {{count}} 个任务", "Archive {{count}} task"],
"taskUI.archiveTasks_other": ["归档 {{count}} 个任务", "Archive {{count}} tasks"],
"taskUI.tasksRestoreQueued_one": ["已将 {{count}} 个任务加入还原队列", "Queued {{count}} task for restoration"],
"taskUI.tasksRestoreQueued_other": ["已将 {{count}} 个任务加入还原队列", "Queued {{count}} tasks for restoration"],
"taskUI.restoreFailures_one": ["{{count}} 个任务无法还原", "Could not restore {{count}} task"],
"taskUI.restoreFailures_other": ["{{count}} 个任务无法还原", "Could not restore {{count}} tasks"],
"taskUI.archivesDeleteQueued_one": [
"已将 {{count}} 个归档加入永久删除队列",
"Queued {{count}} archive for permanent deletion",
],
"taskUI.archivesDeleteQueued_other": [
"已将 {{count}} 个归档加入永久删除队列",
"Queued {{count}} archives for permanent deletion",
],
"taskUI.archiveDeleteFailures_one": ["{{count}} 个归档无法删除", "Could not delete {{count}} archive"],
"taskUI.archiveDeleteFailures_other": ["{{count}} 个归档无法删除", "Could not delete {{count}} archives"],
"taskUI.deleteTasks_one": ["删除 {{count}} 个任务", "Delete {{count}} task"],
"taskUI.deleteTasks_other": ["删除 {{count}} 个任务", "Delete {{count}} tasks"],
"taskUI.sourceLimit_one": ["最多关联 {{count}} 个任务", "Link up to {{count}} task"],
"taskUI.sourceLimit_other": ["最多关联 {{count}} 个任务", "Link up to {{count}} tasks"],
"taskUI.scopeMore_one": [" · 另 {{count}} 条", " · {{count}} more"],
"taskUI.scopeMore_other": [" · 另 {{count}} 条", " · {{count}} more"],
"taskUI.taskCount_one": ["{{count}} 个任务", "{{count}} task"],
"taskUI.taskCount_other": ["{{count}} 个任务", "{{count}} tasks"],
"taskUI.categoryUsed_one": [
"当前有 {{count}} 个任务使用该分类。重命名后会同步更新任务列表。",
"{{count}} task uses this category. Renaming updates the task list.",
],
"taskUI.categoryUsed_other": [
"当前有 {{count}} 个任务使用该分类。重命名后会同步更新任务列表。",
"{{count}} tasks use this category. Renaming updates the task list.",
],
"taskUI.categoryContains_one": ["该分类包含 {{count}} 个任务。", "This category contains {{count}} task."],
"taskUI.categoryContains_other": ["该分类包含 {{count}} 个任务。", "This category contains {{count}} tasks."],
"taskUI.uncategorizedCount_one": ["当前有 {{count}} 个任务尚未分类。", "{{count}} task is uncategorized."],
"taskUI.uncategorizedCount_other": ["当前有 {{count}} 个任务尚未分类。", "{{count}} tasks are uncategorized."],
"taskUI.sourceTaskLimit_one": ["最多关联 {{count}} 个来源任务", "Link up to {{count}} source task"],
"taskUI.sourceTaskLimit_other": ["最多关联 {{count}} 个来源任务", "Link up to {{count}} source tasks"],
"taskUI.uploaded_one": [
"已上传 {{count}} 个文件,绝对路径已追加到描述末尾(可编辑)",
"Uploaded {{count}} file. Absolute paths are appended to the description and can be edited.",
],
"taskUI.uploaded_other": [
"已上传 {{count}} 个文件,绝对路径已追加到描述末尾(可编辑)",
"Uploaded {{count}} files. Absolute paths are appended to the description and can be edited.",
],
"taskUI.selectedCount_one": ["已选 {{count}} 个", "{{count}} selected"],
"taskUI.selectedCount_other": ["已选 {{count}} 个", "{{count}} selected"],
"taskUI.archiveCount_one": ["{{count}} 个归档", "{{count}} archive"],
"taskUI.archiveCount_other": ["{{count}} 个归档", "{{count}} archives"],
"taskUI.confirmDeleteArchives_one": ["永久删除 {{count}} 个任务归档?", "Permanently delete {{count}} task archive?"],
"taskUI.confirmDeleteArchives_other": [
"永久删除 {{count}} 个任务归档?",
"Permanently delete {{count}} task archives?",
],
"taskUI.moveCategoryTitle_one": ["修改所选 {{count}} 个任务的分类", "Change category for {{count}} selected task"],
"taskUI.moveCategoryTitle_other": ["修改所选 {{count}} 个任务的分类", "Change category for {{count}} selected tasks"],
"taskUI.deleteSelectedCount_one": ["删除所选 {{count}}", "Delete selected ({{count}})"],
"taskUI.deleteSelectedCount_other": ["删除所选 {{count}}", "Delete selected ({{count}})"],
"taskUI.confirmDeleteSelected_one": ["确认删除所选 {{count}} 个任务?", "Delete {{count}} selected task?"],
"taskUI.confirmDeleteSelected_other": ["确认删除所选 {{count}} 个任务?", "Delete {{count}} selected tasks?"],
"taskUI.moreSelected_one": ["…等 {{count}} 个", "… {{count}} selected in total"],
"taskUI.moreSelected_other": ["…等 {{count}} 个", "… {{count}} selected in total"],
"taskUI.assetCount_one": ["{{count}} 个资产", "{{count}} asset"],
"taskUI.assetCount_other": ["{{count}} 个资产", "{{count}} assets"],
"taskUI.deleteCategoryDetails_one": [
"分类删除后,其中 {{count}} 个任务会自动移入“未分类”,任务数据不会被删除。",
"{{count}} task will move to Uncategorized. Their data will be retained.",
],
"taskUI.deleteCategoryDetails_other": [
"分类删除后,其中 {{count}} 个任务会自动移入“未分类”,任务数据不会被删除。",
"{{count}} tasks will move to Uncategorized. Their data will be retained.",
],
"taskUI.sourceHelp_one": [
"最多关联 {{count}} 个任务。实时只读继承所选任务的持久化黑板、资产范围及相关流量;新任务写入独立黑板。",
"Link up to {{count}} task for live read-only access to their persisted blackboards, asset scopes and related traffic. The new task writes to its own blackboard.",
],
"taskUI.sourceHelp_other": [
"最多关联 {{count}} 个任务。实时只读继承所选任务的持久化黑板、资产范围及相关流量;新任务写入独立黑板。",
"Link up to {{count}} tasks for live read-only access to their persisted blackboards, asset scopes and related traffic. The new task writes to its own blackboard.",
],
"taskUI.findingCounts_one": ["· {{count}} 漏洞 / {{reports}} 上报", "· {{count}} finding / {{reports}} reports"],
"taskUI.findingCounts_other": ["· {{count}} 漏洞 / {{reports}} 上报", "· {{count}} findings / {{reports}} reports"],
"taskUI.runtime.requestTooLarge": ["请求正文过大", "Request body is too large"],
"taskUI.runtime.nameRequired": ["任务名称不能为空", "Task name is required"],
"taskUI.runtime.deleting": ["任务正在删除,无法控制", "This task is being deleted and cannot be controlled"],
"taskUI.runtime.terminalPause": ["终态任务不能执行暂停", "Finished tasks cannot be paused"],
"taskUI.runtime.alreadyPaused": ["任务已经暂停", "Task is already paused"],
"taskUI.runtime.workerNegative": ["Worker 运行数量不能为负数", "Worker count cannot be negative"],
"taskUI.runtime.templateExists": ["模板名称已存在", "A template with this name already exists"],
"taskUI.runtime.archiveBusy": [
"任务正在进行其他归档或删除操作",
"This task already has an archive or delete operation in progress",
],
"taskUI.runtime.agentsRunning": [
"任务仍有运行中的 Agent,请先暂停后重试归档",
"This task still has active Agents. Pause it before trying to archive again.",
],
"taskUI.runtime.snapshotChanged": [
"任务探索记录在归档快照期间发生变化",
"Task exploration history changed while the archive snapshot was being created",
],
"taskUI.runtime.emptyArchivePath": ["归档包路径为空", "Archive package path is empty"],
"taskUI.runtime.archivePathOutside": [
"归档包路径不在受管目录内",
"Archive package path is outside the managed directory",
],
"taskUI.runtime.invalidArchiveId": ["归档 id 无效", "Invalid archive ID"],
"taskUI.runtime.archiveNotFound": ["归档不存在", "Archive not found"],
"taskUI.runtime.invalidTaskId": ["任务 id 无效", "Invalid task ID"],
"taskUI.runtime.taskIdsRequired": ["task_ids 不能为空", "Task IDs are required"],
"taskUI.runtime.taskBatchLimit": ["一次最多处理 100 个任务", "Process up to 100 tasks at a time"],
"taskUI.runtime.archiveIdsRequired": ["archive_ids 不能为空", "Archive IDs are required"],
"taskUI.runtime.archiveBatchLimit": ["一次最多处理 100 个归档", "Process up to 100 archives at a time"],
"taskUI.runtime.categoryRequired": ["分类名称不能为空", "Category name is required"],
"taskUI.runtime.categoryLimit": ["分类名称最多 80 个字符", "Category name must be 80 characters or fewer"],
"taskUI.runtime.categoryExists": ["分类名称已存在", "A category with this name already exists"],
"taskUI.runtime.invalidCategoryId": ["任务分类 id 无效", "Invalid task category ID"],
"taskUI.runtime.invalidRuleAction": ["action 必须是 block 或 allow", "Rule action must be block or allow"],
"taskUI.runtime.nameLimit": ["任务名称最多 {{limit}} 个字符", "Task name must be {{limit}} characters or fewer"],
"taskUI.runtime.remarkLimit": ["备注最多 {{limit}} 个字符", "Notes must be {{limit}} characters or fewer"],
"taskUI.runtime.workerLimit": ["Worker 运行数量最多 {{limit}}", "Worker count must be {{limit}} or fewer"],
"taskUI.runtime.taskIdCount": ["task_ids 数量必须为 1-{{limit}}", "Select between 1 and {{limit}} task IDs"],
"taskUI.phase.queued": ["等待处理", "Queued"],
"taskUI.phase.starting": ["开始处理", "Starting"],
"taskUI.phase.interrupted": ["处理中断", "Interrupted"],
"taskUI.phase.stage_files": ["暂存文件", "Staging files"],
"taskUI.phase.snapshot_database": ["创建数据库快照", "Creating database snapshot"],
"taskUI.phase.snapshot_traffic": ["创建流量快照", "Creating traffic snapshot"],
"taskUI.phase.compress": ["压缩", "Compressing"],
"taskUI.phase.compact_traffic": ["清理流量热存储", "Cleaning up traffic storage"],
"taskUI.phase.compact_database": ["清理数据库热存储", "Cleaning up database storage"],
"taskUI.phase.verify_package": ["验证归档包", "Verifying archive package"],
"taskUI.phase.restore_traffic": ["还原流量", "Restoring traffic"],
"taskUI.phase.restore_files": ["还原文件", "Restoring files"],
"taskUI.phase.restore_database": ["还原数据库", "Restoring database"],
"taskUI.phase.database_restored": ["数据库已还原", "Database restored"],
"taskUI.phase.consume_package": ["清理已还原归档包", "Cleaning up restored package"],
"taskUI.phase.stage_package_delete": ["暂存待删除归档包", "Staging package for deletion"],
"taskUI.phase.delete_metadata": ["删除归档元数据", "Deleting archive metadata"],
"taskUI.phase.ready": ["可还原", "Ready to restore"],
"taskUI.phase.failed": ["失败", "Failed"],
} as const;
+46
View File
@@ -0,0 +1,46 @@
import type { TFunction } from "i18next";
import { localizedError } from "./errors";
import { scheduleRuntimeText } from "./schedule-runtime";
const messages: Record<string, string> = {
请求正文过大: "taskUI.runtime.requestTooLarge",
任务名称不能为空: "taskUI.runtime.nameRequired",
"任务正在删除,无法控制": "taskUI.runtime.deleting",
终态任务不能执行暂停: "taskUI.runtime.terminalPause",
任务已经暂停: "taskUI.runtime.alreadyPaused",
"Worker 运行数量不能为负数": "taskUI.runtime.workerNegative",
模板名称已存在: "taskUI.runtime.templateExists",
任务正在进行其他归档或删除操作: "taskUI.runtime.archiveBusy",
"任务仍有运行中的 Agent,请先暂停后重试归档": "taskUI.runtime.agentsRunning",
任务探索记录在归档快照期间发生变化: "taskUI.runtime.snapshotChanged",
归档包路径为空: "taskUI.runtime.emptyArchivePath",
归档包路径不在受管目录内: "taskUI.runtime.archivePathOutside",
"归档 id 无效": "taskUI.runtime.invalidArchiveId",
归档不存在: "taskUI.runtime.archiveNotFound",
"任务 id 无效": "taskUI.runtime.invalidTaskId",
"task_ids 不能为空": "taskUI.runtime.taskIdsRequired",
"一次最多处理 100 个任务": "taskUI.runtime.taskBatchLimit",
"archive_ids 不能为空": "taskUI.runtime.archiveIdsRequired",
"一次最多处理 100 个归档": "taskUI.runtime.archiveBatchLimit",
分类名称不能为空: "taskUI.runtime.categoryRequired",
"分类名称最多 80 个字符": "taskUI.runtime.categoryLimit",
分类名称已存在: "taskUI.runtime.categoryExists",
"任务分类 id 无效": "taskUI.runtime.invalidCategoryId",
"action 必须是 block 或 allow": "taskUI.runtime.invalidRuleAction",
};
const patterns: [RegExp, string][] = [
[/^任务名称最多 (\d+) 个字符$/, "taskUI.runtime.nameLimit"],
[/^备注最多 (\d+) 个字符$/, "taskUI.runtime.remarkLimit"],
[/^Worker 运行数量最多 (\d+)$/, "taskUI.runtime.workerLimit"],
[/^task_ids 数量必须为 1-(\d+)$/, "taskUI.runtime.taskIdCount"],
];
export function taskError(error: unknown, translate: TFunction): string {
const value = scheduleRuntimeText(localizedError(error, translate), translate);
if (messages[value]) return translate(messages[value]);
for (const [pattern, key] of patterns) {
const match = pattern.exec(value);
if (match) return translate(key, { limit: match[1] });
}
return value;
}
+79
View File
@@ -0,0 +1,79 @@
// Translations of the existing terms; the original scope and restrictions are preserved.
export const termsMessages = {
"terms.title": ["ARTEX 使用须知与免责声明", "ARTEX Terms of Use and Disclaimer"],
"terms.version": [
"版本 v1.0 · 生效日期 2026-09-18 · 请在登录前完整阅读以下全部条款",
"Version v1.0 · Effective September 18, 2026 · Read all terms before signing in",
],
"terms.introduction": [
'本《使用须知与免责声明》(以下简称"本声明")是您与 ARTEX 项目作者及贡献者之间就使用本软件所达成的约定。请您在使用前审慎阅读、充分理解各条款内容,特别是以粗体或色块标注的免责、责任限制及禁止性条款。',
'These Terms of Use and Disclaimer (the "Statement") constitute an agreement between you and the ARTEX authors and contributors regarding your use of this software. Read and understand all provisions carefully, especially the disclaimers, limitations of liability and restrictions highlighted in bold or colored blocks.',
],
"terms.acceptance": [
"一旦您下载、安装、访问或以任何方式使用本软件,即视为您已阅读、理解并同意接受本声明的全部约束。",
"By downloading, installing, accessing or using this software in any manner, you acknowledge that you have read, understood and agreed to be bound by this Statement in its entirety.",
],
"terms.licenseTitle": ["第一条 · 定义与开源许可", "Article 1 · Definitions and open-source license"],
"terms.license": [
"本软件(ARTEX)是一款基于 GNU Affero General Public License v3.0(AGPL-3.0)发布的开源程序。您可依据该协议自由使用、复制、修改和分发本软件;但任何衍生作品(包括通过网络向第三方提供的在线服务)均须同样以 AGPL-3.0 协议开源并向使用者公开对应的完整源代码。AGPL-3.0 完整条款以随附的 LICENSE 文件为准。",
"ARTEX is open-source software released under the GNU Affero General Public License v3.0 (AGPL-3.0). You may use, copy, modify and distribute it under that license. Any derivative work, including an online service provided to third parties over a network, must also be released under AGPL-3.0 with its complete corresponding source code made available to users. The accompanying LICENSE file contains the full AGPL-3.0 terms.",
],
"terms.scopeTitle": ["第二条 · 授权使用范围", "Article 2 · Permitted use"],
"terms.scope": [
"本软件仅供个人学习、代码研究、安全技术原理探讨,以及在您自行搭建的本地隔离环境中进行技术验证之用,适用于学习、学术研究、代码审阅等非攻击性、非破坏性用途。除本条明确许可的情形外,您不得将本软件用于任何其他目的。",
"This software is solely for personal learning, code research, discussion of security principles and technical verification in a local, isolated environment that you set up yourself. Permitted purposes include learning, academic research and code review that are neither offensive nor destructive. You must not use this software for any purpose other than those expressly permitted by this article.",
],
"terms.prohibitedTitle": ["第三条 · 禁止行为", "Article 3 · Prohibited conduct"],
"terms.noNetworkAttacks": [
"严禁对任何网站、线上服务、他人或第三方所有的联网系统发起扫描、探测、利用或攻击(无论是否已获得授权、是否为您自有资产);",
"Scanning, probing, exploiting or attacking any website, online service or networked system belonging to others or third parties is strictly prohibited, regardless of authorization or whether the assets are your own;",
],
"terms.noRealPentesting": [
"严禁将本软件用于任何实际的渗透测试、攻防对抗、红蓝演练或生产环境;",
"Using this software for actual penetration testing, adversarial security exercises, red-team or blue-team exercises, or production environments is strictly prohibited;",
],
"terms.noCrime": [
"严禁将本软件用于非法入侵、数据窃取、勒索、拒绝服务(DoS/DDoS)或任何破坏性、犯罪性活动;",
"Using this software for unauthorized access, data theft, extortion, denial of service (DoS/DDoS), or any destructive or criminal activity is strictly prohibited;",
],
"terms.noTampering": [
"严禁移除、篡改或规避本软件及其输出中的任何版权、许可或安全提示信息;",
"Removing, altering or circumventing any copyright, license or security notice in this software or its output is strictly prohibited;",
],
"terms.noIllegalUse": [
"严禁从事任何违反您所在国家或地区法律、法规及监管规定的行为。",
"Any conduct that violates applicable laws, regulations or regulatory requirements in your country or region is strictly prohibited.",
],
"terms.ipTitle": ["第四条 · 知识产权", "Article 4 · Intellectual property"],
"terms.ip": [
"本软件的著作权及相关知识产权归项目作者及贡献者所有,并在 AGPL-3.0 协议约定的范围内向您授予相应权利。除该协议明确授予的权利外,本声明未以明示或默示方式授予您任何其他权利。",
"Copyright and related intellectual property rights in this software belong to the project authors and contributors. You receive the rights granted under AGPL-3.0. Except for rights expressly granted by that license, this Statement grants you no other rights, whether expressly or by implication.",
],
"terms.privacyTitle": ["第五条 · 数据与隐私", "Article 5 · Data and privacy"],
"terms.privacy": [
"本软件为可自行部署的开源程序,作者不运营任何集中式服务、亦不会收集或上传您的使用数据。您在使用过程中产生、处理或接触的一切数据,均由您自行掌控并负责其合法性与安全性;因数据处理不当引发的任何后果由您自行承担。",
"This software is self-hostable and open source. Its authors do not operate a centralized service and do not collect or upload your usage data. You control and are responsible for the legality and security of all data you generate, process or access while using the software. You bear all consequences arising from improper data processing.",
],
"terms.complianceTitle": ["第六条 · 合规与法律责任", "Article 6 · Compliance and legal responsibility"],
"terms.compliance": [
"您应自行遵守所在国家或地区关于网络安全、数据安全与个人信息保护、计算机犯罪等方面的全部法律法规(在中国大陆包括但不限于《网络安全法》《数据安全法》《个人信息保护法》及相关司法解释)。",
"You are responsible for complying with all applicable laws and regulations in your country or region concerning cybersecurity, data security, personal information protection and computer crime. In mainland China, these include, without limitation, the Cybersecurity Law, Data Security Law, Personal Information Protection Law and related judicial interpretations.",
],
"terms.responsibility": [
"因您违反上述法律法规或本声明约定而产生的一切法律责任与后果,均由您本人独立承担,与本软件作者及贡献者无关。",
"You alone bear all legal liability and consequences resulting from your violation of those laws, regulations or this Statement. The software authors and contributors bear no responsibility for such violations.",
],
"terms.disclaimerTitle": ["第七条 · 免责声明与责任限制", "Article 7 · Disclaimer and limitation of liability"],
"terms.disclaimer": [
'本软件按"现状(AS IS)"与"现有(AS AVAILABLE)"状态提供,不附带任何明示或默示的担保,包括但不限于对适销性、特定用途适用性、准确性及不侵权的担保。在适用法律允许的最大范围内,本软件作者及贡献者不对因使用或无法使用本软件(无论使用方式是否得当)而导致的任何直接、间接、偶然、特殊或后果性损失承担责任,包括但不限于数据丢失、系统损坏、业务中断、利润损失或法律纠纷。',
'This software is provided "AS IS" and "AS AVAILABLE", without any express or implied warranty, including warranties of merchantability, fitness for a particular purpose, accuracy or non-infringement. To the maximum extent permitted by applicable law, the authors and contributors shall not be liable for any direct, indirect, incidental, special or consequential loss arising from the use of or inability to use this software, whether used properly or otherwise, including data loss, system damage, business interruption, lost profits or legal disputes.',
],
"terms.changesTitle": ["第八条 · 条款变更与最终解释", "Article 8 · Changes and interpretation"],
"terms.changes": [
"作者有权根据法律法规或项目发展需要不时更新本声明,更新后的版本将随项目发布并自公布之日起生效;您继续使用本软件即视为接受修订后的条款。在法律允许的范围内,本声明的最终解释权归项目作者所有。若本声明任一条款被认定为无效,不影响其余条款的效力。",
"The authors may update this Statement from time to time to reflect legal requirements or project development. Updated versions will be distributed with the project and take effect upon publication. Continued use constitutes acceptance of the revised terms. To the extent permitted by law, the project authors reserve the final right to interpret this Statement. If any provision is held invalid, the remaining provisions remain effective.",
],
"terms.readAll": ["您已浏览全部条款", "You have viewed all terms"],
"terms.scrollToEnd": ["请将条款滚动至底部后再确认", "Scroll to the bottom before confirming"],
"terms.agreeAll": ["我已阅读并同意全部条款", "I have read and accept all terms"],
} satisfies Record<string, readonly [string, string]>;
+17
View File
@@ -0,0 +1,17 @@
"use client";
import { enUS } from "date-fns/locale/en-US";
import { zhCN } from "date-fns/locale/zh-CN";
import { useTranslation } from "react-i18next";
import { resolveLocale } from "./config";
export function useDateLocale() {
const { i18n } = useTranslation();
const locale = resolveLocale(i18n.resolvedLanguage);
return {
locale,
dateLocale: locale === "en" ? enUS : zhCN,
datePattern: locale === "en" ? "MMM d, yyyy" : "yyyy年M月d日",
};
}
+15
View File
@@ -0,0 +1,15 @@
"use client";
import { useMemo } from "react";
import { useTranslation } from "react-i18next";
// Keep react-i18next's reactive t for rendering (including React Compiler caches).
// Lifecycle callbacks can use liveT without refetching editable settings on a
// language change; it reads the current language when each callback runs.
export function useLiveTranslation() {
const translation = useTranslation();
const { i18n } = translation;
const liveT = useMemo(() => i18n.t.bind(i18n), [i18n]);
return { ...translation, liveT };
}
+15
View File
@@ -0,0 +1,15 @@
"use client";
import { useCallback } from "react";
import { useLiveTranslation } from "./use-live-translation";
export type UITranslate = (key: string, values?: Record<string, unknown>) => string;
// ui follows the render locale; liveUI stays stable for polling and event callbacks.
export function useUITranslation() {
const { t, liveT, i18n } = useLiveTranslation();
const ui: UITranslate = useCallback((key, values) => String(t(key, values ?? {})), [t]);
const liveUI: UITranslate = useCallback((key, values) => String(liveT(key, values ?? {})), [liveT]);
return { ui, liveUI, i18n };
}