Commit c48cf61f authored by Franco Fichtner's avatar Franco Fichtner

rc: remove translations from console

parent af1928de
...@@ -60,7 +60,7 @@ function set_networking_interfaces_ports($probe = false) ...@@ -60,7 +60,7 @@ function set_networking_interfaces_ports($probe = false)
$iflist = get_interface_list(false, true); $iflist = get_interface_list(false, true);
if ($probe) { if ($probe) {
echo PHP_EOL . gettext('Press any key to start the manual interface assignment: '); echo PHP_EOL . 'Press any key to start the manual interface assignment: ';
$key = timeout(); $key = timeout();
if (!isset($key)) { if (!isset($key)) {
...@@ -79,7 +79,7 @@ Valid interfaces are: ...@@ -79,7 +79,7 @@ Valid interfaces are:
EOD; EOD;
if (!is_array($iflist)) { if (!is_array($iflist)) {
echo gettext("No interfaces found!") . "\n"; echo "No interfaces found!\n";
$iflist = array(); $iflist = array();
} else { } else {
foreach ($iflist as $iface => $ifa) { foreach ($iflist as $iface => $ifa) {
...@@ -109,7 +109,7 @@ EOD; ...@@ -109,7 +109,7 @@ EOD;
} }
if (isset($config['vlans']['vlan'])) { if (isset($config['vlans']['vlan'])) {
echo "\n\n" . gettext("VLAN interfaces:") . "\n\n"; echo "\n\nVLAN interfaces:\n\n";
foreach ($config['vlans']['vlan'] as $vlan) { foreach ($config['vlans']['vlan'] as $vlan) {
echo sprintf("% -16s%s\n", "{$vlan['if']}_vlan{$vlan['tag']}", echo sprintf("% -16s%s\n", "{$vlan['if']}_vlan{$vlan['tag']}",
"VLAN tag {$vlan['tag']}, parent interface {$vlan['if']}"); "VLAN tag {$vlan['tag']}, parent interface {$vlan['if']}");
...@@ -126,7 +126,7 @@ hitting 'a' to initiate auto detection. ...@@ -126,7 +126,7 @@ hitting 'a' to initiate auto detection.
EOD; EOD;
do { do {
echo "\n" . gettext("Enter the WAN interface name or 'a' for auto-detection:") . " "; echo "\nEnter the WAN interface name or 'a' for auto-detection: ";
if ($interactive) { if ($interactive) {
$wanif = chop(fgets($fp)); $wanif = chop(fgets($fp));
...@@ -148,15 +148,15 @@ EOD; ...@@ -148,15 +148,15 @@ EOD;
} }
if (!array_key_exists($wanif, $iflist)) { if (!array_key_exists($wanif, $iflist)) {
printf("\n" . gettext("Invalid interface name '%s'") . "\n", $wanif); printf("\nInvalid interface name '%s'\n", $wanif);
unset($wanif); unset($wanif);
} }
} while (!$wanif); } while (!$wanif);
do { do {
printf(gettext("%sEnter the LAN interface name or 'a' for auto-detection %s" . echo "\nEnter the LAN interface name or 'a' for auto-detection\n" .
"NOTE: this enables full Firewalling/NAT mode.%s" . "NOTE: this enables full Firewalling/NAT mode.\n" .
"(or nothing if finished):%s"), "\n", "\n", "\n", " "); "(or nothing if finished): ";
if ($interactive) { if ($interactive) {
$lanif = chop(fgets($fp)); $lanif = chop(fgets($fp));
...@@ -178,7 +178,7 @@ EOD; ...@@ -178,7 +178,7 @@ EOD;
} }
if (!array_key_exists($lanif, $iflist)) { if (!array_key_exists($lanif, $iflist)) {
printf(gettext("%sInvalid interface name '%s'%s"), "\n", $lanif, "\n"); printf("\nInvalid interface name '%s'\n", $lanif);
unset($lanif); unset($lanif);
} }
...@@ -205,11 +205,11 @@ EOD; ...@@ -205,11 +205,11 @@ EOD;
$io = $i + 1; $io = $i + 1;
if ($config['interfaces']['opt' . $io]['descr']) { if ($config['interfaces']['opt' . $io]['descr']) {
printf(gettext("%sOptional interface %s description found: %s"), "\n", $io, $config['interfaces']['opt' . $io]['descr']); printf("\nOptional interface %s description found: %s", $io, $config['interfaces']['opt' . $io]['descr']);
} }
printf(gettext("%sEnter the Optional %s interface name or 'a' for auto-detection%s" . printf("\nEnter the Optional %s interface name or 'a' for auto-detection\n" .
"(or nothing if finished):%s"), "\n", $io, "\n", " "); "(or nothing if finished): ", $io);
if ($interactive) { if ($interactive) {
$optif[$i] = chop(fgets($fp)); $optif[$i] = chop(fgets($fp));
...@@ -235,7 +235,7 @@ EOD; ...@@ -235,7 +235,7 @@ EOD;
} }
if (!array_key_exists($optif[$i], $iflist)) { if (!array_key_exists($optif[$i], $iflist)) {
printf(gettext("%sInvalid interface name '%s'%s"), "\n", $optif[$i], "\n"); printf("\nInvalid interface name '%s'\n", $optif[$i]);
unset($optif[$i]); unset($optif[$i]);
continue; continue;
} }
...@@ -263,7 +263,7 @@ EOD; ...@@ -263,7 +263,7 @@ EOD;
} }
} }
echo "\n" . gettext("The interfaces will be assigned as follows:") . "\n\n"; echo "\nThe interfaces will be assigned as follows:\n\n";
if ($wanif != '') { if ($wanif != '') {
echo "WAN -> " . $wanif . "\n"; echo "WAN -> " . $wanif . "\n";
...@@ -412,9 +412,10 @@ EOD; ...@@ -412,9 +412,10 @@ EOD;
unset($config['interfaces']['opt' . ($i+1)]); unset($config['interfaces']['opt' . ($i+1)]);
} }
printf(gettext("%sWriting configuration..."), "\n"); echo "\nWriting configuration...";
flush();
write_config("Console assignment of interfaces"); write_config("Console assignment of interfaces");
printf(gettext("done.%s"), "\n"); echo "done.\n";
fclose($fp); fclose($fp);
...@@ -438,13 +439,13 @@ EOD; ...@@ -438,13 +439,13 @@ EOD;
if (is_array($iflist)) { if (is_array($iflist)) {
foreach ($iflist as $ifn => $ifa) { foreach ($iflist as $ifn => $ifa) {
if (!isset($iflist_prev[$ifn])) { if (!isset($iflist_prev[$ifn])) {
printf(gettext("Detected link-up: %s%s"), $ifn, "\n"); printf("Detected link-up: %s\n", $ifn);
return $ifn; return $ifn;
} }
} }
} }
printf(gettext("No link-up detected.%s"), "\n"); echo "No link-up detected.\n";
return false; return false;
} }
...@@ -477,9 +478,9 @@ EOD; ...@@ -477,9 +478,9 @@ EOD;
while (1) { while (1) {
$vlan = array(); $vlan = array();
echo "\n\n" . gettext("VLAN Capable interfaces:") . "\n\n"; echo "\n\nVLAN-capable interfaces:\n\n";
if(!is_array($iflist)) { if(!is_array($iflist)) {
echo gettext("No interfaces found!") . "\n"; echo "No interfaces found!\n";
} else { } else {
$vlan_capable=0; $vlan_capable=0;
foreach ($iflist as $iface => $ifa) { foreach ($iflist as $iface => $ifa) {
...@@ -492,28 +493,28 @@ EOD; ...@@ -492,28 +493,28 @@ EOD;
} }
if($vlan_capable == 0) { if($vlan_capable == 0) {
echo gettext("No VLAN capable interfaces detected.") . "\n"; echo "No VLAN-capable interfaces detected.\n";
return; return;
} }
echo "\n" . gettext("Enter the parent interface name for the new VLAN (or nothing if finished):") . " "; echo "\nEnter the parent interface name for the new VLAN (or nothing if finished): ";
$vlan['if'] = chop(fgets($fp)); $vlan['if'] = chop(fgets($fp));
if ($vlan['if']) { if ($vlan['if']) {
if (!array_key_exists($vlan['if'], $iflist) or if (!array_key_exists($vlan['if'], $iflist) or
!is_jumbo_capable($vlan['if'])) { !is_jumbo_capable($vlan['if'])) {
printf(gettext("%sInvalid interface name '%s'%s"), "\n", $vlan['if'], "\n"); printf("\nInvalid interface name '%s'\n", $vlan['if']);
continue; continue;
} }
} else { } else {
break; break;
} }
echo gettext("Enter the VLAN tag (1-4094):") . " "; echo 'Enter the VLAN tag (1-4094): ';
$vlan['tag'] = chop(fgets($fp)); $vlan['tag'] = chop(fgets($fp));
$vlan['vlanif'] = "{$vlan['if']}_vlan{$vlan['tag']}"; $vlan['vlanif'] = "{$vlan['if']}_vlan{$vlan['tag']}";
if (!is_numericint($vlan['tag']) || ($vlan['tag'] < 1) || ($vlan['tag'] > 4094)) { if (!is_numericint($vlan['tag']) || ($vlan['tag'] < 1) || ($vlan['tag'] > 4094)) {
printf(gettext("%sInvalid VLAN tag '%s'%s"), "\n", $vlan['tag'], "\n"); printf("\nInvalid VLAN tag '%s'\n", $vlan['tag']);
continue; continue;
} }
......
...@@ -33,20 +33,20 @@ require_once('auth.inc'); ...@@ -33,20 +33,20 @@ require_once('auth.inc');
$fp = fopen('php://stdin', 'r'); $fp = fopen('php://stdin', 'r');
printf( printf(
gettext('The %s password will be reset to the factory default of `%s\'.'), 'The %s password will be reset to the factory default of `%s\'.',
$g['factory_shipped_username'], $g['factory_shipped_username'],
$g['factory_shipped_password'] $g['factory_shipped_password']
); );
printf("\n\n"); printf("\n\n");
printf(gettext('Do you want to proceed [y|n]? ')); printf('Do you want to proceed [y|n]? ');
if (strcasecmp(chop(fgets($fp)), 'y') == 0) { if (strcasecmp(chop(fgets($fp)), 'y') == 0) {
if (isset($config['system']['webgui']['authmode']) && if (isset($config['system']['webgui']['authmode']) &&
$config['system']['webgui']['authmode'] != 'Local Database') { $config['system']['webgui']['authmode'] != 'Local Database') {
printf("\n\n"); printf("\n\n");
printf(gettext('The User manager authentication server is set to "%s".'), $config['system']['webgui']['authmode']); printf('The User manager authentication server is set to "%s".', $config['system']['webgui']['authmode']);
printf("\n"); printf("\n");
printf(gettext('Do you want to set it back to Local Database [y|n]? ')); printf('Do you want to set it back to Local Database [y|n]? ');
if (strcasecmp(chop(fgets($fp)), 'y') == 0) { if (strcasecmp(chop(fgets($fp)), 'y') == 0) {
$config['system']['webgui']['authmode'] = 'Local Database'; $config['system']['webgui']['authmode'] = 'Local Database';
} }
...@@ -75,8 +75,8 @@ if (strcasecmp(chop(fgets($fp)), 'y') == 0) { ...@@ -75,8 +75,8 @@ if (strcasecmp(chop(fgets($fp)), 'y') == 0) {
write_config('Password reset from console menu'); write_config('Password reset from console menu');
printf("\n\n"); printf("\n\n");
printf(gettext("The password has been reset.")); printf('The password has been reset.');
printf("\n"); printf("\n");
printf(gettext("Please change the password as soon as you log in!")); printf('Please change the password as soon as you log in!');
printf("\n\n"); printf("\n\n");
} }
...@@ -10,14 +10,14 @@ $fp = fopen('php://stdin', 'r'); ...@@ -10,14 +10,14 @@ $fp = fopen('php://stdin', 'r');
function print_backup_info($backup_info, $number) { function print_backup_info($backup_info, $number) {
if($backup_info['time'] != 0) if($backup_info['time'] != 0)
$date = date(gettext("n/j/y H:i:s"), $backup_info['time']); $date = date('n/j/y H:i:s', $backup_info['time']);
else else
$date = gettext("Unknown"); $date = 'Unknown';
list($page, $reason) = explode(": ", $backup_info['description'], 2); list($page, $reason) = explode(": ", $backup_info['description'], 2);
if (empty($reason)) { if (empty($reason)) {
$reason = $page; $reason = $page;
$page = gettext("Unknown Page"); $page = 'Unknown Page';
} }
echo sprintf("%02d", $number) . ". {$date}\tv{$backup_info['version']}\t{$page}\n"; echo sprintf("%02d", $number) . ". {$date}\tv{$backup_info['version']}\t{$page}\n";
...@@ -30,7 +30,7 @@ function list_backups($which="all") { ...@@ -30,7 +30,7 @@ function list_backups($which="all") {
global $confvers; global $confvers;
if (count($confvers) == 0) { if (count($confvers) == 0) {
echo gettext("No backups found in the configuration history."); echo 'No backups found in the configuration history.';
return; return;
} }
...@@ -46,16 +46,16 @@ function list_backups($which="all") { ...@@ -46,16 +46,16 @@ function list_backups($which="all") {
function choose_backup() { function choose_backup() {
global $fp, $confvers; global $fp, $confvers;
if (count($confvers) == 0) { if (count($confvers) == 0) {
echo gettext("No backups found in the configuration history."); echo 'No backups found in the configuration history.';
return -1; return -1;
} }
echo gettext("Which configuration would you like to restore?") . "\n"; echo "Which configuration would you like to restore?\n";
echo " 1-" . count($confvers) . " : "; echo " 1-" . count($confvers) . " : ";
$number = strtoupper(chop(fgets($fp))); $number = strtoupper(chop(fgets($fp)));
if (is_numeric($number) && ($number > 0) && ($number <= count($confvers))) { if (is_numeric($number) && ($number > 0) && ($number <= count($confvers))) {
return $number; return $number;
} else { } else {
echo gettext("That is not a valid backup number.\n"); echo "That is not a valid backup number.\n";
return -1; return -1;
} }
} }
...@@ -65,45 +65,38 @@ function restore_history_backup($number) ...@@ -65,45 +65,38 @@ function restore_history_backup($number)
global $fp, $confvers; global $fp, $confvers;
if (is_numeric($number) && ($number > 0) && ($number <= count($confvers))) { if (is_numeric($number) && ($number > 0) && ($number <= count($confvers))) {
echo "\n" . gettext("Is this the backup you wish to restore?") . "\n"; echo "\nIs this the backup you wish to restore?\n";
list_backups($number); list_backups($number);
$filename = array_keys($confvers)[$number-1]; $filename = array_keys($confvers)[$number-1];
$thisbackup = $confvers[$filename]; $thisbackup = $confvers[$filename];
echo gettext("Y/N?") . " : "; echo 'Y/N? : ';
$confirm = strtoupper(chop(fgets($fp))); $confirm = strtoupper(chop(fgets($fp)));
if ($confirm == gettext("Y")) { if ($confirm == 'Y') {
$cnf = OPNsense\Core\Config::getInstance(); $cnf = OPNsense\Core\Config::getInstance();
if($cnf->restoreBackup($filename)){ if($cnf->restoreBackup($filename)){
echo "\n"; echo "\n";
echo sprintf(gettext('Successfully reverted to timestamp %s with description "%s".'), date(gettext("n/j/y H:i:s"), $thisbackup['time']), $thisbackup['description']); echo sprintf('Successfully reverted to timestamp %s with description "%s".', date('n/j/y H:i:s', $thisbackup['time']), $thisbackup['description']);
echo "\n" . gettext("You may need to reboot the firewall or restart services before the restored configuration is fully active.") . "\n\n"; echo "\nYou may need to reboot the firewall or restart services before the restored configuration is fully active.\n\n";
} else { } else {
echo gettext("Unable to revert to the selected configuration.") . "\n"; echo "Unable to revert to the selected configuration.\n";
} }
} else { } else {
echo gettext("Restore canceled.") . "\n"; echo "Restore canceled.\n";
} }
} else { } else {
echo gettext("Restore canceled due to invalid input.") . "\n"; echo "Restore canceled due to invalid input.\n";
} }
} }
while (true) { while (true) {
echo "\nRestore Backup from Configuration History\n\n";
echo "\n"; echo "1) List Backups\n";
echo gettext("Restore Backup from Configuration History") . "\n\n"; echo "2) Restore Backup\n";
echo "1) " . gettext("List Backups") . "\n"; echo "q) Quit\n\n\n";
echo "2) " . gettext("Restore Backup") . "\n"; echo "Please select an option to continue: ";
echo "Q) " . gettext("Quit") . "\n";
echo "\n\n";
echo gettext("Please select an option to continue") . ": ";
$command = strtolower(chop(fgets($fp))); $command = strtolower(chop(fgets($fp)));
// Make sure we can detect a foreign language "quit" command.
if (strtolower($command) == gettext("quit"))
$command = "quit";
switch ($command) { switch ($command) {
case "q": case "q":
case "quit": case "quit":
......
...@@ -113,7 +113,7 @@ function prompt_for_enable_dhcp_server($version = 4) ...@@ -113,7 +113,7 @@ function prompt_for_enable_dhcp_server($version = 4)
$label_DHCP = ($version === 6) ? "DHCP6" : "DHCP"; $label_DHCP = ($version === 6) ? "DHCP6" : "DHCP";
$upperifname = strtoupper($interface); $upperifname = strtoupper($interface);
return console_prompt_for_yn(sprintf(gettext("Do you want to enable the %s server on %s?"), $label_DHCP, $upperifname)); return console_prompt_for_yn(sprintf('Do you want to enable the %s server on %s?', $label_DHCP, $upperifname));
} }
function get_interface_config_description($iface) function get_interface_config_description($iface)
...@@ -270,7 +270,7 @@ function console_configure_ip_address($version) ...@@ -270,7 +270,7 @@ function console_configure_ip_address($version)
$upperifname = strtoupper($interface); $upperifname = strtoupper($interface);
if ($interface == "wan") { if ($interface == "wan") {
if (console_prompt_for_yn(sprintf(gettext("Configure %s address %s interface via %s?"), $label_IPvX, $upperifname, $label_DHCP))) { if (console_prompt_for_yn(sprintf('Configure %s address %s interface via %s?', $label_IPvX, $upperifname, $label_DHCP))) {
$ifppp = console_get_interface_from_ppp(get_real_interface("wan")); $ifppp = console_get_interface_from_ppp(get_real_interface("wan"));
if (!empty($ifppp)) { if (!empty($ifppp)) {
$ifaceassigned = $ifppp; $ifaceassigned = $ifppp;
...@@ -286,7 +286,7 @@ function console_configure_ip_address($version) ...@@ -286,7 +286,7 @@ function console_configure_ip_address($version)
while (true) { while (true) {
do { do {
echo "\n" . sprintf( echo "\n" . sprintf(
gettext("Enter the new %s %s address. Press <ENTER> for none:"), 'Enter the new %s %s address. Press <ENTER> for none:',
$upperifname, $upperifname,
$label_IPvX $label_IPvX
) . "\n> "; ) . "\n> ";
...@@ -294,13 +294,13 @@ function console_configure_ip_address($version) ...@@ -294,13 +294,13 @@ function console_configure_ip_address($version)
$is_ipaddr = ($version === 6) ? is_ipaddrv6($intip) : is_ipaddrv4($intip); $is_ipaddr = ($version === 6) ? is_ipaddrv6($intip) : is_ipaddrv4($intip);
if ($is_ipaddr && is_ipaddr_configured($intip, $interface)) { if ($is_ipaddr && is_ipaddr_configured($intip, $interface)) {
$ip_conflict = true; $ip_conflict = true;
echo gettext("This IP address conflicts with another interface or a VIP") . "\n"; echo "This IP address conflicts with another interface or a VIP\n";
} else { } else {
$ip_conflict = false; $ip_conflict = false;
} }
} while (($ip_conflict === true) || !($is_ipaddr || $intip == '')); } while (($ip_conflict === true) || !($is_ipaddr || $intip == ''));
if ($intip != '') { if ($intip != '') {
echo "\n" . gettext("Subnet masks are entered as bit counts (like CIDR notation).") . "\n"; echo "\nSubnet masks are entered as bit counts (like CIDR notation).\n";
if ($version === 6) { if ($version === 6) {
echo "e.g. ffff:ffff:ffff:ffff:ffff:ffff:ffff:ff00 = 120\n"; echo "e.g. ffff:ffff:ffff:ffff:ffff:ffff:ffff:ff00 = 120\n";
echo " ffff:ffff:ffff:ffff:ffff:ffff:ffff:0 = 112\n"; echo " ffff:ffff:ffff:ffff:ffff:ffff:ffff:0 = 112\n";
...@@ -315,7 +315,7 @@ function console_configure_ip_address($version) ...@@ -315,7 +315,7 @@ function console_configure_ip_address($version)
do { do {
$upperifname = strtoupper($interface); $upperifname = strtoupper($interface);
echo "\n" . sprintf( echo "\n" . sprintf(
gettext("Enter the new %s %s subnet bit count (1 to %s):"), 'Enter the new %s %s subnet bit count (1 to %s):',
$upperifname, $upperifname,
$label_IPvX, $label_IPvX,
$maxbits $maxbits
...@@ -326,11 +326,11 @@ function console_configure_ip_address($version) ...@@ -326,11 +326,11 @@ function console_configure_ip_address($version)
if ($version === 4 && $intbits < $maxbits) { if ($version === 4 && $intbits < $maxbits) {
if ($intip == gen_subnet($intip, $intbits)) { if ($intip == gen_subnet($intip, $intbits)) {
echo gettext("You cannot set network address to an interface"); echo 'You cannot set network address to an interface';
continue 2; continue 2;
$intbits_ok = false; $intbits_ok = false;
} elseif ($intip == gen_subnet_max($intip, $intbits)) { } elseif ($intip == gen_subnet_max($intip, $intbits)) {
echo gettext("You cannot set broadcast address to an interface"); echo 'You cannot set broadcast address to an interface';
continue 2; continue 2;
$intbits_ok = false; $intbits_ok = false;
} }
...@@ -343,16 +343,16 @@ function console_configure_ip_address($version) ...@@ -343,16 +343,16 @@ function console_configure_ip_address($version)
$subnet = gen_subnet($intip, $intbits); $subnet = gen_subnet($intip, $intbits);
} }
do { do {
echo "\n" . sprintf(gettext("For a WAN, enter the new %s %s upstream gateway address."), $upperifname, $label_IPvX) . "\n" . echo "\n" . sprintf('For a WAN, enter the new %s %s upstream gateway address.', $upperifname, $label_IPvX) . "\n" .
gettext("For a LAN, press <ENTER> for none:") . "\n> "; 'For a LAN, press <ENTER> for none:' . "\n> ";
$gwip = chop(fgets($fp)); $gwip = chop(fgets($fp));
$is_ipaddr = ($version === 6) ? is_ipaddrv6($gwip) : is_ipaddrv4($gwip); $is_ipaddr = ($version === 6) ? is_ipaddrv6($gwip) : is_ipaddrv4($gwip);
$is_in_subnet = $is_ipaddr && ip_in_subnet($gwip, $subnet . "/" . $intbits); $is_in_subnet = $is_ipaddr && ip_in_subnet($gwip, $subnet . "/" . $intbits);
if ($gwip != '') { if ($gwip != '') {
if (!$is_ipaddr) { if (!$is_ipaddr) {
echo sprintf(gettext("not an %s IP address!"), $label_IPvX) . "\n"; echo sprintf('not an %s IP address!', $label_IPvX) . "\n";
} elseif (!$is_in_subnet) { } elseif (!$is_in_subnet) {
echo gettext("not in subnet!") . "\n"; echo "not in subnet\n";
} }
} }
} while (!($gwip == '' || ($is_ipaddr && $is_in_subnet))); } while (!($gwip == '' || ($is_ipaddr && $is_in_subnet)));
...@@ -399,7 +399,7 @@ function console_configure_dhcpd($version = 4) ...@@ -399,7 +399,7 @@ function console_configure_dhcpd($version = 4)
$subnet_end = ($version === 6) ? gen_subnetv6_max($intip6, $intbits6) : gen_subnet_max($intip, $intbits); $subnet_end = ($version === 6) ? gen_subnetv6_max($intip6, $intbits6) : gen_subnet_max($intip, $intbits);
do { do {
do { do {
echo sprintf(gettext("Enter the start address of the %s client address range:"), $label_IPvX) . " "; echo sprintf('Enter the start address of the %s client address range:', $label_IPvX) . " ";
$dhcpstartip = chop(fgets($fp)); $dhcpstartip = chop(fgets($fp));
if ($dhcpstartip === "") { if ($dhcpstartip === "") {
fclose($fp); fclose($fp);
...@@ -408,12 +408,12 @@ function console_configure_dhcpd($version = 4) ...@@ -408,12 +408,12 @@ function console_configure_dhcpd($version = 4)
$is_ipaddr = ($version === 6) ? is_ipaddrv6($dhcpstartip) : is_ipaddrv4($dhcpstartip); $is_ipaddr = ($version === 6) ? is_ipaddrv6($dhcpstartip) : is_ipaddrv4($dhcpstartip);
$is_inrange = is_inrange($dhcpstartip, $subnet_start, $subnet_end); $is_inrange = is_inrange($dhcpstartip, $subnet_start, $subnet_end);
if (!$is_inrange) { if (!$is_inrange) {
echo gettext("This IP address must be in the interface's subnet") . "\n"; echo "This IP address must be in the interface's subnet\n";
} }
} while (!$is_ipaddr || !$is_inrange); } while (!$is_ipaddr || !$is_inrange);
do { do {
echo sprintf(gettext("Enter the end address of the %s client address range:"), $label_IPvX) . " "; echo sprintf('Enter the end address of the %s client address range:', $label_IPvX) . " ";
$dhcpendip = chop(fgets($fp)); $dhcpendip = chop(fgets($fp));
if ($dhcpendip === "") { if ($dhcpendip === "") {
fclose($fp); fclose($fp);
...@@ -422,11 +422,11 @@ function console_configure_dhcpd($version = 4) ...@@ -422,11 +422,11 @@ function console_configure_dhcpd($version = 4)
$is_ipaddr = ($version === 6) ? is_ipaddrv6($dhcpendip) : is_ipaddrv4($dhcpendip); $is_ipaddr = ($version === 6) ? is_ipaddrv6($dhcpendip) : is_ipaddrv4($dhcpendip);
$is_inrange = is_inrange($dhcpendip, $subnet_start, $subnet_end); $is_inrange = is_inrange($dhcpendip, $subnet_start, $subnet_end);
if (!$is_inrange) { if (!$is_inrange) {
echo gettext("This IP address must be in the interface's subnet") . "\n"; echo "This IP address must be in the interface's subnet\n";
} }
$not_inorder = ($version === 6) ? (inet_pton($dhcpendip) < inet_pton($dhcpstartip)) : ip_less_than($dhcpendip, $dhcpstartip); $not_inorder = ($version === 6) ? (inet_pton($dhcpendip) < inet_pton($dhcpstartip)) : ip_less_than($dhcpendip, $dhcpstartip);
if ($not_inorder) { if ($not_inorder) {
echo gettext("The end address of the DHCP range must be >= the start address") . "\n"; echo "The end address of the DHCP range must be >= the start address\n";
} }
} while (!$is_ipaddr || !$is_inrange); } while (!$is_ipaddr || !$is_inrange);
} while ($not_inorder); } while ($not_inorder);
...@@ -437,7 +437,7 @@ function console_configure_dhcpd($version = 4) ...@@ -437,7 +437,7 @@ function console_configure_dhcpd($version = 4)
} else { } else {
if (isset($config[$dhcpd][$interface]['enable'])) { if (isset($config[$dhcpd][$interface]['enable'])) {
unset($config[$dhcpd][$interface]['enable']); unset($config[$dhcpd][$interface]['enable']);
printf(gettext("Disabling %s DHCPD..."), $label_IPvX); printf('Disabling %s DHCPD...', $label_IPvX);
$restart_dhcpd = true; $restart_dhcpd = true;
} }
} }
...@@ -449,14 +449,14 @@ console_configure_dhcpd(6); ...@@ -449,14 +449,14 @@ console_configure_dhcpd(6);
//***************************************************************************** //*****************************************************************************
if ($config['system']['webgui']['protocol'] == "https") { if ($config['system']['webgui']['protocol'] == "https") {
if (console_prompt_for_yn(gettext("Do you want to revert to HTTP as the web GUI protocol?"))) { if (console_prompt_for_yn('Do you want to revert to HTTP as the web GUI protocol?')) {
$config['system']['webgui']['protocol'] = "http"; $config['system']['webgui']['protocol'] = "http";
$restart_webgui = true; $restart_webgui = true;
} }
} }
if (isset($config['system']['webgui']['noantilockout'])) { if (isset($config['system']['webgui']['noantilockout'])) {
echo "\n" . sprintf(gettext("Note: the anti-lockout rule on %s has been re-enabled."), $interface) . "\n"; echo "\n" . sprintf('Note: the anti-lockout rule on %s has been re-enabled.', $interface) . "\n";
unset($config['system']['webgui']['noantilockout']); unset($config['system']['webgui']['noantilockout']);
} }
...@@ -507,13 +507,13 @@ if (!$dry_run) { ...@@ -507,13 +507,13 @@ if (!$dry_run) {
if ($intip != '') { if ($intip != '') {
if (is_ipaddr($intip)) { if (is_ipaddr($intip)) {
echo "\n\n" . sprintf( echo "\n\n" . sprintf(
gettext("The IPv4 %s address has been set to %s"), 'The IPv4 %s address has been set to %s',
$upperifname, $upperifname,
"{$intip}/{$intbits}" "{$intip}/{$intbits}"
) . "\n"; ) . "\n";
} else { } else {
echo "\n\n" . sprintf( echo "\n\n" . sprintf(
gettext("The IPv4 %s address has been set to %s"), 'The IPv4 %s address has been set to %s',
$upperifname, $upperifname,
$intip $intip
) . "\n"; ) . "\n";
...@@ -522,13 +522,13 @@ if ($intip != '') { ...@@ -522,13 +522,13 @@ if ($intip != '') {
if ($intip6 != '') { if ($intip6 != '') {
if (is_ipaddr($intip6)) { if (is_ipaddr($intip6)) {
echo "\n\n" . sprintf( echo "\n\n" . sprintf(
gettext("The IPv6 %s address has been set to %s"), 'The IPv6 %s address has been set to %s',
$upperifname, $upperifname,
"${intip6}/${intbits6}" "${intip6}/${intbits6}"
) . "\n"; ) . "\n";
} else { } else {
echo "\n\n" . sprintf( echo "\n\n" . sprintf(
gettext("The IPv6 %s address has been set to %s"), 'The IPv6 %s address has been set to %s',
$upperifname, $upperifname,
$intip6 $intip6
) . "\n"; ) . "\n";
...@@ -537,7 +537,7 @@ if ($intip6 != '') { ...@@ -537,7 +537,7 @@ if ($intip6 != '') {
if ($intip != '' || $intip6 != '') { if ($intip != '' || $intip6 != '') {
if (count($ifdescrs) == "1" or $interface == "lan") { if (count($ifdescrs) == "1" or $interface == "lan") {
echo gettext('You can now access the web GUI by opening the following URL in your web browser:') . "\n"; echo "You can now access the web GUI by opening the following URL in your web browser:\n";
if (!empty($config['system']['webgui']['port'])) { if (!empty($config['system']['webgui']['port'])) {
$webuiport = $config['system']['webgui']['port']; $webuiport = $config['system']['webgui']['port'];
if ($intip != '') { if ($intip != '') {
...@@ -565,7 +565,7 @@ if ($intip != '' || $intip6 != '') { ...@@ -565,7 +565,7 @@ if ($intip != '' || $intip6 != '') {
} }
} }
echo "\n" . gettext('Press <ENTER> to continue.'); echo "\nPress <ENTER> to continue.";
fgets($fp); fgets($fp);
fclose($fp); fclose($fp);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment