API16:JPlugin/loadLanguage
From Joomla! Documentation
Description
Loads the plugin language file
Syntax
loadLanguage($extension= '', $basePath=JPATH_ADMINISTRATOR)
| Parameter Name | Default Value | Description |
|---|---|---|
| $extension | $extension The extension for which a language file should be loaded | |
| $basePath | JPATH_ADMINISTRATOR | $basePath The basepath to use |
Returns
boolean True, if the file has successfully loaded.
Defined in
libraries/joomla/plugin/plugin.php
Importing
jimport( 'joomla.plugin.plugin' );
Source Body
public function loadLanguage($extension = '', $basePath = JPATH_ADMINISTRATOR)
{
if (empty($extension)) {
$extension = 'plg_'.$this->_type.'_'.$this->_name;
}
$lang = &JFactory::getLanguage();
return
$lang->load(strtolower($extension), $basePath, null, false, false)
|| $lang->load (strtolower($extension), JPATH_PLUGINS .DS.$this->_type.DS.$this->_name, null, false, false)
|| $lang->load(strtolower($extension), $basePath, $lang->getDefault(), false, false)
|| $lang->load (strtolower($extension), JPATH_PLUGINS .DS.$this->_type.DS.$this->_name, $lang->getDefault(), false, false);
}
Examples
Code Examples