Skip to content

Commit

Permalink
Native language (adjustments after 12036 merge) (#12394)
Browse files Browse the repository at this point in the history
* restore native language

* remvoe space

* correct

* simplify

* improve code

* ups

* native language in unit test too
  • Loading branch information
andrepereiradasilva authored and zero-24 committed Oct 29, 2016
1 parent f1c6878 commit 334d5a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions libraries/joomla/language/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ public static function createLanguageList($actualLanguage, $basePath = JPATH_BAS
{
if (!$installed || array_key_exists($lang, $installed_languages))
{
$option = array();
$option = array(
'text' => isset($metadata['nativeName']) ? $metadata['nativeName'] : $metadata['name'],
'value' => $lang,
);

$option['text'] = $metadata['name'];
$option['value'] = $lang;

if ($lang == $actualLanguage)
if ($lang === $actualLanguage)
{
$option['selected'] = 'selected="selected"';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class JLanguageHelperTest extends PHPUnit_Framework_TestCase
public function testCreateLanguageList()
{
$option = array(
'text' => 'English (en-GB)',
'text' => 'English (United Kingdom)',
'value' => 'en-GB',
'selected' => 'selected="selected"'
);
Expand Down

0 comments on commit 334d5a4

Please sign in to comment.