symfony/symfony — pull request #8788 by bschussek (2013-08-19 10:19:26+00:00)
Title: [Validation] Fixed IdentityTranslator to pass correct Locale to MessageSelector

| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -

This PR fixes the following case:

```php
\Locale::setDefault('en');
$translator = new IdentityTranslator(new MessageSelector());

echo $translator->transChoice('There is one apple|There are %count% apples', 10, array('%count' => 10));
```

Result before PR:

```
There are 1 apples
```

Result after PR:

```
There is one apple
```

The reason for the current behavior is that the locale `null` is passed to `MessageSelector`, but `MessageSelector` is not programmed to accept `null` values.