fix(vcs): translate the question in the add/remove to Git confirmation (#1575)

The confirmation body joined the English question and the file list into one string, which never matched a catalog entry. The question is now translated on its own before the list is appended.
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-11-05 22:32:09 +08:00
1 джерело de09ee0678
коміт 6e6baf4284
2 files changed
+12 -2

No files matched your search

+8 -2
Переглянути файл
@@ -44,14 +44,20 @@ async function confirmFiles(op: FileOperation["kind"], files: string[]): Promise
const root = useVcs.getState().root ?? "";
const add = op === "created";
const n = files.length;
const what = n === 1 ? "file" : `${n} files`;
const list = files
.slice(0, 10)
.map((f) => relTo(root, f))
.join("\n");
const question = add
? n === 1
? tx("Do you want to add the following file to Git?")
: tx`Do you want to add the following ${n} files to Git?`
: n === 1
? tx("Do you want to remove the following file from Git?")
: tx`Do you want to remove the following ${n} files from Git?`;
const r = await ask({
title: add ? "Add File to Git" : "Remove File from Git",
body: `${add ? `Do you want to add the following ${what} to Git?` : `Do you want to remove the following ${what} from Git?`}\n${list}${n > 10 ? "\n…" : ""}`,
body: `${question}\n${list}${n > 10 ? "\n…" : ""}`,
checkbox: "Don't ask again",
width: 480,
buttons: [{ id: "ok", label: add ? "Add" : "Remove", primary: true }],
+4
Переглянути файл
@@ -6099,6 +6099,10 @@
"Dropped {ref}": "已删除 {ref}",
"Remove 1 file from Git": "从 Git 中移除 1 个文件",
"Remove {n} files from Git": "从 Git 中移除 {n} 个文件",
"Do you want to add the following file to Git?": "是否将以下文件添加到 Git?",
"Do you want to add the following {n} files to Git?": "是否将以下 {n} 个文件添加到 Git?",
"Do you want to remove the following file from Git?": "是否从 Git 中移除以下文件?",
"Do you want to remove the following {n} files from Git?": "是否从 Git 中移除以下 {n} 个文件?",
"Accept yours for {path}": "对 {path} 接受你的版本",
"Accept theirs for {path}": "对 {path} 接受他们的版本",
"{path} resolved": "{path} 已解决",