bug #23250 [Translation] return fallback locales whenever possible (xabbuh)

This PR was merged into the 2.7 branch.

Discussion
----------

[Translation] return fallback locales whenever possible

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

Commits
-------

3c21650d9e return fallback locales whenever possible
This commit is contained in:
Fabien Potencier 2017-06-21 07:18:43 -07:00
commit 9a0d342226
2 changed files with 2 additions and 2 deletions

View File

@ -95,7 +95,7 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter
*/
public function getFallbackLocales()
{
if ($this->translator instanceof Translator) {
if ($this->translator instanceof Translator || method_exists($this->translator, 'getFallbackLocales')) {
return $this->translator->getFallbackLocales();
}

View File

@ -95,7 +95,7 @@ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface
*/
public function getFallbackLocales()
{
if ($this->translator instanceof Translator) {
if ($this->translator instanceof Translator || method_exists($this->translator, 'getFallbackLocales')) {
return $this->translator->getFallbackLocales();
}