Skip to content

Commit

Permalink
Translate error message for Sum field on Admin/Transfer (#1871)
Browse files Browse the repository at this point in the history
* Translate error message on Admin - Transfer

* Add spacing between the buttons and page footer

---------

Co-authored-by: ani-kalpachka <[email protected]>
  • Loading branch information
ani-kalpachka and ani-kalpachka authored Jul 17, 2024
1 parent 3e7dab5 commit 65a90e9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion public/locales/bg/validation.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
"unique-field-violation": "Полето `{1}` със тази стойност вече съществува в платформата.",
"payment-reference": "Невалиден формат на кода за плащане",
"eik-invalid": "Невалидно ЕИК",
"help-us-improve": "Съгласявам се да се свържете с мен за подобрение на платформата."
"help-us-improve": "Съгласявам се да се свържете с мен за подобрение на платформата.",
"positive-amount": "Сумата трябва да е положително число."
}
3 changes: 2 additions & 1 deletion public/locales/en/validation.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
"unique-field-violation": "The field `{1}` with this value already exists in the platform.",
"payment-reference": "Invalid payment code format",
"eik-invalid": "Invalid EIK",
"help-us-improve": "I agree to be contacted to help improve the platform."
"help-us-improve": "I agree to be contacted to help improve the platform.",
"positive-amount": "The amount must be a positive number."
}
4 changes: 2 additions & 2 deletions src/components/admin/transfers/CreateForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default function CreateForm({ campaigns }: Props) {
return value ? value < Number(fromMoney(currentAmount)) : false
},
}),
otherwise: yup.number().positive().integer().required(),
otherwise: yup.number().positive('validation:positive-amount').integer().required(),
}),
reason: yup.string().trim().min(1).max(300).required(),
documentId: yup.string().uuid().notRequired().nullable(),
Expand Down Expand Up @@ -116,7 +116,7 @@ export default function CreateForm({ campaigns }: Props) {
onSubmit={handleSubmit}
initialValues={initialValues}
validationSchema={validationSchema}>
<Box>
<Box mb={5}>
<Typography variant="h5" component="h2" sx={{ marginBottom: 2, textAlign: 'center' }}>
{t('form-heading')}
</Typography>
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/form/AcceptPrivacyPolicyField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function AcceptPrivacyPolicyField({ name }: AcceptGDPRFieldProps)
label={
<Typography variant="body2">
{t('validation:informed-agree-with')}{' '}
<ExternalLink href={routes.privacyPolicy}>{t('validation:gdpr')}</ExternalLink>.
<ExternalLink href={routes.privacyPolicy}>{t('validation:gdpr')}</ExternalLink>
</Typography>
}
/>
Expand Down

0 comments on commit 65a90e9

Please sign in to comment.