From 1c550bed001f95807d8293f234403468bb8d42d7 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Fri, 18 Jun 2010 16:00:13 -0300 Subject: Implement gettext() calls --- usr/local/www/diag_packet_capture.php | 73 ++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/usr/local/www/diag_packet_capture.php b/usr/local/www/diag_packet_capture.php index 68248ea..e49d969 100644 --- a/usr/local/www/diag_packet_capture.php +++ b/usr/local/www/diag_packet_capture.php @@ -35,7 +35,7 @@ ##|*MATCH=diag_packet_capture.php* ##|-PRIV -$pgtitle = array("Diagnostics", "Packet Capture"); +$pgtitle = array(gettext("Diagnostics"), gettext("Packet Capture")); require_once("guiconfig.inc"); require_once("pfsense-utils.inc"); @@ -64,14 +64,14 @@ if ($_POST) { } if ($_POST['startbtn'] != "" ) { - $action = "Start"; + $action = gettext("Start"); //delete previous packet capture if it exists if (file_exists($fp.$fn)) unlink ($fp.$fn); } elseif ($_POST['stopbtn']!= "") { - $action = "Stop"; + $action = gettext("Stop"); $processes_running = trim(shell_exec('/bin/ps axw -O pid= | /usr/bin/grep tcpdump | /usr/bin/grep $fn | /usr/bin/grep -v pflog')); //explode processes into an array, (delimiter is new line) @@ -95,7 +95,6 @@ if ($_POST) { } else { $do_tcpdump = false; } -$pgtitle = "Diagnostics: Packet Capture"; include("head.inc"); ?> @@ -110,10 +109,10 @@ include("fbegin.inc");
- + - + - + - + - + - + - + - + @@ -190,14 +191,14 @@ include("fbegin.inc"); if ($processcheck != false) $processisrunning = true; - if (($action == "Stop" or $action == "") and $processisrunning != true) - echo " "; + if (($action == gettext("Stop") or $action == "") and $processisrunning != true) + echo " "; else { - echo " "; + echo " "; } if (file_exists($fp.$fn) and $processisrunning != true) { - echo ""; - echo "  (The packet capture file was last updated: " . date("F jS, Y g:i:s a.", filemtime($fp.$fn)) . ")"; + echo ""; + echo "  (" . gettext("The packet capture file was last updated") . ": " . date("F jS, Y g:i:s a.", filemtime($fp.$fn)) . ")"; } ?> @@ -207,7 +208,7 @@ include("fbegin.inc"); "; if ($processisrunning == true) - echo("Packet Capture is running.
"); + echo("" . gettext("Packet Capture is running.") . "
"); if ($do_tcpdump) { @@ -234,12 +235,12 @@ include("fbegin.inc"); $selectedif = convert_friendly_interface_to_real_interface_name($selectedif); - if ($action == "Start") { - echo("Packet Capture is running.
"); + if ($action == gettext("Start")) { + echo("" . gettext("Packet Capture is running.") . "
"); mwexec_bg ("/usr/sbin/tcpdump -i $selectedif $searchcount -s $packetlength -w $fp$fn $searchhost $searchport"); } else { //action = stop - echo("Packet Capture stopped.

Packets Captured:

"); + echo("" . gettext("Packet Capture stopped.") . "

" . gettext("Packets Captured") . ":

"); ?>
Packet capture
Interface -
Select the interface the traffic will be passing through. Typically this will be the WAN interface. +
Host Address -
This value is either the Source or Destination IP address. The packet capture will look for this address in either field. -
This value can be a domain name or IP address. -
If you leave this field blank, all packets on the specified interface will be captured. +
+
+
Port -
The port can be either the source or destination port. The packet capture will look for this port in either field. -
Leave blank if you do not want to filter by port. +
+
Packet Length -
The Packet length is the number of bytes the packet will capture for each payload. Default value is 1500. +
Count -
This is the number of packets the packet capture will grab. Default value is 100.
Enter 0 (zero) for no count limit. +
" . gettext("Enter 0 (zero) for no count limit.");?>
Level of Detail -
This is the level of detail that will be displayed after hitting 'Stop' when the packets have been captured.
Note: This option does not affect the level of detail when downloading the packet capture. +
" . + gettext("Note") . ": " . + gettext("This option does not affect the level of detail when downloading the packet capture.");?>
Reverse DNS Lookup > -
This check box will cause the packet capture to perform a reverse DNS lookup associated with all IP addresses. -
Note: This option can cause delays for large packet captures. +
+
: