3 namespace Wallabag\CoreBundle\EventListener
;
5 use Symfony\Component\HttpFoundation\Session\Session
;
6 use Symfony\Component\Security\Http\Event\InteractiveLoginEvent
;
9 * Stores the locale of the user in the session after the
10 * login. This can be used by the LocaleListener afterwards.
12 class UserLocaleListener
19 public function __construct(Session
$session)
21 $this->session
= $session;
25 * @param InteractiveLoginEvent $event
27 public function onInteractiveLogin(InteractiveLoginEvent
$event)
29 $user = $event->getAuthenticationToken()->getUser();
31 if (null !== $user->getConfig()->getLanguage()) {
32 $this->session
->set('_locale', $user->getConfig()->getLanguage());