Add translation support

Add translation support by adding the language dir
with bare PO files.
All translations are changed to use their plugin domain.
This commit is contained in:
Jelle van der Waa
2016-06-09 11:13:23 +02:00
parent ecaa6e3a35
commit ec102f9c03
9 changed files with 312 additions and 33 deletions

View File

@ -181,24 +181,24 @@ class PluginMDMModule extends Module
$this->handleUnknownActionType($actionType);
}
} catch (SoapFault $fault) {
$display_message = _('Something went wrong.');
$display_message = _('Something went wrong.', 'plugin_mdm');
if ($fault->faultcode === 'HTTP') {
if ($fault->getMessage() === "Unauthorized") {
$display_message = _('Unable to connect to Z-Push Server. Unauthorized.');
$display_message = _('Unable to connect to Z-Push Server. Unauthorized.', 'plugin_mdm');
}
if ($fault->getMessage() === "Could not connect to host") {
$display_message = _('Unable to connect to Z-Push Server. Could not connect to host.');
$display_message = _('Unable to connect to Z-Push Server. Could not connect to host.', 'plugin_mdm');
}
if ($fault->getMessage() === "Not Found") {
$display_message = _('Unable to connect to Z-Push Server. Not found.');
$display_message = _('Unable to connect to Z-Push Server. Not found.', 'plugin_mdm');
}
} else if ($fault->faultcode === "ERROR") {
$display_message = _('Device ID could not be found');
$display_message = _('Device ID could not be found', 'plugin_mdm');
}
$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'))));
$this->sendFeedback(true, array("type" => ERROR_GENERAL, "info" => array('display_message' => _('Something went wrong', 'plugin_mdm'))));
}
}
}