Improve plural string translation

Improve plural translation for some statements

refs #8000
This commit is contained in:
Carlos Cesario 2014-12-05 10:45:10 -02:00
parent f0b470870a
commit 571df0a5ab
8 changed files with 24 additions and 24 deletions

View File

@ -222,4 +222,4 @@
<?php endforeach ?>
</tbody>
</table>
</div>
</div>

View File

@ -222,4 +222,4 @@
<?php endforeach ?>
</tbody>
</table>
</div>
</div>

View File

@ -7,7 +7,7 @@ $currentUrl = Url::fromRequest()->without('limit')->getRelativeUrl();
?>
<h1 class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : '' ?>>
<?php if ($object->stats->services_total > 0): ?>
<?= $this->qlink(sprintf($this->translate('%s configured services:'), $object->stats->services_total), $selfUrl) ?>
<?= $this->qlink(sprintf($this->translatePlural('%d configured service:', '%d configured services:', $object->stats->services_total), $object->stats->services_total), $selfUrl) ?>
<?php else: ?>
<?= $this->translate('No services configured on this host'); ?>
<?php endif; ?>

View File

@ -17,7 +17,7 @@
'monitoring/list/hosts',
array('host_active_checks_enabled' => 1)
); ?>">
<?= $this->statusSummary->hosts_active . ' ' . $this->translate('Active'); ?>
<?= sprintf($this->translatePlural('%d Active', '%d Active', $this->statusSummary->hosts_active), $this->statusSummary->hosts_active); ?>
</a>
</div>
<?php endif ?>
@ -27,7 +27,7 @@
'monitoring/list/hosts',
array('host_active_checks_enabled' => 0, 'host_passive_checks_enabled' => 1)
); ?>">
<?= $this->statusSummary->hosts_passive . ' ' . $this->translate('Passive'); ?>
<?= sprintf($this->translatePlural('%d Passive', '%d Passive', $this->statusSummary->hosts_passive), $this->statusSummary->hosts_passive); ?>
</a>
</div>
<?php endif ?>
@ -37,7 +37,7 @@
'monitoring/list/hosts',
array('host_active_checks_enabled' => 0, 'host_passive_checks_enabled' => 0)
); ?>" style="color: red;">
<?= $this->statusSummary->hosts_not_checked . ' ' . $this->translate('Disabled'); ?>
<?= sprintf($this->translatePlural('%d Disabled', '%d Disabled', $this->statusSummary->hosts_not_checked), $this->statusSummary->hosts_not_checked); ?>
</a>
</div>
<?php endif ?>
@ -49,7 +49,7 @@
'monitoring/list/services',
array('service_active_checks_enabled' => 1)
); ?>">
<?= $this->statusSummary->services_active . ' ' . $this->translate('Active'); ?>
<?= sprintf($this->translatePlural('%d Active', '%d Active', $this->statusSummary->services_active), $this->statusSummary->services_active); ?>
</a>
</div>
<?php endif ?>
@ -59,7 +59,7 @@
'monitoring/list/services',
array('service_active_checks_enabled' => 0, 'service_passive_checks_enabled' => 1)
); ?>">
<?= $this->statusSummary->services_passive . ' ' . $this->translate('Passive'); ?>
<?= $this->statusSummary->services_passive . ' ' . $this->translatePlural('Passive', 'Passive', $this->statusSummary->services_passive); ?>
</a>
</div>
<?php endif ?>
@ -69,7 +69,7 @@
'monitoring/list/services',
array('service_active_checks_enabled' => 0, 'service_passive_checks_enabled' => 0)
); ?>" style="color: red;">
<?= $this->statusSummary->services_not_checked . ' ' . $this->translate('Disabled'); ?>
<?= sprintf($this->translatePlural('%d Disabled', '%d Disabled', $this->statusSummary->services_not_checked), $this->statusSummary->services_not_checked); ?>
</a>
</div>
<?php endif ?>

View File

@ -17,7 +17,7 @@
'monitoring/list/hosts',
array('host_flap_detection_enabled' => 0)
); ?>" class="feature-highlight">
<?= sprintf($this->translate('%d hosts disabled'), $this->statusSummary->hosts_without_flap_detection); ?>
<?= sprintf($this->translatePlural('%d host disabled', '%d hosts disabled', $this->statusSummary->hosts_without_flap_detection), $this->statusSummary->hosts_without_flap_detection); ?>
</a>
<?php else: ?>
<div class="box entry">
@ -33,7 +33,7 @@
'monitoring/list/hosts',
array('host_is_flapping' => 1)
); ?>" class="feature-highlight">
<?= sprintf($this->translate('%d hosts flapping'), $this->statusSummary->hosts_flapping); ?>
<?= sprintf($this->translatePlural('%d host flapping', '%d hosts flapping', $this->statusSummary->hosts_flapping), $this->statusSummary->hosts_flapping); ?>
</a>
<?php endif ?>
</div>
@ -45,7 +45,7 @@
'monitoring/list/services',
array('service_flap_detection_enabled' => 0)
); ?>" class="feature-highlight">
<?= sprintf($this->translate('%d services disabled'), $this->statusSummary->services_without_flap_detection); ?>
<?= sprintf($this->translatePlural('%d service disabled', '%d services disabled', $this->statusSummary->services_without_flap_detection), $this->statusSummary->services_without_flap_detection); ?>
</a>
<?php else: ?>
<div class="box entry">
@ -61,7 +61,7 @@
'monitoring/list/services',
array('service_is_flapping' => 1)
); ?>" class="feature-highlight">
<?= sprintf($this->translate('%d services flapping'), $this->statusSummary->services_flapping); ?>
<?= sprintf($this->translatePlural('%d service flapping', '%d services flapping', $this->statusSummary->services_flapping), $this->statusSummary->services_flapping); ?>
</a>
<?php endif ?>
</div>
@ -84,7 +84,7 @@
'monitoring/list/hosts',
array('host_notifications_enabled' => 0)
); ?>" class="feature-highlight">
<?= sprintf($this->translate('%d hosts disabled'), $this->statusSummary->hosts_not_triggering_notifications); ?>
<?= sprintf($this->translatePlural('%d host disabled', '%d hosts disabled', $this->statusSummary->hosts_not_triggering_notifications), $this->statusSummary->hosts_not_triggering_notifications); ?>
</a>
<?php else: ?>
<div class="box entry ">
@ -104,7 +104,7 @@
'monitoring/list/services',
array('service_notifications_enabled' => 0)
); ?>" class="feature-highlight">
<?= sprintf($this->translate('%d services disabled'), $this->statusSummary->services_not_triggering_notifications); ?>
<?= sprintf($this->translatePlural('%d service disabled', '%d services disabled', $this->statusSummary->services_not_triggering_notifications), $this->statusSummary->services_not_triggering_notifications); ?>
</a>
<?php else: ?>
<div class="box entry">
@ -135,7 +135,7 @@
'monitoring/list/hosts',
array('host_event_handler_enabled' => 0)
); ?>" class="feature-highlight">
<?= sprintf($this->translate('%d hosts disabled'), $this->statusSummary->hosts_not_processing_event_handlers); ?>
<?= sprintf($this->translatePlural('%d host disabled', '%d hosts disabled', $this->statusSummary->hosts_not_processing_event_handlers), $this->statusSummary->hosts_not_processing_event_handlers); ?>
</a>
<?php else: ?>
<div class="box entry">
@ -155,7 +155,7 @@
'monitoring/list/services',
array('service_event_handler_enabled' => 0)
); ?>" class="feature-highlight">
<?= sprintf($this->translate('%d services disabled'), $this->statusSummary->services_not_processing_event_handlers); ?>
<?= sprintf($this->translatePlural('%d service disabled', '%d services disabled', $this->statusSummary->services_not_processing_event_handlers), $this->statusSummary->services_not_processing_event_handlers); ?>
</a>
<?php else: ?>
<div class="box entry">

View File

@ -12,14 +12,14 @@ $service_problems = (
<?php if ($this->statusSummary->hosts_up): ?>
<h2>
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 0)); ?>">
<?= sprintf($this->translate('%d Hosts UP'), $this->statusSummary->hosts_up); ?>
<?= sprintf($this->translatePlural('%d Host UP', '%d Hosts UP', $this->statusSummary->hosts_up), $this->statusSummary->hosts_up); ?>
</a>
</h2>
<?php endif ?>
<?php if ($this->statusSummary->hosts_pending): ?>
<h2>
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 99)); ?>">
<?= sprintf($this->translate('%d Hosts PENDING'), $this->statusSummary->hosts_pending); ?>
<?= sprintf($this->translatePlural('%d Host PENDING', '%d Hosts PENDING', $this->statusSummary->hosts_pending), $this->statusSummary->hosts_pending); ?>
</a>
</h2>
<?php endif ?>

View File

@ -5,7 +5,7 @@
'monitoring/list/services',
array('host_problem' => $host_problem, 'service_state' => 2, 'service_acknowledged' => 0, 'service_in_downtime' => 0)
); ?>">
<?= $services_critical_unhandled; ?> <?= $this->translate('CRITICAL', 'icinga.state') ?>
<?= sprintf($this->translatePlural('%d CRITICAL', '%d CRITICAL', $services_critical_unhandled, 'icinga.state'), $services_critical_unhandled); ?>
</a>
<?php endif ?>
<?php if ($services_critical_handled): ?>
@ -145,7 +145,7 @@
'monitoring/list/services',
array('host_problem' => $host_problem, 'service_state' => 3, 'service_acknowledged' => 0, 'service_in_downtime' => 0)
); ?>">
<?= $services_unknown_unhandled; ?> <?= $this->translate('UNKNOWN', 'icinga.state') ?>
<?= sprintf($this->translatePlural('%d UNKNOWN', '%d UNKNOWN', $services_unknown_unhandled, 'icinga.state'), $services_unknown_unhandled) ?>
</a>
<?php endif ?>
<?php if ($services_unknown_handled): ?>
@ -249,7 +249,7 @@
'monitoring/list/services',
array('host_problem' => $host_problem, 'service_state' => 99)
); ?>">
<?= $services_pending; ?> <?= $this->translate('PENDING', 'icinga.state') ?>
<?= sprintf($this->translatePlural('%d PENDING', '%d PENDING', $services_pending, 'icinga.state'), $services_pending); ?>
</a>
<?php if ($services_pending_not_checked): ?>
<a href="<?= $this->href(

View File

@ -7,14 +7,14 @@
<?php if ($this->statusSummary->hosts_down): ?>
<h2>
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 1)); ?>">
<?= sprintf($this->translate('%d Hosts DOWN'), $this->statusSummary->hosts_down); ?>
<?= sprintf($this->translatePlural('%d Host DOWN', '%d Hosts DOWN', $this->statusSummary->hosts_down), $this->statusSummary->hosts_down); ?>
</a>
</h2>
<?php endif ?>
<?php if ($this->statusSummary->hosts_unreachable): ?>
<h2>
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 2)); ?>">
<?= sprintf($this->translate('%d Hosts UNREACHABLE'), $this->statusSummary->hosts_unreachable); ?>
<?= sprintf($this->translatePlural('%d Host UNREACHABLE', '%d Hosts UNREACHABLE', $this->statusSummary->hosts_unreachable), $this->statusSummary->hosts_unreachable); ?>
</a>
</h2>
<?php endif ?>