diff --git a/internal/gui/assets/i18n.js b/internal/gui/assets/i18n.js index c7ac59552..8c2e1d614 100644 --- a/internal/gui/assets/i18n.js +++ b/internal/gui/assets/i18n.js @@ -2615,7 +2615,7 @@ const I18N = { "Succeeded": "成功", "Request ID": "请求 ID", "Error": "错误", - "First token": "首响", + "First token": "首字耗时", "Reasoning tokens": "推理 token", "Called for": "用途", "Session ID": "会话 ID", @@ -3318,16 +3318,16 @@ const I18N = { "{n} s": "{n} 秒", "{n} ms": "{n} 毫秒", "TTFT {ms}": "首字 {ms}", - "TTFT": "首响", - "Time to first token": "首响时间:从发出请求到收到第一个 token", + "TTFT": "首字耗时", + "Time to first token": "首字耗时:从发出请求到收到第一个 token", "Speed": "速度", "Output speed": "输出速度", - "Output tokens a second after the first, over the streamed replies": "流式回复从首响起每秒输出的 token 数", + "Output tokens a second after the first, over the streamed replies": "流式回复从首字起每秒输出的 token 数", "No streamed replies timed in this period": "这段时间没有可计时的流式回复", "A reply that reasoned counts only its answer, from its first text: the reasoning was written before the stream showed it": "有推理的回复只算正文部分,从首个正文起计:推理在流里出现前就已写完", "No answer text: speed includes reasoning only when visible reasoning streamed; hidden reasoning has no speed": "没有正文时,仅在可见推理持续流式输出时将其计入速度;隐藏推理不显示速度", "Cache": "缓存", - "first token in {ms}": "{ms} 后首响", + "first token in {ms}": "{ms} 后出首字", "{n} tok/s": "{n} token/秒", "{k} timed reply": "{k} 次计时", "{k} timed replies": "{k} 次计时", @@ -6472,7 +6472,7 @@ const I18N = { "Succeeded": "成功", "Request ID": "請求 ID", "Error": "錯誤", - "First token": "首響", + "First token": "首字耗時", "Reasoning tokens": "推理 token", "Called for": "用途", "Session ID": "會話 ID", @@ -7161,16 +7161,16 @@ const I18N = { "{n} s": "{n} 秒", "{n} ms": "{n} 毫秒", "TTFT {ms}": "首字 {ms}", - "TTFT": "首響", - "Time to first token": "首響時間:從發出請求到收到第一個 token", + "TTFT": "首字耗時", + "Time to first token": "首字耗時:從發出請求到收到第一個 token", "Speed": "速度", "Output speed": "輸出速度", - "Output tokens a second after the first, over the streamed replies": "流式回覆從首響起每秒輸出的 token 數", + "Output tokens a second after the first, over the streamed replies": "流式回覆從首字起每秒輸出的 token 數", "No streamed replies timed in this period": "這段時間沒有可計時的流式回覆", "A reply that reasoned counts only its answer, from its first text: the reasoning was written before the stream showed it": "有推理的回覆只算正文部分,從首個正文起計:推理在流裡出現前就已寫完", "No answer text: speed includes reasoning only when visible reasoning streamed; hidden reasoning has no speed": "沒有正文時,僅在可見推理持續串流輸出時將其計入速度;隱藏推理不顯示速度", "Cache": "快取", - "first token in {ms}": "{ms} 後首響", + "first token in {ms}": "{ms} 後出首字", "{n} tok/s": "{n} token/秒", "{k} timed reply": "{k} 次計時", "{k} timed replies": "{k} 次計時", diff --git a/internal/gui/assets/plugins/usage/i18n.js b/internal/gui/assets/plugins/usage/i18n.js index ec5e5a4b9..d08e6a5c9 100644 --- a/internal/gui/assets/plugins/usage/i18n.js +++ b/internal/gui/assets/plugins/usage/i18n.js @@ -178,7 +178,7 @@ magpie.strings({ "first token in {ms} on average": "首字平均 {ms}", "no streamed replies timed": "没有可计时的流式回复", "Sent, Effort and the cache are in each row's details": "窗口较窄:发送模型、推理强度和缓存在每行的详情里", - "Sent, Effort, the first token and the cache are in each row's details": "窗口较窄:发送模型、推理强度、首响和缓存在每行的详情里", + "Sent, Effort, the first token and the cache are in each row's details": "窗口较窄:发送模型、推理强度、首字和缓存在每行的详情里", "{n} output tokens in {ms} after the first": "首字后 {ms} 输出 {n} 个 token", "At least: {n} output tokens in {ms}, from the line that asked for it to its last. The session file has no first token, so the wait for it is counted too": "下限:从发出请求的那一行到最后一行,{ms} 输出 {n} 个 token。会话文件没有首字时间,等首字的时间也算在里面", "At least: {n} answer tokens in {ms} after the first token, the {r} reasoning tokens left out. The session file has no first text, so reasoning after the first token is counted too": "下限:首字后 {ms} 输出 {n} 个正文 token,{r} 个推理 token 不计。会话文件没有首个正文的时间,首字后的推理时间也算在里面", @@ -368,7 +368,7 @@ magpie.strings({ "first token in {ms} on average": "首字平均 {ms}", "no streamed replies timed": "沒有可計時的流式回覆", "Sent, Effort and the cache are in each row's details": "視窗較窄:傳送模型、推理強度和快取在每行的詳情裡", - "Sent, Effort, the first token and the cache are in each row's details": "視窗較窄:傳送模型、推理強度、首響和快取在每行的詳情裡", + "Sent, Effort, the first token and the cache are in each row's details": "視窗較窄:傳送模型、推理強度、首字和快取在每行的詳情裡", "{n} output tokens in {ms} after the first": "首字後 {ms} 輸出 {n} 個 token", "At least: {n} output tokens in {ms}, from the line that asked for it to its last. The session file has no first token, so the wait for it is counted too": "下限:從發出請求的那一行到最後一行,{ms} 輸出 {n} 個 token。會話檔案沒有首字時間,等首字的時間也算在裡面", "At least: {n} answer tokens in {ms} after the first token, the {r} reasoning tokens left out. The session file has no first text, so reasoning after the first token is counted too": "下限:首字後 {ms} 輸出 {n} 個正文 token,{r} 個推理 token 不計。會話檔案沒有首個正文的時間,首字後的推理時間也算在裡面", diff --git a/internal/gui/tests/routing-burst-speed.test.cjs b/internal/gui/tests/routing-burst-speed.test.cjs index e00d69324..2abab24ad 100644 --- a/internal/gui/tests/routing-burst-speed.test.cjs +++ b/internal/gui/tests/routing-burst-speed.test.cjs @@ -61,7 +61,7 @@ function serve(lang) { const want = { en: { first: /first token in 24 s/, speed: /tok\/s/, normal: /· 100 tok\/s/, slow: /· 50 tok\/s/ }, - zh: { first: /24 秒 后首响/, speed: /token\/秒/, normal: /· 100 token\/秒/, slow: /· 50 token\/秒/ }, + zh: { first: /24 秒 后出首字/, speed: /token\/秒/, normal: /· 100 token\/秒/, slow: /· 50 token\/秒/ }, }; for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) { diff --git a/internal/gui/tests/routing-request-metrics.test.cjs b/internal/gui/tests/routing-request-metrics.test.cjs index 4773d0fe4..a382cbba4 100644 --- a/internal/gui/tests/routing-request-metrics.test.cjs +++ b/internal/gui/tests/routing-request-metrics.test.cjs @@ -91,7 +91,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", assert.equal(await rows.nth(9).locator(".cache-hit").count(), 0, "a request still underway has no final rate"); assert.equal(await rows.nth(12).locator(".meta").isVisible(), false, "a row with no available metrics has no empty band"); assert.equal(await rows.locator(".rt-metric").filter({ hasText: "—" }).count(), 0, "unavailable metrics leave no dash placeholders"); - assert.equal(await rows.nth(0).locator(".ttft .k").textContent(), lang === "zh" ? "首响" : "First token"); + assert.equal(await rows.nth(0).locator(".ttft .k").textContent(), lang === "zh" ? "首字耗时" : "First token"); const labels = lang === "zh" ? ["Token 明细", "输入(未缓存)", "输出", "缓存读取", "缓存写入"] : ["Token breakdown", "Input (uncached)", "Output", "Cache read", "Cache write"]; assert.equal(await rows.nth(0).locator(".tokens").getAttribute("title"), @@ -124,8 +124,8 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", await rows.nth(0).click(); assert.match(await page.locator(".rt-steps").textContent(), lang === "zh" ? /请求缓存命中率 60%/ : /request cache hit rate 60%/); if (lang === "zh") { - assert.match(await page.locator(".rt-steps").textContent(), /后首响/); - assert.doesNotMatch(await page.locator(".rt-steps").textContent(), /首字/); + assert.match(await page.locator(".rt-steps").textContent(), /后出首字/); + assert.doesNotMatch(await page.locator(".rt-steps").textContent(), /首响/); } for (const width of [1280, 1000, 700, 480, 360]) { await page.setViewportSize({ width, height: 900 }); @@ -198,7 +198,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", assert.equal(await menu.locator('[role="menuitemcheckbox"]').count(), 6); // Keep only cache and speed. Each click updates the list immediately, // with the menu open and focus on the checkbox for continued selection. - const labels = lang === "zh" ? ["耗时", "首响", "Token", "费用"] : ["Duration", "First token", "Tokens", "Cost"]; + const labels = lang === "zh" ? ["耗时", "首字耗时", "Token", "费用"] : ["Duration", "First token", "Tokens", "Cost"]; for (const [i, label] of labels.entries()) { const option = menu.getByRole("menuitemcheckbox", { name: label, exact: true }); await option.click(); diff --git a/internal/gui/tests/usage-ledger-detail.test.cjs b/internal/gui/tests/usage-ledger-detail.test.cjs index 7ac1df050..3f401af2b 100644 --- a/internal/gui/tests/usage-ledger-detail.test.cjs +++ b/internal/gui/tests/usage-ledger-detail.test.cjs @@ -74,7 +74,7 @@ const L = { zh: { statuses: ["429 · rate_limit_error", "200", "成功", "rate_limit", "200 · 2 次尝试"], badge: "本地会话", split: [["magpie 内耗时", "180 毫秒"], ["之前失败的尝试", "103 秒"], ["连接并发送请求", "820 毫秒"], ["厂商首字等待", "37 秒"]], - speed: "24 token/秒", tokens: "输入 300 · 输出 40 · 缓存读取 0 · 缓存创建 0", labels: { fail: ["状态", "错误类型", "上游返回", "耗时", "请求 ID", "终结点", "协议", "会话 ID"], ok: ["状态", "耗时", "Token", "速度", "请求 ID", "终结点", "协议", "用途", "首响", "magpie 内耗时", "厂商首字等待"], log: ["请求 ID", "会话 ID", "数据来源"], logFail: ["状态", "错误类型", "错误", "请求 ID", "会话 ID", "数据来源"] }, + speed: "24 token/秒", tokens: "输入 300 · 输出 40 · 缓存读取 0 · 缓存创建 0", labels: { fail: ["状态", "错误类型", "上游返回", "耗时", "请求 ID", "终结点", "协议", "会话 ID"], ok: ["状态", "耗时", "Token", "速度", "请求 ID", "终结点", "协议", "用途", "首字耗时", "magpie 内耗时", "厂商首字等待"], log: ["请求 ID", "会话 ID", "数据来源"], logFail: ["状态", "错误类型", "错误", "请求 ID", "会话 ID", "数据来源"] }, subagent: "子代理", noStatus: "读自 Agent 的会话文件;仅在本地元数据能够明确识别时显示账号,不推断供应商。", }, diff --git a/internal/gui/tests/usage-ledger-ttft.test.cjs b/internal/gui/tests/usage-ledger-ttft.test.cjs index 13f63df3f..bae459511 100644 --- a/internal/gui/tests/usage-ledger-ttft.test.cjs +++ b/internal/gui/tests/usage-ledger-ttft.test.cjs @@ -51,8 +51,8 @@ function server(lang) { const L = { en: { head: "TTFT", detail: "First token", duration: "Duration", hint: "Sent, Effort, the first token and the cache are in each row's details" }, - zh: { head: "首响", detail: "首响", duration: "耗时", hint: "窗口较窄:发送模型、推理强度、首响和缓存在每行的详情里" }, - "zh-TW": { head: "首響", detail: "首響", duration: "耗時", hint: "視窗較窄:傳送模型、推理強度、首響和快取在每行的詳情裡" }, + zh: { head: "首字耗时", detail: "首字耗时", duration: "耗时", hint: "窗口较窄:发送模型、推理强度、首字和缓存在每行的详情里" }, + "zh-TW": { head: "首字耗時", detail: "首字耗時", duration: "耗時", hint: "視窗較窄:傳送模型、推理強度、首字和快取在每行的詳情裡" }, ja: { head: "TTFT", detail: "最初のトークン", duration: "所要時間", hint: "ウィンドウが狭いため、送信したモデル・推論レベル・最初のトークン・キャッシュは各行の詳細にあります" }, de: { head: "TTFT", detail: "Erstes Token", duration: "Dauer", hint: "Schmales Fenster: Gesendet, Effort, erstes Token und Cache stehen in den Details jeder Zeile" }, }; diff --git a/internal/gui/tests/usage-ledger.test.cjs b/internal/gui/tests/usage-ledger.test.cjs index 9124e38c9..80c55376b 100644 --- a/internal/gui/tests/usage-ledger.test.cjs +++ b/internal/gui/tests/usage-ledger.test.cjs @@ -108,7 +108,7 @@ const L = { }, zh: { tabs: ["概览", "请求", "会话", "上下文"], - cols: ["时间", "Agent", "请求模型", "供应商 · 账号", "发送模型", "实际模型", "推理强度", "输入", "输出", "缓存写入", "缓存读取", "费用", "首响", "耗时", "速度", "状态"], + cols: ["时间", "Agent", "请求模型", "供应商 · 账号", "发送模型", "实际模型", "推理强度", "输入", "输出", "缓存写入", "缓存读取", "费用", "首字耗时", "耗时", "速度", "状态"], sum: "130 个请求", pager: "第 1–100 条,共 130 条", older: "较早", newer: "较新", failed: "失败", export: "导出 CSV", why: null, saved: "已将 130 个请求保存到 ~/Downloads/magpie-requests-30d-2026-09-29.csv", none: "没有符合这些筛选条件的请求。", bad: "失败:Agent 收到的是 429", via: "Codex · 来自 office-mac", diff --git a/internal/gui/tests/usage-speed.test.cjs b/internal/gui/tests/usage-speed.test.cjs index cbf0e50cf..9c0ad8993 100644 --- a/internal/gui/tests/usage-speed.test.cjs +++ b/internal/gui/tests/usage-speed.test.cjs @@ -97,7 +97,7 @@ function server(lang) { const L = { en: { speed: "Speed", kpi: "Output speed", fast: "75 tok/s", slow: "10 tok/s", all: "72 tok/s", first: "first token in 600 ms on average · 28 timed replies", sent: "Sent", hint: "Sent, Effort, the first token and the cache are in each row's details" }, - zh: { speed: "速度", kpi: "输出速度", fast: "75 token/秒", slow: "10 token/秒", all: "72 token/秒", first: "首字平均 600 毫秒 · 28 次计时", sent: "发送模型", hint: "窗口较窄:发送模型、推理强度、首响和缓存在每行的详情里" }, + zh: { speed: "速度", kpi: "输出速度", fast: "75 token/秒", slow: "10 token/秒", all: "72 token/秒", first: "首字平均 600 毫秒 · 28 次计时", sent: "发送模型", hint: "窗口较窄:发送模型、推理强度、首字和缓存在每行的详情里" }, }; for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) {