From: Thomas Citharel Date: Mon, 8 Feb 2016 21:49:17 +0000 (+0100) Subject: fix labels on new user prompt X-Git-Tag: 2.0.0-beta.1~42^2 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=6fa4be38eb1b42a224b1649736c16b8d4b44d66a;hp=ae5b37ef2e52c06182bc6edb14f6b3aae381ddb4;p=github%2Fwallabag%2Fwallabag.git fix labels on new user prompt fix tests nl add translation validation length --- 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', ), ); }