From 2f5cfc8580a9ea7ced5e47edc9a7e987c21db490 Mon Sep 17 00:00:00 2001 From: Rafael Lucas Date: Fri, 2 Jul 2010 17:33:32 -0300 Subject: [PATCH] Implement gettext() calls on interfaces_ppps_edit.php --- usr/local/www/interfaces_ppps_edit.php | 66 +++++++++++++------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/usr/local/www/interfaces_ppps_edit.php b/usr/local/www/interfaces_ppps_edit.php index f218f3c6c8..89a657c3d6 100644 --- a/usr/local/www/interfaces_ppps_edit.php +++ b/usr/local/www/interfaces_ppps_edit.php @@ -175,17 +175,17 @@ if ($_POST) { /* input validation */ switch($_POST['type']) { case "ppp": - $reqdfields = explode(" ", "interfaces phone"); - $reqdfieldsn = explode(",", "Link Interface(s),Phone Number"); + $reqdfields = explode("interfaces phone"); + $reqdfieldsn = array(gettext("Link Interface(s)"),gettext("Phone Number")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); break; case "pppoe": if ($_POST['ondemand']) { $reqdfields = explode(" ", "interfaces username password ondemand idletimeout"); - $reqdfieldsn = explode(",", "Link Interface(s),Username,Password,Dial on demand,Idle timeout value"); + $reqdfieldsn = array(gettext("Link Interface(s)"),gettext("Username"),gettext("Password"),gettext("Dial on demand"),gettext("Idle timeout value")); } else { $reqdfields = explode(" ", "interfaces username password"); - $reqdfieldsn = explode(",", "Link Interface(s),Username,Password"); + $reqdfieldsn = array(gettext("Link Interface(s)"),gettext("Username"),gettext("Password")); } do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); break; @@ -193,23 +193,23 @@ if ($_POST) { case "pptp": if ($_POST['ondemand']) { $reqdfields = explode(" ", "interfaces username password localip subnet gateway ondemand idletimeout"); - $reqdfieldsn = explode(",", "Link Interface(s),Username,Password,Local IP address,Subnet,Remote IP address,Dial on demand,Idle timeout value"); + $reqdfieldsn = array(gettext("Link Interface(s)"),gettext("Username"),gettext("Password"),gettext("Local IP address"),gettext("Subnet"),gettext("Remote IP address"),gettext("Dial on demand"),gettext("Idle timeout value")); } else { $reqdfields = explode(" ", "interfaces username password localip subnet gateway"); - $reqdfieldsn = explode(",", "Link Interface(s),Username,Password,Local IP address,Subnet,Remote IP address"); + $reqdfieldsn = array(gettext("Link Interface(s)"),gettext("Username"),gettext("Password"),gettext("Local IP address"),gettext("Subnet"),gettext("Remote IP address")); } do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); break; default: - $input_errors[] = "Please choose a Link Type."; + $input_errors[] = gettext("Please choose a Link Type."); break; } if ($_POST['type'] == "ppp" && count($_POST['interfaces']) > 1) - $input_errors[] = "Multilink connections (MLPPP) using the PPP link type is not currently supported. Please select only one Link Interface."; + $input_errors[] = gettext("Multilink connections (MLPPP) using the PPP link type is not currently supported. Please select only one Link Interface."); if (($_POST['provider'] && !is_domain($_POST['provider']))) - $input_errors[] = "The service name contains invalid characters."; + $input_errors[] = gettext("The service name contains invalid characters."); if (($_POST['idletimeout'] != "") && !is_numericint($_POST['idletimeout'])) - $input_errors[] = "The idle timeout value must be an integer."; + $input_errors[] = gettext("The idle timeout value must be an integer."); if ($_POST['pppoe-reset-type'] == "custom" && $_POST['pppoe_resethour'] <> "" && !is_numericint($_POST['pppoe_resethour']) && $_POST['pppoe_resethour'] >= 0 && $_POST['pppoe_resethour'] <=23) $input_errors[] = gettext("A valid PPPoE reset hour must be specified (0-23)."); @@ -230,15 +230,15 @@ if ($_POST) { foreach($_POST['interfaces'] as $iface){ if ($_POST['localip'][$iface] && !is_ipaddr($_POST['localip'][$iface])) - $input_errors[] = "A valid local IP address must be specified for {$iface}."; + $input_errors[] = sprintf(gettext("A valid local IP address must be specified for %s."),$iface); if ($_POST['gateway'][$iface] && !is_ipaddr($_POST['gateway'][$iface]) && !is_hostname($_POST['gateway'][$iface])) - $input_errors[] = "A valid gateway IP address OR hostname must be specified for {$iface}."; + $input_errors[] = sprintf(gettext("A valid gateway IP address OR hostname must be specified for %s."),$iface); if ($_POST['bandwidth'][$iface] && !is_numericint($_POST['bandwidth'][$iface])) - $input_errors[] = "The bandwidth value for {$iface} must be an integer."; + $input_errors[] = sprintf(gettext("The bandwidth value for %s must be an integer."),$iface); if ($_POST['mtu'][$iface] && ($_POST['mtu'][$iface] < 576)) - $input_errors[] = "The MTU for {$iface} must be greater than 576 bytes."; + $input_errors[] = sprintf(gettext("The MTU for %s must be greater than 576 bytes."),$iface); if ($_POST['mru'][$iface] && ($_POST['mru'][$iface] < 576)) - $input_errors[] = "The MRU for {$iface} must be greater than 576 bytes."; + $input_errors[] = sprintf(gettext("The MRU for %s must be greater than 576 bytes."),$iface); } /* @@ -370,10 +370,10 @@ if ($_POST) { } // end if($_POST) $closehead = false; -$pgtitle = array("Interfaces","PPPs","Edit"); +$pgtitle = array(gettext("Interfaces"),gettext("PPPs"),gettext("Edit")); include("head.inc"); -$types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" => "PPTP", "l2tp" => "L2TP"/*, "tcp" => "TCP", "udp" => "UDP"*/ ); +$types = array("select" => gettext("Select"), "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" => "PPTP", "l2tp" => "L2TP"/*, "tcp" => "TCP", "udp" => "UDP"*/ ); ?> @@ -613,7 +613,7 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp"
 
- Note: +

@@ -682,32 +682,32 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" -
When the idle timeout occurs, if the dial-on-demand option is enabled, mpd goes back into dial-on-demand mode. Otherwise, the interface is brought down and all associated routes removed."); ?> +
+
-
This option enables Van Jacobson TCP header compression, which saves several bytes per TCP data packet. +
+ stamping or SACK, which modify TCP options between sequential packets.");?> -
This option causes mpd to adjust incoming and outgoing TCP SYN segments so that the requested maximum segment size is not greater than the amount - allowed by the interface MTU. This is necessary in many setups to avoid problems caused by routers that drop ICMP Datagram Too Big messages. Without these messages, - the originating machine sends data, it passes the rogue router then hits a machine that has an MTU that is not big enough for the data. Because the IP Don't Fragment option is set, - this machine sends an ICMP Datagram Too Big message back to the originator and drops the packet. The rogue router drops the ICMP message and the originator never - gets to discover that it must reduce the fragment size or drop the IP Don't Fragment option from its outgoing data. +
- ShortSeq +
"Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" - Link Parameters + - +
Bandwidth
-
Set Bandwidth for each link ONLY for MLPPP connections and ONLY when links have different bandwidths. +
MTU -
MTU will default to 1492. +
MRU -
MRU will default to 1492. +