From 136c598df3c390d01cc876669b89943eaeb22981 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Thu, 8 Jul 2010 23:15:30 -0300 Subject: Checked gettext() implementation on interfaces.php --- usr/local/www/interfaces.php | 452 +++++++++++++++++++++---------------------- 1 file changed, 226 insertions(+), 226 deletions(-) (limited to 'usr/local/www/interfaces.php') diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 81f3694..b71ec30 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -284,7 +284,7 @@ if (isset($wancfg['wireless'])) { if ($_POST['apply']) { unset($input_errors); if (!is_subsystem_dirty('interfaces')) - $intput_errors[] = "You have already applied your settings!"; + $intput_errors[] = gettext("You have already applied your settings!"); else { unlink_if_exists("{$g['tmp_path']}/config.cache"); clear_subsystem_dirty('interfaces'); @@ -296,7 +296,7 @@ if ($_POST['apply']) { /* restart snmp so that it binds to correct address */ services_snmpd_configure(); if ($if == "lan") - $savemsg = "The changes have been applied. You may need to correct your web browser's IP address."; + $savemsg = gettext("The changes have been applied. You may need to correct your web browser's IP address."); /* sync filter configuration */ setup_gateways_monitor(); @@ -346,11 +346,11 @@ if ($_POST) { /* description unique? */ foreach ($iflist as $ifent => $ifdescr) { if ($if != $ifent && $ifdescr == $_POST['descr']) - $input_errors[] = "An interface with the specified description already exists."; + $input_errors[] = gettext("An interface with the specified description already exists."); } /* input validation */ if (isset($config['dhcpd']) && isset($config['dhcpd'][$if]['enable']) && $_POST['type'] != "static") - $input_errors[] = "The DHCP Server is active on this interface and it can be used only with a static IP configuration. Please disable the DHCP Server service on this interface first, then change the interface configuration."; + $input_errors[] = gettext("The DHCP Server is active on this interface and it can be used only with a static IP configuration. Please disable the DHCP Server service on this interface first, then change the interface configuration."); switch($_POST['type']) { case "static": @@ -388,13 +388,13 @@ if ($_POST) { /* normalize MAC addresses - lowercase and convert Windows-ized hyphenated MACs to colon delimited */ $_POST['spoofmac'] = strtolower(str_replace("-", ":", $_POST['spoofmac'])); if (($_POST['ipaddr'] && !is_ipaddr($_POST['ipaddr']))) - $input_errors[] = "A valid IP address must be specified."; + $input_errors[] = gettext("A valid IP address must be specified."); if (($_POST['subnet'] && !is_numeric($_POST['subnet']))) - $input_errors[] = "A valid subnet bit count must be specified."; + $input_errors[] = gettext("A valid subnet bit count must be specified."); if (($_POST['alias-address'] && !is_ipaddr($_POST['alias-address']))) - $input_errors[] = "A valid alias IP address must be specified."; + $input_errors[] = gettext("A valid alias IP address must be specified."); if (($_POST['alias-subnet'] && !is_numeric($_POST['alias-subnet']))) - $input_errors[] = "A valid alias subnet bit count must be specified."; + $input_errors[] = gettext("A valid alias subnet bit count must be specified."); if ($_POST['gateway'] != "none") { $match = false; foreach($a_gateways as $gateway) { @@ -403,13 +403,13 @@ if ($_POST) { } } if(!$match) { - $input_errors[] = "A valid gateway must be specified."; + $input_errors[] = gettext("A valid gateway must be specified."); } } 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['pppoe_idletimeout'] != "") && !is_numericint($_POST['pppoe_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_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)."); @@ -419,17 +419,17 @@ if ($_POST) { if ($_POST['pppoe_resetdate'] <> "" && !is_numeric(str_replace("/", "", $_POST['pppoe_resetdate']))) $input_errors[] = gettext("A valid PPPoE reset date must be specified (mm/dd/yyyy)."); if (($_POST['pptp_local'] && !is_ipaddr($_POST['pptp_local']))) - $input_errors[] = "A valid PPTP local IP address must be specified."; + $input_errors[] = gettext("A valid PPTP local IP address must be specified."); if (($_POST['pptp_subnet'] && !is_numeric($_POST['pptp_subnet']))) - $input_errors[] = "A valid PPTP subnet bit count must be specified."; + $input_errors[] = gettext("A valid PPTP subnet bit count must be specified."); if (($_POST['pptp_remote'] && !is_ipaddr($_POST['pptp_remote']))) - $input_errors[] = "A valid PPTP remote IP address must be specified."; + $input_errors[] = gettext("A valid PPTP remote IP address must be specified."); if (($_POST['pptp_idletimeout'] != "") && !is_numericint($_POST['pptp_idletimeout'])) - $input_errors[] = "The idle timeout value must be an integer."; + $input_errors[] = gettext("The idle timeout value must be an integer."); if (($_POST['spoofmac'] && !is_macaddr($_POST['spoofmac']))) - $input_errors[] = "A valid MAC address must be specified."; + $input_errors[] = gettext("A valid MAC address must be specified."); if ($_POST['mtu'] && ($_POST['mtu'] < 576)) - $input_errors[] = "The MTU must be greater than 576 bytes."; + $input_errors[] = gettext("The MTU must be greater than 576 bytes."); /* Wireless interface? */ if (isset($wancfg['wireless'])) { $reqdfields = explode(" ", "mode ssid"); @@ -467,7 +467,7 @@ if ($_POST) { } if(strlen($_POST['key' . $i]) == 28) continue; - $input_errors[] = "Invalid WEP key size. Sizes should be 40 (64) bit keys or 104 (128) bit."; + $input_errors[] = gettext("Invalid WEP key size. Sizes should be 40 (64) bit keys or 104 (128) bit."); break; } } @@ -475,7 +475,7 @@ if ($_POST) { if ($_POST['passphrase']) { $passlen = strlen($_POST['passphrase']); if ($passlen < 8 || $passlen > 64) - $input_errors[] = "The length of the passphrase should be between 8 and 63 characters."; + $input_errors[] = gettext("The length of the passphrase should be between 8 and 63 characters."); } } if (!$input_errors) { @@ -521,8 +521,8 @@ if ($_POST) { } } if($skip == false) { - $gateway_item['gateway'] = "dynamic"; - $gateway_item['descr'] = "Interface {$if} dynamic gateway"; + $gateway_item['gateway'] = gettext("dynamic"); + $gateway_item['descr'] = gettext("Interface") . $if . gettext("dynamic gateway"); $gateway_item['name'] = "GW_" . strtoupper($if); $gateway_item['interface'] = "{$if}"; } else { @@ -796,7 +796,7 @@ function check_wireless_mode() { $old_wireless_mode = $wancfg['wireless']['mode']; $wancfg['wireless']['mode'] = $_POST['mode']; if (!interface_wireless_clone("{$wlanif}_", $wancfg)) { - $input_errors[] = "Unable to change mode to {$wlan_modes[$wancfg['wireless']['mode']]}. You may already have the maximum number of wireless clones supported in this mode."; + $input_errors[] = sprintf(gettext("Unable to change mode to %s . You may already have the maximum number of wireless clones supported in this mode."), $wlan_modes[$wancfg['wireless']['mode']]); } else { mwexec("/sbin/ifconfig {$wlanif}_ destroy"); } @@ -809,7 +809,7 @@ $statusurl = "status_interfaces.php"; $closehead = false; include("head.inc"); -$types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" => "PPTP" /* , "carpdev-dhcp" => "CarpDev"*/); +$types = array("none" => gettext("None"), "static" => gettext("Static"), "dhcp" => gettext("DHCP"), "ppp" => gettext("PPP"), "pppoe" => gettext("PPPoE"), "pptp" => gettext("PPTP") /* , "carpdev-dhcp" => "CarpDev"*/); ?> @@ -983,27 +983,27 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "ppp" =
- + - +
General configuration
Enable onClick="show_allcfg(this);"> - Enable Interface +