Skip to content

Commit f5511e9

Browse files
committed
fix: use i18n translations for Git warning message
- Use t() function for warning message and Learn More button - Add translations to common.json for git_not_installed error - Follow project's i18n patterns for consistency
1 parent 185220e commit f5511e9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/core/checkpoints/index.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { Task } from "../task/Task"
77

88
import { getWorkspacePath } from "../../utils/path"
99
import { checkGitInstalled } from "../../utils/git"
10+
import { t } from "../../i18n"
1011

1112
import { ClineApiReqInfo } from "../../shared/ExtensionMessage"
1213
import { getApiMetrics } from "../../shared/getApiMetrics"
@@ -81,12 +82,9 @@ export function getCheckpointService(cline: Task) {
8182

8283
// Show user-friendly notification
8384
vscode.window
84-
.showWarningMessage(
85-
"Git is required for the checkpoints feature. Please install Git to enable checkpoints.",
86-
"Learn More",
87-
)
85+
.showWarningMessage(t("common:errors.git_not_installed"), t("common:buttons.learn_more"))
8886
.then((selection) => {
89-
if (selection === "Learn More") {
87+
if (selection === t("common:buttons.learn_more")) {
9088
vscode.env.openExternal(vscode.Uri.parse("https://git-scm.com/downloads"))
9189
}
9290
})

src/i18n/locales/en/common.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"could_not_open_file_generic": "Could not open file!",
2929
"checkpoint_timeout": "Timed out when attempting to restore checkpoint.",
3030
"checkpoint_failed": "Failed to restore checkpoint.",
31+
"git_not_installed": "Git is required for the checkpoints feature. Please install Git to enable checkpoints.",
3132
"no_workspace": "Please open a project folder first",
3233
"update_support_prompt": "Failed to update support prompt",
3334
"reset_support_prompt": "Failed to reset support prompt",
@@ -107,7 +108,8 @@
107108
},
108109
"buttons": {
109110
"save": "Save",
110-
"edit": "Edit"
111+
"edit": "Edit",
112+
"learn_more": "Learn More"
111113
},
112114
"tasks": {
113115
"canceled": "Task error: It was stopped and canceled by the user.",

0 commit comments

Comments
 (0)