From 3bd74348f03714448996b0352ce7bb41fb2cc320 Mon Sep 17 00:00:00 2001 From: bruno Date: Fri, 22 Jan 2016 11:25:28 -0200 Subject: add call 'gettext' function in the status menu files --- src/usr/local/www/status_captiveportal.php | 2 +- src/usr/local/www/status_filter_reload.php | 10 ++++---- src/usr/local/www/status_graph.php | 6 ++--- src/usr/local/www/status_graph_cpu.php | 2 +- src/usr/local/www/status_ipsec.php | 8 +++---- src/usr/local/www/status_ipsec_spd.php | 4 ++-- src/usr/local/www/status_lb_pool.php | 12 +++++----- src/usr/local/www/status_lb_vs.php | 20 ++++++---------- src/usr/local/www/status_logs.php | 24 +++++++++---------- src/usr/local/www/status_logs_common.inc | 4 ++-- src/usr/local/www/status_logs_filter_summary.php | 2 +- src/usr/local/www/status_logs_vpn.php | 10 ++++---- src/usr/local/www/status_ntpd.php | 30 ++++++++++++------------ src/usr/local/www/status_queues.php | 8 +++---- src/usr/local/www/status_rrd_graph.php | 6 ++--- src/usr/local/www/status_rrd_graph_img.php | 2 +- src/usr/local/www/status_rrd_graph_settings.php | 2 +- src/usr/local/www/status_services.php | 2 +- 18 files changed, 74 insertions(+), 80 deletions(-) (limited to 'src/usr') diff --git a/src/usr/local/www/status_captiveportal.php b/src/usr/local/www/status_captiveportal.php index c497ab8..d3adb88 100644 --- a/src/usr/local/www/status_captiveportal.php +++ b/src/usr/local/www/status_captiveportal.php @@ -259,7 +259,7 @@ else:


' . 'Services->Captive portal' . ''); + print_info_box(gettext("No captive portal zones have been configured. You may add new zones here: ") . '' . gettext('Services->Captive portal') . ''); ?>
diff --git a/src/usr/local/www/status_filter_reload.php b/src/usr/local/www/status_filter_reload.php index 9a9596b..01255a1 100644 --- a/src/usr/local/www/status_filter_reload.php +++ b/src/usr/local/www/status_filter_reload.php @@ -91,7 +91,7 @@ include("head.inc");
-

Filter Reload

+

@@ -135,16 +135,16 @@ function update_data(obj) { if (result_text) { jQuery('#status').html(result_text + '...'); } else { - jQuery('#status').html('Obtaining filter status...'); + jQuery('#status').html(''); } if (result_text == "Initializing") { - jQuery('#status').html('Initializing...'); + jQuery('#status').html(''); } else if (result_text == "Done") { jQuery('#status').effect('highlight'); - jQuery('#status').html('Done. The filter rules have been reloaded.'); + jQuery('#status').html(''); jQuery('#reloadinfo').css("visibility", "hidden"); jQuery('#doneurl').css("visibility", "visible"); - jQuery('#doneurl').html("

Queue Status<\/a><\/p>"); + jQuery('#doneurl').html("

<\/a><\/p>"); } window.setTimeout('update_status_thread()', 2500); } diff --git a/src/usr/local/www/status_graph.php b/src/usr/local/www/status_graph.php index 440b434..9f7b862 100644 --- a/src/usr/local/www/status_graph.php +++ b/src/usr/local/www/status_graph.php @@ -225,8 +225,8 @@ function updateBandwidth() { $('#top10-hosts').append(''+ ''+ hostinfo[0] +''+ - ''+ hostinfo[1] +' Bits/sec'+ - ''+ hostinfo[2] +' Bits/sec'+ + ''+ hostinfo[1] +' '+ + ''+ hostinfo[2] +' '+ ''); } } @@ -255,7 +255,7 @@ if (ipsec_enabled()) { ?>

-

Traffic graph

+

diff --git a/src/usr/local/www/status_graph_cpu.php b/src/usr/local/www/status_graph_cpu.php index 8533160..f37a332 100644 --- a/src/usr/local/www/status_graph_cpu.php +++ b/src/usr/local/www/status_graph_cpu.php @@ -71,7 +71,7 @@ $pgtitle = gettext("Status: CPU Graph"); ?>
-

CPU Load graph

+

diff --git a/src/usr/local/www/status_ipsec.php b/src/usr/local/www/status_ipsec.php index 9b253e5..d029fe6 100644 --- a/src/usr/local/www/status_ipsec.php +++ b/src/usr/local/www/status_ipsec.php @@ -124,7 +124,7 @@ display_top_tabs($tab_array); ?>
-

IPsec status

+

@@ -197,7 +197,7 @@ if (is_array($status)) { $identity = ""; if (!empty($ikesa['remote-id'])) { if ($ikesa['remote-id'] == '%any') { - $identity = 'Any identifier'; + $identity = htmlspecialchars(gettext('Any identifier')); } else { $identity = htmlspecialchars($ikesa['remote']['identification']); } @@ -274,13 +274,13 @@ if (is_array($status)) { - + " > - + ">
diff --git a/src/usr/local/www/status_lb_pool.php b/src/usr/local/www/status_lb_pool.php index d9917f8..f647c90 100644 --- a/src/usr/local/www/status_lb_pool.php +++ b/src/usr/local/www/status_lb_pool.php @@ -140,12 +140,12 @@ if ($_POST) { } mark_subsystem_dirty('loadbalancer'); - write_config("Updated load balancer pools via status screen."); + write_config(gettext("Updated load balancer pools via status screen.")); } } if (is_subsystem_dirty('loadbalancer')) { - print_info_box_np('The load balancer configuration has been changed You must apply the changes in order for them to take effect.'); + print_info_box_np(gettext('The load balancer configuration has been changed You must apply the changes in order for them to take effect.')); } /* active tabs */ @@ -159,7 +159,7 @@ $rowsprinted = 0;
-

Load Balancer Pools

+

@@ -184,13 +184,13 @@ foreach ($a_pool as $pool): diff --git a/src/usr/local/www/status_lb_vs.php b/src/usr/local/www/status_lb_vs.php index 4bfe8c3..fb7849f 100644 --- a/src/usr/local/www/status_lb_vs.php +++ b/src/usr/local/www/status_lb_vs.php @@ -91,7 +91,7 @@ $tab_array[] = array(gettext("Virtual Servers"), true, "status_lb_vs.php"); display_top_tabs($tab_array); if (empty($a_vs)) { - print('
No load balancers have been configured!
'); + print('
' . gettext("No load balancers have been configured!") . '
'); } else { ?>
@@ -133,15 +133,15 @@ if (empty($a_vs)) { switch (trim($rdr_a[$vsent['name']]['status'])) { case 'active': $bgcolor = LIGHTGREEN; - $rdr_a[$vsent['name']]['status'] = "Active"; + $rdr_a[$vsent['name']]['status'] = gettext("Active"); break; case 'down': $bgcolor = LIGHTCORAL; - $rdr_a[$vsent['name']]['status'] = "Down"; + $rdr_a[$vsent['name']]['status'] = gettext("Down"); break; default: $bgcolor = LIGHTGRAY; - $rdr_a[$vsent['name']]['status'] = 'Unknown - relayd not running?'; + $rdr_a[$vsent['name']]['status'] = gettext('Unknown - relayd not running?'); } if (!COLOR) { @@ -153,19 +153,13 @@ if (empty($a_vs)) { - Total Sessions:
/> -"); } if (!empty($rdr_a[$vsent['name']]['last'])) { -?> - Last:
/> -"); } if (!empty($rdr_a[$vsent['name']]['average'])) { -?> - Average: - diff --git a/src/usr/local/www/status_logs.php b/src/usr/local/www/status_logs.php index 35e969e..5fb1da1 100755 --- a/src/usr/local/www/status_logs.php +++ b/src/usr/local/www/status_logs.php @@ -71,29 +71,29 @@ Build a list of allowed log files so we can reject others to prevent the page from acting on unauthorized files. */ $allowed_logs = array( - "system" => array("name" => "General", + "system" => array("name" => gettext("General"), "shortcut" => ""), - "dhcpd" => array("name" => "DHCP", + "dhcpd" => array("name" => gettext("DHCP"), "shortcut" => "dhcp"), - "portalauth" => array("name" => "Captive Portal Authentication", + "portalauth" => array("name" => gettext("Captive Portal Authentication"), "shortcut" => "captiveportal"), - "ipsec" => array("name" => "IPsec", + "ipsec" => array("name" => gettext("IPsec"), "shortcut" => "ipsec"), - "ppp" => array("name" => "PPP", + "ppp" => array("name" => gettext("PPP"), "shortcut" => ""), - "relayd" => array("name" => "Load Balancer", + "relayd" => array("name" => gettext("Load Balancer"), "shortcut" => "relayd"), - "openvpn" => array("name" => "OpenVPN", + "openvpn" => array("name" => gettext("OpenVPN"), "shortcut" => "openvpn"), - "ntpd" => array("name" => "NTPd", + "ntpd" => array("name" => gettext("NTPd"), "shortcut" => "ntp"), - "gateways" => array("name" => "Gateways", + "gateways" => array("name" => gettext("Gateways"), "shortcut" => "gateways"), - "routing" => array("name" => "Routing", + "routing" => array("name" => gettext("Routing"), "shortcut" => "routing"), - "resolver" => array("name" => "DNS Resolver", + "resolver" => array("name" => gettext("DNS Resolver"), "shortcut" => "resolver"), - "wireless" => array("name" => "Wireless", + "wireless" => array("name" => gettext("Wireless"), "shortcut" => "wireless"), ); diff --git a/src/usr/local/www/status_logs_common.inc b/src/usr/local/www/status_logs_common.inc index 99610da..efeeaf5 100644 --- a/src/usr/local/www/status_logs_common.inc +++ b/src/usr/local/www/status_logs_common.inc @@ -682,12 +682,12 @@ function manage_log_code() { // If any of the logging settings were changed then backup and sync (standard write_config). Otherwise only write config (don't backup, don't sync). if ($logging_changed) { - write_config($desc = "Log Display Settings Saved: " . gettext($allowed_logs[$logfile]["name"]), $backup = true, $write_config_only = false); + write_config($desc = gettext("Log Display Settings Saved: ") . gettext($allowed_logs[$logfile]["name"]), $backup = true, $write_config_only = false); $retval = 0; $retval = system_syslogd_start(); $savemsg = gettext("The changes have been applied successfully."); } else { - write_config($desc = "Log Display Settings Saved (no backup, no sync): " . gettext($allowed_logs[$logfile]["name"]), $backup = false, $write_config_only = true); + write_config($desc = gettext("Log Display Settings Saved (no backup, no sync): ") . gettext($allowed_logs[$logfile]["name"]), $backup = false, $write_config_only = true); $savemsg = ''; } diff --git a/src/usr/local/www/status_logs_filter_summary.php b/src/usr/local/www/status_logs_filter_summary.php index 416bcd8..efa7d15 100644 --- a/src/usr/local/www/status_logs_filter_summary.php +++ b/src/usr/local/www/status_logs_filter_summary.php @@ -209,7 +209,7 @@ function stat_block($summary, $stat, $num) { $numentries++; $outstr = $k[$i]; if (is_ipaddr($outstr)) { - print('' . ''); + print('' . ''); } elseif (substr_count($outstr, '/') == 1) { list($proto, $port) = explode('/', $outstr); diff --git a/src/usr/local/www/status_logs_vpn.php b/src/usr/local/www/status_logs_vpn.php index cce15dd..111e00a 100644 --- a/src/usr/local/www/status_logs_vpn.php +++ b/src/usr/local/www/status_logs_vpn.php @@ -72,11 +72,11 @@ Build a list of allowed log files so we can reject others to prevent the page from acting on unauthorized files. */ $allowed_logs = array( - "vpn" => array("name" => "VPN Logins", + "vpn" => array("name" => gettext("VPN Logins"), "shortcut" => "poes"), - "poes" => array("name" => "PPPoE Service", + "poes" => array("name" => gettext("PPPoE Service"), "shortcut" => "pppoes"), - "l2tps" => array("name" => "L2TP Service", + "l2tps" => array("name" => gettext("L2TP Service"), "shortcut" => "l2tps"), ); @@ -94,8 +94,8 @@ if (!$_GET['logfile']) { } } -if ($vpntype == 'poes') { $allowed_logs['vpn']['name'] = "PPPoE Logins"; } -if ($vpntype == 'l2tp') { $allowed_logs['vpn']['name'] = "L2TP Logins"; } +if ($vpntype == 'poes') { $allowed_logs['vpn']['name'] = gettext("PPPoE Logins"); } +if ($vpntype == 'l2tp') { $allowed_logs['vpn']['name'] = gettext("L2TP Logins"); } // Log Filter Submit - VPN diff --git a/src/usr/local/www/status_ntpd.php b/src/usr/local/www/status_ntpd.php index c231908..f887c53 100644 --- a/src/usr/local/www/status_ntpd.php +++ b/src/usr/local/www/status_ntpd.php @@ -81,28 +81,28 @@ if (!isset($config['ntpd']['noquery'])) { switch (substr($line, 0, 1)) { case " ": - $server['status'] = "Unreach/Pending"; + $server['status'] = gettext("Unreach/Pending"); break; case "*": - $server['status'] = "Active Peer"; + $server['status'] = gettext("Active Peer"); break; case "+": - $server['status'] = "Candidate"; + $server['status'] = gettext("Candidate"); break; case "o": - $server['status'] = "PPS Peer"; + $server['status'] = gettext("PPS Peer"); break; case "#": - $server['status'] = "Selected"; + $server['status'] = gettext("Selected"); break; case ".": - $server['status'] = "Excess Peer"; + $server['status'] = gettext("Excess Peer"); break; case "x": - $server['status'] = "False Ticker"; + $server['status'] = gettext("False Ticker"); break; case "-": - $server['status'] = "Outlier"; + $server['status'] = gettext("Outlier"); break; } @@ -190,7 +190,7 @@ include("head.inc"); ?>
-

Network Time Protocol Status

+

' . $outstr . '' . $summary[$stat][$k[$i]] . 'Lookup
' . $outstr . '' . $summary[$stat][$k[$i]] . '' . gettext("Lookup") . '
@@ -212,13 +212,13 @@ include("head.inc");
-

GPS information

+

- Statistics unavailable because ntpq and ntpdc queries are disabled in the NTP service settings. + ', '');?>
- No peers found, is the ntp service running? + ', '');?>
@@ -300,21 +300,21 @@ if (($gps_ok) && ($gps_lat) && ($gps_lon)): if (isset($gps_sat) || isset($gps_satview)) { ?> - +
Google Maps Link
diff --git a/src/usr/local/www/status_queues.php b/src/usr/local/www/status_queues.php index b1c0815..9568b75 100644 --- a/src/usr/local/www/status_queues.php +++ b/src/usr/local/www/status_queues.php @@ -84,7 +84,7 @@ if (!file_exists("{$g['varrun_path']}/qstats.pid") || !isvalidpid("{$g['varrun_p } $fd = @fsockopen("unix://{$g['varrun_path']}/qstats"); if (!$fd) { - $error = "Something wrong happened during communication with stat gathering"; + $error = gettext("Something wrong happened during communication with stat gathering"); } else { $stats = ""; while (!feof($fd)) { @@ -94,7 +94,7 @@ if (!$fd) { @file_put_contents("{$g['tmp_path']}/qstats", $stats); $altqstats = @parse_xml_config("{$g['tmp_path']}/qstats", array("altqstats")); if ($altqstats == -1) { - $error = "No queue statistics could be read."; + $error = gettext("No queue statistics could be read."); } } if ($_REQUEST['getactivity']) { @@ -191,8 +191,8 @@ else: ?> diff --git a/src/usr/local/www/status_rrd_graph.php b/src/usr/local/www/status_rrd_graph.php index 2bea2c7..4e2eb94 100644 --- a/src/usr/local/www/status_rrd_graph.php +++ b/src/usr/local/www/status_rrd_graph.php @@ -230,7 +230,7 @@ if (is_numeric($_GET['end'])) { /* this should never happen */ if ($end < $start) { - log_error("start $start is smaller than end $end"); + log_error(sprintf(gettext("start %d is smaller than end %d"), $start, $end)); $end = $now; } @@ -299,7 +299,7 @@ $graph_length = array( switch ($curcat) { case "vpnusers": - $curcattext = "VPN Users"; + $curcattext = gettext("VPN Users"); break; default: $curcattext = ucfirst($curcat); @@ -622,7 +622,7 @@ if ($curcat == 'custom') { $id = preg_replace('/\./', '_', $id); ?>
- <?=$prettydb?> Graph + <?=$prettydb?> <?=gettext(" src="status_rrd_graph_img.php?start=&end=&database=&style=&graph=" />
gettext("Absolute Timespans"), if ($_POST['ResetRRD']) { mwexec('/bin/rm /var/db/rrd/*'); enable_rrd_graphing(); - $savemsg = "RRD data has been cleared. New RRD files have been generated."; + $savemsg = gettext("RRD data has been cleared. New RRD files have been generated."); } elseif ($_POST) { unset($input_errors); $pconfig = $_POST; diff --git a/src/usr/local/www/status_services.php b/src/usr/local/www/status_services.php index 905057a..6f7cbb0 100755 --- a/src/usr/local/www/status_services.php +++ b/src/usr/local/www/status_services.php @@ -165,7 +165,7 @@ if (count($services) > 0) { } ?> - Running':'Stopped'?> + ' . gettext("Running") . '':'' . gettext("Stopped") . ''?> -- cgit v1.1