Skip to content
Snippets Groups Projects
Commit 52a1e1a9 authored by Sebastien's avatar Sebastien
Browse files

Merge branch 'tuleap-114-add-translation-for-registration-email-verified-flash-message' into 'main'

Fix registration email verified flash message translation

See merge request !28
parents 23b7c282 aed3245d
No related branches found
No related tags found
1 merge request!28Fix registration email verified flash message translation
Pipeline #643 passed
......@@ -15,6 +15,7 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Mime\Address;
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Contracts\Translation\TranslatorInterface;
use SymfonyCasts\Bundle\VerifyEmail\Exception\VerifyEmailExceptionInterface;
class RegistrationController extends AbstractController
......@@ -86,7 +87,8 @@ class RegistrationController extends AbstractController
*/
public function verifyUserEmail(
Request $request,
UserRepository $userRepository
UserRepository $userRepository,
TranslatorInterface $translator
): Response {
$id = $request->get('id');
......@@ -109,7 +111,10 @@ class RegistrationController extends AbstractController
return $this->redirectToRoute('app_register');
}
$this->addFlash('success', 'Your email address has been verified.');
$this->addFlash(
'email_verified_success',
$translator->trans('registration.email_verified_success')
);
return $this->redirectToRoute('app_login');
}
......
......
......@@ -9,8 +9,8 @@
{% if error %}
<div class="alert alert-danger col-6 m-auto">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
{% endif %}
{% for flashMessage in app.flashes('success') %}
<div class="alert alert-warning col-6 m-auto" role="alert" >{{ flashMessage }}</div>
{% for flashMessage in app.flashes('email_verified_success') %}
<div class="text-center alert alert-warning col-6 m-auto" role="alert" >{{ flashMessage }}</div>
{% endfor %}
<div class="form-group d-flex flex-column m-auto mb-4 mt-4 col-6">
......
......
......@@ -18,8 +18,8 @@ registration:
captcha: Captcha
agreeTerms: Accept terms and conditions
register: Register
email_verified_success: Your email address has been verified
#RESET PASSWORD
reset_password:
title: Reset your password
new_password: New password
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment