Skip to content

Fix inline table collection translation domain#6401

Merged
VincentLanglet merged 1 commit intosonata-project:3.xfrom
EmmanuelVella:patch-26
Sep 27, 2020
Merged

Fix inline table collection translation domain#6401
VincentLanglet merged 1 commit intosonata-project:3.xfrom
EmmanuelVella:patch-26

Conversation

@EmmanuelVella
Copy link
Copy Markdown
Contributor

@EmmanuelVella EmmanuelVella commented Sep 21, 2020

Subject

Currently, inline table / tabs collection labels will get the translation domain in this order :

  • the admin one
  • if it's empty, the field options one.

I think it should be the opposite ? Check the option first, and fallback to the admin.

I am targeting this branch, because it's a bugfix.

Changelog

### Fixed
- Fixed incorrect inline table / tabs collection translation domain

VincentLanglet
VincentLanglet previously approved these changes Sep 22, 2020
@VincentLanglet VincentLanglet requested a review from a team September 22, 2020 09:54
jordisala1991
jordisala1991 previously approved these changes Sep 22, 2020
@EmmanuelVella
Copy link
Copy Markdown
Contributor Author

Sorry guys, I just added the same fix for tabs !

Before
image

After
image

VincentLanglet
VincentLanglet previously approved these changes Sep 22, 2020
@phansys phansys added the patch label Sep 22, 2020
@VincentLanglet
Copy link
Copy Markdown
Member

Please take a new look @phansys :)

{% 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) %}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first sight, there is no other variable using camel case in this file, excepting this property:

sonata_admin.field_description.associationadmin.formfielddescriptions[field_name].translationDomain

@VincentLanglet VincentLanglet merged commit d71c4f5 into sonata-project:3.x Sep 27, 2020
@VincentLanglet
Copy link
Copy Markdown
Member

Thanks ! @EmmanuelVella

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants