From 65a90e9c9a2dc13469455b2e5d55faf7384d7eac Mon Sep 17 00:00:00 2001 From: Ani Date: Wed, 17 Jul 2024 14:49:52 +0300 Subject: [PATCH] Translate error message for Sum field on Admin/Transfer (#1871) * Translate error message on Admin - Transfer * Add spacing between the buttons and page footer --------- Co-authored-by: ani-kalpachka --- public/locales/bg/validation.json | 3 ++- public/locales/en/validation.json | 3 ++- src/components/admin/transfers/CreateForm.tsx | 4 ++-- src/components/common/form/AcceptPrivacyPolicyField.tsx | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/public/locales/bg/validation.json b/public/locales/bg/validation.json index ffc4e1361..c622f3f91 100644 --- a/public/locales/bg/validation.json +++ b/public/locales/bg/validation.json @@ -21,5 +21,6 @@ "unique-field-violation": "Полето `{1}` със тази стойност вече съществува в платформата.", "payment-reference": "Невалиден формат на кода за плащане", "eik-invalid": "Невалидно ЕИК", - "help-us-improve": "Съгласявам се да се свържете с мен за подобрение на платформата." + "help-us-improve": "Съгласявам се да се свържете с мен за подобрение на платформата.", + "positive-amount": "Сумата трябва да е положително число." } diff --git a/public/locales/en/validation.json b/public/locales/en/validation.json index dc846a346..a45665812 100644 --- a/public/locales/en/validation.json +++ b/public/locales/en/validation.json @@ -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." } diff --git a/src/components/admin/transfers/CreateForm.tsx b/src/components/admin/transfers/CreateForm.tsx index ae923ff96..e72aac80a 100644 --- a/src/components/admin/transfers/CreateForm.tsx +++ b/src/components/admin/transfers/CreateForm.tsx @@ -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(), @@ -116,7 +116,7 @@ export default function CreateForm({ campaigns }: Props) { onSubmit={handleSubmit} initialValues={initialValues} validationSchema={validationSchema}> - + {t('form-heading')} diff --git a/src/components/common/form/AcceptPrivacyPolicyField.tsx b/src/components/common/form/AcceptPrivacyPolicyField.tsx index 5448a1123..b3226c0aa 100644 --- a/src/components/common/form/AcceptPrivacyPolicyField.tsx +++ b/src/components/common/form/AcceptPrivacyPolicyField.tsx @@ -17,7 +17,7 @@ export default function AcceptPrivacyPolicyField({ name }: AcceptGDPRFieldProps) label={ {t('validation:informed-agree-with')}{' '} - {t('validation:gdpr')}. + {t('validation:gdpr')} } />