Skip to content

[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

Merged
merged 1 commit into from
Sep 27, 2019

Conversation

digilist
Copy link
Contributor

@digilist digilist commented Aug 4, 2019

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.

@ro0NL
Copy link
Contributor

ro0NL commented Aug 4, 2019

would it be useful to keep this information under e.g. fallback_locale for this state? And adjust the table to show both in this case.

To further clarify i think the panel title should be Default locale actually

@digilist
Copy link
Contributor Author

That's a good idea and I made the adjustments :)

@digilist digilist force-pushed the profiler_fallback_locale branch from 29f6749 to d369be8 Compare August 11, 2019 12:34
Copy link
Contributor

@ro0NL ro0NL left a 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 👍

@fabpot fabpot force-pushed the profiler_fallback_locale branch from d369be8 to 5564e14 Compare September 27, 2019 05:57
@fabpot
Copy link
Member

fabpot commented Sep 27, 2019

Thank you @digilist.

fabpot added a commit that referenced this pull request Sep 27, 2019
…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
@fabpot fabpot merged commit 5564e14 into symfony:3.4 Sep 27, 2019
This was referenced Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants