/**
* 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);
}