Skip to content

DataCollectorTranslator::getFallbackLocales() return empty array #23248

Closed
@steevanb

Description

@steevanb
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.2.9

Hi !

When i call $container->get('translator')->getFallbackLocales(), in dev environment, i get an empty array.
I have to call $container->get('translator.default')->getFallbackLocales() to really get fallback.

Problem is here : https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Translation/DataCollectorTranslator.php#L100
I have a LoggingTranslator instance, not Translator.
We can't change instanceof Translator by instanceof TranslatorInterface, cause TranslatorInterface do not define getFallbackLocales().

I don't know how to fix it ...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions