[TYPO3-german] Aus extension pi2 locallang.xml ansprechen

Christian Platt christian.platt at pharmaline.de
Sun Aug 21 06:43:42 CEST 2011


Daniel,

ein Ansatz ,den ich gerne nachverfolgen werde.

Liebe Grüße
Christian


Am 21.08.2011 um 01:50 schrieb Daniel Siepmann:

> On 2011-08-20 05:28:32 +0200, Christian Platt said:
> 
>> Mal was anderes...
>> Ich möchte aus meiner pi2 Extension die locallang.xml per pi_getLL() ansprechen.
>> Die pi_loadLL() scheint aber nur die locallang.xml aus dem pi1 Ordner zu laden.
>> Muss ich das in der Extension noch irgendwo hinterlegen, wo sich die zu zweite language.xml befindet?Ich dachte, es wird die aus dem aufrufenden Ordner (hier pi2) genutzt.Oder wird immer nur die locallang.xml aus dem pi1 geladen?
>> Wer kann mir weiterhelfen?
>> Liebe Grüße
>> Christian
> 
> Perhaps this Code will help you, you can chance the locallang-file your plugin will use. So it's possible to use one file in the extension for all plugins:
> 
> 
>       /**
>        * We overwrite this method, so we can use the language file defined in $this->languageFile.
>        * So we are more flexible and can use the extbase file structure.
>        */
>       public function pi_loadLL() {
>           $origPluginRelPath = $this->scriptRelPath;
>           $this->scriptRelPath = $this->languageFile;
>           parent::pi_loadLL();
>           $this->scriptRelPath = $origPluginRelPath;
>       }
> 
> You just have to add a class var called languageFile containing the path to the language file to use. (Example: Resources/Private/Language/locallang.xml)
> 
> -- 
> Best Regards,
> Daniel Siepmann.
> 
> www.wiki.typo3.org
> 
> _______________________________________________
> TYPO3-german mailing list
> TYPO3-german at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german



More information about the TYPO3-german mailing list