welsh language updated for errors on uploads

This commit is contained in:
2025-02-03 11:54:27 +00:00
parent c82732c46d
commit 5cadd05364
7 changed files with 32 additions and 7 deletions
@@ -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
+9 -3
View File
@@ -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