[TYPO3-dev] includeLLFile() - force language
Martin Kutschker
Martin.Kutschker at n0spam-blackbox.net
Mon Sep 17 16:40:56 CEST 2007
Brian Bendtsen schrieb:
> Martin Kutschker skrev:
>> Brian Bendtsen schrieb:
>>> Hi
>>>
>>> Im using the function includeLLFile() in an extension like so:
>>>
>>> $LANG = t3lib_div::makeInstance('language');
>>> $LANG->includeLLFile('EXT:indmeldelse/locallang_db.xml');
>>>
>>> loop begin
>>> $LANG->getLL('tx_indmeldelse_medlem.'.$name)
>>> loop end
>>>
>>> and the labels are found but not in the right language.
>>>
>>> My language is set to danish but the english labels are used. Can I
>>> tell this function to use the danish language?
>>
>> The BE user's language:
>>
>> $LANG->init($BE_USER->uc['lang']);
>>
>> Masi
> I know I use the language file for the BE but my extension is not a
> backend extension, so no user is logged in.
Then you shouldn't use $LANG. But anyway, you can of course use any valid
language key in the call to init.
You could eg use the value of config.language:
$TSFE->config['config']['language']
Masi
More information about the TYPO3-dev
mailing list