[TYPO3-dev] Extbase localization in CLI mode

Caspar Stuebs caspar at gosign.de
Wed Jul 23 12:00:34 CEST 2014


Hi Viktor,

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.

I think this could be defined as a bug ...

Kind regards
Caspar

[1] typo3/sysext/extbase/Classes/Persistence/Generic/Typo3QuerySettings.php;
line 133ff


2014-07-22 16:36 GMT+02:00 Viktor Livakivskyi <invisible.kinder at gmail.com>:

> Crossposting this from MVC-list, since no answers for a week were given
> there. Hopefuly, DEV-list is more popular.
>
> So,
>
> Is it possible to "tell" Extbase, which language it should operate in CLI
> mode?
> The problem is in fact, that using ->setSysLanguageUid($language) on query
> settings of Repository helps, but only for 1st level object. Child objects
> are non-localized in this mode.
>
> Example:
> $languageUid = 7;
> // $parents contain correct translations (language=7)
> $parents = $parentRepository->findAll($languageUid);
> foreach($parents as $parent) {
> // $child doesn't contain correct translation (language=0)
> $child = $parent->getChild();
> }
>
> Is it possible to work in some specific language context, when in CLI mode?
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev
>

-- 
-- 

Gosign media. GmbH | We web ideas.
Langenfelder Damm 67 Gewerbehof | 22525 Hamburg
Telefon 040-609 40 79-0

Handelsregister AG HH HRB 112197 | Geschäftsführung Bert Gogolin
Greenpeace energy: Gosign läuft mit ehrlichem Strom und Gas.
GLS Bank: Gosign wirtschaftet mit Gewissen. 



More information about the TYPO3-dev mailing list