+
{counts ? confirmText(counts) : Replace every occurrence in the scope?}
+
+ -
+ Text to find
+
+ -
+
+ {pattern}
+
+
+ -
+ Replace with
+
+ -
+
+ {replacement || (
+
+ Empty text
+
+ )}
+
+
+
+ {!counts && (
+
+ The search hit its limit, so it runs again to find any additional matches.
+
+ )}
+ {hasExclusions && (
+
+ Excluded usages are skipped.
+
+ )}
+
+ ),
+ });
+}
diff --git a/src/features/search/find/replaceFlow.ts b/src/features/search/find/replaceFlow.ts
index 32b2edd4b..dc0377308 100644
--- a/src/features/search/find/replaceFlow.ts
+++ b/src/features/search/find/replaceFlow.ts
@@ -91,15 +91,10 @@ export function countUsages(usages: readonly Usage[]): ReplaceCounts {
}
/** "Replace 3 occurrences in 2 files" for the confirmation dialog. */
-export function confirmText(c: ReplaceCounts, pattern: string, replacement: string): string {
- const occ = `${c.usages} occurrence${c.usages === 1 ? "" : "s"}`;
- const files = `${c.files} file${c.files === 1 ? "" : "s"}`;
- return `Replace ${occ} of '${pattern}' with '${replacement}' in ${files}?`;
-}
-
-/** Confirmation for Replace All once the search hit its limit (the count shown is not the total). */
-export function confirmAllText(pattern: string, replacement: string): string {
- return tx`Replace every occurrence of '${pattern}' with '${replacement}' in the scope? The search hit its limit, so it runs again to find the occurrences not listed.`;
+export function confirmText({ usages, files }: ReplaceCounts): string {
+ if (usages === 1) return tx("Replace 1 occurrence in 1 file?");
+ if (files === 1) return tx`Replace ${usages} occurrences in 1 file?`;
+ return tx`Replace ${usages} occurrences in ${files} files?`;
}
/** Toggles exclusion of every usage in `groups` (all excluded → include them again). */
diff --git a/src/platform/locales/text/en.json b/src/platform/locales/text/en.json
index b2609c7e5..25252ee4d 100644
--- a/src/platform/locales/text/en.json
+++ b/src/platform/locales/text/en.json
@@ -3185,7 +3185,15 @@
"Stacked": "Stacked",
"Resize plugin panes": "Resize plugin panes",
"Run a Python script or module": "Run a Python script or module",
- "Replace every occurrence of '{pattern}' with '{replacement}' in the scope? The search hit its limit, so it runs again to find the occurrences not listed.": "Replace every occurrence of '{pattern}' with '{replacement}' in the scope? The search hit its limit, so it runs again to find the occurrences not listed.",
+ "Replace 1 occurrence in 1 file?": "Replace 1 occurrence in 1 file?",
+ "Replace {usages} occurrences in 1 file?": "Replace {usages} occurrences in 1 file?",
+ "Replace {usages} occurrences in {files} files?": "Replace {usages} occurrences in {files} files?",
+ "Replace every occurrence in the scope?": "Replace every occurrence in the scope?",
+ "The search hit its limit, so it runs again to find any additional matches.": "The search hit its limit, so it runs again to find any additional matches.",
+ "Text to find": "Text to find",
+ "Replace with": "Replace with",
+ "Empty text": "Empty text",
+ "Excluded usages are skipped.": "Excluded usages are skipped.",
"Server default": "Server default",
"New Database": "New Database",
"Owner:": "Owner:",
diff --git a/src/platform/locales/text/tr.json b/src/platform/locales/text/tr.json
index 9d2bf18d7..9c6bb55e4 100644
--- a/src/platform/locales/text/tr.json
+++ b/src/platform/locales/text/tr.json
@@ -2588,7 +2588,8 @@
"Resize Markdown preview": "Markdown önizlemesini yeniden boyutlandır",
"Resize plugin panes": "Eklenti bölmelerini yeniden boyutlandır",
"Run a Python script or module": "Python betiği veya modülü çalıştır",
- "Replace every occurrence of '{pattern}' with '{replacement}' in the scope? The search hit its limit, so it runs again to find the occurrences not listed.": "Kapsamdaki tüm '{pattern}' eşleşmeleri '{replacement}' ile değiştirilsin mi? Arama sınıra ulaştığı için listelenmeyen eşleşmeleri bulmak üzere yeniden çalıştırılacak.",
+ "Replace every occurrence in the scope?": "Kapsamdaki tüm eşleşmeler değiştirilsin mi?",
+ "The search hit its limit, so it runs again to find any additional matches.": "Arama sınıra ulaştığı için kalan eşleşmeleri bulmak üzere yeniden çalıştırılacak.",
"Server default": "Sunucu varsayılanı",
"New Database": "Yeni veritabanı",
"Owner:": "Sahip:",
diff --git a/src/platform/locales/text/zh-TW.json b/src/platform/locales/text/zh-TW.json
index af0376ef5..b7ce58108 100644
--- a/src/platform/locales/text/zh-TW.json
+++ b/src/platform/locales/text/zh-TW.json
@@ -3391,7 +3391,8 @@
"Group By": "分組依據",
"Show on Double-Click": "雙擊時顯示",
"Follow the Interface": "跟隨介面",
- "Replace every occurrence of '{pattern}' with '{replacement}' in the scope? The search hit its limit, so it runs again to find the occurrences not listed.": "要在整個範圍內把所有「{pattern}」取代為「{replacement}」嗎?搜尋已達上限,將重新搜尋以找出未列出的相符項目。",
+ "Replace every occurrence in the scope?": "要取代整個範圍內的所有相符項目嗎?",
+ "The search hit its limit, so it runs again to find any additional matches.": "搜尋已達上限,將重新搜尋以找出其餘相符項目。",
"Review": "審查",
"Commit and Push…": "提交併推送…",
"Language server": "語言伺服器",
diff --git a/src/platform/locales/text/zh.json b/src/platform/locales/text/zh.json
index ab58d02e4..8bf8b62a6 100644
--- a/src/platform/locales/text/zh.json
+++ b/src/platform/locales/text/zh.json
@@ -3820,7 +3820,12 @@
"Group By": "分组依据",
"Show on Double-Click": "双击时显示",
"Follow the Interface": "跟随界面",
- "Replace every occurrence of '{pattern}' with '{replacement}' in the scope? The search hit its limit, so it runs again to find the occurrences not listed.": "要在整个范围内把所有「{pattern}」替换为「{replacement}」吗?搜索已达上限,将重新搜索以找出未列出的匹配项。",
+ "Replace 1 occurrence in 1 file?": "替换 1 个文件中的 1 处匹配项吗?",
+ "Replace {usages} occurrences in 1 file?": "替换 1 个文件中的 {usages} 处匹配项吗?",
+ "Replace {usages} occurrences in {files} files?": "替换 {files} 个文件中的 {usages} 处匹配项吗?",
+ "Replace every occurrence in the scope?": "替换整个范围内的所有匹配项吗?",
+ "The search hit its limit, so it runs again to find any additional matches.": "搜索已达上限,将重新搜索以找出其余匹配项。",
+ "Empty text": "空文本",
"Review": "审查",
"Commit and Push…": "提交并推送…",
"Language server": "语言服务器",