Skip to content

Commit

Permalink
Tweak to plugin manager so we always load the default language for a …
Browse files Browse the repository at this point in the history
…plugin, then the current language, so untranslated strings fall back to default. Prior to this we were only loading the default if no translation for current existed.
  • Loading branch information
cheesegrits committed Oct 26, 2017
1 parent 3591d59 commit 847d555
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions components/com_fabrik/models/pluginmanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,14 @@ public function loadPlugIn($className = '', $group = '')
$langFile = 'plg_' . $folder . '_' . $className;
$langPath = $client->path . '/plugins/' . $folder . '/' . $className;

$lang->load($langFile, $langPath, null, false, false) || $lang->load($langFile, $langPath, $lang->getDefault(), false, false);
// load both default and current, so untranslated strings fall back to default
$lang->load($langFile, $langPath, $lang->getDefault(), false, false);
$lang->load($langFile, $langPath, null, false, false);

// Load system ini file
$langFile .= '.sys';
$lang->load($langFile, $langPath, null, false, false) || $lang->load($langFile, $langPath, $lang->getDefault(), false, false);
$lang->load($langFile, $langPath, $lang->getDefault(), false, false);
$lang->load($langFile, $langPath, null, false, false);

if (!is_object($plugIn))
{
Expand Down Expand Up @@ -482,7 +485,10 @@ public function getFormPlugins(&$form)

$langFile = 'plg_' . $folder . '_' . $element->plugin;
$langPath = $client->path . '/plugins/' . $folder . '/' . $element->plugin;
$lang->load($langFile, $langPath, null, false, false) || $lang->load($langFile, $langPath, $lang->getDefault(), false, false);

// load both default and current, so untranslated strings fall back to default
$lang->load($langFile, $langPath, $lang->getDefault(), false, false);
$lang->load($langFile, $langPath, null, false, false);

$listModel = $form->getListModel();
$pluginModel->setContext($groupModel, $form, $listModel);
Expand Down

0 comments on commit 847d555

Please sign in to comment.