Fix translation

Remove calls to deprecated translation function. Always use plural forms for commands in multi-view to indicate that this will cause multiple commands to be issued.

refs #8565
This commit is contained in:
Matthias Jentsch 2015-03-06 15:22:14 +01:00
parent 5c71f5a8ef
commit 2591f055d8
4 changed files with 20 additions and 17 deletions

View File

@ -23,7 +23,7 @@ use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm;
<?= $this->icon('reschedule') ?>
<?= $this->translate('Commands') ?>
</h3>
<?= sprintf(t('Issue commands to all %d selected hosts:'), count($objects)) ?>
<?= sprintf($this->translate('Issue commands to all %d selected hosts:'), count($objects)) ?>
<?php if (($hostCount = count($objects)) === 0): ?>
<?= $this->translate('No hosts matching the filter'); ?>
@ -36,7 +36,7 @@ use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm;
<div>
<?= $this->qlink(
$this->translate('Reschedule the next check'),
$this->translate('Reschedule next checks'),
$rescheduleAllLink,
null,
array('icon' => 'reschedule')
@ -45,7 +45,7 @@ use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm;
<div>
<?= $this->qlink(
$this->translate('Schedule a downtime'),
$this->translate('Schedule downtimes'),
$downtimeAllLink,
null,
array('icon' => 'plug')
@ -54,7 +54,7 @@ use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm;
<div>
<?= $this->qlink(
$this->translate('Submit a passive check result'),
$this->translate('Submit passive check results'),
$processCheckResultAllLink,
null,
array('icon' => 'reply')
@ -63,7 +63,7 @@ use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm;
<div>
<?= $this->qlink(
$this->translate('Add a comment'),
$this->translate('Add comments'),
$addCommentLink,
null,
array('icon' => 'comment')
@ -85,7 +85,7 @@ use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm;
<p>
<?= sprintf(
t('There are %s unhandled problems. Issue commands to the problematic hosts:'),
$this->translate('There are %s unhandled problems. Issue commands to the problematic hosts:'),
'<span class="badge badge-critical">' . $unhandledCount . '</span>'
) ?>
@ -142,7 +142,7 @@ use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm;
<?php if (($inDowntimeCount = count($objectsInDowntime)) > 0): ?>
<h3><?= $this->translate('Downtimes') ?></h3>
<h3><?= $this->icon('plug', $this->translate('Downtimes'))?> <?=$this->translate('Downtimes')?></h3>
<p><?= sprintf(
$this->translatePlural(
'%u Host currently in downtime.',
@ -161,7 +161,7 @@ use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm;
<?php endif ?>
<?php if (($commentCount = count($objects->getComments())) > 0): ?>
<h3> <?= $this->translate('Comments') ?></h3>
<h3> <?= $this->icon('comment', $this->translate('Comments'))?> <?=$this->translate('Comments') ?></h3>
<p>
<?= sprintf(
$this->translatePlural(

View File

@ -74,7 +74,7 @@ $hiddenRich = array();
<td>
<div class="selection-info" data-title-rich="<span align='left'><?= join('<br>', $hiddenRich) ?></span>"
title="<?= join(', ', $hidden) ?>">
<?= sprintf(t('%d more ...'), count($hidden)) ?>
<?= sprintf($this->translate('%d more ...'), count($hidden)) ?>
</div>
</td>
</tr>

View File

@ -34,7 +34,9 @@ use Icinga\Web\Url;
<tr class="state <?= Service::getStateText($service->service_state); ?><?= $service->service_handled ? ' handled' : '' ?>">
<td class="state"><?= Service::getStateText($service->service_state, true); ?><br /></td>
<td>
<?php if (!$service->service_handled && $service->service_state > 0): ?>
<?= $this->icon('attention-alt', $this->translate('Unhandled')) ?>
<?php endif ?>
@ -60,6 +62,7 @@ use Icinga\Web\Url;
<?php if (isset($service->service_last_comment) && $service->service_last_comment !== null): ?>
<?= $this->icon('comment', $this->translate('Last Comment: ') . $service->service_last_comment) ?>
<?php endif ?>
</td>
<td class="name oneline"><?= $this->escape($service->getName()); ?></td>
<td class="name oneline"><?= $this->escape($service->getHost()->getName()); ?></b></td>
@ -72,7 +75,7 @@ use Icinga\Web\Url;
<td class="state">
<div data-title-rich="<span align='left'><?= join('<br>', $hiddenRich) ?></span>"
title="<?= join(', ', $hidden) ?>">
<?= sprintf(t('%d more ...'), count($hidden)) ?>
<?= sprintf($this->translate('%d more ...'), count($hidden)) ?>
</div>
</td>
</tr>

View File

@ -21,7 +21,7 @@ use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm;
<?php if (($serviceCount = count($objects)) === 0): ?>
<?= $this->translate('No services matching the filter'); ?>
<?php else: ?>
<?= sprintf(t('Issue commands to all %d selected services:'), count($objects)) ?>
<?= sprintf($this->translate('Issue commands to all %d selected services:'), count($objects)) ?>
<p>
<div>
@ -30,7 +30,7 @@ use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm;
<div>
<?= $this->qlink(
$this->translate('Reschedule the next check'),
$this->translate('Reschedule next checks'),
$rescheduleAllLink,
null,
array('icon' => 'reschedule')
@ -39,7 +39,7 @@ use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm;
<div>
<?= $this->qlink(
$this->translate('Schedule a downtime'),
$this->translate('Schedule downtimes'),
$downtimeAllLink,
null,
array('icon' => 'plug')
@ -48,7 +48,7 @@ use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm;
<div>
<?= $this->qlink(
$this->translate('Submit a passive check result'),
$this->translate('Submit passive check results'),
$processCheckResultAllLink,
null,
array('icon' => 'reply')
@ -57,7 +57,7 @@ use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm;
<div>
<?= $this->qlink(
$this->translate('Add a comment'),
$this->translate('Add comments'),
$addCommentLink,
null,
array('icon' => 'comment')
@ -76,7 +76,7 @@ use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm;
) ?>
</h3>
<p><?= sprintf(t('There are %s unhandled problems. ' .
<p><?= sprintf($this->translate('There are %s unhandled problems. ' .
'Issue commands to the problematic services:'),
'<span class="badge badge-critical">' . $unhandledCount . '</span>') ?>
@ -149,7 +149,7 @@ use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm;
<?php $commentCount = count($objects->getComments()) ?>
<?php if ($commentCount > 0): ?>
<h3> <?= $this->icon('comment') ?> <?= t('Comments') ?> </h3>
<h3> <?= $this->icon('comment') ?> <?= $this->translate('Comments') ?> </h3>
<p><?= sprintf(
$this->translatePlural(
'There is %d comment.',