diff options
20 files changed, 719 insertions, 719 deletions
diff --git a/usr/local/www/firewall_aliases.php b/usr/local/www/firewall_aliases.php index bc210a1..c06f6fa 100755 --- a/usr/local/www/firewall_aliases.php +++ b/usr/local/www/firewall_aliases.php @@ -147,7 +147,7 @@ if ($_GET['act'] == "del") { } } if($is_alias_referenced == true) { - $savemsg = "Cannot delete rule. Currently in use by {$referenced_by}"; + $savemsg = sprintf(gettext("Cannot delete rule. Currently in use by %s"), $referenced_by); } else { unset($a_aliases[$_GET['id']]); write_config(); @@ -159,7 +159,7 @@ if ($_GET['act'] == "del") { } } -$pgtitle = array("Firewall","Aliases"); +$pgtitle = array(gettext("Firewall"),gettext("Aliases")); include("head.inc"); ?> @@ -169,19 +169,19 @@ include("head.inc"); <form action="firewall_aliases.php" method="post"> <?php if ($savemsg) print_info_box($savemsg); ?> <?php if (is_subsystem_dirty('aliases')): ?><p> -<?php print_info_box_np("The alias list has been changed.<br>You must apply the changes in order for them to take effect.");?> +<?php print_info_box_np(gettext("The alias list has been changed.") . "<br>" . gettext("You must apply the changes in order for them to take effect."));?> <?php endif; ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> - <td width="25%" class="listhdrr">Name</td> - <td width="25%" class="listhdrr">Values</td> - <td width="25%" class="listhdr">Description</td> + <td width="25%" class="listhdrr"><?=gettext("Name"); ?></td> + <td width="25%" class="listhdrr"><?=gettext("Values"); ?></td> + <td width="25%" class="listhdr"><?=gettext("Description"); ?></td> <td width="10%" class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> <td valign="middle" width="17"> </td> - <td valign="middle"><a href="firewall_aliases_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="add a new alias"></a></td> + <td valign="middle"><a href="firewall_aliases_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?=gettext("add a new alias"); ?>"></a></td> </tr> </table> </td> @@ -213,8 +213,8 @@ include("head.inc"); <td valign="middle" nowrap class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> - <td valign="middle"><a href="firewall_aliases_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="edit alias"></a></td> - <td><a href="firewall_aliases.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this alias? All elements that still use it will become invalid (e.g. filter rules)!')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="delete alias"></a></td> + <td valign="middle"><a href="firewall_aliases_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="<?=gettext("edit alias"); ?>"></a></td> + <td><a href="firewall_aliases.php?act=del&id=<?=$i;?>" onclick="return confirm(<?=gettext('Do you really want to delete this alias? All elements that still use it will become invalid (e.g. filter rules)!');?>)"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="<?=gettext("delete alias"); ?>"></a></td> </tr> </table> </td> @@ -227,10 +227,10 @@ include("head.inc"); <tr> <td valign="middle" width="17"> </td> <td valign="middle"> - <a href="firewall_aliases_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="add a new alias"></a></td> + <a href="firewall_aliases_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?=gettext("add a new alias"); ?>"></a></td> </td> <td valign="middle"> - <a href="firewall_aliases_import.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_import_alias.gif" width="17" height="17" border="0" title="<?=gettext("Bulk import aliases from list");?>" alt="" /></a> + <a href="firewall_aliases_import.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_import_alias.gif" width="17" height="17" border="0" title="<?=gettext("Bulk import aliases from list"); ?>" alt="" /></a> </td> </tr> </table> @@ -238,7 +238,7 @@ include("head.inc"); </tr> <tr> <td class="tabcont" colspan="3"> - <p><span class="vexpl"><span class="red"><strong>Note:<br></strong></span>Aliases act as placeholders for real hosts, networks or ports. They can be used to minimize the number of changes that have to be made if a host, network or port changes. You can enter the name of an alias instead of the host, network or port in all fields that have a red background. The alias will be resolved according to the list above. If an alias cannot be resolved (e.g. because you deleted it), the corresponding element (e.g. filter/NAT/shaper rule) will be considered invalid and skipped.</span></p> + <p><span class="vexpl"><span class="red"><strong><?=gettext("Note"); ?>:<br></strong></span><?=gettext("Aliases act as placeholders for real hosts, networks or ports. They can be used to minimize the number of changes that have to be made if a host, network or port changes. You can enter the name of an alias instead of the host, network or port in all fields that have a red background. The alias will be resolved according to the list above. If an alias cannot be resolved (e.g. because you deleted it), the corresponding element (e.g. filter/NAT/shaper rule) will be considered invalid and skipped."); ?></span></p> </td> </tr> </table> diff --git a/usr/local/www/firewall_aliases_edit.php b/usr/local/www/firewall_aliases_edit.php index 5835bd2..ebae16a 100755 --- a/usr/local/www/firewall_aliases_edit.php +++ b/usr/local/www/firewall_aliases_edit.php @@ -44,7 +44,7 @@ ##|*MATCH=firewall_aliases_edit.php* ##|-PRIV -$pgtitle = array("Firewall","Aliases","Edit"); +$pgtitle = array(gettext("Firewall"),gettext("Aliases"),gettext("Edit")); // Keywords not allowed in names $reserved_keywords = array("pass", "out", "queue", "max", "min", "pptp", "pppoe", "l2tp", "openvpn"); @@ -101,7 +101,7 @@ if (isset($id) && $a_aliases[$id]) { $iflist = get_configured_interface_with_descr(true, true); foreach ($iflist as $if => $ifdesc) if($ifdesc == $pconfig['descr']) - $input_errors[] = "Sorry, an interface is already named {$pconfig['descr']}."; + $input_errors[] = sprintf(gettext("Sorry, an interface is already named %s."), $pconfig['descr']); if($a_aliases[$id]['type'] == "urltable") { $pconfig['address'] = $a_aliases[$id]['url']; @@ -130,24 +130,24 @@ if ($_POST) { /* input validation */ $reqdfields = explode(" ", "name"); - $reqdfieldsn = explode(",", "Name"); + $reqdfieldsn = array(gettext("Name")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); $x = is_validaliasname($_POST['name']); if (!isset($x)) { - $input_errors[] = "Reserved word used for alias name."; + $input_errors[] = gettext("Reserved word used for alias name."); } else if ($_POST['type'] == "port" && (getservbyname($_POST['name'], "tcp") || getservbyname($_POST['name'], "udp"))) { - $input_errors[] = "Reserved word used for alias name."; + $input_errors[] = gettext("Reserved word used for alias name."); } else { if (is_validaliasname($_POST['name']) == false) - $input_errors[] = "The alias name may only consist of the characters a-z, A-Z, 0-9, _."; + $input_errors[] = gettext("The alias name may only consist of the characters") . " a-z, A-Z, 0-9, _."; } /* check for name conflicts */ if (empty($a_aliases[$id])) { foreach ($a_aliases as $alias) { if ($alias['name'] == $_POST['name']) { - $input_errors[] = "An alias with this name already exists."; + $input_errors[] = gettext("An alias with this name already exists."); break; } } @@ -156,12 +156,12 @@ if ($_POST) { /* Check for reserved keyword names */ foreach($reserved_keywords as $rk) if($rk == $_POST['name']) - $input_errors[] = "Cannot use a reserved keyword as alias name $rk"; + $input_errors[] = sprintf(gettext("Cannot use a reserved keyword as alias name %s"), $rk); /* check for name interface description conflicts */ foreach($config['interfaces'] as $interface) { if($interface['descr'] == $_POST['name']) { - $input_errors[] = "An interface description with this name already exists."; + $input_errors[] = gettext("An interface description with this name already exists."); break; } } @@ -183,10 +183,10 @@ if ($_POST) { $alias['url'] = $_POST['address0']; $alias['updatefreq'] = $_POST['address_subnet0'] ? $_POST['address_subnet0'] : 7; if (!is_URL($alias['url']) || empty($alias['url'])) { - $input_errors[] = "You must provide a valid URL."; + $input_errors[] = gettext("You must provide a valid URL."); $dont_update = true; } elseif (! process_alias_urltable($alias['name'], $alias['url'], 0, true)) { - $input_errors[] = "Unable to fetch usable data."; + $input_errors[] = gettext("Unable to fetch usable data."); $dont_update = true; } } @@ -231,14 +231,14 @@ if ($_POST) { } if($isfirst == 0) { /* nothing was found */ - $input_errors[] = "You must provide a valid URL. Could not fetch usable data."; + $input_errors[] = gettext("You must provide a valid URL. Could not fetch usable data."); $dont_update = true; break; } $alias['aliasurl'][] = $_POST['address' . $x]; mwexec("/bin/rm -rf {$temp_filename}"); } else { - $input_errors[] = "You must provide a valid URL."; + $input_errors[] = gettext("You must provide a valid URL."); $dont_update = true; break; } @@ -254,12 +254,12 @@ if ($_POST) { $wrongaliases .= " " . $_POST["address{$x}"]; } else if ($_POST['type'] == "port") { if (!is_port($_POST["address{$x}"])) - $input_errors[] = $_POST["address{$x}"] . " is not a valid port or alias."; + $input_errors[] = $_POST["address{$x}"] . " " . gettext("is not a valid port or alias."); } else if ($_POST['type'] == "host" || $_POST['type'] == "network") { if (!is_ipaddr($_POST["address{$x}"]) && !is_hostname($_POST["address{$x}"]) && !is_iprange($_POST["address{$x}"])) - $input_errors[] = $_POST["address{$x}"] . " is not a valid {$_POST['type']} alias."; + $input_errors[] = sprintf(gettext("%s is not a valid %s alias."), $_POST["address{$x}"], $_POST['type']); } if (is_iprange($_POST["address{$x}"])) { list($startip, $endip) = explode('-', $_POST["address{$x}"]); @@ -274,11 +274,11 @@ if ($_POST) { if ($_POST["detail{$x}"] <> "") $final_address_details[] = $_POST["detail{$x}"]; else - $final_address_details[] = "Entry added " . date('r'); + $final_address_details[] = sprintf(gettext("Entry added %s"), date('r')); } } if ($wrongaliases <> "") - $input_errors[] = "The alias(es): {$wrongaliases} \ncannot be nested cause they are not of the same type."; + $input_errors[] = sprintf(gettext("The alias(es): %s \ncannot be nested cause they are not of the same type."), $wrongaliases); } if (!$input_errors) { @@ -444,13 +444,13 @@ $update_freq_str = gettext("Update Freq."); $networks_help = gettext("Networks are specified in CIDR format. Select the CIDR mask that pertains to each entry. /32 specifies a single host, /24 specifies 255.255.255.0, etc. Hostnames (FQDNs) may also be specified, using a /32 mask. You may also enter an IP range such as 192.168.1.1-192.168.1.254 and a list of CIDR networks will be derived to fill the range."); $hosts_help = gettext("Enter as many hosts as you would like. Hosts must be specified by their IP address."); $ports_help = gettext("Enter as many ports as you wish. Port ranges can be expressed by seperating with a colon."); -$url_help = gettext("Enter as many URLs as you wish. After saving {$g['product_name']} will download the URL and import the items into the alias. Use only with small sets of IP addresses (less than 3000)."); -$urltable_help = gettext("Enter a single URL containing a large number of IPs and/or Subnets. After saving {$g['product_name']} will download the URL and create a table file containing these addresses. This will work with large numbers of addresses (30,000+) or small numbers."); +$url_help = sprintf(gettext("Enter as many URLs as you wish. After saving %s will download the URL and import the items into the alias. Use only with small sets of IP addresses (less than 3000)."), $g['product_name']); +$urltable_help = sprintf(gettext("Enter a single URL containing a large number of IPs and/or Subnets. After saving %s will download the URL and create a table file containing these addresses. This will work with large numbers of addresses (30,000+) or small numbers."), $g['product_name']); $openvpn_str = gettext("Username"); $openvpn_user_str = gettext("OpenVPN Users"); $openvpn_help = gettext("Enter as many usernames as you wish."); -$openvpn_freq = gettext(""); +$openvpn_freq = ""; $jscriptstr .= <<<EOD @@ -549,10 +549,10 @@ EOD; <form action="firewall_aliases_edit.php" method="post" name="iform" id="iform"> <table width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> - <td colspan="2" valign="top" class="listtopic">Alias Edit</td> + <td colspan="2" valign="top" class="listtopic"><?=gettext("Alias Edit"); ?></td> </tr> <tr> - <td valign="top" class="vncellreq">Name</td> + <td valign="top" class="vncellreq"><?=gettext("Name"); ?></td> <td class="vtable"> <input name="origname" type="hidden" id="origname" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['name']);?>" /> <input name="name" type="text" id="name" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['name']);?>" /> @@ -561,47 +561,47 @@ EOD; <?php endif; ?> <br /> <span class="vexpl"> - The name of the alias may only consist of the characters a-z, A-Z and 0-9. + <?=gettext("The name of the alias may only consist of the characters \"a-z, A-Z and 0-9\"."); ?> </span> </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">Description</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td> <td width="78%" class="vtable"> <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=$pconfig['descr'];?>" /> <br /> <span class="vexpl"> - You may enter a description here for your reference (not parsed). + <?=gettext("You may enter a description here for your reference (not parsed)."); ?> </span> </td> </tr> <tr> - <td valign="top" class="vncellreq">Type</td> + <td valign="top" class="vncellreq"><?=gettext("Type"); ?></td> <td class="vtable"> <select name="type" class="formselect" id="type" onchange="update_box_type(); typesel_change();"> - <option value="host" <?php if ($pconfig['type'] == "host") echo "selected"; ?>>Host(s)</option> - <option value="network" <?php if ($pconfig['type'] == "network") echo "selected"; ?>>Network(s)</option> - <option value="port" <?php if ($pconfig['type'] == "port") echo "selected"; ?>>Port(s)</option> - <option value="openvpn" <?php if ($pconfig['type'] == "openvpn") echo "selected"; ?>>OpenVPN Users</option> - <option value="url" <?php if ($pconfig['type'] == "url") echo "selected"; ?>>URL</option> - <option value="urltable" <?php if ($pconfig['type'] == "urltable") echo "selected"; ?>>URL Table</option> + <option value="host" <?php if ($pconfig['type'] == "host") echo "selected"; ?>><?=gettext("Host(s)"); ?></option> + <option value="network" <?php if ($pconfig['type'] == "network") echo "selected"; ?>><?=gettext("Network(s)"); ?></option> + <option value="port" <?php if ($pconfig['type'] == "port") echo "selected"; ?>><?=gettext("Port(s)"); ?></option> + <option value="openvpn" <?php if ($pconfig['type'] == "openvpn") echo "selected"; ?>><?=gettext("OpenVPN Users"); ?></option> + <option value="url" <?php if ($pconfig['type'] == "url") echo "selected"; ?>><?=gettext("URL");?></option> + <option value="urltable" <?php if ($pconfig['type'] == "urltable") echo "selected"; ?>><?=gettext("URL Table"); ?></option> </select> </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq"><div id="addressnetworkport">Host(s)</div></td> + <td width="22%" valign="top" class="vncellreq"><div id="addressnetworkport"><?=gettext("Host(s)"); ?></div></td> <td width="78%" class="vtable"> <table id="maintable"> <tbody> <tr> <td colspan="4"> - <div style="padding:5px; margin-top: 16px; margin-bottom: 16px; border:1px dashed #000066; background-color: #ffffff; color: #000000; font-size: 8pt;" id="itemhelp">Item information</div> + <div style="padding:5px; margin-top: 16px; margin-bottom: 16px; border:1px dashed #000066; background-color: #ffffff; color: #000000; font-size: 8pt;" id="itemhelp"><?=gettext("Item information"); ?></div> </td> </tr> <tr> - <td><div id="onecolumn">Network</div></td> + <td><div id="onecolumn"><?=gettext("Network"); ?></div></td> <td><div id="twocolumn">CIDR</div></td> - <td><div id="threecolumn">Description</div></td> + <td><div id="threecolumn"><?=gettext("Description"); ?></div></td> </tr> <?php @@ -640,7 +640,7 @@ EOD; <input name="detail<?php echo $tracker; ?>" type="text" class="formfld unknown" id="detail<?php echo $tracker; ?>" size="50" value="<?=$item4;?>" /> </td> <td> - <input type="image" src="/themes/<?echo $g['theme'];?>/images/icons/icon_x.gif" onclick="removeRow(this); return false;" value="Delete" /> + <input type="image" src="/themes/<?echo $g['theme'];?>/images/icons/icon_x.gif" onclick="removeRow(this); return false;" value="<?=gettext("Delete"); ?>" /> </td> </tr> <?php @@ -662,8 +662,8 @@ EOD; <tr> <td width="22%" valign="top"> </td> <td width="78%"> - <input id="submit" name="submit" type="submit" class="formbtn" value="Save" /> - <a href="firewall_aliases.php"><input id="cancelbutton" name="cancelbutton" type="button" class="formbtn" value="Cancel" /></a> + <input id="submit" name="submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" /> + <a href="firewall_aliases.php"><input id="cancelbutton" name="cancelbutton" type="button" class="formbtn" value="<?=gettext("Cancel"); ?>" /></a> </td> </tr> </table> diff --git a/usr/local/www/firewall_aliases_import.php b/usr/local/www/firewall_aliases_import.php index 760688d..76246a6 100755 --- a/usr/local/www/firewall_aliases_import.php +++ b/usr/local/www/firewall_aliases_import.php @@ -37,7 +37,7 @@ ##|*MATCH=firewall_aliases_import.php* ##|-PRIV -$pgtitle = array("Firewall","Aliases","Bulk import"); +$pgtitle = array(gettext("Firewall"),gettext("Aliases"),gettext("Bulk import")); $reserved_keywords = array("pass", "out", "queue", "max", "min", "pptp"); @@ -55,27 +55,27 @@ $a_aliases = &$config['aliases']['alias']; if($_POST['aliasimport'] <> "") { $reqdfields = explode(" ", "name aliasimport"); - $reqdfieldsn = explode(",", "Name,Aliases"); + $reqdfieldsn = array(gettext("Name"),gettext("Aliases")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); if (is_validaliasname($_POST['name']) == false) - $input_errors[] = "The alias name may only consist of the characters a-z, A-Z, 0-9, _."; + $input_errors[] = gettext("The alias name may only consist of the characters") . " a-z, A-Z, 0-9, _."; /* check for name duplicates */ if (is_alias($_POST['name'])) - $input_errors[] = "An alias with this name already exists."; + $input_errors[] = gettext("An alias with this name already exists."); /* Check for reserved keyword names */ foreach($reserved_keywords as $rk) if ($rk == $_POST['name']) - $input_errors[] = "Cannot use a reserved keyword as alias name $rk"; + $input_errors[] = sprintf(gettext("Cannot use a reserved keyword as alias name %s"), $rk); /* check for name interface description conflicts */ foreach($config['interfaces'] as $interface) { if($interface['descr'] == $_POST['name']) { - $input_errors[] = "An interface description with this name already exists."; + $input_errors[] = gettext("An interface description with this name already exists."); break; } } @@ -90,7 +90,7 @@ if($_POST['aliasimport'] <> "") { $rangesubnets = ip_range_to_subnet_array($startip, $endip); $address .= implode(" ", $rangesubnets); } else if (!is_ipaddr($impip) && !is_subnet($impip) && !empty($impip)) { - $input_errors[] = "$impip is not an IP address. Please correct the error to continue"; + $input_errors[] = sprintf(gettext("%s is not an IP address. Please correct the error to continue"), $impip); } elseif (!empty($impip)) { $imported[] = $impip; } @@ -127,31 +127,31 @@ include("head.inc"); <div id="inputerrors"></div> <table width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> - <td colspan="2" valign="top" class="listtopic">Alias Import</td> + <td colspan="2" valign="top" class="listtopic"><?=gettext("Alias Import"); ?></td> </tr> <tr> - <td valign="top" class="vncellreq">Alias Name</td> + <td valign="top" class="vncellreq"><?=gettext("Alias Name"); ?></td> <td class="vtable"> <input name="name" type="text" class="formfld unknown" id="name" size="40" value="<?=htmlspecialchars($_POST['name']);?>" /> <br /> <span class="vexpl"> - The name of the alias may only consist of the characters a-z, A-Z and 0-9.</span></td> + <?=gettext("The name of the alias may only consist of the characters \"a-z, A-Z and 0-9\"."); ?></span></td> </tr> <tr> - <td width="22%" valign="top" class="vncell">Description</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td> <td width="78%" class="vtable"> <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($_POST['descr']);?>" /> - <br /> <span class="vexpl">You may enter a description here - for your reference (not parsed).</span></td> + <br /> <span class="vexpl"><?=gettext("You may enter a description here " . + "for your reference (not parsed)"); ?>.</span></td> </tr> <tr> - <td valign="top" class="vncellreq">Aliases to import</td> + <td valign="top" class="vncellreq"><?=gettext("Aliases to import"); ?></td> <td class="vtable"><textarea name="aliasimport" ROWS="15" COLS="40"><?php echo $_POST['aliasimport']; ?></textarea> - <br /> <span class="vexpl">Paste in the aliases to import separated by a carriage return. Common examples are lists of IPs, networks, blacklists, etc. - <br /> The list may contain only IP addresses. </span></td> + <br /> <span class="vexpl"><?=gettext("Paste in the aliases to import separated by a carriage return. Common examples are lists of IPs, networks, blacklists, etc."); ?> + <br /> <?=gettext("The list may contain only IP addresses."); ?> </span></td> </tr> <tr> <td width="22%" valign="top"> </td> <td width="78%"> - <input id="submit" name="Submit" type="submit" class="formbtn" value="Save" /> - <input class="formbtn" type="button" value="Cancel" onclick="history.back()" /> + <input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" /> + <input class="formbtn" type="button" value="<?=gettext("Cancel"); ?>" onclick="history.back()" /> </tr> </table> diff --git a/usr/local/www/firewall_nat.php b/usr/local/www/firewall_nat.php index 84fc0e8..4cab5d6 100755 --- a/usr/local/www/firewall_nat.php +++ b/usr/local/www/firewall_nat.php @@ -158,7 +158,7 @@ if (isset($_POST['del_x'])) { } } -$pgtitle = array("Firewall","NAT","Port Forward"); +$pgtitle = array(gettext("Firewall"),gettext("NAT"),gettext("Port Forward")); include("head.inc"); echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript/domTT/domLib.js\"></script>"; @@ -174,18 +174,18 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript <?php if (is_subsystem_dirty('natconf')): ?><p> <?php if($savemsg) - print_info_box_np("{$savemsg}<br>The NAT configuration has been changed.<br>You must apply the changes in order for them to take effect."); - else - print_info_box_np("The NAT configuration has been changed.<br>You must apply the changes in order for them to take effect."); + print_info_box_np("{$savemsg}<br>" . gettext("The NAT configuration has been changed") . ".<br>" . gettext("You must apply the changes in order for them to take effect.") ); + else + print_info_box_np( gettext("The NAT configuration has been changed") . ".<br>" . gettext("You must apply the changes in order for them to take effect.") ); ?> <?php endif; ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td> <?php $tab_array = array(); - $tab_array[] = array("Port Forward", true, "firewall_nat.php"); - $tab_array[] = array("1:1", false, "firewall_nat_1to1.php"); - $tab_array[] = array("Outbound", false, "firewall_nat_out.php"); + $tab_array[] = array(gettext("Port Forward"), true, "firewall_nat.php"); + $tab_array[] = array(gettext("1:1"), false, "firewall_nat_1to1.php"); + $tab_array[] = array(gettext("Outbound"), false, "firewall_nat_out.php"); display_top_tabs($tab_array); ?> </td></tr> @@ -196,23 +196,23 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript <tr id="frheader"> <td width="3%" class="list"> </td> <td width="3%" class="list"> </td> - <td width="5%" class="listhdrr">If</td> - <td width="5%" class="listhdrr">Proto</td> - <td width="11%" class="listhdrr">Src. addr</td> - <td width="11%" class="listhdrr">Src. ports</td> - <td width="11%" class="listhdrr">Dest. addr</td> - <td width="11%" class="listhdrr">Dest. ports</td> - <td width="11%" class="listhdrr">NAT IP</td> - <td width="11%" class="listhdrr">NAT Ports</td> - <td width="11%" class="listhdr">Description</td> + <td width="5%" class="listhdrr"><?=gettext("If");?></td> + <td width="5%" class="listhdrr"><?=gettext("Proto");?></td> + <td width="11%" class="listhdrr"><?=gettext("Src. addr");?></td> + <td width="11%" class="listhdrr"><?=gettext("Src. ports");?></td> + <td width="11%" class="listhdrr"><?=gettext("Dest. addr");?></td> + <td width="11%" class="listhdrr"><?=gettext("Dest. ports");?></td> + <td width="11%" class="listhdrr"><?=gettext("NAT IP");?></td> + <td width="11%" class="listhdrr"><?=gettext("NAT Ports");?></td> + <td width="11%" class="listhdr"><?=gettext("Description");?></td> <td width="5%" class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> <td width="17"> <?php if (count($a_nat) == 0): ?> - <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="delete selected rules" border="0"> + <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="<?=gettext("delete selected rules");?>" border="0"> <?php else: ?> - <input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="delete selected rules" onclick="return confirm('Do you really want to delete the selected rules?')"> + <input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="<?=gettext("delete selected rules"); ?>" onclick="return confirm('Do you really want to delete the selected rules?')"> <?php endif; ?> </td> <td><a href="firewall_nat_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td> @@ -253,9 +253,9 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript <td class="listt"><input type="checkbox" id="frc<?=$nnats;?>" name="rule[]" value="<?=$i;?>" onClick="fr_bgcolor('<?=$nnats;?>')" style="margin: 0; padding: 0; width: 15px; height: 15px;"></td> <td class="listt" align="center"> <?php if($natent['associated-rule-id'] == "pass"): ?> - <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_pass.gif" title="All traffic matching this NAT entry is passed" border="0"> + <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_pass.gif" title="<?=gettext("All traffic matching this NAT entry is passed"); ?>" border="0"> <?php elseif (!empty($natent['associated-rule-id'])): ?> - <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_chain.png" width="17" height="17" title="Firewall rule ID <?=htmlspecialchars($nnatid); ?> is managed with this rule" border="0"> + <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_chain.png" width="17" height="17" title="<?=gettext("Firewall rule ID"); ?> <?=htmlspecialchars($nnatid); ?> <?=gettext("is managed with this rule"); ?>" border="0"> <?php endif; ?> </td> <td class="listlr" onClick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';"> @@ -312,12 +312,12 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript <td valign="middle" class="list" nowrap> <table border="0" cellspacing="0" cellpadding="1"> <tr> - <td><input onmouseover="fr_insline(<?=$nnats;?>, true)" onmouseout="fr_insline(<?=$nnats;?>, false)" name="move_<?=$i;?>" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" title="move selected rules before this rule" height="17" type="image" width="17" border="0"></td> - <td><a href="firewall_nat_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="edit rule"></a></td> + <td><input onmouseover="fr_insline(<?=$nnats;?>, true)" onmouseout="fr_insline(<?=$nnats;?>, false)" name="move_<?=$i;?>" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" title="<?=gettext("move selected rules before this rule");?>" height="17" type="image" width="17" border="0"></td> + <td><a href="firewall_nat_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="<?=gettext("edit rule"); ?>"></a></td> </tr> <tr> - <td align="center" valign="middle"><a href="firewall_nat.php?act=del&id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="delete rule" onclick="return confirm('Do you really want to delete this rule?')"></a></td> - <td><a href="firewall_nat_edit.php?dup=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="add a new nat based on this one" width="17" height="17" border="0"></a></td> + <td align="center" valign="middle"><a href="firewall_nat.php?act=del&id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="<?=gettext("delete rule");?> onclick="return confirm(<?=gettext('Do you really want to delete this rule?');?>)"></a></td> + <td><a href="firewall_nat_edit.php?dup=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add a new nat based on this one");?>" width="17" height="17" border="0"></a></td> </tr> </table> </tr> @@ -330,14 +330,14 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript <td class="list" valign="middle" nowrap> <table border="0" cellspacing="0" cellpadding="1"> <tr> - <td><?php if ($nnats == 0): ?><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="move selected rules to end" border="0"><?php else: ?><input name="move_<?=$i;?>" type="image" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" width="17" height="17" title="move selected rules to end" border="0"><?php endif; ?></td> + <td><?php if ($nnats == 0): ?><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="<?=gettext("move selected rules to end"); ?>" border="0"><?php else: ?><input name="move_<?=$i;?>" type="image" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" width="17" height="17" title="<?=gettext("move selected rules to end");?>" border="0"><?php endif; ?></td> </tr> <tr> <td width="17"> <?php if (count($a_nat) == 0): ?> - <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="delete selected rules" border="0"> + <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="<?=gettext("delete selected rules");?>" border="0"> <?php else: ?> - <input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="delete selected rules" onclick="return confirm('Do you really want to delete the selected rules?')"> + <input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="<?=gettext("delete selected rules"); ?>" onclick="return confirm(<?=gettext('Do you really want to delete the selected rules?');?>)"> <?php endif; ?> </td> <td><a href="firewall_nat_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td> @@ -348,11 +348,11 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript <tr><td> </td></tr> <tr> <td width="16"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_pass.gif" width="11" height="11"></td> - <td colspan="3">pass</td> + <td colspan="3"><?=gettext("pass"); ?></td> </tr> <tr> <td width="14"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_chain.png" width="11" height="11"></td> - <td colspan="3">linked rule</td> + <td colspan="3"><?=gettext("linked rule");?></td> </tr> </table> </div> diff --git a/usr/local/www/firewall_nat_1to1.php b/usr/local/www/firewall_nat_1to1.php index 52a1268..b2252ae 100755 --- a/usr/local/www/firewall_nat_1to1.php +++ b/usr/local/www/firewall_nat_1to1.php @@ -84,14 +84,14 @@ include("head.inc"); <form action="firewall_nat_1to1.php" method="post"> <?php if ($savemsg) print_info_box($savemsg); ?> <?php if (is_subsystem_dirty('natconf')): ?><p> -<?php print_info_box_np("The NAT configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br> +<?php print_info_box_np(gettext("The NAT configuration has been changed") . ".<br>" . gettext("You must apply the changes in order for them to take effect."));?><br> <?php endif; ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td> <?php $tab_array = array(); - $tab_array[] = array("Port Forward", false, "firewall_nat.php"); - $tab_array[] = array("1:1", true, "firewall_nat_1to1.php"); - $tab_array[] = array("Outbound", false, "firewall_nat_out.php"); + $tab_array[] = array(gettext("Port Forward"), false, "firewall_nat.php"); + $tab_array[] = array(gettext("1:1"), true, "firewall_nat_1to1.php"); + $tab_array[] = array(gettext("Outbound"), false, "firewall_nat_out.php"); display_top_tabs($tab_array); ?> </td></tr> @@ -100,15 +100,15 @@ include("head.inc"); <div id="mainarea"> <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> - <td width="10%" class="listhdrr">Interface</td> - <td width="20%" class="listhdrr">External IP</td> - <td width="20%" class="listhdrr">Internal IP</td> - <td width="40%" class="listhdr">Description</td> + <td width="10%" class="listhdrr"><?=gettext("Interface"); ?></td> + <td width="20%" class="listhdrr"><?=gettext("External IP"); ?></td> + <td width="20%" class="listhdrr"><?=gettext("Internal IP"); ?></td> + <td width="40%" class="listhdr"><?=gettext("Description"); ?></td> <td width="10%" class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> <td width="17"></td> - <td valign="middle"><a href="firewall_nat_1to1_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="add rule"></a></td> + <td valign="middle"><a href="firewall_nat_1to1_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?=gettext("add rule"); ?>"></a></td> </tr> </table> </td> @@ -137,8 +137,8 @@ include("head.inc"); <td class="list" nowrap> <table border="0" cellspacing="0" cellpadding="1"> <tr> - <td valign="middle"><a href="firewall_nat_1to1_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="edit rule"></a></td> - <td valign="middle"><a href="firewall_nat_1to1.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this mapping?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="delete rule"></a></td> + <td valign="middle"><a href="firewall_nat_1to1_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="<?=gettext("edit rule"); ?>"></a></td> + <td valign="middle"><a href="firewall_nat_1to1.php?act=del&id=<?=$i;?>" onclick="return confirm(<?=gettext('Do you really want to delete this mapping?');?>)"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="<?=gettext("delete rule"); ?>"></a></td> </tr> </table> </td> @@ -150,17 +150,17 @@ include("head.inc"); <table border="0" cellspacing="0" cellpadding="1"> <tr> <td width="17"></td> - <td valign="middle"><a href="firewall_nat_1to1_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="add rule"></a></td> + <td valign="middle"><a href="firewall_nat_1to1_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?=gettext("add rule"); ?>"></a></td> </tr> </table> </td> </tr> <tr> <td colspan="4"> - <p><span class="vexpl"><span class="red"><strong>Note:<br> - </strong></span>Depending on the way your WAN connection is setup, you may also need a <a href="firewall_virtual_ip.php">Virtual IP</a>.<br/> - If you add a 1:1 NAT entry for any of the interface IPs on this system, it will make this system inaccessible on that IP address. i.e. if - you use your WAN IP address, any services on this system (IPsec, OpenVPN server, etc.) using the WAN IP address will no longer function.</span></p> + <p><span class="vexpl"><span class="red"><strong><?=gettext("Note"); ?>:<br> + </strong></span><?=gettext("Depending on the way your WAN connection is setup, you may also need a"); ?> <a href="firewall_virtual_ip.php"><?=gettext("Virtual IP"); ?></a>.<br/> + <?=gettext("If you add a 1:1 NAT entry for any of the interface IPs on this system, it will make this system inaccessible on that IP address. i.e. if " . + "you use your WAN IP address, any services on this system (IPsec, OpenVPN server, etc.) using the WAN IP address will no longer function."); ?></span></p> </td> <tr> </table> diff --git a/usr/local/www/firewall_nat_1to1_edit.php b/usr/local/www/firewall_nat_1to1_edit.php index 4966e14..5c024b7 100755 --- a/usr/local/www/firewall_nat_1to1_edit.php +++ b/usr/local/www/firewall_nat_1to1_edit.php @@ -90,15 +90,15 @@ if ($_POST) { /* input validation */ $reqdfields = explode(" ", "interface external internal"); - $reqdfieldsn = explode(",", "Interface,External subnet,Internal subnet"); + $reqdfieldsn = array(gettext("Interface"),gettext("External subnet"),gettext("Internal subnet")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); if (($_POST['external'] && !is_ipaddr($_POST['external']))) { - $input_errors[] = "A valid external subnet must be specified."; + $input_errors[] = gettext("A valid external subnet must be specified."); } if (($_POST['internal'] && !is_ipaddr($_POST['internal']))) { - $input_errors[] = "A valid internal subnet must be specified."; + $input_errors[] = gettext("A valid internal subnet must be specified."); } /* check for overlaps with other 1:1 */ @@ -144,7 +144,7 @@ if ($_POST) { } } -$pgtitle = array("Firewall","NAT","1:1","Edit"); +$pgtitle = array(gettext("Firewall"),gettext("NAT"),gettext("1:1"),gettext("Edit")); include("head.inc"); ?> @@ -155,7 +155,7 @@ include("head.inc"); <form action="firewall_nat_1to1_edit.php" method="post" name="iform" id="iform"> <table width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> - <td colspan="2" valign="top" class="listtopic">Edit NAT 1:1 entry</td> + <td colspan="2" valign="top" class="listtopic"><?=gettext("Edit NAT 1:1 entry"); ?></td> </tr> <tr> <td width="22%" valign="top" class="vncellreq">Interface</td> @@ -195,11 +195,11 @@ include("head.inc"); </option> <?php endforeach; ?> </select><br> - <span class="vexpl">Choose which interface this rule applies to.<br> - Hint: in most cases, you'll want to use WAN here.</span></td> + <span class="vexpl"><?=gettext("Choose which interface this rule applies to"); ?>.<br> + <?=gettext("Hint: in most cases, you'll want to use WAN here"); ?>.</span></td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">External subnet</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("External subnet"); ?></td> <td width="78%" class="vtable"> <input name="external" type="text" class="formfld unknown" id="external" size="20" value="<?=htmlspecialchars($pconfig['external']);?>"> <select name="subnet" class="formselect" id="subnet" > @@ -210,21 +210,21 @@ include("head.inc"); <?php endfor; ?> </select> <br> - <span class="vexpl">Enter the external (WAN) subnet for the 1:1 mapping. You may map single IP addresses by specifying a /32 subnet.</span></td> + <span class="vexpl"><?=gettext("Enter the external (WAN) subnet for the 1:1 mapping. You may map single IP addresses by specifying a /32 subnet."); ?></span></td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Internal subnet</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Internal subnet"); ?></td> <td width="78%" class="vtable"> <input name="internal" type="text" class="formfld unknown" id="internal" size="20" value="<?=htmlspecialchars($pconfig['internal']);?>"> <br> - <span class="vexpl">Enter the internal (LAN) subnet for the 1:1 mapping. The subnet size specified for the external subnet also applies to the internal subnet (they have to be the same).</span></td> + <span class="vexpl"><?=gettext("Enter the internal (LAN) subnet for the 1:1 mapping. The subnet size specified for the external subnet also applies to the internal subnet (they have to be the same)."); ?></span></td> </tr> <tr> - <td width="22%" valign="top" class="vncell">Description</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td> <td width="78%" class="vtable"> <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>"> - <br> <span class="vexpl">You may enter a description here - for your reference (not parsed).</span></td> + <br> <span class="vexpl"><?=gettext("You may enter a description here " . + "for your reference (not parsed)."); ?></span></td> </tr> <tr> <td width="22%" valign="top" class="vncell">NAT reflection</td> @@ -239,7 +239,7 @@ include("head.inc"); <tr> <td width="22%" valign="top"> </td> <td width="78%"> - <input name="Submit" type="submit" class="formbtn" value="Save"> <input type="button" class="formbtn" value="Cancel" onclick="history.back()"> + <input name="Submit" type="submit" class="formbtn" value="Save"> <input type="button" class="formbtn" value="<?=gettext("Cancel"); ?>" onclick="history.back()"> <?php if (isset($id) && $a_1to1[$id]): ?> <input name="id" type="hidden" value="<?=$id;?>"> <?php endif; ?> diff --git a/usr/local/www/firewall_nat_edit.php b/usr/local/www/firewall_nat_edit.php index 3f06928..4962466 100755 --- a/usr/local/www/firewall_nat_edit.php +++ b/usr/local/www/firewall_nat_edit.php @@ -105,7 +105,7 @@ foreach ($_POST as $key => $value) { $temp = $value; $newpost = htmlentities($temp); if($newpost <> $temp) - $input_errors[] = "Invalid characters detected ($temp). Please remove invalid characters and save again."; + $input_errors[] = sprintf(gettext("Invalid characters detected %s. Please remove invalid characters and save again."), $temp); } if ($_POST) { @@ -179,19 +179,19 @@ if ($_POST) { /* input validation */ if(strtoupper($_POST['proto']) == "TCP" or strtoupper($_POST['proto']) == "UDP" or strtoupper($_POST['proto']) == "TCP/UDP") { $reqdfields = explode(" ", "interface proto dstbeginport dstendport localip"); - $reqdfieldsn = explode(",", "Interface,Protocol,Destination port from,Destination port to,NAT IP"); + $reqdfieldsn = array(gettext("Interface"),gettext("Protocol"),gettext("Destination port from"),gettext("Destination port to"),gettext("NAT IP")); } else { $reqdfields = explode(" ", "interface proto localip"); - $reqdfieldsn = explode(",", "Interface,Protocol,NAT IP"); + $reqdfieldsn = array(gettext("Interface"),gettext("Protocol"),gettext("NAT IP")); } if ($_POST['srctype'] == "single" || $_POST['srctype'] == "network") { $reqdfields[] = "src"; - $reqdfieldsn[] = "Source address"; + $reqdfieldsn[] = gettext("Source address"); } if ($_POST['dsttype'] == "single" || $_POST['dsttype'] == "network") { $reqdfields[] = "dst"; - $reqdfieldsn[] = "Destination address"; + $reqdfieldsn[] = gettext("Destination address"); } do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); @@ -206,42 +206,42 @@ if ($_POST) { } if (($_POST['localip'] && !is_ipaddroralias($_POST['localip']))) { - $input_errors[] = "\"{$_POST['localip']}\" is not valid NAT IP address or host alias."; + $input_errors[] = sprintf(gettext("\"%s\" is not valid NAT IP address or host alias."), $_POST['localip']); } if ($_POST['srcbeginport'] && !is_portoralias($_POST['srcbeginport'])) - $input_errors[] = "{$_POST['srcbeginport']} is not a valid start source port. It must be a port alias or integer between 1 and 65535."; + $input_errors[] = sprintf(gettext("%s is not a valid start source port. It must be a port alias or integer between 1 and 65535."), $_POST['srcbeginport']); if ($_POST['srcendport'] && !is_portoralias($_POST['srcendport'])) - $input_errors[] = "{$_POST['srcendport']} is not a valid end source port. It must be a port alias or integer between 1 and 65535."; + $input_errors[] = sprintf(gettext("%s is not a valid end source port. It must be a port alias or integer between 1 and 65535."), $_POST['srcendport']); if ($_POST['dstbeginport'] && !is_portoralias($_POST['dstbeginport'])) - $input_errors[] = "{$_POST['dstbeginport']} is not a valid start destination port. It must be a port alias or integer between 1 and 65535."; + $input_errors[] = sprintf(gettext("%s is not a valid start destination port. It must be a port alias or integer between 1 and 65535."), $_POST['dstbeginport']); if ($_POST['dstendport'] && !is_portoralias($_POST['dstendport'])) - $input_errors[] = "{$_POST['dstendport']} is not a valid end destination port. It must be a port alias or integer between 1 and 65535."; + $input_errors[] = sprintf(gettext("%s is not a valid end destination port. It must be a port alias or integer between 1 and 65535."), $_POST['dstendport']); if ($_POST['localbeginport'] && !is_portoralias($_POST['localbeginport'])) { - $input_errors[] = "{$_POST['localbeginport']} is not a valid local port. It must be a port alias or integer between 1 and 65535."; + $input_errors[] = sprintf(gettext("%s is not a valid local port. It must be a port alias or integer between 1 and 65535."), $_POST['localbeginport']); } /* if user enters an alias and selects "network" then disallow. */ if( ($_POST['srctype'] == "network" && is_alias($_POST['src']) ) || ($_POST['dsttype'] == "network" && is_alias($_POST['dst']) ) ) { - $input_errors[] = "You must specify single host or alias for alias entries."; + $input_errors[] = gettext("You must specify single host or alias for alias entries."); } if (!is_specialnet($_POST['srctype'])) { if (($_POST['src'] && !is_ipaddroralias($_POST['src']))) { - $input_errors[] = "{$_POST['src']} is not a valid source IP address or alias."; + $input_errors[] = sprintf(gettext("%s is not a valid source IP address or alias."), $_POST['src']); } if (($_POST['srcmask'] && !is_numericint($_POST['srcmask']))) { - $input_errors[] = "A valid source bit count must be specified."; + $input_errors[] = gettext("A valid source bit count must be specified."); } } if (!is_specialnet($_POST['dsttype'])) { if (($_POST['dst'] && !is_ipaddroralias($_POST['dst']))) { - $input_errors[] = "{$_POST['dst']} is not a valid destination IP address or alias."; + $input_errors[] = sprintf(gettext("%s is not a valid destination IP address or alias."), $_POST['dst']); } if (($_POST['dstmask'] && !is_numericint($_POST['dstmask']))) { - $input_errors[] = "A valid destination bit count must be specified."; + $input_errors[] = gettext("A valid destination bit count must be specified."); } } @@ -260,7 +260,7 @@ if ($_POST) { if (!$input_errors) { if (($_POST['dstendport'] - $_POST['dstbeginport'] + $_POST['localbeginport']) > 65535) - $input_errors[] = "The target port range must be an integer between 1 and 65535."; + $input_errors[] = gettext("The target port range must be an integer between 1 and 65535."); } /* check for overlaps */ @@ -281,7 +281,7 @@ if ($_POST) { if (!( (($_POST['beginport'] < $begp) && ($_POST['endport'] < $begp)) || (($_POST['beginport'] > $endp) && ($_POST['endport'] > $endp)))) { - $input_errors[] = "The destination port range overlaps with an existing entry."; + $input_errors[] = gettext("The destination port range overlaps with an existing entry."); break; } } @@ -421,7 +421,7 @@ if ($_POST) { } } -$pgtitle = array("Firewall","NAT","Port Forward: Edit"); +$pgtitle = array(gettext("Firewall"),gettext("NAT"),gettext("Port Forward"),gettext("Edit")); include("head.inc"); ?> @@ -433,26 +433,26 @@ include("fbegin.inc"); ?> <form action="firewall_nat_edit.php" method="post" name="iform" id="iform"> <table width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> - <td colspan="2" valign="top" class="listtopic">Edit Redirect entry</td> + <td colspan="2" valign="top" class="listtopic"><?=gettext("Edit Redirect entry"); ?></td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Disabled</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Disabled"); ?></td> <td width="78%" class="vtable"> <input name="disabled" type="checkbox" id="disabled" value="yes" <?php if ($pconfig['disabled']) echo "checked"; ?>> - <strong>Disable this rule</strong><br /> - <span class="vexpl">Set this option to disable this rule without removing it from the list.</span> + <strong><?=gettext("Disable this rule"); ?></strong><br /> + <span class="vexpl"><?=gettext("Set this option to disable this rule without removing it from the list."); ?></span> </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">No RDR (NOT)</td> + <td width="22%" valign="top" class="vncell"><?=gettext("No RDR (NOT)"); ?></td> <td width="78%" class="vtable"> <input type="checkbox" name="nordr"<?php if($pconfig['nordr']) echo " CHECKED"; ?>> - <span class="vexpl">Enabling this option will disable redirection for traffic matching this rule. - <br>Hint: this option is rarely needed, don't use this unless you know what you're doing.</span> + <span class="vexpl"><?=gettext("Enabling this option will disable redirection for traffic matching this rule."); ?> + <br><?=gettext("Hint: this option is rarely needed, don't use this unless you know what you're doing."); ?></span> </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Interface</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Interface"); ?></td> <td width="78%" class="vtable"> <select name="interface" class="formselect" onChange="dst_change(this.value,iface_old,document.iform.dsttype.value);iface_old = document.iform.interface.value;typesel_change();"> <?php @@ -489,60 +489,60 @@ include("fbegin.inc"); ?> </option> <?php endforeach; ?> </select><br> - <span class="vexpl">Choose which interface this rule applies to.<br> - Hint: in most cases, you'll want to use WAN here.</span></td> + <span class="vexpl"><?=gettext("Choose which interface this rule applies to."); ?><br> + <?=gettext("Hint: in most cases, you'll want to use WAN here."); ?></span></td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Protocol</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Protocol"); ?></td> <td width="78%" class="vtable"> <select name="proto" class="formselect" onChange="proto_change(); check_for_aliases();"> <?php $protocols = explode(" ", "TCP UDP TCP/UDP GRE ESP"); foreach ($protocols as $proto): ?> <option value="<?=strtolower($proto);?>" <?php if (strtolower($proto) == $pconfig['proto']) echo "selected"; ?>><?=htmlspecialchars($proto);?></option> <?php endforeach; ?> - </select> <br> <span class="vexpl">Choose which IP protocol - this rule should match.<br> - Hint: in most cases, you should specify <em>TCP</em> here.</span></td> + </select> <br> <span class="vexpl"><?=gettext("Choose which IP protocol " . + "this rule should match."); ?><br> + <?=gettext("Hint: in most cases, you should specify"); ?> <em>TCP</em> <?=gettext("here"); ?>.</span></td> </tr> <tr id="showadvancedboxsrc" name="showadvancedboxsrc"> - <td width="22%" valign="top" class="vncellreq">Source</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Source"); ?></td> <td width="78%" class="vtable"> - <input type="button" onClick="show_source()" value="Advanced"></input> - Show source address and port range</a> + <input type="button" onClick="show_source()" value="<?=gettext("Advanced"); ?>"></input> - <?=gettext("Show source address and port range"); ?></a> </td> </tr> <tr style="display: none;" id="srctable" name="srctable"> - <td width="22%" valign="top" class="vncellreq">Source</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Source"); ?></td> <td width="78%" class="vtable"> <input name="srcnot" type="checkbox" id="srcnot" value="yes" <?php if ($pconfig['srcnot']) echo "checked"; ?>> - <strong>not</strong> + <strong><?=gettext("not"); ?></strong> <br /> - Use this option to invert the sense of the match. + <?=gettext("Use this option to invert the sense of the match"); ?>. <br /> <br /> <table border="0" cellspacing="0" cellpadding="0"> <tr> - <td>Type: </td> + <td><?=gettext("Type"); ?>: </td> <td> <select name="srctype" class="formselect" onChange="typesel_change()"> <?php $sel = is_specialnet($pconfig['src']); ?> - <option value="any" <?php if ($pconfig['src'] == "any") { echo "selected"; } ?>>any</option> - <option value="single" <?php if (($pconfig['srcmask'] == 32) && !$sel) { echo "selected"; $sel = 1; } ?>>Single host or alias</option> - <option value="network" <?php if (!$sel) echo "selected"; ?>>Network</option> + <option value="any" <?php if ($pconfig['src'] == "any") { echo "selected"; } ?>><?=gettext("any"); ?></option> + <option value="single" <?php if (($pconfig['srcmask'] == 32) && !$sel) { echo "selected"; $sel = 1; } ?>><?=gettext("Single host or alias"); ?></option> + <option value="network" <?php if (!$sel) echo "selected"; ?>><?=gettext("Network"); ?></option> <?php if(have_ruleint_access("pptp")): ?> - <option value="pptp" <?php if ($pconfig['src'] == "pptp") { echo "selected"; } ?>>PPTP clients</option> + <option value="pptp" <?php if ($pconfig['src'] == "pptp") { echo "selected"; } ?>><?=gettext("PPTP clients"); ?></option> <?php endif; ?> <?php if(have_ruleint_access("pppoe")): ?> - <option value="pppoe" <?php if ($pconfig['src'] == "pppoe") { echo "selected"; } ?>>PPPoE clients</option> + <option value="pppoe" <?php if ($pconfig['src'] == "pppoe") { echo "selected"; } ?>><?=gettext("PPPoE clients"); ?></option> <?php endif; ?> <?php if(have_ruleint_access("l2tp")): ?> - <option value="l2tp" <?php if ($pconfig['src'] == "l2tp") { echo "selected"; } ?>>L2TP clients</option> - <?php endif; ?> + <option value="l2tp" <?php if ($pconfig['src'] == "l2tp") { echo "selected"; } ?>><?=gettext("L2TP clients"); ?></option> + <?php endif; ?> <?php foreach ($ifdisp as $ifent => $ifdesc): ?> <?php if(have_ruleint_access($ifent)): ?> - <option value="<?=$ifent;?>" <?php if ($pconfig['src'] == $ifent) { echo "selected"; } ?>><?=htmlspecialchars($ifdesc);?> subnet</option> + <option value="<?=$ifent;?>" <?php if ($pconfig['src'] == $ifent) { echo "selected"; } ?>><?=htmlspecialchars($ifdesc);?> <?=gettext("subnet"); ?></option> <option value="<?=$ifent;?>ip"<?php if ($pconfig['src'] == $ifent . "ip") { echo "selected"; } ?>> - <?=$ifdesc?> address + <?=$ifdesc?> <?=gettext("address");?> </option> <?php endif; ?> <?php endforeach; ?> @@ -550,7 +550,7 @@ include("fbegin.inc"); ?> </td> </tr> <tr> - <td>Address: </td> + <td><?=gettext("Address"); ?>: </td> <td> <input autocomplete='off' name="src" type="text" class="formfldalias" id="src" size="20" value="<?php if (!is_specialnet($pconfig['src'])) echo htmlspecialchars($pconfig['src']);?>"> / <select name="srcmask" class="formselect" id="srcmask"> @@ -564,15 +564,15 @@ include("fbegin.inc"); ?> </td> </tr> <tr style="display:none" id="sprtable" name="sprtable"> - <td width="22%" valign="top" class="vncellreq">Source port range</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Source port range"); ?></td> <td width="78%" class="vtable"> <table border="0" cellspacing="0" cellpadding="0"> <tr> - <td>from: </td> + <td><?=gettext("from"); ?>: </td> <td> <select name="srcbeginport" class="formselect" onchange="src_rep_change();ext_change()"> - <option value="">(other)</option> - <option value="any" <?php $bfound = 0; if ($pconfig['srcbeginport'] == "any") { echo "selected"; $bfound = 1; } ?>>any</option> + <option value="">(<?=gettext("other"); ?>)</option> + <option value="any" <?php $bfound = 0; if ($pconfig['srcbeginport'] == "any") { echo "selected"; $bfound = 1; } ?>><?=gettext("any"); ?></option> <?php foreach ($wkports as $wkport => $wkportdesc): ?> <option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['srcbeginport']) { echo "selected"; $bfound = 1; } ?>><?=htmlspecialchars($wkportdesc);?></option> <?php endforeach; ?> @@ -581,11 +581,11 @@ include("fbegin.inc"); ?> </td> </tr> <tr> - <td>to:</td> + <td><?=gettext("to"); ?>:</td> <td> <select name="srcendport" class="formselect" onchange="ext_change()"> - <option value="">(other)</option> - <option value="any" <?php $bfound = 0; if ($pconfig['srcendport'] == "any") { echo "selected"; $bfound = 1; } ?>>any</option> + <option value="">(<?=gettext("other"); ?>)</option> + <option value="any" <?php $bfound = 0; if ($pconfig['srcendport'] == "any") { echo "selected"; $bfound = 1; } ?>><?=gettext("any"); ?></option> <?php foreach ($wkports as $wkport => $wkportdesc): ?> <option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['srcendport']) { echo "selected"; $bfound = 1; } ?>><?=htmlspecialchars($wkportdesc);?></option> <?php endforeach; ?> @@ -595,43 +595,43 @@ include("fbegin.inc"); ?> </tr> </table> <br /> - <span class="vexpl"><?=gettext("Specify the source port or port range for this rule. <b>This is usually <em>random</em> and almost never equal to the destination port range (and should usually be "any").</b> <br /> Hint: you can leave the <em>'to'</em> field empty if you only want to filter a single port.");?></span><br/> + <span class="vexpl"><?=gettext("Specify the source port or port range for this rule"); ?>. <b><?=gettext("This is usually"); ?> <em><?=gettext("random"); ?></em> <?=gettext("and almost never equal to the destination port range (and should usually be 'any')"); ?>.</b> <br /> <?=gettext("Hint: you can leave the"); ?> <em>'<?=gettext("to"); ?>'</em> <?=gettext("field empty if you only want to filter a single port."); ?></span><br/> </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Destination</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Destination"); ?></td> <td width="78%" class="vtable"> <input name="dstnot" type="checkbox" id="dstnot" value="yes" <?php if ($pconfig['dstnot']) echo "checked"; ?>> - <strong>not</strong> + <strong><?=gettext("not"); ?></strong> <br /> - Use this option to invert the sense of the match. + <?=gettext("Use this option to invert the sense of the match"); ?>. <br /> <br /> <table border="0" cellspacing="0" cellpadding="0"> <tr> - <td>Type: </td> + <td><?=gettext("Type"); ?>: </td> <td> <select name="dsttype" class="formselect" onChange="typesel_change()"> <?php $sel = is_specialnet($pconfig['dst']); ?> - <option value="any" <?php if ($pconfig['dst'] == "any") { echo "selected"; } ?>>any</option> - <option value="single" <?php if (($pconfig['dstmask'] == 32) && !$sel) { echo "selected"; $sel = 1; } ?>>Single host or alias</option> - <option value="network" <?php if (!$sel) echo "selected"; ?>>Network</option> + <option value="any" <?php if ($pconfig['dst'] == "any") { echo "selected"; } ?>><?=gettext("any"); ?></option> + <option value="single" <?php if (($pconfig['dstmask'] == 32) && !$sel) { echo "selected"; $sel = 1; } ?>><?=gettext("Single host or alias"); ?></option> + <option value="network" <?php if (!$sel) echo "selected"; ?>><?=gettext("Network"); ?></option> <?php if(have_ruleint_access("pptp")): ?> - <option value="pptp" <?php if ($pconfig['dst'] == "pptp") { echo "selected"; } ?>>PPTP clients</option> + <option value="pptp" <?php if ($pconfig['dst'] == "pptp") { echo "selected"; } ?>><?=gettext("PPTP clients"); ?></option> <?php endif; ?> <?php if(have_ruleint_access("pppoe")): ?> - <option value="pppoe" <?php if ($pconfig['dst'] == "pppoe") { echo "selected"; } ?>>PPPoE clients</option> + <option value="pppoe" <?php if ($pconfig['dst'] == "pppoe") { echo "selected"; } ?>><?=gettext("PPPoE clients"); ?></option> <?php endif; ?> <?php if(have_ruleint_access("l2tp")): ?> - <option value="l2tp" <?php if ($pconfig['dst'] == "l2tp") { echo "selected"; } ?>>L2TP clients</option> + <option value="l2tp" <?php if ($pconfig['dst'] == "l2tp") { echo "selected"; } ?>><?=gettext("L2TP clients"); ?></option> <?php endif; ?> <?php foreach ($ifdisp as $if => $ifdesc): ?> <?php if(have_ruleint_access($if)): ?> - <option value="<?=$if;?>" <?php if ($pconfig['dst'] == $if) { echo "selected"; } ?>><?=htmlspecialchars($ifdesc);?> subnet</option> + <option value="<?=$if;?>" <?php if ($pconfig['dst'] == $if) { echo "selected"; } ?>><?=htmlspecialchars($ifdesc);?> <?=gettext("subnet"); ?></option> <option value="<?=$if;?>ip"<?php if ($pconfig['dst'] == $if . "ip") { echo "selected"; } ?>> - <?=$ifdesc;?> address + <?=$ifdesc;?> <?=gettext("address");?> </option> <?php endif; ?> <?php endforeach; ?> @@ -658,7 +658,7 @@ include("fbegin.inc"); ?> </td> </tr> <tr> - <td>Address: </td> + <td><?=gettext("Address"); ?>: </td> <td> <input name="dst" type="text" class="formfldalias" id="dst" size="20" value="<?php if (!is_specialnet($pconfig['dst'])) echo htmlspecialchars($pconfig['dst']);?>"> / @@ -674,14 +674,14 @@ include("fbegin.inc"); ?> </td> </tr> <tr id="dprtr" name="dprtr"> - <td width="22%" valign="top" class="vncellreq">Destination port range </td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Destination port range"); ?> </td> <td width="78%" class="vtable"> <table border="0" cellspacing="0" cellpadding="0"> <tr> - <td>from: </td> + <td><?=gettext("from"); ?>: </td> <td> <select name="dstbeginport" class="formselect" onchange="dst_rep_change();ext_change()"> - <option value="">(other)</option> + <option value="">(<?=gettext("other"); ?>)</option> <?php $bfound = 0; foreach ($wkports as $wkport => $wkportdesc): ?> <option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['dstbeginport']) { echo "selected"; $bfound = 1; }?>><?=htmlspecialchars($wkportdesc);?></option> @@ -691,10 +691,10 @@ include("fbegin.inc"); ?> </td> </tr> <tr> - <td>to:</td> + <td><?=gettext("to"); ?>:</td> <td> <select name="dstendport" class="formselect" onchange="ext_change()"> - <option value="">(other)</option> + <option value="">(<?=gettext("other"); ?>)</option> <?php $bfound = 0; foreach ($wkports as $wkport => $wkportdesc): ?> <option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['dstendport']) { echo "selected"; $bfound = 1; } ?>><?=htmlspecialchars($wkportdesc);?></option> @@ -706,25 +706,25 @@ include("fbegin.inc"); ?> </table> <br /> <span class="vexpl"> - Specify the port or port range for the destination of the packet for this mapping. + <?=gettext("Specify the port or port range for the destination of the packet for this mapping"); ?>. <br /> - Hint: you can leave the <em>'to'</em> field empty if you only want to map a single port + <?=gettext("Hint: you can leave the"); ?> <em>'<?=gettext("to"); ?>'</em> <?=gettext("field empty if you only want to map a single port"); ?> </span> </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Redirect target IP</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Redirect target IP"); ?></td> <td width="78%" class="vtable"> <input autocomplete='off' name="localip" type="text" class="formfldalias" id="localip" size="20" value="<?=htmlspecialchars($pconfig['localip']);?>"> - <br> <span class="vexpl">Enter the internal IP address of - the server on which you want to map the ports.<br> - e.g. <em>192.168.1.12</em></span></td> + <br> <span class="vexpl"><?=gettext("Enter the internal IP address of " . + "the server on which you want to map the ports"); ?>.<br> + <?=gettext("e.g."); ?> <em>192.168.1.12</em></span></td> </tr> <tr name="lprtr" id="lprtr"> - <td width="22%" valign="top" class="vncellreq">Redirect target port</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Redirect target port"); ?></td> <td width="78%" class="vtable"> <select name="localbeginport" class="formselect" onChange="ext_change();check_for_aliases();"> - <option value="">(other)</option> + <option value="">(<?=gettext("other"); ?>)</option> <?php $bfound = 0; foreach ($wkports as $wkport => $wkportdesc): ?> <option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['localbeginport']) { echo "selected"; @@ -735,42 +735,42 @@ include("fbegin.inc"); ?> <?php endforeach; ?> </select> <input onChange="check_for_aliases();" autocomplete='off' class="formfldalias" name="localbeginport_cust" id="localbeginport_cust" type="text" size="5" value="<?php if (!$bfound) echo $pconfig['localbeginport']; ?>"> <br> - <span class="vexpl">Specify the port on the machine with the - IP address entered above. In case of a port range, specify - the beginning port of the range (the end port will be calculated - automatically).<br> - Hint: this is usually identical to the 'from' port above</span></td> + <span class="vexpl"><?=gettext("Specify the port on the machine with the " . + "IP address entered above. In case of a port range, specify " . + "the beginning port of the range (the end port will be calculated " . + "automatically)"); ?>.<br> + <?=gettext("Hint: this is usually identical to the 'from' port above"); ?></span></td> </tr> <tr> - <td width="22%" valign="top" class="vncell">Description</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td> <td width="78%" class="vtable"> <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>"> - <br> <span class="vexpl">You may enter a description here - for your reference (not parsed).</span></td> + <br> <span class="vexpl"><?=gettext("You may enter a description here " . + "for your reference (not parsed)"); ?>.</span></td> </tr> <tr> - <td width="22%" valign="top" class="vncell">No XMLRPC Sync</td> + <td width="22%" valign="top" class="vncell"><?=gettext("No XMLRPC Sync"); ?></td> <td width="78%" class="vtable"> <input type="checkbox" value="yes" name="nosync"<?php if($pconfig['nosync']) echo " CHECKED"; ?>><br> - HINT: This prevents the rule from automatically syncing to other CARP members. + <?=gettext("HINT: This prevents the rule from automatically syncing to other CARP members"); ?>. </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">NAT reflection</td> + <td width="22%" valign="top" class="vncell"><?=gettext("NAT reflection"); ?></td> <td width="78%" class="vtable"> <select name="natreflection" class="formselect"> - <option value="default" <?php if ($pconfig['natreflection'] != "enable" && $pconfig['natreflection'] != "disable") echo "selected"; ?>>use system default</option> - <option value="enable" <?php if ($pconfig['natreflection'] == "enable") echo "selected"; ?>>enable</option> - <option value="disable" <?php if ($pconfig['natreflection'] == "disable") echo "selected"; ?>>disable</option> + <option value="default" <?php if ($pconfig['natreflection'] != "enable" && $pconfig['natreflection'] != "disable") echo "selected"; ?>><?=gettext("use system default"); ?></option> + <option value="enable" <?php if ($pconfig['natreflection'] == "enable") echo "selected"; ?>><?=gettext("enable"); ?></option> + <option value="disable" <?php if ($pconfig['natreflection'] == "disable") echo "selected"; ?>><?=gettext("disable"); ?></option> </select> </td> </tr> <?php if (isset($id) && $a_nat[$id] && !isset($_GET['dup'])): ?> <tr> - <td width="22%" valign="top" class="vncell">Filter rule association</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Filter rule association"); ?></td> <td width="78%" class="vtable"> <select name="associated-rule-id"> - <option value="">None</option> + <option value=""><?=gettext("None"); ?></option> <option value="pass" <?php if($pconfig['associated-rule-id'] == "pass") echo " SELECTED"; ?>>Pass</option> <?php $linkedrule = ""; @@ -791,7 +791,7 @@ include("fbegin.inc"); ?> } } if (isset($pconfig['associated-rule-id'])) - echo "<option value=\"new\">Create new associated filter rule</option>\n"; + echo "<option value=\"new\">" . gettext("Create new associated filter rule") . "</option>\n"; echo "</select>\n"; echo $linkedrule; ?> @@ -800,13 +800,13 @@ include("fbegin.inc"); ?> <?php endif; ?> <?php if ((!(isset($id) && $a_nat[$id])) || (isset($_GET['dup']))): ?> <tr> - <td width="22%" valign="top" class="vncell">Filter rule association</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Filter rule association"); ?></td> <td width="78%" class="vtable"> <select name="filter-rule-association" id="filter-rule-association"> - <option value="">None</option> - <option value="add-associated" selected="selected">Add associated filter rule</option> - <option value="add-unassociated">Add unassociated filter rule</option> - <option value="pass">Pass</option> + <option value=""><?=gettext("None"); ?></option> + <option value="add-associated" selected="selected"><?=gettext("Add associated filter rule"); ?></option> + <option value="add-unassociated"><?=gettext("Add unassociated filter rule"); ?></option> + <option value="pass"><?=gettext("Pass"); ?></option> </select> </td> </tr><?php endif; ?> @@ -817,7 +817,7 @@ include("fbegin.inc"); ?> <tr> <td width="22%" valign="top"> </td> <td width="78%"> - <input name="Submit" type="submit" class="formbtn" value="Save"> <input type="button" class="formbtn" value="Cancel" onclick="history.back()"> + <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>"> <input type="button" class="formbtn" value="<?=gettext("Cancel"); ?>" onclick="history.back()"> <?php if (isset($id) && $a_nat[$id]): ?> <input name="id" type="hidden" value="<?=$id;?>"> <?php endif; ?> diff --git a/usr/local/www/firewall_nat_out.php b/usr/local/www/firewall_nat_out.php index b0abc50..59d6cb4 100755 --- a/usr/local/www/firewall_nat_out.php +++ b/usr/local/www/firewall_nat_out.php @@ -108,7 +108,7 @@ if (isset($_POST['save']) && $_POST['save'] == "Save") { $natent = array(); $natent['source']['network'] = "{$osn}/{$ossubnet}"; $natent['dstport'] = "500"; - $natent['descr'] = "Auto created rule for ISAKMP - {$ifdesc} to {$ifdesc2}"; + $natent['descr'] = sprintf(gettext("Auto created rule for ISAKMP - %s to %s"),$ifdesc,$ifdesc2); $natent['target'] = ""; $natent['interface'] = $if2; $natent['destination']['any'] = true; @@ -118,7 +118,7 @@ if (isset($_POST['save']) && $_POST['save'] == "Save") { $natent = array(); $natent['source']['network'] = "{$osn}/{$ossubnet}"; $natent['dstport'] = "5060"; - $natent['descr'] = "Auto created rule for SIP - {$ifdesc} to {$ifdesc2}"; + $natent['descr'] = sprintf(gettext("Auto created rule for SIP - %s to %s"),$ifdesc,$ifdesc2); $natent['target'] = ""; $natent['interface'] = $if2; $natent['destination']['any'] = true; @@ -128,7 +128,7 @@ if (isset($_POST['save']) && $_POST['save'] == "Save") { $natent = array(); $natent['source']['network'] = "{$osn}/{$ossubnet}"; $natent['sourceport'] = ""; - $natent['descr'] = "Auto created rule for {$ifdesc} to {$ifdesc2}"; + $natent['descr'] = sprintf(gettext("Auto created rule for %s to %s"),$ifdesc,$ifdesc2); $natent['target'] = ""; $natent['interface'] = $if2; $natent['destination']['any'] = true; @@ -146,7 +146,7 @@ if (isset($_POST['save']) && $_POST['save'] == "Save") { $natent = array(); $natent['source']['network'] = "{$osn}/{$ossubnet}"; $natent['sourceport'] = ""; - $natent['descr'] = "Auto created rule for PPTP server"; + $natent['descr'] = gettext("Auto created rule for PPTP server"); $natent['target'] = ""; $natent['interface'] = $if2; $natent['destination']['any'] = true; @@ -165,7 +165,7 @@ if (isset($_POST['save']) && $_POST['save'] == "Save") { $natent = array(); $natent['source']['network'] = "{$osn}/{$ossubnet}"; $natent['sourceport'] = ""; - $natent['descr'] = "Auto created rule for PPPoE server"; + $natent['descr'] = gettext("Auto created rule for PPPoE server"); $natent['target'] = ""; $natent['interface'] = $if2; $natent['destination']['any'] = true; @@ -184,7 +184,7 @@ if (isset($_POST['save']) && $_POST['save'] == "Save") { $natent = array(); $natent['source']['network'] = "{$osn}/{$ossubnet}"; $natent['sourceport'] = ""; - $natent['descr'] = "Auto created rule for L2TP server"; + $natent['descr'] = gettext("Auto created rule for L2TP server"); $natent['target'] = ""; $natent['interface'] = $if2; $natent['destination']['any'] = true; @@ -198,7 +198,7 @@ if (isset($_POST['save']) && $_POST['save'] == "Save") { $natent = array(); $natent['source']['network'] = $ovpnsrv['tunnel_network']; $natent['sourceport'] = ""; - $natent['descr'] = "Auto created rule for OpenVPN server"; + $natent['descr'] = gettext("Auto created rule for OpenVPN server"); $natent['target'] = ""; $natent['interface'] = $if2; $natent['destination']['any'] = true; @@ -209,7 +209,7 @@ if (isset($_POST['save']) && $_POST['save'] == "Save") { } } - $savemsg = "Default rules for each interface have been created."; + $savemsg = gettext("Default rules for each interface have been created."); } break; } @@ -280,7 +280,7 @@ if (isset($_POST['del_x'])) { } -$pgtitle = array("Firewall","NAT","Outbound"); +$pgtitle = array(gettext("Firewall"),gettext("NAT"),gettext("Outbound")); include("head.inc"); ?> @@ -291,14 +291,14 @@ include("head.inc"); </script> <?php if ($savemsg) print_info_box($savemsg); ?> <?php if (is_subsystem_dirty('natconf')): ?><p> -<?php print_info_box_np("The NAT configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br> +<?php print_info_box_np(gettext("The NAT configuration has been changed.")."<br>".gettext("You must apply the changes in order for them to take effect."));?><br> <?php endif; ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td> <?php $tab_array = array(); - $tab_array[] = array("Port Forward", false, "firewall_nat.php"); + $tab_array[] = array(gettext("Port Forward"), false, "firewall_nat.php"); $tab_array[] = array("1:1", false, "firewall_nat_1to1.php"); - $tab_array[] = array("Outbound", true, "firewall_nat_out.php"); + $tab_array[] = array(gettext("Outbound"), true, "firewall_nat_out.php"); display_top_tabs($tab_array); ?> </td></tr> @@ -314,9 +314,9 @@ include("head.inc"); <td> <input name="advancedoripsec" type="radio" id="advancedoutbound" value="advancedoutboundnat" <?php if (isset($config['nat']['advancedoutbound']['enable'])) echo "checked";?>> - <strong><?=gettext("Manual Outbound NAT rule generation<br/> (AON - Advanced Outbound NAT)");?></strong></td> + <strong><?=gettext("Manual Outbound NAT rule generation") . "<br/> " . gettext("(AON - Advanced Outbound NAT)");?></strong></td> <td valign="middle" align="left"> - <input name="save" type="submit" class="formbtn" value="Save"> + <input name="save" type="submit" class="formbtn" value="<?=gettext("Save");?>"> <br/> </td> </tr> @@ -337,20 +337,20 @@ include("head.inc"); <tr id="frheader"> <td width="3%" class="list"> </td> <td width="3%" class="list"> </td> - <td width="10%" class="listhdrr">Interface</td> - <td width="15%" class="listhdrr">Source</td> - <td width="10%" class="listhdrr">Source Port</td> - <td width="15%" class="listhdrr">Destination</td> - <td width="10%" class="listhdrr">Destination Port</td> - <td width="15%" class="listhdrr">NAT Address</td> - <td width="10%" class="listhdrr">NAT Port</td> - <td width="10%" class="listhdrr">Static Port</td> - <td width="25%" class="listhdr">Description</td> + <td width="10%" class="listhdrr"><?=gettext("Interface");?></td> + <td width="15%" class="listhdrr"><?=gettext("Source");?></td> + <td width="10%" class="listhdrr"><?=gettext("Source Port");?></td> + <td width="15%" class="listhdrr"><?=gettext("Destination");?></td> + <td width="10%" class="listhdrr"><?=gettext("Destination Port");?></td> + <td width="15%" class="listhdrr"><?=gettext("NAT Address");?></td> + <td width="10%" class="listhdrr"><?=gettext("NAT Port");?></td> + <td width="10%" class="listhdrr"><?=gettext("Static Port");?></td> + <td width="25%" class="listhdr"><?=gettext("Description");?></td> <td width="5%" class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> <td width="17"></td> - <td><a href="firewall_nat_out_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="add new mapping"></a></td> + <td><a href="firewall_nat_out_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?=gettext("add new mapping");?>"></a></td> </tr> </table> </td> @@ -421,9 +421,9 @@ include("head.inc"); <td class="listr" onClick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$nnats;?>';"> <?php if(isset($natent['staticnatport'])) - echo "<CENTER>YES</CENTER>"; + echo "<CENTER>" . gettext("YES") . "</CENTER>"; else - echo "<CENTER>NO</CENTER>"; + echo "<CENTER>" . gettext("NO") . "</CENTER>"; ?> </td> <td class="listbg" onClick="fr_toggle(<?=$nnats;?>)" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$nnats;?>';"> @@ -432,11 +432,11 @@ include("head.inc"); <td class="list" valign="middle" nowrap> <table border="0" cellspacing="0" cellpadding="1"> <tr> - <td><a href="firewall_nat_out_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="edit mapping"></a></td> + <td><a href="firewall_nat_out_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="<?=gettext("edit mapping");?>"></a></td> </tr> <tr> - <td><input onmouseover="fr_insline(<?=$nnats;?>, true)" onmouseout="fr_insline(<?=$nnats;?>, false)" name="move_<?=$i;?>" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" title="move selected rules before this rule" height="17" type="image" width="17" border="0"></td> - <td><a href="firewall_nat_out_edit.php?dup=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="add a new nat based on this one" width="17" height="17" border="0"></a></td> + <td><input onmouseover="fr_insline(<?=$nnats;?>, true)" onmouseout="fr_insline(<?=$nnats;?>, false)" name="move_<?=$i;?>" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" title="<?=gettext("move selected rules before this rule");?>" height="17" type="image" width="17" border="0"></td> + <td><a href="firewall_nat_out_edit.php?dup=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add a new nat based on this one");?>" width="17" height="17" border="0"></a></td> </tr> </table> <?php $i++; $nnats++; endforeach; ?> @@ -445,11 +445,11 @@ include("head.inc"); <td class="list" valign="middle" nowrap> <table border="0" cellspacing="0" cellpadding="1"> <tr> - <td><?php if ($nnats == 0): ?><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="move selected mappings to end" border="0"><?php else: ?><input name="move_<?=$i;?>" type="image" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" width="17" height="17" title="move selected mappings to end" border="0"><?php endif; ?></td> - <td><a href="firewall_nat_out_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="add new mapping"></a></td> + <td><?php if ($nnats == 0): ?><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="<?=gettext("move selected mappings to end");?>" border="0"><?php else: ?><input name="move_<?=$i;?>" type="image" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" width="17" height="17" title="<?=gettext("move selected mappings to end");?>" border="0"><?php endif; ?></td> + <td><a href="firewall_nat_out_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?=gettext("add new mapping");?>"></a></td> </tr> <tr> - <td><?php if ($nnats == 0): ?><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="delete selected rules" border="0"><?php else: ?><input name="del" type="image" src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="delete selected mappings" onclick="return confirm('Do you really want to delete the selected mappings?')"><?php endif; ?></td> + <td><?php if ($nnats == 0): ?><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="<?=gettext("delete selected rules");?>" border="0"><?php else: ?><input name="del" type="image" src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="<?=gettext("delete selected mappings");?>" onclick="return confirm('<?=gettext("Do you really want to delete the selected mappings?");?>')"><?php endif; ?></td> </tr> </table></td> </tr> diff --git a/usr/local/www/firewall_nat_out_edit.php b/usr/local/www/firewall_nat_out_edit.php index b1e7a64..4cafc89 100755 --- a/usr/local/www/firewall_nat_out_edit.php +++ b/usr/local/www/firewall_nat_out_edit.php @@ -109,50 +109,50 @@ if ($_POST) { /* input validation */ $reqdfields = explode(" ", "interface protocol source source_subnet destination destination_subnet"); - $reqdfieldsn = explode(",", "Interface,Protocol,Source,Source bit count,Destination,Destination bit count"); + $reqdfieldsn = array(gettext("Interface"),gettext("Protocol"),gettext("Source"),gettext("Source bit count"),gettext("Destination"),gettext("Destination bit count")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); if($_POST['sourceport'] <> "" && !is_port($_POST['sourceport'])) - $input_errors[] = "You must supply either a valid port for the source port entry."; + $input_errors[] = gettext("You must supply either a valid port for the source port entry."); if($_POST['dstport'] <> "" and !is_port($_POST['dstport'])) - $input_errors[] = "You must supply either a valid port for the destination port entry."; + $input_errors[] = gettext("You must supply either a valid port for the destination port entry."); if($_POST['natport'] <> "" and !is_port($_POST['natport'])) - $input_errors[] = "You must supply either a valid port for the nat port entry."; + $input_errors[] = gettext("You must supply either a valid port for the nat port entry."); if ($_POST['source_type'] != "any") { if ($_POST['source'] && !is_ipaddr($_POST['source']) && $_POST['source'] <> "any") { - $input_errors[] = "A valid source must be specified."; + $input_errors[] = gettext("A valid source must be specified."); } } if ($_POST['source_subnet'] && !is_numericint($_POST['source_subnet'])) { - $input_errors[] = "A valid source bit count must be specified."; + $input_errors[] = gettext("A valid source bit count must be specified."); } if ($_POST['sourceport'] && !is_numericint($_POST['sourceport'])) { - $input_errors[] = "A valid source port must be specified."; + $input_errors[] = gettext("A valid source port must be specified."); } if ($_POST['destination_type'] != "any") { if ($_POST['destination'] && !is_ipaddr($_POST['destination'])) { - $input_errors[] = "A valid destination must be specified."; + $input_errors[] = gettext("A valid destination must be specified."); } } if ($_POST['destination_subnet'] && !is_numericint($_POST['destination_subnet'])) { - $input_errors[] = "A valid destination bit count must be specified."; + $input_errors[] = gettext("A valid destination bit count must be specified."); } if ($_POST['destination_type'] == "any") { if ($_POST['destination_not']) { - $input_errors[] = "Negating destination address of \"any\" is invalid."; + $input_errors[] = gettext("Negating destination address of \"any\" is invalid."); } } if ($_POST['nonat'] && $_POST['staticnatport']) { - $input_errors[] = "Static port cannot be used with No NAT."; + $input_errors[] = gettext("Static port cannot be used with No NAT."); } if ($_POST['target'] && !is_ipaddr($_POST['target'])) { - $input_errors[] = "A valid target IP address must be specified."; + $input_errors[] = gettext("A valid target IP address must be specified."); } /* if user has selected any as source, set it here */ @@ -249,7 +249,7 @@ if ($_POST) { } } -$pgtitle = array("Firewall","NAT","Outbound","Edit"); +$pgtitle = array(gettext("Firewall"),gettext("NAT"),gettext("Outbound"),gettext("Edit")); $closehead = false; include("head.inc"); @@ -304,17 +304,17 @@ function sourcesel_change() { <form action="firewall_nat_out_edit.php" method="post" name="iform" id="iform"> <table width="100%" border="0" cellpadding="6" cellspacing="1"> <tr> - <td colspan="2" valign="top" class="listtopic">Edit Advanced Outbound NAT entry</td> + <td colspan="2" valign="top" class="listtopic"><?=gettext("Edit Advanced Outbound NAT entry");?></td> </tr> <tr> - <td width="22%" valign="top" class="vncell">Do not NAT</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Do not NAT");?></td> <td width="78%" class="vtable"> <input type="checkbox" name="nonat"<?php if(isset($pconfig['nonat'])) echo " CHECKED"; ?>> - <span class="vexpl">Enabling this option will disable NAT for traffic matching this rule and stop processing Outbound NAT rules. - <br>Hint: in most cases, you won't use this option.</span></td> + <span class="vexpl"><?=gettext("Enabling this option will disable NAT for traffic matching this rule and stop processing Outbound NAT rules.");?> + <br><?=gettext("Hint: in most cases, you won't use this option.");?></span></td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Interface</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Interface");?></td> <td width="78%" class="vtable"> <select name="interface" class="formselect"> <?php @@ -350,34 +350,34 @@ function sourcesel_change() { </option> <?php endforeach; ?> </select><br> - <span class="vexpl">Choose which interface this rule applies to.<br> - Hint: in most cases, you'll want to use WAN here.</span></td> + <span class="vexpl"><?=gettext("Choose which interface this rule applies to.");?><br> + <?=gettext("Hint: in most cases, you'll want to use WAN here.");?></span></td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Protocol</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Protocol");?></td> <td width="78%" class="vtable"> <select name="protocol" class="formselect"> <?php $protocols = explode(" ", "any TCP UDP TCP/UDP ICMP ESP AH GRE IGMP carp pfsync"); foreach ($protocols as $proto): ?> <option value="<?=strtolower($proto);?>" <?php if (strtolower($proto) == $pconfig['protocol']) echo "selected"; ?>><?=htmlspecialchars($proto);?></option> <?php endforeach; ?> - </select> <br> <span class="vexpl">Choose which protocol this rule should match.<br /> - Hint: in most cases, you should specify <em>any</em> here.</span> + </select> <br> <span class="vexpl"><?=gettext("Choose which protocol this rule should match.");?><br /> + <?php printf(gettext("Hint: in most cases, you should specify %s any %s here."),"<em>","</em> ");?></span> </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Source</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Source");?></td> <td width="78%" class="vtable"> <table border="0" cellspacing="1" cellpadding="1"> <tr> - <td>Type: </td> + <td><?=gettext("Type");?>: </td> <td> <select name="source_type" class="formselect" onChange="sourcesel_change()"> - <option value="any" <?php if ($pconfig['source'] == "any") echo "selected"; ?>>any</option> - <option value="network" <?php if ($pconfig['source'] != "any") echo "selected"; ?>>Network</option> + <option value="any" <?php if ($pconfig['source'] == "any") echo "selected"; ?>><?=gettext("any");?></option> + <option value="network" <?php if ($pconfig['source'] != "any") echo "selected"; ?>><?=gettext("Network");?></option> </select> </td></tr> - <td>Address: </td> + <td><?=gettext("Address");?>: </td> <td><input name="source" type="text" class="formfld unknown" id="source" size="20" value="<?=htmlspecialchars($pconfig['source']);?>">/<select name="source_subnet" class="formfld" id="source_subnet"> <?php for ($i = 32; $i >= 0; $i--): ?> <option value="<?=$i;?>"<?php if ($i == $pconfig['source_subnet']) echo " selected"; ?>><?=$i;?></option> @@ -386,34 +386,34 @@ function sourcesel_change() { </tr> <tr> <td> </td> - <td><span class="vexpl">Enter the source network for the outbound NAT mapping.</span></td> + <td><span class="vexpl"><?=gettext("Enter the source network for the outbound NAT mapping.");?></span></td> </tr> <tr> - <td>Source port: </td> - <td><input name="sourceport" type="text" class="formfld unknown" id="sourceport" size="5" value="<?=htmlspecialchars($pconfig['sourceport']);?>"> (leave -blank for any)</td> + <td><?=gettext("Source port");?>: </td> + <td><input name="sourceport" type="text" class="formfld unknown" id="sourceport" size="5" value="<?=htmlspecialchars($pconfig['sourceport']);?>"> <?=gettext("(leave +blank for any)");?></td> </tr> </table></td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Destination</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Destination");?></td> <td width="78%" class="vtable"> <input name="destination_not" type="checkbox" id="destination_not" value="yes" <?php if ($pconfig['destination_not']) echo "checked"; ?>> - <strong>not</strong><br> - Use this option to invert the sense of the match.<br> + <strong><?=gettext("not");?></strong><br> + <?=gettext("Use this option to invert the sense of the match.");?><br> <br> <table border="0" cellspacing="1" cellpadding="1"> <tr> - <td>Type: </td> + <td><?=gettext("Type");?>: </td> <td><select name="destination_type" class="formselect" onChange="typesel_change()"> <option value="any"<?php if ($pconfig['destination'] == "any") echo " selected"; ?>> - any</option> + <?=gettext("any");?></option> <option value="network"<?php if ($pconfig['destination'] != "any") echo " selected"; ?>> - Network</option> + <?=gettext("Network");?></option> </select></td> </tr> <tr> - <td>Address: </td> + <td><?=gettext("Address");?>: </td> <td><input name="destination" type="text" class="formfld unknown" id="destination" size="20" value="<?=htmlspecialchars($pconfig['destination']);?>"> / <select name="destination_subnet" class="formselect" id="destination_subnet"> @@ -424,25 +424,25 @@ blank for any)</td> </tr> <tr> <td> </td> - <td><span class="vexpl">Enter the destination network for - the outbound NAT mapping.</span></td> + <td><span class="vexpl"><?=gettext("Enter the destination network for ". + "the outbound NAT mapping.");?></span></td> </tr> <tr> - <td>Destination port: </td> - <td><input name="dstport" type="text" class="formfld unknown" id="dstport" size="5" value="<?=htmlspecialchars($pconfig['dstport']);?>"> (leave blank for -any)</td> + <td><?=gettext("Destination port");?>: </td> + <td><input name="dstport" type="text" class="formfld unknown" id="dstport" size="5" value="<?=htmlspecialchars($pconfig['dstport']);?>"> <?=gettext("(leave blank for +any)");?></td> </tr> </table> </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">Translation</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Translation");?></td> <td width="78%" class="vtable"> <table border="0" cellspacing="1" cellpadding="1"> <tr> - <td>Address: </td> + <td><?=gettext("Address");?>: </td> <td><select name="target" class="formselect"> - <option value=""<?php if (!$pconfig['target']) echo " selected"; ?>>Interface address</option> + <option value=""<?php if (!$pconfig['target']) echo " selected"; ?>><?=gettext("Interface address");?></option> <?php if (is_array($config['virtualip']['vip'])): foreach ($config['virtualip']['vip'] as $sn): if ($sn['mode'] == "proxyarp" && $sn['type'] == "network"): @@ -460,49 +460,49 @@ any)</td> <?php endif; endforeach; endif; ?> - <option value=""<?php if($pconfig['target'] == "any") echo " selected"; ?>>any</option> + <option value=""<?php if($pconfig['target'] == "any") echo " selected"; ?>><?=gettext("any");?></option> </select> </td> </tr> <tr><td> </td><td> - <span class="vexpl">Packets matching this rule will be mapped to the IP address given here.<br> - If you want this rule to apply to another IP address than the IP address of the interface chosen above, - select it here (you need to define <a href="firewall_virtual_ip.php">Virtual IP</a> addresses on the first). - Also note that if you are trying to redirect connections on the LAN select the "any" option. + <span class="vexpl"><?=gettext("Packets matching this rule will be mapped to the IP address given here.");?><br> + <?=gettext("If you want this rule to apply to another IP address than the IP address of the interface chosen above, ". + gettext("select it here (you need to define");?> <a href="firewall_virtual_ip.php"><?=gettext("Virtual IP");?></a> <?=gettext("addresses on the first).");?> + <?=gettext('Also note that if you are trying to redirect connections on the LAN select the "any" option.');?> </span> </td></tr> <tr> - <td>Port: </td> + <td><?=gettext("Port");?>: </td> <td><input name="natport" type="text" class="formfld unknown" id="natport" size="5" value="<?=htmlspecialchars($pconfig['natport']);?>"></td> </tr> <tr><td> </td><td> - <span class="vexpl">Enter the source port for the outbound NAT mapping.</span> + <span class="vexpl"><?=gettext("Enter the source port for the outbound NAT mapping.");?></span> </td></tr> <tr> - <td>Static-port: </td> + <td><?=gettext("Static-port");?>: </td> <td><input onChange="staticportchange();" name="staticnatport" type="checkbox" class="formfld" id="staticnatport" size="5"<?php if($pconfig['staticnatport']) echo " CHECKED";?>></td> </tr> </table> </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">No XMLRPC Sync</td> + <td width="22%" valign="top" class="vncell"><?=gettext("No XMLRPC Sync");?></td> <td width="78%" class="vtable"> <input value="yes" name="nosync" type="checkbox" class="formfld" id="nosync"<?php if($pconfig['nosync']) echo " CHECKED"; ?>><br> - HINT: This prevents the rule from automatically syncing to other CARP members. + <?=gettext("HINT: This prevents the rule from automatically syncing to other CARP members.");?> </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">Description</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td> <td width="78%" class="vtable"> <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>"> - <br> <span class="vexpl">You may enter a description here - for your reference (not parsed).</span></td> + <br> <span class="vexpl"><?=gettext("You may enter a description here + for your reference (not parsed).");?></span></td> </tr> <tr> <td width="22%" valign="top"> </td> <td width="78%"> - <input name="Submit" type="submit" class="formbtn" value="Save"> <input type="button" class="formbtn" value="Cancel" onclick="history.back()"> + <input name="Submit" type="submit" class="formbtn" value="Save"> <input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="history.back()"> <?php if (isset($id) && $a_out[$id]): ?> <input name="id" type="hidden" value="<?=$id;?>"> <?php endif; ?> diff --git a/usr/local/www/firewall_rules.php b/usr/local/www/firewall_rules.php index cd358da..4553641 100755 --- a/usr/local/www/firewall_rules.php +++ b/usr/local/www/firewall_rules.php @@ -41,7 +41,7 @@ ##|*MATCH=firewall_rules.php* ##|-PRIV -$pgtitle = array("Firewall", "Rules"); +$pgtitle = array(gettext("Firewall"),gettext("Rules")); $statusurl = "status_filter_reload.php"; $logurl = "diag_logs_filter.php"; @@ -178,7 +178,7 @@ if ($_POST) { clear_subsystem_dirty('filter'); - $savemsg = "The settings have been applied. The firewall rules are now reloading in the background. You can also <a href='status_filter_reload.php'>monitor</a> the reload progress."; + $savemsg = sprintf(gettext("The settings have been applied. The firewall rules are now reloading in the background. You can also %s monitor %s the reload progress"),"<a href='status_filter_reload.php'>","</a>"); } } @@ -286,7 +286,7 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript </script> <?php if ($savemsg) print_info_box($savemsg); ?> <?php if (is_subsystem_dirty('filter')): ?><p> -<?php print_info_box_np("The firewall rule configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br> +<?php print_info_box_np(gettext("The firewall rule configuration has been changed.")."<br>".gettext("You must apply the changes in order for them to take effect."));?><br> <?php endif; ?> <div id="loading" style="visibity:hidden"> <img src="/themes/<?=$g['theme']?>/images/misc/loader.gif"> Loading, please wait... @@ -301,7 +301,7 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript $active = true; else $active = false; - $tab_array[] = array("Floating", $active, "firewall_rules.php?if=FloatingRules"); + $tab_array[] = array(gettext("Floating"), $active, "firewall_rules.php?if=FloatingRules"); $tabscounter = 0; $i = 0; foreach ($iflist as $ifent => $ifname) { if ($ifent == $if) $active = true; @@ -319,16 +319,16 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript <tr id="frheader"> <td width="3%" class="list"> </td> <td width="5%" class="list"> </td> - <td width="3%" class="listhdrr">ID</td> - <td width="6%" class="listhdrr">Proto</td> - <td width="12%" class="listhdrr">Source</td> - <td width="6%" class="listhdrr">Port</td> - <td width="12%" class="listhdrr">Destination</td> - <td width="6%" class="listhdrr">Port</td> - <td width="5%" class="listhdrr">Gateway</td> - <td width="8%" class="listhdrr">Queue</td> - <td width="5%" class="listhdrr">Schedule</td> - <td width="19%" class="listhdr">Description</td> + <td width="3%" class="listhdrr"><?=gettext("ID");?></td> + <td width="6%" class="listhdrr"><?=gettext("Proto");?></td> + <td width="12%" class="listhdrr"><?=gettext("Source");?></td> + <td width="6%" class="listhdrr"><?=gettext("Port");?></td> + <td width="12%" class="listhdrr"><?=gettext("Destination");?></td> + <td width="6%" class="listhdrr"><?=gettext("Port");?></td> + <td width="5%" class="listhdrr"><?=gettext("Gateway");?></td> + <td width="8%" class="listhdrr"><?=gettext("Queue");?></td> + <td width="5%" class="listhdrr"><?=gettext("Schedule");?></td> + <td width="19%" class="listhdr"><?=gettext("Description");?></td> <td width="10%" class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> @@ -346,9 +346,9 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript <td> <?php if ($nrules == 0): ?> <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="delete selected rules" border="0"><?php else: ?> - <input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="delete selected rules" onclick="return confirm('Do you really want to delete the selected rules?')"><?php endif; ?> + <input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="<?=gettext("delete selected rules");?>" onclick="return confirm('<?=gettext('Do you really want to delete the selected rules?');?>')"><?php endif; ?> </td> - <td align="center" valign="middle"><a href="firewall_rules_edit.php?if=<?=$if;?>&after=-1"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="add new rule" width="17" height="17" border="0"></a></td> + <td align="center" valign="middle"><a href="firewall_rules_edit.php?if=<?=$if;?>&after=-1"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add new rule");?>" width="17" height="17" border="0"></a></td> </tr> </table> </td> @@ -359,23 +359,23 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript <td class="listt" align="center"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_block.gif" width="11" height="11" border="0"></td> <td class="listlr" style="background-color: #e0e0e0"></td> <td class="listr" style="background-color: #e0e0e0">*</td> - <td class="listr" style="background-color: #e0e0e0">RFC 1918 networks</td> + <td class="listr" style="background-color: #e0e0e0"><?=gettext("RFC 1918 networks");?></td> <td class="listr" style="background-color: #e0e0e0">*</td> <td class="listr" style="background-color: #e0e0e0">*</td> <td class="listr" style="background-color: #e0e0e0">*</td> <td class="listr" style="background-color: #e0e0e0">*</td> <td class="listr" style="background-color: #e0e0e0">*</td> <td class="listr" style="background-color: #e0e0e0"></td> - <td class="listbg">Block private networks</td> + <td class="listbg"><?=gettext("Block private networks");?></td> <td valign="middle" nowrap class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> - <td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="move selected rules before this rule"></td> - <td><a href="interfaces.php?if=<?=$if?>#rfc1918"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="edit rule" width="17" height="17" border="0"></a></td> + <td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="<?=gettext("move selected rules before this rule");?>"></td> + <td><a href="interfaces.php?if=<?=$if?>#rfc1918"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit rule");?>" width="17" height="17" border="0"></a></td> </tr> <tr> <td align="center" valign="middle"></td> - <td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus_d.gif" title="add a new rule based on this one" width="17" height="17" border="0"></td> + <td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus_d.gif" title="<?=gettext("add a new rule based on this one");?>" width="17" height="17" border="0"></td> </tr> </table> </td> @@ -387,23 +387,23 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript <td class="listt" align="center"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_block.gif" width="11" height="11" border="0"></td> <td class="listlr" style="background-color: #e0e0e0"></td> <td class="listr" style="background-color: #e0e0e0">*</td> - <td class="listr" style="background-color: #e0e0e0">Reserved/not assigned by IANA</td> + <td class="listr" style="background-color: #e0e0e0"><?=gettext("Reserved/not assigned by IANA");?></td> <td class="listr" style="background-color: #e0e0e0">*</td> <td class="listr" style="background-color: #e0e0e0">*</td> <td class="listr" style="background-color: #e0e0e0">*</td> <td class="listr" style="background-color: #e0e0e0">*</td> <td class="listr" style="background-color: #e0e0e0">*</td> <td class="listr" style="background-color: #e0e0e0">*</td> - <td class="listbg">Block bogon networks</td> + <td class="listbg"><?=gettext("Block bogon networks");?></td> <td valign="middle" nowrap class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> - <td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="move selected rules before this rule"></td> - <td><a href="interfaces.php?if=<?=$if?>#rfc1918"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="edit rule" width="17" height="17" border="0"></a></td> + <td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="<?=gettext("move selected rules before this rule");?>"></td> + <td><a href="interfaces.php?if=<?=$if?>#rfc1918"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit rule");?>" width="17" height="17" border="0"></a></td> </tr> <tr> <td align="center" valign="middle"></td> - <td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus_d.gif" title="add a new rule based on this one" width="17" height="17" border="0"></td> + <td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus_d.gif" title="<?=gettext("add a new rule based on this one");?>" width="17" height="17" border="0"></td> </tr> </table> </td> @@ -442,7 +442,7 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript $textss = $textse = ""; } ?> - <a href="?if=<?=$if;?>&act=toggle&id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_<?=$iconfn;?>.gif" width="11" height="11" border="0" title="click to toggle enabled/disabled status"></a> + <a href="?if=<?=$if;?>&act=toggle&id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_<?=$iconfn;?>.gif" width="11" height="11" border="0" title="<?=gettext("click to toggle enabled/disabled status");?>></a> <?php if (isset($filterent['log'])): $iconfnlog = "log_s"; if (isset($filterent['disabled'])) @@ -478,8 +478,8 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript $sched_caption_escaped = ""; $sched_content = ""; $schedstatus = false; - $dayArray = array ('Mon','Tues','Wed','Thur','Fri','Sat','Sun'); - $monthArray = array ('January','February','March','April','May','June','July','August','September','October','November','December'); + $dayArray = array (gettext('Mon'),gettext('Tues'),gettext('Wed'),gettext('Thur'),gettext('Fri'),gettext('Sat'),gettext('Sun')); + $monthArray = array (gettext('January'),gettext('February'),gettext('March'),gettext('April'),gettext('May'),gettext('June'),gettext('July'),gettext('August'),gettext('September'),gettext('October'),gettext('November'),gettext('December')); if($config['schedules']['schedule'] <> "" and is_array($config['schedules']['schedule'])){ foreach ($a_schedules as $schedule) { @@ -590,12 +590,12 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript if ($iconfn == "block" || $iconfn == "reject") { $image = "icon_block"; - $alttext = "Traffic matching this rule is currently being denied"; + $alttext = gettext("Traffic matching this rule is currently being denied"); } else { $image = "icon_pass"; - $alttext = "Traffic matching this rule is currently being allowed"; + $alttext = gettext("Traffic matching this rule is currently being allowed"); } $printicon = true; } @@ -605,7 +605,7 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript $image = "icon_block_d"; else $image = "icon_block"; - $alttext = "This rule is not currently active because its period has expired"; + $alttext = gettext("This rule is not currently active because its period has expired"); $printicon = true; } } @@ -670,9 +670,9 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript <td class="listt"></td> <td class="listlr" colspan="10" align="center" valign="middle"> <span class="gray"> - No rules are currently defined for this interface.<br> - All incoming connections on this interface will be blocked until you add pass rules.<br><br> - Click the <a href="firewall_rules_edit.php?if=<?=$if;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="add new rule" border="0" width="17" height="17" align="absmiddle"></a> button to add a new rule.</span> + <?=gettext("No rules are currently defined for this interface")."<br>". + gettext("All incoming connections on this interface will be blocked until you add pass rules.")."<br><br>";?> + Click the <a href="firewall_rules_edit.php?if=<?=$if;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add new rule");?>" border="0" width="17" height="17" align="absmiddle"></a><?=gettext(" button to add a new rule.");?></span> </td> <?php endif; ?> <tr id="fr<?=$nrules;?>"> @@ -692,16 +692,16 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript <table border="0" cellspacing="0" cellpadding="1"> <tr> <td> - <?php if ($nrules == 0): ?><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="move selected rules to end" border="0"><?php else: ?><input name="move_<?=$i;?>" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" width="17" height="17" title="move selected rules to end" onMouseOver="fr_insline(<?=$nrules;?>, true)" onMouseOut="fr_insline(<?=$nrules;?>, false)"><?php endif; ?></td> + <?php if ($nrules == 0): ?><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="<?=gettext("move selected rules to end");?>" border="0"><?php else: ?><input name="move_<?=$i;?>" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" width="17" height="17" title="<?=gettext("move selected rules to end");?>" onMouseOver="fr_insline(<?=$nrules;?>, true)" onMouseOut="fr_insline(<?=$nrules;?>, false)"><?php endif; ?></td> <td></td> </tr> <tr> <td> <?php if ($nrules == 0): ?> - <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="delete selected rules" border="0"><?php else: ?> - <input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="delete selected rules" onclick="return confirm('Do you really want to delete the selected rules?')"><?php endif; ?> + <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="<?=gettext("delete selected rules");?>" border="0"><?php else: ?> + <input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="<?=gettext("delete selected rules");?>" onclick="return confirm('<?=gettext('Do you really want to delete the selected rules?');?>')"><?php endif; ?> </td> - <td><a href="firewall_rules_edit.php?if=<?=$if;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="add new rule" width="17" height="17" border="0"></a></td> + <td><a href="firewall_rules_edit.php?if=<?=$if;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add new rule");?>" width="17" height="17" border="0"></a></td> </tr> </table> </td> @@ -710,45 +710,45 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript <table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="16"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_pass.gif" width="11" height="11"></td> - <td>pass</td> + <td><?=gettext("pass");?></td> <td width="14"></td> <td width="16"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_block.gif" width="11" height="11"></td> - <td>block</td> + <td><?=gettext("block");?></td> <td width="14"></td> <td width="16"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_reject.gif" width="11" height="11"></td> - <td>reject</td> + <td><?=gettext("reject");?></td> <td width="14"></td> <td width="16"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_log.gif" width="11" height="11"></td> - <td>log</td> + <td><?=gettext("log");?></td> </tr> <tr> <td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_pass_d.gif" width="11" height="11"></td> - <td nowrap>pass (disabled)</td> + <td nowrap><?=gettext("pass (disabled)");?></td> <td> </td> <td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_block_d.gif" width="11" height="11"></td> - <td nowrap>block (disabled)</td> + <td nowrap><?=gettext("block (disabled)");?></td> <td> </td> <td><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_reject_d.gif" width="11" height="11"></td> - <td nowrap>reject (disabled)</td> + <td nowrap><?=gettext("reject (disabled)");?></td> <td> </td> <td width="16"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_log_d.gif" width="11" height="11"></td> - <td nowrap>log (disabled)</td> + <td nowrap><?=gettext("log (disabled)");?></td> </tr> <tr> <td colspan="10"> <p/> <strong> - <span class="red">Hint:</span> + <span class="red"><?=gettext("Hint") . ":";?></span> </strong><br> <ul> - <li>Rules are evaluated on a first-match basis (i.e. - the action of the first rule to match a packet will be executed). - This means that if you use block rules, you'll have to pay attention - to the rule order. Everything that isn't explicitly passed is blocked - by default. + <li><?=gettext("Rules are evaluated on a first-match basis (i.e. " . + "the action of the first rule to match a packet will be executed). " . + "This means that if you use block rules, you'll have to pay attention " . + "to the rule order. Everything that isn't explicitly passed is blocked " . + "by default. ");?> </li> <li> - You may drag and drop rules using your mouse to reorder the rule ordering. + <?=gettext("You may drag and drop rules using your mouse to reorder the rule ordering.");?> </li> </ul> </td> diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php index 277ad26..f5890c6 100755 --- a/usr/local/www/firewall_rules_edit.php +++ b/usr/local/www/firewall_rules_edit.php @@ -188,7 +188,7 @@ if (isset($_GET['dup'])) if ($_POST) { if ($_POST['type'] == "reject" && $_POST['proto'] <> "tcp") - $input_errors[] = "Reject type rules only works when the protocol is set to TCP."; + $input_errors[] = gettext("Reject type rules only works when the protocol is set to TCP."); if (($_POST['proto'] != "tcp") && ($_POST['proto'] != "udp") && ($_POST['proto'] != "tcp/udp")) { $_POST['srcbeginport'] = 0; @@ -254,7 +254,7 @@ if ($_POST) { continue; $newpost = htmlentities($temp); if($newpost <> $temp) - $input_errors[] = "Invalid characters detected ($temp). Please remove invalid characters and save again."; + $input_errors[] = sprintf(gettext("Invalid characters detected (%s). Please remove invalid characters and save again."),$temp); } /* input validation */ @@ -271,9 +271,9 @@ if ($_POST) { if($_POST['statetype'] == "modulate state" or $_POST['statetype'] == "synproxy state") { if( $_POST['proto'] != "tcp" ) - $input_errors[] = "{$_POST['statetype']} is only valid with protocol tcp."; + $input_errors[] = sprintf(gettext("%s is only valid with protocol tcp."),$_POST['statetype']); if(($_POST['statetype'] == "synproxy state") && ($_POST['gateway'] != "")) - $input_errors[] = "{$_POST['statetype']} is only valid if the gateway is set to 'default'."; + $input_errors[] = sprintf(gettext("%s is only valid if the gateway is set to 'default'."),$_POST['statetype']); } if ( isset($a_filter[$id]['associated-rule-id'])===false && @@ -284,7 +284,7 @@ if ($_POST) { if ( isset($a_filter[$id]['associated-rule-id'])===false && (!(is_specialnet($_POST['dsttype']) || ($_POST['dsttype'] == "single"))) ) { $reqdfields[] = "dstmask"; - $reqdfieldsn[] = "Destination bit count"; + $reqdfieldsn[] = gettext("Destination bit count"); } do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); @@ -299,38 +299,38 @@ if ($_POST) { } if ($_POST['srcbeginport'] && !is_portoralias($_POST['srcbeginport'])) - $input_errors[] = "{$_POST['srcbeginport']} is not a valid start source port. It must be a port alias or integer between 1 and 65535."; + $input_errors[] = sprintf(gettext("%s is not a valid start source port. It must be a port alias or integer between 1 and 65535."),$_POST['srcbeginposrt']); if ($_POST['srcendport'] && !is_portoralias($_POST['srcendport'])) - $input_errors[] = "{$_POST['srcendport']} is not a valid end source port. It must be a port alias or integer between 1 and 65535."; + $input_errors[] = sprintf(gettext("%s is not a valid end source port. It must be a port alias or integer between 1 and 65535."),$_POST['srcendport']); if ($_POST['dstbeginport'] && !is_portoralias($_POST['dstbeginport'])) - $input_errors[] = "{$_POST['dstbeginport']} is not a valid start destination port. It must be a port alias or integer between 1 and 65535."; + $input_errors[] = sprintf(gettext("%s is not a valid start destination port. It must be a port alias or integer between 1 and 65535."),$_POST['dstbeginport']); if ($_POST['dstendport'] && !is_portoralias($_POST['dstendport'])) - $input_errors[] = "{$_POST['dstendport']} is not a valid end destination port. It must be a port alias or integer between 1 and 65535."; + $input_errors[] = sprintf(gettext("%s is not a valid end destination port. It must be a port alias or integer between 1 and 65535."),$_POST['dstendport']); /* if user enters an alias and selects "network" then disallow. */ if($_POST['srctype'] == "network") { if(is_alias($_POST['src'])) - $input_errors[] = "You must specify single host or alias for alias entries."; + $input_errors[] = gettext("You must specify single host or alias for alias entries."); } if($_POST['dsttype'] == "network") { if(is_alias($_POST['dst'])) - $input_errors[] = "You must specify single host or alias for alias entries."; + $input_errors[] = gettext("You must specify single host or alias for alias entries."); } if (!is_specialnet($_POST['srctype'])) { if (($_POST['src'] && !is_ipaddroralias($_POST['src']))) { - $input_errors[] = "{$_POST['src']} is not a valid source IP address or alias."; + $input_errors[] = sprintf(gettext("%s is not a valid source IP address or alias."),$_POST['src']); } if (($_POST['srcmask'] && !is_numericint($_POST['srcmask']))) { - $input_errors[] = "A valid source bit count must be specified."; + $input_errors[] = gettext("A valid source bit count must be specified."); } } if (!is_specialnet($_POST['dsttype'])) { if (($_POST['dst'] && !is_ipaddroralias($_POST['dst']))) { - $input_errors[] = "{$_POST['dst']} is not a valid destination IP address or alias."; + $input_errors[] = sprintf(gettext("%s is not a valid destination IP address or alias."),$_POST['dst']); } if (($_POST['dstmask'] && !is_numericint($_POST['dstmask']))) { - $input_errors[] = "A valid destination bit count must be specified."; + $input_errors[] = gettext("A valid destination bit count must be specified."); } } @@ -348,31 +348,31 @@ if ($_POST) { } if ($_POST['os']) if( $_POST['proto'] != "tcp" ) - $input_errors[] = "OS detection is only valid with protocol tcp."; + $input_errors[] = gettext("OS detection is only valid with protocol tcp."); if ($_POST['ackqueue'] && $_POST['ackqueue'] != "none") { if ($_POST['defaultqueue'] == "none" ) - $input_errors[] = "You have to select a queue when you select an acknowledge queue too."; + $input_errors[] = gettext("You have to select a queue when you select an acknowledge queue too."); else if ($_POST['ackqueue'] == $_POST['defaultqueue']) - $input_errors[] = "Acknowledge queue and Queue cannot be the same."; + $input_errors[] = gettext("Acknowledge queue and Queue cannot be the same."); } if ($_POST['pdnpipe'] && $_POST['pdnpipe'] != "none") { if ($_POST['dnpipe'] == "none" ) - $input_errors[] = "You must select a queue for the In direction before selecting one for Out too."; + $input_errors[] = gettext("You must select a queue for the In direction before selecting one for Out too."); else if ($_POST['pdnpipe'] == $_POST['dnpipe']) - $input_errors[] = "In and Out Queue cannot be the same."; + $input_errors[] = gettext("In and Out Queue cannot be the same."); else if ($pdnpipe[0] == "?" && $dnpipe[0] <> "?") - $input_errors[] = "You cannot select one queue and one virtual interface for IN and Out. both must be from the same type."; - else if ($dnpipe[0] == "?" && $pdnpipe[0] <> "?") - $input_errors[] = "You cannot select one queue and one virtual interface for IN and Out. both must be from the same type."; + $input_errors[] = gettext("You cannot select one queue and one virtual interface for IN and Out. both must be from the same type."); + else if ($dnpipe[0] == "?" && $pdnpipe[0] <> "?") + $input_errors[] = gettext("You cannot select one queue and one virtual interface for IN and Out. both must be from the same type."); } if( !empty($_POST['ruleid']) && !ctype_digit($_POST['ruleid'])) - $input_errors[] = 'ID must be an integer'; + $input_errors[] = gettext('ID must be an integer'); if($_POST['l7container'] && $_POST['l7container'] != "none") { if(!($_POST['proto'] == "tcp" || $_POST['proto'] == "udp" || $_POST['proto'] == "tcp/udp")) - $input_errors[] = "You can only select a layer7 container for TCP and/or UDP protocols"; + $input_errors[] = gettext("You can only select a layer7 container for TCP and/or UDP protocols"); if ($_POST['type'] <> "pass") - $input_errors[] = "You can only select a layer7 container for Pass type rules."; + $input_errors[] = gettext("You can only select a layer7 container for Pass type rules."); } if (!$_POST['tcpflags_any']) { @@ -385,7 +385,7 @@ if ($_POST) { $outoftcpflags[] = $tcpflag; } if (empty($outoftcpflags) && !empty($settcpflags)) - $input_errors[] = "If you specify TCP flags that should be set you should specify out of which flags as well."; + $input_errors[] = gettext("If you specify TCP flags that should be set you should specify out of which flags as well."); } if (!$input_errors) { @@ -549,7 +549,7 @@ $dnqlist =& get_unique_dnqueue_list(); read_layer7_config(); $l7clist =& get_l7_unique_list(); -$pgtitle = array("Firewall","Rules","Edit"); +$pgtitle = array(gettext("Firewall"),gettext("Rules"),gettext("Edit")); $statusurl = "status_filter_reload.php"; $logurl = "diag_logs_filter.php"; @@ -571,10 +571,10 @@ include("head.inc"); <table width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> - <td colspan="2" valign="top" class="listtopic">Edit Firewall rule</td> + <td colspan="2" valign="top" class="listtopic"><?=gettext("Edit Firewall rule");?></td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Action</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Action");?></td> <td width="78%" class="vtable"> <select name="type" class="formselect"> <?php $types = explode(" ", "Pass Block Reject"); foreach ($types as $type): ?> @@ -585,17 +585,17 @@ include("head.inc"); </select> <br/> <span class="vexpl"> - Choose what to do with packets that match the criteria specified below. <br/> - Hint: the difference between block and reject is that with reject, a packet (TCP RST or ICMP port unreachable for UDP) is returned to the sender, whereas with block the packet is dropped silently. In either case, the original packet is discarded. + <?=gettext("Choose what to do with packets that match the criteria specified below.");?> <br/> + <?=gettext("Hint: the difference between block and reject is that with reject, a packet (TCP RST or ICMP port unreachable for UDP) is returned to the sender, whereas with block the packet is dropped silently. In either case, the original packet is discarded.");?> </span> </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Disabled</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Disabled");?></td> <td width="78%" class="vtable"> <input name="disabled" type="checkbox" id="disabled" value="yes" <?php if ($pconfig['disabled']) echo "checked"; ?>> - <strong>Disable this rule</strong><br /> - <span class="vexpl">Set this option to disable this rule without removing it from the list.</span> + <strong><?=gettext("Disable this rule");?></strong><br /> + <span class="vexpl"><?=gettext("Set this option to disable this rule without removing it from the list.");?></span> </td> </tr> <?php if ($if == "FloatingRules" || isset($pconfig['floating'])): ?> @@ -611,7 +611,7 @@ include("head.inc"); </tr> <? endif; ?> <tr> - <td width="22%" valign="top" class="vncellreq">Interface</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Interface");?></td> <td width="78%" class="vtable"> <?php if ($if == "FloatingRules" || isset($pconfig['floating'])): ?> <select name="interface[]" multiple="true" class="formselect" size="3"> @@ -647,11 +647,11 @@ include("head.inc"); $interfaces["openvpn"] = "OpenVPN"; $selected_interfaces = explode(",", $pconfig['interface']); foreach ($interfaces as $iface => $ifacename): ?> - <option value="<?=$iface;?>" <?php if ($pconfig['interface'] <> "" && ( strcasecmp($pconfig['interface'], $iface) == 0 || in_array($iface, $selected_interfaces) )) echo "selected"; ?>><?=gettext($ifacename);?></option> + <option value="<?=$iface;?>" <?php if ($pconfig['interface'] <> "" && ( strcasecmp($pconfig['interface'], $iface) == 0 || in_array($iface, $selected_interfaces) )) echo "selected"; ?>><?=$ifacename?></option> <?php endforeach; ?> </select> <br /> - <span class="vexpl">Choose on which interface packets must come in to match this rule.</span> + <span class="vexpl"><?=gettext("Choose on which interface packets must come in to match this rule.");?></span> </td> </tr> <?php if ($if == "FloatingRules" || isset($pconfig['floating'])): ?> @@ -661,7 +661,7 @@ include("head.inc"); </td> <td width="78%" class="vtable"> <select name="direction" class="formselect"> - <?php $directions = array('any', 'in', 'out'); + <?php $directions = array('any','in','out'); foreach ($directions as $direction): ?> <option value="<?=$direction;?>" <?php if ($direction == $pconfig['direction']): ?> @@ -675,7 +675,7 @@ include("head.inc"); <tr> <?php endif; ?> <tr> - <td width="22%" valign="top" class="vncellreq">Protocol</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Protocol");?></td> <td width="78%" class="vtable"> <select name="proto" class="formselect" onchange="proto_change()"> <?php @@ -685,32 +685,32 @@ include("head.inc"); <?php endforeach; ?> </select> <br /> - <span class="vexpl">Choose which IP protocol this rule should match. <br /> Hint: in most cases, you should specify <em>TCP</em> here.</span> + <span class="vexpl"><?=gettext("Choose which IP protocol this rule should match.");?> <br /> <?=gettext("Hint: in most cases, you should specify ");?><em>TCP</em> <?=gettext("here.");?></span> </td> </tr> <tr id="icmpbox" name="icmpbox"> - <td valign="top" class="vncell">ICMP type</td> + <td valign="top" class="vncell"><?=gettext("ICMP type");?></td> <td class="vtable"> <select name="icmptype" class="formselect"> <?php $icmptypes = array( - "" => "any", - "echorep" => "Echo reply", - "unreach" => "Destination unreachable", - "squench" => "Source quench", - "redir" => "Redirect", - "althost" => "Alternate Host", - "echoreq" => "Echo", - "routeradv" => "Router advertisement", - "routersol" => "Router solicitation", - "timex" => "Time exceeded", - "paramprob" => "Invalid IP header", - "timereq" => "Timestamp", - "timerep" => "Timestamp reply", - "inforeq" => "Information request", - "inforep" => "Information reply", - "maskreq" => "Address mask request", - "maskrep" => "Address mask reply" + "" => gettext("any"), + "echorep" => gettext("Echo reply"), + "unreach" => gettext("Destination unreachable"), + "squench" => gettext("Source quench"), + "redir" => gettext("Redirect"), + "althost" => gettext("Alternate Host"), + "echoreq" => gettext("Echo"), + "routeradv" => gettext("Router advertisement"), + "routersol" => gettext("Router solicitation"), + "timex" => gettext("Time exceeded"), + "paramprob" => gettext("Invalid IP header"), + "timereq" => gettext("Timestamp"), + "timerep" => gettext("Timestamp reply"), + "inforeq" => gettext("Information request"), + "inforep" => gettext("Information reply"), + "maskreq" => gettext("Address mask request"), + "maskrep" => gettext("Address mask reply") ); foreach ($icmptypes as $icmptype => $descr): ?> @@ -718,16 +718,16 @@ include("head.inc"); <?php endforeach; ?> </select> <br /> - <span class="vexpl">If you selected ICMP for the protocol above, you may specify an ICMP type here.</span> + <span class="vexpl"><?=gettext("If you selected ICMP for the protocol above, you may specify an ICMP type here.");?></span> </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Source</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Source");?></td> <td width="78%" class="vtable"> <?php $edit_disabled=false; ?> <?php if( isset($pconfig['associated-rule-id']) ): ?> - <span class="red"><strong>NOTE: </strong></span> This is associated to a NAT rule.<br /> - You cannot edit the source and destination of associated filter rules.<br /> + <span class="red"><strong><?=gettext("NOTE: ");?></strong></span><?=gettext("This is associated to a NAT rule.");?><br /> + <?=gettext("You cannot edit the source and destination of associated filter rules.");?><br /> <br /> <?php $edit_disabled=true; @@ -746,36 +746,36 @@ include("head.inc"); </script> <?php endif; ?> <input<?php echo ($edit_disabled===true?' DISABLED':''); ?> name="srcnot" type="checkbox" id="srcnot" value="yes" <?php if ($pconfig['srcnot']) echo "checked"; ?>> - <strong>not</strong> + <strong><?=gettext("not");?></strong> <br /> - Use this option to invert the sense of the match. + <?=gettext("Use this option to invert the sense of the match.");?> <br /> <br /> <table border="0" cellspacing="0" cellpadding="0"> <tr> - <td>Type: </td> + <td><?=gettext("Type");?>: </td> <td> <select<?php echo ($edit_disabled===true?' DISABLED':''); ?> name="srctype" class="formselect" onChange="typesel_change()"> <?php $sel = is_specialnet($pconfig['src']); ?> - <option value="any" <?php if ($pconfig['src'] == "any") { echo "selected"; } ?>>any</option> - <option value="single" <?php if (($pconfig['srcmask'] == 32) && !$sel) { echo "selected"; $sel = 1; } ?>>Single host or alias</option> - <option value="network" <?php if (!$sel) echo "selected"; ?>>Network</option> + <option value="any" <?php if ($pconfig['src'] == "any") { echo "selected"; } ?>><?=gettext("any");?></option> + <option value="single" <?php if (($pconfig['srcmask'] == 32) && !$sel) { echo "selected"; $sel = 1; } ?>><?=gettext("Single host or alias");?></option> + <option value="network" <?php if (!$sel) echo "selected"; ?>><?=gettext("Network");?></option> <?php if(have_ruleint_access("pptp")): ?> - <option value="pptp" <?php if ($pconfig['src'] == "pptp") { echo "selected"; } ?>>PPTP clients</option> + <option value="pptp" <?php if ($pconfig['src'] == "pptp") { echo "selected"; } ?>><?=gettext("PPTP clients");?></option> <?php endif; ?> <?php if(have_ruleint_access("pppoe")): ?> - <option value="pppoe" <?php if ($pconfig['src'] == "pppoe") { echo "selected"; } ?>>PPPoE clients</option> + <option value="pppoe" <?php if ($pconfig['src'] == "pppoe") { echo "selected"; } ?>><?=gettext("PPPoE clients");?></option> <?php endif; ?> <?php if(have_ruleint_access("l2tp")): ?> - <option value="l2tp" <?php if ($pconfig['src'] == "l2tp") { echo "selected"; } ?>>L2TP clients</option> + <option value="l2tp" <?php if ($pconfig['src'] == "l2tp") { echo "selected"; } ?>><?=gettext("L2TP clients");?></option> <?php endif; ?> <?php foreach ($ifdisp as $ifent => $ifdesc): ?> <?php if(have_ruleint_access($ifent)): ?> - <option value="<?=$ifent;?>" <?php if ($pconfig['src'] == $ifent) { echo "selected"; } ?>><?=htmlspecialchars($ifdesc);?> subnet</option> + <option value="<?=$ifent;?>" <?php if ($pconfig['src'] == $ifent) { echo "selected"; } ?>><?=htmlspecialchars($ifdesc);?><?=gettext(" subnet");?></option> <option value="<?=$ifent;?>ip"<?php if ($pconfig['src'] == $ifent . "ip") { echo "selected"; } ?>> - <?=$ifdesc?> address + <?=$ifdesc?> <?=gettext("address");?> </option> <?php endif; ?> <?php endforeach; ?> @@ -783,7 +783,7 @@ include("head.inc"); </td> </tr> <tr> - <td>Address: </td> + <td><?=gettext("Address");?>: </td> <td> <input<?php echo ($edit_disabled===true?' DISABLED':''); ?> autocomplete='off' name="src" type="text" class="formfldalias" id="src" size="20" value="<?php if (!is_specialnet($pconfig['src'])) echo htmlspecialchars($pconfig['src']);?>"> / <select<?php echo ($edit_disabled===true?' DISABLED':''); ?> name="srcmask" class="formselect" id="srcmask"> @@ -796,20 +796,20 @@ include("head.inc"); </table> <div id="showadvancedboxspr"> <p> - <input<?php echo ($edit_disabled===true?' DISABLED':''); ?> type="button" onClick="show_source_port_range()" value="Advanced"></input> - Show source port range</a> + <input<?php echo ($edit_disabled===true?' DISABLED':''); ?> type="button" onClick="show_source_port_range()" value="Advanced"></input> - <?=gettext("Show source port range");?></a> </div> </td> </tr> <tr style="display:none" id="sprtable" name="sprtable"> - <td width="22%" valign="top" class="vncellreq">Source port range</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Source port range");?></td> <td width="78%" class="vtable"> <table border="0" cellspacing="0" cellpadding="0"> <tr> - <td>from: </td> + <td><?=gettext("from");?>: </td> <td> <select<?php echo ($edit_disabled===true?' DISABLED':''); ?> name="srcbeginport" class="formselect" onchange="src_rep_change();ext_change()"> - <option value="">(other)</option> - <option value="any" <?php $bfound = 0; if ($pconfig['srcbeginport'] == "any") { echo "selected"; $bfound = 1; } ?>>any</option> + <option value="">(<?=gettext("other"); ?>)</option> + <option value="any" <?php $bfound = 0; if ($pconfig['srcbeginport'] == "any") { echo "selected"; $bfound = 1; } ?>><?=gettext("any");?></option> <?php foreach ($wkports as $wkport => $wkportdesc): ?> <option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['srcbeginport']) { echo "selected"; $bfound = 1; } ?>><?=htmlspecialchars($wkportdesc);?></option> <?php endforeach; ?> @@ -818,11 +818,11 @@ include("head.inc"); </td> </tr> <tr> - <td>to:</td> + <td><?=gettext("to");?>:</td> <td> <select<?php echo ($edit_disabled===true?' DISABLED':''); ?> name="srcendport" class="formselect" onchange="ext_change()"> - <option value="">(other)</option> - <option value="any" <?php $bfound = 0; if ($pconfig['srcendport'] == "any") { echo "selected"; $bfound = 1; } ?>>any</option> + <option value="">(<?=gettext("other"); ?>)</option> + <option value="any" <?php $bfound = 0; if ($pconfig['srcendport'] == "any") { echo "selected"; $bfound = 1; } ?>><?=gettext("any");?></option> <?php foreach ($wkports as $wkport => $wkportdesc): ?> <option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['srcendport']) { echo "selected"; $bfound = 1; } ?>><?=htmlspecialchars($wkportdesc);?></option> <?php endforeach; ?> @@ -832,43 +832,43 @@ include("head.inc"); </tr> </table> <br /> - <span class="vexpl"><?=gettext("Specify the source port or port range for this rule. <b>This is usually <em>random</em> and almost never equal to the destination port range (and should usually be "any").</b> <br /> Hint: you can leave the <em>'to'</em> field empty if you only want to filter a single port.");?></span><br/> + <span class="vexpl"><?=gettext("Specify the source port or port range for this rule. <b>This is usually <em>random</em> and almost never equal to the destination port range (and should usually be "any").</b>")."<br />".gettext("Hint: you can leave the <em>'to'</em> field empty if you only want to filter a single port.");?></span><br/> </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Destination</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Destination");?></td> <td width="78%" class="vtable"> <input<?php echo ($edit_disabled===true?' DISABLED':''); ?> name="dstnot" type="checkbox" id="dstnot" value="yes" <?php if ($pconfig['dstnot']) echo "checked"; ?>> - <strong>not</strong> + <strong><?=gettext("not");?></strong> <br /> - Use this option to invert the sense of the match. + <?=gettext("Use this option to invert the sense of the match.");?> <br /> <br /> <table border="0" cellspacing="0" cellpadding="0"> <tr> - <td>Type: </td> + <td><?=gettext("Type");?>: </td> <td> <select<?php echo ($edit_disabled===true?' DISABLED':''); ?> name="dsttype" class="formselect" onChange="typesel_change()"> <?php $sel = is_specialnet($pconfig['dst']); ?> - <option value="any" <?php if ($pconfig['dst'] == "any") { echo "selected"; } ?>>any</option> - <option value="single" <?php if (($pconfig['dstmask'] == 32) && !$sel) { echo "selected"; $sel = 1; } ?>>Single host or alias</option> - <option value="network" <?php if (!$sel) echo "selected"; ?>>Network</option> + <option value="any" <?php if ($pconfig['dst'] == "any") { echo "selected"; } ?>><?=gettext("any");?></option> + <option value="single" <?php if (($pconfig['dstmask'] == 32) && !$sel) { echo "selected"; $sel = 1; } ?>><?=gettext("Single host or alias");?></option> + <option value="network" <?php if (!$sel) echo "selected"; ?>><?=gettext("Network");?></option> <?php if(have_ruleint_access("pptp")): ?> - <option value="pptp" <?php if ($pconfig['dst'] == "pptp") { echo "selected"; } ?>>PPTP clients</option> + <option value="pptp" <?php if ($pconfig['dst'] == "pptp") { echo "selected"; } ?>><?=gettext("PPTP clients");?></option> <?php endif; ?> <?php if(have_ruleint_access("pppoe")): ?> - <option value="pppoe" <?php if ($pconfig['dst'] == "pppoe") { echo "selected"; } ?>>PPPoE clients</option> + <option value="pppoe" <?php if ($pconfig['dst'] == "pppoe") { echo "selected"; } ?>><?=gettext("PPPoE clients");?></option> <?php endif; ?> <?php if(have_ruleint_access("l2tp")): ?> - <option value="l2tp" <?php if ($pconfig['dst'] == "l2tp") { echo "selected"; } ?>>L2TP clients</option> + <option value="l2tp" <?php if ($pconfig['dst'] == "l2tp") { echo "selected"; } ?>><?=gettext("L2TP clients");?></option> <?php endif; ?> <?php foreach ($ifdisp as $if => $ifdesc): ?> <?php if(have_ruleint_access($if)): ?> - <option value="<?=$if;?>" <?php if ($pconfig['dst'] == $if) { echo "selected"; } ?>><?=htmlspecialchars($ifdesc);?> subnet</option> + <option value="<?=$if;?>" <?php if ($pconfig['dst'] == $if) { echo "selected"; } ?>><?=htmlspecialchars($ifdesc);?> <?=gettext("subnet");?></option> <option value="<?=$if;?>ip"<?php if ($pconfig['dst'] == $if . "ip") { echo "selected"; } ?>> - <?=$ifdesc;?> address + <?=$ifdesc;?> <?=gettext("address");?> </option> <?php endif; ?> <?php endforeach; ?> @@ -876,7 +876,7 @@ include("head.inc"); </td> </tr> <tr> - <td>Address: </td> + <td><?=gettext("Address");?>: </td> <td> <input<?php echo ($edit_disabled===true?' DISABLED':''); ?> name="dst" type="text" class="formfldalias" id="dst" size="20" value="<?php if (!is_specialnet($pconfig['dst'])) echo htmlspecialchars($pconfig['dst']);?>"> / @@ -892,15 +892,15 @@ include("head.inc"); </td> </tr> <tr id="dprtr" name="dprtr"> - <td width="22%" valign="top" class="vncellreq">Destination port range </td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Destination port range ");?></td> <td width="78%" class="vtable"> <table border="0" cellspacing="0" cellpadding="0"> <tr> - <td>from: </td> + <td><?=gettext("from");?>: </td> <td> <select<?php echo ($edit_disabled===true?' DISABLED':''); ?> name="dstbeginport" class="formselect" onchange="dst_rep_change();ext_change()"> - <option value="">(other)</option> - <option value="any" <?php $bfound = 0; if ($pconfig['dstbeginport'] == "any") { echo "selected"; $bfound = 1; } ?>>any</option> + <option value="">(<?=gettext("other"); ?>)</option> + <option value="any" <?php $bfound = 0; if ($pconfig['dstbeginport'] == "any") { echo "selected"; $bfound = 1; } ?>><?=gettext("any");?></option> <?php foreach ($wkports as $wkport => $wkportdesc): ?> <option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['dstbeginport']) { echo "selected"; $bfound = 1; }?>><?=htmlspecialchars($wkportdesc);?></option> <?php endforeach; ?> @@ -909,11 +909,11 @@ include("head.inc"); </td> </tr> <tr> - <td>to:</td> + <td><?=gettext("to");?>:</td> <td> <select<?php echo ($edit_disabled===true?' DISABLED':''); ?> name="dstendport" class="formselect" onchange="ext_change()"> - <option value="">(other)</option> - <option value="any" <?php $bfound = 0; if ($pconfig['dstendport'] == "any") { echo "selected"; $bfound = 1; } ?>>any</option> + <option value="">(<?=gettext("other"); ?>)</option> + <option value="any" <?php $bfound = 0; if ($pconfig['dstendport'] == "any") { echo "selected"; $bfound = 1; } ?>><?=gettext("any");?></option> <?php foreach ($wkports as $wkport => $wkportdesc): ?> <option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['dstendport']) { echo "selected"; $bfound = 1; } ?>><?=htmlspecialchars($wkportdesc);?></option> <?php endforeach; ?> @@ -924,27 +924,27 @@ include("head.inc"); </table> <br /> <span class="vexpl"> - Specify the port or port range for the destination of the packet for this rule. + <?=gettext("Specify the port or port range for the destination of the packet for this rule.");?> <br /> - Hint: you can leave the <em>'to'</em> field empty if you only want to filter a single port + <?=gettext("Hint: you can leave the <em>'to'</em> field empty if you only want to filter a single port");?> </span> </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Log</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Log");?></td> <td width="78%" class="vtable"> <input name="log" type="checkbox" id="log" value="yes" <?php if ($pconfig['log']) echo "checked"; ?>> - <strong>Log packets that are handled by this rule</strong> + <strong><?=gettext("Log packets that are handled by this rule");?></strong> <br /> - <span class="vexpl">Hint: the firewall has limited local log space. Don't turn on logging for everything. If you want to do a lot of logging, consider using a remote syslog server (see the <a href="diag_logs_settings.php">Diagnostics: System logs: Settings</a> page).</span> + <span class="vexpl"><?=gettext("Hint: the firewall has limited local log space. Don't turn on logging for everything. If you want to do a lot of logging, consider using a remote syslog server (see the <a href="diag_logs_settings.php">Diagnostics: System logs: Settings</a> page).");?></span> </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">Description</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td> <td width="78%" class="vtable"> <input name="descr" type="text" class="formfld unknown" id="descr" size="52" maxlength="52" value="<?=htmlspecialchars($pconfig['descr']);?>"> <br /> - <span class="vexpl">You may enter a description here for your reference.</span> + <span class="vexpl"><?=gettext("You may enter a description here for your reference.");?></span> </td> </tr> <tr> @@ -962,20 +962,20 @@ include("head.inc"); <td> </td> </tr> <tr> - <td colspan="2" valign="top" class="listtopic">Advanced features</td> + <td colspan="2" valign="top" class="listtopic"><?=gettext("Advanced features");?></td> </tr> <tr> - <td width="22%" valign="top" class="vncell">Source OS</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Source OS");?></td> <td width="78%" class="vtable"> <div id="showadvsourceosbox" <? if ($pconfig['os']) echo "style='display:none'"; ?>> - <input type="button" onClick="show_advanced_sourceos()" value="Advanced"></input> - Show advanced option</a> + <input type="button" onClick="show_advanced_sourceos()" value="Advanced"></input> - <?=gettext("Show advanced option");?></a> </div> <div id="showsourceosadv" <? if (empty($pconfig['os'])) echo "style='display:none'"; ?>> - OS Type: + <?=gettext("OS Type");?>: <select name="os" id="os" class="formselect"> <?php $ostypes = array( - "" => "any", + "" => gettext("any"), "AIX" => "AIX", "Linux" => "Linux", "FreeBSD" => "FreeBSD", @@ -994,15 +994,15 @@ include("head.inc"); ?> </select> <br /> - Note: this only works for TCP rules + <?=gettext("Note: this only works for TCP rules");?> </div> </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">Diffserv Code Point</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Diffserv Code Point");?></td> <td width="78%" class="vtable"> <div id="dsadv" name="dsadv" <? if ($pconfig['dscp']) echo "style='display:none'"; ?>> - <input type="button" onClick="show_dsdiv();" value="Advanced"> - Show advanced option + <input type="button" onClick="show_dsdiv();" value="Advanced"> - <?=gettext("Show advanced option");?> </div> <div id="dsdivmain" name="dsdivmain" <? if (empty($pconfig['dscp'])) echo "style='display:none'"; ?>> <select name="dscp" id="dscp"> @@ -1015,10 +1015,10 @@ include("head.inc"); </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">Advanced Options</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Advanced Options");?></td> <td width="78%" class="vtable"> <div id="aoadv" name="aoadv"> - <input type="button" onClick="show_aodiv();" value="Advanced"> - Show advanced option + <input type="button" onClick="show_aodiv();" value="Advanced"> - <?=gettext("Show advanced option");?> </div> <div id="aodivmain" name="aodivmain" style="display:none"> <input type="checkbox" id="allowopts" value="yes" name="allowopts"<?php if($pconfig['allowopts'] == true) echo " checked"; ?>> @@ -1033,10 +1033,10 @@ include("head.inc"); <input name="tagged" id="tagged" value="<?=htmlspecialchars($pconfig['tagged']);?>"> <br /><span class="vexpl"><?=gettext("You can match packet on a mark placed before on another rule.")?> </span> <p> - <input name="max" id="max" value="<?php echo $pconfig['max'] ?>"><br> Maximum state entries this rule can create<p> - <input name="max-src-nodes" id="max-src-nodes" value="<?php echo $pconfig['max-src-nodes'] ?>"><br> Maximum number of unique source hosts<p> - <input name="max-src-conn" id="max-src-conn" value="<?php echo $pconfig['max-src-conn'] ?>"><br> Maximum number of established connections per host<p> - <input name="max-src-states" id="max-src-states" value="<?php echo $pconfig['max-src-states'] ?>"><br> Maximum state entries per host<p> + <input name="max" id="max" value="<?php echo $pconfig['max'] ?>"><br><?=gettext(" Maximum state entries this rule can create");?><p> + <input name="max-src-nodes" id="max-src-nodes" value="<?php echo $pconfig['max-src-nodes'] ?>"><br><?=gettext(" Maximum number of unique source hosts");?><p> + <input name="max-src-conn" id="max-src-conn" value="<?php echo $pconfig['max-src-conn'] ?>"><br><?=gettext(" Maximum number of established connections per host");?><p> + <input name="max-src-states" id="max-src-states" value="<?php echo $pconfig['max-src-states'] ?>"><br><?=gettext(" Maximum state entries per host");?><p> <input name="max-src-conn-rate" id="max-src-conn-rate" value="<?php echo $pconfig['max-src-conn-rate'] ?>"> / <select name="max-src-conn-rates" id="max-src-conn-rates"> <option value=""<?php if(intval($pconfig['max-src-conn-rates']) < 1) echo " selected"; ?>></option> @@ -1045,22 +1045,22 @@ include("head.inc"); echo "<option value=\"{$x}\"{$selected}>{$x}</option>\n"; } ?> </select><br /> - Maximum new connections / per second(s) + <?=gettext("Maximum new connections / per second(s)");?> <p> <input name="statetimeout" value="<?php echo $pconfig['statetimeout'] ?>"><br> - State Timeout in seconds + <?=gettext("State Timeout in seconds");?> <p /> - <p><strong>NOTE: Leave fields blank to disable that feature.</strong> + <p><strong><?=gettext("NOTE: Leave fields blank to disable that feature.");?></strong> </div> </td> </tr> <tr id="tcpflags" name="tcpflags"> - <td width="22%" valign="top" class="vncell">TCP flags</td> + <td width="22%" valign="top" class="vncell"><?=gettext("TCP flags");?></td> <td width="78%" class="vtable"> <div id="showtcpflagsbox" <? if ($pconfig['tcpflags_any'] || $pconfig['tcpflags1'] || $pconfig['tcpflags2']) echo "style='display:none'"; ?>> - <input type="button" onClick="show_advanced_tcpflags()" value="Advanced"></input> - Show advanced option</a> + <input type="button" onClick="show_advanced_tcpflags()" value="Advanced"></input> - <?=gettext("Show advanced option");?></a> </div> <div id="showtcpflagsadv" <? if (empty($pconfig['tcpflags_any']) && empty($pconfig['tcpflags1']) && empty($pconfig['tcpflags2'])) echo "style='display:none'"; ?>> <div id="tcpheader" name="tcpheader"> @@ -1091,46 +1091,46 @@ include("head.inc"); <center> </div> <br/><center> - <input onClick='tcpflags_anyclick(this);' type='checkbox' name='tcpflags_any' value='on' <?php if ($pconfig['tcpflags_any']) echo "checked"; ?>><strong>Any flags.</strong><br/></center> + <input onClick='tcpflags_anyclick(this);' type='checkbox' name='tcpflags_any' value='on' <?php if ($pconfig['tcpflags_any']) echo "checked"; ?>><strong><?=gettext("Any flags.");?></strong><br/></center> <br/> - <span class="vexpl">Use this to choose TCP flags that must - be set or cleared for this rule to match.</span> + <span class="vexpl"><?=gettext("Use this to choose TCP flags that must". + "be set or cleared for this rule to match.");?></span> </div> </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">State Type</td> + <td width="22%" valign="top" class="vncell"><?=gettext("State Type");?></td> <td width="78%" class="vtable"> <div id="showadvstatebox" <? if (!empty($pconfig['statetype']) && $pconfig['statetype'] != "keep state") echo "style='display:none'"; ?>> - <input type="button" onClick="show_advanced_state()" value="Advanced"></input> - Show advanced option</a> + <input type="button" onClick="show_advanced_state()" value="Advanced"></input> - <?=gettext("Show advanced option");?></a> </div> <div id="showstateadv" <? if (empty($pconfig['statetype']) || $pconfig['statetype'] == "keep state") echo "style='display:none'"; ?>> <select name="statetype"> - <option value="keep state" <?php if(!isset($pconfig['statetype']) or $pconfig['statetype'] == "keep state") echo "selected"; ?>>keep state</option> - <option value="sloppy state" <?php if($pconfig['statetype'] == "sloppy state") echo "selected"; ?>>sloppy state</option> - <option value="synproxy state"<?php if($pconfig['statetype'] == "synproxy state") echo "selected"; ?>>synproxy state</option> - <option value="none"<?php if($pconfig['statetype'] == "none") echo "selected"; ?>>none</option> - </select><br>HINT: Select which type of state tracking mechanism you would like to use. If in doubt, use keep state. + <option value="keep state" <?php if(!isset($pconfig['statetype']) or $pconfig['statetype'] == "keep state") echo "selected"; ?>><?=gettext("keep state");?></option> + <option value="sloppy state" <?php if($pconfig['statetype'] == "sloppy state") echo "selected"; ?>><?=gettext("sloppy state");?></option> + <option value="synproxy state"<?php if($pconfig['statetype'] == "synproxy state") echo "selected"; ?>><?=gettext("synproxy state");?></option> + <option value="none"<?php if($pconfig['statetype'] == "none") echo "selected"; ?>><?=gettext("none");?></option> + </select><br><?=gettext("HINT: Select which type of state tracking mechanism you would like to use. If in doubt, use keep state.");?> <p> <table width="90%"> - <tr><td width="25%"><ul><li>keep state</li></td><td>Works with all IP protocols.</ul></td></tr> - <tr><td width="25%"><ul><li>sloppy state</li></td><td>Works with all IP protocols.</ul></td></tr> - <tr><td width="25%"><ul><li>synproxy state</li></td><td>Proxies incoming TCP connections to help protect servers from spoofed TCP SYN floods. This option includes the functionality of keep state and modulate state combined.</ul></td></tr> - <tr><td width="25%"><ul><li>none</li></td><td>Do not use state mechanisms to keep track. This is only useful if you're doing advanced queueing in certain situations. Please check the documentation.</ul></td></tr> + <tr><td width="25%"><ul><li><?=gettext("keep state");?></li></td><td><?=gettext("Works with all IP protocols.");?></ul></td></tr> + <tr><td width="25%"><ul><li><?=gettext("sloppy state");?></li></td><td><?=gettext("Works with all IP protocols.");?></ul></td></tr> + <tr><td width="25%"><ul><li><?=gettext("synproxy state");?></li></td><td><?=gettext("Proxies incoming TCP connections to help protect servers from spoofed TCP SYN floods. This option includes the functionality of keep state and modulate state combined.");?></ul></td></tr> + <tr><td width="25%"><ul><li><?=gettext("none");?></li></td><td><?=gettext("Do not use state mechanisms to keep track. This is only useful if you're doing advanced queueing in certain situations. Please check the documentation.");?></ul></td></tr> </table> </p> </div> </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">No XMLRPC Sync</td> + <td width="22%" valign="top" class="vncell"><?=gettext("No XMLRPC Sync");?></td> <td width="78%" class="vtable"> <div id="showadvnoxmlrpcsyncbox" <? if ($pconfig['nosync']) echo "style='display:none'"; ?>> - <input type="button" onClick="show_advanced_noxmlrpc()" value="Advanced"></input> - Show advanced option</a> + <input type="button" onClick="show_advanced_noxmlrpc()" value="Advanced"></input> - <?=gettext("Show advanced option");?></a> </div> <div id="shownoxmlrpcadv" <? if (empty($pconfig['nosync'])) echo "style='display:none'"; ?>> <input type="checkbox" name="nosync"<?php if($pconfig['nosync']) echo " CHECKED"; ?>><br> - HINT: This prevents the rule from automatically syncing to other CARP members. + <?=gettext("HINT: This prevents the rule from automatically syncing to other CARP members.");?> </div> </td> </tr> @@ -1146,10 +1146,10 @@ include("head.inc"); } ?> <tr> - <td width="22%" valign="top" class="vncell">Schedule</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Schedule");?></td> <td width="78%" class="vtable"> <div id="showadvschedulebox" <? if (!empty($pconfig['sched'])) echo "style='display:none'"; ?>> - <input type="button" onClick="show_advanced_schedule()" value="Advanced"></input> - Show advanced option</a> + <input type="button" onClick="show_advanced_schedule()" value="Advanced"></input> - <?=gettext("Show advanced option");?></a> </div> <div id="showscheduleadv" <? if (empty($pconfig['sched'])) echo "style='display:none'"; ?>> <select name='sched'> @@ -1168,19 +1168,19 @@ include("head.inc"); } ?> </select> - <p>Leave as 'none' to leave the rule enabled all the time.</p> + <p><?=gettext("Leave as 'none' to leave the rule enabled all the time.");?></p> </div> </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">Gateway</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Gateway");?></td> <td width="78%" class="vtable"> <div id="showadvgatewaybox" <? if (!empty($pconfig['gateway'])) echo "style='display:none'"; ?>> - <input type="button" onClick="show_advanced_gateway()" value="Advanced"></input> - Show advanced option</a> + <input type="button" onClick="show_advanced_gateway()" value="Advanced"></input> - <?=gettext("Show advanced option");?></a> </div> <div id="showgatewayadv" <? if (empty($pconfig['gateway'])) echo "style='display:none'"; ?>> <select name='gateway'> - <option value="" >default</option> + <option value="" ><?=gettext("default");?></option> <?php /* build a list of gateways */ $gateways = return_gateways_array(); @@ -1209,15 +1209,15 @@ include("head.inc"); } ?> </select> - <p><strong>Leave as 'default' to use the system routing table. Or choose a gateway to utilize policy based routing.</strong></p> + <p><strong><?=gettext("Leave as 'default' to use the system routing table. Or choose a gateway to utilize policy based routing.");?></strong></p> </div> </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">In/Out</td> + <td width="22%" valign="top" class="vncell"><?=gettext("In/Out");?></td> <td width="78%" class="vtable"> <div id="showadvinoutbox" <? if (!empty($pconfig['dnpipe'])) echo "style='display:none'"; ?>> - <input type="button" onClick="show_advanced_inout()" value="Advanced"></input> - Show advanced option</a> + <input type="button" onClick="show_advanced_inout()" value="Advanced"></input> - <?=gettext("Show advanced option");?></a> </div> <div id="showinoutadv" <? if (empty($pconfig['dnpipe'])) echo "style='display:none'"; ?>> <select name="dnpipe"> @@ -1258,16 +1258,16 @@ include("head.inc"); ?> </select> <br /> - <span class="vexpl">Choose the Out queue/Virtual interface only if you have selected In too. <br/> The Out selection is applied to traffic going out the interface the rule is created, In is the incoming one. <br/> If you are creating a rule on the Floating tab if the direction is In then the same rules apply, if the direction is out the selections are reverted Out is for incoming and In is for outgoing and if you do not select any direction use only the In since the Out selection does not make sense in there to prevent oddities.</span> + <span class="vexpl"><?=gettext("Choose the Out queue/Virtual interface only if you have selected In too.")."<br/>".gettext("The Out selection is applied to traffic going out the interface the rule is created, In is the incoming one.")."<br/>".gettext("If you are creating a rule on the Floating tab if the direction is In then the same rules apply, if the direction is out the selections are reverted Out is for incoming and In is for outgoing and if you do not select any direction use only the In since the Out selection does not make sense in there to prevent oddities.");?></span> </div> </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">Ackqueue/Queue</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Ackqueue/Queue");?></td> <td width="78%" class="vtable"> <div id="showadvackqueuebox" <? if (!empty($pconfig['defaultqueue'])) echo "style='display:none'"; ?>> - <input type="button" onClick="show_advanced_ackqueue()" value="Advanced"></input> - Show advanced option</a> + <input type="button" onClick="show_advanced_ackqueue()" value="Advanced"></input> - <?=gettext("Show advanced option");?></a> </div> <div id="showackqueueadv" <? if (empty($pconfig['defaultqueue'])) echo "style='display:none'"; ?>> <select name="ackqueue"> @@ -1308,14 +1308,14 @@ include("head.inc"); ?> </select> <br /> - <span class="vexpl">Choose the Acknowledge Queue only if you have selected Queue.</span> + <span class="vexpl"><?=gettext("Choose the Acknowledge Queue only if you have selected Queue.");?></span> </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">Layer7</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Layer7");?></td> <td width="78%" class="vtable"> <div id="showadvlayer7box" <? if (!empty($pconfig['l7container'])) echo "style='display:none'"; ?>> - <input type="button" onClick="show_advanced_layer7()" value="Advanced"></input> - Show advanced option</a> + <input type="button" onClick="show_advanced_layer7()" value="Advanced"></input> - <?=gettext("Show advanced option");?></a> </div> <div id="showlayer7adv" <? if (empty($pconfig['l7container'])) echo "style='display:none'"; ?>> <select name="l7container"> @@ -1335,8 +1335,8 @@ include("head.inc"); </select> <br/> <span class="vexpl"> - Choose a Layer7 container to apply application protocol inspection rules. - These are valid for TCP and UDP protocols only. + <?=gettext("Choose a Layer7 container to apply application protocol inspection rules. + These are valid for TCP and UDP protocols only.");?> </span> </div> </td> diff --git a/usr/local/www/firewall_schedule.php b/usr/local/www/firewall_schedule.php index f204497..60ee732 100644 --- a/usr/local/www/firewall_schedule.php +++ b/usr/local/www/firewall_schedule.php @@ -39,10 +39,10 @@ ##|*MATCH=firewall_schedule.php* ##|-PRIV -$pgtitle = array("Firewall","Schedules"); +$pgtitle = array(gettext("Firewall"),gettext("Schedules")); -$dayArray = array ('Mon','Tues','Wed','Thur','Fri','Sat','Sun'); -$monthArray = array ('January','February','March','April','May','June','July','August','September','October','November','December'); +$dayArray = array (gettext('Mon'),gettext('Tues'),gettext('Wed'),gettext('Thur'),gettext('Fri'),gettext('Sat'),gettext('Sun')); +$monthArray = array (gettext('January'),gettext('February'),gettext('March'),gettext('April'),gettext('May'),gettext('June'),gettext('July'),gettext('August'),gettext('September'),gettext('October'),gettext('November'),gettext('December')); require("guiconfig.inc"); require("filter.inc"); @@ -73,7 +73,7 @@ if ($_GET['act'] == "del") { } if($is_schedule_referenced == true) { - $savemsg = "Cannot delete Schedule. Currently in use by {$referenced_by}"; + $savemsg = sprintf(gettext("Cannot delete Schedule. Currently in use by %s"),$referenced_by); } else { unset($a_schedules[$_GET['id']]); write_config(); @@ -92,9 +92,9 @@ include("head.inc"); <form action="firewall_schedule.php" method="post"> <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> - <td width="25%" class="listhdrr">Name</td> - <td width="35%" class="listhdrr">Time Range(s)</td> - <td width="35%" class="listhdr">Description</td> + <td width="25%" class="listhdrr"><?=gettext("Name");?></td> + <td width="35%" class="listhdrr"><?=gettext("Time Range(s)");?></td> + <td width="35%" class="listhdr"><?=gettext("Description");?></td> <td width="5%" class="list sort_ignore"> <table border="0" cellspacing="0" cellpadding="1"> <tr> @@ -110,7 +110,7 @@ include("head.inc"); <?=htmlspecialchars($schedule['name']); $schedstatus = filter_get_time_based_rule_status($schedule); if ($schedstatus) { ?> - <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_frmfld_time.png" title="Schedule is currently active" width="17" height="17" border="0"> + <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_frmfld_time.png" title="<?=gettext("Schedule is currently active");?>" width="17" height="17" border="0"> <?php } ?> </td> @@ -215,8 +215,8 @@ include("head.inc"); <td valign="middle" nowrap class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> - <td valign="middle"><a href="firewall_schedule_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="edit alias"></a></td> - <td><a href="firewall_schedule.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this schedule?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="delete alias"></a></td> + <td valign="middle"><a href="firewall_schedule_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="<?=gettext("edit alias");?>"></a></td> + <td><a href="firewall_schedule.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext('Do you really want to delete this schedule?');?>')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="<?=gettext("delete alias");?>"></a></td> </tr> </table> </td> @@ -235,7 +235,7 @@ include("head.inc"); </tr> <tr> <td class="tabcont" colspan="3"> - <p><span class="vexpl"><span class="red"><strong>Note:<br></strong></span>Schedules act as placeholders for time ranges to be used in Firewall Rules.</span></p> + <p><span class="vexpl"><span class="red"><strong><?=gettext("Note");?>:<br></strong></span><?=gettext("Schedules act as placeholders for time ranges to be used in Firewall Rules.");?></span></p> </td> </tr> </table> diff --git a/usr/local/www/firewall_schedule_edit.php b/usr/local/www/firewall_schedule_edit.php index 62f0d99..4f5264b 100644 --- a/usr/local/www/firewall_schedule_edit.php +++ b/usr/local/www/firewall_schedule_edit.php @@ -53,7 +53,7 @@ function schedule_sort(){ usort($config['schedules']['schedule'], "schedulecmp"); } -$pgtitle = array("Firewall","Schedules","Edit"); +$pgtitle = array(gettext("Firewall"),gettext("Schedules"),gettext("Edit")); require("guiconfig.inc"); require_once("functions.inc"); require_once("filter.inc"); @@ -65,8 +65,8 @@ $starttimemin = 00; $stoptimehr = 23; $stoptimemin = 59; -$dayArray = array ('Mon','Tues','Wed','Thur','Fri','Sat','Sun'); -$monthArray = array ('January','February','March','April','May','June','July','August','September','October','November','December'); +$dayArray = array (gettext('Mon'),gettext('Tues'),gettext('Wed'),gettext('Thur'),gettext('Fri'),gettext('Sat'),gettext('Sun')); +$monthArray = array (gettext('January'),gettext('February'),gettext('March'),gettext('April'),gettext('May'),gettext('June'),gettext('July'),gettext('August'),gettext('September'),gettext('October'),gettext('November'),gettext('December')); if (!is_array($config['schedules']['schedule'])) $config['schedules']['schedule'] = array(); @@ -89,18 +89,18 @@ if (isset($id) && $a_schedules[$id]) { if ($_POST) { if(strtolower($_POST['name']) == "lan") - $input_errors[] = "Schedule may not be named LAN."; + $input_errors[] = gettext("Schedule may not be named LAN."); if(strtolower($_POST['name']) == "wan") - $input_errors[] = "Schedule may not be named WAN."; + $input_errors[] = gettext("Schedule may not be named WAN."); if(strtolower($_POST['name']) == "") - $input_errors[] = "Schedule name cannot be blank."; + $input_errors[] = gettext("Schedule name cannot be blank."); $x = is_validaliasname($_POST['name']); if (!isset($x)) { - $input_errors[] = "Reserved word used for schedule name."; + $input_errors[] = gettext("Reserved word used for schedule name."); } else { if (is_validaliasname($_POST['name']) == false) - $input_errors[] = "The schedule name may only consist of the characters a-z, A-Z, 0-9"; + $input_errors[] = gettext("The schedule name may only consist of the characters a-z, A-Z, 0-9"); } /* check for name conflicts */ @@ -109,7 +109,7 @@ if ($_POST) { continue; if ($schedule['name'] == $_POST['name']) { - $input_errors[] = "A Schedule with this name already exists."; + $input_errors[] = gettext("A Schedule with this name already exists."); break; } } @@ -166,7 +166,7 @@ if ($_POST) { } if (!$timerangeFound) - $input_errors[] = "The schedule must have at least one time range configured."; + $input_errors[] = gettext("The schedule must have at least one time range configured."); if (!$input_errors) { @@ -766,33 +766,33 @@ EOD; <form action="firewall_schedule_edit.php" method="post" name="iform" id="iform"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> - <td colspan="2" valign="top" class="listtopic">Schedule information</td> + <td colspan="2" valign="top" class="listtopic"><?=gettext("Schedule information");?></td> </tr> <tr> <td> <table width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> - <td width="15%" valign="top" class="vncellreq">Schedule Name</td> + <td width="15%" valign="top" class="vncellreq"><?=gettext("Schedule Name");?></td> <td width="85%" class="vtable"> <?php if(is_schedule_inuse($pconfig['name']) == true): ?> <input name="name" type="hidden" id="name" size="40" value="<?=htmlspecialchars($pconfig['name']);?>" /> <?php echo $pconfig['name']; ?> <p> - <span class="vexpl">NOTE: This schedule is in use so the name may not be modified!</span> + <span class="vexpl"><?=gettext("NOTE: This schedule is in use so the name may not be modified!");?></span> </p> <?php else: ?> <input name="name" type="text" id="name" size="40" maxlength="40" class="formfld unknown" value="<?=htmlspecialchars($pconfig['name']);?>"><br> <span class="vexpl"> - The name of the alias may only consist of the characters a-z, A-Z and 0-9 + <?=gettext("The name of the alias may only consist of the characters a-z, A-Z and 0-9");?> </span> <?php endif; ?> </td> </tr> <tr> - <td width="15%" valign="top" class="vncell">Description</td> + <td width="15%" valign="top" class="vncell"><?=gettext("Description");?></td> <td width="85%" class="vtable"><input name="descr" type="text" id="descr" size="40" maxlength="40" class="formfld unknown" value="<?=htmlspecialchars($pconfig['descr']);?>"><br> <span class="vexpl"> - You may enter a description here for your reference (not parsed). + <?=gettext("You may enter a description here for your reference (not parsed).");?> </span> </td> @@ -800,7 +800,7 @@ EOD; <tr> </tr> <tr> - <td width="15%" valign="top" class="vncellreq">Month</td> + <td width="15%" valign="top" class="vncellreq"><?=gettext("Month");?></td> <td width="85%" class="vtable"> <select name="monthsel" class="formselect" id="monthsel" onchange="update_month();"> <?php @@ -842,13 +842,13 @@ EOD; <TR><TD COLSPAN="7" ALIGN=center class="listbg"><B><?php echo date("F Y", mktime(0, 0, 0, date($monthcounter), 1, date($yearcounter)));?></B></TD> </TR> <TR> - <TD ALIGN=center class="listhdrr" style="cursor: pointer;" onClick="daytoggle('w1p1');"><u><b>Mon</b></u></TD> - <TD ALIGN=center class="listhdrr" style="cursor: pointer;" onClick="daytoggle('w1p2');"><u><b>Tue</b></u></TD> - <TD ALIGN=center class="listhdrr" style="cursor: pointer;" onClick="daytoggle('w1p3');"><u><b>Wed</b></u></TD> - <TD ALIGN=center class="listhdrr" style="cursor: pointer;" onClick="daytoggle('w1p4');"><u><b>Thu</b></u></TD> - <TD ALIGN=center class="listhdrr" style="cursor: pointer;" onClick="daytoggle('w1p5');"><u><b>Fri</b></u></TD> - <TD ALIGN=center class="listhdrr" style="cursor: pointer;" onClick="daytoggle('w1p6');"><u><b>Sat</b></u></TD> - <TD ALIGN=center class="listhdrr" style="cursor: pointer;" onClick="daytoggle('w1p7');"><u><b>Sun</b></u></TD> + <TD ALIGN=center class="listhdrr" style="cursor: pointer;" onClick="daytoggle('w1p1');"><u><b><?=gettext("Mon");?></b></u></TD> + <TD ALIGN=center class="listhdrr" style="cursor: pointer;" onClick="daytoggle('w1p2');"><u><b><?=gettext("Tue");?></b></u></TD> + <TD ALIGN=center class="listhdrr" style="cursor: pointer;" onClick="daytoggle('w1p3');"><u><b><?=gettext("Wed");?></b></u></TD> + <TD ALIGN=center class="listhdrr" style="cursor: pointer;" onClick="daytoggle('w1p4');"><u><b><?=gettext("Thu");?></b></u></TD> + <TD ALIGN=center class="listhdrr" style="cursor: pointer;" onClick="daytoggle('w1p5');"><u><b><?=gettext("Fri");?></b></u></TD> + <TD ALIGN=center class="listhdrr" style="cursor: pointer;" onClick="daytoggle('w1p6');"><u><b><?=gettext("Sat");?></b></u></TD> + <TD ALIGN=center class="listhdrr" style="cursor: pointer;" onClick="daytoggle('w1p7');"><u><b><?=gettext("Sun");?></b></u></TD> </TR> <?php $firstmonth = FALSE; @@ -902,15 +902,15 @@ EOD; } //end for loop ?> <br/> - Click individual date to select that date only. Click the appropriate weekday Header to select all occurences of that weekday. + <?=gettext("Click individual date to select that date only. Click the appropriate weekday Header to select all occurences of that weekday.");?> </td> </tr> <tr> - <td width="15%" valign="top" class="vncellreq">Time</td> + <td width="15%" valign="top" class="vncellreq"><?=gettext("Time");?></td> <td width="85%" class="vtable"> <table cellspacing=2 class="tabcont"> <tr> - <td class="listhdrr" align="center">Start Time</td><td></td><td class="listhdrr" align="center">Stop Time</td> + <td class="listhdrr" align="center"><?=gettext("Start Time");?></td><td></td><td class="listhdrr" align="center"><?=gettext("Stop Time");?></td> </tr> <tr> <td> @@ -923,14 +923,14 @@ EOD; echo "</option>"; } ?> - </select> Hr + </select> <?=gettext("Hr"); ?> <select name="starttimemin" class="formselect" id="starttimemin"> <option value="00">00</option> <option value="15">15</option> <option value="30">30</option> <option value="45">45</option> <option value="59">59</option> - </select> Min + </select> <?=gettext("Min"); ?> </td> <td></td> <td> @@ -948,33 +948,33 @@ EOD; echo "</option>"; } ?> - </select> Hr + </select> <?=gettext("Hr");?> <select name="stoptimemin" class="formselect" id="stoptimemin"> <option value="00">00</option> <option value="15">15</option> <option value="30">30</option> <option value="45">45</option> <option value="59" SELECTED>59</option> - </select> Min + </select> <?=gettext("Min");?> </td> </tr> </table><br> - Select the time range for the day(s) selected on the Month(s) above. A full day is 0:00-23:59. + <?=gettext("Select the time range for the day(s) selected on the Month(s) above. A full day is 0:00-23:59.")?> </td> </tr> <tr> - <td width="15%" valign="top" class="vncell">Time Range Description</td> + <td width="15%" valign="top" class="vncell"><?=gettext("Time Range Description")?></td> <td width="85%" class="vtable"><input name="timerangedescr" type="text" class="formfld unknown" id="timerangedescr" size="40" maxlength="40"><br> <span class="vexpl"> - You may enter a description here for your reference (not parsed). + <?=gettext("You may enter a description here for your reference (not parsed).")?> </span> </td> </tr> <tr> <td width="22%" valign="top"> </td> <td width="78%"> - <input type="button" value="Add Time" class="formbtn" onclick="javascript:processEntries();"> - <input type="button" value="Clear Selection" class="formbtn" onclick="javascript:clearCalendar(); clearTime(); clearDescr();"> + <input type="button" value="<?=gettext("Add Time");?>" class="formbtn" onclick="javascript:processEntries();"> + <input type="button" value="<?=gettext("Clear Selection");?>" class="formbtn" onclick="javascript:clearCalendar(); clearTime(); clearDescr();"> </td> </tr> <tr> @@ -983,18 +983,18 @@ EOD; </td> </tr> <tr> - <td colspan="2" valign="top" class="listtopic">Schedule repeat</td> + <td colspan="2" valign="top" class="listtopic"><?=gettext("Schedule repeat");?></td> </tr> <tr> - <td width="15%" valign="top" class="vncellreq">Configured Ranges</td> + <td width="15%" valign="top" class="vncellreq"><?=gettext("Configured Ranges");?></td> <td width="85%"> <table id="scheduletable"> <tbody> <tr> - <TD ALIGN="center" class="listbg" width="35%">Day(s)</td> - <TD ALIGN="center" class="listbg" width="12%">Start Time</td> - <TD ALIGN="center" class="listbg" width="11%">Stop Time</td> - <TD ALIGN="center" class="listbg" width="42%">Description</td> + <TD ALIGN="center" class="listbg" width="35%"><?=gettext("Day(s)");?></td> + <TD ALIGN="center" class="listbg" width="12%"><?=gettext("Start Time");?></td> + <TD ALIGN="center" class="listbg" width="11%"><?=gettext("Stop Time");?></td> + <TD ALIGN="center" class="listbg" width="42%"><?=gettext("Description");?></td> </tr> <?php if ($getSchedule){ @@ -1152,8 +1152,8 @@ EOD; <tr> <td width="15%" valign="top"> </td> <td width="85%"> - <input id="submit" name="submit" type="submit" onclick="return checkForRanges();" class="formbtn" value="Save" /> - <input id="cancelbutton" name="cancelbutton" type="button" class="formbtn" value="Cancel" onclick="history.back()" /> + <input id="submit" name="submit" type="submit" onclick="return checkForRanges();" class="formbtn" value="<?=gettext("Save"); ?>" /> + <input id="cancelbutton" name="cancelbutton" type="button" class="formbtn" value="<?=gettext("Cancel"); ?>" onclick="history.back()" /> <?php if (isset($id) && $a_schedules[$id]): ?> <input name="id" type="hidden" value="<?=$id;?>" /> <?php endif; ?> diff --git a/usr/local/www/firewall_shaper.php b/usr/local/www/firewall_shaper.php index 6618389..d20d022 100755 --- a/usr/local/www/firewall_shaper.php +++ b/usr/local/www/firewall_shaper.php @@ -51,7 +51,7 @@ if($_GET['reset'] <> "") { exit; } -$pgtitle = array("Firewall","Traffic Shaper"); +$pgtitle = array(gettext("Firewall"),gettext("Traffic Shaper")); $statusurl = "status_queues.php"; $shaperIFlist = get_configured_interface_with_descr(); @@ -156,7 +156,7 @@ if ($_GET) { } else if ($addnewaltq) { $q = new altq_root_queue(); } else - $input_errors[] = "Could not create new queue/discipline!"; + $input_errors[] = gettext("Could not create new queue/discipline!"); if ($q) { $q->SetInterface($interface); @@ -172,7 +172,7 @@ if ($_GET) { if ($queue) $output_form .= $queue->build_form(); else - $input_errors[] = "Queue not found!"; + $input_errors[] = gettext("Queue not found!"); break; case "enable": if ($queue) { @@ -181,7 +181,7 @@ if ($_GET) { write_config(); mark_subsystem_dirty('shaper'); } else - $input_errors[] = "Queue not found!"; + $input_errors[] = gettext("Queue not found!"); break; case "disable": if ($queue) { @@ -190,7 +190,7 @@ if ($_GET) { write_config(); mark_subsystem_dirty('shaper'); } else - $input_errors[] = "Queue not found!"; + $input_errors[] = gettext("Queue not found!"); break; default: $output_form .= "<p class=\"pgtitle\">" . $default_shaper_msg."</p>"; @@ -363,9 +363,9 @@ if ($can_add || $addnewaltq) { $output_form .= "&action=delete\">"; $output_form .= "<input type=\"button\" class=\"formbtn\" name=\"delete\""; if ($queue) - $output_form .= " value=\"Delete this queue\">"; + $output_form .= " value=\"" . gettext("Delete this queue") . "\">"; else - $output_form .= " value=\"Disable shaper on interface\">"; + $output_form .= " value=\"" . gettext("Disable shaper on interface") . "\">"; $output_form .= "</a>"; } $output_form .= "</td></tr>"; @@ -402,17 +402,17 @@ include("fbegin.inc"); <?php if ($savemsg) print_info_box($savemsg); ?> <?php if (is_subsystem_dirty('shaper')): ?><p> -<?php print_info_box_np("The traffic shaper configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br> +<?php print_info_box_np(gettext("The traffic shaper configuration has been changed.")."<br>".gettext("You must apply the changes in order for them to take effect."));?><br> <?php endif; ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td> <?php $tab_array = array(); - $tab_array[0] = array("By Interface", true, "firewall_shaper.php"); - $tab_array[1] = array("By Queue", false, "firewall_shaper_queues.php"); - $tab_array[2] = array("Limiter", false, "firewall_shaper_vinterface.php"); - $tab_array[3] = array("Layer7", false, "firewall_shaper_layer7.php"); - $tab_array[4] = array("Wizards", false, "firewall_shaper_wizards.php"); + $tab_array[0] = array(gettext("By Interface"), true, "firewall_shaper.php"); + $tab_array[1] = array(gettext("By Queue"), false, "firewall_shaper_queues.php"); + $tab_array[2] = array(gettext("Limiter"), false, "firewall_shaper_vinterface.php"); + $tab_array[3] = array(gettext("Layer7"), false, "firewall_shaper_layer7.php"); + $tab_array[4] = array(gettext("Wizards"), false, "firewall_shaper_wizards.php"); display_top_tabs($tab_array); ?> </td></tr> @@ -423,7 +423,7 @@ include("fbegin.inc"); <?php if (count($altq_list_queues) > 0): ?> <tr class="tabcont"><td width="25%" align="left"> <a href="firewall_shaper.php?action=resetall" > - <input type="button" value="Remove Shaper" class="formbtn"> + <input type="button" value="<?=gettext("Remove Shaper")?>" class="formbtn"> </a> </td><td width="75%"> </td></tr> <? endif; ?> diff --git a/usr/local/www/firewall_shaper_layer7.php b/usr/local/www/firewall_shaper_layer7.php index 3e2dc22..2415fbd 100755 --- a/usr/local/www/firewall_shaper_layer7.php +++ b/usr/local/www/firewall_shaper_layer7.php @@ -56,14 +56,14 @@ $avail_behaviours_limiter = get_dummynet_name_list(); $show_proto_form = false; //More variables -$pgtitle = array("Firewall","Traffic Shaper", "Layer7"); +$pgtitle = array(gettext("Firewall"),gettext("Traffic Shaper"), gettext("Layer7")); $statusurl = "status_queues.php"; $output_form = ""; $default_layer7shaper_msg = "<tr><td colspan=\"4\">"; $default_layer7shaper_msg .= "<p><span class=\"vexpl\"><span class=\"red\"><strong>Note:<br>"; -$default_layer7shaper_msg .= "</strong></span>You can add new layer7 protocol patterns by simply uploading the file <a href=\"diag_patterns.php\">here.</a><br>"; +$default_layer7shaper_msg .= "</strong></span>" . gettext("You can add new layer7 protocol patterns by simply uploading the file") . " <a href=\"diag_patterns.php\">" . gettext("here") . ".</a><br>"; $default_layer7shaper_msg .= "</td></tr>"; @@ -109,7 +109,7 @@ if ($_GET) { } else { $show_proto_form = false; - $input_errors[] = "Layer7 Rules Container not found!"; + $input_errors[] = gettext("Layer7 Rules Container not found!"); } break; default: @@ -159,7 +159,7 @@ else if ($_POST) { } else { if(sizeof($dupes) > 0) { - $dupe_error = "Found the following repeated protocol definitions: "; + $dupe_error = gettext("Found the following repeated protocol definitions") . ": "; foreach($dupes as $dupe) $dupe_error .= "$dupe "; $input_errors[] .= $dupe_error; @@ -399,17 +399,17 @@ include("fbegin.inc"); <?php if ($savemsg) print_info_box($savemsg); ?> <?php if (is_subsystem_dirty('shaper')): ?><p> -<?php print_info_box_np("The traffic shaper configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br> +<?php print_info_box_np(gettext("The traffic shaper configuration has been changed") . ".<br>" . gettext("You must apply the changes in order for them to take effect."));?><br> <?php endif; ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td> <?php $tab_array = array(); - $tab_array[0] = array("By Interface", false, "firewall_shaper.php"); - $tab_array[1] = array("By Queue", false, "firewall_shaper_queues.php"); - $tab_array[2] = array("Limiter", false, "firewall_shaper_vinterface.php"); - $tab_array[3] = array("Layer7", true, "firewall_shaper_layer7.php"); - $tab_array[4] = array("Wizards", false, "firewall_shaper_wizards.php"); + $tab_array[0] = array(gettext("By Interface"), false, "firewall_shaper.php"); + $tab_array[1] = array(gettext("By Queue"), false, "firewall_shaper_queues.php"); + $tab_array[2] = array(gettext("Limiter"), false, "firewall_shaper_vinterface.php"); + $tab_array[3] = array(gettext("Layer7"), true, "firewall_shaper_layer7.php"); + $tab_array[4] = array(gettext("Wizards"), false, "firewall_shaper_wizards.php"); display_top_tabs($tab_array); ?> </td></tr> @@ -430,7 +430,7 @@ include("fbegin.inc"); ?> <br/><br/> <a href="firewall_shaper_layer7.php?action=add"> - <img src="./themes/<?=$g['theme']; ?>/images/icons/icon_plus.gif" title="Create new l7 rules group" width="17" height="17" border="0"> Create new l7 rules group + <img src="./themes/<?=$g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("Create new l7 rules group"); ?>" width="17" height="17" border="0"> <?=gettext("Create new l7 rules group"); ?> </a><br/> </td> <td width="75%" valign="top" align="center"> @@ -443,7 +443,7 @@ include("fbegin.inc"); <?php if($show_proto_form): ?> <td width = "22%" valign = "top" class = "vncellreq"> <div id = "addressnetworkport"> - Rule(s) + <?=gettext("Rule(s)"); ?> </div> </td> @@ -455,7 +455,7 @@ include("fbegin.inc"); <td colspan = "4"> <div style = "font-size: 8pt; padding:5px; margin-top: 16px; margin-bottom: 16px; border:1px dashed #000066;" id = "itemhelp"> - Add one or more rules + <?=gettext("Add one or more rules"); ?> </div> </td> </tr> @@ -464,21 +464,21 @@ include("fbegin.inc"); <td> <div style = "font-size: 8pt; padding:5px;" id = "onecolumn"> - Protocol + <?=gettext("Protocol"); ?> </div> </td> <td> <div style = "font-size: 8pt; padding:5px;" id = "twocolumn"> - Structure + <?=gettext("Structure"); ?> </div> </td> <td> <div style = "font-size: 8pt; padding:5px;" id = "threecolumn"> - Behaviour + <?=gettext("Behaviour"); ?> </div> </td> </tr> @@ -556,7 +556,7 @@ include("fbegin.inc"); <a onclick = "javascript:addRow('maintable'); return false;" href="#"> <img border = "0" src = "/themes/<?=$g['theme']; ?>/images/icons/icon_plus.gif" - alt = "" title = "add another entry" /> </a> + alt = "" title = "<?=gettext("add another entry"); ?>" /> </a> </td> </tr> @@ -567,14 +567,14 @@ include("fbegin.inc"); <td width = "78%"> <input id = "submit" - name = "submit" type = "submit" class = "formbtn" value = "Save" /> + name = "submit" type = "submit" class = "formbtn" value = "<?=gettext("Save"); ?>" /> <a href= "firewall_shaper_layer7.php"> <input id = "cancelbutton" - name = "cancelbutton" type = "button" class = "formbtn" value = "Cancel" /></a> + name = "cancelbutton" type = "button" class = "formbtn" value = "<?=gettext("Cancel"); ?>" /></a> <?php if($container): ?> - <input id = "delete" type="submit" class="formbtn" name="delete" value="Delete"></a> + <input id = "delete" type="submit" class="formbtn" name="delete" value="<?=gettext("Delete"); ?>"></a> <? endif ?> </td> </tr> diff --git a/usr/local/www/firewall_shaper_queues.php b/usr/local/www/firewall_shaper_queues.php index 35b6f21..ac3213a 100755 --- a/usr/local/www/firewall_shaper_queues.php +++ b/usr/local/www/firewall_shaper_queues.php @@ -169,7 +169,7 @@ if ($_POST['apply']) { clear_subsystem_dirty('shaper'); } -$pgtitle = "Firewall: Shaper: By Queues View"; +$pgtitle = gettext("Firewall: Shaper: By Queues View"); $statusurl = "status_queues.php"; include("head.inc"); @@ -184,17 +184,17 @@ include("head.inc"); <form action="firewall_shaper_queues.php" method="post" name="iform" id="iform"> <?php if ($savemsg) print_info_box($savemsg); ?> <?php if (is_subsystem_dirty('shaper')): ?><p> -<?php print_info_box_np("The traffic shaper configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br> +<?php print_info_box_np(gettext("The traffic shaper configuration has been changed") . ".<br>" . gettext("You must apply the changes in order for them to take effect."));?><br> <?php endif; ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td> <?php $tab_array = array(); - $tab_array[0] = array("By Interface", false, "firewall_shaper.php"); - $tab_array[1] = array("By Queue", true, "firewall_shaper_queues.php"); - $tab_array[2] = array("Limiter", false, "firewall_shaper_vinterface.php"); - $tab_array[3] = array("Layer7", false, "firewall_shaper_layer7.php"); - $tab_array[4] = array("Wizards", false, "firewall_shaper_wizards.php"); + $tab_array[0] = array(gettext("By Interface"), false, "firewall_shaper.php"); + $tab_array[1] = array(gettext("By Queue"), true, "firewall_shaper_queues.php"); + $tab_array[2] = array(gettext("Limiter"), false, "firewall_shaper_vinterface.php"); + $tab_array[3] = array(gettext("Layer7"), false, "firewall_shaper_layer7.php"); + $tab_array[4] = array(gettext("Wizards"), false, "firewall_shaper_wizards.php"); display_top_tabs($tab_array); ?> </td></tr> diff --git a/usr/local/www/firewall_shaper_vinterface.php b/usr/local/www/firewall_shaper_vinterface.php index b6c8c76..8405186 100644 --- a/usr/local/www/firewall_shaper_vinterface.php +++ b/usr/local/www/firewall_shaper_vinterface.php @@ -51,7 +51,7 @@ if($_GET['reset'] <> "") { exit; } -$pgtitle = array("Firewall","Traffic Shaper", "Limiter"); +$pgtitle = array(gettext("Firewall"),gettext("Traffic Shaper"), gettext("Limiter")); $statusurl = "status_queues.php"; read_dummynet_config(); @@ -142,7 +142,7 @@ if ($_GET) { $q = new dnpipe_class(); $q->SetQname($pipe); } else - $input_errors[] = "Could not create new queue/discipline!"; + $input_errors[] = gettext("Could not create new queue/discipline!"); if ($q) { $output_form .= $q->build_form(); @@ -154,7 +154,7 @@ if ($_GET) { if ($queue) $output_form .= $queue->build_form(); else - $input_errors[] = "Queue not found!"; + $input_errors[] = gettext("Queue not found!"); break; case "enable": if ($queue) { @@ -163,7 +163,7 @@ if ($_GET) { write_config(); mark_subsystem_dirty('shaper'); } else - $input_errors[] = "Queue not found!"; + $input_errors[] = gettext("Queue not found!"); break; case "disable": if ($queue) { @@ -172,7 +172,7 @@ if ($_GET) { write_config(); mark_subsystem_dirty('shaper'); } else - $input_errors[] = "Queue not found!"; + $input_errors[] = gettext("Queue not found!"); break; default: $output_form .= "<p class=\"pgtitle\">" . $dn_default_shaper_msg."</p>"; @@ -217,7 +217,7 @@ if ($_GET) { read_dummynet_config(); $output_form .= $tmp->build_form(); } else - $input_errors[] = "Could not add new queue."; + $input_errors[] = gettext("Could not add new queue."); } else if ($_POST['apply']) { write_config(); @@ -286,7 +286,7 @@ $tree .= "</ul>"; if (!$dontshow || $newqueue) { $output_form .= "<tr><td width=\"22%\" valign=\"top\" class=\"vncellreq\">"; -$output_form .= "Queue Actions"; +$output_form .= gettext("Queue Actions"); $output_form .= "</td><td valign=\"top\" class=\"vncellreq\" width=\"78%\">"; $output_form .= "<input type=\"submit\" name=\"Submit\" value=\"" . gettext("Save") . "\" class=\"formbtn\" />"; @@ -348,17 +348,17 @@ include("fbegin.inc"); <?php if ($savemsg) print_info_box($savemsg); ?> <?php if (is_subsystem_dirty('shaper')): ?><p> -<?php print_info_box_np("The traffic shaper configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br> +<?php print_info_box_np(gettext("The traffic shaper configuration has been changed.")."<br>".gettext("You must apply the changes in order for them to take effect."));?><br> <?php endif; ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td> <?php $tab_array = array(); - $tab_array[0] = array("By Interface", false, "firewall_shaper.php"); - $tab_array[1] = array("By Queue", false, "firewall_shaper_queues.php"); - $tab_array[2] = array("Limiter", true, "firewall_shaper_vinterface.php"); - $tab_array[3] = array("Layer7", false, "firewall_shaper_layer7.php"); - $tab_array[4] = array("Wizards", false, "firewall_shaper_wizards.php"); + $tab_array[0] = array(gettext("By Interface"), false, "firewall_shaper.php"); + $tab_array[1] = array(gettext("By Queue"), false, "firewall_shaper_queues.php"); + $tab_array[2] = array(gettext("Limiter"), true, "firewall_shaper_vinterface.php"); + $tab_array[3] = array(gettext("Layer7"), false, "firewall_shaper_layer7.php"); + $tab_array[4] = array(gettext("Wizards"), false, "firewall_shaper_wizards.php"); display_top_tabs($tab_array); ?> </td></tr> @@ -377,7 +377,7 @@ include("fbegin.inc"); ?> <br/><br/> <a href="firewall_shaper_vinterface.php?pipe=new&action=add"> - <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="Create new limiter" width="17" height="17" border="0"> Create new limiter + <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("Create new limiter");?>" width="17" height="17" border="0"><?=gettext("Create new limiter");?> </a><br/> </td> <td width="75%" valign="top" align="center"> diff --git a/usr/local/www/firewall_shaper_wizards.php b/usr/local/www/firewall_shaper_wizards.php index acd744c..ac6d00a 100755 --- a/usr/local/www/firewall_shaper_wizards.php +++ b/usr/local/www/firewall_shaper_wizards.php @@ -70,14 +70,14 @@ if ($_POST['apply']) { clear_subsystem_dirty('shaper'); } -$pgtitle = array("Firewall", "Traffic Shaper", "Wizards"); +$pgtitle = array(gettext("Firewall"),gettext("Traffic Shaper"),gettext("Wizards")); $statusurl = "status_queues.php"; -$wizards = array("Single Lan multi Wan" => "traffic_shaper_wizard.xml", - "Single Wan multi Lan" => "traffic_shaper_wizard_multi_lan.xml", - "Multiple Lan/Wan" => "traffic_shaper_wizard_multi_all.xml", - "Dedicated Links" => "traffic_shaper_wizard_dedicated.xml", - ); +$wizards = array(gettext("Single Lan multi Wan") => "traffic_shaper_wizard.xml", + gettext("Single Wan multi Lan") => "traffic_shaper_wizard_multi_lan.xml", + gettext("Multiple Lan/Wan") => "traffic_shaper_wizard_multi_all.xml", + gettext("Dedicated Links") => "traffic_shaper_wizard_dedicated.xml", + ); include("head.inc"); ?> @@ -93,17 +93,17 @@ include("fbegin.inc"); <?php if ($savemsg) print_info_box($savemsg); ?> <?php if (is_subsystem_dirty('shaper')): ?><p> -<?php print_info_box_np("The traffic shaper configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br> +<?php print_info_box_np(gettext("The traffic shaper configuration has been changed.")."<br>".gettext("You must apply the changes in order for them to take effect."));?><br> <?php endif; ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td> <?php $tab_array = array(); - $tab_array[0] = array("By Interface", false, "firewall_shaper.php"); - $tab_array[1] = array("By Queue", false, "firewall_shaper_queues.php"); - $tab_array[2] = array("Limiter", false, "firewall_shaper_vinterface.php"); - $tab_array[3] = array("Layer7", false, "firewall_shaper_layer7.php"); - $tab_array[4] = array("Wizards", true, "firewall_shaper_wizards.php"); + $tab_array[0] = array(gettext("By Interface"), false, "firewall_shaper.php"); + $tab_array[1] = array(gettext("By Queue"), false, "firewall_shaper_queues.php"); + $tab_array[2] = array(gettext("Limiter"), false, "firewall_shaper_vinterface.php"); + $tab_array[3] = array(gettext("Layer7"), false, "firewall_shaper_layer7.php"); + $tab_array[4] = array(gettext("Wizards"), true, "firewall_shaper_wizards.php"); display_top_tabs($tab_array); ?> </td></tr> @@ -112,8 +112,8 @@ include("fbegin.inc"); <div id="mainarea"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> - <td class="listhdrr" width="25%" align="center" >Wizard function</td> - <td class="listhdrr" width="75%" align="center">Wizard Link</td> + <td class="listhdrr" width="25%" align="center" ><?=gettext("Wizard function");?></td> + <td class="listhdrr" width="75%" align="center"><?=gettext("Wizard Link");?></td> </tr> <?php foreach ($wizards as $key => $wizard): ?> <tr class="tabcont"><td class="listlr" style="background-color: #e0e0e0" width="25%" align="center"> diff --git a/usr/local/www/firewall_virtual_ip.php b/usr/local/www/firewall_virtual_ip.php index f4b4567..01889f9 100755 --- a/usr/local/www/firewall_virtual_ip.php +++ b/usr/local/www/firewall_virtual_ip.php @@ -101,7 +101,7 @@ if ($_GET['act'] == "del") { foreach ($config['nat']['rule'] as $rule) { if($rule['destination']['address'] <> "") { if ($rule['destination']['address'] == $a_vip[$_GET['id']]['subnet']) { - $input_errors[] = "This entry cannot be deleted because it is still referenced by at least one NAT mapping."; + $input_errors[] = gettext("This entry cannot be deleted because it is still referenced by at least one NAT mapping."); break; } } @@ -128,7 +128,7 @@ if ($_GET['act'] == "del") { } else if ($_GET['changes'] == "mods") $id = $_GET['id']; -$pgtitle = array("Firewall","Virtual IP Addresses"); +$pgtitle = array(gettext("Firewall"),gettext("Virtual IP Addresses")); include("head.inc"); ?> @@ -143,7 +143,7 @@ include("head.inc"); print_info_box($savemsg); else if (is_subsystem_dirty('vip')) - print_info_box_np("The VIP configuration has been changed.<br>You must apply the changes in order for them to take effect."); + print_info_box_np(gettext("The VIP configuration has been changed.")."<br>".gettext("You must apply the changes in order for them to take effect.")); ?> <br> <table width="100%" border="0" cellpadding="0" cellspacing="0"> @@ -151,8 +151,8 @@ include("head.inc"); <?php /* active tabs */ $tab_array = array(); - $tab_array[] = array("Virtual IPs", true, "firewall_virtual_ip.php"); - $tab_array[] = array("CARP Settings", false, "pkg_edit.php?xml=carp_settings.xml&id=0"); + $tab_array[] = array(gettext("Virtual IPs"), true, "firewall_virtual_ip.php"); + $tab_array[] = array(gettext("CARP Settings"), false, "pkg_edit.php?xml=carp_settings.xml&id=0"); display_top_tabs($tab_array); ?> </td></tr> @@ -164,9 +164,9 @@ include("head.inc"); <div id="mainarea"> <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> - <td width="30%" class="listhdrr">Virtual IP address</td> - <td width="10%" class="listhdrr">Type</td> - <td width="40%" class="listhdr">Description</td> + <td width="30%" class="listhdrr"><?=gettext("Virtual IP address");?></td> + <td width="10%" class="listhdrr"><?=gettext("Type");?></td> + <td width="40%" class="listhdr"><?=gettext("Description");?></td> <td width="10%" class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> @@ -200,7 +200,7 @@ include("head.inc"); <table border="0" cellspacing="0" cellpadding="1"> <tr> <td valign="middle"><a href="firewall_virtual_ip_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td> - <td valign="middle"><a href="firewall_virtual_ip.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this entry?')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> + <td valign="middle"><a href="firewall_virtual_ip.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext('Do you really want to delete this entry?');?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> </tr> </table> </td> @@ -220,9 +220,9 @@ include("head.inc"); </tr> <tr> <td colspan="4"> - <p><span class="vexpl"><span class="red"><strong>Note:<br> - </strong></span>The virtual IP addresses defined on this page may be used in <a href="firewall_nat.php">NAT</a> mappings.<br> - You can check the status of your CARP Virtual IPs and interfaces <a href="carp_status.php">here</a>.</span></p> + <p><span class="vexpl"><span class="red"><strong><?=gettext("Note");?>:<br> + </strong></span><?=gettext("The virtual IP addresses defined on this page may be used in");?><a href="firewall_nat.php"> NAT </a><?=gettext("mappings.");?><br> + <?=gettext("You can check the status of your CARP Virtual IPs and interfaces ");?><a href="carp_status.php"><?=gettext("here");?></a>.</span></p> </td> </tr> </table> diff --git a/usr/local/www/firewall_virtual_ip_edit.php b/usr/local/www/firewall_virtual_ip_edit.php index 8970e33..198d563 100755 --- a/usr/local/www/firewall_virtual_ip_edit.php +++ b/usr/local/www/firewall_virtual_ip_edit.php @@ -101,20 +101,20 @@ if ($_POST) { /* input validation */ $reqdfields = explode(" ", "mode"); - $reqdfieldsn = explode(",", "Type"); + $reqdfieldsn = array(gettext("Type")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); if (($_POST['subnet'] && !is_ipaddr($_POST['subnet']))) - $input_errors[] = "A valid IP address must be specified."; + $input_errors[] = gettext("A valid IP address must be specified."); $natiflist = get_configured_interface_with_descr(); foreach ($natiflist as $natif => $natdescr) if ($_POST['subnet'] == get_interface_ip($natif)) - $input_errors[] = "The {$natdescr} IP address may not be used in a virtual entry."; + $input_errors[] = sprintf(gettext("The %s IP address may not be used in a virtual entry."),$natdescr); if($_POST['subnet_bits'] == "32" and $_POST['type'] == "carp") - $input_errors[] = "The /32 subnet mask is invalid for CARP IPs."; + $input_errors[] = gettext("The /32 subnet mask is invalid for CARP IPs."); /* check for overlaps with other virtual IP */ foreach ($a_vip as $vipent) { @@ -122,7 +122,7 @@ if ($_POST) { continue; if (isset($_POST['subnet']) && $_POST['subnet'] == $vipent['subnet']) { - $input_errors[] = "There is already a virtual IP entry for the specified IP address."; + $input_errors[] = gettext("There is already a virtual IP entry for the specified IP address."); break; } } @@ -135,19 +135,19 @@ if ($_POST) { $idtracker = 0; foreach($config['virtualip']['vip'] as $vip) { if($vip['vhid'] == $_POST['vhid'] and $idtracker <> $id) - $input_errors[] = "VHID {$_POST['vhid']} is already in use. Pick a unique number."; + $input_errors[] = sprintf(gettext("VHID %s is already in use. Pick a unique number."),$_POST['vhid']); $idtracker++; } if($_POST['password'] == "") - $input_errors[] = "You must specify a CARP password that is shared between the two VHID members."; + $input_errors[] = gettext("You must specify a CARP password that is shared between the two VHID members."); $parent_ip = get_interface_ip($_POST['interface']); $parent_sn = get_interface_subnet($_POST['interface']); if (!ip_in_subnet($_POST['subnet'], gen_subnet($parent_ip, $parent_sn) . "/" . $parent_sn)) { $cannot_find = $_POST['subnet'] . "/" . $_POST['subnet_bits'] ; - $input_errors[] = "Sorry, we could not locate an interface with a matching subnet for {$cannot_find}. Please add an IP alias in this subnet on this interface."; + $input_errors[] = sprintf(gettext("Sorry, we could not locate an interface with a matching subnet for %s. Please add an IP alias in this subnet on this interface."),$cannot_find); } else if ($parent_sn != $_POST['subnet_bits']) - $input_errors[] = "Subnet bits needs to be the same as the parent interface."; + $input_errors[] = gettext("Subnet bits needs to be the same as the parent interface."); if ($a_vip[$id]['vhid'] != $_POST['vhid']) interface_vip_bring_down($a_vip[$id]); @@ -229,7 +229,7 @@ if ($_POST) { } } -$pgtitle = array("Firewall","Virtual IP Address","Edit"); +$pgtitle = array(gettext("Firewall"),gettext("Virtual IP Address"),gettext("Edit")); include("head.inc"); ?> @@ -248,9 +248,9 @@ function get_radio_value(obj) } function enable_change(enable_over) { var note = document.getElementById("typenote"); - var carpnote = document.createTextNode("This must be the network's subnet mask. It does not specify a CIDR range."); - var proxyarpnote = document.createTextNode("This is a CIDR block of proxy ARP addresses."); - var ipaliasnote = document.createTextNode("This must be the network's subnet mask. It does not specify a CIDR range."); + var carpnote = document.createTextNode('<?=gettext("This must be the network's subnet mask. It does not specify a CIDR range.");?>'); + var proxyarpnote = document.createTextNode('<?=gettext("This is a CIDR block of proxy ARP addresses.");?>'); + var ipaliasnote = document.createTextNode('<?=gettext("This must be the network's subnet mask. It does not specify a CIDR range.");?>'); if ((get_radio_value(document.iform.mode) == "carp") || enable_over) { document.iform.vhid.disabled = 0; document.iform.password.disabled = 0; @@ -338,19 +338,19 @@ function typesel_change() { <form action="firewall_virtual_ip_edit.php" method="post" name="iform" id="iform"> <table width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> - <td colspan="2" valign="top" class="listtopic">Edit Virtual IP</td> + <td colspan="2" valign="top" class="listtopic"><?=gettext("Edit Virtual IP");?></td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Type</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Type");?></td> <td width="78%" class="vtable"> <input name="mode" type="radio" onclick="enable_change(false)" value="proxyarp" - <?php if ($pconfig['mode'] == "proxyarp" || $pconfig['type'] != "carp") echo "checked";?>> Proxy ARP + <?php if ($pconfig['mode'] == "proxyarp" || $pconfig['type'] != "carp") echo "checked";?>> <?=gettext("Proxy ARP"); ?> <input name="mode" type="radio" onclick="enable_change(false)" value="carp" - <?php if ($pconfig['mode'] == "carp") echo "checked";?>> CARP + <?php if ($pconfig['mode'] == "carp") echo "checked";?>> <?=gettext("CARP"); ?> <input name="mode" type="radio" onclick="enable_change(false)" value="other" - <?php if ($pconfig['mode'] == "other") echo "checked";?>> Other + <?php if ($pconfig['mode'] == "other") echo "checked";?>> <?=gettext("Other");?> <input name="mode" type="radio" onclick="enable_change(false)" value="ipalias" - <?php if ($pconfig['mode'] == "ipalias") echo "checked";?>> IP Alias + <?php if ($pconfig['mode'] == "ipalias") echo "checked";?>> <?=gettext("IP Alias");?> <?php /* <input name="mode" type="radio" onclick="enable_change(false)" value="carpdev-dhcp" @@ -361,7 +361,7 @@ function typesel_change() { </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Interface</td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Interface");?></td> <td width="78%" class="vtable"> <select name="interface" class="formselect"> <?php @@ -375,22 +375,22 @@ function typesel_change() { </td> </tr> <tr> - <td valign="top" class="vncellreq">IP Address(es)</td> + <td valign="top" class="vncellreq"><?=gettext("IP Address(es)");?></td> <td class="vtable"> <table border="0" cellspacing="0" cellpadding="0"> <tr> - <td>Type: </td> + <td><?=gettext("Type");?>: </td> <td><select name="type" class="formselect" onChange="typesel_change()"> <option value="single" <?php if ((!$pconfig['range'] && $pconfig['subnet_bits'] == 32) || (!isset($pconfig['subnet']))) echo "selected"; ?>> - Single address</option> + <?=gettext("Single address");?></option> <option value="network" <?php if (!$pconfig['range'] && $pconfig['subnet_bits'] != 32 && isset($pconfig['subnet'])) echo "selected"; ?>> - Network</option> + <?=gettext("Network");?></option> <!-- XXX: Billm, don't let anyone choose this until NAT configuration screens are ready for it <option value="range" <?php if ($pconfig['range']) echo "selected"; ?>> Range</option> --> </select></td> </tr> <tr> - <td>Address: </td> + <td><?=gettext("Address");?>: </td> <td><input name="subnet" type="text" class="formfld unknown" id="subnet" size="20" value="<?=htmlspecialchars($pconfig['subnet']);?>"> /<select name="subnet_bits" class="formselect" id="select"> <?php for ($i = 32; $i >= 1; $i--): ?> @@ -416,13 +416,13 @@ function typesel_change() { </td> </tr> <tr valign="top"> - <td width="22%" class="vncellreq">Virtual IP Password</td> + <td width="22%" class="vncellreq"><?=gettext("Virtual IP Password");?></td> <td class="vtable"><input type='password' name='password' value="<?=htmlspecialchars($pconfig['password']);?>"> - <br>Enter the VHID group password. + <br><?=gettext("Enter the VHID group password.");?> </td> </tr> <tr valign="top"> - <td width="22%" class="vncellreq">VHID Group</td> + <td width="22%" class="vncellreq"><?=gettext("VHID Group");?></td> <td class="vtable"><select id='vhid' name='vhid'> <?php for ($i = 1; $i <= 254; $i++): ?> <option value="<?=$i;?>" <?php if ($i == $pconfig['vhid']) echo "selected"; ?>> @@ -430,11 +430,11 @@ function typesel_change() { </option> <?php endfor; ?> </select> - <br>Enter the VHID group that the machines will share + <br><?=gettext("Enter the VHID group that the machines will share");?> </td> </tr> <tr valign="top"> - <td width="22%" class="vncellreq">Advertising Frequency</td> + <td width="22%" class="vncellreq"><?=gettext("Advertising Frequency");?></td> <td class="vtable"><select id='advskew' name='advskew'> <?php for ($i = 0; $i <= 254; $i++): ?> <option value="<?=$i;?>" <?php if ($i == $pconfig['advskew']) echo "selected"; ?>> @@ -442,19 +442,19 @@ function typesel_change() { </option> <?php endfor; ?> </select> - <br>The frequency that this machine will advertise. 0 = master. Anything above 0 designates a backup. + <br><?=gettext("The frequency that this machine will advertise. 0 = master. Anything above 0 designates a backup.");?> </td> </tr> <tr> - <td width="22%" valign="top" class="vncell">Description</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td> <td width="78%" class="vtable"> <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>"> - <br> <span class="vexpl">You may enter a description here for your reference (not parsed).</span></td> + <br> <span class="vexpl"><?=gettext("You may enter a description here for your reference (not parsed).");?></span></td> </tr> <tr> <td width="22%" valign="top"> </td> <td width="78%"> - <input name="Submit" type="submit" class="formbtn" value="Save"> <input type="button" class="formbtn" value="Cancel" onclick="history.back()"> + <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>"> <input type="button" class="formbtn" value="<?=gettext("Cancel"); ?>" onclick="history.back()"> <?php if (isset($id) && $a_vip[$id]): ?> <input name="id" type="hidden" value="<?=$id;?>"> <?php endif; ?> @@ -465,10 +465,10 @@ function typesel_change() { <p> <span class="vexpl"> <span class="red"> - <strong>Note:<br></strong> + <b><?=gettext("Note");?>:<br></b> </span> - ProxyARP type IP addresses *DO NOT* work with add on packages such as Squid. Use a CARP or IP Alias type address for these cases. - <p> For more information on CARP and the above values, visit the OpenBSD <a href='http://www.openbsd.org/faq/pf/carp.html'>CARP FAQ</A>. + <?=gettext("ProxyARP type IP addresses *DO NOT* work with add on packages such as Squid. Use a CARP or IP Alias type address for these cases.");?> + <p> <?=gettext("For more information on CARP and the above values, visit the OpenBSD ");?><a href='http://www.openbsd.org/faq/pf/carp.html'> CARP FAQ</A>. </span> </p> </td> |