diff --git a/src/Form/ChangePasswordFormType.php b/src/Form/ChangePasswordFormType.php index 419fe5e44d38ec2a92c71ba0f1be2bed7f6bb49c..287894d36ddf712b82909a9925d9fe7d8df5a34d 100644 --- a/src/Form/ChangePasswordFormType.php +++ b/src/Form/ChangePasswordFormType.php @@ -21,22 +21,22 @@ class ChangePasswordFormType extends AbstractType 'attr' => ['autocomplete' => 'new-password'], 'constraints' => [ new NotBlank([ - 'message' => 'Please enter a password', + 'message' => 'password.not_blank', ]), new Length([ 'min' => 6, - 'minMessage' => 'Your password should be at least {{ limit }} characters', + 'minMessage' => 'password.min_characters', // max length allowed by Symfony for security reasons 'max' => 4096, ]), ], - 'label' => 'New password', + 'label' => 'reset_password.new_password', ], 'second_options' => [ 'attr' => ['autocomplete' => 'new-password'], - 'label' => 'Repeat Password', + 'label' => 'reset_password.repeat_password', ], - 'invalid_message' => 'The password fields must match.', + 'invalid_message' => 'password.match', // Instead of being set onto the object directly, // this is read and encoded in the controller 'mapped' => false, diff --git a/src/Form/RegistrationFormType.php b/src/Form/RegistrationFormType.php index 9a8fa839d3bbb4b06d4fbb2bdeea3fbae55c70c2..cabe1d492809ef7bcba2a2f9e6e480641f0bb15c 100644 --- a/src/Form/RegistrationFormType.php +++ b/src/Form/RegistrationFormType.php @@ -62,7 +62,7 @@ class RegistrationFormType extends AbstractType ], 'first_options' => ['label' => 'registration.password.first'], 'second_options' => ['label' => 'registration.password.second'], - 'invalid_message' => 'invalid_message' + 'invalid_message' => 'password.match' ]) ->add( 'captcha', diff --git a/src/Form/ResetPasswordRequestFormType.php b/src/Form/ResetPasswordRequestFormType.php index 939ea5ff0e11e9b0af6ffc1e355da79b39ee79f7..706ba84e8ca214659f4fe4590029af2323428d64 100644 --- a/src/Form/ResetPasswordRequestFormType.php +++ b/src/Form/ResetPasswordRequestFormType.php @@ -17,9 +17,10 @@ class ResetPasswordRequestFormType extends AbstractType 'attr' => ['autocomplete' => 'email'], 'constraints' => [ new NotBlank([ - 'message' => 'Please enter your email', + 'message' => 'email.not_blank', ]), ], + 'label' => 'reset_password.email' ]) ; } diff --git a/translations/messages.en.yaml b/translations/messages.en.yaml index c5f2227ba1793f5f5c15bf9d6b8be01feeea696d..9cb783643734136adcd6ba951c0cf61d4d841432 100644 --- a/translations/messages.en.yaml +++ b/translations/messages.en.yaml @@ -10,4 +10,9 @@ registration: second: Repeat Password captcha: Captcha agreeTerms: Accept terms and conditions - register: Register \ No newline at end of file + register: Register + +reset_password: + email: Email + repeat_password: Repeat password + new_password: New password \ No newline at end of file diff --git a/translations/validators.en.yaml b/translations/validators.en.yaml index 2ca8f82af4b6db0d38e37b62a60f5da40a200cf7..838756d97feb6a639a2f08379a591b77f0860469 100644 --- a/translations/validators.en.yaml +++ b/translations/validators.en.yaml @@ -10,7 +10,6 @@ email: password: not_blank: Please enter your password min_characters: Your password should be at least {{ limit }} characters + match: The password fields must match. -invalid_message: The password fields must match - -agreeTerms: You must agree with our terms +agreeTerms: You must agree with our terms \ No newline at end of file