API16:JInstallerComponent/loadLanguage
From Joomla! Documentation
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.
Contents |
Description
Custom loadLanguage method
Description:JInstallerComponent/loadLanguage
Syntax
loadLanguage($path)
| Parameter Name | Default Value | Description |
|---|---|---|
| $path | $path the path where to find language files |
Defined in
libraries/joomla/installer/adapters/component.php
Importing
jimport( 'joomla.installer.adapters.component' );
Source Body
public function loadLanguage($path) { $this->manifest = &$this->parent->getManifest(); $name = strtolower(JFilterInput::getInstance()->clean((string)$this->manifest->name, 'cmd')); $check = substr($name, 0, 4); if ($check="com_") { $name = substr($name, 4); } $extension = "com_$name"; $lang =& JFactory::getLanguage(); $source = $path; if($this->manifest->administration->files) { $element = $this->manifest->administration->files; } elseif ($this->manifest->files) { $element = $this->manifest->files; } else { $element = null; } if ($element) { $folder = (string)$element->attributes()->folder; if ($folder && file_exists("$path/$folder")) { $source = "$path/$folder"; } } $lang->load($extension . '.manage', $source, null, false, false) || $lang->load($extension, $source, null, false, false) || $lang->load($extension . '.manage', JPATH_ADMINISTRATOR, null, false, false) || $lang->load($extension, JPATH_ADMINISTRATOR, null, false, false) || $lang->load($extension . '.manage', $source, $lang->getDefault(), false, false) || $lang->load($extension, $source, $lang->getDefault(), false, false) || $lang->load($extension . '.manage', JPATH_ADMINISTRATOR, $lang->getDefault(), false, false) || $lang->load($extension, JPATH_ADMINISTRATOR, $lang->getDefault(), false, false); }
[Edit See Also] SeeAlso:JInstallerComponent/loadLanguage
Examples
<CodeExamplesForm />
