diff options
author | Jeann <wjeann@gmail.com> | 2010-06-28 23:19:56 -0300 |
---|---|---|
committer | Jeann <wjeann@gmail.com> | 2010-06-28 23:19:56 -0300 |
commit | 1baff2e5d32ebb5a71b07f38d9f97e3c4788e3be (patch) | |
tree | e4997633b7ee2ee5b2acbb919c70181f5c47cc57 /usr/local/www | |
parent | eaed8f3dc1acefedc77f830cddf0243ebcec3e3a (diff) | |
download | pfsense-1baff2e5d32ebb5a71b07f38d9f97e3c4788e3be.zip pfsense-1baff2e5d32ebb5a71b07f38d9f97e3c4788e3be.tar.gz |
Implemment gettext()
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/firewall_nat_edit.php | 6 | ||||
-rwxr-xr-x | usr/local/www/firewall_nat_out.php | 60 | ||||
-rwxr-xr-x | usr/local/www/firewall_nat_out_edit.php | 78 |
3 files changed, 72 insertions, 72 deletions
diff --git a/usr/local/www/firewall_nat_edit.php b/usr/local/www/firewall_nat_edit.php index 73e0084..93210e9 100755 --- a/usr/local/www/firewall_nat_edit.php +++ b/usr/local/www/firewall_nat_edit.php @@ -515,13 +515,13 @@ include("fbegin.inc"); ?> <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 <?=gettext("clients"); ?></option> + <option value="pptp" <?php if ($pconfig['src'] == "pptp") { echo gettext("selected"); } ?>>PPTP <?=gettext("clients"); ?></option> <?php endif; ?> <?php if(have_ruleint_access("pppoe")): ?> - <option value="pppoe" <?php if ($pconfig['src'] == "pppoe") { echo "selected"; } ?>>PPPoE <?=gettext("clients"); ?></option> + <option value="pppoe" <?php if ($pconfig['src'] == "pppoe") { echo gettext("selected"); } ?>>PPPoE <?=gettext("clients"); ?></option> <?php endif; ?> <?php if(have_ruleint_access("l2tp")): ?> - <option value="l2tp" <?php if ($pconfig['src'] == "l2tp") { echo "selected"; } ?>>L2TP <?=gettext("clients"); ?></option> + <option value="l2tp" <?php if ($pconfig['src'] == "l2tp") { echo gettext("selected"); } ?>>L2TP <?=gettext("clients"); ?></option> <?php endif; ?> <?php foreach ($ifdisp as $ifent => $ifdesc): ?> diff --git a/usr/local/www/firewall_nat_out.php b/usr/local/www/firewall_nat_out.php index c4f21c1..9017bee 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'] = gettext("Auto created rule for ISAKMP - {$ifdesc} to {$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'] = gettext("Auto created rule for SIP - {$ifdesc} to {$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'] = gettext("Auto created rule for {$ifdesc} to {$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; } @@ -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> @@ -323,15 +323,15 @@ include("head.inc"); </tr> <tr> <td colspan="2"><p><span class="vexpl"><span class="red"><strong>Note:<br> - </strong></span>If advanced outbound NAT is enabled, no outbound NAT - rules will be automatically generated any longer. Instead, only the mappings - you specify below will be used. With advanced outbound NAT disabled, + </strong></span>gettext("If advanced outbound NAT is enabled, no outbound NAT + rules will be automatically generated any longer.") gettext("Instead, only the mappings + you specify below will be used.") gettext("With advanced outbound NAT disabled, a mapping is automatically created for each interface's subnet - (except WAN). If you use target addresses other than the WAN interface's + (except WAN).") gettext("If you use target addresses other than the WAN interface's IP address, then depending on the way your WAN connection is setup, you - may also need a <a href="firewall_virtual_ip.php">Virtual IP</a>.</span><br> + may also need a") <a href="firewall_virtual_ip.php">gettext("Virtual IP")</a>.</span><br> <br> - You may enter your own mappings below.</p> + gettext("You may enter your own mappings below.")</p> </td> </tr> </table> @@ -339,20 +339,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> @@ -437,7 +437,7 @@ include("head.inc"); <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> </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><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="add a new nat based on this one" width="17" height="17" border="0"></a></td> </tr> </table> @@ -447,11 +447,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><?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="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="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 df0487f..5b22a00 100755 --- a/usr/local/www/firewall_nat_out_edit.php +++ b/usr/local/www/firewall_nat_out_edit.php @@ -108,51 +108,51 @@ if ($_POST) { $pconfig = $_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"); + $reqdfields = explode(" ", gettext("interface protocol source source_subnet destination destination_subnet")); + $reqdfieldsn = explode(",", gettext("Interface,Protocol,Source,Source bit count,Destination,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","NAT","Outbound","Edit")); $closehead = false; include("head.inc"); @@ -304,14 +304,14 @@ 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="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> @@ -325,8 +325,8 @@ 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> @@ -336,8 +336,8 @@ function sourcesel_change() { 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 /> + gettext("Hint: in most cases, you should specify <em>any</em> here.")</span> </td> </tr> <tr> @@ -355,13 +355,13 @@ function sourcesel_change() { <td>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> + <option value="<?=$i;?>"<?php if ($i == $pconfig['source_subnet']) echo "selected"; ?>><?=$i;?></option> <?php endfor; ?> </select></td> </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> @@ -371,11 +371,11 @@ blank for any)</td> </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> + gettext("Use this option to invert the sense of the match.")<br> <br> <table border="0" cellspacing="1" cellpadding="1"> <tr> @@ -399,8 +399,8 @@ 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> @@ -411,13 +411,13 @@ any)</td> </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><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"): @@ -440,10 +440,10 @@ any)</td> </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, + select it here (you need to define <a href="firewall_virtual_ip.php">Virtual IP</a> 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> @@ -451,7 +451,7 @@ any)</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> @@ -461,18 +461,18 @@ any)</td> </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> |