Use JText in plugins?

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Locked
mludwig
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Tue Dec 26, 2006 8:24 pm

Use JText in plugins?

Post by mludwig » Mon Jul 28, 2008 12:35 pm

I am writing a 1.5 Native Plugin and having some problems with the languages. While I was able to add a language file, install it and it is currently used to translate strings in the back-end plugin configuration page, I cannot figure out how to make strings from this file available to the plugin script itself (for error messages, for example). Any JText call in the plugin PHP file doesn't get translated.
Is this a feature request or did I just miss something?

User avatar
jenscski
Joomla! Ace
Joomla! Ace
Posts: 1465
Joined: Thu Aug 18, 2005 6:58 am
Location: Tønsberg, Norway

Re: Use JText in plugins?

Post by jenscski » Wed Aug 20, 2008 9:29 am

You need to manually load the translations for plugins using

$this->loadLanguage( );

in the plugins constructor.
Jens-Christian Skibakk
MMS Blog - http://mms.pipp.no/
Joomla! i Norge / Joomla! in Norway - http://www.joomlainorge.no/


Locked

Return to “Joomla! 1.5 Coding”