Fix language override loading method in plugin

Co-authored-by: jmiller-moko <230051081+jmiller-moko@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-22 22:34:09 +00:00
parent 0033bef862
commit c93061cc29
+11 -3
View File
@@ -100,7 +100,7 @@ class PlgSystemMokoWaaSBrand extends CMSPlugin
$lang = Factory::getLanguage();
$tag = $lang->getTag();
// Load language overrides from the plugin's language folder
// Determine the override file path based on client
if ($this->app->isClient('administrator'))
{
$overridePath = JPATH_ADMINISTRATOR . '/language/overrides/' . $tag . '.override.ini';
@@ -110,10 +110,18 @@ class PlgSystemMokoWaaSBrand extends CMSPlugin
$overridePath = JPATH_SITE . '/language/overrides/' . $tag . '.override.ini';
}
// Load overrides if the file exists
// Load and parse the override file if it exists
if (file_exists($overridePath))
{
$lang->load('', JPATH_BASE, $tag, true);
$overrides = parse_ini_file($overridePath);
if ($overrides !== false && is_array($overrides))
{
foreach ($overrides as $key => $value)
{
$lang->_strings[$key] = $value;
}
}
}
}
}