fix issue with translation domain#6523
Conversation
| {% 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.
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.
Ah wait. It can be null... changing it
There was a problem hiding this comment.
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.
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.
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