Translation: use translation for monitoring/views

Just a bunch of translation-helper calls

refs #6339
This commit is contained in:
Thomas Gelf 2014-05-27 21:44:02 +00:00
parent 360ac87550
commit b47cec3e02
14 changed files with 35 additions and 35 deletions

View File

@ -1,14 +1,14 @@
<div class="controls">
<?= $this->tabs->render($this); ?>
<div style="margin: 1em" class="dontprint">
Sort by <?= $this->sortControl->render($this); ?>
<?= $this->translate('Sort by') ?> <?= $this->sortControl->render($this); ?>
</div>
<?= $this->paginationControl($history, null, null, array('preserve' => $this->preserve)); ?>
</div>
<div class="content">
<?php if (empty($history)): ?>
No entries found
<?= $this->translate('No entries found') ?>
</div>
<?php return; endif ?>

View File

@ -4,7 +4,7 @@ $helper = $this->getHelper('MonitoringState');
<div class="controls">
<?= $this->tabs ?>
<div style="margin: 1em;" class="dontprint">
Sort by <?= $this->sortControl->render($this); ?>
<?= $this->translate('Sort by') ?> <?= $this->sortControl->render($this); ?>
</div>
<?= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)); ?>
@ -15,7 +15,7 @@ Sort by <?= $this->sortControl->render($this); ?>
<?php
if ($hosts->count() === 0) {
echo 'No host found</div>';
echo $this->translate('No host found') . '</div>';
return;
}
?>
@ -78,10 +78,10 @@ if ($hosts->count() === 0) {
<strong><?= ucfirst($helper->monitoringState($host, 'host')); ?></strong><br />
<div class="small-row">
Since <?= $this->timeSince($host->host_last_state_change); ?>
<?= $this->translate('Since') ?> <?= $this->timeSince($host->host_last_state_change); ?>
<?php if ($host->host_state > 0): ?>
<br />
<strong><?= ($host->host_state_type === '1') ? 'Hard' : 'Soft'; ?> </strong> <?= $host->host_current_check_attempt; ?>/<?= $host->host_max_check_attempts; ?>
<strong><?= ($host->host_state_type === '1') ? $this->translate('Hard') : $this->translate('Soft') ?> </strong> <?= $host->host_current_check_attempt; ?>/<?= $host->host_max_check_attempts; ?>
<?php endif ?>
</div>
</div>

View File

@ -1,7 +1,7 @@
<div class="controls">
<?= $this->tabs ?>
<div style="margin: 1em" class="dontprint">
Sort by <?= $this->sortControl->render($this) ?>
<?= $this->translate('Sort by') ?> <?= $this->sortControl->render($this) ?>
<?= $this->selectionToolbar('single') ?>
</div>

View File

@ -2,7 +2,7 @@
<div class="controls">
<?= $this->tabs; ?>
<div style="margin: 1em;" class="dontprint">
<!--<?= $this->filterBox ?>-->Sort by <?= $this->sortControl ?>
<?= $this->translate('Sort by') ?> <?= $this->sortControl ?>
</div>
<?= $this->partial(
'pivottablePagination.phtml',

View File

@ -5,7 +5,7 @@ if (!$this->compact): ?>
<div class="controls">
<?= $this->tabs ?>
<div style="margin: 1em;" class="dontprint">
Sort by <?= $this->sortControl ?>
<?= $this->translate('Sort by') ?> <?= $this->sortControl ?>
</div>
<?= $this->paginationControl($services, null, null, array('preserve' => $this->preserve)) ?>
@ -39,9 +39,9 @@ foreach ($services as $service):
?>
<tr class="state <?= $serviceStateName ?><?= $service->service_handled ? ' handled' : '' ?>">
<td class="state" title="<?= $helper->getStateTitle($service, 'service'); ?>">
<strong><?= strtoupper($helper->monitoringState($service, 'service')); ?></strong><br />
<strong><?= $this->translate(strtoupper($helper->monitoringState($service, 'service'))) ?></strong><br />
<?php if (!$this->compact): ?>Since <?php endif ?><?= $this->timeSince($service->service_last_state_change); ?>
<?php if (!$this->compact): ?><?= $this->translate('Since') ?> <?php endif ?><?= $this->timeSince($service->service_last_state_change); ?>
<?php if ($service->service_state > 0 && (int) $service->service_state_type === 0): ?>
<br />
<strong>Soft <?= $service->service_attempt ?></strong>

View File

@ -22,19 +22,19 @@ if ($object instanceof Host && $object->host_acknowledged
|| $object instanceof Service && $object->service_acknowledged): ?>
<th>Issue acknowledged</th>
<td data-base-target="_self"><?= $cf->labelSubmitForm(
'Remove Acknowledgement',
'Remove problem acknowledgement',
$this->translate('Remove Acknowledgement'),
$this->translate('Remove problem acknowledgement'),
'link-like',
'removeacknowledgement',
$data
) ?>
<?php else: ?>
<th>Not acknowledged</th>
<th><?= $this->translate('Not acknowledged') ?></th>
<td>
<a href="<?= $this->href(
'monitoring/command/acknowledgeproblem',
$data
) ?>"><?= $this->icon('acknowledgement_petrol.png') ?> Acknowledge</a>
) ?>"><?= $this->icon('acknowledgement_petrol.png') ?> <?= $this->translate('Acknowledge') ?></a>
</td>
<?php endif ?>
</tr>

View File

@ -5,8 +5,8 @@ $cf = $this->getHelper('CommandForm');
?><tr>
<th><?= $this->translate('Last check') ?></th>
<td data-base-target="_self"><?= $this->img('img/icons/refresh_petrol.png') ?> <?= $cf->labelSubmitForm(
'Check now',
'Reschedule next check immediately',
$this->translate('Check now'),
$this->translate('Reschedule next check immediately'),
'link-like',
'reschedulenextcheck',
array(

View File

@ -10,7 +10,7 @@ $data = array(
?>
<tr class="newsection">
<th>Passive Checks</th>
<th><?= $this->translate('Passive Checks') ?></th>
<td data-base-target="_self"><?= $cf->toggleSubmitForm(
'',
$o->passive_checks_enabled,
@ -21,7 +21,7 @@ $data = array(
) ?></td>
</tr>
<tr>
<th>Active Checks</th>
<th><?= $this->translate('Active Checks') ?></th>
<td data-base-target="_self"><?= $cf->toggleSubmitForm(
'',
$o->active_checks_enabled,
@ -32,7 +32,7 @@ $data = array(
) ?></td>
</tr>
<tr>
<th>Notifications</th>
<th><?= $this->translate('Notifications') ?></th>
<td data-base-target="_self"><?= $cf->toggleSubmitForm(
'',
$o->notifications_enabled,
@ -43,7 +43,7 @@ $data = array(
) ?></td>
</tr>
<tr>
<th>Event Handler</th>
<th><?= $this->translate('Event Handler') ?></th>
<td data-base-target="_self"><?= $cf->toggleSubmitForm(
'',
$o->event_handler_enabled,
@ -54,7 +54,7 @@ $data = array(
) ?></td>
</tr>
<tr>
<th>Flap Detection</th>
<th><?= $this->translate('Flap Detection') ?></th>
<td data-base-target="_self"><?= $cf->toggleSubmitForm(
'',
$o->flap_detection_enabled,
@ -65,7 +65,7 @@ $data = array(
) ?></td>
</tr>
<tr>
<th>Obsessing</th>
<th><?= $this->translate('Obsessing') ?></th>
<td data-base-target="_self"><?= $cf->toggleSubmitForm(
'',
$o->obsessing,

View File

@ -5,8 +5,8 @@
<table class="objectstate">
<tr class="state <?= $this->monitoringState($object, 'host') ?><?= $object->host_handled ? ' handled' : '' ?>">
<td class="state"<?= $showService ? '' : ' rowspan="2"' ?>>
<?= $this->util()->getHostStateName($object->host_state) ?><br />
since <?= $this->timeSince($object->host_last_state_change) ?>
<?= $this->translate($this->util()->getHostStateName($object->host_state)) ?><br />
<?= $this->translate('Since') ?> <?= $this->timeSince($object->host_last_state_change) ?>
</td>
<td><b><?= $this->escape($object->host_name) ?></b><?php
if ($object->host_address && $object->host_address !== $object->host_name): ?>
@ -17,10 +17,10 @@
<?php if ($showService): ?>
<tr class="state <?= $this->monitoringState($object, 'service') ?><?= $object->service_handled ? ' handled' : '' ?>">
<td class="state">
<?= $this->util()->getServiceStateName($object->service_state); ?><br />
since <?= $this->timeSince($object->service_last_state_change) ?>
<?= $this->translate($this->util()->getServiceStateName($object->service_state)) ?><br />
<?= $this->translate('Since') ?> <?= $this->timeSince($object->service_last_state_change) ?>
</td>
<td><b>Service: <?= $this->escape($object->service_description) ?></b>
<td><b><?= $this->translate('Service') ?>: <?= $this->escape($object->service_description) ?></b>
<?= $this->render('show/components/statusIcons.phtml') ?>

View File

@ -7,7 +7,7 @@ if (in_array((int) $object->state, array(0, 99))) {
?>
<tr>
<th>Notifications</th>
<th><?= $this->translate('Notifications') ?></th>
<td>
<?php
@ -22,7 +22,7 @@ if ($object->current_notification_number > 0) {
$this->translate('%s notications have been sent for this issue'),
$object->current_notification_number
) . '<br />' . sprintf(
'The last one occured %s ago',
$this->translate('The last one occured %s ago'),
$this->timeSince($object->last_notification)
);
}

View File

@ -33,12 +33,12 @@ $states = array(
?><div class="controls">
<?= $this->render('show/components/header.phtml') ?>
<h1>This object's event history</h1>
<h1><?= $this->translate("This object's event history") ?></h1>
<?= $this->paginationControl($this->history, null, null, array('preserve' => $this->preserve)); ?>
</div>
<?php if($this->history->count() === 0): ?>
No History Available For This Object
<?= $this->translate('No History Available For This Object' ?>
</div>
<?php return; endif ?>

View File

@ -1,6 +1,6 @@
<div class="controls">
<?= $this->render('show/components/header.phtml') ?>
<h1>This host's current state</h1>
<h1><?= $this->translate("This host's current state") ?></h1>
</div>
<div class="content" data-base-target="_next">
<?= $this->render('show/components/output.phtml') ?>

View File

@ -1,6 +1,6 @@
<div class="controls">
<?= $this->render('show/components/header.phtml') ?>
<h1>This service's current state</h1>
<h1><?= $this->translate("This service's current state") ?></h1>
</div>
<div class="content" data-base-target="_next">
<?= $this->render('show/components/output.phtml') ?>

View File

@ -1,6 +1,6 @@
<div class="controls">
<?= $this->render('show/components/header.phtml') ?>
<h1>All services configured on this host</h1>
<h1><?= $this->translate('All services configured on this host') ?></h1>
</div>
<div class="content">
<?= preg_replace('~<table data-base-target="_next"~', '<table data-base-target="_self"', $services) /* TODO: find an elegant solution for this */ ?>