[TYPO3-dev] GLOBALS['LANG'] and MacOs

Christian Trabold trabold at mehrwert.de
Fri Nov 24 12:03:00 CET 2006


Hi Toke,
Hi Martin,

> Yes but why use the sL format, if we are going to split it any way, easier to just send a sl(sl-index)
> The difference in the code is somthing like:
> 
> $llkey = explode(':' $TCA['label']);
> T3lib_div::readLLfile($llkey[2], $GLOBALS['TSFE']->lang);
> ...->getLL($llkey[3]);
> 
> Or
> 
> $lang->sl($TCA['label']);

I don't get it, why you use "$TCA['label']" here, sorry.


> I tried to Use the GLOABAL $LANG which is a BE object.

To sum this thread up:

- Use "$GLOBALS['TSFE']->sL()" to get specific language labels from 
other extensions in FE.

Example with extension 'lang':

   $GLOBALS['TSFE']->sL('LLL:EXT:lang/locallang_tca.php:title')


Hint 1: The following approach will not work, because $TCA is not fully 
accessible in FE:

   $GLOBALS['TSFE']->sL($TCA['pages']['columns']['title']['label'])


Hint 2: If you want to get all language labels of an extension, this 
example could help out:

   $extLL = $GLOBALS['TSFE']->readLLfile(t3lib_extMgm::extPath('lang') 
.'locallang_tca.xml')
   $GLOBALS['TSFE']->getLLL('title', $extLL);


Hint 3: You do NOT have to call t3lib_div::readLLfile() by your own - 
use the global objects provided by TYPO3.

Thanks Martin for pointing to TSFE-sL()! ;-)



- Use "$LANG->sL()" or "$LANG->getLL" to get language labels in BE (as 
described in "Inside TYPO3" [1]).


Right?


Greetings

Christian


[1] 
http://typo3.org/documentation/document-library/core-documentation/doc_core_inside/current/view/3/8/#id2806984




More information about the TYPO3-dev mailing list