Closed
Description
https://symfony.com/doc/master/translation/locale.html
The custom listener must be called before LocaleListener, which initializes the locale based on the current request. To do so, set your listener priority to a higher value than LocaleListener priority (which you can obtain running the debug:event kernel.request command).
And then in the linked example:
https://symfony.com/doc/master/session/locale_sticky_session.html
public static function getSubscribedEvents()
{
return array(
// must be registered after the default Locale listener
KernelEvents::REQUEST => array(array('onKernelRequest', 15)),
);
}
Documentation says (in bold) the custom listener must be registered before the framework listener, the inline doc in the example says after, which is exactly the opposite.