diff options
author | groo <ericitaquera@gmail.com> | 2010-06-30 18:00:14 -0300 |
---|---|---|
committer | groo <ericitaquera@gmail.com> | 2010-06-30 18:00:59 -0300 |
commit | 8cc6876f823744433e3c8200ae2259d97227a0a3 (patch) | |
tree | 7bbf80277b8e1dc0433346555ee1f98ef6af8623 /usr/local/www | |
parent | cbdc84eaf81245fc1691893cf8f33876a8e81831 (diff) | |
download | pfsense-8cc6876f823744433e3c8200ae2259d97227a0a3.zip pfsense-8cc6876f823744433e3c8200ae2259d97227a0a3.tar.gz |
Implement gettext() calls on interfaces.php and interfaces_assign.php
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/interfaces.php | 30 | ||||
-rwxr-xr-x | usr/local/www/interfaces_assign.php | 44 |
2 files changed, 37 insertions, 37 deletions
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 4d6283b..9ed372b 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -177,7 +177,7 @@ $pconfig['enable'] = isset($wancfg['enable']); if (is_array($config['aliases']['alias'])) { foreach($config['aliases']['alias'] as $alias) { if($alias['name'] == $wancfg['descr']) { - $input_errors[] = gettext("Sorry, an alias with the name {$wancfg['descr']} already exists."); + $input_errors[] = sprintf(gettext("Sorry, an alias with the name '%s' already exists."),$wancfg['descr']); } } } @@ -355,31 +355,31 @@ if ($_POST) { switch($_POST['type']) { case "static": $reqdfields = explode(" ", "ipaddr subnet gateway"); - $reqdfieldsn = explode(",", "IP address,Subnet bit count,Gateway"); + $reqdfieldsn = array(gettext("IP address"),gettext("Subnet bit count"),gettext("Gateway")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); break; case "ppp": $reqdfields = explode(" ", "port phone"); - $reqdfieldsn = explode(",", "Modem Port,Phone Number"); + $reqdfieldsn = array(gettext("Modem Port"),gettext("Phone Number")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); break; case "PPPoE": if ($_POST['pppoe_dialondemand']) { $reqdfields = explode(" ", "pppoe_username pppoe_password pppoe_dialondemand pppoe_idletimeout"); - $reqdfieldsn = explode(",", "PPPoE username,PPPoE password,Dial on demand,Idle timeout value"); + $reqdfieldsn = array(gettext("PPPoE username"),gettext("PPPoE password"),gettext("Dial on demand"),gettext("Idle timeout value")); } else { $reqdfields = explode(" ", "pppoe_username pppoe_password"); - $reqdfieldsn = explode(",", "PPPoE username,PPPoE password"); + $reqdfieldsn = array(gettext("PPPoE username"),gettext("PPPoE password")); } do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); break; case "PPTP": if ($_POST['pptp_dialondemand']) { $reqdfields = explode(" ", "pptp_username pptp_password pptp_local pptp_subnet pptp_remote pptp_dialondemand pptp_idletimeout"); - $reqdfieldsn = explode(",", "PPTP username,PPTP password,PPTP local IP address,PPTP subnet,PPTP remote IP address,Dial on demand,Idle timeout value"); + $reqdfieldsn = array(gettext("PPTP username"),gettext("PPTP password"),gettext("PPTP local IP address"),gettext("PPTP subnet"),gettext("PPTP remote IP address"),gettext("Dial on demand"),gettext("Idle timeout value")); } else { $reqdfields = explode(" ", "pptp_username pptp_password pptp_local pptp_subnet pptp_remote"); - $reqdfieldsn = explode(",", "PPTP username,PPTP password,PPTP local IP address,PPTP subnet,PPTP remote IP address"); + $reqdfieldsn = array(gettext("PPTP username"),gettext("PPTP password"),gettext("PPTP local IP address"),gettext("PPTP subnet"),gettext("PPTP remote IP address")); } do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); break; @@ -433,7 +433,7 @@ if ($_POST) { /* Wireless interface? */ if (isset($wancfg['wireless'])) { $reqdfields = explode(" ", "mode ssid"); - $reqdfieldsn = explode(",", "Mode,SSID"); + $reqdfieldsn = array(gettext("Mode"),gettext("SSID")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); check_wireless_mode(); /* loop through keys and enforce size */ @@ -803,7 +803,7 @@ function check_wireless_mode() { } } -$pgtitle = array("Interfaces", $pconfig['descr']); +$pgtitle = array(gettext("Interfaces"),sprintf(gettext("'%s'"),$pconfig['descr'])); $statusurl = "status_interfaces.php"; $closehead = false; @@ -973,7 +973,7 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "ppp" = <form action="interfaces.php" method="post" name="iform" id="iform"> <?php if ($input_errors) print_input_errors($input_errors); ?> <?php if (is_subsystem_dirty('interfaces')): ?><p> - <?php print_info_box_np(gettext("The {$wancfg['descr']} configuration has been changed.<p>You must apply the changes in order for them to take effect.<p>Don't forget to adjust the DHCP Server range if needed after applying."));?><br /> + <?php print_info_box_np(printf(gettext("The '%s' configuration has been changed."),$wancfg['descr'])."<p>".gettext("You must apply the changes in order for them to take effect.")."<p>".gettext("Don't forget to adjust the DHCP Server range if needed after applying."));?><br /> <?php endif; ?> <?php if ($savemsg) print_info_box($savemsg); ?> <table width="100%" border="0" cellpadding="6" cellspacing="0"> @@ -998,7 +998,7 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "ppp" = <td width="22%" valign="top" class="vncell">Description</td> <td width="78%" class="vtable"> <input name="descr" type="text" class="formfld unknown" id="descr" size="30" value="<?=htmlspecialchars($pconfig['descr']);?>"> - <br><span class="vexpl">Enter a description (name) for the interface here.</span> + <br><span class="vexpl"><?= gettext("Enter a description (name) for the interface here."); ?></span> </td> </tr> <tr> @@ -1311,7 +1311,7 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "ppp" = <tr> <td width="22%" valign="top" class="vncell">Service name</td> <td width="78%" class="vtable"><input name="provider" type="text" class="formfld unknown" id="provider" size="20" value="<?=htmlspecialchars($pconfig['provider']);?>"> - <br> <span class="vexpl">Hint: this field can usually be left empty</span> + <br> <span class="vexpl"><?= gettext("Hint: this field can usually be left empty"); ?></span> </td> </tr> <tr> @@ -1353,7 +1353,7 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "ppp" = <input name="pppoe_resetdate" type="text" class="w8em format-m-d-y highlight-days-67" id="pppoe_resetdate" maxlength="10" size="10" value="<?=htmlspecialchars($pconfig['pppoe_resetdate']);?>" /> <?= gettext("reset at a specific date (mm/dd/yyyy)"); ?> <br /> <br /> - <span class="red"><strong>Note: </strong></span> + <span class="red"><strong><?= gettext("Note"); ?>: </strong></span> <?= gettext("If you leave the date field empty, the reset will be executed each day at the time you did specify using the minutes and hour field."); ?> </p> <?php if ($pconfig['pppoe_pr_preset']): ?> @@ -1823,7 +1823,7 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "ppp" = <td class="vtable"> <input name="ieee8021x" type="checkbox" value="yes" class="formfld" id="ieee8021x" <? if ($pconfig['ieee8021x']) echo "checked";?>> <br/>Setting this option will enable 802.1x authentication. - <br/><span class="red"><strong>NOTE:</strong</span> this option requires checking the "Enable WPA box". + <br/><span class="red"><strong><?= gettext("NOTE"); ?>:</strong</span> this option requires checking the "Enable WPA box". </td> </tr> <tr> @@ -1888,7 +1888,7 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "ppp" = </td> <td> <br/> - <input id="save" name="Submit" type="submit" class="formbtn" value="Save"> + <input id="save" name="Submit" type="submit" class="formbtn" value="<?= gettext("Save"); ?>"> <input id="cancel" type="button" class="formbtn" value="Cancel" onclick="history.back()"> <input name="if" type="hidden" id="if" value="<?=$if;?>"> <?php if ($wancfg['if'] == $a_ppps[$pppid]['if']) : ?> diff --git a/usr/local/www/interfaces_assign.php b/usr/local/www/interfaces_assign.php index 2c38e80..28349fa 100755 --- a/usr/local/www/interfaces_assign.php +++ b/usr/local/www/interfaces_assign.php @@ -40,7 +40,7 @@ ##|*MATCH=interfaces_assign.php* ##|-PRIV -$pgtitle = array("Interfaces", "Assign network ports"); +$pgtitle = array(gettext("Interfaces"),gettext("Assign network ports")); $statusurl = "status_interfaces.php"; require("guiconfig.inc"); @@ -182,9 +182,9 @@ if ($_POST['apply']) { /* Deliver error message for any port with more than one assignment */ foreach ($portifmap as $portname => $ifnames) { if (count($ifnames) > 1) { - $errstr = "Port " . $portname . - " was assigned to " . count($ifnames) . - " interfaces:"; + $errstr = sprintf(gettext("Port '%s' ". + " was assigned to '%s'" . + " interfaces:"), $portname, count($ifnames)); foreach ($portifmap[$portname] as $ifn) $errstr .= " " . $ifn; @@ -246,11 +246,11 @@ if ($_GET['act'] == "del") { $id = $_GET['id']; if (link_interface_to_bridge($id)) - $input_errors[] = "The interface is part of a bridge. Please remove it from the bridge to continue"; + $input_errors[] = gettext("The interface is part of a bridge. Please remove it from the bridge to continue"); else if (link_interface_to_gre($id)) - $input_errors[] = "The interface is part of a gre tunnel. Please delete the tunnel to continue"; + $input_errors[] = gettext("The interface is part of a gre tunnel. Please delete the tunnel to continue"); else if (link_interface_to_gif($id)) - $input_errors[] = "The interface is part of a gif tunnel. Please delete the tunnel to continue"; + $input_errors[] = gettext("The interface is part of a gif tunnel. Please delete the tunnel to continue"); else { unset($config['interfaces'][$id]['enable']); $realid = get_real_interface($id); @@ -300,15 +300,15 @@ if ($_GET['act'] == "del") { link_interface_to_vlans($realid, "update"); - $savemsg = "Interface has been deleted."; + $savemsg = gettext("Interface has been deleted."); } } if ($_GET['act'] == "add") { /* find next free optional interface number */ if(!$config['interfaces']['lan']) { - $newifname = "lan"; - $descr = "LAN"; + $newifname = gettext("lan"); + $descr = gettext("LAN"); $config['interfaces'][$newifname] = array(); $config['interfaces'][$newifname]['descr'] = $descr; } else { @@ -317,7 +317,7 @@ if ($_GET['act'] == "add") { break; } $newifname = 'opt' . $i; - $descr = "OPT{$i}"; + $descr = sprintf(gettext("OPT '%s'"),$i); $config['interfaces'][$newifname] = array(); $config['interfaces'][$newifname]['descr'] = $descr; } @@ -348,7 +348,7 @@ if ($_GET['act'] == "add") { write_config(); - $savemsg = "Interface has been added."; + $savemsg = gettext("Interface has been added."); } @@ -371,9 +371,9 @@ include("head.inc"); if(file_exists("/var/run/interface_mismatch_reboot_needed")) if ($_POST) - $savemsg = "Reboot is needed. Please apply the settings in order to reboot."; + $savemsg = gettext("Reboot is needed. Please apply the settings in order to reboot."); else - $savemsg = "Interface mismatch detected. Please resolve the mismatch and click Save. The firewall will reboot afterwards."; + $savemsg = gettext("Interface mismatch detected. Please resolve the mismatch and click Save. The firewall will reboot afterwards."); ?> @@ -429,7 +429,7 @@ if(file_exists("/var/run/interface_mismatch_reboot_needed")) <?php foreach ($portlist as $portname => $portinfo): ?> <option value="<?=$portname;?>" <?php if ($portname == $iface['if']) echo " selected";?>> <?php if ($portinfo['isvlan']) { - $descr = "VLAN {$portinfo['tag']} on {$portinfo['if']}"; + $descr = sprintf(gettext("VLAN '%s' on '%s'"),$portinfo['tag'],$portinfo['if']); if ($portinfo['descr']) $descr .= " (" . $portinfo['descr'] . ")"; echo htmlspecialchars($descr); @@ -470,7 +470,7 @@ if(file_exists("/var/run/interface_mismatch_reboot_needed")) </td> <td valign="middle" class="list"> <?php if ($ifname != 'wan'): ?> - <a href="interfaces_assign.php?act=del&id=<?=$ifname;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="delete interface" width="17" height="17" border="0"></a> + <a href="interfaces_assign.php?act=del&id=<?=$ifname;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title=<?=gettext("delete interface"); ?> width="17" height="17" border="0"></a> <?php endif; ?> </td> </tr> @@ -479,7 +479,7 @@ if(file_exists("/var/run/interface_mismatch_reboot_needed")) <tr> <td class="list" colspan="2"></td> <td class="list" nowrap> - <a href="interfaces_assign.php?act=add"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="add interface" width="17" height="17" border="0"></a> + <a href="interfaces_assign.php?act=add"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title=<?=gettext("add interface"); ?> width="17" height="17" border="0"></a> </td> </tr> <?php else: ?> @@ -490,14 +490,14 @@ if(file_exists("/var/run/interface_mismatch_reboot_needed")) </table> </div> <br/> -<input name="Submit" type="submit" class="formbtn" value="Save"><br><br> +<input name="Submit" type="submit" class="formbtn" value=<?=gettext("Save"); ?>><br><br> <p> </p> <ul> - <li><span class="vexpl">change the IP address of your computer</span></li> - <li><span class="vexpl">renew its DHCP lease</span></li> - <li><span class="vexpl">access the webConfigurator with the new IP address</span></li> - <li><span class="vexpl">interfaces that are configured as members of a lagg(4) interface will not be shown.</span></li> + <li><span class="vexpl"><?=gettext("change the IP address of your computer"); ?></span></li> + <li><span class="vexpl"><?=gettext("renew its DHCP lease"); ?></span></li> + <li><span class="vexpl"><?=gettext("access the webConfigurator with the new IP address"); ?></span></li> + <li><span class="vexpl"><?=gettext("interfaces that are configured as members of a lagg(4) interface will not be shown."); ?></span></li> </ul></td> </tr> </table> |