diff options
author | Simon Rettberg | 2016-05-10 19:17:28 +0200 |
---|---|---|
committer | Simon Rettberg | 2016-05-10 19:17:28 +0200 |
commit | a79bbfa1a23838b91e9a08f7014c2c7304976714 (patch) | |
tree | fafb56190707d10b01cb282bc14b99156e100dcb /modules-available/sysconfig | |
parent | Translating module strings and custom sections works (diff) | |
download | slx-admin-a79bbfa1a23838b91e9a08f7014c2c7304976714.tar.gz slx-admin-a79bbfa1a23838b91e9a08f7014c2c7304976714.tar.xz slx-admin-a79bbfa1a23838b91e9a08f7014c2c7304976714.zip |
Migrated messages to modules
Diffstat (limited to 'modules-available/sysconfig')
11 files changed, 82 insertions, 30 deletions
diff --git a/modules-available/sysconfig/addconfig.inc.php b/modules-available/sysconfig/addconfig.inc.php index 8203e555..34a46d52 100644 --- a/modules-available/sysconfig/addconfig.inc.php +++ b/modules-available/sysconfig/addconfig.inc.php @@ -41,7 +41,7 @@ abstract class AddConfig_Base protected function tmError() { - Message::addError('taskmanager-error'); + Message::addError('main.taskmanager-error'); Util::redirect('?do=SysConfig'); } @@ -54,7 +54,7 @@ abstract class AddConfig_Base } else { $error = Dictionary::translate('lang_unknwonTaskManager'); // TODO: No text } - Message::addError('task-error', $error); + Message::addError('main.task-error', $error); Util::redirect('?do=SysConfig'); } diff --git a/modules-available/sysconfig/addmodule.inc.php b/modules-available/sysconfig/addmodule.inc.php index bcd8e796..913a37c1 100644 --- a/modules-available/sysconfig/addmodule.inc.php +++ b/modules-available/sysconfig/addmodule.inc.php @@ -43,7 +43,7 @@ abstract class AddModule_Base protected function tmError() { - Message::addError('taskmanager-error'); + Message::addError('main.taskmanager-error'); Util::redirect('?do=SysConfig'); } @@ -56,7 +56,7 @@ abstract class AddModule_Base } else { $error = Dictionary::translate('lang_unknwonTaskManager'); } - Message::addError('task-error', $error); + Message::addError('main.task-error', $error); Util::redirect('?do=SysConfig'); } diff --git a/modules-available/sysconfig/addmodule_adauth.inc.php b/modules-available/sysconfig/addmodule_adauth.inc.php index e295630c..cb7bfb4e 100644 --- a/modules-available/sysconfig/addmodule_adauth.inc.php +++ b/modules-available/sysconfig/addmodule_adauth.inc.php @@ -42,7 +42,7 @@ class AdAuth_CheckConnection extends AddModule_Base $binddn = Request::post('binddn'); $ssl = Request::post('ssl', 'off') === 'on'; if (empty($this->server) || empty($binddn)) { - Message::addError('empty-field'); + Message::addError('main.empty-field'); AddModule_Base::setStep('AdAuth_Start'); // Continues with AdAuth_Start for render() return; } @@ -108,12 +108,12 @@ class AdAuth_SelfSearch extends AddModule_Base $bindpw = Request::post('bindpw'); $ssl = Request::post('ssl', 'off') === 'on'; if ($ssl && !Request::post('fingerprint')) { - Message::addError('error-read', 'fingerprint'); + Message::addError('main.error-read', 'fingerprint'); AddModule_Base::setStep('AdAuth_Start'); // Continues with AdAuth_Start for render() return; } if (empty($server) || empty($binddn) || empty($port)) { - Message::addError('empty-field'); + Message::addError('main.empty-field'); AddModule_Base::setStep('AdAuth_Start'); // Continues with AdAuth_Start for render() return; } @@ -185,12 +185,12 @@ class AdAuth_HomeAttrCheck extends AddModule_Base $bindpw = Request::post('bindpw'); $ssl = Request::post('ssl', 'off') === 'on'; if ($ssl && !Request::post('fingerprint')) { - Message::addError('error-read', 'fingerprint'); + Message::addError('main.error-read', 'fingerprint'); AddModule_Base::setStep('AdAuth_Start'); // Continues with AdAuth_Start for render() return; } if (empty($server) || empty($binddn) || empty($port)) { - Message::addError('empty-field'); + Message::addError('main.empty-field'); AddModule_Base::setStep('AdAuth_Start'); // Continues with AdAuth_Start for render() return; } @@ -255,12 +255,12 @@ class AdAuth_CheckCredentials extends AddModule_Base $bindpw = Request::post('bindpw'); $ssl = Request::post('ssl', 'off') === 'on'; if ($ssl && !Request::post('fingerprint')) { - Message::addError('error-read', 'fingerprint'); + Message::addError('main.error-read', 'fingerprint'); AddModule_Base::setStep('AdAuth_Start'); // Continues with AdAuth_Start for render() return; } if (empty($server) || empty($binddn) || empty($port)) { - Message::addError('empty-field'); + Message::addError('main.empty-field'); AddModule_Base::setStep('AdAuth_Start'); // Continues with AdAuth_Start for render() return; } @@ -323,13 +323,13 @@ class AdAuth_Finish extends AddModule_Base // If no search base was given, determine it from the dn $originalBindDn = str_replace('\\', '/', trim(Request::post('originalbinddn'))); if (!preg_match('#^([^/]+)/[^/]+$#', $originalBindDn, $out)) { - Message::addError('value-invalid', 'binddn', $originalBindDn); + Message::addError('main.value-invalid', 'binddn', $originalBindDn); Util::redirect('?do=SysConfig&action=addmodule&step=AdAuth_Start'); } // $out[1] is the domain // Find the domain in the dn $i = mb_stripos($binddn, '=' . $out[1] . ','); if ($i === false) { - Message::addError('value-invalid', 'binddn', $out[1]); + Message::addError('main.value-invalid', 'binddn', $out[1]); Util::redirect('?do=SysConfig&action=addmodule&step=AdAuth_Start'); } // Now find ',' before it so we get the key @@ -372,7 +372,7 @@ class AdAuth_Finish extends AddModule_Base else $ret = $module->insert($title); if (!$ret) { - Message::addError('value-invalid', 'any', 'any'); + Message::addError('main.value-invalid', 'any', 'any'); $tgz = false; } else { $parent = $this->stopOldInstance(); diff --git a/modules-available/sysconfig/addmodule_branding.inc.php b/modules-available/sysconfig/addmodule_branding.inc.php index 67e20892..cb5609e6 100644 --- a/modules-available/sysconfig/addmodule_branding.inc.php +++ b/modules-available/sysconfig/addmodule_branding.inc.php @@ -29,7 +29,7 @@ class Branding_ProcessFile extends AddModule_Base { $url = Request::post('url'); if ((!isset($_FILES['file']['error']) || $_FILES['file']['error'] === UPLOAD_ERR_NO_FILE) && empty($url)) { - Message::addError('empty-field'); + Message::addError('main.empty-field'); Util::redirect('?do=SysConfig&action=addmodule&step=Branding_Start'); } @@ -204,7 +204,7 @@ class Branding_Finish extends AddModule_Base } $tgz = Session::get('logo_tgz'); if ($tgz === false || !file_exists($tgz)) { - Message::addError('error-read', $tgz); + Message::addError('main.error-read', $tgz); Util::redirect('?do=SysConfig&action=addmodule&step=Branding_Start'); } if ($this->edit === false) @@ -212,7 +212,7 @@ class Branding_Finish extends AddModule_Base else $module = $this->edit; if ($module === false) { - Message::addError('error-read', 'branding.inc.php'); + Message::addError('main.error-read', 'branding.inc.php'); Util::redirect('?do=SysConfig&action=addmodule&step=Branding_Start'); } $module->setData('tmpFile', $tgz); diff --git a/modules-available/sysconfig/addmodule_custommodule.inc.php b/modules-available/sysconfig/addmodule_custommodule.inc.php index 023463f7..d08cc5fb 100644 --- a/modules-available/sysconfig/addmodule_custommodule.inc.php +++ b/modules-available/sysconfig/addmodule_custommodule.inc.php @@ -43,7 +43,7 @@ class CustomModule_ProcessUpload extends AddModule_Base } $tempfile = '/tmp/bwlp-' . mt_rand(1, 100000) . '-' . crc32($_SERVER['REMOTE_ADDR']) . '.tmp'; if (!move_uploaded_file($_FILES['modulefile']['tmp_name'], $tempfile)) { - Message::addError('error-write', $tempfile); + Message::addError('main.error-write', $tempfile); Util::redirect('?do=SysConfig'); } $this->taskId = 'tgzmod' . mt_rand() . '-' . microtime(true); @@ -113,7 +113,7 @@ class CustomModule_CompressModule extends AddModule_Base $title = Request::post('title'); $tempfile = Session::get('mod_temp'); if (empty($title) || empty($tempfile) || !file_exists($tempfile)) { - Message::addError('empty-field'); + Message::addError('main.empty-field'); Util::redirect('?do=SysConfig&action=addmodule&step=CustomModule_Start'); } // Recompress using task manager @@ -138,7 +138,7 @@ class CustomModule_CompressModule extends AddModule_Base else $module = $this->edit; if ($module === false) { - Message::addError('error-read', 'custommodule.inc.php'); + Message::addError('main.error-read', 'custommodule.inc.php'); Util::redirect('?do=SysConfig&action=addmodule&step=CustomModule_Start'); } $module->setData('tmpFile', $destFile); diff --git a/modules-available/sysconfig/addmodule_ldapauth.inc.php b/modules-available/sysconfig/addmodule_ldapauth.inc.php index e17469a0..c2e4e1c2 100644 --- a/modules-available/sysconfig/addmodule_ldapauth.inc.php +++ b/modules-available/sysconfig/addmodule_ldapauth.inc.php @@ -38,7 +38,7 @@ class LdapAuth_CheckConnection extends AddModule_Base $searchbase = Request::post('searchbase'); $ssl = Request::post('ssl', 'off') === 'on'; if (empty($this->server) || empty($searchbase)) { - Message::addError('empty-field'); + Message::addError('main.empty-field'); AddModule_Base::setStep('LdapAuth_Start'); // Continues with LdapAuth_Start for render() return; } @@ -96,12 +96,12 @@ class LdapAuth_CheckCredentials extends AddModule_Base $bindpw = Request::post('bindpw'); $ssl = Request::post('ssl', 'off') === 'on'; if ($ssl && !Request::post('fingerprint')) { - Message::addError('error-read', 'fingerprint'); + Message::addError('main.error-read', 'fingerprint'); AddModule_Base::setStep('LdapAuth_Start'); // Continues with LdapAuth_Start for render() return; } if (empty($server) || empty($port)) { - Message::addError('empty-field'); + Message::addError('main.empty-field'); AddModule_Base::setStep('LdapAuth_Start'); // Continues with LdapAuth_Start for render() return; } @@ -193,7 +193,7 @@ class LdapAuth_Finish extends AddModule_Base else $ret = $module->insert($title); if (!$ret) { - Message::addError('value-invalid', 'any', 'any'); + Message::addError('main.value-invalid', 'any', 'any'); $tgz = false; } else { $parent = $this->stopOldInstance(); diff --git a/modules-available/sysconfig/addmodule_sshconfig.inc.php b/modules-available/sysconfig/addmodule_sshconfig.inc.php index 5f0f7222..79857085 100644 --- a/modules-available/sysconfig/addmodule_sshconfig.inc.php +++ b/modules-available/sysconfig/addmodule_sshconfig.inc.php @@ -41,16 +41,16 @@ class SshConfig_Finish extends AddModule_Base else $module = $this->edit; if ($module === false) { - Message::addError('error-read', 'sshconfig.inc.php'); + Message::addError('main.error-read', 'sshconfig.inc.php'); Util::redirect('?do=SysConfig&action=addmodule&step=SshConfig_Start'); } $module->setData('allowPasswordLogin', Request::post('allowPasswordLogin') === 'yes'); if (!$module->setData('listenPort', Request::post('listenPort'))) { - Message::addError('value-invalid', 'port', Request::post('listenPort')); + Message::addError('main.value-invalid', 'port', Request::post('listenPort')); Util::redirect('?do=SysConfig&action=addmodule&step=SshConfig_Start'); } if (!$module->setData('publicKey', Request::post('publicKey'))) { - Message::addError('value-invalid', 'pubkey', Request::post('publicKey')); + Message::addError('main.value-invalid', 'pubkey', Request::post('publicKey')); Util::redirect('?do=SysConfig&action=addmodule&step=SshConfig_Start'); } if ($this->edit !== false) diff --git a/modules-available/sysconfig/lang/de/messages.json b/modules-available/sysconfig/lang/de/messages.json new file mode 100644 index 00000000..7993babd --- /dev/null +++ b/modules-available/sysconfig/lang/de/messages.json @@ -0,0 +1,20 @@ +{ + "invalid-action": "Ung\u00fcltige Aktion: {{0}}", + "missing-title": "Kein Titel eingegeben", + "module-edited": "Modul wurde aktualisiert", + "module-added": "Modul erfolgreich hinzugef\u00fcgt", + "replacing-config": "Ersetzen von Konfiguration {{0}}", + "missing-file": "Es wurde keine Datei ausgew\u00e4hlt!", + "unsuccessful-action": "Nicht erfolgreich", + "upload-failed": "Upload schlug fehl: {{0}}", + "remote-timeout": "Konnte Ressource {{0}} nicht herunterladen ({{1}})", + "no-image": "Unter der angegebenen URL konnte kein SVG-Bild gefunden werden", + "replacing-module": "Ersetzen von Modul {{0}}", + "config-invalid": "Konfiguration mit ID {{0}} existiert nicht", + "config-activated": "Konfiguration {{0}} wurde aktiviert", + "module-rebuilt": "Modul wurde neu generiert", + "module-rebuild-failed": "Neubau des Moduls fehlgeschlagen", + "module-rebuilding": "Modul wird neu generiert", + "module-in-use": "Modul {{0}} wird noch durch Konfiguration {{1}} verwendet", + "module-deleted": "Modul {{0}} wurde gel\u00f6scht" +}
\ No newline at end of file diff --git a/modules-available/sysconfig/lang/en/messages.json b/modules-available/sysconfig/lang/en/messages.json new file mode 100644 index 00000000..fc3c1160 --- /dev/null +++ b/modules-available/sysconfig/lang/en/messages.json @@ -0,0 +1,20 @@ +{ + "invalid-action": "Invalid action: {{0}}", + "missing-title": "No title given", + "module-edited": "Module has been edited", + "module-added": "Module successfully added", + "replacing-config": "Replace config {{0}}", + "missing-file": "There was no file selected!", + "unsuccessful-action": "Not successful", + "upload-failed": "Upload failed: {{0}}", + "remote-timeout": "Could not download resource {{0}} ({{1}})", + "no-image": "Could not find an SVG-image at the given URL", + "replacing-module": "Replace module {{0}}", + "config-invalid": "Configuration with id {{0}} does not exist", + "config-activated": "Configuration {{0}} has been activated", + "module-rebuilt": "Module was rebuilt", + "module-rebuild-failed": "Rebuilding module failed", + "module-rebuilding": "Module is rebuilding...", + "module-in-use": "Module {{0}} is still used by Configuration {{1}}", + "module-deleted": "Module {{0}} was deleted" +}
\ No newline at end of file diff --git a/modules-available/sysconfig/lang/pt/messages.json b/modules-available/sysconfig/lang/pt/messages.json new file mode 100644 index 00000000..230fcb1d --- /dev/null +++ b/modules-available/sysconfig/lang/pt/messages.json @@ -0,0 +1,12 @@ +{ + "invalid-action": "A\u00e7\u00e3o inv\u00e1lida: {{0}}", + "module-added": "M\u00f3dulo adicionado com sucesso", + "missing-file": "N\u00e3o havia nenhum arquivo selecionado!", + "unsuccessful-action": "A a\u00e7\u00e3o n\u00e3o foi bem sucedida", + "upload-failed": "Envio falhou: {{0}}", + "remote-timeout": "N\u00e3o foi poss\u00edvel baixar o recurso {{0}} ({{1}})", + "config-invalid": "Configura\u00e7\u00e3o com id {{0}} n\u00e3o existe", + "config-activated": "Configura\u00e7\u00e3o {{0}} foi ativada", + "module-in-use": "M\u00f3dulo {{0}} ainda \u00e9 usado pela configura\u00e7\u00e3o {{1}}", + "module-deleted": "M\u00f3dulo {{0}} foi exclu\u00eddo" +}
\ No newline at end of file diff --git a/modules-available/sysconfig/page.inc.php b/modules-available/sysconfig/page.inc.php index 0c06e125..d4fe4a37 100644 --- a/modules-available/sysconfig/page.inc.php +++ b/modules-available/sysconfig/page.inc.php @@ -47,7 +47,7 @@ class Page_SysConfig extends Page User::load(); if (!User::hasPermission('superadmin')) { - Message::addError('no-permission'); + Message::addError('main.no-permission'); Util::redirect('?do=Main'); } @@ -273,7 +273,7 @@ class Page_SysConfig extends Page $task = Taskmanager::waitComplete($task['id']); } if (!isset($task['statusCode']) || $task['statusCode'] === TASK_ERROR) { - Message::addError('task-error', $task['data']['error']); + Message::addError('main.task-error', $task['data']['error']); } elseif ($task['statusCode'] === TASK_FINISHED) { Message::addSuccess('config-activated', $row['title']); Event::activeConfigChanged(); @@ -321,7 +321,7 @@ class Page_SysConfig extends Page $task = Taskmanager::waitComplete($task['id']); } if (!isset($task['statusCode']) || $task['statusCode'] === TASK_ERROR) { - Message::addWarning('task-error', $task['data']['error']); + Message::addWarning('main.task-error', $task['data']['error']); } elseif ($task['statusCode'] === TASK_FINISHED) { Message::addSuccess('module-deleted', $row['title']); } |