From 782bb147af1cb826afceec02509ceed3a45fe853 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 24 Mar 2021 17:20:02 +0100 Subject: [PATCH] add translations --- .../Account/PasswordRequestEventSubscriber.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/EventSuscriber/Account/PasswordRequestEventSubscriber.php b/core/EventSuscriber/Account/PasswordRequestEventSubscriber.php index bee5664..5799abb 100644 --- a/core/EventSuscriber/Account/PasswordRequestEventSubscriber.php +++ b/core/EventSuscriber/Account/PasswordRequestEventSubscriber.php @@ -20,17 +20,20 @@ class PasswordRequestEventSubscriber implements EventSubscriberInterface protected UrlGeneratorInterface $urlGenerator; protected EntityManager $entityManager; protected TokenGeneratorInterface $tokenGenerator; + protected TranslatorInterface $translator; public function __construct( MailNotifier $notifier, UrlGeneratorInterface $urlGenerator, EntityManager $entityManager, - TokenGeneratorInterface $tokenGenerator + TokenGeneratorInterface $tokenGenerator, + TranslatorInterface $translator ) { $this->notifier = $notifier; $this->urlGenerator = $urlGenerator; $this->entityManager = $entityManager; $this->tokenGenerator = $tokenGenerator; + $this->translator = $translator; } public static function getSubscribedEvents() @@ -49,7 +52,7 @@ class PasswordRequestEventSubscriber implements EventSubscriberInterface $this->entityManager->update($user); $this->notifier - ->setSubject('Mot de passe perdu') + ->setSubject($translator->trans('Mot de passe perdu')) ->addRecipient($user->getEmail()) ->notify('@Core/mail/account/resetting_request.html.twig', [ 'reseting_update_link' => $this->urlGenerator->generate(