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/locations | |
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/locations')
-rw-r--r-- | modules-available/locations/lang/de/messages.json | 9 | ||||
-rw-r--r-- | modules-available/locations/lang/en/messages.json | 9 | ||||
-rw-r--r-- | modules-available/locations/page.inc.php | 26 |
3 files changed, 31 insertions, 13 deletions
diff --git a/modules-available/locations/lang/de/messages.json b/modules-available/locations/lang/de/messages.json new file mode 100644 index 00000000..bef94781 --- /dev/null +++ b/modules-available/locations/lang/de/messages.json @@ -0,0 +1,9 @@ +{ + "added-x-entries": "Eintr\u00e4ge hinzugef\u00fcgt: {{0}}", + "parameter-missing": "Fehlender Parameter: {{0}}", + "location-deleted": "Location wurde gel\u00f6scht (Locations: {{0}}, Subnets: {{1}})", + "location-updated": "Location {{0}} wurde aktualisiert", + "subnets-deleted": "Subnetze gel\u00f6scht: {{0}}", + "subnets-updated": "Subnetze aktualisiert: {{0}}", + "subnets-created": "Subnetze angelegt: {{0}}" +}
\ No newline at end of file diff --git a/modules-available/locations/lang/en/messages.json b/modules-available/locations/lang/en/messages.json new file mode 100644 index 00000000..e23f231a --- /dev/null +++ b/modules-available/locations/lang/en/messages.json @@ -0,0 +1,9 @@ +{ + "added-x-entries": "Entries added: {{0}}", + "parameter-missing": "Missing parameter: {{0}}", + "location-deleted": "Location has been deleted (locations: {{0}}, subnets: {{1}})", + "location-updated": "Location {{0}} has been updated", + "subnets-deleted": "{{0}} subnet(s) deleted", + "subnets-updated": "{{0}} subnet(s) updated", + "subnets-created": "{{0}} subnet(s) created" +}
\ No newline at end of file diff --git a/modules-available/locations/page.inc.php b/modules-available/locations/page.inc.php index 60af719b..8f76701a 100644 --- a/modules-available/locations/page.inc.php +++ b/modules-available/locations/page.inc.php @@ -13,7 +13,7 @@ class Page_Locations extends Page { User::load(); if (!User::hasPermission('superadmin')) { - Message::addError('no-permission'); + Message::addError('main.no-permission'); Util::redirect('?do=Main'); } $this->action = Request::post('action'); @@ -29,7 +29,7 @@ class Page_Locations extends Page $names = Request::post('newlocation', false); $parents = Request::post('newparent', false); if (!is_array($names) || !is_array($parents)) { - Message::addError('empty-field'); + Message::addError('main.empty-field'); Util::redirect('?do=Locations'); } $locs = Location::getLocations(); @@ -46,7 +46,7 @@ class Page_Locations extends Page } } if (!$ok) { - Message::addWarning('value-invalid', 'parentlocationid', $parent); + Message::addWarning('main.value-invalid', 'parentlocationid', $parent); continue; } } @@ -72,7 +72,7 @@ class Page_Locations extends Page $location = Database::queryFirst('SELECT locationid, parentlocationid, locationname FROM location' . ' WHERE locationid = :lid', array('lid' => $locationId)); if ($location === false) { - Message::addError('value-invalid', 'locationid', $locationId); + Message::addError('main.value-invalid', 'locationid', $locationId); Util::redirect('?do=Locations'); } // Delete location? @@ -117,7 +117,7 @@ class Page_Locations extends Page $newName = Request::post('locationname', false, 'string'); if ($newName === false || preg_match('/^\s*$/', $newName)) { if ($newName !== false) { - Message::addWarning('value-invalid', 'location name', $newName); + Message::addWarning('main.value-invalid', 'location name', $newName); } $newName = $location['locationname']; } @@ -127,12 +127,12 @@ class Page_Locations extends Page $rows = Location::queryLocations(); $all = Location::extractIds(Location::buildTree($rows)); if (!in_array($newParent, $all) || $newParent === $locationId) { - Message::addWarning('value-invalid', 'parent', $newParent); + Message::addWarning('main.value-invalid', 'parent', $newParent); $newParent = $location['parentlocationid']; } else { $rows = Location::extractIds(Location::buildTree($rows, $locationId)); if (in_array($newParent, $rows)) { - Message::addWarning('value-invalid', 'parent', $newParent); + Message::addWarning('main.value-invalid', 'parent', $newParent); $newParent = $location['parentlocationid']; } } @@ -181,14 +181,14 @@ class Page_Locations extends Page $end = $ends[$key]; list($startLong, $endLong) = $this->rangeToLong($start, $end); if ($startLong === false) { - Message::addWarning('value-invalid', 'start addr', $start); + Message::addWarning('main.value-invalid', 'start addr', $start); } if ($endLong === false) { - Message::addWarning('value-invalid', 'end addr', $start); + Message::addWarning('main.value-invalid', 'end addr', $start); } if ($startLong === false || $endLong === false) continue; if ($startLong > $endLong) { - Message::addWarning('value-invalid', 'range', $start . ' - ' . $end); + Message::addWarning('main.value-invalid', 'range', $start . ' - ' . $end); continue; } if ($stmt->execute(array('id' => $key, 'start' => $startLong, 'end' => $endLong))) { @@ -215,14 +215,14 @@ class Page_Locations extends Page $end = $ends[$key]; list($startLong, $endLong) = $this->rangeToLong($start, $end); if ($startLong === false) { - Message::addWarning('value-invalid', 'new start addr', $start); + Message::addWarning('main.value-invalid', 'new start addr', $start); } if ($endLong === false) { - Message::addWarning('value-invalid', 'new end addr', $start); + Message::addWarning('main.value-invalid', 'new end addr', $start); } if ($startLong === false || $endLong === false) continue; if ($startLong > $endLong) { - Message::addWarning('value-invalid', 'range', $start . ' - ' . $end); + Message::addWarning('main.value-invalid', 'range', $start . ' - ' . $end); continue; } if ($stmt->execute(array('location' => $locationId, 'start' => $startLong, 'end' => $endLong))) { |