From 6fa4be38eb1b42a224b1649736c16b8d4b44d66a Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 8 Feb 2016 22:49:17 +0100 Subject: fix labels on new user prompt fix tests nl add translation validation length --- src/Wallabag/CoreBundle/Form/Type/NewUserType.php | 3 +++ src/Wallabag/CoreBundle/Resources/translations/validators.fr.yml | 3 +++ src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 src/Wallabag/CoreBundle/Resources/translations/validators.fr.yml (limited to 'src') diff --git a/src/Wallabag/CoreBundle/Form/Type/NewUserType.php b/src/Wallabag/CoreBundle/Form/Type/NewUserType.php index ffbe9ba2..d8bde17e 100644 --- a/src/Wallabag/CoreBundle/Form/Type/NewUserType.php +++ b/src/Wallabag/CoreBundle/Form/Type/NewUserType.php @@ -20,6 +20,9 @@ class NewUserType extends AbstractType ->add('username', TextType::class, array('required' => true)) ->add('plainPassword', RepeatedType::class, array( 'type' => PasswordType::class, + 'invalid_message' => 'The password fields must match', + 'first_options' => array('label' => 'Password'), + 'second_options' => array('label' => 'Repeat new password'), 'constraints' => array( new Constraints\Length(array( 'min' => 8, diff --git a/src/Wallabag/CoreBundle/Resources/translations/validators.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/validators.fr.yml new file mode 100644 index 00000000..40513f2a --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/translations/validators.fr.yml @@ -0,0 +1,3 @@ +# Config screen +The password fields must match: 'Les deux mots de passe doivent être les mêmes' +Password should by at least 8 chars long: 'Le mot de passe doit contenir au moins 8 caractères' diff --git a/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php index c8807425..6c370a2d 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php @@ -293,7 +293,7 @@ class ConfigControllerTest extends WallabagCoreTestCase 'new_user[plainPassword][second]' => 'mypassword2', 'new_user[email]' => 'wallace@wallace.me', ), - 'This value is not valid', + 'The password fields must match', ), ); } -- cgit v1.2.3