diff --git a/libraries/joomla/language/language.php b/libraries/joomla/language/language.php index 968bb15c56728..e83bde35ab2c5 100644 --- a/libraries/joomla/language/language.php +++ b/libraries/joomla/language/language.php @@ -723,6 +723,12 @@ public static function exists($lang, $basePath = JPATH_BASE) */ public function load($extension = 'joomla', $basePath = JPATH_BASE, $lang = null, $reload = false, $default = true) { + // If language is null set as the current language. + if (!$lang) + { + $lang = $this->lang; + } + // Load the default language first if we're not debugging and a non-default language is requested to be loaded // with $default set to true if (!$this->debug && ($lang != $this->default) && $default) @@ -730,11 +736,6 @@ public function load($extension = 'joomla', $basePath = JPATH_BASE, $lang = null $this->load($extension, $basePath, $this->default, false, true); } - if (!$lang) - { - $lang = $this->lang; - } - $path = self::getLanguagePath($basePath, $lang); $internal = $extension == 'joomla' || $extension == '';