From 9a37abbe88bd2ad177718a0c328adf6668f68358 Mon Sep 17 00:00:00 2001 From: lat9 Date: Wed, 22 May 2024 21:41:36 -0400 Subject: [PATCH] `zc_plugin`: Enable installer language default If a site's current language is other than 'english' (the default) when a zc_plugin is installed and the plugin fails its install with an error message, no message will be displayed if the plugin doesn't have an associated language file. --- .../classes/PluginSupport/BasePluginInstaller.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/includes/classes/PluginSupport/BasePluginInstaller.php b/includes/classes/PluginSupport/BasePluginInstaller.php index 01b361fdd8..ff9b8ce4c8 100644 --- a/includes/classes/PluginSupport/BasePluginInstaller.php +++ b/includes/classes/PluginSupport/BasePluginInstaller.php @@ -94,13 +94,22 @@ protected function setPluginVersionStatus($pluginKey, $version, $status) $this->dbConn->execute($sql); } - protected function loadInstallerLanguageFile($file) { $lng = $_SESSION['language']; $filename = $this->pluginDir . '/Installer/languages/' . $lng . '/' . $file; if (file_exists($filename)) { - require_once($filename); + require_once $filename; + return; + } + + if ($lng === 'english') { + return; + } + + $filename = $this->pluginDir . '/Installer/languages/english/' . $file; + if (file_exists($filename)) { + require_once $filename; } }