english/libraries/joomla/installer/adapters/language.php
/**
	 * Custom discover method
	 * Finds language files
	 */
Custom discover method
Finds language files
Custom discover method Finds language files
public function discover()
	{
		$results = Array();
		$site_languages = JFolder::folders(JPATH_SITE . '/language');
		$admin_languages = JFolder::folders(JPATH_ADMINISTRATOR . '/language');
		foreach ($site_languages as $language)
		{
			if (file_exists(JPATH_SITE . '/language/' . $language . '/' . $language.'.xml'))
			{
				$manifest_details = JApplicationHelper::parseXMLInstallFile(JPATH_SITE . '/language/' . $language . '/' . $language.'.xml');
				$extension = JTable::getInstance('extension');
				$extension->set('type', 'language');
				$extension->set('client_id', 0);
				$extension->set('element', $language);
				$extension->set('name', $language);
				$extension->set('state', -1);
				$extension->set('manifest_cache', json_encode($manifest_details));
				$results[] = $extension;
			}
		}
		foreach ($admin_languages as $language)
		{
			if (file_exists(JPATH_ADMINISTRATOR . '/language/' . $language . '/' . $language.'.xml'))
			{
				$manifest_details = JApplicationHelper::parseXMLInstallFile(JPATH_ADMINISTRATOR . '/language/' . $language . '/' . $language.'.xml');
				$extension = JTable::getInstance('extension');
				$extension->set('type', 'language');
				$extension->set('client_id', 1);
				$extension->set('element', $language);
				$extension->set('name', $language);
				$extension->set('state', -1);
				$extension->set('manifest_cache', json_encode($manifest_details));
				$results[] = $extension;
			}
		}
		return $results;
	}
public function discover ( ) { $ results = Array ( ) ; $ site_languages = JFolder :: folders ( JPATH_SITE . '/language' ) ; $ admin_languages = JFolder :: folders ( JPATH_ADMINISTRATOR . '/language' ) ; foreach ( $ site_languages as $ language ) { if ( file_exists ( JPATH_SITE . '/language/' . $ language . '/' . $ language . '.xml' ) ) { $ manifest_details = JApplicationHelper :: parseXMLInstallFile ( JPATH_SITE . '/language/' . $ language . '/' . $ language . '.xml' ) ; $ extension = JTable :: getInstance ( 'extension' ) ; $ extension -> set ( 'type' , 'language' ) ; $ extension -> set ( 'client_id' , 0 ) ; $ extension -> set ( 'element' , $ language ) ; $ extension -> set ( 'name' , $ language ) ; $ extension -> set ( 'state' , - 1 ) ; $ extension -> set ( 'manifest_cache' , json_encode ( $ manifest_details ) ) ; $ results [ ] = $ extension ; } } foreach ( $ admin_languages as $ language ) { if ( file_exists ( JPATH_ADMINISTRATOR . '/language/' . $ language . '/' . $ language . '.xml' ) ) { $ manifest_details = JApplicationHelper :: parseXMLInstallFile ( JPATH_ADMINISTRATOR . '/language/' . $ language . '/' . $ language . '.xml' ) ; $ extension = JTable :: getInstance ( 'extension' ) ; $ extension -> set ( 'type' , 'language' ) ; $ extension -> set ( 'client_id' , 1 ) ; $ extension -> set ( 'element' , $ language ) ; $ extension -> set ( 'name' , $ language ) ; $ extension -> set ( 'state' , - 1 ) ; $ extension -> set ( 'manifest_cache' , json_encode ( $ manifest_details ) ) ; $ results [ ] = $ extension ; } } return $ results ; }
Custom discover method
 Finds language files
Custom discover method Finds language files