title: Locale switch in login of FOSUserBundle
body: <p>I'm trying to get locale switching to work in the login screen of my application. In order to do that I have links on my login page that point to site.com/ (the default locale) and site.com/en (the second locale I support). As soon as I've logged in, the switching works like a charm. However if I'm not yet authenticated the login always goes back to the default locale. My understanding was that if I use the named routes from FOSUserBundle then it's should be able to handle the locales automatically, but I can't get it to work.</p>
  
  <p>My app/config/security.yml</p>
  
  <pre><code>security:
      encoders:
          FOS\UserBundle\Model\UserInterface: sha512
  
      role_hierarchy:
          ROLE_ADMIN:       ROLE_USER
          ROLE_SUPER_ADMIN: ROLE_ADMIN
  
      providers:
          fos_userbundle:
              id: fos_user.user_provider.username
  
      firewalls:
          main:
              pattern: ^/
              form_login:
                  provider: fos_userbundle
                  csrf_provider: form.csrf_provider
                  login_path: fos_user_security_login
                  check_path: fos_user_security_check
              logout:       true
              anonymous:    true
  
      access_control:
          - { path: ^/_wdt, roles: IS_AUTHENTICATED_ANONYMOUSLY }         # allow wdt for debugging
          - { path: ^/_profiler/, role: IS_AUTHENTICATED_ANONYMOUSLY }    # allow profiler for debugging
          - { path: ^/bundles/, role: IS_AUTHENTICATED_ANONYMOUSLY }      # allow assets to be loaded anonymously
  
          - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
          - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
          - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
          - { path: ^/admin, role: ROLE_ADMIN }
          - { path: ^/, role: ROLE_USER } 
  </code></pre>
  
  <p>My app/config/routing.yml</p>
  
  <pre><code># FOS User bundle
  fos_user_security:
      resource: "@FOSUserBundle/Resources/config/routing/security.xml"
  
  fos_user_profile:
      resource: "@FOSUserBundle/Resources/config/routing/profile.xml"
      prefix: /profile
  
  #fos_user_register:
  #    resource: "@FOSUserBundle/Resources/config/routing/registration.xml"
  #    prefix: /register
  
  fos_user_resetting:
      resource: "@FOSUserBundle/Resources/config/routing/resetting.xml"
      prefix: /resetting
  
  fos_user_change_password:
      resource: "@FOSUserBundle/Resources/config/routing/change_password.xml"
      prefix: /profile
  </code></pre>
  
  <p>Any pointers much appreciated as I've been stuck with this for a couple of days now</p>