feat(webui): localize agent activity
Localize frontend-owned activity presentation while preserving raw tool data and current controls. Include locale-aware model memoization and integration with current main. Co-authored-by: Xubin Ren <52506698+Re-bin@users.noreply.github.com>
This commit is contained in:
1 parent
f57cc3aad2
commit
796e1cb0e6
23 files changed
+1704
-128
No files matched your search
@@ -2,9 +2,10 @@ import { describe, expect, it } from "vitest";
|
||||
|
||||
import { describeTraceLine } from "@/components/thread/activity/trace-activity-model";
|
||||
import type { GenericToolStatus } from "@/components/thread/activity/generic-tool-model";
|
||||
import i18n, { setAppLanguage } from "@/i18n";
|
||||
|
||||
function describeTrace(line: string, status: GenericToolStatus = "done") {
|
||||
return describeTraceLine(line, status);
|
||||
return describeTraceLine(line, status, i18n.t);
|
||||
}
|
||||
|
||||
describe("trace activity semantics", () => {
|
||||
@@ -66,4 +67,17 @@ describe("trace activity semantics", () => {
|
||||
});
|
||||
expect(result.detail).not.toContain("second-secret-line");
|
||||
});
|
||||
|
||||
it("localizes generated copy while preserving paths and commands", async () => {
|
||||
await setAppLanguage("zh-CN");
|
||||
|
||||
expect(describeTrace('read_file({"path":"src/app.tsx"})')).toMatchObject({
|
||||
label: "已读取",
|
||||
detail: "src/app.tsx",
|
||||
});
|
||||
expect(describeTrace('exec({"command":"bun test"})')).toMatchObject({
|
||||
label: "已运行命令",
|
||||
detail: "bun test",
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user