title: change locale symfony 2.3
body: <p>I just began with symfony
  I'm trying to build a multilang website but I have a problem to change the locale</p>
  
  <p>I read some posts and I read the documentation about this but the locale don't change, I try:</p>
  
  <pre><code>public function indexAction()
  {    
      $this-&gt;get('session')-&gt;set('_locale', 'fr');
  
      $request = $this-&gt;getRequest();
      $locale = $request-&gt;getLocale();
      return $this-&gt;render('PhoneMainBundle:Default:index.html.twig',array('locale'=&gt;$locale));
  }
  </code></pre>
  
  <p>but the value in $locale is always 'en' (my default locale)</p>
  
  <p>I also try</p>
  
  <pre><code>public function indexAction()
  {    
      $this-&gt;get('session')-&gt;set('_locale', 'fr');
  
      $request = $this-&gt;getRequest();
      $request-&gt;setLocale('fr');
      $locale = $request-&gt;getLocale();
  
      return $this-&gt;render('PhoneMainBundle:Default:index.html.twig',array('locale'=&gt;$locale));
  }
  </code></pre>
  
  <p>In this case $locale is fr but the translations are always from messages.en.yml</p>
  
  <p>I'd like in a first time to detect the user locale using $_SERVER['HTTP_ACCEPT_LANGUAGE'], maybe using a listner on each page actualisation ?</p>
  
  <p>and after I will create a route to change the locale</p>
  
  <p>But I 'd like to find a way to change the locale.</p>
  
  <p>Thanks for your help</p>