From f7b7e0283ac52f345924bd680fbd808056e7746a Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Mon, 29 Sep 2014 15:20:19 +0200 Subject: [PATCH] Translation: another bunch of translatable strings --- application/controllers/ConfigController.php | 4 +- .../views/scripts/config/modules.phtml | 6 +- .../controllers/ChartController.php | 4 +- .../controllers/CommandController.php | 7 +- .../controllers/ListController.php | 80 +++++++++---------- .../controllers/MultiController.php | 24 +++--- .../forms/Config/SecurityConfigForm.php | 6 +- .../views/scripts/layout/topbar.phtml | 28 +++---- .../views/scripts/list/hostgroups.phtml | 56 ++++++------- .../views/scripts/list/hosts.phtml | 22 ++--- .../views/scripts/list/servicegroups.phtml | 46 +++++------ .../views/scripts/list/services.phtml | 16 ++-- .../scripts/show/components/statusIcons.phtml | 12 +-- .../servicestatesummarybyhoststate.phtml | 16 ++-- 14 files changed, 167 insertions(+), 160 deletions(-) diff --git a/application/controllers/ConfigController.php b/application/controllers/ConfigController.php index 559d8f3f9..c12860e72 100644 --- a/application/controllers/ConfigController.php +++ b/application/controllers/ConfigController.php @@ -96,7 +96,7 @@ class ConfigController extends ActionController try { $manager->enableModule($module); $manager->loadModule($module); - Notification::success('Module "' . $module . '" enabled'); + Notification::success(sprintf($this->translate('Module "%s" enabled'), $module)); $this->rerenderLayout()->reloadCss()->redirectNow('config/modules'); } catch (Exception $e) { $this->view->exceptionMesssage = $e->getMessage(); @@ -115,7 +115,7 @@ class ConfigController extends ActionController $manager = Icinga::app()->getModuleManager(); try { $manager->disableModule($module); - Notification::success('Module "' . $module . '" disabled'); + Notification::success(sprintf($this->translate('Module "%s" disabled'), $module)); $this->rerenderLayout()->reloadCss()->redirectNow('config/modules'); } catch (Exception $e) { $this->view->exceptionMessage = $e->getMessage(); diff --git a/application/views/scripts/config/modules.phtml b/application/views/scripts/config/modules.phtml index 086d0a61a..e0204b24f 100644 --- a/application/views/scripts/config/modules.phtml +++ b/application/views/scripts/config/modules.phtml @@ -1,6 +1,6 @@
tabs ?> -

Installed Modules

+

translate('Installed Modules') ?>

paginationControl($modules) ?>
@@ -11,9 +11,9 @@ enabled): ?> - icon('success.png', 'Module is enabled') ?> + icon('success.png', $this->translate('Module is enabled')) ?> - icon('remove.png', 'Module is disabled') ?> + icon('remove.png', $this->translate('Module is disabled')) ?> - + hosts_up ?> - + hosts_down_unhandled ?> / - + hosts_down_handled ?> - + hosts_unreachable_unhandled ?> / - + hosts_unreachable_handled ?> - + hosts_pending ?> @@ -29,36 +29,36 @@ @@ -70,8 +70,8 @@ if (count($hostgroups) === 0) { 'host_unhandled' => 1, 'hostgroup' => $h->hostgroup ) - ); ?>" title="Hosts UNREACHABLE Unhandled"> - hosts_unreachable_unhandled; ?> UNREACHABLE + ); ?>" title="translate('Hosts UNREACHABLE Unhandled') ?>"> + hosts_unreachable_unhandled; ?> translate('UNREACHABLE', 'icinga.state') ?> hosts_unreachable_handled): ?> @@ -82,8 +82,8 @@ if (count($hostgroups) === 0) { 'host_handled' => 1, 'hostgroup' => $h->hostgroup ) - ); ?>" title="Hosts UNREACHABLE Handled"> - hosts_unreachable_handled . ' ' . ($h->hosts_unreachable_unhandled ? $this->translate('Acknowledged') : 'UNREACHABLE'); ?> + ); ?>" title="translate('Hosts UNREACHABLE Handled') ?>"> + hosts_unreachable_handled . ' ' . ($h->hosts_unreachable_unhandled ? $this->translate('Acknowledged') : $this->translate('UNREACHABLE', 'icinga.state')) ?> @@ -98,8 +98,8 @@ if (count($hostgroups) === 0) { 'host_state' => 0, 'hostgroup' => $h->hostgroup ) - ); ?>" title="Hosts UP"> - hosts_up; ?> UP + ); ?>" title="translate('Hosts UP') ?>"> + hosts_up; ?> translate('UP', 'icinga.state') ?> @@ -113,8 +113,8 @@ if (count($hostgroups) === 0) { 'host_state' => 99, 'hostgroup' => $h->hostgroup ) - ); ?>" title="Hosts PENDING"> - hosts_pending; ?> PENDING + ); ?>" title="translate('Hosts PENDING') ?>"> + hosts_pending; ?> translate('PENDING', 'icinga.state') ?> @@ -135,8 +135,8 @@ if (count($hostgroups) === 0) { 'hostgroup' => $h->hostgroup, 'sort' => 'service_severity' ) - ); ?>" title="Services CRITICAL Unhandled"> - services_critical_unhandled; ?> CRITICAL + ); ?>" title="translate('Services CRITICAL Unhandled') ?>"> + services_critical_unhandled; ?> translate('CRITICAL', 'icinga.state') ?> services_critical_handled): ?> @@ -148,8 +148,8 @@ if (count($hostgroups) === 0) { 'hostgroup' => $h->hostgroup, 'sort' => 'service_severity' ) - ); ?>" title="Services CRITICAL Handled"> - services_critical_handled . ' ' . ($h->services_critical_unhandled ? $this->translate('Acknowledged') : 'CRITICAL'); ?> + ); ?>" title="translate('Services CRITICAL Handled') ?>"> + services_critical_handled . ' ' . ($h->services_critical_unhandled ? $this->translate('Acknowledged') : $this->translate('CRITICAL', 'icinga.state')); ?> @@ -169,8 +169,8 @@ if (count($hostgroups) === 0) { 'hostgroup' => $h->hostgroup, 'sort' => 'service_severity' ) - ); ?>" title="Services WARNING Unhandled"> - services_warning_unhandled; ?> WARNING + ); ?>" title="translate('Services WARNING Unhandled') ?>"> + services_warning_unhandled; ?> translate('WARNING', 'icinga.state') ?> services_warning_handled): ?> @@ -182,8 +182,8 @@ if (count($hostgroups) === 0) { 'hostgroup' => $h->hostgroup, 'sort' => 'service_severity' ) - ); ?>" title="Services WARNING Handled"> - services_warning_handled . ' ' . ($h->services_warning_unhandled ? $this->translate('Acknowledged') : 'WARNING'); ?> + ); ?>" title="translate('Services WARNING Handled') ?>"> + services_warning_handled . ' ' . ($h->services_warning_unhandled ? $this->translate('Acknowledged') : $this->translate('WARNING', 'icinga.state')); ?> @@ -203,8 +203,8 @@ if (count($hostgroups) === 0) { 'hostgroup' => $h->hostgroup, 'sort' => 'service_severity' ) - ); ?>" title="Services UNKNOWN Unhandled"> - services_unknown_unhandled; ?> UNKNOWN + ); ?>" title="translate('Services UNKNOWN Unhandled') ?>"> + services_unknown_unhandled; ?> translate('UNKNOWN', 'icinga.state') ?> services_unknown_handled): ?> @@ -216,8 +216,8 @@ if (count($hostgroups) === 0) { 'hostgroup' => $h->hostgroup, 'sort' => 'service_severity' ) - ); ?>" title="Services UNKNOWN Handled"> - services_unknown_handled . ' ' . ($h->services_unknown_unhandled ? $this->translate('Acknowledged') : 'UNKNOWN'); ?> + ); ?>" title="translate('Services UNKNOWN Handled') ?>"> + services_unknown_handled . ' ' . ($h->services_unknown_unhandled ? $this->translate('Acknowledged') : $this->translate('UNKNOWN', 'icinga.state')); ?> @@ -233,8 +233,8 @@ if (count($hostgroups) === 0) { 'hostgroup' => $h->hostgroup, 'sort' => 'service_severity' ) - ); ?>" title="Services OK"> - services_ok; ?> OK + ); ?>" title="translate('Services OK') ?>"> + services_ok; ?> translate('OK', 'icinga.state') ?> @@ -249,8 +249,8 @@ if (count($hostgroups) === 0) { 'hostgroup' => $h->hostgroup, 'sort' => 'service_severity' ) - ); ?>" title="Services PENDING"> - services_pending; ?> PENDING + ); ?>" title="translate('Services PENDING') ?>"> + services_pending; ?> translate('PENDING', 'icinga.state') ?> diff --git a/modules/monitoring/application/views/scripts/list/hosts.phtml b/modules/monitoring/application/views/scripts/list/hosts.phtml index 5cad9142e..5be77f89f 100644 --- a/modules/monitoring/application/views/scripts/list/hosts.phtml +++ b/modules/monitoring/application/views/scripts/list/hosts.phtml @@ -47,35 +47,35 @@ if ($hosts->count() === 0) { $icons = array(); if (! $host->host_handled && $host->host_state > 0){ - $icons[] = $this->icon('unhandled.png', 'Unhandled'); + $icons[] = $this->icon('unhandled.png', $this->translate('Unhandled')); } if ($host->host_acknowledged) { - $icons[] = $this->icon('acknowledgement.png', 'Acknowledged'); + $icons[] = $this->icon('acknowledgement.png', $this->translate('Acknowledged')); } if ($host->host_is_flapping) { - $icons[] = $this->icon('flapping.png', 'Flapping'); + $icons[] = $this->icon('flapping.png', $this->translate('Flapping')); } if (! $host->host_notifications_enabled) { - $icons[] = $this->icon('notification_disabled.png', 'Notifications Disabled'); + $icons[] = $this->icon('notification_disabled.png', $this->translate('Notifications Disabled')); } if ($host->host_in_downtime) { - $icons[] = $this->icon('in_downtime.png', 'In Downtime'); + $icons[] = $this->icon('in_downtime.png', $this->translate('In Downtime')); } if (! $host->host_active_checks_enabled) { if (! $host->host_passive_checks_enabled) { - $icons[] = $this->icon('active_passive_checks_disabled.png', 'Active And Passive Checks Disabled'); + $icons[] = $this->icon('active_passive_checks_disabled.png', $this->translate('Active And Passive Checks Disabled')); } else { - $icons[] = $this->icon('active_checks_disabled.png', 'Active Checks Disabled'); + $icons[] = $this->icon('active_checks_disabled.png', $this->translate('Active Checks Disabled')); } } if (isset($host->host_last_comment) && $host->host_last_comment !== null) { - $icons[] = $this->icon('comment.png', 'Comment: ' . $host->host_last_comment); + $icons[] = $this->icon('comment.png', $this->translate('Comment: ') . $host->host_last_comment); } ?> @@ -101,8 +101,10 @@ if ($hosts->count() === 0) { host_unhandled_services) && $host->host_unhandled_services > 0): ?> (qlink( - sprintf($this->translate('%d unhandled services'), $host->host_unhandled_services), + ?> translate('Service Problems on Host') ?>"> (qlink( + sprintf( + $this->translatePlural('%d unhandled service', '%d unhandled services', $host->host_unhandled_services), + $host->host_unhandled_services), 'monitoring/show/services', array( 'host' => $host->host_name, diff --git a/modules/monitoring/application/views/scripts/list/servicegroups.phtml b/modules/monitoring/application/views/scripts/list/servicegroups.phtml index 059ea9dcb..5af6899e7 100644 --- a/modules/monitoring/application/views/scripts/list/servicegroups.phtml +++ b/modules/monitoring/application/views/scripts/list/servicegroups.phtml @@ -43,8 +43,8 @@ if (count($servicegroups) === 0) { 'host_unhandled' => 1, 'servicegroup' => $servicegroup->servicegroup ) - ); ?>" title="Hosts DOWN Unhandled"> - hosts_down_unhandled; ?> DOWN + ); ?>" title="translate('Hosts DOWN Unhandled') ?>"> + hosts_down_unhandled; ?> translate('DOWN', 'icinga.state') ?> hosts_down_handled): ?> @@ -55,7 +55,7 @@ if (count($servicegroups) === 0) { 'host_handled' => 1, 'servicegroup' => $servicegroup->servicegroup ) - ); ?>" title="Hosts DOWN Handled"> + ); ?>" title="translate('Hosts DOWN Handled') ?>"> hosts_down_handled . ' ' . ($servicegroup->hosts_down_unhandled ? $this->translate('Acknowledged') : 'DOWN'); ?> @@ -73,8 +73,8 @@ if (count($servicegroups) === 0) { 'host_unhandled' => 1, 'servicegroup' => $servicegroup->servicegroup ) - ); ?>" title="Hosts UNREACHABLE Unhandled"> - hosts_unreachable_unhandled; ?> UNREACHABLE + ); ?>" title="translate('Hosts UNREACHABLE Unhandled') ?>"> + hosts_unreachable_unhandled; ?> translate('UNREACHABLE', 'icinga.state') ?> hosts_unreachable_handled): ?> @@ -85,7 +85,7 @@ if (count($servicegroups) === 0) { 'host_handled' => 1, 'servicegroup' => $servicegroup->servicegroup ) - ); ?>" title="Hosts UNREACHABLE Handled"> + ); ?>" title="translate('Hosts UNREACHABLE Handled') ?>"> hosts_unreachable_handled . ' ' . ($servicegroup->hosts_unreachable_unhandled ? $this->translate('Acknowledged') : 'UNREACHABLE'); ?> @@ -101,8 +101,8 @@ if (count($servicegroups) === 0) { 'host_state' => 0, 'servicegroup' => $servicegroup->servicegroup ) - ); ?>" title="Hosts UP"> - hosts_up; ?> UP + ); ?>" title="translate('Hosts UP') ?>"> + hosts_up; ?> translate('UP', 'icinga.state') ?> @@ -116,8 +116,8 @@ if (count($servicegroups) === 0) { 'host_state' => 99, 'servicegroup' => $servicegroup->servicegroup ) - ); ?>" title="Hosts PENDING"> - hosts_pending; ?> PENDING + ); ?>" title="translate('Hosts PENDING') ?>"> + hosts_pending; ?> translate('PENDING', 'icinga.state') ?> @@ -138,8 +138,8 @@ if (count($servicegroups) === 0) { 'servicegroup' => $servicegroup->servicegroup, 'sort' => 'service_severity' ) - ); ?>" title="Services CRITICAL Unhandled"> - services_critical_unhandled; ?> CRITICAL + ); ?>" title="translate('Services CRITICAL Unhandled') ?>"> + services_critical_unhandled; ?> translate('CRITICAL', 'icinga.state') ?> services_critical_handled): ?> @@ -151,7 +151,7 @@ if (count($servicegroups) === 0) { 'servicegroup' => $servicegroup->servicegroup, 'sort' => 'service_severity' ) - ); ?>" title="Services CRITICAL Handled"> + ); ?>" title="translate('Services CRITICAL Handled') ?>"> services_critical_handled . ' ' . ($servicegroup->services_critical_unhandled ? $this->translate('Acknowledged') : 'CRITICAL'); ?> @@ -172,8 +172,8 @@ if (count($servicegroups) === 0) { 'servicegroup' => $servicegroup->servicegroup, 'sort' => 'service_severity' ) - ); ?>" title="Services WARNING Unhandled"> - services_warning_unhandled; ?> WARNING + ); ?>" title="translate('Services WARNING Unhandled') ?>"> + services_warning_unhandled; ?> translate('WARNING', 'icinga.state') ?> services_warning_handled): ?> @@ -185,7 +185,7 @@ if (count($servicegroups) === 0) { 'servicegroup' => $servicegroup->servicegroup, 'sort' => 'service_severity' ) - ); ?>" title="Services WARNING Handled"> + ); ?>" title="translate('Services WARNING Handled') ?>"> services_warning_handled . ' ' . ($servicegroup->services_warning_unhandled ? $this->translate('Acknowledged') : 'WARNING'); ?> @@ -206,8 +206,8 @@ if (count($servicegroups) === 0) { 'servicegroup' => $servicegroup->servicegroup, 'sort' => 'service_severity' ) - ); ?>" title="Services UNKNOWN Unhandled"> - services_unknown_unhandled; ?> UNKNOWN + ); ?>" title="translate('Services UNKNOWN Unhandled') ?>"> + services_unknown_unhandled; ?> translate('UNKNOWN', 'icinga.state') ?> services_unknown_handled): ?> @@ -219,7 +219,7 @@ if (count($servicegroups) === 0) { 'servicegroup' => $servicegroup->servicegroup, 'sort' => 'service_severity' ) - ); ?>" title="Services UNKNOWN Handled"> + ); ?>" title="translate('Services UNKNOWN Handled') ?>"> services_unknown_handled . ' ' . ($servicegroup->services_unknown_unhandled ? $this->translate('Acknowledged') : 'UNKNOWN'); ?> @@ -236,8 +236,8 @@ if (count($servicegroups) === 0) { 'servicegroup' => $servicegroup->servicegroup, 'sort' => 'service_severity' ) - ); ?>" title="Services OK"> - services_ok; ?> OK + ); ?>" title="translate('Services OK') ?>"> + services_ok; ?> translate('OK', 'icinga.state') ?> @@ -252,8 +252,8 @@ if (count($servicegroups) === 0) { 'servicegroup' => $servicegroup->servicegroup, 'sort' => 'service_severity' ) - ); ?>" title="Services PENDING"> - services_pending; ?> PENDING + ); ?>" title="translate('Services PENDING') ?>"> + services_pending; ?> translate('PENDING', 'icinga.state') ?> diff --git a/modules/monitoring/application/views/scripts/list/services.phtml b/modules/monitoring/application/views/scripts/list/services.phtml index 46ca2c08f..66cf14c54 100644 --- a/modules/monitoring/application/views/scripts/list/services.phtml +++ b/modules/monitoring/application/views/scripts/list/services.phtml @@ -69,36 +69,36 @@ foreach ($services as $service): perfdata($service->service_perfdata, true, true) ?> service_handled && $service->service_state > 0): ?> - icon('unhandled.png', 'Unhandled') ?> + icon('unhandled.png', $this->translate('Unhandled')) ?> service_acknowledged && !$service->service_in_downtime): ?> - icon('acknowledgement.png', 'Acknowledged' . ( + icon('acknowledgement.png', $this->translate('Acknowledged') . ( $service->service_last_ack ? ': ' . $service->service_last_ack : '' )) ?> service_is_flapping): ?> - icon('flapping.png', 'Flapping') ?> + icon('flapping.png', $this->translate('Flapping')) ?> service_notifications_enabled): ?> - icon('notification_disabled.png', 'Notifications Disabled') ?> + icon('notification_disabled.png', $this->translate('Notifications Disabled')) ?> service_in_downtime): ?> - icon('in_downtime.png', 'In Downtime') ?> + icon('in_downtime.png', $this->translate('In Downtime')) ?> service_last_comment) && $service->service_last_comment !== null): ?> - icon('comment.png', 'Comment: ' . $service->service_last_comment) ?> + icon('comment.png', $this->translate('Comment: ') . $service->service_last_comment) ?> service_active_checks_enabled): ?> service_passive_checks_enabled): ?> - icon('active_passive_checks_disabled.png', 'Active And Passive Checks Disabled') ?> + icon('active_passive_checks_disabled.png', $this->translate('Active And Passive Checks Disabled')) ?> - icon('active_checks_disabled.png', 'Active Checks Disabled') ?> + icon('active_checks_disabled.png', $this->translate('Active Checks Disabled')) ?> diff --git a/modules/monitoring/application/views/scripts/show/components/statusIcons.phtml b/modules/monitoring/application/views/scripts/show/components/statusIcons.phtml index 4e0f3845f..bfa7b7873 100644 --- a/modules/monitoring/application/views/scripts/show/components/statusIcons.phtml +++ b/modules/monitoring/application/views/scripts/show/components/statusIcons.phtml @@ -23,26 +23,26 @@ $obj->passive_checks_enabled = $i = array(); if (! $obj->handled && $obj->state > 0) { - $i[] = $this->icon('unhandled.png', 'Unhandled'); + $i[] = $this->icon('unhandled.png', $this->translate('Unhandled')); } if ($obj->acknowledged && ! $obj->in_downtime) { - $i[] = $this->icon('acknowledgement.png', 'Acknowledged'); + $i[] = $this->icon('acknowledgement.png', $this->translate('Acknowledged')); } if (!$obj->notifications_enabled) { - $i[] = $this->icon('notification_disabled.png', 'Notifications Disabled'); + $i[] = $this->icon('notification_disabled.png', $this->translate('Notifications Disabled')); } if ($obj->in_downtime) { - $i[] = $this->icon('in_downtime.png', 'In Downtime'); + $i[] = $this->icon('in_downtime.png', $this->translate('In Downtime')); } if (! $obj->active_checks_enabled) { if ($obj->passive_checks_enabled) { - $i[] = $this->icon('active_checks_disabled.png', 'Active Checks Disabled'); + $i[] = $this->icon('active_checks_disabled.png', $this->translate('Active Checks Disabled')); } else { - $i[] = $this->icon('active_passive_checks_disabled.png', 'Active And Passive Checks Disabled'); + $i[] = $this->icon('active_passive_checks_disabled.png', $this->translate('Active And Passive Checks Disabled')); } } diff --git a/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml b/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml index 484bbb65e..cccfa094e 100644 --- a/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml +++ b/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml @@ -5,7 +5,7 @@ 'monitoring/list/services', array('host_problem' => $host_problem, 'service_state' => 2, 'service_acknowledged' => 0, 'service_in_downtime' => 0) ); ?>"> - CRITICAL + translate('CRITICAL', 'icinga.state') ?> @@ -13,7 +13,7 @@ 'monitoring/list/services', array('host_problem' => $host_problem, 'service_state' => 2, 'service_handled' => 1) ); ?>"> - translate('Acknowledged') : 'CRITICAL'); ?> + translate('Acknowledged') : $this->translate('CRITICAL', 'icinga.state')); ?> @@ -75,7 +75,7 @@ 'monitoring/list/services', array('host_problem' => $host_problem, 'service_state' => 1, 'service_acknowledged' => 0, 'service_in_downtime' => 0) ); ?>"> - WARNING + translate('WARNING', 'icinga.state') ?> @@ -83,7 +83,7 @@ 'monitoring/list/services', array('host_problem' => $host_problem, 'service_state' => 1, 'service_handled' => 1) ); ?>"> - translate('Acknowledged') : 'WARNING'); ?> + translate('Acknowledged') : $this->translate('WARNING', 'icinga.state')); ?> @@ -145,7 +145,7 @@ 'monitoring/list/services', array('host_problem' => $host_problem, 'service_state' => 3, 'service_acknowledged' => 0, 'service_in_downtime' => 0) ); ?>"> - UNKNOWN + translate('UNKNOWN', 'icinga.state') ?> @@ -153,7 +153,7 @@ 'monitoring/list/services', array('host_problem' => $host_problem, 'service_state' => 3, 'service_handled' => 1) ); ?>"> - translate('Acknowledged') : 'UNKNOWN'); ?> + translate('Acknowledged') : $this->translate('UNKNOWN', 'icinga.state')); ?> @@ -214,7 +214,7 @@ 'monitoring/list/services', array('host_problem' => $host_problem, 'service_state' => 0) ); ?>"> - OK + translate('OK', 'icinga.state') ?> - PENDING + translate('PENDING', 'icinga.state') ?>