From eb4cf3cb25606e08428ba06287742928d417d953 Mon Sep 17 00:00:00 2001 From: "Neriberto C.Prado" Date: Thu, 1 Jul 2010 15:00:47 -0300 Subject: [PATCH] implements gettext in interfaces_bridge_edit.php --- usr/local/www/interfaces_bridge_edit.php | 170 +++++++++++------------ 1 file changed, 85 insertions(+), 85 deletions(-) diff --git a/usr/local/www/interfaces_bridge_edit.php b/usr/local/www/interfaces_bridge_edit.php index 1b2b304b9f..0ab31c6e0a 100644 --- a/usr/local/www/interfaces_bridge_edit.php +++ b/usr/local/www/interfaces_bridge_edit.php @@ -104,45 +104,45 @@ if ($_POST) { /* input validation */ $reqdfields = explode(" ", "members"); - $reqdfieldsn = explode(",", "Member Interfaces"); + $reqdfieldsn = array(gettext("Member Interfaces")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); if ($_POST['maxage'] && !is_numeric($_POST['maxage'])) - $input_errors[] = "Maxage needs to be an integer between 6 and 40."; + $input_errors[] = gettext("Maxage needs to be an integer between 6 and 40."); if ($_POST['maxaddr'] && !is_numeric($_POST['maxaddr'])) - $input_errors[] = "Maxaddr needs to be an integer."; + $input_errors[] = gettext("Maxaddr needs to be an integer."); if ($_POST['timeout'] && !is_numeric($_POST['timeout'])) - $input_errors[] = "Timeout needs to be an integer."; + $input_errors[] = gettext("Timeout needs to be an integer."); if ($_POST['fwdelay'] && !is_numeric($_POST['fwdelay'])) - $input_errors[] = "Forward Delay needs to be an integer between 4 and 30."; + $input_errors[] = gettext("Forward Delay needs to be an integer between 4 and 30."); if ($_POST['hellotime'] && !is_numeric($_POST['hellotime'])) - $input_errors[] = "Hello time for STP needs to be an integer between 1 and 2."; + $input_errors[] = gettext("Hello time for STP needs to be an integer between 1 and 2."); if ($_POST['priority'] && !is_numeric($_POST['priority'])) - $input_errors[] = "Priority for STP needs to be an integer between 0 and 61440."; + $input_errors[] = gettext("Priority for STP needs to be an integer between 0 and 61440."); if ($_POST['holdcnt'] && !is_numeric($_POST['holdcnt'])) - $input_errors[] = "Transmit Hold Count for STP needs to be an integer between 1 and 10."; + $input_errors[] = gettext("Transmit Hold Count for STP needs to be an integer between 1 and 10."); foreach ($ifacelist as $ifn => $ifdescr) { if ($_POST[$ifn] <> "" && !is_numeric($_POST[$ifn])) - $input_errors[] = "{$ifdescr} interface priority for STP needs to be an integer between 0 and 240."; + $input_errors[] = "{$ifdescr} " . gettext("interface priority for STP needs to be an integer between 0 and 240."); } $i = 0; foreach ($ifacelist as $ifn => $ifdescr) { if ($_POST["{$ifn}{$i}"] <> "" && !is_numeric($_POST["{$ifn}{$i}"])) - $input_errors[] = "{$ifdescr} interface path cost for STP needs to be an integer between 1 and 200000000."; + $input_errors[] = "{$ifdescr} " . gettext("interface path cost for STP needs to be an integer between 1 and 200000000."); $i++; } if (!is_array($_POST['members']) || count($_POST['members']) < 2) - $input_errors[] = "You must select at least 2 member interfaces for a bridge."; + $input_errors[] = gettext("You must select at least 2 member interfaces for a bridge."); if (is_array($_POST['members'])) { foreach($_POST['members'] as $ifmembers) { if (is_array($config['interfaces'][$ifmembers]['wireless']) && $config['interfaces'][$ifmembers]['wireless']['mode'] != "hostap") - $input_errors[] = "Bridging a wireless interface is only possible in hostap mode."; + $input_errors[] = gettext("Bridging a wireless interface is only possible in hostap mode."); if ($_POST['span'] != "none" && $_POST['span'] == $ifmembers) - $input_errors[] = "Span interface cannot be part of the bridge. Remove the span interface from bridge members to continue."; + $input_errors[] = gettext("Span interface cannot be part of the bridge. Remove the span interface from bridge members to continue."); } } @@ -199,7 +199,7 @@ if ($_POST) { $bridge['bridgeif'] = $_POST['bridgeif']; $bridge['bridgeif'] = interface_bridge_configure($bridge); if ($bridge['bridgeif'] == "" || !stristr($bridge['bridgeif'], "bridge")) - $input_errors[] = "Error occured creating interface, please retry."; + $input_errors[] = gettext("Error occured creating interface, please retry."); else { if (isset($id) && $a_bridges[$id]) $a_bridges[$id] = $bridge; @@ -219,7 +219,7 @@ if ($_POST) { } } -$pgtitle = array("Firewall","Bridge","Edit"); +$pgtitle = array(gettext("Firewall"),gettext("Bridge"),gettext("Edit")); include("head.inc"); ?> @@ -246,10 +246,10 @@ function show_source_port_range() {
- + - + - + @@ -281,10 +281,10 @@ function show_source_port_range() { - + - + - + - + - + - + - + - + - +
Bridge configuration
Member interfaces
- Interfaces participating in the bridge. +
Description RSTP/STP > - Enable spanning tree options for this bridge. +

- + + - + - + - + - + - + - + - + - +
Protocol

- Protocol used for spanning tree.
STP interfaces

- - Enable Spanning Tree Protocol on interface. The if_bridge(4) + +
Valid time
- seconds +
- Set the time that a Spanning Tree Protocol configuration is +
Forward time
- seconds +
- Set the time that must pass before an interface begins forwarding - packets when Spanning Tree is enabled. The default is 15 seconds. The minimum is 4 seconds and the maximum is 30 seconds. +
Hello time
- seconds +
- Set the time between broadcasting of Spanning Tree Protocol configuration messages. The hello time may only be changed when - operating in legacy STP mode. The default is 2 seconds. The minimum is 1 second and the maximum is 2 seconds. +
Priority

- Set the bridge priority for Spanning Tree. The default is 32768. - The minimum is 0 and the maximum is 61440. +
Hold count

- Set the transmit hold count for Spanning Tree. This is the num- +
Priority
$ifdescr) @@ -375,11 +375,11 @@ function show_source_port_range() {

- Set the Spanning Tree priority of interface to value. The - default is 128. The minimum is 0 and the maximum is 240. +
Path cost
$ifdescr) @@ -388,40 +388,40 @@ function show_source_port_range() {

- Set the Spanning Tree path cost of interface to value. The +
  - + "> " onclick="history.back()">