Issue Bug Closed

#92797Context API - Get the backend.user in TCA not possible. Bug?

Mati Sediqi 11/08/20, 13:46 updated 05/29/21, 23:10

Description

Hey there,

I was playing around recently with the new Context API introduced in TYPO3 9.4 (feature #85389) on a 10.4.9 installation.
I’ve noticed that I can’t access the backend.user inside TCA (to be specific, in /Configuration/TCA/Overrides/pages.php) – I guess it’s due to caching of it..

The use-case why I need it is because I want to make an own Localization-Service which is inspired by Laravel.
They got like a folder structure as a global lang-directory which looks like:
- /lang/en/tt_content.json
- /lang/de/tt_content.json

and so on – also possible IIRC to leave .php-files – if not, it’d be easy anyways to implement that, which I’ve done so far.
This way it’d be a, personally, better overview instead of using the .xliff-files which is a mess of unnecessary XML-tags etc. for translations. Also it’s more flexible and you can call it using a global-helper function called “__(‘key’)” – of course that can be changed in TYPO3.

So back to the topic of this issue; is it actually at all possible to get the current backend.user – mainly for the purpose to fetch its current language UID in order to get the current language by the UID (e.g. 0 => “english” while “english” is mapped to “en”, 1 => “deutsch” while “deutsch” is mapped to “de” etc) – or getting the User-Configuration by the current BE user, both would be helpful.

I hope I’ve clarified everything so far, feel free to ask anything about it.

Best regards,
Mati

Reviews 0

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