Skip to content

Fix filter labels not translated with correct domain#7520

Open
Amoifr wants to merge 1 commit intoEasyCorp:5.xfrom
Amoifr:fix_7373
Open

Fix filter labels not translated with correct domain#7520
Amoifr wants to merge 1 commit intoEasyCorp:5.xfrom
Amoifr:fix_7373

Conversation

@Amoifr
Copy link
Copy Markdown

@Amoifr Amoifr commented Mar 25, 2026

Summary

  • Filter labels were not being translated the same way as on other CRUD pages (index, edit, etc.)
  • The issue was that CommonConfigurator passed plain strings as labels, but filters use translation_domain: EasyAdminBundle
  • This caused labels like command.label.lastRunAt to be looked up in EasyAdminBundle domain instead of the application's domain

Changes:

  • Preserve TranslatableInterface labels from fields instead of extracting the message
  • Wrap string labels in t() with the application's translation domain from $context->getI18n()->getTranslationDomain()

Test plan

  • Added unit tests for CommonConfigurator
  • Tests verify that labels are wrapped in TranslatableInterface
  • Tests verify that the correct translation domain is used
  • Manual testing with custom translation keys in filters

Fix #7373

Filter labels were not being translated the same way as on other CRUD
pages because the label was passed as a plain string while filters use
translation_domain 'EasyAdminBundle'.

Now CommonConfigurator:
- Preserves TranslatableInterface labels from fields
- Wraps string labels in t() with the application's translation domain

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Filter form labels are not being translated in the same way as they are on other CRUD pages

1 participant