english/libraries/joomla/installer/adapters/plugin.php
/**
	 * Custom loadLanguage method
	 *
	 * @param   string  $path the path where to find language files
	 * @since   11.1
	 */
Custom loadLanguage method
@param   string  $path the path where to find language files
@since   11.1
Custom loadLanguage method @param string $path the path where to find language files @since 11 . 1
public function loadLanguage($path=null)
	{
		$source = $this->parent->getPath('source');
		if (!$source) {
			$this->parent->setPath('source', JPATH_PLUGINS . '/'.$this->parent->extension->folder.'/'.$this->parent->extension->element);
		}
		$this->manifest = $this->parent->getManifest();
		$element = $this->manifest->files;
		if ($element)
		{
			$group = strtolower((string)$this->manifest->attributes()->group);
			$name = '';
			if (count($element->children()))
			{
				foreach ($element->children() as $file)
				{
					if ((string)$file->attributes()->plugin)
					{
						$name = strtolower((string)$file->attributes()->plugin);
						break;
					}
				}
			}
			if ($name)
			{
				$extension = "plg_${group}_${name}";
				$lang = JFactory::getLanguage();
				$source = $path ? $path : JPATH_PLUGINS . "/$group/$name";
				$folder = (string)$element->attributes()->folder;
				if ($folder && file_exists("$path/$folder"))
				{
					$source = "$path/$folder";
				}
				$lang->load($extension . '.sys', $source, null, false, false)
				||	$lang->load($extension . '.sys', JPATH_ADMINISTRATOR, null, false, false)
				||	$lang->load($extension . '.sys', $source, $lang->getDefault(), false, false)
				||	$lang->load($extension . '.sys', JPATH_ADMINISTRATOR, $lang->getDefault(), false, false);
			}
		}
	}
public function loadLanguage ( $ path = null ) { $ source = $ this -> parent -> getPath ( 'source' ) ; if ( ! $ source ) { $ this -> parent -> setPath ( 'source' , JPATH_PLUGINS . '/' . $ this -> parent -> extension -> folder . '/' . $ this -> parent -> extension -> element ) ; } $ this -> manifest = $ this -> parent -> getManifest ( ) ; $ element = $ this -> manifest -> files ; if ( $ element ) { $ group = strtolower ( ( string ) $ this -> manifest -> attributes ( ) -> group ) ; $ name = '' ; if ( count ( $ element -> children ( ) ) ) { foreach ( $ element -> children ( ) as $ file ) { if ( ( string ) $ file -> attributes ( ) -> plugin ) { $ name = strtolower ( ( string ) $ file -> attributes ( ) -> plugin ) ; break ; } } } if ( $ name ) { $ extension = " plg_ $ { group } _ $ { name } " ; $ lang = JFactory :: getLanguage ( ) ; $ source = $ path ? $ path : JPATH_PLUGINS . " / $ group / $ name " ; $ folder = ( string ) $ element -> attributes ( ) -> folder ; if ( $ folder && file_exists ( " $ path / $ folder " ) ) { $ source = " $ path / $ folder " ; } $ lang -> load ( $ extension . '.sys' , $ source , null , false , false ) || $ lang -> load ( $ extension . '.sys' , JPATH_ADMINISTRATOR , null , false , false ) || $ lang -> load ( $ extension . '.sys' , $ source , $ lang -> getDefault ( ) , false , false ) || $ lang -> load ( $ extension . '.sys' , JPATH_ADMINISTRATOR , $ lang -> getDefault ( ) , false , false ) ; } } }
Custom loadLanguage method
 @param   string  $path the path where to find language files
 @since   11.1
Custom loadLanguage method @param string $path the path where to find language files @since 11 . 1