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 "