-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Translation] Collect original locale in case of fallback translation #32925
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
Conversation
would it be useful to keep this information under e.g. To further clarify i think the panel title should be symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig Line 76 in 5d60221
|
That's a good idea and I made the adjustments :) |
src/Symfony/Component/Translation/Tests/DataCollectorTranslatorTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig
Outdated
Show resolved
Hide resolved
29f6749
to
d369be8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
im for 3.4 👍
d369be8
to
5564e14
Compare
Thank you @digilist. |
…translation (digilist) This PR was squashed before being merged into the 3.4 branch (closes #32925). Discussion ---------- [Translation] Collect original locale in case of fallback translation Before, it collected the fallback locale that was used to translate a key. But this information is confusing, as it does not reveal which translation key is missing in the requested language. So I'd like to propose to track the "requested" locale instead, so that the Symfony profiler gives me the information in which locale the key is missing instead of which locale was used as a fallback. | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | yes? | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | In principle, this change is a BC break, but imho also a bug. It's really confusing when the Profiler tells you that it uses a translation fallback for an ID and locale that is actually translated. Took some debugging so recognize that this fallback came from another locale. If you think it's better to target 5.0, I'll update the PR. Commits ------- 5564e14 [Translation] Collect original locale in case of fallback translation
Before, it collected the fallback locale that was used to translate a key. But this information is confusing, as it does not reveal which translation key is missing in the requested language.
So I'd like to propose to track the "requested" locale instead, so that the Symfony profiler gives me the information in which locale the key is missing instead of which locale was used as a fallback.
In principle, this change is a BC break, but imho also a bug. It's really confusing when the Profiler tells you that it uses a translation fallback for an ID and locale that is actually translated. Took some debugging so recognize that this fallback came from another locale. If you think it's better to target 5.0, I'll update the PR.