@@ -58,6 +58,7 @@ export class FileDropper extends Component<FileDropperProps, {}> {
5858
5959 private onDrop ( acceptedFiles : File [ ] , fileRejections : FileRejection [ ] ) : void {
6060 const { store } = this . props ;
61+ const { FILERECTEDSIZE , FILESREJECTED } = store . texts ;
6162 const maxSize = store . maxSize || null ;
6263 let maxReached = false ;
6364
@@ -71,8 +72,12 @@ export class FileDropper extends Component<FileDropperProps, {}> {
7172 const otherRejected : File [ ] = [ ] ;
7273 fileRejections . forEach ( reject => {
7374 if ( maxSize !== null && reject && reject . file . size && reject . file . size > maxSize ) {
75+ const text = FILERECTEDSIZE
76+ . replace ( / % % F I L E N A M E % % / g, reject . file . name )
77+ . replace ( / % % M A X S I Z E % % / g, fileSize ( maxSize ) ) ;
78+
7479 const message = new ValidationMessage (
75- `File: ' ${ reject . file . name } ' is rejected, file size exceeds ${ fileSize ( maxSize ) } ` ,
80+ text ,
7681 "warning"
7782 ) ;
7883 store . addValidationMessage ( message ) ;
@@ -83,7 +88,7 @@ export class FileDropper extends Component<FileDropperProps, {}> {
8388
8489 if ( otherRejected . length > 0 ) {
8590 mx . ui . info (
86- [ "The following files are rejected:" , "" , ...otherRejected . map ( file => file . name ) ] . join ( "\n" ) ,
91+ [ FILESREJECTED , "" , ...otherRejected . map ( file => file . name ) ] . join ( "\n" ) ,
8792 true
8893 ) ;
8994 }
0 commit comments