[TYPO3-dev] Extbase localization in CLI mode

Viktor Livakivskyi invisible.kinder at gmail.com
Wed Jul 23 15:58:00 CEST 2014


Hi, Caspar 

> I was working with locallang-xlf files in cli mode a few days ago and I
> found, that they are respecting $GLOBALS['BE_USER']->uc['lang'] within
> backend context.
> 
> But within the query settings I have not found any similar. The function
> initializeObject() [1] of the query settings just looks for frontend
> language values, $GLOBALS['TSFE'] or GeneralUtility::_GP('L')
> 
> Maybe you have to set GeneralUtility::_GETset($language, 'L') at the
> beginning of your script.

Woah! You were absolutely right with your suggestion. This is non-obvious logic, but it helps to 'simulate' FE.

Another thing that we've found, thanks to your suggestion, is that we had to make instance of TypoScriptFrontendController and set ->sys_language_mode to 'strict', becasue we have this in our FE TS and we don't need to get non-translated records.
This even more looks like a hack.


> I think this could be defined as a bug ...
I agree. Created one [1]

Thank you and best regards.

[1] https://forge.typo3.org/issues/60501



More information about the TYPO3-dev mailing list