From 40ad67e0b50e232c03a6d96062e54d3eee2003be Mon Sep 17 00:00:00 2001 From: Rafael Lucas Date: Tue, 13 Jul 2010 14:24:53 -0300 Subject: [PATCH] Implement gettext() calls on services_dhcp.php --- usr/local/www/services_dhcp.php | 192 ++++++++++++++++---------------- 1 file changed, 96 insertions(+), 96 deletions(-) diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php index 79fd1d8e95..a44a41a33e 100755 --- a/usr/local/www/services_dhcp.php +++ b/usr/local/www/services_dhcp.php @@ -113,7 +113,7 @@ if($config['installedpackages']['olsrd']) { } if (!$_GET['if']) - $savemsg = "The DHCP Server can only be enabled on interfaces configured with static IP addresses.

Only interfaces configured with a static IP will be shown.

"; + $savemsg = gettext("The DHCP Server can only be enabled on interfaces configured with static IP addresses.

Only interfaces configured with a static IP will be shown.

"); $iflist = get_configured_interface_with_descr(); @@ -208,47 +208,47 @@ if ($_POST) { /* input validation */ if ($_POST['enable']) { $reqdfields = explode(" ", "range_from range_to"); - $reqdfieldsn = explode(",", "Range begin,Range end"); + $reqdfieldsn = array(gettext("Range begin"),gettext("Range end")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); if (($_POST['range_from'] && !is_ipaddr($_POST['range_from']))) - $input_errors[] = "A valid range must be specified."; + $input_errors[] = gettext("A valid range must be specified."); if (($_POST['range_to'] && !is_ipaddr($_POST['range_to']))) - $input_errors[] = "A valid range must be specified."; + $input_errors[] = gettext("A valid range must be specified."); if (($_POST['gateway'] && !is_ipaddr($_POST['gateway']))) - $input_errors[] = "A valid IP address must be specified for the gateway."; + $input_errors[] = gettext("A valid IP address must be specified for the gateway."); if (($_POST['wins1'] && !is_ipaddr($_POST['wins1'])) || ($_POST['wins2'] && !is_ipaddr($_POST['wins2']))) - $input_errors[] = "A valid IP address must be specified for the primary/secondary WINS servers."; + $input_errors[] = gettext("A valid IP address must be specified for the primary/secondary WINS servers."); if (($_POST['dns1'] && !is_ipaddr($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddr($_POST['dns2']))) - $input_errors[] = "A valid IP address must be specified for the primary/secondary DNS servers."; + $input_errors[] = gettext("A valid IP address must be specified for the primary/secondary DNS servers."); if ($_POST['deftime'] && (!is_numeric($_POST['deftime']) || ($_POST['deftime'] < 60))) - $input_errors[] = "The default lease time must be at least 60 seconds."; + $input_errors[] = gettext("The default lease time must be at least 60 seconds."); if ($_POST['maxtime'] && (!is_numeric($_POST['maxtime']) || ($_POST['maxtime'] < 60) || ($_POST['maxtime'] <= $_POST['deftime']))) - $input_errors[] = "The maximum lease time must be at least 60 seconds and higher than the default lease time."; + $input_errors[] = gettext("The maximum lease time must be at least 60 seconds and higher than the default lease time."); if (($_POST['ddnsdomain'] && !is_domain($_POST['ddnsdomain']))) - $input_errors[] = "A valid domain name must be specified for the dynamic DNS registration."; + $input_errors[] = gettext("A valid domain name must be specified for the dynamic DNS registration."); if (($_POST['ntp1'] && !is_ipaddr($_POST['ntp1'])) || ($_POST['ntp2'] && !is_ipaddr($_POST['ntp2']))) - $input_errors[] = "A valid IP address must be specified for the primary/secondary NTP servers."; + $input_errors[] = gettext("A valid IP address must be specified for the primary/secondary NTP servers."); if (($_POST['domain'] && !is_domain($_POST['domain']))) - $input_errors[] = "A valid domain name must be specified for the DNS domain."; + $input_errors[] = gettext("A valid domain name must be specified for the DNS domain."); if (($_POST['tftp'] && (!is_ipaddr($_POST['tftp']) && !is_domain($_POST['tftp'])))) - $input_errors[] = "A valid IP address or hostname must be specified for the TFTP server."; + $input_errors[] = gettext("A valid IP address or hostname must be specified for the TFTP server."); if (($_POST['nextserver'] && !is_ipaddr($_POST['nextserver']))) - $input_errors[] = "A valid IP address must be specified for the network boot server."; + $input_errors[] = gettext("A valid IP address must be specified for the network boot server."); if(gen_subnet($ifcfgip, $ifcfgsn) == $_POST['range_from']) - $input_errors[] = "You cannot use the network address in the starting subnet range."; + $input_errors[] = gettext("You cannot use the network address in the starting subnet range."); if(gen_subnet_max($ifcfgip, $ifcfgsn) == $_POST['range_to']) - $input_errors[] = "You cannot use the broadcast address in the ending subnet range."; + $input_errors[] = gettext("You cannot use the broadcast address in the ending subnet range."); // Disallow a range that includes the virtualip if (is_array($config['virtualip']['vip'])) { foreach($config['virtualip']['vip'] as $vip) { if($vip['interface'] == $if) if($vip['subnet'] && is_inrange($vip['subnet'], $_POST['range_from'], $_POST['range_to'])) - $input_errors[] = "The subnet range cannot overlap with virtual IP address {$vip['subnet']}."; + $input_errors[] = printf(gettext("The subnet range cannot overlap with virtual IP address %s."),$vip['subnet']); } } @@ -259,15 +259,15 @@ if ($_POST) { if ((ip2ulong($_POST['range_from']) < $subnet_start) || (ip2ulong($_POST['range_from']) > $subnet_end) || (ip2ulong($_POST['range_to']) < $subnet_start) || (ip2ulong($_POST['range_to']) > $subnet_end)) { - $input_errors[] = "The specified range lies outside of the current subnet."; + $input_errors[] = gettext("The specified range lies outside of the current subnet."); } if (ip2ulong($_POST['range_from']) > ip2ulong($_POST['range_to'])) - $input_errors[] = "The range is invalid (first element higher than second element)."; + $input_errors[] = gettext("The range is invalid (first element higher than second element)."); /* make sure that the DHCP Relay isn't enabled on this interface */ if (isset($config['dhcrelay'][$if]['enable'])) - $input_errors[] = "You must disable the DHCP relay on the {$iflist[$if]} interface before enabling the DHCP server."; + $input_errors[] = printf(gettext("You must disable the DHCP relay on the %s interface before enabling the DHCP server."),$iflist[$if]); } } @@ -372,7 +372,7 @@ if ($_GET['act'] == "del") { } } -$pgtitle = array("Services","DHCP server"); +$pgtitle = array(gettext("Services"),gettext("DHCP server")); $statusurl = "status_dhcp_leases.php"; $logurl = "diag_logs_dhcp.php"; @@ -466,7 +466,7 @@ include("head.inc"); "; echo ""; @@ -474,7 +474,7 @@ include("head.inc"); } ?>

-You must apply the changes in order for them to take effect.");?>
+You must apply the changes in order for them to take effect."));?>
+ +
+ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +
@@ -513,31 +513,31 @@ include("head.inc");   onClick="enable_change(false)"> - Enable DHCP server on - - interface
  > - Deny unknown clients
- If this is checked, only the clients defined below will get DHCP leases from this server.
Subnet
Subnet mask
Available range
Subnet Mask
Range  to 
WINS servers
DNS servers

- NOTE: leave blank to use the system default DNS servers - this interface's IP if DNS forwarder is enabled, otherwise the servers configured on the General page. +
Gateway
- The default is to use the IP on this interface of the firewall as the gateway. Specify an alternate gateway here if this is not the correct gateway for your network. +
Domain name
- The default is to use the domain name of this system as the default domain name provided by DHCP. You may specify an alternate domain name here. +
Domain search list
- The DHCP server can optionally provide a domain search list. +
Default lease time - seconds
- This is used for clients that do not ask for a specific +
+ - The default is 7200 seconds. + The default is 7200 seconds.");?>
Maximum lease time - seconds
- This is the maximum lease time for clients that ask - for a specific expiration time.
- The default is 86400 seconds. +
+ ". + " The default is 86400 seconds.");?>
Failover peer IP:
- Leave blank to disable. Enter the interface IP address of the other machine. Machines must be using CARP. +
Static ARP - +
Enable Static ARP entries
  - Note: Only the machines listed below will be able to communicate with the firewall on this NIC. +
Dynamic DNS
- - Show Dynamic DNS + ">
NTP servers
- - Show NTP configuration + ">
TFTP server
- - Show TFTP configuration + ">
LDAP URI
- - Show LDAP configuration + ">
Enable network booting
- - Show Network booting + ">
Additional BOOTP/DHCP Options
- - Show Additional BOOTP/DHCP Options + ">