I’m using the JS API to open a dialog, and passing a validator array to check for minimum pixel dimensions. I’m also writing window.UPLOADCARE_LOCALE_TRANSLATIONS to provide custom error messages. This works great when the settings object is set to {..., multiple: true } (top image):
There are two places in the custom locale where you specify the error message. This is how it should look like:
window.UPLOADCARE_LOCALE_TRANSLATIONS = {
// for the widget and the "multiple: true" mode
errors: {
'fileSizeError': 'File is too big'
},
//for the dialog and the "multiple: false" mode
dialog: {
tabs: {
preview: {
error: {
'fileSizeError': {
title: 'ERROR',
text: 'File is too big',
back: 'Please try again'
}
}
}
}
}
};
Slightly related: when { previewStep: true, multiple: true } and the effects tab is set up, it’s possible to click on the file name to access the crop/enhance settings. But is there any way to make the preview step appear automatically, as it does with {multiple: false}? I’m not sure customers will realize they can crop or enhance the image from the list as things stand – though I can probably add some messaging to this effect if necessary.
There’s no way to force the preview step when the “multiple” mode is enabled, but yes, you can add a custom hint for your users to let them know how to crop/edit images. See this topic to learn more.