title: Forcing the Twig Locale
body: <p>I would like to use the Twig template system to template my e-mails. The locale of the e-mail should be based on a user setting, not from the session or request locale. How can I force the locale when rendering a Twig template?</p>
  
  <p>The manual does mention how <a href="http://symfony.com/doc/master/book/translation.html#forcing-the-translator-locale">to force the locale for the Translator</a>. But i'd like pass this locale to the render() method, in order to have the translations inside the twig template to be rendered in this locale.</p>
  
  <p>This is different from using <em>into</em> in the template, because I think this forces a translation inside the template in a specific locale.</p>
  
  <p>So, taking the example from Symfony, I'm looking for something like this:</p>
  
  <pre class="lang-php prettyprint-override"><code>public function indexAction($name)
  {
      $message = \Swift_Message::newInstance()
          -&gt;setSubject('Hello Email')
          -&gt;setFrom('send@example.com')
          -&gt;setTo('recipient@example.com')
          -&gt;setBody(
              $this-&gt;renderView(
                  'HelloBundle:Hello:email.txt.twig',
                  array('name' =&gt; $name),
                  'nl_NL' // &lt;-- This would be nice!
              )
          )
      ;
      $this-&gt;get('mailer')-&gt;send($message);
  
      return $this-&gt;render(...);
  }
  </code></pre>