diff --git a/packages/ra-ui-materialui/src/button/BulkDeleteWithConfirmButton.js b/packages/ra-ui-materialui/src/button/BulkDeleteWithConfirmButton.js index 160e0377f63..4ea3de5cdb4 100644 --- a/packages/ra-ui-materialui/src/button/BulkDeleteWithConfirmButton.js +++ b/packages/ra-ui-materialui/src/button/BulkDeleteWithConfirmButton.js @@ -43,6 +43,8 @@ const useStyles = makeStyles(theme => ({ const BulkDeleteWithConfirmButton = ({ basePath, classes: classesOverride, + confirmTitle, + confirmContent, crudDeleteMany, icon, label, @@ -105,8 +107,8 @@ const BulkDeleteWithConfirmButton = ({ <Confirm isOpen={isOpen} loading={loading} - title="ra.message.bulk_delete_title" - content="ra.message.bulk_delete_content" + title={confirmTitle} + content={confirmContent} translateOptions={{ smart_count: selectedIds.length, name: inflection.humanize( @@ -127,6 +129,8 @@ const BulkDeleteWithConfirmButton = ({ BulkDeleteWithConfirmButton.propTypes = { basePath: PropTypes.string, classes: PropTypes.object, + confirmTitle: PropTypes.string, + confirmContent: PropTypes.string, label: PropTypes.string, resource: PropTypes.string.isRequired, selectedIds: PropTypes.arrayOf(PropTypes.any).isRequired, @@ -134,6 +138,8 @@ BulkDeleteWithConfirmButton.propTypes = { }; BulkDeleteWithConfirmButton.defaultProps = { + confirmTitle: 'ra.message.bulk_delete_title', + confirmContent: 'ra.message.bulk_delete_content', label: 'ra.action.delete', icon: <ActionDelete />, }; diff --git a/packages/ra-ui-materialui/src/button/DeleteWithConfirmButton.js b/packages/ra-ui-materialui/src/button/DeleteWithConfirmButton.js index 64bb0577f0e..5902f02d8ff 100644 --- a/packages/ra-ui-materialui/src/button/DeleteWithConfirmButton.js +++ b/packages/ra-ui-materialui/src/button/DeleteWithConfirmButton.js @@ -51,6 +51,8 @@ const DeleteWithConfirmButton = ({ basePath, classes: classesOverride, className, + confirmTitle = 'ra.message.delete_title', + confirmContent = 'ra.message.delete_content', icon, label = 'ra.action.delete', onClick, @@ -127,8 +129,8 @@ const DeleteWithConfirmButton = ({ <Confirm isOpen={open} loading={loading} - title="ra.message.delete_title" - content="ra.message.delete_content" + title={confirmTitle} + content={confirmContent} translateOptions={{ name: inflection.humanize( translate(`resources.${resource}.name`, { @@ -150,6 +152,8 @@ DeleteWithConfirmButton.propTypes = { basePath: PropTypes.string, classes: PropTypes.object, className: PropTypes.string, + confirmTitle: PropTypes.string, + confirmContent: PropTypes.string, label: PropTypes.string, record: PropTypes.object, redirect: PropTypes.oneOfType([