[TYPO3-dev] includeLLFile() - force language

Steffen Kamper steffen at sk-typo3.de
Mon Sep 17 17:47:01 CEST 2007


Hi Bernd,

$this->LLkey is not filled properly, i run in this problem in some cases.

vg  Steffen

"Bernd Wilke" <xoonsji02 at sneakemail.com> schrieb im Newsbeitrag 
news:mailman.1.1190040236.2560.typo3-dev at lists.netfielders.de...
> 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?
>>
>> /Brian Bendtsen
>
> just have a look into the source of pi_getLL() 
> (typo3/sysext/cms/tslib/class.tslib_pibase.php line 942):
>
> if (isset($this->LOCAL_LANG[$this->LLkey][$key])) {
> $word = $GLOBALS['TSFE']->csConv($this->LOCAL_LANG[$this->LLkey][$key], 
> $this->LOCAL_LANG_charset[$this->LLkey][$key]); } else ....
>
> the actual language is decided by $this->LLkey.
> if you want to get the words from another than the actual language you 
> have to save this value and change it to your desired value.
> Then you can access the desired language with the default-function.
> after the work is done, don't forget to restore the original 
> language-value!
>
> Bernd
>
> -- 
> http://www.pi-phi.de/t3v4/cheatsheet.html 






More information about the TYPO3-dev mailing list