diff options
author | jim-p <jimp@pfsense.org> | 2011-07-12 19:57:42 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2011-07-12 19:57:42 -0400 |
commit | 8b6313a4d3eb1895b6c855436a50606cc7691ad4 (patch) | |
tree | 97784c2235366f00f42961dd4557e82fadf1ce8c /etc/inc/pfsense-utils.inc | |
parent | 13b9dba9aae25edf62d6cd58c7446329b0dd913c (diff) | |
parent | fd3e19f3bf9499b944263c0acaeaa6446260f197 (diff) | |
download | pfsense-8b6313a4d3eb1895b6c855436a50606cc7691ad4.zip pfsense-8b6313a4d3eb1895b6c855436a50606cc7691ad4.tar.gz |
Merge remote-tracking branch 'upstream/master'
Conflicts:
etc/inc/easyrule.inc
etc/inc/filter.inc
etc/inc/interfaces.inc
etc/inc/services.inc
etc/inc/xmlrpc_client.inc
usr/local/www/fbegin.inc
usr/local/www/services_dhcp.php
Diffstat (limited to 'etc/inc/pfsense-utils.inc')
-rw-r--r-- | etc/inc/pfsense-utils.inc | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index b9378e6..e5dbe93 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -342,11 +342,11 @@ function get_carp_interface_status($carpinterface) { exec("/sbin/ifconfig $carpinterface | /usr/bin/grep -v grep | /usr/bin/grep carp:", $carp_query); foreach($carp_query as $int) { if(stristr($int, "MASTER")) - return "MASTER"; + return gettext("MASTER"); if(stristr($int, "BACKUP")) - return "BACKUP"; + return gettext("BACKUP"); if(stristr($int, "INIT")) - return "INIT"; + return gettext("INIT"); } return; } @@ -414,7 +414,7 @@ function after_sync_bump_adv_skew() { } } if($processed_skew == 1) - write_config("After synch increase advertising skew"); + write_config(gettext("After synch increase advertising skew")); } /* @@ -459,16 +459,16 @@ function WakeOnLan($addr, $mac) // send it to the broadcast address using UDP $s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); if ($s == false) { - log_error("Error creating socket!"); - log_error("Error code is '".socket_last_error($s)."' - " . socket_strerror(socket_last_error($s))); + log_error(gettext("Error creating socket!")); + log_error(sprintf(gettext("Error code is '%1\$s' - %2\$s"), socket_last_error($s), socket_strerror(socket_last_error($s)))); } else { // setting a broadcast option to socket: $opt_ret = socket_set_option($s, 1, 6, TRUE); if($opt_ret < 0) - log_error("setsockopt() failed, error: " . strerror($opt_ret)); + log_error(sprintf(gettext("setsockopt() failed, error: %s"), strerror($opt_ret))); $e = socket_sendto($s, $msg, strlen($msg), 0, $addr, 2050); socket_close($s); - log_error("Magic Packet sent ({$e}) to {$addr} MAC={$mac}"); + log_error(sprintf(gettext('Magic Packet sent (%1$s) to {%2$s} MAC=%3$s'), $e, $addr, $mac)); return true; } @@ -545,7 +545,7 @@ function restore_config_section($section, $new_contents) { @unlink($g['tmp_path'] . "/tmpxml"); if(file_exists("{$g['tmp_path']}/config.cache")) unlink("{$g['tmp_path']}/config.cache"); - write_config("Restored {$section} of config file (maybe from CARP partner)"); + write_config(sprintf(gettext("Restored %s of config file (maybe from CARP partner)"), $section)); disable_security_checks(); conf_mount_ro(); return; @@ -567,7 +567,7 @@ function merge_config_section($section, $new_contents) { $section_xml = parse_xml_config($fname, $section); $config[$section] = $section_xml; unlink($fname); - write_config("Restored {$section} of config file (maybe from CARP partner)"); + write_config(sprintf(gettext("Restored %s of config file (maybe from CARP partner)"), $section)); disable_security_checks(); conf_mount_ro(); return; @@ -726,10 +726,10 @@ function call_pfsense_method($method, $params, $timeout = 0) { } $resp = $cli->send($msg, $timeout); if(!is_object($resp)) { - log_error("XMLRPC communication error: " . $cli->errstr); + log_error(sprintf(gettext("XMLRPC communication error: %s"), $cli->errstr)); return false; } elseif($resp->faultCode()) { - log_error("XMLRPC request failed with error " . $resp->faultCode() . ": " . $resp->faultString()); + log_error(sprintf(gettext('XMLRPC request failed with error %1$s: %2$s'), $resp->faultCode(), $resp->faultString())); return false; } else { return XML_RPC_Decode($resp->value()); @@ -822,7 +822,7 @@ function reload_interfaces_sync() { global $config, $g; if($g['debug']) - log_error("reload_interfaces_sync() is starting."); + log_error(gettext("reload_interfaces_sync() is starting.")); /* parse config.xml again */ $config = parse_config(true); @@ -830,10 +830,10 @@ function reload_interfaces_sync() { /* enable routing */ system_routing_enable(); if($g['debug']) - log_error("Enabling system routing"); + log_error(gettext("Enabling system routing")); if($g['debug']) - log_error("Cleaning up Interfaces"); + log_error(gettext("Cleaning up Interfaces")); /* set up interfaces */ interfaces_configure(); @@ -939,7 +939,7 @@ function auto_login() { } if (!$fd) { conf_mount_ro(); - log_error("Enabling auto login was not possible."); + log_error(gettext("Enabling auto login was not possible.")); return; } foreach($getty_split as $gs) { @@ -1111,7 +1111,7 @@ function get_ppp_uptime($port){ } return convert_seconds_to_hms($sec); } else { - $total_time = "No history data found!"; + $total_time = gettext("No history data found!"); return $total_time; } } @@ -1233,7 +1233,7 @@ function get_interface_info($ifdescr) { break; if (!file_exists($dev)) { $ifinfo['nodevice'] = 1; - $ifinfo['pppinfo'] = $dev . " device not present! Is the modem attached to the system?"; + $ifinfo['pppinfo'] = $dev . " " . gettext("device not present! Is the modem attached to the system?"); } // Calculate cumulative uptime for PPP link. Useful for connections that have per minute/hour contracts so you don't go over! if (isset($ppp['uptime'])) @@ -1273,8 +1273,8 @@ function get_interface_info($ifdescr) { if (preg_match("/status: (.*)$/", $ici, $matches)) { if ($matches[1] != "active") $ifinfo['status'] = $matches[1]; - if($ifinfo['status'] == "running") - $ifinfo['status'] = "up"; + if($ifinfo['status'] == gettext("running")) + $ifinfo['status'] = gettext("up"); } if (preg_match("/channel (\S*)/", $ici, $matches)) { $ifinfo['channel'] = $matches[1]; @@ -1311,13 +1311,13 @@ function get_interface_info($ifdescr) { if($bridge) { $bridge_text = `/sbin/ifconfig {$bridge}`; if(stristr($bridge_text, "blocking") <> false) { - $ifinfo['bridge'] = "<b><font color='red'>blocking</font></b> - check for ethernet loops"; + $ifinfo['bridge'] = "<b><font color='red'>" . gettext("blocking") . "</font></b> - " . gettext("check for ethernet loops"); $ifinfo['bridgeint'] = $bridge; } else if(stristr($bridge_text, "learning") <> false) { - $ifinfo['bridge'] = "learning"; + $ifinfo['bridge'] = gettext("learning"); $ifinfo['bridgeint'] = $bridge; } else if(stristr($bridge_text, "forwarding") <> false) { - $ifinfo['bridge'] = "forwarding"; + $ifinfo['bridge'] = gettext("forwarding"); $ifinfo['bridgeint'] = $bridge; } } @@ -1428,7 +1428,7 @@ function compare_hostname_to_dnscache($hostname) { if(trim($oldcontents) != trim($contents)) { if($g['debug']) { - log_error("DNSCACHE: Found old IP {$oldcontents} and new IP {$contents}"); + log_error(sprintf(gettext('DNSCACHE: Found old IP %1$s and new IP %2$s'), $oldcontents, $contents)); } return ($oldcontents); } else { |