Back to LibraryAdapter class

Method loadLanguage

public void
loadLanguage
(mixed $path = null)
Custom loadLanguage method
Parameters
  • string $path The path where to find language files.
Returns
  • void
Since
  • 3.1

Method loadLanguage - Source code

/**
 * Custom loadLanguage method
 *
 * @param   string  $path  The path where to find language files.
 *
 * @return  void
 *
 * @since   3.1
 */
public function loadLanguage($path = null)
{
    $source = $this->parent->getPath('source');
    if (!$source) {
        $this->parent->setPath('source', JPATH_PLATFORM . '/' . $this->getElement());
    }
    $extension = 'lib_' . str_replace('/', '_', $this->getElement());
    $librarypath = (string) $this->getManifest()->libraryname;
    $source = $path ?: JPATH_PLATFORM . '/' . $librarypath;
    $this->doLoadLanguage($extension, $source, JPATH_SITE);
}