EasyCorp / EasyCorp/EasyAdminBundle

Nested Enum Labels do not translate

Open
#7,787 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
4.3k
Forks
1.1k
Avg merge
8d 2h
Merged PRs (30d)
11

Description

Describe the bug
When you got a ChoiceField that accesses an enum that implements the TranslatableInterface on a nested entity the label will not get translated in index/detail view.

To Reproduce

ChoiceField('foo.bar')->setChoices(Bar::cases()) where Bar is a string backed enum implementing TranslatableInterface

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ChoiceField('foo.bar') entry point and reproduce the issue using a nested entity whose string-backed Bar enum implements TranslatableInterface. Trace how labels are resolved for index and detail views; done means the enum labels are translated there as they are for non-nested fields.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, symfony
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
56/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.