Project

General

Profile

Actions

Bug #92797

closed

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

Added by Mati Sediqi almost 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-11-08
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

Actions

Also available in: Atom PDF