-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix issue with translation domain #6523
Conversation
@@ -26,8 +26,7 @@ file that was distributed with this source code. | |||
{% if nested_field.vars.translation_domain is same as(false) %} | |||
{{ nested_field.vars.label }} | |||
{% else %} | |||
{% set translationDomain = nested_field.vars.translation_domain|default(nested_field.vars['sonata_admin'].admin.translationDomain) %} |
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.
Is there some way that nested_field.vars['sonata_admin'].admin.translationDomain
was actually used as the translation domain?
if nested_field.vars.translation_domain
is false
then its the above if block anyway?
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.
Ah wait. It can be null
... changing it
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.
Previously the #6401 PR, it was:
nested_field.vars['sonata_admin'].admin.translationDomain|default(nested_field.vars.translation_domain)
Which mean it was used. And when it wasn't defined (like in your case) nested_field.vars.translation_domain
was used instead.
The PR (with the bug), swap the default value.
I would say that if nested_field.vars.translation_domain
is null
it will fallback to nested_field.vars['sonata_admin'].admin.translationDomain
, which is not a bad thing.
But if both nested_field.vars.translation_domain
is null
and nested_field.vars['sonata_admin'].admin.translationDomain
is not defined ; what should we do ?
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.
if both are not available then we use null
as the domain. The Symfony translator should handle it properly and use the default domain I think?
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.
Seems like the right solution indeed.
Thank you @dmaicher |
Subject
I am targeting this branch, because it fixes a bug introduced in 3.77.0 (#6401).
Closes #6522
Changelog