Skip to content

Commit 4aa6ee5

Browse files
committed
fix: address PR #8796 review comments
- Add missing 'checkpoint.menu.more' translation key for accessibility - Add translation keys for checkpoint diff messages (no_first, no_previous, no_changes, diff_with_next, diff_since_first, diff_to_current) - Fix English wording: 'compared with' instead of 'compare with' - Fix naming inconsistency: rename setRestoreIsConfirming to setRestoreConfirming - Update tests to expect translation keys instead of hardcoded strings - All translations added to 18 supported languages
1 parent 4f2bb89 commit 4aa6ee5

File tree

39 files changed

+144
-19
lines changed

39 files changed

+144
-19
lines changed

src/core/checkpoints/__tests__/checkpoint.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ describe("Checkpoint functionality", () => {
304304
})
305305
expect(vscode.commands.executeCommand).toHaveBeenCalledWith(
306306
"vscode.changes",
307-
"Changes to current workspace",
307+
"errors.checkpoint_diff_to_current",
308308
expect.any(Array),
309309
)
310310
})
@@ -329,7 +329,7 @@ describe("Checkpoint functionality", () => {
329329
})
330330
expect(vscode.commands.executeCommand).toHaveBeenCalledWith(
331331
"vscode.changes",
332-
"Changes compare with next checkpoint",
332+
"errors.checkpoint_diff_with_next",
333333
expect.any(Array),
334334
)
335335
})
@@ -364,7 +364,7 @@ describe("Checkpoint functionality", () => {
364364
mode: "to-current",
365365
})
366366

367-
expect(vscode.window.showInformationMessage).toHaveBeenCalledWith("No changes found.")
367+
expect(vscode.window.showInformationMessage).toHaveBeenCalledWith("errors.checkpoint_no_changes")
368368
expect(vscode.commands.executeCommand).not.toHaveBeenCalled()
369369
})
370370

src/core/checkpoints/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ export async function checkpointDiff(task: Task, { ts, previousCommitHash, commi
298298
const checkpoints = task.clineMessages.filter(({ say }) => say === "checkpoint_saved").map(({ text }) => text!)
299299

300300
if (["from-init", "full"].includes(mode) && checkpoints.length < 1) {
301-
vscode.window.showInformationMessage("No first checkpoint to compare.")
301+
vscode.window.showInformationMessage(t("common:errors.checkpoint_no_first"))
302302
return
303303
}
304304

@@ -307,35 +307,35 @@ export async function checkpointDiff(task: Task, { ts, previousCommitHash, commi
307307
case "checkpoint":
308308
fromHash = commitHash
309309
toHash = idx !== -1 && idx < checkpoints.length - 1 ? checkpoints[idx + 1] : undefined
310-
title = "Changes compare with next checkpoint"
310+
title = t("common:errors.checkpoint_diff_with_next")
311311
break
312312
case "from-init":
313313
fromHash = checkpoints[0]
314314
toHash = commitHash
315-
title = "Changes since first checkpoint"
315+
title = t("common:errors.checkpoint_diff_since_first")
316316
break
317317
case "to-current":
318318
fromHash = commitHash
319319
toHash = undefined
320-
title = "Changes to current workspace"
320+
title = t("common:errors.checkpoint_diff_to_current")
321321
break
322322
case "full":
323323
fromHash = checkpoints[0]
324324
toHash = undefined
325-
title = "Changes since first checkpoint"
325+
title = t("common:errors.checkpoint_diff_since_first")
326326
break
327327
}
328328

329329
if (!fromHash) {
330-
vscode.window.showInformationMessage("No previous checkpoint to compare.")
330+
vscode.window.showInformationMessage(t("common:errors.checkpoint_no_previous"))
331331
return
332332
}
333333

334334
try {
335335
const changes = await service.getDiff({ from: fromHash, to: toHash })
336336

337337
if (!changes?.length) {
338-
vscode.window.showInformationMessage("No changes found.")
338+
vscode.window.showInformationMessage(t("common:errors.checkpoint_no_changes"))
339339
return
340340
}
341341

src/i18n/locales/ca/common.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/i18n/locales/de/common.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/i18n/locales/en/common.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929
"checkpoint_timeout": "Timed out when attempting to restore checkpoint.",
3030
"checkpoint_failed": "Failed to restore checkpoint.",
3131
"git_not_installed": "Git is required for the checkpoints feature. Please install Git to enable checkpoints.",
32+
"checkpoint_no_first": "No first checkpoint to compare.",
33+
"checkpoint_no_previous": "No previous checkpoint to compare.",
34+
"checkpoint_no_changes": "No changes found.",
35+
"checkpoint_diff_with_next": "Changes compared with next checkpoint",
36+
"checkpoint_diff_since_first": "Changes since first checkpoint",
37+
"checkpoint_diff_to_current": "Changes to current workspace",
3238
"nested_git_repos_warning": "Checkpoints are disabled because a nested git repository was detected at: {{path}}. To use checkpoints, please remove or relocate this nested git repository.",
3339
"no_workspace": "Please open a project folder first",
3440
"update_support_prompt": "Failed to update support prompt",

src/i18n/locales/es/common.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/i18n/locales/fr/common.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/i18n/locales/hi/common.json

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/i18n/locales/id/common.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/i18n/locales/it/common.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)