Skip to content

Commit

Permalink
Merge branch 'bugfix/translation-strings-6339'
Browse files Browse the repository at this point in the history
refs #6339
  • Loading branch information
Alexander Fuhr committed Sep 29, 2014
2 parents 31609ec + f7b7e02 commit 3ee9cd2
Show file tree
Hide file tree
Showing 14 changed files with 167 additions and 160 deletions.
4 changes: 2 additions & 2 deletions application/controllers/ConfigController.php
Expand Up @@ -96,7 +96,7 @@ public function moduleenableAction()
try {
$manager->enableModule($module);
$manager->loadModule($module);
Notification::success('Module "' . $module . '" enabled');
Notification::success(sprintf($this->translate('Module "%s" enabled'), $module));
$this->rerenderLayout()->reloadCss()->redirectNow('config/modules');
} catch (Exception $e) {
$this->view->exceptionMesssage = $e->getMessage();
Expand All @@ -115,7 +115,7 @@ public function moduledisableAction()
$manager = Icinga::app()->getModuleManager();
try {
$manager->disableModule($module);
Notification::success('Module "' . $module . '" disabled');
Notification::success(sprintf($this->translate('Module "%s" disabled'), $module));
$this->rerenderLayout()->reloadCss()->redirectNow('config/modules');
} catch (Exception $e) {
$this->view->exceptionMessage = $e->getMessage();
Expand Down
6 changes: 3 additions & 3 deletions application/views/scripts/config/modules.phtml
@@ -1,6 +1,6 @@
<div class="controls">
<?= $this->tabs ?>
<h1>Installed Modules</h1>
<h1><?= $this->translate('Installed Modules') ?></h1>
<?= $this->paginationControl($modules) ?>
</div>

Expand All @@ -11,9 +11,9 @@
<tr>
<td>
<?php if ($module->enabled): ?>
<?= $this->icon('success.png', 'Module is enabled') ?>
<?= $this->icon('success.png', $this->translate('Module is enabled')) ?>
<?php else: ?>
<?= $this->icon('remove.png', 'Module is disabled') ?>
<?= $this->icon('remove.png', $this->translate('Module is disabled')) ?>
<? endif ?>
<a href="<?= $this->url(
'config/module/',
Expand Down
Expand Up @@ -274,7 +274,7 @@ private function drawHostGroupPie($query)
),
'colors' => array('#44bb77', '#ff4444', '#ff0000', '#E066FF', '#f099FF', '#fefefe'),
'labels'=> array(
(int) $query->hosts_up . ' Up Hosts',
(int) $query->hosts_up . t(' Up Hosts'),
(int) $query->hosts_down_handled . t(' Down Hosts (Handled)'),
(int) $query->hosts_down_unhandled . t(' Down Hosts (Unhandled)'),
(int) $query->hosts_unreachable_handled . t(' Unreachable Hosts (Handled)'),
Expand All @@ -294,7 +294,7 @@ private function drawHostGroupPie($query)
),
'colors' => array('#44bb77', '#ff4444', '#ff0000', '#ffff00', '#ffff33', '#E066FF', '#f099FF', '#fefefe'),
'labels'=> array(
$query->services_ok . ' Up Services',
$query->services_ok . t(' Up Services'),
$query->services_warning_handled . t(' Warning Services (Handled)'),
$query->services_warning_unhandled . t(' Warning Services (Unhandled)'),
$query->services_critical_handled . t(' Down Services (Handled)'),
Expand Down
Expand Up @@ -115,14 +115,17 @@ public function init()
if ($targetConfig->get($instance)) {
$this->target = new CommandPipe($targetConfig->get($instance));
} else {
throw new ConfigurationError('Instance is not configured: %s', $instance);
throw new ConfigurationError(
$this->translate('Instance is not configured: %s'),
$instance
);
}
} else {
if ($targetConfig && $targetInfo = $targetConfig->current()) {
// Take the very first section
$this->target = new CommandPipe($targetInfo);
} else {
throw new ConfigurationError('No instances are configured yet');
throw new ConfigurationError($this->translate('No instances are configured yet'));
}
}
}
Expand Down
80 changes: 40 additions & 40 deletions modules/monitoring/application/controllers/ListController.php
Expand Up @@ -143,12 +143,12 @@ public function hostsAction()
$this->applyFilters($query);

$this->setupSortControl(array(
'host_last_check' => 'Last Check',
'host_severity' => 'Severity',
'host_name' => 'Hostname',
'host_address' => 'Address',
'host_state' => 'Current State',
'host_state' => 'Hard State'
'host_last_check' => $this->translate('Last Check'),
'host_severity' => $this->translate('Severity'),
'host_name' => $this->translate('Hostname'),
'host_address' => $this->translate('Address'),
'host_state' => $this->translate('Current State'),
'host_state' => $this->translate('Hard State')
));
$this->view->hosts = $query->paginate();
}
Expand Down Expand Up @@ -220,16 +220,16 @@ public function servicesAction()

$this->applyFilters($query);
$this->setupSortControl(array(
'service_last_check' => 'Last Service Check',
'service_severity' => 'Severity',
'service_state' => 'Current Service State',
'service_description' => 'Service Name',
'service_state_type' => 'Hard State',
'host_severity' => 'Host Severity',
'host_state' => 'Current Host State',
'host_name' => 'Host Name',
'host_address' => 'Host Address',
'host_last_check' => 'Last Host Check'
'service_last_check' => $this->translate('Last Service Check'),
'service_severity' => $this->translate('Severity'),
'service_state' => $this->translate('Current Service State'),
'service_description' => $this->translate('Service Name'),
'service_state_type' => $this->translate('Hard State'),
'host_severity' => $this->translate('Host Severity'),
'host_state' => $this->translate('Current Host State'),
'host_name' => $this->translate('Host Name'),
'host_address' => $this->translate('Host Address'),
'host_last_check' => $this->translate('Last Host Check')
));
$limit = $this->params->get('limit');
$this->view->limit = $limit;
Expand Down Expand Up @@ -291,15 +291,15 @@ public function downtimesAction()
$this->applyFilters($query);
$this->view->downtimes = $query->paginate();
$this->setupSortControl(array(
'downtime_is_in_effect' => 'Is In Effect',
'downtime_host' => 'Host / Service',
'downtime_entry_time' => 'Entry Time',
'downtime_author' => 'Author',
'downtime_start' => 'Start Time',
'downtime_start' => 'End Time',
'downtime_scheduled_start' => 'Scheduled Start',
'downtime_scheduled_end' => 'Scheduled End',
'downtime_duration' => 'Duration',
'downtime_is_in_effect' => $this->translate('Is In Effect'),
'downtime_host' => $this->translate('Host / Service'),
'downtime_entry_time' => $this->translate('Entry Time'),
'downtime_author' => $this->translate('Author'),
'downtime_start' => $this->translate('Start Time'),
'downtime_start' => $this->translate('End Time'),
'downtime_scheduled_start' => $this->translate('Scheduled Start'),
'downtime_scheduled_end' => $this->translate('Scheduled End'),
'downtime_duration' => $this->translate('Duration'),
));
$this->view->delDowntimeForm = new DeleteDowntimeCommandForm();
}
Expand All @@ -322,7 +322,7 @@ public function notificationsAction()
$this->applyFilters($query);
$this->view->notifications = $query->paginate();
$this->setupSortControl(array(
'notification_start_time' => 'Notification Start'
'notification_start_time' => $this->translate('Notification Start')
));
}

Expand Down Expand Up @@ -353,12 +353,12 @@ public function contactsAction()
$this->view->contacts = $query->paginate();

$this->setupSortControl(array(
'contact_name' => 'Name',
'contact_alias' => 'Alias',
'contact_email' => 'Email',
'contact_pager' => 'Pager Address / Number',
'contact_notify_service_timeperiod' => 'Service Notification Timeperiod',
'contact_notify_host_timeperiod' => 'Host Notification Timeperiod'
'contact_name' => $this->translate('Name'),
'contact_alias' => $this->translate('Alias'),
'contact_email' => $this->translate('Email'),
'contact_pager' => $this->translate('Pager Address / Number'),
'contact_notify_service_timeperiod' => $this->translate('Service Notification Timeperiod'),
'contact_notify_host_timeperiod' => $this->translate('Host Notification Timeperiod')
));
}

Expand Down Expand Up @@ -453,10 +453,10 @@ public function commentsAction()

$this->setupSortControl(
array(
'comment_timestamp' => 'Comment Timestamp',
'comment_host' => 'Host / Service',
'comment_type' => 'Comment Type',
'comment_expiration' => 'Expiration',
'comment_timestamp' => $this->translate('Comment Timestamp'),
'comment_host' => $this->translate('Host / Service'),
'comment_type' => $this->translate('Comment Type'),
'comment_expiration' => $this->translate('Expiration'),
)
);
$this->view->delCommentForm = new DeleteCommentCommandForm();
Expand Down Expand Up @@ -489,7 +489,7 @@ public function servicegroupsAction()
$this->applyFilters($query);
$this->view->servicegroups = $query->paginate();
$this->setupSortControl(array(
'servicegroup_name' => 'Servicegroup Name'
'servicegroup_name' => $this->translate('Servicegroup Name')
));
}

Expand Down Expand Up @@ -520,7 +520,7 @@ public function hostgroupsAction()
$this->applyFilters($query);
$this->view->hostgroups = $query->paginate();
$this->setupSortControl(array(
'hostgroup_name' => 'Hostgroup Name'
'hostgroup_name' => $this->translate('Hostgroup Name')
));
}

Expand Down Expand Up @@ -565,8 +565,8 @@ public function servicematrixAction()
));
$this->applyFilters($query);
$this->setupSortControl(array(
'host_name' => 'Hostname',
'service_description' => 'Service description'
'host_name' => $this->translate('Hostname'),
'service_description' => $this->translate('Service description')
));
$pivot = $query->pivot('service_description', 'host_name');
$this->view->pivot = $pivot;
Expand Down
24 changes: 12 additions & 12 deletions modules/monitoring/application/controllers/MultiController.php
Expand Up @@ -59,12 +59,12 @@ public function hostAction()

// Handle configuration changes
$this->handleConfigurationForm(array(
'host_passive_checks_enabled' => 'Passive Checks',
'host_active_checks_enabled' => 'Active Checks',
'host_notifications_enabled' => 'Notifications',
'host_event_handler_enabled' => 'Event Handler',
'host_flap_detection_enabled' => 'Flap Detection',
'host_obsessing' => 'Obsessing'
'host_passive_checks_enabled' => $this->translate('Passive Checks'),
'host_active_checks_enabled' => $this->translate('Active Checks'),
'host_notifications_enabled' => $this->translate('Notifications'),
'host_event_handler_enabled' => $this->translate('Event Handler'),
'host_flap_detection_enabled' => $this->translate('Flap Detection'),
'host_obsessing' => $this->translate('Obsessing')
));
}

Expand Down Expand Up @@ -127,12 +127,12 @@ public function serviceAction()
$this->view->errors = $errors;

$this->handleConfigurationForm(array(
'service_passive_checks_enabled' => 'Passive Checks',
'service_active_checks_enabled' => 'Active Checks',
'service_notifications_enabled' => 'Notifications',
'service_event_handler_enabled' => 'Event Handler',
'service_flap_detection_enabled' => 'Flap Detection',
'service_obsessing' => 'Obsessing',
'service_passive_checks_enabled' => $this->translate('Passive Checks'),
'service_active_checks_enabled' => $this->translate('Active Checks'),
'service_notifications_enabled' => $this->translate('Notifications'),
'service_event_handler_enabled' => $this->translate('Event Handler'),
'service_flap_detection_enabled' => $this->translate('Flap Detection'),
'service_obsessing' => $this->translate('Obsessing'),
));
}

Expand Down
Expand Up @@ -56,10 +56,12 @@ public function createElements(array $formData)
'protected_customvars',
array(
'required' => true,
'label' => 'Protected Custom Variables',
'description' => 'Comma separated case insensitive list of protected custom variables.'
'label' => t('Protected Custom Variables'),
'description' => t(
'Comma separated case insensitive list of protected custom variables.'
. ' Use * as a placeholder for zero or more wildcard characters.'
. ' Existance of those custom variables will be shown, but their values will be masked.'
)
)
);
}
Expand Down
28 changes: 14 additions & 14 deletions modules/monitoring/application/views/scripts/layout/topbar.phtml
@@ -1,64 +1,64 @@
<div class="nav navbar-nav topbar-host-status-summary">
<span class="topbar-status-up">
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 0)); ?>" title="Hosts Up">
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 0)); ?>" title="<?= $this->translate('Hosts Up') ?>">
<?= $hostSummary->hosts_up ?>
</a>
</span>
<span class="topbar-status-down">
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 1, 'host_unhandled' => 1)); ?>" title="Hosts Down Unhandled">
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 1, 'host_unhandled' => 1)); ?>" title="<?= $this->translate('Hosts Down Unhandled') ?>">
<?= $hostSummary->hosts_down_unhandled ?>
</a>/
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 1, 'host_handled' => 1)); ?>" title="Hosts Down Handled">
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 1, 'host_handled' => 1)); ?>" title="<?= $this->translate('Hosts Down Handled') ?>">
<?= $hostSummary->hosts_down_handled ?>
</a>
</span>
<span class="topbar-status-unreachable">
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 2, 'host_unhandled' => 1)); ?>" title="Hosts Unreachable Unhandled">
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 2, 'host_unhandled' => 1)); ?>" title="<?= $this->translate('Hosts Unreachable Unhandled') ?>">
<?= $hostSummary->hosts_unreachable_unhandled ?>
</a>/
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 2, 'host_handled' => 1)); ?>" title="Hosts Unreachable Handled">
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 2, 'host_handled' => 1)); ?>" title="<?= $this->translate('Hosts Unreachable Handled') ?>">
<?= $hostSummary->hosts_unreachable_handled ?>
</a>
</span>
<span class="topbar-status-pending">
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 99)); ?>" title="Hosts Pending">
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 99)); ?>" title="<?= $this->translate('Hosts Pending') ?>">
<?= $hostSummary->hosts_pending ?>
</a>
</span>
</div>

<div class="nav navbar-nav topbar-service-status-summary">
<span class="topbar-status-ok">
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 0)); ?>" title="Services Ok">
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 0)); ?>" title="<?= $this->translate('Services Ok') ?>">
<?= $serviceSummary->services_ok ?>
</a>
</span>
<span class="topbar-status-critical">
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 2, 'service_unhandled' => 1)); ?>" title="Services Critical Unhandled">
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 2, 'service_unhandled' => 1)); ?>" title="<?= $this->translate('Services Critical Unhandled') ?>">
<?= $serviceSummary->services_critical_unhandled ?>
</a>/
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 2, 'service_handled' => 1)); ?>" title="Services Critical Handled">
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 2, 'service_handled' => 1)); ?>" title="<?= $this->translate('Services Critical Handled') ?>">
<?= $serviceSummary->services_critical_handled ?>
</a>
</span>
<span class="topbar-status-warning">
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 1, 'service_unhandled' => 1)); ?>" title="Services Warning Unhandled">
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 1, 'service_unhandled' => 1)); ?>" title="<?= $this->translate('Services Warning Unhandled') ?>">
<?= $serviceSummary->services_warning_unhandled ?>
</a>/
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 1, 'service_handled' => 1)); ?>" title="Services Warning Handled">
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 1, 'service_handled' => 1)); ?>" title="<?= $this->translate('Services Warning Handled') ?>">
<?= $serviceSummary->services_warning_handled ?>
</a>
</span>
<span class="topbar-status-unknown">
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 3, 'service_unhandled' => 1)); ?>" title="Services Unknown Unhandled">
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 3, 'service_unhandled' => 1)); ?>" title="<?= $this->translate('Services Unknown Unhandled') ?>">
<?= $serviceSummary->services_unknown_unhandled ?>
</a>/
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 3, 'service_handled' => 1)); ?>" title="Services Unknown Handled">
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 3, 'service_handled' => 1)); ?>" title="<?= $this->translate('Services Unknown Handled') ?>">
<?= $serviceSummary->services_unknown_handled ?>
</a>
</span>
<span class="topbar-status-pending">
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 99)); ?>" title="Services Pending">
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 99)); ?>" title="<?= $this->translate('Services Pending') ?>">
<?= $serviceSummary->services_pending ?>
</a>
</span>
Expand Down

0 comments on commit 3ee9cd2

Please sign in to comment.