merged branch vlechemin/ticket_3472 (PR #3473)

Commits
-------

ab47a88 [FrameworkBundle][Translator] Fix test for request being available in order to get the locale.

Discussion
----------

[FrameworkBundle][Translator] Fix test for request being available.

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3472
Todo: -
This commit is contained in:
Fabien Potencier 2012-06-27 20:31:58 +02:00
commit e8c0e07841

View File

@ -65,7 +65,7 @@ class Translator extends BaseTranslator
*/
public function getLocale()
{
if (null === $this->locale && $this->container->has('request')) {
if (null === $this->locale && $this->container->isScopeActive('request')) {
$this->locale = $this->container->get('request')->getLocale();
}