Skip to content

Commit

Permalink
Fixes language loading for system plugins in Language Filter plugin (#…
Browse files Browse the repository at this point in the history
…16287)

* Fixes language loading for system plugins in Langauge Filter

* Added one missing whitespace...

* Added check for system plugins and loading of files from plugin folders - Thanks to Infograf768
  • Loading branch information
Kubik-Rubik authored and rdeutz committed Jun 6, 2017
1 parent 0867625 commit f32f3c9
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions plugins/system/languagefilter/languagefilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -475,15 +475,25 @@ public function parseRule(&$router, &$uri)

if ($language->getTag() != $lang_code)
{
$newLang = JLanguage::getInstance($lang_code);
$language_new = JLanguage::getInstance($lang_code);

foreach ($language->getPaths() as $extension => $files)
{
$newLang->load($extension);
if (strpos($extension, 'plg_system') !== false)
{
$extension_name = substr($extension, 11);

$language_new->load($extension, JPATH_ADMINISTRATOR)
|| $language_new->load($extension, JPATH_PLUGINS . '/system/' . $extension_name);

continue;
}

$language_new->load($extension);
}

JFactory::$language = $newLang;
$this->app->loadLanguage($newLang);
JFactory::$language = $language_new;
$this->app->loadLanguage($language_new);
}

// Create a cookie.
Expand Down

0 comments on commit f32f3c9

Please sign in to comment.