-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
DataCollectorTranslator::getFallbackLocales() return empty array #23248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
see #23250 |
hm i still don't see why it does look for specially Translator and why TranslatorInterface can't be extended to use getFallbackLocales :/ |
@Hanmac Adding a new method to an interface would break any implementation that is not already implementing this method, adding a new interface extending the TranslatorInterface one is possible, but that needs to be discussed beforehand (in a dedicated issue) . |
Adding a new method to an interface is a BC as all implementations would need to be adapted. That's why we cannot do so. |
Thanks ! |
…abbuh) 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 ------- 3c21650 return fallback locales whenever possible
Just a question : |
@steevanb from time to time we merge from lower branches to higher branches. So your PR will be merged "soon" to the upper branches too. |
Ok, thanks ! |
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, notTranslator
.We can't change
instanceof Translator
byinstanceof TranslatorInterface
, causeTranslatorInterface
do not definegetFallbackLocales()
.I don't know how to fix it ...
The text was updated successfully, but these errors were encountered: