original_string: public function setLocaleForAuthenticatedUser(InteractiveLoginEvent $event)
      {
          $user = $event->getAuthenticationToken()->getUser();
          if ($lang = $user->getLocale()) {
              $this->session->set('_locale', $lang);
          } else {
              $request = $event->getRequest();
              if ('unset' == $request->getLocale()) {
                  $this->session->set('_locale', 'en');
              }
          }
      }
code: public function setLocaleForAuthenticatedUser(InteractiveLoginEvent $event)
      {
          $user = $event->getAuthenticationToken()->getUser();
          if ($lang = $user->getLocale()) {
              $this->session->set('_locale', $lang);
          } else {
              $request = $event->getRequest();
              if ('unset' == $request->getLocale()) {
                  $this->session->set('_locale', 'en');
              }
          }
      }
code_tokens: public function setLocaleForAuthenticatedUser ( InteractiveLoginEvent $ event ) { $ user = $ event -> getAuthenticationToken ( ) -> getUser ( ) ; if ( $ lang = $ user -> getLocale ( ) ) { $ this -> session -> set ( '_locale' , $ lang ) ; } else { $ request = $ event -> getRequest ( ) ; if ( 'unset' == $ request -> getLocale ( ) ) { $ this -> session -> set ( '_locale' , 'en' ) ; } } }
docstring: security.interactive_login event. If a user chose a language in preferences, it would be set,
  if not, a locale that was set by setLocaleForUnauthenticatedUser remains.
  
  @param \Symfony\Component\Security\Http\Event\InteractiveLoginEvent $event
docstring_tokens: security . interactive_login event . If a user chose a language in preferences it would be set if not a locale that was set by setLocaleForUnauthenticatedUser remains .