Skip to content

Commit

Permalink
Correctly translate name of library using Joomla! language sys file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hayden Young committed Oct 1, 2014
1 parent 696b4c2 commit fcce18b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ private function translate(&$items)
|| $lang->load("$extension.sys", $source, null, false, true);
break;
}
if (!in_array($item->type, array('language', 'template', 'library')))
if (!in_array($item->type, array('language', 'template')))
{
$item->name = JText::_($item->name);
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/cms/installer/adapter/library.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function loadLanguage($path = null)
}

$this->manifest = $this->parent->getManifest();
$extension = 'lib_' . strtolower(JFilterInput::getInstance()->clean((string) $this->manifest->name, 'cmd'));
$extension = strtolower(JFilterInput::getInstance()->clean((string) $this->manifest->name, 'cmd'));
$name = strtolower((string) $this->manifest->libraryname);
$lang = JFactory::getLanguage();
$source = $path ? $path : JPATH_PLATFORM . "/$name";
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/suites/libraries/cms/installer/data/joomla.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<extension type="library" version="2.5">
<name>Joomla! Platform</name>
<name>lib_joomla</name>
<libraryname>joomla</libraryname>
<version>11.4</version>
<description>LIB_JOOMLA_XML_DESCRIPTION</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function testLoadManifestFromData()
$this->object = new JInstallerManifestLibrary(dirname(__DIR__) . '/data/joomla.xml');

$this->assertEquals(
'Joomla! Platform',
'lib_joomla',
$this->object->name
);

Expand Down

0 comments on commit fcce18b

Please sign in to comment.