-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Translation fallback order error #42480
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
this looks odd. Can you invalidate this test?
my guess is nobody noticed yet :) |
this test is partly correct, but is missing the point a translation non-existing primary and is existing in all subsequent parts. I would rewrite this test by:
|
This PR was squashed before being merged into the 4.4 branch. Discussion ---------- [Translation] Reverse fallback locales | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #42480 | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> <!-- Commits ------- 7cc0c36 [Translation] Reverse fallback locales
Hey, after this change, we have an issue with our application and we don't know if that new order is correct 🤔 That's like our current code: $translator = new Translator('en_GB');
$translator->setFallbackLocales(['en_GB', 'en']);
$catalogue = $translator->getCatalogue('en_GB');
$this->assertEquals('en', $catalogue->getFallbackCatalogue()->getLocale()); After this issue en_001 (taken from ICU) is preferred over the configured fallback locales. I am not very experienced with the translation stuff and ICU. Is that correct so? I would expect that the ICU stuff is appended to the locales at end and not to the beginning. |
Discussed in #42479
Originally posted by mboeck001 August 11, 2021
Hi!
There seems to be a bug in Symfony\Component\Translation computing the fallbacks in method computeFallbackLocales. Perhapes someone can confirm or correct me?
I would just change the array_unshift to a normal append operation
Did I miss something? This seams to be since a long time ...
changed line arround line 441 of Translator.php to:
removing the array_unshift operation. For me it works.
Thats also in the 4.x branch.
Martin
The text was updated successfully, but these errors were encountered: