feat(i18n): M119 追加 6 条 AI 助手错误/确认文案,并订正两条已成假话的译文

接线(M119)之后右栏才第一次有「失败态」与「写操作确认」这两块真 UI,而 catalog 里
一条对应的 key 都没有——任务书要求「失败必须显示**具名**错误」,没有键就只能硬编码,
和 M106 立的「界面文案一律走 catalog + lang」直接冲突。所以这批条目是修不成就做不成。

新增(按金表规矩追加在 `agent_entries` 族尾、`golden.rs` 同序追加):

| key | 用途 |
|---|---|
| `AgentErrorTitle` | 失败横幅标题 |
| `AgentErrorUnavailable` | AI 端点不可达(原因码 `unreachable`) |
| `AgentErrorNotImplemented` | 该路由还没接线(原因码 `not_implemented`) |
| `AgentConfirmRequest` | 确认条的句子(`{summary}` = presenter 已脱敏的请求摘要) |
| `AgentConfirmAllow` / `AgentConfirmDeny` | 确认条两个按钮 |

订正两条**已成假话**的译文(接线前它们陈述「后端未接」):

- `AgentSubtitle`:`Conversation shell · no backend yet` → `Conversation`
- `AgentEmptyBody`:去掉 `No model is wired up yet.` 一句

真接的是什么由端点标签与失败横幅说,不在标题下重复。`golden.rs` 现在 399 行(+6 行后仍 ≤400)。
This commit is contained in:
AskaEth committed 2026-11-05 08:02:49 +08:00
1 parent 3c61a2397e
commit 6505493d4e
2 files changed
+23 -4

No files matched your search

+15 -2
View File
@@ -14,7 +14,9 @@ macro_rules! agent_entries {
$($acc)*
// ── AI 助手(右栗 + 独立页共用)
AgentTitle => ("Assistant", "助手"),
AgentSubtitle => ("Conversation shell · no backend yet", "会话外壳 · 后端未接"),
// M119:接线之前这条写的是「后端未接」。真接进 presenter 之后那句话成了假话,
// 改成中性的「会话」;「跑的是什么后端」由端点标签与错误横幅说,不在标题下重复。
AgentSubtitle => ("Conversation", "会话"),
AgentCollapse => ("Collapse", "收起"),
AgentDetach => ("Pop out", "拆出"),
AgentDock => ("Dock back", "收回"),
@@ -24,7 +26,8 @@ macro_rules! agent_entries {
AgentStop => ("Stop", "中断"),
AgentPlaceholder => ("Message the assistant…", "给助手发消息…"),
AgentEmptyTitle => ("Nothing in this session yet", "这个会话还没有内容"),
AgentEmptyBody => ("Ask about instances, downloads or logs. No model is wired up yet.", "可以问实例、下载或日志。模型还没接上。"),
// M119:同上——「模型还没接上」这句在接线后是假话。真接的是什么由端点标签说。
AgentEmptyBody => ("Ask about instances, downloads or logs.", "可以问实例、下载或日志。"),
AgentNotePending => ("Placeholder shell: your message is kept here, nothing was sent to a model.", "占位外壳:消息留在这里,没有发给任何模型。"),
AgentNoteStopped => ("Stopped by you.", "你中断了这次回复。"),
AgentUnread => ("{count} unread", "{count} 条未读"),
@@ -33,6 +36,16 @@ macro_rules! agent_entries {
AgentRoleYou => ("You", "你"),
AgentRoleAssistant => ("Assistant", "助手"),
AgentRoleNotice => ("Notice", "提示"),
// ── M119:失败态与写操作确认(接线后才有;`AgentRail::error` / `rail.confirm`)
//
// 为什么必须成 key:任务要求「presenter 出错时 UI 显示**具名**错误」,
// 而 M106 立的规矩是界面文案一律走 catalog——没有键就只能硬编码中英。
AgentErrorTitle => ("Assistant error", "助手出错"),
AgentErrorUnavailable => ("Couldn't reach the assistant backend. Check the endpoint, then try again.", "连不上助手后端:检查端点后重试。"),
AgentErrorNotImplemented => ("This assistant request isn't wired up yet.", "这个助手请求还没接线。"),
AgentConfirmRequest => ("The assistant wants to change something: {summary}", "助手想改一项设置:{summary}"),
AgentConfirmAllow => ("Allow", "允许"),
AgentConfirmDeny => ("Deny", "拒绝"),
} }
};
}
+8 -2
View File
@@ -124,7 +124,7 @@ pub(super) const GOLDEN: &[(&str, &str, &str)] = &[
("LogsEmptyBody", "Logs stream here while the launcher or the game is running. Pick an instance and start it to see the first lines.", "启动器或游戏运行时,日志会实时出现在这里。选择一个实例并启动,就能看到第一批日志。"),
("LogsEmptyAction", "Choose an instance", "选择实例"),
("AgentTitle", "Assistant", "助手"),
("AgentSubtitle", "Conversation shell · no backend yet", "会话外壳 · 后端未接"),
("AgentSubtitle", "Conversation", "会话"),
("AgentCollapse", "Collapse", "收起"),
("AgentDetach", "Pop out", "拆出"),
("AgentDock", "Dock back", "收回"),
@@ -134,7 +134,7 @@ pub(super) const GOLDEN: &[(&str, &str, &str)] = &[
("AgentStop", "Stop", "中断"),
("AgentPlaceholder", "Message the assistant…", "给助手发消息…"),
("AgentEmptyTitle", "Nothing in this session yet", "这个会话还没有内容"),
("AgentEmptyBody", "Ask about instances, downloads or logs. No model is wired up yet.", "可以问实例、下载或日志。模型还没接上。"),
("AgentEmptyBody", "Ask about instances, downloads or logs.", "可以问实例、下载或日志。"),
("AgentNotePending", "Placeholder shell: your message is kept here, nothing was sent to a model.", "占位外壳:消息留在这里,没有发给任何模型。"),
("AgentNoteStopped", "Stopped by you.", "你中断了这次回复。"),
("AgentUnread", "{count} unread", "{count} 条未读"),
@@ -143,6 +143,12 @@ pub(super) const GOLDEN: &[(&str, &str, &str)] = &[
("AgentRoleYou", "You", "你"),
("AgentRoleAssistant", "Assistant", "助手"),
("AgentRoleNotice", "Notice", "提示"),
("AgentErrorTitle", "Assistant error", "助手出错"),
("AgentErrorUnavailable", "Couldn't reach the assistant backend. Check the endpoint, then try again.", "连不上助手后端:检查端点后重试。"),
("AgentErrorNotImplemented", "This assistant request isn't wired up yet.", "这个助手请求还没接线。"),
("AgentConfirmRequest", "The assistant wants to change something: {summary}", "助手想改一项设置:{summary}"),
("AgentConfirmAllow", "Allow", "允许"),
("AgentConfirmDeny", "Deny", "拒绝"),
// ── M106 `I18NFOLLOW`:General 分组真控件(语言选择器 + 其余三行)。**只追加在链尾**,
// 上一行到 `LogsEmptyAction` 的既有顺序一字未动(金表要证明的正是这件事)。
("SettingsLanguageFollowSystem", "Follow system", "跟随系统"),