From b47cec3e028446e4def7844acbc14f7b76dd5e39 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 27 May 2014 21:44:02 +0000 Subject: [PATCH] Translation: use translation for monitoring/views Just a bunch of translation-helper calls refs #6339 --- .../views/scripts/list/eventhistory.phtml | 4 ++-- .../application/views/scripts/list/hosts.phtml | 8 ++++---- .../views/scripts/list/notifications.phtml | 2 +- .../views/scripts/list/servicematrix.phtml | 2 +- .../application/views/scripts/list/services.phtml | 6 +++--- .../scripts/show/components/acknowledgement.phtml | 8 ++++---- .../scripts/show/components/checkstatistics.phtml | 4 ++-- .../views/scripts/show/components/flags.phtml | 12 ++++++------ .../views/scripts/show/components/header.phtml | 10 +++++----- .../scripts/show/components/notifications.phtml | 4 ++-- .../application/views/scripts/show/history.phtml | 4 ++-- .../application/views/scripts/show/host.phtml | 2 +- .../application/views/scripts/show/service.phtml | 2 +- .../application/views/scripts/show/services.phtml | 2 +- 14 files changed, 35 insertions(+), 35 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/eventhistory.phtml b/modules/monitoring/application/views/scripts/list/eventhistory.phtml index fb8e1b212..ba7034a1e 100644 --- a/modules/monitoring/application/views/scripts/list/eventhistory.phtml +++ b/modules/monitoring/application/views/scripts/list/eventhistory.phtml @@ -1,14 +1,14 @@
tabs->render($this); ?>
-Sort by sortControl->render($this); ?> +translate('Sort by') ?> sortControl->render($this); ?>
paginationControl($history, null, null, array('preserve' => $this->preserve)); ?>
-No entries found +translate('No entries found') ?>
diff --git a/modules/monitoring/application/views/scripts/list/hosts.phtml b/modules/monitoring/application/views/scripts/list/hosts.phtml index 4b13acb4b..bb169c892 100644 --- a/modules/monitoring/application/views/scripts/list/hosts.phtml +++ b/modules/monitoring/application/views/scripts/list/hosts.phtml @@ -4,7 +4,7 @@ $helper = $this->getHelper('MonitoringState');
tabs ?>
-Sort by sortControl->render($this); ?> +translate('Sort by') ?> sortControl->render($this); ?>
paginationControl($hosts, null, null, array('preserve' => $this->preserve)); ?> @@ -15,7 +15,7 @@ Sort by sortControl->render($this); ?> count() === 0) { - echo 'No host found
'; + echo $this->translate('No host found') . ''; return; } ?> @@ -78,10 +78,10 @@ if ($hosts->count() === 0) { monitoringState($host, 'host')); ?>
- Since timeSince($host->host_last_state_change); ?> + translate('Since') ?> timeSince($host->host_last_state_change); ?> host_state > 0): ?>
- host_state_type === '1') ? 'Hard' : 'Soft'; ?> host_current_check_attempt; ?>/host_max_check_attempts; ?> + host_state_type === '1') ? $this->translate('Hard') : $this->translate('Soft') ?> host_current_check_attempt; ?>/host_max_check_attempts; ?>
diff --git a/modules/monitoring/application/views/scripts/list/notifications.phtml b/modules/monitoring/application/views/scripts/list/notifications.phtml index 97b56a650..cd94600cc 100644 --- a/modules/monitoring/application/views/scripts/list/notifications.phtml +++ b/modules/monitoring/application/views/scripts/list/notifications.phtml @@ -1,7 +1,7 @@
tabs ?>
-Sort by sortControl->render($this) ?> +translate('Sort by') ?> sortControl->render($this) ?> selectionToolbar('single') ?>
diff --git a/modules/monitoring/application/views/scripts/list/servicematrix.phtml b/modules/monitoring/application/views/scripts/list/servicematrix.phtml index 224dd46c5..65dea6d4e 100644 --- a/modules/monitoring/application/views/scripts/list/servicematrix.phtml +++ b/modules/monitoring/application/views/scripts/list/servicematrix.phtml @@ -2,7 +2,7 @@
tabs; ?>
- Sort by sortControl ?> + translate('Sort by') ?> sortControl ?>
partial( 'pivottablePagination.phtml', diff --git a/modules/monitoring/application/views/scripts/list/services.phtml b/modules/monitoring/application/views/scripts/list/services.phtml index c807e68c8..d16690d52 100644 --- a/modules/monitoring/application/views/scripts/list/services.phtml +++ b/modules/monitoring/application/views/scripts/list/services.phtml @@ -5,7 +5,7 @@ if (!$this->compact): ?>
tabs ?>
-Sort by sortControl ?> +translate('Sort by') ?> sortControl ?>
paginationControl($services, null, null, array('preserve' => $this->preserve)) ?> @@ -39,9 +39,9 @@ foreach ($services as $service): ?> - monitoringState($service, 'service')); ?>
+ translate(strtoupper($helper->monitoringState($service, 'service'))) ?>
- compact): ?>Since timeSince($service->service_last_state_change); ?> + compact): ?>translate('Since') ?> timeSince($service->service_last_state_change); ?> service_state > 0 && (int) $service->service_state_type === 0): ?>
Soft service_attempt ?> diff --git a/modules/monitoring/application/views/scripts/show/components/acknowledgement.phtml b/modules/monitoring/application/views/scripts/show/components/acknowledgement.phtml index a96e98fdc..38359bf34 100644 --- a/modules/monitoring/application/views/scripts/show/components/acknowledgement.phtml +++ b/modules/monitoring/application/views/scripts/show/components/acknowledgement.phtml @@ -22,19 +22,19 @@ if ($object instanceof Host && $object->host_acknowledged || $object instanceof Service && $object->service_acknowledged): ?> Issue acknowledged labelSubmitForm( - 'Remove Acknowledgement', - 'Remove problem acknowledgement', + $this->translate('Remove Acknowledgement'), + $this->translate('Remove problem acknowledgement'), 'link-like', 'removeacknowledgement', $data ) ?> - Not acknowledged + translate('Not acknowledged') ?> icon('acknowledgement_petrol.png') ?> Acknowledge + ) ?>">icon('acknowledgement_petrol.png') ?> translate('Acknowledge') ?> diff --git a/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml b/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml index 3d564e1e1..e5cf0e0a4 100644 --- a/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml +++ b/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml @@ -5,8 +5,8 @@ $cf = $this->getHelper('CommandForm'); ?> translate('Last check') ?> img('img/icons/refresh_petrol.png') ?> labelSubmitForm( - 'Check now', - 'Reschedule next check immediately', + $this->translate('Check now'), + $this->translate('Reschedule next check immediately'), 'link-like', 'reschedulenextcheck', array( diff --git a/modules/monitoring/application/views/scripts/show/components/flags.phtml b/modules/monitoring/application/views/scripts/show/components/flags.phtml index 585520328..fb02b97a3 100644 --- a/modules/monitoring/application/views/scripts/show/components/flags.phtml +++ b/modules/monitoring/application/views/scripts/show/components/flags.phtml @@ -10,7 +10,7 @@ $data = array( ?> - Passive Checks + translate('Passive Checks') ?> toggleSubmitForm( '', $o->passive_checks_enabled, @@ -21,7 +21,7 @@ $data = array( ) ?> - Active Checks + translate('Active Checks') ?> toggleSubmitForm( '', $o->active_checks_enabled, @@ -32,7 +32,7 @@ $data = array( ) ?> - Notifications + translate('Notifications') ?> toggleSubmitForm( '', $o->notifications_enabled, @@ -43,7 +43,7 @@ $data = array( ) ?> - Event Handler + translate('Event Handler') ?> toggleSubmitForm( '', $o->event_handler_enabled, @@ -54,7 +54,7 @@ $data = array( ) ?> - Flap Detection + translate('Flap Detection') ?> toggleSubmitForm( '', $o->flap_detection_enabled, @@ -65,7 +65,7 @@ $data = array( ) ?> - Obsessing + translate('Obsessing') ?> toggleSubmitForm( '', $o->obsessing, diff --git a/modules/monitoring/application/views/scripts/show/components/header.phtml b/modules/monitoring/application/views/scripts/show/components/header.phtml index 0cfdfb048..774c1edf0 100644 --- a/modules/monitoring/application/views/scripts/show/components/header.phtml +++ b/modules/monitoring/application/views/scripts/show/components/header.phtml @@ -5,8 +5,8 @@ - - +
> - util()->getHostStateName($object->host_state) ?>
- since timeSince($object->host_last_state_change) ?> + translate($this->util()->getHostStateName($object->host_state)) ?>
+ translate('Since') ?> timeSince($object->host_last_state_change) ?>
escape($object->host_name) ?>host_address && $object->host_address !== $object->host_name): ?> @@ -17,10 +17,10 @@
- util()->getServiceStateName($object->service_state); ?>
- since timeSince($object->service_last_state_change) ?> + translate($this->util()->getServiceStateName($object->service_state)) ?>
+ translate('Since') ?> timeSince($object->service_last_state_change) ?>
Service: escape($object->service_description) ?> + translate('Service') ?>: escape($object->service_description) ?> render('show/components/statusIcons.phtml') ?> diff --git a/modules/monitoring/application/views/scripts/show/components/notifications.phtml b/modules/monitoring/application/views/scripts/show/components/notifications.phtml index 09c54539e..5c52e872a 100644 --- a/modules/monitoring/application/views/scripts/show/components/notifications.phtml +++ b/modules/monitoring/application/views/scripts/show/components/notifications.phtml @@ -7,7 +7,7 @@ if (in_array((int) $object->state, array(0, 99))) { ?>
Notificationstranslate('Notifications') ?> current_notification_number > 0) { $this->translate('%s notications have been sent for this issue'), $object->current_notification_number ) . '
' . sprintf( - 'The last one occured %s ago', + $this->translate('The last one occured %s ago'), $this->timeSince($object->last_notification) ); } diff --git a/modules/monitoring/application/views/scripts/show/history.phtml b/modules/monitoring/application/views/scripts/show/history.phtml index 32e3cbdfb..2b7aa63d9 100644 --- a/modules/monitoring/application/views/scripts/show/history.phtml +++ b/modules/monitoring/application/views/scripts/show/history.phtml @@ -33,12 +33,12 @@ $states = array( ?>
render('show/components/header.phtml') ?> -

This object's event history

+

translate("This object's event history") ?>

paginationControl($this->history, null, null, array('preserve' => $this->preserve)); ?>
history->count() === 0): ?> -No History Available For This Object +translate('No History Available For This Object' ?> diff --git a/modules/monitoring/application/views/scripts/show/host.phtml b/modules/monitoring/application/views/scripts/show/host.phtml index 189729192..e2f6ee1c4 100644 --- a/modules/monitoring/application/views/scripts/show/host.phtml +++ b/modules/monitoring/application/views/scripts/show/host.phtml @@ -1,6 +1,6 @@
render('show/components/header.phtml') ?> -

This host's current state

+

translate("This host's current state") ?>

render('show/components/output.phtml') ?> diff --git a/modules/monitoring/application/views/scripts/show/service.phtml b/modules/monitoring/application/views/scripts/show/service.phtml index 1c8f42c9f..19e5666e2 100644 --- a/modules/monitoring/application/views/scripts/show/service.phtml +++ b/modules/monitoring/application/views/scripts/show/service.phtml @@ -1,6 +1,6 @@
render('show/components/header.phtml') ?> -

This service's current state

+

translate("This service's current state") ?>

render('show/components/output.phtml') ?> diff --git a/modules/monitoring/application/views/scripts/show/services.phtml b/modules/monitoring/application/views/scripts/show/services.phtml index 06aee393f..bd734b97b 100644 --- a/modules/monitoring/application/views/scripts/show/services.phtml +++ b/modules/monitoring/application/views/scripts/show/services.phtml @@ -1,6 +1,6 @@
render('show/components/header.phtml') ?> -

All services configured on this host

+

translate('All services configured on this host') ?>