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

Franz Holzinger franz at fholzinger.com
Tue Sep 16 11:14:02 CEST 2008


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.

- Franz


More information about the TYPO3-team-core mailing list