Issue Feature New Orphaned

#108237Make Make f:form.select options localizable

Lina Wolf 11/21/25, 07:09 updated 04/21/26, 11:23

Description

If I am working with an enum for select options I currently have to do something like the following to localize the label:

public function getLabel(): string
    {
        return $GLOBALS['LANG']->sL('LLL:EXT:my_extension/Resources/Private/Language/locallang.xlf:gender.'.$this->name);
    }

It would be great if the f:form.select could detect the LLL prefix and localize the strings so I can simply do

public function getLabel(): string
    {
        return LLL:EXT:my_extension/Resources/Private/Language/locallang.xlf:gender.'.$this->name;
    }

And not use the global in the enum.

With the new language domain we could even pass a domain for the localizations to the select viewHelper:


<f:form.select
        class="form-control select"
        id="gender"
        options="{genderOptions}"
        property="user.gender"
        prependOptionLabel="choose"
        prependOptionValue=""
        domain="my_extension.labels.gender"
/>

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Fix this issue

Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch

Commit message
[FEATURE] Make Make f:form.select options localizable Resolves: #108237 Releases: main