[TYPO3-core] RFC: #9346: Preinitialise GLOBALS[LANG] in init.php

Martin Kutschker masi-no at spam-typo3.org
Tue Sep 16 13:23:58 CEST 2008


Franz Holzinger schrieb:
> Hello Steffen,
> 
>> I moved initialisation to init.php direct after BE_USER authentication
>> and removed the other initialisations.
>>
>> Now we have GLOBALS[LANG] available all the time (in BE)
>> (because it isn't i declared the patch as bugfix)
> 
> Move the lines
> +require_once(PATH_typo3.'sysext/lang/lang.php');
> +$GLOBALS['LANG'] = t3lib_div::makeInstance('language');
> +$GLOBALS['LANG']->init($BE_USER->uc['lang']);
> 
> to the beginning of the file init.php.
> So the global language would be available everywhere for the future.
> At the moment the class library t3lib_div contains many error texts only
> in English. It would be fine to have them one day replaced by texts in
> multiple languages. But then no t3lib_div::makeInstance could be used,
> but the new operator. The init method might be called even later.

All messages of t3lib_div are developer orientated. The calling code
should handle errors and return appropriate messages to the end user.

Therefore I don't think that t3lib_div should require $LANG.

Masi


More information about the TYPO3-team-core mailing list