更新后symfony twig翻译不起作用

I upgraded my project from 2.5.x to 2.8.1 and suddenly twig is not using the correct translations anymore.

In the twig template i have something like this: {% trans %}something.abc{% endtrans %}

my config.yml looks like this:

...
framework:
    translator:      ~
...
templating:
    engines: ['twig']
default_locale:  en_US

in Controller action:

$request->setLocale('nl_BE');

The page is always showing the en_US translation and never something else.

Did something change?

It is because the TranslatorListener (which was added in 2.6) sets the locale before the action is called in your controller. Use $this->get('translator')->setLocale('nl_BE'); instead, if you want to change the locale in your controller.