Symfony2 TranslatorListener local culture issue
I am using redirection from symfony 1 to symfony 2.6.9 with authenticated user. The db is the same. I am using sf1 action to set the web page culture. In sf2 controller I can get the correct culture via
$culture = $this->getRequest()->getLocale()
but the translator instance uses the default variable.
here are the kernel.request event listeners from app/console debug:event-dispatche kernel.request
:
| #1 | NelmioCorsBundleEventListenerCorsListener::onKernelRequest()
| #2 | SymfonyComponentHttpKernelEventListenerDebugHandlersListener::configure()
| #3 | SymfonyComponentHttpKernelEventListenerProfilerListener::onKernelRequest()
| #4 | SymfonyBundleFrameworkBundleEventListenerSessionListener::onKernelRequest()
| #5 | SymfonyComponentHttpKernelEventListenerRouterListener::onKernelRequest()
| #6 | SymfonyComponentHttpKernelEventListenerLocaleListener::onKernelRequest()
| #7 | FOSRestBundleEventListenerBodyListener::onKernelRequest()
| #8 | SymfonyComponentHttpKernelEventListenerTranslatorListener::onKernelRequest()
| #9 | SymfonyComponentSecurityHttpFirewall::onKernelRequest()
| #10 | SymfonyBundleAsseticBundleEventListenerRequestListener::onKernelRequest()
| #11 | NelmioApiDocBundleEventListenerRequestListener::onKernelRequest()
Please any idea.
链接地址: http://www.djcxy.com/p/54002.html