react-dropzone/react-dropzone

Text/Error Message Mapping:

Chiusa

#1197 aperta il 19 mag 2022

 (1 commento) (1 reazione) (0 assegnatari)TypeScript (801 fork)batch import
enhancementhelp wanted

Metriche repository

Star
 (11.015 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Is your feature request related to a problem? Please describe. I would like to be able to add custom error messages. This way I can internationalize this component for teams outside of the US. Example

Describe the solution you'd like An option that exposes and object of errors that we can update. An idea could be something like:

textMap: {
  fileTypeError: 'Wrong file error %s',
  maxFileSizeError: 'File too big, should be %s',
}

The %s would get replaced by a value, if available (e.g. filesize). This is way our international teams could replace these messages with messages in their language.

Describe alternatives you've considered Writing my own regex replace function when looping through the rejectedFiles array.

Guida contributor