Monday, April 9, 2012

How to load a language file for a joomla plugin

Loading a language file for a joomla plugin-
If this is how your xml code looks for including a language file
<languages folder="language/en-GB">
<language tag="en-GB">en-GB.plg_pluginType_myPlugin.ini</language>

PHP code below
/*load language file for plugin frontend*/
$lang = JFactory::getLanguage();
$lang->load('plg_pluginType_myPlugin', JPATH_ADMINISTRATOR);

This will load your language file for the plugin and you can use language constants in the plugin.

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...