welsh language updated for errors on uploads
This commit is contained in:
@@ -1040,12 +1040,18 @@ export const RenderFileUpload = (field) => {
|
||||
.map(({ file, errors }) => {
|
||||
return errors.map((error) => {
|
||||
if (error.code === "file-too-large") {
|
||||
return `${file.name} is too large. Please upload a smaller file.`;
|
||||
return `${file.name} ${t(
|
||||
"myrepresentations:fileupload-file-error-filesize-label"
|
||||
)}`;
|
||||
}
|
||||
if (error.code === "file-invalid-type") {
|
||||
return `${file.name} has an invalid type. Please upload an image.`;
|
||||
return `${file.name} ${t(
|
||||
"myrepresentations:fileupload-file-error-invalid-type-label"
|
||||
)}`;
|
||||
}
|
||||
return `${file.name} is invalid.`;
|
||||
return `${file.name} ${t(
|
||||
"myrepresentations:fileupload-file-error-invalid-label"
|
||||
)}`;
|
||||
});
|
||||
})
|
||||
.flat(); // Flatten the errors array
|
||||
|
||||
@@ -1978,12 +1978,18 @@ const RenderFileUpload = (field) => {
|
||||
.map(({ file, errors }) => {
|
||||
return errors.map((error) => {
|
||||
if (error.code === "file-too-large") {
|
||||
return `${file.name} is too large. Please upload a smaller file.`;
|
||||
return `${file.name} ${t(
|
||||
"newappeal:new-appeal-fileupload-file-error-filesize-label"
|
||||
)}`;
|
||||
}
|
||||
if (error.code === "file-invalid-type") {
|
||||
return `${file.name} has an invalid type. Please upload an image.`;
|
||||
return `${file.name} ${t(
|
||||
"newappeal:new-appeal-fileupload-file-error-invalid-type-label"
|
||||
)}`;
|
||||
}
|
||||
return `${file.name} is invalid.`;
|
||||
return `${file.name} ${t(
|
||||
"newappeal:new-appeal-fileupload-file-error-invalid-label"
|
||||
)}`;
|
||||
});
|
||||
})
|
||||
.flat(); // Flatten the errors array
|
||||
|
||||
Reference in New Issue
Block a user