merged branch mageekguy/master (PR #4725)

Commits
-------

6155583 Remove bug in locale management in listener.

Discussion
----------

Remove bug in locale listener
This commit is contained in:
Fabien Potencier 2012-07-03 16:27:02 +02:00
commit 480323c4e9

View File

@ -69,7 +69,7 @@
* [BC BREAK] The current locale for the user is not stored anymore in the session
You can simulate the old behavior by registering a listener that looks like the following:
You can simulate the old behavior by registering a listener that looks like the following, if the paramater which handle locale value in the request is `_locale`:
```
namespace XXX;
@ -95,7 +95,7 @@
}
if ($locale = $request->attributes->get('_locale')) {
$request->getSession()->set('_locale', $request->getLocale());
$request->getSession()->set('_locale', $locale);
} else {
$request->setDefaultLocale($request->getSession()->get('_locale', $this->defaultLocale));
}