1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-03 16:10:26 +00:00

improve delete message

This commit is contained in:
shanshuirenjia
2019-06-05 21:10:42 +08:00
parent aad5d6c8dd
commit 649a68829c

View File

@@ -600,9 +600,15 @@ class LibContentView extends React.Component {
}
this.deleteDirent(direntPath);
});
var msg = gettext('Successfully deleted {name} and other {n} items.');
let msg = '';
if (direntPaths.length > 1) {
msg = gettext('Successfully deleted {name} and other {n} items.');
msg = msg.replace('{name}', dirNames[0]);
msg = msg.replace('{n}', dirNames.length - 1);
} else {
msg = gettext('Successfully deleted {name}.');
msg = msg.replace('{name}', dirNames[0]);
}
toaster.success(msg);
}).catch(() => {
var msg = gettext('Failed to delete {name} and other {n} items.');