From b9548dec8d8110d1081bd38989bdb6d119dadda6 Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Thu, 11 Aug 2016 11:08:54 +0200 Subject: [PATCH] Use dgettext which handles translation domains The PHP code should use a translation function which can handle a textdomain as argument. References: KMP-10 --- php/class.pluginmdmmodule.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/php/class.pluginmdmmodule.php b/php/class.pluginmdmmodule.php index 814f2a6..bbc809d 100755 --- a/php/class.pluginmdmmodule.php +++ b/php/class.pluginmdmmodule.php @@ -161,24 +161,24 @@ class PluginMDMModule extends Module $this->handleUnknownActionType($actionType); } } catch (SoapFault $fault) { - $display_message = _('Something went wrong.', 'plugin_mdm'); + $display_message = dgettext('plugin_mdm', 'Something went wrong.'); if ($fault->faultcode === 'HTTP') { if ($fault->getMessage() === "Unauthorized") { - $display_message = _('Unable to connect to Z-Push Server. Unauthorized.', 'plugin_mdm'); + $display_message = dgettext('plugin_mdm', 'Unable to connect to Z-Push Server. Unauthorized.'); } if ($fault->getMessage() === "Could not connect to host") { - $display_message = _('Unable to connect to Z-Push Server. Could not connect to host.', 'plugin_mdm'); + $display_message = dgettext('plugin_mdm', 'Unable to connect to Z-Push Server. Could not connect to host.'); } if ($fault->getMessage() === "Not Found") { - $display_message = _('Unable to connect to Z-Push Server. Not found.', 'plugin_mdm'); + $display_message = dgettext('plugin_mdm', 'Unable to connect to Z-Push Server. Not found.'); } } else if ($fault->faultcode === "ERROR") { - $display_message = _('Device ID could not be found', 'plugin_mdm'); + $display_message = dgettext('plugin_mdm', 'Device ID could not be found'); } $this->sendFeedback(false, array("type" => ERROR_GENERAL, "info" => array('display_message' => $display_message))); } catch (Exception $e) { - $this->sendFeedback(true, array("type" => ERROR_GENERAL, "info" => array('display_message' => _('Something went wrong', 'plugin_mdm')))); + $this->sendFeedback(true, array("type" => ERROR_GENERAL, "info" => array('display_message' => dgettext('plugin_mdm', 'Something went wrong')))); } } }