fix(i18n): translate notification titles passed through helpers (#1142)

Debugger action failures, project tree clipboard / create-file failures and Docker operation failures pass their title through a helper before notify, so the text catalog check never saw them and they showed in English. The call sites now tag the text with tx, and Docker failures name each operation in a full sentence instead of splicing an English verb or object into one.
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-11-04 09:53:56 +08:00
1 джерело 2e6cda1d86
коміт f088a4afb0
4 files changed
+63 -28

No files matched your search

+11 -11
Переглянути файл
@@ -91,7 +91,7 @@ export function runToLine(path: string, line: number) {
const t = pausedTarget();
if (t && breakpointPathAllowed(path))
void report(
"Run to Cursor failed",
tx("Run to Cursor failed"),
resumeExecution(t.s.id, () => call(commands.debugRunTo(t.s.id, t.thread, path, line, false))),
);
}
@@ -340,7 +340,7 @@ export function registerDebugActions(): () => void {
category: "Debug",
icon: "debug",
description: "Start debugging a run configuration",
run: ({ arg }) => report("Cannot start debugging", startConfig(arg)),
run: ({ arg }) => report(tx("Cannot start debugging"), startConfig(arg)),
},
{
id: "debug.attach",
@@ -351,7 +351,7 @@ export function registerDebugActions(): () => void {
"Attach the Java debugger to a JVM listening for JDWP (arg: { name, module, hostName, port, process })",
run: ({ arg }) =>
report(
"Cannot attach the debugger",
tx("Cannot attach the debugger"),
(async () => {
const root = useProject.getState().project?.root;
if (!root || !isJavaAttachTarget(arg)) return;
@@ -414,7 +414,7 @@ export function registerDebugActions(): () => void {
const t = pausedTarget();
if (t)
void report(
"Resume failed",
tx("Resume failed"),
resumeExecution(t.s.id, () => call(commands.debugResume(t.s.id, t.thread))),
);
},
@@ -433,7 +433,7 @@ export function registerDebugActions(): () => void {
const threads = await call(commands.debugThreads(s.id)).catch(() => []);
thread = threads[0]?.id ?? 0;
}
await report("Pause failed", call(commands.debugPause(s.id, thread)));
await report(tx("Pause failed"), call(commands.debugPause(s.id, thread)));
},
},
step("debug.stepOver", "Step Over", "over", "step-over"),
@@ -450,7 +450,7 @@ export function registerDebugActions(): () => void {
const t = pausedTarget();
if (t)
void report(
"Force Step Over failed",
tx("Force Step Over failed"),
resumeExecution(t.s.id, () => call(commands.debugForceStepOver(t.s.id, t.thread))),
);
},
@@ -467,7 +467,7 @@ export function registerDebugActions(): () => void {
const t = pausedTarget();
if (t)
void report(
"Force Step Into failed",
tx("Force Step Into failed"),
resumeExecution(t.s.id, () => call(commands.debugStep(t.s.id, t.thread, "into"))),
);
},
@@ -479,7 +479,7 @@ export function registerDebugActions(): () => void {
icon: "smart-step-into",
description: "Choose which call on the current line to step into",
when: paused,
run: () => void report("Smart Step Into failed", smartStepInto()),
run: () => void report(tx("Smart Step Into failed"), smartStepInto()),
},
{
id: "debug.showExecutionPoint",
@@ -509,7 +509,7 @@ export function registerDebugActions(): () => void {
return;
}
void report(
"Reset Frame failed",
tx("Reset Frame failed"),
resumeExecution(t.s.id, () => call(commands.debugRestartFrame(t.s.id, frame.id))),
);
},
@@ -559,7 +559,7 @@ export function registerDebugActions(): () => void {
const c = cursor();
if (t && c && breakpointPathAllowed(c.path))
void report(
"Run to Cursor failed",
tx("Run to Cursor failed"),
resumeExecution(t.s.id, () => call(commands.debugRunTo(t.s.id, t.thread, c.path, c.line, false))),
);
},
@@ -576,7 +576,7 @@ export function registerDebugActions(): () => void {
const c = cursor();
if (t && c && breakpointPathAllowed(c.path))
void report(
"Force Run to Cursor failed",
tx("Force Run to Cursor failed"),
resumeExecution(t.s.id, () => call(commands.debugRunTo(t.s.id, t.thread, c.path, c.line, true))),
);
},