Merge pull request #2 in KWA/mobile-device-management from KMP-10-fix-translations to master

* commit 'b9548dec8d8110d1081bd38989bdb6d119dadda6':
  Use dgettext which handles translation domains
This commit is contained in:
Martijn Alberts 2016-08-17 17:30:11 +02:00
commit 7385ef179e

View File

@ -161,24 +161,24 @@ class PluginMDMModule extends Module
$this->handleUnknownActionType($actionType); $this->handleUnknownActionType($actionType);
} }
} catch (SoapFault $fault) { } catch (SoapFault $fault) {
$display_message = _('Something went wrong.', 'plugin_mdm'); $display_message = dgettext('plugin_mdm', 'Something went wrong.');
if ($fault->faultcode === 'HTTP') { if ($fault->faultcode === 'HTTP') {
if ($fault->getMessage() === "Unauthorized") { 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") { 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") { 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") { } 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))); $this->sendFeedback(false, array("type" => ERROR_GENERAL, "info" => array('display_message' => $display_message)));
} }
catch (Exception $e) { 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'))));
} }
} }
} }