react-drop-n-crop
react-drop-n-crop copied to clipboard
Change the message content?
It's a pretty good. But is there anyway to custom the content message for localization purpose? Thanks!
Not currently!
This would be a pretty easy update though - we can add an optional prop called customMessages that takes a shape like this:
{
instructions: 'Drag-n-drop a file or click to add an image',
acceptedFileTypes: 'Accepted file types',
maxFileSize: 'Max file size',
fileTypeErrorMessage: 'Invalid file type',
fileSizeErrorMessage: 'File size must be less than $BYTES',
}
then update the code to use those messages if provided
I've seen your source code and solved this already. I've also add clear image feature and custom error messages. Can I contribute?
Sure submit a PR and we'll take a look!
Is this feature not available at master branch yet? Only in v0.3.0 branch so far? Edit: Hey after looking at the source code I realized you have a props known as "instructions" which allow user to change the content inside the "Drop n Crop" box! Perhaps you can add this to the documentation.