Feature request: Add delete confirmation dialog to file manager #344
@@ -846,6 +846,7 @@
|
|||||||
"confirmDeleteMessage": "Are you sure you want to delete <strong>{{name}}</strong>?",
|
"confirmDeleteMessage": "Are you sure you want to delete <strong>{{name}}</strong>?",
|
||||||
"confirmDeleteSingleItem": "Are you sure you want to permanently delete \"{{name}}\"?",
|
"confirmDeleteSingleItem": "Are you sure you want to permanently delete \"{{name}}\"?",
|
||||||
"confirmDeleteMultipleItems": "Are you sure you want to permanently delete {{count}} items?",
|
"confirmDeleteMultipleItems": "Are you sure you want to permanently delete {{count}} items?",
|
||||||
|
"confirmDeleteMultipleItemsWithFolders": "Are you sure you want to permanently delete {{count}} items? This includes folders and their contents.",
|
||||||
"confirmDeleteFolder": "Are you sure you want to permanently delete the folder \"{{name}}\" and all its contents?",
|
"confirmDeleteFolder": "Are you sure you want to permanently delete the folder \"{{name}}\" and all its contents?",
|
||||||
"deleteDirectoryWarning": "This will delete the folder and all its contents.",
|
"deleteDirectoryWarning": "This will delete the folder and all its contents.",
|
||||||
"actionCannotBeUndone": "This action cannot be undone.",
|
"actionCannotBeUndone": "This action cannot be undone.",
|
||||||
|
|||||||
@@ -603,7 +603,12 @@ function FileManagerContent({ initialHost, onClose }: FileManagerProps) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
confirmMessage = t("fileManager.confirmDeleteMultipleItems", {
|
const hasDirectory = files.some((file) => file.type === "directory");
|
||||||
|
const translationKey = hasDirectory
|
||||||
|
? "fileManager.confirmDeleteMultipleItemsWithFolders"
|
||||||
|
: "fileManager.confirmDeleteMultipleItems";
|
||||||
|
|
||||||
|
confirmMessage = t(translationKey, {
|
||||||
count: files.length,
|
count: files.length,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user