TYPO3 TCA select list in backend user language

2.7k views Asked by At

I build an extension that can assign a tag to an object, this is a 1:n relation to the object and the tag gets selected from a list that a simple editor cannot edit.

the admin has to supply the tags and the translations for every tag, so I was able to limit the list to the items in the default language with this TCA:

    'tag' => [
        'exclude' => 1,
        'label' => 'tag',
        'config' => [
            'type' => 'select',
            'renderType' => 'selectSingle',
            'items' => [
                ['none' , 0]
            ],
            'foreign_table' => 'tx_myextension_domain_model_tags',
            'foreign_table_where' => ' AND tx_myextension_domain_model_tags.sys_language_uid IN (-1, 0)',
            'MM' => 'tx_myextension_object_tags_mm',
            'maxitems' => 1,
            'multiple' => 0,
            'default' => 0,
        ],

    ],

but rather than the default language IN (-1, 0) i'd like to display the list in the selected language for the backend user = ###BE_user_language_uid###... is this possible ?

1

There are 1 answers

2
pgampe On BEST ANSWER

You can use ###REC_FIELD_sys_language_uid### to access the sys_language_uid field of the current record.

However it is not possible to use the language of the backend user, because frontend translation has nothing to do with backend localization.