'Get currently selected language of backend user in TYPO3

In a PHP function in the Backend context, I would like to determine the currently selected language of the BE user.

In my use case, the editor chooses from a list of values (generated by an itemsProcFunc) in a Flexform. The values are localized.

Example:

This is the flexform output:

enter image description here

The labels which are displayed in the multi-select box are created dynamically in an itemsProcFunc and should be displayed in English, if the user's preferred language in the backend is English.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source