diff options
author | Phil Davis <phil.davis@inf.org> | 2016-02-17 19:18:51 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2016-02-17 19:18:51 +0545 |
commit | d18f3f6e09b86359395cd78db2e19f721818b992 (patch) | |
tree | e69d57c2eda5116852d313c4657421f72ef12358 /src/etc | |
parent | 8bd840820e37fedadb56eba97f407a0f7ba1f0b2 (diff) | |
download | pfsense-d18f3f6e09b86359395cd78db2e19f721818b992.zip pfsense-d18f3f6e09b86359395cd78db2e19f721818b992.tar.gz |
Internationalize etc inc a-i files
Diffstat (limited to 'src/etc')
-rw-r--r-- | src/etc/inc/authgui.inc | 12 | ||||
-rw-r--r-- | src/etc/inc/captiveportal.inc | 32 | ||||
-rw-r--r-- | src/etc/inc/config.console.inc | 2 | ||||
-rw-r--r-- | src/etc/inc/config.lib.inc | 2 | ||||
-rw-r--r-- | src/etc/inc/crypt.inc | 2 | ||||
-rw-r--r-- | src/etc/inc/filter.inc | 22 | ||||
-rw-r--r-- | src/etc/inc/filter_log.inc | 8 | ||||
-rw-r--r-- | src/etc/inc/gwlb.inc | 23 | ||||
-rw-r--r-- | src/etc/inc/interfaces.inc | 54 |
9 files changed, 83 insertions, 74 deletions
diff --git a/src/etc/inc/authgui.inc b/src/etc/inc/authgui.inc index 47616ee..57e44b9 100644 --- a/src/etc/inc/authgui.inc +++ b/src/etc/inc/authgui.inc @@ -264,7 +264,7 @@ if (isset($config['system']['webgui']['webguicss'])) { <div class="panel panel-default"> <div class="panel-heading"> - <h2 class="panel-title">Login to pfSense</h2> + <h2 class="panel-title"><?=gettext("Login to pfSense")?></h2> </div> <div class="panel-body"> @@ -275,22 +275,22 @@ if (isset($config['system']['webgui']['webguicss'])) { <form method="post" <?= $loginautocomplete ?> action="<?=$_SERVER['SCRIPT_NAME'];?>" class="form-horizontal"> <div class="form-group"> - <label for="usernamefld" class="col-sm-3 control-label">Username</label> + <label for="usernamefld" class="col-sm-3 control-label"><?=gettext("Username")?></label> <div class="col-sm-9 col-md-7"> - <input type="text" class="form-control" name="usernamefld" id="usernamefld" placeholder="Enter your username" autocorrect="off" autocapitalize="none" spellcheck="false"> + <input type="text" class="form-control" name="usernamefld" id="usernamefld" placeholder="<?=gettext("Enter your username")?>" autocorrect="off" autocapitalize="none" spellcheck="false"> </div> </div> <div class="form-group"> - <label for="passwordfld" class="col-sm-3 control-label">Password</label> + <label for="passwordfld" class="col-sm-3 control-label"><?=gettext("Password")?></label> <div class="col-sm-9 col-md-7"> - <input type="password" class="form-control" name="passwordfld" id="passwordfld" placeholder="Enter your password"> + <input type="password" class="form-control" name="passwordfld" id="passwordfld" placeholder="<?=gettext("Enter your password")?>"> </div> </div> <div class="form-group"> <div class="col-sm-offset-3 col-sm-9 col-md-7"> - <button type="submit" class="btn btn-primary" name="login">Login</button> + <button type="submit" class="btn btn-primary" name="login"><?=gettext("Login")?></button> </div> </div> </form> diff --git a/src/etc/inc/captiveportal.inc b/src/etc/inc/captiveportal.inc index 2921af2..d051695 100644 --- a/src/etc/inc/captiveportal.inc +++ b/src/etc/inc/captiveportal.inc @@ -64,6 +64,10 @@ require_once("voucher.inc"); function get_default_captive_portal_html() { global $config, $g, $cpzone; + $translated_text1 = sprintf(gettext("%s captive portal"), $g['product_name']); + $translated_text2 = sprintf(gettext("Welcome to the %s Captive Portal!"), $g['product_name']); + $translated_text3 = gettext("Username:"); + $translated_text4 = gettext("Password:"); $htmltext = <<<EOD <html> <body> @@ -76,7 +80,7 @@ function get_default_captive_portal_html() { <td style="border-bottom:1px solid #000000"> <font color='white'> <b> - {$g['product_name']} captive portal + {$translated_text1} </b> </font> </td> @@ -106,27 +110,29 @@ function get_default_captive_portal_html() { <br /> <div id='loginbox'> <table> - <tr><td colspan="2"><center>Welcome to the {$g['product_name']} Captive Portal!</td></tr> + <tr><td colspan="2"><center>{$translated_text2}</td></tr> <tr><td> </td></tr> - <tr><td align="right">Username:</td><td><input name="auth_user" type="text" style="border: 1px dashed;"></td></tr> - <tr><td align="right">Password:</td><td><input name="auth_pass" type="password" style="border: 1px dashed;"></td></tr> + <tr><td align="right">{$translated_text3}</td><td><input name="auth_user" type="text" style="border: 1px dashed;"></td></tr> + <tr><td align="right">{$translated_text4}</td><td><input name="auth_pass" type="password" style="border: 1px dashed;"></td></tr> <tr><td> </td></tr> EOD; if (isset($config['voucher'][$cpzone]['enable'])) { + $translated_text = gettext("Enter Voucher Code:"); $htmltext .= <<<EOD <tr> - <td align="right">Enter Voucher Code: </td> + <td align="right">{$translated_text} </td> <td><input name="auth_voucher" type="text" style="border:1px dashed;" size="22"></td> </tr> EOD; } + $translated_text = gettext("Continue"); $htmltext .= <<<EOD <tr> - <td colspan="2"><center><input name="accept" type="submit" value="Continue"></center></td> + <td colspan="2"><center><input name="accept" type="submit" value="{$translated_text}"></center></td> </tr> </table> </div> @@ -280,26 +286,30 @@ function captiveportal_configure_zone($cpcfg) { $logouttext = base64_decode($cpcfg['page']['logouttext']); } else { /* example page */ + $translated_text1 = gettext("Redirecting..."); + $translated_text2 = gettext("Redirecting to"); + $translated_text3 = gettext("Logout"); + $translated_text4 = gettext("Click the button below to disconnect"); $logouttext = <<<EOD <html> -<head><title>Redirecting...</title></head> +<head><title>{$translated_text1}</title></head> <body> <span style="font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 11px;"> -<b>Redirecting to <a href="<?=\$my_redirurl;?>"><?=\$my_redirurl;?></a>...</b> +<b>{$translated_text2} <a href="<?=\$my_redirurl;?>"><?=\$my_redirurl;?></a>...</b> </span> <script type="text/javascript"> //<![CDATA[ LogoutWin = window.open('', 'Logout', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=256,height=64'); if (LogoutWin) { LogoutWin.document.write('<html>'); - LogoutWin.document.write('<head><title>Logout</title></head>') ; + LogoutWin.document.write('<head><title>{$translated_text3}</title></head>') ; LogoutWin.document.write('<body bgcolor="#435370">'); LogoutWin.document.write('<div align="center" style="color: #ffffff; font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 11px;">') ; - LogoutWin.document.write('<b>Click the button below to disconnect</b><p />'); + LogoutWin.document.write('<b>{$translated_text4}</b><p />'); LogoutWin.document.write('<form method="POST" action="<?=\$logouturl;?>">'); LogoutWin.document.write('<input name="logout_id" type="hidden" value="<?=\$sessionid;?>" />'); LogoutWin.document.write('<input name="zone" type="hidden" value="<?=\$cpzone;?>" />'); - LogoutWin.document.write('<input name="logout" type="submit" value="Logout" />'); + LogoutWin.document.write('<input name="logout" type="submit" value="{$translated_text3}" />'); LogoutWin.document.write('</form>'); LogoutWin.document.write('</div></body>'); LogoutWin.document.write('</html>'); diff --git a/src/etc/inc/config.console.inc b/src/etc/inc/config.console.inc index fd2d767..0d3356e 100644 --- a/src/etc/inc/config.console.inc +++ b/src/etc/inc/config.console.inc @@ -447,7 +447,7 @@ EOD; } printf(gettext("%sWriting configuration..."), "\n"); - write_config("Console assignment of interfaces"); + write_config(gettext("Console assignment of interfaces")); printf(gettext("done.%s"), "\n"); fclose($fp); diff --git a/src/etc/inc/config.lib.inc b/src/etc/inc/config.lib.inc index d61cf17..09e6730 100644 --- a/src/etc/inc/config.lib.inc +++ b/src/etc/inc/config.lib.inc @@ -690,7 +690,7 @@ function config_restore($conffile) { conf_mount_ro(); - write_config(gettext("Reverted to") . " " . array_pop(explode("/", $conffile)) . ".", false); + write_config(sprintf(gettext("Reverted to %s."), array_pop(explode("/", $conffile))), false); return 0; } diff --git a/src/etc/inc/crypt.inc b/src/etc/inc/crypt.inc index a8fcc83..37d507d 100644 --- a/src/etc/inc/crypt.inc +++ b/src/etc/inc/crypt.inc @@ -64,7 +64,7 @@ $result = file_get_contents("{$file}.enc"); } else { $result = ""; - log_error("Failed to encrypt/decrypt data!"); + log_error(gettext("Failed to encrypt/decrypt data!")); } @unlink($file); @unlink("{$file}.dec"); diff --git a/src/etc/inc/filter.inc b/src/etc/inc/filter.inc index 231672c..f006a1f 100644 --- a/src/etc/inc/filter.inc +++ b/src/etc/inc/filter.inc @@ -797,7 +797,7 @@ function filter_generate_aliases() { $aliasaddrnesting = array(); if (is_numericint($aliased['name'])) { // skip aliases with numeric-only names. redmine #4289 - file_notice("Filter_Reload", "Aliases with numeric-only names are not valid. Skipping alias " . $aliased['name']); + file_notice("Filter_Reload", sprintf(gettext("Aliases with numeric-only names are not valid. Skipping alias %s"), $aliased['name'])); continue; } $addrlist = filter_generate_nested_alias($aliased['name'], $aliased['address'], $aliasnesting, $aliasaddrnesting); @@ -1501,13 +1501,13 @@ function filter_generate_reflection_proxy($rule, $nordr, $rdr_ifs, $srcaddr, $ds } if (($inetdport + $delta + 1) - $starting_localhost_port_tmp > 500) { - log_error("Not installing NAT reflection rules for a port range > 500"); + log_error(gettext("Not installing NAT reflection rules for a port range > 500")); $inetdport = $starting_localhost_port; $toadd_array = array(); $toomanyports = true; break; } else if (($inetdport + $delta) > 19990) { - log_error("Installing partial NAT reflection rules. Maximum 1,000 reached."); + log_error(gettext("Installing partial NAT reflection rules. Maximum 1,000 reached.")); $delta = 19990 - $inetdport; $loc_pt[1] = $loc_pt[0] + $delta; if ($delta == 0) { @@ -2419,7 +2419,7 @@ function filter_generate_port(& $rule, $target = "source", $isnat = false) { $srcport = explode("-", $rule[$target]['port']); $srcporta = alias_expand($srcport[0]); if (!$srcporta) { - log_error(sprintf(gettext("filter_generate_port: %s is not a valid {$target} port."), $srcport[0])); + log_error(sprintf(gettext('filter_generate_port: %1$s is not a valid %2$s port.'), $srcport[0], $target)); } else if ((!$srcport[1]) || ($srcport[0] == $srcport[1])) { $src .= " port {$srcporta} "; } else if (($srcport[0] == 1) && ($srcport[1] == 65535)) { @@ -2655,7 +2655,7 @@ function filter_generate_user_rule($rule) { if (isset($rule['disabled'])) { return "# rule " . $rule['descr'] . " disabled \n"; } - update_filter_reload_status("Creating filter rules {$rule['descr']} ..."); + update_filter_reload_status(sprintf(gettext("Creating filter rules %s ..."), $rule['descr'])); $int = ""; $aline = array(); @@ -2706,16 +2706,16 @@ function filter_generate_user_rule($rule) { /* check for unresolvable aliases */ if ($rule['source']['address'] && !alias_expand($rule['source']['address'])) { - $error_text = "Unresolvable source alias '{$rule['source']['address']}' for rule '{$rule['descr']}'"; + $error_text = sprintf(gettext("Unresolvable source alias '%1\$s' for rule '%2\$s'"), $rule['source']['address'], $rule['descr']); file_notice("Filter_Reload", $error_text); return "# {$error_text}"; } if ($rule['destination']['address'] && !alias_expand($rule['destination']['address'])) { - $error_text = "Unresolvable destination alias '{$rule['destination']['address']}' for rule '{$rule['descr']}'"; + $error_text = sprintf(gettext("Unresolvable destination alias '%1\$s' for rule '%2\$s'"), $rule['destination']['address'], $rule['descr']); file_notice("Filter_Reload", $error_text); return "# {$error_text}"; } - update_filter_reload_status("Setting up pass/block rules"); + update_filter_reload_status(gettext("Setting up pass/block rules")); $type = $rule['type']; if ($type != "pass" && $type != "block" && $type != "reject" && $type != "match") { /* default (for older rules) is pass */ @@ -2766,7 +2766,7 @@ function filter_generate_user_rule($rule) { } else if (isset($config['system']['skip_rules_gw_down'])) { return "# rule " . $rule['descr'] . " disabled because gateway " . $rule['gateway'] . " is down "; } else { - log_error("The gateway: {$rule['gateway']} is invalid or unknown, not using it."); + log_error(sprintf(gettext("The gateway: %s is invalid or unknown, not using it."), $rule['gateway'])); } } @@ -3030,7 +3030,7 @@ function filter_generate_user_rule($rule) { } return "# schedule finished - {$rule['descr']}"; } else if ($g['debug']) { - log_error("[TDR DEBUG] status true -- rule type '$type'"); + log_error(sprintf(gettext("[TDR DEBUG] status true -- rule type '%s'"), $type)); } $aline['schedlabel'] = " schedule \"{$sched['schedlabel']}\" "; @@ -4278,7 +4278,7 @@ function display_separator($separators, $nrules, $columns_in_table) { $cellcolor = $separator['color']; print('<tr class="ui-sortable-handle separator">' . '<td class="' . $cellcolor . '" colspan="' . ($columns_in_table -1) . '">' . '<span class="' . $cellcolor . '">' . $separator['text'] . '</span></td>' . - '<td class="' . $cellcolor . '"><a href="#"><i class="fa fa-trash no-confirm sepdel" title="delete this separator"></i></a></td>' . + '<td class="' . $cellcolor . '"><a href="#"><i class="fa fa-trash no-confirm sepdel" title="' . gettext("delete this separator") . '"></i></a></td>' . '</tr>' . "\n"); } } diff --git a/src/etc/inc/filter_log.inc b/src/etc/inc/filter_log.inc index d216083..dfc5a75 100644 --- a/src/etc/inc/filter_log.inc +++ b/src/etc/inc/filter_log.inc @@ -257,7 +257,7 @@ function parse_vpn_login_log_line($line) { return $flent; } else { if($g['debug']) { - log_error(sprintf(gettext("There was a error parsing log entry: %s. Please report to mailing list or forum."), $line)); + log_error(sprintf(gettext("There was a error parsing log entry: %s. Please report to mailing list or forum."), $line)); } return ""; } @@ -279,7 +279,7 @@ function parse_vpn_service_log_line($line) { return $flent; } else { if($g['debug']) { - log_error(sprintf(gettext("There was a error parsing log entry: %s. Please report to mailing list or forum."), $line)); + log_error(sprintf(gettext("There was a error parsing log entry: %s. Please report to mailing list or forum."), $line)); } return ""; } @@ -302,7 +302,7 @@ function parse_unknown_log_line($line) { return $flent; } else { if ($g['debug']) { - log_error(sprintf(gettext("There was a error parsing log entry: %s. Please report to mailing list or forum."), $line)); + log_error(sprintf(gettext("There was a error parsing log entry: %s. Please report to mailing list or forum."), $line)); } return ""; } @@ -325,7 +325,7 @@ function parse_system_log_line($line) { return $flent; } else { if ($g['debug']) { - log_error(sprintf(gettext("There was a error parsing log entry: %s. Please report to mailing list or forum."), $line)); + log_error(sprintf(gettext("There was a error parsing log entry: %s. Please report to mailing list or forum."), $line)); } return ""; } diff --git a/src/etc/inc/gwlb.inc b/src/etc/inc/gwlb.inc index 6ab8b8a..b1e342d 100644 --- a/src/etc/inc/gwlb.inc +++ b/src/etc/inc/gwlb.inc @@ -199,7 +199,7 @@ function setup_gateways_monitor() { $gateways_arr = return_gateways_array(); if (!is_array($gateways_arr)) { - log_error("No gateways to monitor. dpinger will not run."); + log_error(gettext("No gateways to monitor. dpinger will not run.")); stop_dpinger(); return; } @@ -247,7 +247,7 @@ function setup_gateways_monitor() { * not strictly necessary but is a added level of protection. */ if (is_ipaddrv4($gateway['gateway']) && $gateway['monitor'] != $gateway['gateway']) { - log_error("Removing static route for monitor {$gateway['monitor']} and adding a new route through {$gateway['gateway']}"); + log_error(sprintf(gettext('Removing static route for monitor %1$s and adding a new route through %2$s'), $gateway['monitor'], $gateway['gateway'])); if (interface_isppp_type($gateway['friendlyiface'])) { mwexec("/sbin/route change -host " . escapeshellarg($gateway['monitor']) . " -iface " . escapeshellarg($gateway['interface']), true); @@ -289,7 +289,7 @@ function setup_gateways_monitor() { * not strictly necessary but is a added level of protection. */ if ($gateway['gateway'] != $gateway['monitor']) { - log_error("Removing static route for monitor {$gateway['monitor']} and adding a new route through {$gateway['gateway']}"); + log_error(sprintf(gettext('Removing static route for monitor %1$s and adding a new route through %2$s'), $gateway['monitor'], $gateway['gateway'])); if (interface_isppp_type($gateway['friendlyiface'])) { mwexec("/sbin/route change -host -inet6 " . escapeshellarg($gateway['monitor']) . " -iface " . escapeshellarg($gateway['interface']), true); @@ -318,8 +318,7 @@ function setup_gateways_monitor() { } if (start_dpinger($gateway) != 0) { - log_error("Error starting gateway monitor for " . - $gateway['name']); + log_error(sprintf(gettext("Error starting gateway monitor for %s"), $gateway['name'])); } } @@ -332,7 +331,7 @@ function get_dpinger_status($gwname) { $running_processes = running_dpinger_processes(); if (!isset($running_processes[$gwname])) { - log_error("dpinger: No dpinger session running for gateway {$gwname}"); + log_error(sprint(gettext('dpinger: No dpinger session running for gateway %s'), $gwname)); return false; } @@ -346,7 +345,7 @@ function get_dpinger_status($gwname) { $fp = stream_socket_client("unix://{$proc['socket']}", $errno, $errstr, 10); if (!$fp) { - log_error("dpinger: cannot connect to status socket {$proc['socket']} - $errstr ($errno)"); + log_error(sprintf(gettext('dpinger: cannot connect to status socket %1$s - %2$s (%3$s)'), $proc['socket'], $errstr, $errno)); return false; } @@ -925,15 +924,15 @@ function return_gateway_groups_array() { $status = $gateways_status[$gwname]; $gwdown = false; if (stristr($status['status'], "down")) { - $msg = sprintf(gettext("MONITOR: %s is down, omitting from routing group {$group['name']}"), $gwname); + $msg = sprintf(gettext('MONITOR: %1$s is down, omitting from routing group %2$s'), $group['name'], $gwname); $gwdown = true; } else if (stristr($status['status'], "loss") && strstr($group['trigger'], "loss")) { /* packet loss */ - $msg = sprintf(gettext("MONITOR: %s has packet loss, omitting from routing group {$group['name']}"), $gwname); + $msg = sprintf(gettext('MONITOR: %1$s has packet loss, omitting from routing group %2$s'), $group['name'], $gwname); $gwdown = true; } else if (stristr($status['status'], "delay") && strstr($group['trigger'] , "latency")) { /* high latency */ - $msg = sprintf(gettext("MONITOR: %s has high latency, omitting from routing group {$group['name']}"), $gwname); + $msg = sprintf(gettext('MONITOR: %1$s has high latency, omitting from routing group %2$s'), $group['name'], $gwname); $gwdown = true; } if ($gwdown == true) { @@ -955,7 +954,7 @@ function return_gateway_groups_array() { if ($tiers_count == 0) { /* Oh dear, we have no members! Engage Plan B */ if (!platform_booting()) { - $msg = gettext("Gateways status could not be determined, considering all as up/active. (Group: {$group['name']})"); + $msg = sprintf(gettext('Gateways status could not be determined, considering all as up/active. (Group: %s)'), $group['name']); log_error($msg); notify_via_growl($msg); //notify_via_smtp($msg); @@ -998,7 +997,7 @@ function return_gateway_groups_array() { if (count($gateway_groups_array[$group['name']]) > 0) { break; } else { - log_error("GATEWAYS: Group {$group['name']} did not have any gateways up on tier {$tieridx}!"); + log_error(sprintf(gettext('GATEWAYS: Group %1$s did not have any gateways up on tier %2$s!'), $group['name'], $tieridx)); } } } diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index 800ff42..535e147 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -1228,7 +1228,7 @@ function interface_bring_down($interface = "wan", $destroy = false, $ifacecfg = } if ($g['debug']) { - log_error("Calling interface down for interface {$interface}, destroy is " . (($destroy) ? 'true' : 'false')); + log_error(sprintf(gettext('Calling interface down for interface %1$s, destroy is %2$s'), $interface, (($destroy) ? 'true' : 'false'))); } /* @@ -1417,7 +1417,7 @@ function interfaces_carp_set_maintenancemode($carp_maintenancemode) { write_config("Leave CARP maintenance mode"); } else if (!isset($config["virtualip_carp_maintenancemode"]) && $carp_maintenancemode == true) { $config["virtualip_carp_maintenancemode"] = true; - write_config("Enter CARP maintenance mode"); + write_config(gettext("Enter CARP maintenance mode")); } $viparr = &$config['virtualip']['vip']; @@ -1661,7 +1661,7 @@ function interface_ppps_configure($interface) { } if (!is_ipaddr($localips[$pid])) { - log_error("Could not get a Local IP address for PPTP/L2TP link on {$port} in interfaces_ppps_configure. Using 0.0.0.0 ip!"); + log_error(sprintf(gettext("Could not get a Local IP address for PPTP/L2TP link on %s in interfaces_ppps_configure. Using 0.0.0.0 ip!"), $port)); $localips[$pid] = "0.0.0.0"; } if (!is_ipaddr($gateways[$pid])) { @@ -1992,7 +1992,7 @@ EOD; } else { $fd = fopen("{$g['varetc_path']}/mpd_{$interface}.conf", "w"); if (!$fd) { - log_error(sprintf(gettext("Error: cannot open mpd_%s.conf in interface_ppps_configure().%s"), $interface, "\n")); + log_error(sprintf(gettext('Error: cannot open mpd_%1$s.conf in interface_ppps_configure().%2$s'), $interface, "\n")); return 0; } // Write out mpd_ppp.conf @@ -2090,7 +2090,7 @@ EOD; $mondev = substr(basename($port), 0, -1) . "1"; } if ($mondev != '') { - log_error("Starting 3gstats.php on device '{$mondev}' for interface '{$interface}'"); + log_error(sprintf(gettext('Starting 3gstats.php on device \'%1$s\' for interface \'%2$s\''), $mondev, $interface)); mwexec_bg("/usr/local/bin/3gstats.php {$mondev} {$interface}"); } } @@ -2148,14 +2148,14 @@ function interfaces_sync_setup() { /* XXX: Handle an issue with pfsync(4) and carp(4). In a cluster carp will come up before pfsync(4) has updated and so will cause issues * for existing sessions. */ - log_error("waiting for pfsync..."); + log_error(gettext("waiting for pfsync...")); $i = 0; while (intval(trim(`/sbin/ifconfig pfsync0 | /usr/bin/grep 'syncok: 0' | /usr/bin/grep -v grep | /usr/bin/wc -l`)) == 0 && $i < 30) { $i++; sleep(1); } - log_error("pfsync done in $i seconds."); - log_error("Configuring CARP settings finalize..."); + log_error(sprintf(gettext("pfsync done in %s seconds."), $i)); + log_error(gettext("Configuring CARP settings finalize...")); } else { mwexec("/sbin/ifconfig pfsync0 -syncdev -syncpeer down", false); } @@ -3029,7 +3029,7 @@ function interface_virtual_create($interface) { if (!function_exists('openvpn_resync')) { require_once('openvpn.inc'); } - log_error("OpenVPN: Resync server {$server['description']}"); + log_error(sprintf(gettext("OpenVPN: Resync server %s"), $server['description'])); openvpn_resync('server', $server); } } @@ -3042,7 +3042,7 @@ function interface_virtual_create($interface) { if (!function_exists('openvpn_resync')) { require_once('openvpn.inc'); } - log_error("OpenVPN: Resync server {$client['description']}"); + log_error(sprintf(gettext("OpenVPN: Resync client %s"), $client['description'])); openvpn_resync('client', $client); } } @@ -3213,7 +3213,7 @@ function interface_configure($interface = "wan", $reloadall = false, $linkupeven /* Disable Accepting router advertisements unless specifically requested */ if ($g['debug']) { - log_error("Deny router advertisements for interface {$interface}"); + log_error(sprintf(gettext("Deny router advertisements for interface %s"), $interface)); } mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " inet6 -accept_rtadv", true); @@ -3318,7 +3318,7 @@ function interface_configure($interface = "wan", $reloadall = false, $linkupeven if (!empty($assignedparent) && !empty($config['interfaces'][$assignedparent]['mtu'])) { $parentmtu = $config['interfaces'][$assignedparent]['mtu']; if ($wancfg['mtu'] > $parentmtu) { - log_error("There is a conflict on MTU between parent {$mtuhwif} and VLAN({$mtuif})"); + log_error(sprintf(gettext('There is a conflict on MTU between parent %1$s and VLAN(%2$s)'), $mtuhwif, $mtuif)); } } @@ -3517,20 +3517,20 @@ function interface_track6_configure($interface = "lan", $wancfg, $linkupevent = $trackcfg = $config['interfaces'][$wancfg['track6-interface']]; if (!isset($trackcfg['enable'])) { - log_error("Interface {$interface} tracking non-existant interface {$wancfg['track6-interface']}"); + log_error(sprintf(gettext('Interface %1$s tracking non-existant interface %2$s'), $interface, $wancfg['track6-interface'])); return; } switch ($trackcfg['ipaddrv6']) { case "6to4": if ($g['debug']) { - log_error("Interface {$interface} configured via {$wancfg['track6-interface']} type {$type}"); + log_error(sprintf(gettext('Interface %1$s configured via %2$s type %3$s'), $interface, $wancfg['track6-interface'], $type)); } interface_track6_6to4_configure($interface, $wancfg); break; case "6rd": if ($g['debug']) { - log_error("Interface {$interface} configured via {$wancfg['track6-interface']} type {$type}"); + log_error(sprintf(gettext('Interface %1$s configured via %2$s type %3$s'), $interface, $wancfg['track6-interface'], $type)); } interface_track6_6rd_configure($interface, $wancfg); break; @@ -3582,13 +3582,13 @@ function interface_track6_6rd_configure($interface = "lan", $lancfg) { $wancfg = $config['interfaces'][$lancfg['track6-interface']]; if (empty($wancfg)) { - log_error("Interface {$interface} tracking non-existant interface {$lancfg['track6-interface']}"); + log_error(sprintf(gettext('Interface %1$s tracking non-existant interface %2$s'), $interface, $lancfg['track6-interface'])); return; } $ip4address = get_interface_ip($lancfg['track6-interface']); if (!is_ipaddrv4($ip4address)) { /* XXX: This should not be needed by 6rd || (is_private_ip($ip4address))) { */ - log_error("The interface IPv4 '{$ip4address}' address on interface '{$lancfg['track6-interface']}' is not valid, not configuring 6RD tunnel"); + log_error(sprintf(gettext('The interface IPv4 \'%1$s\' address on interface \'%2$s\' is not valid, not configuring 6RD tunnel'), $ip4address, $lancfg['track6-interface'])); return; } $hexwanv4 = return_hex_ipv4($ip4address); @@ -3624,7 +3624,7 @@ function interface_track6_6rd_configure($interface = "lan", $lancfg) { } unset($interface_ipv6_arr_cache[$lanif]); unset($interface_snv6_arr_cache[$lanif]); - log_error("rd6 {$interface} with ipv6 address {$rd6lan} based on {$lancfg['track6-interface']} ipv4 {$ip4address}"); + log_error(sprintf(gettext('rd6 %1$s with ipv6 address %2$s based on %3$s ipv4 %4$s'), $interface, $rd6lan, $lancfg['track6-interface'], $ip4address)); mwexec("/sbin/ifconfig {$lanif} inet6 {$rd6lan} prefixlen 64"); return 0; @@ -3646,13 +3646,13 @@ function interface_track6_6to4_configure($interface = "lan", $lancfg) { $wancfg = $config['interfaces'][$lancfg['track6-interface']]; if (empty($wancfg)) { - log_error("Interface {$interface} tracking non-existant interface {$lancfg['track6-interface']}"); + log_error(sprintf(gettext('Interface %1$s tracking non-existant interface %2$s'), $interface, $lancfg['track6-interface'])); return; } $ip4address = get_interface_ip($lancfg['track6-interface']); if (!is_ipaddrv4($ip4address) || is_private_ip($ip4address)) { - log_error("The interface IPv4 '{$ip4address}' address on interface '{$lancfg['track6-interface']}' is not public, not configuring 6RD tunnel"); + log_error(sprintf(gettext('The interface IPv4 \'%1$s\' address on interface \'%2$s\' is not public, not configuring 6RD tunnel'), $ip4address, $lancfg['track6-interface'])); return; } $hexwanv4 = return_hex_ipv4($ip4address); @@ -3684,7 +3684,7 @@ function interface_track6_6to4_configure($interface = "lan", $lancfg) { } unset($interface_ipv6_arr_cache[$lanif]); unset($interface_snv6_arr_cache[$lanif]); - log_error("sixto4 {$interface} with ipv6 address {$sixto4lan} based on {$lancfg['track6-interface']} ipv4 {$ip4address}"); + log_error(sprintf(gettext('sixto4 %1$s with ipv6 address %2$s based on %3$s ipv4 %4$s'), $interface, $sixto4lan, $lancfg['track6-interface'], $ip4address)); mwexec("/sbin/ifconfig {$lanif} inet6 {$sixto4lan} prefixlen 64"); return 0; @@ -3707,7 +3707,7 @@ function interface_6rd_configure($interface = "wan", $wancfg) { $wanif = get_real_interface($interface); $ip4address = find_interface_ip($wanif); if (!is_ipaddrv4($ip4address)) { - log_error("The interface IPv4 '{$ip4address}' address on interface '{$wanif}' is not public, not configuring 6RD tunnel"); + log_error(sprintf(gettext('The interface IPv4 \'%1$s\' address on interface \'%2$s\' is not public, not configuring 6RD tunnel'), $ip4address, $wanif)); return false; } $hexwanv4 = return_hex_ipv4($ip4address); @@ -3793,7 +3793,7 @@ function interface_6to4_configure($interface = "wan", $wancfg) { $wanif = get_real_interface($interface); $ip4address = find_interface_ip($wanif); if ((!is_ipaddrv4($ip4address)) || (is_private_ip($ip4address))) { - log_error("The interface IPv4 '{$ip4address}' address on interface '{$wanif}' is not public, not configuring 6RD tunnel"); + log_error(sprintf(gettext('The interface IPv4 \'%1$s\' address on interface \'%2$s\' is not public, not configuring 6RD tunnel'), $ip4address, $wanif)); return false; } @@ -4179,7 +4179,7 @@ function DHCP6_Config_File_Override($wancfg, $wanif) { $dhcp6cconf = @file_get_contents($wancfg['adv_dhcp6_config_file_override_path']); if ($dhcp6cconf === false) { - log_error("Error: cannot open {$wancfg['adv_dhcp6_config_file_override_path']} in DHCP6_Config_File_Override() for reading.\n"); + log_error(sprintf(gettext('Error: cannot open %s in DHCP6_Config_File_Override() for reading.'), $wancfg['adv_dhcp6_config_file_override_path'])); return ''; } else { return DHCP6_Config_File_Substitutions($wancfg, $wanif, $dhcp6cconf);; @@ -4276,7 +4276,7 @@ EOD; if ($wanif) { interfaces_bring_up($wanif); } else { - log_error(printf(gettext("Could not bring up %s interface in interface_dhcp_configure()"), $wanif)); + log_error(sprintf(gettext("Could not bring up %s interface in interface_dhcp_configure()"), $wanif)); } /* Make sure dhclient is not running */ @@ -4362,7 +4362,7 @@ function DHCP_Config_File_Override($wancfg, $wanif) { $dhclientconf = @file_get_contents($wancfg['adv_dhcp_config_file_override_path']); if ($dhclientconf === false) { - log_error("Error: cannot open {$wancfg['adv_dhcp_config_file_override_path']} in DHCP_Config_File_Override() for reading.\n"); + log_error(sprintf(gettext("Error: cannot open %s in DHCP_Config_File_Override() for reading.\n"), $wancfg['adv_dhcp_config_file_override_path'])); return ''; } else { return DHCP_Config_File_Substitutions($wancfg, $wanif, $dhclientconf); @@ -5294,7 +5294,7 @@ function get_possible_traffic_source_addresses($include_ipv6_link_local=false) { foreach ($config['openvpn']["openvpn-{$mode}"] as $id => $setting) { if (!isset($setting['disable'])) { $sourceips_key = 'ovpn' . substr($mode, 0, 1) . $setting['vpnid']; - $sourceips[$sourceips_key] = gettext("OpenVPN") . " ".$mode.": ".htmlspecialchars($setting['description']); + $sourceips[$sourceips_key] = gettext("OpenVPN") . " " . $mode . ": " . htmlspecialchars($setting['description']); } } } |