Use View::translate() instead of mt() and t() ...

This commit is contained in:
Johannes Meyer 2015-02-23 16:42:25 +01:00
parent f6ea02fec5
commit 48286e0d59
4 changed files with 17 additions and 17 deletions

View File

@ -4,7 +4,7 @@
<div class="content"> <div class="content">
<h1 tabindex="0" id="application-configuration"> <h1 tabindex="0" id="application-configuration">
<?= t('Generic Configuration'); ?> <?= $this->translate('General Configuration'); ?>
</h1> </h1>
<?php if (isset($this->messageBox)): ?> <?php if (isset($this->messageBox)): ?>
<?= $this->messageBox->render() ?> <?= $this->messageBox->render() ?>

View File

@ -9,7 +9,7 @@
<div data-base-target="_next" class="content contacts"> <div data-base-target="_next" class="content contacts">
<?php <?php
if (count($contacts) === 0) { if (count($contacts) === 0) {
echo mt('monitoring', 'No contacts matching the filter'); echo $this->translate('No contacts matching the filter');
return; return;
} }
foreach ($contacts as $contact): ?> foreach ($contacts as $contact): ?>
@ -26,7 +26,7 @@
) ?></div> ) ?></div>
<?php if ($contact->contact_pager): ?> <?php if ($contact->contact_pager): ?>
<div> <div>
<?= mt('monitoring', 'Pager') ?>: <?= $this->translate('Pager') ?>:
<?= $this->escape($contact->contact_pager) ?> <?= $this->escape($contact->contact_pager) ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
@ -34,13 +34,13 @@
<div class="notification-periods"> <div class="notification-periods">
<?php if ($contact->contact_notify_service_timeperiod): ?> <?php if ($contact->contact_notify_service_timeperiod): ?>
<div> <div>
<?= mt('monitoring', 'Service notification period') ?>: <?= $this->translate('Service notification period') ?>:
<?= $this->escape($contact->contact_notify_service_timeperiod) ?> <?= $this->escape($contact->contact_notify_service_timeperiod) ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php if ($contact->contact_notify_host_timeperiod): ?> <?php if ($contact->contact_notify_host_timeperiod): ?>
<div> <div>
<?= mt('monitoring', 'Host notification period') ?>: <?= $this->translate('Host notification period') ?>:
<?= $this->escape($contact->contact_notify_host_timeperiod) ?> <?= $this->escape($contact->contact_notify_host_timeperiod) ?>
</div> </div>
<?php endif; ?> <?php endif; ?>

View File

@ -18,39 +18,39 @@ use Icinga\Web\Widget\Chart\HistoryColorGrid;
$settings = array( $settings = array(
'cnt_up' => array( 'cnt_up' => array(
'tooltip' => mt('monitoring', '%d ok on %s'), 'tooltip' => $this->translate('%d hosts ok on %s'),
'color' => '#49DF96', 'color' => '#49DF96',
'opacity' => '0.55' 'opacity' => '0.55'
), ),
'cnt_unreachable_hard' => array( 'cnt_unreachable_hard' => array(
'tooltip' => mt('monitoring', '%d unreachable on %s'), 'tooltip' => $this->translate('%d hosts unreachable on %s'),
'color' => '#77AAFF', 'color' => '#77AAFF',
'opacity' => '0.55' 'opacity' => '0.55'
), ),
'cnt_critical_hard' => array( 'cnt_critical_hard' => array(
'tooltip' => mt('monitoring', '%d critical on %s'), 'tooltip' => $this->translate('%d services critical on %s'),
'color' => '#ff5566', 'color' => '#ff5566',
'opacity' => '0.9' 'opacity' => '0.9'
), ),
'cnt_warning_hard' => array( 'cnt_warning_hard' => array(
'tooltip' => mt('monitoring', '%d warning on %s'), 'tooltip' => $this->translate('%d services warning on %s'),
'color' => '#ffaa44', 'color' => '#ffaa44',
'opacity' => '1.0' 'opacity' => '1.0'
), ),
'cnt_down_hard' => array( 'cnt_down_hard' => array(
'tooltip' => mt('monitoring', '%d down on %s'), 'tooltip' => $this->translate('%d hosts down on %s'),
'color' => '#ff5566', 'color' => '#ff5566',
'opacity' => '0.9' 'opacity' => '0.9'
), ),
'cnt_unknown_hard' => array( 'cnt_unknown_hard' => array(
'tooltip' => mt('monitoring', '%d unknown on %s'), 'tooltip' => $this->translate('%d services unknown on %s'),
'color' => '#cc77ff', 'color' => '#cc77ff',
'opacity' => '0.7' 'opacity' => '0.7'
), ),
'cnt_ok' => array( 'cnt_ok' => array(
'tooltip' => mt('monitoring', '%d ok on %s'), 'tooltip' => $this->translate('%d services ok on %s'),
'color' => '#49DF96', 'color' => '#49DF96',
'opacity' => '0.55' 'opacity' => '0.55'
) )
@ -66,7 +66,7 @@ if ($to - $from > 315360000) {
$data = array(); $data = array();
if (count($summary) === 0) { if (count($summary) === 0) {
echo mt('monitoring', 'No state changes in the selected time period.'); echo $this->translate('No state changes in the selected time period.');
} }
foreach ($summary as $entry) { foreach ($summary as $entry) {
$day = $entry->day; $day = $entry->day;

View File

@ -19,23 +19,23 @@
</tr> </tr>
<?php if ($contact->contact_email): ?> <?php if ($contact->contact_email): ?>
<tr> <tr>
<th><?= mt('monitoring', 'Email') ?></th>
<td><?= sprintf('<a href="mailto:%1$s">%1$s</a>', $this->escape($contact->contact_email)) ?></td> <td><?= sprintf('<a href="mailto:%1$s">%1$s</a>', $this->escape($contact->contact_email)) ?></td>
<th><?= $this->translate('Email') ?></th>
</tr> </tr>
<?php endif ?> <?php endif ?>
<?php if ($contact->contact_pager): ?> <?php if ($contact->contact_pager): ?>
<tr> <tr>
<th><?= mt('monitoring', 'Pager') ?></th> <th><?= $this->translate('Pager') ?></th>
<td><?= $this->escape($contact->contact_pager) ?></td> <td><?= $this->escape($contact->contact_pager) ?></td>
</tr> </tr>
<?php endif ?> <?php endif ?>
<tr> <tr>
<th><?= mt('monitoring', 'Hosts') ?></th> <th><?= $this->translate('Hosts') ?></th>
<td><?= $this->escape($contactHelper->contactFlags($contact, 'host')) ?><br /> <td><?= $this->escape($contactHelper->contactFlags($contact, 'host')) ?><br />
<?= $this->escape($contact->contact_notify_host_timeperiod) ?></td> <?= $this->escape($contact->contact_notify_host_timeperiod) ?></td>
</tr> </tr>
<tr> <tr>
<th><?= mt('monitoring', 'Services') ?></th> <th><?= $this->translate('Services') ?></th>
<td><?= $this->escape($contactHelper->contactFlags($contact, 'service')) ?><br /> <td><?= $this->escape($contactHelper->contactFlags($contact, 'service')) ?><br />
<?= $this->escape($contact->contact_notify_service_timeperiod) ?></td> <?= $this->escape($contact->contact_notify_service_timeperiod) ?></td>
</tr> </tr>