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

Daniel Siepmann layne.obserdia at gmail.com
Sun Aug 21 01:50:43 CEST 2011


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



More information about the TYPO3-german mailing list