diff options
author | Renato Botelho <renato.botelho@bluepex.com> | 2010-10-01 10:17:13 -0300 |
---|---|---|
committer | Renato Botelho <renato.botelho@bluepex.com> | 2010-10-01 10:17:13 -0300 |
commit | addc0439931fb28c626c7024b1e9857adfe29f29 (patch) | |
tree | f6774da34d43b238c3a14a3a43a5b71da0a2f249 | |
parent | 788c1288bae791ac0b3f2a19eb8c6aac8d7a7c22 (diff) | |
download | pfsense-addc0439931fb28c626c7024b1e9857adfe29f29.zip pfsense-addc0439931fb28c626c7024b1e9857adfe29f29.tar.gz |
Fix quotes to use %N$X on gettext calls
-rw-r--r-- | etc/inc/auth.inc | 14 | ||||
-rw-r--r-- | etc/inc/authgui.inc | 2 | ||||
-rw-r--r-- | etc/inc/cmd_chain.inc | 6 | ||||
-rw-r--r-- | etc/inc/config.lib.inc | 8 | ||||
-rw-r--r-- | etc/inc/filter.inc | 12 | ||||
-rw-r--r-- | etc/inc/filter_log.inc | 2 | ||||
-rw-r--r-- | etc/inc/gwlb.inc | 2 | ||||
-rw-r--r-- | etc/inc/interfaces.inc | 8 | ||||
-rw-r--r-- | etc/inc/meta.inc | 8 | ||||
-rw-r--r-- | etc/inc/notices.inc | 4 | ||||
-rw-r--r-- | etc/inc/pfsense-utils.inc | 12 | ||||
-rw-r--r-- | etc/inc/pkg-utils.inc | 4 | ||||
-rw-r--r-- | etc/inc/rrd.inc | 10 | ||||
-rw-r--r-- | etc/inc/services.inc | 2 | ||||
-rw-r--r-- | etc/inc/smtp.inc | 6 | ||||
-rw-r--r-- | etc/inc/system.inc | 2 | ||||
-rw-r--r-- | etc/inc/util.inc | 2 | ||||
-rw-r--r-- | etc/inc/voucher.inc | 12 | ||||
-rw-r--r-- | etc/inc/vpn.inc | 8 | ||||
-rw-r--r-- | etc/inc/xmlparse.inc | 4 | ||||
-rw-r--r-- | etc/inc/xmlparse_attr.inc | 4 | ||||
-rw-r--r-- | etc/inc/xmlrpc_client.inc | 2 |
22 files changed, 67 insertions, 67 deletions
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc index 59e9128..f48a9bc 100644 --- a/etc/inc/auth.inc +++ b/etc/inc/auth.inc @@ -930,7 +930,7 @@ function ldap_backed($username, $passwd, $authcfg) { /* Iterate through the user containers for search */ foreach ($ldac_splits as $i => $ldac_split) { /* Make sure we just use the first user we find */ - log_error(sprintf(gettext("Now Searching in server %1$s, container %2$s with filter %3$s."), $ldapname, $ldac_split, $ldapfilter)); + log_error(sprintf(gettext('Now Searching in server %1$s, container %2$s with filter %3$s.'), $ldapname, $ldac_split, $ldapfilter)); if ($ldapscope == "one") $ldapfunc = "ldap_list"; else @@ -963,12 +963,12 @@ function ldap_backed($username, $passwd, $authcfg) { /* Now lets bind as the user we found */ if (!($res = @ldap_bind($ldap, $userdn, $passwd))) { - log_error(sprintf(gettext("ERROR! Could not login to server %1$s as user %2$s."), $ldapname, $username)); + log_error(sprintf(gettext('ERROR! Could not login to server %1$s as user %2$s.'), $ldapname, $username)); @ldap_unbind($ldap); return false; } - log_error(sprintf(gettext("Logged in successfully as %1$s via LDAP server %2$s with DN = %3$s."), $username, $ldapname, $userdn)); + log_error(sprintf(gettext('Logged in successfully as %1$s via LDAP server %2$s with DN = %3$s.'), $username, $ldapname, $userdn)); /* At this point we are bound to LDAP so the user was auth'd okay. Close connection. */ @ldap_unbind($ldap); @@ -1147,7 +1147,7 @@ function session_auth() { $_SESSION['Logged_In'] = "True"; $_SESSION['Username'] = $_POST['usernamefld']; $_SESSION['last_access'] = time(); - log_error(sprintf(gettext("Successful login for user '%1$s' from: %2$s"), $_POST['usernamefld'], $_SERVER['REMOTE_ADDR'])); + log_error(sprintf(gettext("Successful login for user '%1\$s' from: %2\$s"), $_POST['usernamefld'], $_SERVER['REMOTE_ADDR'])); $HTTP_SERVER_VARS['AUTH_USER'] = $_SESSION['Username']; if (isset($_POST['postafterlogin'])) return true; @@ -1160,7 +1160,7 @@ function session_auth() { } else { /* give the user an error message */ $_SESSION['Login_Error'] = gettext("Username or Password incorrect"); - log_error(sprintf(gettext("Login attempt with user: '%1$s' from: '%2$s' failed."), $_POST['usernamefld'], $_SERVER['REMOTE_ADDR'])); + log_error(sprintf(gettext("Login attempt with user: '%1\$s' from: '%2\$s' failed."), $_POST['usernamefld'], $_SERVER['REMOTE_ADDR'])); if(isAjax()) { echo "showajaxmessage('{$_SESSION['Login_Error']}');"; return; @@ -1200,9 +1200,9 @@ function session_auth() { if (isset($_GET['logout'])) { if ($_SESSION['Logout']) - log_error(sprintf(gettext("Session timed out for user '%1$s' from: %2$s"), $_SESSION['Username'], $_SERVER['REMOTE_ADDR'])); + log_error(sprintf(gettext("Session timed out for user '%1\$s' from: %2\$s"), $_SESSION['Username'], $_SERVER['REMOTE_ADDR'])); else - log_error(sprintf(gettext("User logged out for user '%1$s' from: %2$s"), $_SESSION['Username'], $_SERVER['REMOTE_ADDR'])); + log_error(sprintf(gettext("User logged out for user '%1\$s' from: %2\$s"), $_SESSION['Username'], $_SERVER['REMOTE_ADDR'])); /* wipe out $_SESSION */ $_SESSION = array(); diff --git a/etc/inc/authgui.inc b/etc/inc/authgui.inc index 143e4a2..a42b9f9 100644 --- a/etc/inc/authgui.inc +++ b/etc/inc/authgui.inc @@ -88,7 +88,7 @@ function display_error_form($http_code, $desc) { global $config, $g; $g['theme'] = $config['theme']; if(isAjax()) { - printf(gettext("Error: %1$s Description: %2$s"), $http_code, $desc); + printf(gettext('Error: %1$s Description: %2$s'), $http_code, $desc); return; } diff --git a/etc/inc/cmd_chain.inc b/etc/inc/cmd_chain.inc index 399210e..4c1e69e 100644 --- a/etc/inc/cmd_chain.inc +++ b/etc/inc/cmd_chain.inc @@ -98,7 +98,7 @@ Class CmdCHAIN { $ignore_return_text = $cmd['ignore_return_text']; // Should we perform verbose debugging? if($this->is_debugging == true) { - log_error(sprintf(gettext("CmdCHAIN is executing -> %1$s - %2$s"), $cmd_title, $command)); + log_error(sprintf(gettext('CmdCHAIN is executing -> %1$s - %2$s'), $cmd_title, $command)); usleep(100); // give network stack time to deliver network syslog message } // Execute command @@ -106,9 +106,9 @@ Class CmdCHAIN { if($this->ignore_return_text == true) continue; if(intval($status) <> 0) { - log_error(sprintf(gettext("%s failed with return code -> %1$s. The command was %2$s"), $cmd_title, $status, $command)); + log_error(sprintf(gettext('%1$s failed with return code -> %2$s. The command was %3$s'), $cmd_title, $status, $command)); if($this->halt_on_errors == true) - return(sprintf(gettext("%s failed with return code -> %1$s. The command was %2$s"), $cmd_title, $status, $command)); + return(sprintf(gettext('%1$s failed with return code -> %2$s. The command was %3$s'), $cmd_title, $status, $command)); } } return; diff --git a/etc/inc/config.lib.inc b/etc/inc/config.lib.inc index 29576cb..ebcfb64 100644 --- a/etc/inc/config.lib.inc +++ b/etc/inc/config.lib.inc @@ -201,8 +201,8 @@ function restore_backup($file) { conf_mount_rw(); unlink_if_exists("{$g['tmp_path']}/config.cache"); copy("$file","/cf/conf/config.xml"); - log_error(sprintf(gettext("%1$s is restoring the configuration %2$s"), $g['product_name'], $file)); - file_notice("config.xml", sprintf(gettext("%1$s is restoring the configuration %2$s"), $g['product_name'], $file), "pfSenseConfigurator", ""); + log_error(sprintf(gettext('%1$s is restoring the configuration %2$s'), $g['product_name'], $file)); + file_notice("config.xml", sprintf(gettext('%1$s is restoring the configuration %2$s'), $g['product_name'], $file), "pfSenseConfigurator", ""); conf_mount_ro(); } } @@ -404,7 +404,7 @@ function convert_config() { log_error(sprintf(gettext("Ended Configuration upgrade at %s"), $now)); if ($prev_version != $config['version']) - write_config(sprintf(gettext("Upgraded config version level from %1$s to %2$s"), $prev_version, $config['version'])); + write_config(sprintf(gettext('Upgraded config version level from %1$s to %2$s'), $prev_version, $config['version'])); if($g['booting']) echo gettext("Loading new configuration..."); @@ -640,7 +640,7 @@ function config_validate($conffile) { while ($data = fread($fp, 4096)) { if (!xml_parse($xml_parser, $data, feof($fp))) { - $xmlerr = sprintf(gettext("%1$s at line %2$d"), + $xmlerr = sprintf(gettext('%1$s at line %2$d'), xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser)); return false; diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 211f33a..d01ac41 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -323,9 +323,9 @@ function filter_configure_sync() { $line_number = $line_error[1]; $line_split = file("{$g['tmp_path']}/rules.debug"); if(is_array($line_split)) - $line_error = sprintf(gettext("The line in question reads [%1$d]: %2$s"), $line_number, $line_split[$line_number-1]); + $line_error = sprintf(gettext('The line in question reads [%1$d]: %2$s'), $line_number, $line_split[$line_number-1]); if($line_error and $line_number) { - $error_msg = sprintf(gettext("There were error(s) loading the rules: %1$s - %2$s"), $rules_error, $line_error); + $error_msg = sprintf(gettext('There were error(s) loading the rules: %1$s - %2$s'), $rules_error, $line_error); file_notice("filter_load", $error_msg, "Filter Reload", ""); log_error($error_msg); update_filter_reload_status($error_msg); @@ -612,7 +612,7 @@ function filter_generate_gateways() { $gatewayip = $member['gwip']; if (($int <> "") && is_ipaddr($gatewayip)) { if ($g['debug']) - log_error(sprintf(gettext("Setting up route with %1$s on %2$s"), $gatewayip, $int)); + log_error(sprintf(gettext('Setting up route with %1$s on %2$s'), $gatewayip, $int)); if ($member['weight'] > 1) { $routeto .= str_repeat("( {$int} {$gatewayip} ) ", $member['weight']); } else @@ -1285,7 +1285,7 @@ function filter_nat_rules_generate() { } if($numberofnathosts > 0): foreach ($FilterIflist as $if => $ifcfg) { - update_filter_reload_status(sprintf(gettext("Creating outbound rules %1$s - (%2$s)"), $if, $ifcfg['descr'])); + update_filter_reload_status(sprintf(gettext('Creating outbound rules %1$s - (%2$s)'), $if, $ifcfg['descr'])); if(interface_has_gateway($if)) { $target = $ifcfg['ip']; /* create outbound nat entries for all local networks */ @@ -2701,12 +2701,12 @@ function discover_pkg_rules($ruletype) { $rules = ""; $files = glob("/usr/local/pkg/*.inc"); foreach($files as $pkg_inc) { - update_filter_reload_status(sprintf(gettext("Checking for %1$s PF hooks in package %2$s"), $ruletype, $pkg_inc)); + update_filter_reload_status(sprintf(gettext('Checking for %1$s PF hooks in package %2$s'), $ruletype, $pkg_inc)); require_once($pkg_inc); $pkg = basename($pkg_inc, ".inc"); $pkg_generate_rules = "{$pkg}_generate_rules"; if(function_exists($pkg_generate_rules)) { - update_filter_reload_status(sprintf(gettext("Processing early %1$s rules for package %2$s"), $ruletype, $pkg_inc)); + update_filter_reload_status(sprintf(gettext('Processing early %1$s rules for package %2$s'), $ruletype, $pkg_inc)); $tmprules = $pkg_generate_rules("$ruletype"); file_put_contents("{$g['tmp_path']}/rules.test.packages", $aliases . $tmprules); $status = mwexec("/sbin/pfctl -nf {$g['tmp_path']}/rules.test.packages"); diff --git a/etc/inc/filter_log.inc b/etc/inc/filter_log.inc index b027f6e..9fe6b6d 100644 --- a/etc/inc/filter_log.inc +++ b/etc/inc/filter_log.inc @@ -203,7 +203,7 @@ function get_port_with_service($port, $proto) { $service = getservbyport($port, $proto); $portstr = ""; if ($service) { - $portstr = sprintf(gettext("<span title=\"Service %1$s/%2$s: %3$s\">%4$s</span>"), $port, $proto, $service, htmlspecialchars($port)); + $portstr = sprintf('<span title="' . gettext('Service %1$s/%2$s: %3$s') . '">' . htmlspecialchars($port) . '</span>', $port, $proto, $service); } else { $portstr = htmlspecialchars($port); } diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 03cbf6f..66696a2 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -452,7 +452,7 @@ function dhclient_update_gateway_groups_defaultroute($interface = "wan") { } } if($changed && $current_gw) - write_config(sprintf(gettext("Updating gateway group gateway for %1$s - new gateway is %2$s"), $interfac, $current_gw)); + write_config(sprintf(gettext('Updating gateway group gateway for %1$s - new gateway is %2$s'), $interfac, $current_gw)); } function lookup_gateway_ip_by_name($name) { diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 93ff163..78a883b 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1113,7 +1113,7 @@ function interface_ppps_configure($interface) { */ } if(!is_ipaddr($gateways[$pid])){ - log_error(sprintf(gettext("Could not get a PPTP/L2TP Remote IP address from %1$s for %2$s in interfaces_ppps_configure."), $dhcp_gateway, $gway)); + log_error(sprintf(gettext('Could not get a PPTP/L2TP Remote IP address from %1$s for %2$s in interfaces_ppps_configure.'), $dhcp_gateway, $gway)); return 0; } break; @@ -1737,7 +1737,7 @@ function interface_carpdev_configure(&$vip) { if($vip['password'] != "") $password = " pass \"" . $vip_password . "\""; - log_error(sprintf(gettext("Found carpdev interface %1$s on top of interface %2$s"), $vip['interface'], $interface)); + log_error(sprintf(gettext('Found carpdev interface %1$s on top of interface %2$s'), $vip['interface'], $interface)); if (empty($vip['interface'])) return; @@ -1853,7 +1853,7 @@ function interface_wireless_clone($realif, $wlcfg) { // example: wlan2 exec("/sbin/ifconfig wlan create wlandev {$baseif} {$mode} bssid 2>&1", $out, $ret); if($ret <> 0) { - log_error(sprintf(gettext("Failed to clone interface %1$s with error code %2$s, output %3$s"), $baseif, $ret, $out[0])); + log_error(sprintf(gettext('Failed to clone interface %1$s with error code %2$s, output %3$s'), $baseif, $ret, $out[0])); return false; } $newif = trim($out[0]); @@ -2397,7 +2397,7 @@ function interface_configure($interface = "wan", $reloadall = false, $linkupeven " link " . escapeshellarg($random_mac)); $wancfg['spoofmac'] = $random_mac; write_config(); - file_notice("MAC Address altered", sprintf(gettext("The INVALID MAC address (ff:ff:ff:ff:ff:ff) on interface %1$s has been automatically replaced with %2$s"), $realif, $random_mac), "Interfaces"); + file_notice("MAC Address altered", sprintf(gettext('The INVALID MAC address (ff:ff:ff:ff:ff:ff) on interface %1$s has been automatically replaced with %2$s'), $realif, $random_mac), "Interfaces"); } } diff --git a/etc/inc/meta.inc b/etc/inc/meta.inc index 4216185..cad7942 100644 --- a/etc/inc/meta.inc +++ b/etc/inc/meta.inc @@ -129,7 +129,7 @@ function read_file_metadata($fpath, & $metadata, $taglist = false) { $tagend = substr($fdata, $tagend_off + 4, $tagend_len - 4); if ($tagbeg != $tagend) { - printf(gettext("error: tag mismatch ( %1$s != %2$s ) in '%3$s'%4$s"), $tagbeg, $tagend, $fpath, "\n"); + printf(gettext("error: tag mismatch ( %1\$s != %2\$s ) in '%3\$s'%4\$s"), $tagbeg, $tagend, $fpath, "\n"); break; } @@ -140,7 +140,7 @@ function read_file_metadata($fpath, & $metadata, $taglist = false) { $mdata = substr($fdata, $mdata_off, $mdata_len); if (!strlen($mdata)) { - printf(gettext("warning: tag %1$s has no data in '%2$s'%3$s"), $tagbeg, $fpath, "\n"); + printf(gettext("warning: tag %1\$s has no data in '%2\$s'%3\$s"), $tagbeg, $fpath, "\n"); break; } @@ -160,7 +160,7 @@ function read_file_metadata($fpath, & $metadata, $taglist = false) { $valtag = stripos($line, "##|*"); if ($valtag === false || $valtag) { - printf(gettext("warning: tag %1$s has malformed data in '%2$s'%3$s"), $tagbeg, $fpath, "\n"); + printf(gettext("warning: tag %1\$s has malformed data in '%2\$s'%3\$s"), $tagbeg, $fpath, "\n"); continue; } @@ -182,7 +182,7 @@ function read_file_metadata($fpath, & $metadata, $taglist = false) { } if (!isset($vname) || !isset($vdata)) { - printf(gettext("warning: tag %1$s has invalid data in '%2$s'%3$s"), $tagbeg, $fpath, "\n"); + printf(gettext("warning: tag %1\$s has invalid data in '%2\$s'%3\$s"), $tagbeg, $fpath, "\n"); continue; } diff --git a/etc/inc/notices.inc b/etc/inc/notices.inc index 224e680..f1510ee 100644 --- a/etc/inc/notices.inc +++ b/etc/inc/notices.inc @@ -326,8 +326,8 @@ function notify_via_smtp($message) { log_error(sprintf(gettext("Message sent to %s OK"), $to)); return; } else { - log_error(sprintf(gettext("Could not send the message to %1$s -- Error: %2$s"), $to, $smtp->error)); - return(sprintf(gettext("Could not send the message to %1$s -- Error: %2$s"), $to, $smtp->error)); + log_error(sprintf(gettext('Could not send the message to %1$s -- Error: %2$s'), $to, $smtp->error)); + return(sprintf(gettext('Could not send the message to %1$s -- Error: %2$s'), $to, $smtp->error)); } } diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 8e0233e..8bfb3ec 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -483,7 +483,7 @@ function WakeOnLan($addr, $mac) $s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); if ($s == false) { 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)))); + 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); @@ -491,7 +491,7 @@ function WakeOnLan($addr, $mac) 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(sprintf(gettext("Magic Packet sent (%1$s) to {%2$s} MAC=%3$s"), $e, $addr, $mac)); + log_error(sprintf(gettext('Magic Packet sent (%1$s) to {%2$s} MAC=%3$s'), $e, $addr, $mac)); return true; } @@ -737,7 +737,7 @@ function call_pfsense_method($method, $params, $timeout = 0) { log_error(sprintf(gettext("XMLRPC communication error: %s"), $cli->errstr)); return false; } elseif($resp->faultCode()) { - log_error(sprintf(gettext("XMLRPC request failed with error %1$s: %2$s"), $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()); @@ -1402,7 +1402,7 @@ function compare_hostname_to_dnscache($hostname) { if(trim($oldcontents) != trim($contents)) { if($g['debug']) { - log_error(sprintf(gettext("DNSCACHE: Found old IP %1$s and new IP %2$s"), $oldcontents, $contents)); + log_error(sprintf(gettext('DNSCACHE: Found old IP %1$s and new IP %2$s'), $oldcontents, $contents)); } return ($oldcontents); } else { @@ -1573,7 +1573,7 @@ function update_alias_names_upon_change($section, $subsection, $fielda, $fieldb, for ($i = 0; isset($config["$section"]["$subsection"][$i]["$fielda"]); $i++) { if($debug) fwrite($fd, "$i\n"); if($config["$section"]["$subsection"][$i]["$fielda"]["$fieldb"] == $origname) { - if($debug) fwrite($fd, sprintf(gettext("Setting old alias value %1$s to %2$s%3$s"), $origname, $new_alias_name, "\n")); + if($debug) fwrite($fd, sprintf(gettext('Setting old alias value %1$s to %2$s%3$s'), $origname, $new_alias_name, "\n")); $config["$section"]["$subsection"][$i]["$fielda"]["$fieldb"] = $new_alias_name; } } @@ -1582,7 +1582,7 @@ function update_alias_names_upon_change($section, $subsection, $fielda, $fieldb, for ($i = 0; isset($config["$section"]["$subsection"][$i]["$fielda"]); $i++) { if($config["$section"]["$subsection"][$i]["$fielda"] == $origname) { $config["$section"]["$subsection"][$i]["$fielda"] = $new_alias_name; - if($debug) fwrite($fd, sprintf(gettext("Setting old alias value %1$s to %2$s%3$s"), $origname, $new_alias_name, "\n")); + if($debug) fwrite($fd, sprintf(gettext('Setting old alias value %1$s to %2$s%3$s'), $origname, $new_alias_name, "\n")); } } } diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index cbeb855..e88897c 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -236,7 +236,7 @@ function get_pkg_depends($pkg_name, $filetype = ".xml", $format = "files", $retu $package =& $config['installedpackages']['package'][$pkg_id]; if(!file_exists("/usr/local/pkg/" . $package['configurationfile'])) { - log_error(sprintf(gettext("The %1$s package is missing required dependencies and must be reinstalled. %2$s"), $package['name'], $package['configurationfile'])); + log_error(sprintf(gettext('The %1$s package is missing required dependencies and must be reinstalled. %2$s'), $package['name'], $package['configurationfile'])); uninstall_package_from_name($package['name']); install_package($package['name']); return; @@ -662,7 +662,7 @@ function install_package_xml($pkg) { fwrite($fd_log, print_r($tarout, true) . "\n"); } if($pkg_chmod <> "") { - fwrite($fd_log, sprintf(gettext("Changing file mode to %1$s for %2$s%3$s%4$s"), $pkg_chmod, $prefix, $filename, "\n")); + fwrite($fd_log, sprintf(gettext('Changing file mode to %1$s for %2$s%3$s%4$s'), $pkg_chmod, $prefix, $filename, "\n")); @chmod($prefix . $filename, $pkg_chmod); system("/bin/chmod {$pkg_chmod} {$prefix}{$filename}"); } diff --git a/etc/inc/rrd.inc b/etc/inc/rrd.inc index 34ed887..365ba9f 100644 --- a/etc/inc/rrd.inc +++ b/etc/inc/rrd.inc @@ -42,7 +42,7 @@ function dump_rrd_to_xml($rrddatabase, $xmldumpfile) { exec("$rrdtool dump {$rrddatabase} {$xmldumpfile} 2>&1", $dumpout, $dumpret); if ($dumpret <> 0) { $dumpout = implode(" ", $dumpout); - log_error(sprintf(gettext("RRD dump failed exited with %1$s, the error is: %2$s"), $dumpret, $dumpout)); + log_error(sprintf(gettext('RRD dump failed exited with %1$s, the error is: %2$s'), $dumpret, $dumpout)); } return($dumpret); } @@ -53,7 +53,7 @@ function create_new_rrd($rrdcreatecmd) { exec("$rrdcreatecmd 2>&1", $rrdcreateoutput, $rrdcreatereturn); if ($rrdcreatereturn <> 0) { $rrdcreateoutput = implode(" ", $rrdcreateoutput); - log_error(sprintf(gettext("RRD create failed exited with %1$s, the error is: %2$s"), $rrdcreatereturn, $rrdcreateoutput)); + log_error(sprintf(gettext('RRD create failed exited with %1$s, the error is: %2$s'), $rrdcreatereturn, $rrdcreateoutput)); } return $rrdcreatereturn; } @@ -67,7 +67,7 @@ function migrate_rrd_format($rrdoldxml, $rrdnewxml) { $numdsold = count($rrdoldxml['ds']); $numrranew = count($rrdnewxml['rra']); $numdsnew = count($rrdnewxml['ds']); - log_error(sprintf(gettext("Import RRD has %1$s DS values and %2$s RRA databases, new format RRD has %3$s DS values and %4$s RRA databases"), $numdsold, $numrraold, $numdsnew ,$numrranew)); + log_error(sprintf(gettext('Import RRD has %1$s DS values and %2$s RRA databases, new format RRD has %3$s DS values and %4$s RRA databases'), $numdsold, $numrraold, $numdsnew ,$numrranew)); /* add data sources not found in the old array from the new array */ $i = 0; @@ -151,7 +151,7 @@ function migrate_rrd_format($rrdoldxml, $rrdnewxml) { $numrranew = count($rrdoldxml['rra']); $numdsnew = count($rrdoldxml['ds']); - log_error(sprintf(gettext("The new RRD now has %1$s DS values and %2$s RRA databases"), $numdsnew, $numrranew)); + log_error(sprintf(gettext('The new RRD now has %1$s DS values and %2$s RRA databases'), $numdsnew, $numrranew)); return $rrdoldxml; } @@ -238,7 +238,7 @@ function enable_rrd_graphing() { exec("cd /;LANG=C /usr/bin/tar -xzf {$g['cf_conf_path']}/rrd.tgz 2>&1", $rrdrestore, $rrdreturn); $rrdrestore = implode(" ", $rrdrestore); if($rrdreturn <> 0) { - log_error(sprintf(gettext("RRD restore failed exited with %1$s, the error is: %2$s%3$s"), $rrdreturn, $rrdrestore, "\n")); + log_error(sprintf(gettext('RRD restore failed exited with %1$s, the error is: %2$s%3$s'), $rrdreturn, $rrdrestore, "\n")); } } } diff --git a/etc/inc/services.inc b/etc/inc/services.inc index b784108..c91071c 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -94,7 +94,7 @@ function services_dhcpd_configure() { exec("cd /;LANG=C /usr/bin/tar -xzf {$g['cf_conf_path']}/dhcpleases.tgz 2>&1", $dhcprestore, $dhcpreturn); $dhcprestore = implode(" ", $dhcprestore); if($dhcpreturn <> 0) { - log_error(sprintf(gettext("DHCP leases restore failed exited with %1$s, the error is: %2$s%3$s"), $dhcpreturn, $dhcprestore, "\n")); + log_error(sprintf(gettext('DHCP leases restore failed exited with %1$s, the error is: %2$s%3$s'), $dhcpreturn, $dhcprestore, "\n")); } } } diff --git a/etc/inc/smtp.inc b/etc/inc/smtp.inc index c33978d..1f371f6 100644 --- a/etc/inc/smtp.inc +++ b/etc/inc/smtp.inc @@ -236,7 +236,7 @@ class smtp_class && !strcmp(@gethostbyname($this->exclude_address),$ip)) return(sprintf(gettext("domain \"%s\" resolved to an address excluded to be valid"), $domain)); if($this->debug) - $this->OutputDebug(sprintf(gettext("Connecting to host address \"%1$s\" port %2$s..."), $ip, $port)); + $this->OutputDebug(sprintf(gettext('Connecting to host address "%1$s" port %2$s...'), $ip, $port)); if(($this->connection=($this->timeout ? @fsockopen(($this->ssl ? "ssl://" : "").$ip,$port,$errno,$error,$this->timeout) : @fsockopen(($this->ssl ? "ssl://" : "").$ip,$port)))) return(""); $error=($this->timeout ? strval($error) : "??"); @@ -253,7 +253,7 @@ class smtp_class case "-7": return(gettext("-7 setvbuf() call failed")); } - return(sprintf(gettext("could not connect to the host \"%1$s\": %2$s"), $domain, $error)); + return(sprintf(gettext('could not connect to the host "%1$s": %2$s'), $domain, $error)); } Function SASLAuthenticate($mechanisms, $credentials, &$authenticated, &$mechanism) @@ -286,7 +286,7 @@ class smtp_class case SASL_NOMECH: if(strlen($this->authentication_mechanism)) { - $this->error=printf(gettext("authenticated mechanism %1$s may not be used: %2$s"), $this->authentication_mechanism, $sasl->error); + $this->error=printf(gettext('authenticated mechanism %1$s may not be used: %2$s'), $this->authentication_mechanism, $sasl->error); return(0); } break; diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 59ea4ea..69fb427 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -362,7 +362,7 @@ function system_routing_configure($interface = "") { if(isset($route_arr['default'])) { $action = "change"; } - log_error(sprintf(gettext("ROUTING: %1$s default route to %2$s"), $action, $gatewayip)); + log_error(sprintf(gettext('ROUTING: %1$s default route to %2$s'), $action, $gatewayip)); mwexec("/sbin/route {$action} default " . escapeshellarg($gatewayip)); } } diff --git a/etc/inc/util.inc b/etc/inc/util.inc index a46fae3..3517c32 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -783,7 +783,7 @@ function mwexec($command, $mute = false) { $mute = false; if(($retval <> 0) && ($mute === false)) { $output = implode(" ", $oarr); - log_error(sprintf(gettext("The command '%1$s' returned exit code '%2$d', the output was '%3$s' "), $command, $retval, $output)); + log_error(sprintf(gettext("The command '%1\$s' returned exit code '%2\$d', the output was '%3\$s' "), $command, $retval, $output)); } return $retval; } diff --git a/etc/inc/voucher.inc b/etc/inc/voucher.inc index 58c6dc5..27e6763 100644 --- a/etc/inc/voucher.inc +++ b/etc/inc/voucher.inc @@ -153,7 +153,7 @@ function voucher_auth($voucher_received, $test = 0) { list($timestamp,$minutes) = explode(",", $line); // we have an already active voucher here. $remaining = intval((($timestamp + 60*$minutes) - time())/60); - $test_result[] = sprintf(gettext("%1$s (%2$s/%3$s) active and good for %4$d Minutes"), $voucher, $roll, $nr, $remaining); + $test_result[] = sprintf(gettext('%1$s (%2$s/%3$s) active and good for %4$d Minutes'), $voucher, $roll, $nr, $remaining); $total_minutes += $remaining; } else { // voucher not used. Check if ticket Id is on the roll (not too high) @@ -164,18 +164,18 @@ function voucher_auth($voucher_received, $test = 0) { $pos = $nr >> 3; // divide by 8 -> octet $mask = 1 << ($nr % 8); if (ord($bitstring[$roll][$pos]) & $mask) { - $test_result[] = sprintf(gettext("%1$s (%2$s/%3$s) already used and expired"), $voucher, $roll, $nr); + $test_result[] = sprintf(gettext('%1$s (%2$s/%3$s) already used and expired'), $voucher, $roll, $nr); $total_minutes = -1; // voucher expired $error++; } else { // mark bit for this voucher as used $bitstring[$roll][$pos] = chr(ord($bitstring[$roll][$pos]) | $mask); - $test_result[] = sprintf(gettext("%1$s (%2$s/%3$) good for %4$d Minutes"), $voucher, $roll, $nr, $minutes_per_roll[$roll]); + $test_result[] = sprintf(gettext('%1$s (%2$s/%3$) good for %4$d Minutes'), $voucher, $roll, $nr, $minutes_per_roll[$roll]); $total_minutes += $minutes_per_roll[$roll]; } } } else { - $test_result[] = sprintf(gettext("%1$s (%2$s/%3$s): not found on any registererd Roll"), $voucher, $roll, $nr); + $test_result[] = sprintf(gettext('%1$s (%2$s/%3$s): not found on any registererd Roll'), $voucher, $roll, $nr); } } else { // hmm, thats weird ... not what I expected @@ -339,7 +339,7 @@ function voucher_write_used_db($roll, $vdb) { fwrite($fd, $vdb . "\n"); fclose($fd); } else { - voucher_log(LOG_ERR, sprintf(gettext("cant write %1$s/voucher_used_%2$s.db"), $g['vardb_path'], $roll)); + voucher_log(LOG_ERR, sprintf(gettext('cant write %1$s/voucher_used_%2$s.db'), $g['vardb_path'], $roll)); } } @@ -418,7 +418,7 @@ function voucher_read_used_db($roll) { $vdb = trim(fgets($fd)); fclose($fd); } else { - voucher_log(LOG_ERR, sprintf(gettext("cant read %1$s/voucher_used_%2$s.db"), $g['vardb_path'], $roll)); + voucher_log(LOG_ERR, sprintf(gettext('cant read %1$s/voucher_used_%2$s.db'), $g['vardb_path'], $roll)); } } return base64_decode($vdb); diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc index c5802fc..040184a 100644 --- a/etc/inc/vpn.inc +++ b/etc/inc/vpn.inc @@ -839,7 +839,7 @@ EOD; if(is_ipaddr($gatewayip)) { /* FIXME: does adding route-to and reply-to on the in/outbound * rules fix this? smos@ 13-01-2009 */ - log_error(sprintf(gettext("IPSEC interface is not WAN but %1$s, adding static route for VPN endpoint %2$s via %3$s"), $parentinterface, $rgip, $gatewayip)); + log_error(sprintf(gettext('IPSEC interface is not WAN but %1$s, adding static route for VPN endpoint %2$s via %3$s'), $parentinterface, $rgip, $gatewayip)); mwexec("/sbin/route delete -host {$rgip}"); mwexec("/sbin/route add -host {$rgip} {$gatewayip}"); } @@ -1650,10 +1650,10 @@ function reload_tunnel_spd_policy($phase1, $phase2, $old_phase1, $old_phase2) { } if((!is_ipaddr($old_ep)) || (! is_ipaddr($ep))) { - log_error(sprintf(gettext("IPSEC: ERROR: One of the endpoints is not a IP address. Old EP '%1$s' new EP '%2$s'"), $old_ep, $ep)); + log_error(sprintf(gettext("IPSEC: ERROR: One of the endpoints is not a IP address. Old EP '%1\$s' new EP '%2\$s'"), $old_ep, $ep)); } if((! is_ipaddr($rgip)) || (! is_ipaddr($old_gw))) { - log_error(sprintf(gettext("IPSEC: ERROR: One of the remote endpoints is not a IP address. Old RG '%1$s' new RG '%2$s'"), $old_gw, $rgip)); + log_error(sprintf(gettext("IPSEC: ERROR: One of the remote endpoints is not a IP address. Old RG '%1\$s' new RG '%2\$s'"), $old_gw, $rgip)); } $spdconf = ""; @@ -1699,7 +1699,7 @@ function reload_tunnel_spd_policy($phase1, $phase2, $old_phase1, $old_phase2) { "{$phase2['protocol']}/tunnel/{$rgip}-" . "{$ep}/unique;\n"; - log_error(sprintf(gettext("Reloading IPsec tunnel '%1$s'. Previous IP '%2$s', current IP '%3$s'. Reloading policy"), $phase1['descr'], $old_gw, $rgip)); + log_error(sprintf(gettext("Reloading IPsec tunnel '%1\$s'. Previous IP '%2\$s', current IP '%3\$s'. Reloading policy"), $phase1['descr'], $old_gw, $rgip)); $now = time(); $spdfile = tempnam("{$g['tmp_path']}", "spd.conf.reload.{$now}."); diff --git a/etc/inc/xmlparse.inc b/etc/inc/xmlparse.inc index 79bbad0..1738370 100644 --- a/etc/inc/xmlparse.inc +++ b/etc/inc/xmlparse.inc @@ -82,7 +82,7 @@ function startElement($parser, $name, $attrs) { } else if (isset($ptr)) { /* multiple entries not allowed for this element, bail out */ - die(sprintf(gettext("XML error: %1$s at line %2$d cannot occur more than once") . "\n", + die(sprintf(gettext('XML error: %1$s at line %2$d cannot occur more than once') . "\n", $name, xml_get_current_line_number($parser))); } @@ -179,7 +179,7 @@ function parse_xml_config_raw($cffile, $rootobj, $isstring = "false") { while ($data = fread($fp, 4096)) { if (!xml_parse($xml_parser, $data, feof($fp))) { - log_error(sprintf(gettext("XML error: %1$s at line %2$d") . "\n", + log_error(sprintf(gettext('XML error: %1$s at line %2$d') . "\n", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); return -1; diff --git a/etc/inc/xmlparse_attr.inc b/etc/inc/xmlparse_attr.inc index 534ffb5..933caba 100644 --- a/etc/inc/xmlparse_attr.inc +++ b/etc/inc/xmlparse_attr.inc @@ -75,7 +75,7 @@ function startElement_attr($parser, $name, $attrs) { } else if (isset($ptr)) { /* multiple entries not allowed for this element, bail out */ - die(sprintf(gettext("XML error: %1$s at line %2$d cannot occur more than once") . "\n", + die(sprintf(gettext('XML error: %1$s at line %2$d cannot occur more than once') . "\n", $name, xml_get_current_line_number($parser))); } else if (isset($writeattrs)) { @@ -194,7 +194,7 @@ function parse_xml_config_raw_attr($cffile, $rootobj, &$parsed_attributes, $isst while ($data = fread($fp, 4096)) { if (!xml_parse($xml_parser, $data, feof($fp))) { - log_error(sprintf(gettext("XML error: %1$s at line %2$d") . "\n", + log_error(sprintf(gettext('XML error: %1$s at line %2$d') . "\n", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); if (isset($parsed_attributes)) { diff --git a/etc/inc/xmlrpc_client.inc b/etc/inc/xmlrpc_client.inc index bd0f1bd..5a9f559 100644 --- a/etc/inc/xmlrpc_client.inc +++ b/etc/inc/xmlrpc_client.inc @@ -303,7 +303,7 @@ function XML_RPC_se($parser_resource, $name, $attrs) if (!in_array($XML_RPC_xh[$parser]['stack'][0], $XML_RPC_valid_parents[$name])) { $name = $GLOBALS['XML_RPC_func_ereg_replace']('[^a-zA-Z0-9._-]', '', $name); $XML_RPC_xh[$parser]['isf'] = 2; - $XML_RPC_xh[$parser]['isf_reason'] = sprintf(gettext("xmlrpc element %1$s cannot be child of %2$s"), $name, $XML_RPC_xh[$parser]['stack'][0]); + $XML_RPC_xh[$parser]['isf_reason'] = sprintf(gettext('xmlrpc element %1$s cannot be child of %2$s'), $name, $XML_RPC_xh[$parser]['stack'][0]); return; } } |