From da0031765e65735ceb404fc1bb28f564d727cc66 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Fri, 13 Aug 2010 13:32:53 -0300 Subject: Implement gettext() calls on array_intersect_key.inc --- etc/inc/array_intersect_key.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etc/inc/array_intersect_key.inc b/etc/inc/array_intersect_key.inc index 0cd5099..c1416ad 100644 --- a/etc/inc/array_intersect_key.inc +++ b/etc/inc/array_intersect_key.inc @@ -34,7 +34,7 @@ if (!function_exists('array_intersect_key')) { { $args = func_get_args(); if (count($args) < 2) { - user_error('Wrong parameter count for array_intersect_key()', E_USER_WARNING); + user_error(gettext('Wrong parameter count for array_intersect_key()'), E_USER_WARNING); return; } @@ -42,8 +42,8 @@ if (!function_exists('array_intersect_key')) { $array_count = count($args); for ($i = 0; $i !== $array_count; $i++) { if (!is_array($args[$i])) { - user_error('array_intersect_key() Argument #' . - ($i + 1) . ' is not an array', E_USER_WARNING); + user_error(gettext('array_intersect_key() Argument #') . + ($i + 1) . gettext(' is not an array'), E_USER_WARNING); return; } } @@ -64,4 +64,4 @@ if (!function_exists('array_intersect_key')) { } } -?> \ No newline at end of file +?> -- cgit v1.1 From 0b70d9f421d23841eaf9c976b904f3bb611912f9 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Fri, 13 Aug 2010 13:52:39 -0300 Subject: Implement gettext() calls on authgui.inc --- etc/inc/authgui.inc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/etc/inc/authgui.inc b/etc/inc/authgui.inc index 27e4c88..97b2899 100644 --- a/etc/inc/authgui.inc +++ b/etc/inc/authgui.inc @@ -64,7 +64,7 @@ if (!isAllowedPage($_SERVER['SCRIPT_NAME'])) { pfSenseHeader("/{$page}"); exit; } else { - display_error_form("201", "No page assigned to this user! Click here to logout."); + display_error_form("201", gettext("No page assigned to this user! Click here to logout.")); exit; } } else @@ -88,7 +88,7 @@ function display_error_form($http_code, $desc) { global $config, $g; $g['theme'] = $config['theme']; if(isAjax()) { - echo "Error: {$http_code} Description: {$desc}"; + printf(gettext("Error: %s Description: %s"), $http_code, $desc); return; } @@ -151,13 +151,13 @@ function display_login_form() { if(isAjax()) { if (isset($_POST['login'])) { if($_SESSION['Logged_In'] <> "True") { - isset($_SESSION['Login_Error']) ? $login_error = $_SESSION['Login_Error'] : $login_error = "unknown reason"; - echo "showajaxmessage('Invalid login ({$login_error}).');"; + isset($_SESSION['Login_Error']) ? $login_error = $_SESSION['Login_Error'] : $login_error = gettext("unknown reason"); + printf(gettext("showajaxmessage('Invalid login (%s).')"), $login_error); } if (file_exists("{$g['tmp_path']}/webconfigurator.lock")) { // TODO: add the IP from the user who did lock the device $whom = file_get_contents("{$g['tmp_path']}/webconfigurator.lock"); - echo "showajaxmessage('This device is currently beeing maintained by: {$whom}.');"; + printf(gettext("showajaxmessage('This device is currently beeing maintained by: %s.');"), $whom); } } exit; @@ -232,14 +232,14 @@ if($config['virtualip'])

- :
+


- :
+

@@ -261,4 +261,4 @@ if($config['virtualip']) \ No newline at end of file +?> -- cgit v1.1 From 940214048fa9582a560caefe44973a183beee009 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Fri, 13 Aug 2010 16:23:37 -0300 Subject: Implement gettext() calls on auth.inc --- etc/inc/auth.inc | 72 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc index f85f897..77e4aa5 100644 --- a/etc/inc/auth.inc +++ b/etc/inc/auth.inc @@ -81,7 +81,7 @@ if (function_exists("display_error_form") && !isset($config['system']['webgui'][ $found_host = true; if($found_host == false) { - display_error_form("501", "Potential DNS Rebind attack detected, see http://en.wikipedia.org/wiki/DNS_rebinding"); + display_error_form("501", gettext("Potential DNS Rebind attack detected, see http://en.wikipedia.org/wiki/DNS_rebinding")); exit; } } @@ -225,7 +225,7 @@ function local_sync_accounts() { continue; $cmd = "/usr/sbin/pw userdel {$line[2]}"; if($debug) - log_error("Running: {$cmd}"); + log_error(sprintf(gettext("Running: %s"), $cmd)); mwexec($cmd); } pclose($fd); @@ -245,7 +245,7 @@ function local_sync_accounts() { continue; $cmd = "/usr/sbin/pw groupdel {$line[2]}"; if($debug) - log_error("Running: {$cmd}"); + log_error(sprintf(gettext("Running: %s"), $cmd)); mwexec($cmd); } pclose($fd); @@ -309,7 +309,7 @@ function local_user_set(& $user) { if ($user_uid == 0) { $cmd = "/usr/sbin/pw usermod -q -n root -s /bin/sh -H 0"; if($debug) - log_error("Running: {$cmd}"); + log_error(sprintf(gettext("Running: %s"), $cmd)); $fd = popen($cmd, "w"); fwrite($fd, $user['password']); pclose($fd); @@ -336,7 +336,7 @@ function local_user_set(& $user) { " -c ".escapeshellarg($user['fullname'])." -H 0 2>&1"; if($debug) - log_error("Running: {$cmd}"); + log_error(sprintf(gettext("Running: %s"), $cmd)); $fd = popen($cmd, "w"); fwrite($fd, $user['password']); pclose($fd); @@ -380,7 +380,7 @@ function local_user_del($user) { $cmd = "/usr/sbin/pw userdel {$user['name']} {$rmhome}"; if($debug) - log_error("Running: {$cmd}"); + log_error(sprintf(gettext("Running: %s"), $cmd)); mwexec($cmd); /* Delete user from groups needs a call to write_config() */ @@ -507,7 +507,7 @@ function local_group_set($group, $reset = false) { $cmd = "/usr/sbin/pw {$group_op} {$group_name} -g {$group_gid} -M {$group_members} 2>&1"; if($debug) - log_error("Running: {$cmd}"); + log_error(sprintf(gettext("Running: %s"), $cmd)); mwexec($cmd); } @@ -519,7 +519,7 @@ function local_group_del($group) { $cmd = "/usr/sbin/pw groupdel {$group['name']}"; if($debug) - log_error("Running: {$cmd}"); + log_error(sprintf(gettext("Running: %s"), $cmd)); mwexec($cmd); } @@ -553,7 +553,7 @@ function ldap_test_connection($authcfg) { $error = true; if ($error == true) { - log_error("ERROR! Could not connect to server {$ldapname}."); + log_error(sprintf(gettext("ERROR! Could not connect to server %s."), $ldapname)); return false; } @@ -595,7 +595,7 @@ function ldap_test_bind($authcfg) { $error = true; if ($error == true) { - log_error("ERROR! Could not connect to server {$ldapname}."); + log_error(sprintf(gettext("ERROR! Could not connect to server %s."), $ldapname)); return false; } @@ -648,7 +648,7 @@ function ldap_get_user_ous($show_complete_ou=true, $authcfg) { /* first check if there is even an LDAP server populated */ if(!$ldapserver) { - log_error("ERROR! ldap_get_user_ous() backed selected with no LDAP authentication server defined."); + log_error(gettext("ERROR! ldap_get_user_ous() backed selected with no LDAP authentication server defined.")); return $ous; } @@ -662,7 +662,7 @@ function ldap_get_user_ous($show_complete_ou=true, $authcfg) { $error = true; if ($error == true) { - log_error("ERROR! Could not connect to server {$ldapname}."); + log_error(sprintf(gettext("ERROR! Could not connect to server %s."), $ldapname)); return $ous; } @@ -673,12 +673,12 @@ function ldap_get_user_ous($show_complete_ou=true, $authcfg) { if ($ldapanon == true) { if (!($res = @ldap_bind($ldap))) { - log_error("ERROR! ldap_get_user_ous() could not bind anonymously to server {$ldapname}."); + log_error(sprintf(gettext("ERROR! ldap_get_user_ous() could not bind anonymously to server %s."), $ldapname)); @ldap_close($ldap); return $ous; } } else if (!($res = @ldap_bind($ldap, $ldapbindun, $ldapbindpw))) { - log_error("ERROR! ldap_get_user_ous() could not bind to server {$ldapname}."); + log_error(sprintf(gettext("ERROR! ldap_get_user_ous() could not bind to server %s."), $ldapname)); @ldap_close($ldap); return $ous; } @@ -773,7 +773,7 @@ function ldap_get_groups($username, $authcfg) { $error = true; if ($error == true) { - log_error("ERROR! ldap_get_groups() Could not connect to server {$ldapname}."); + log_error(sprintf(gettext("ERROR! ldap_get_groups() Could not connect to server %s."), $ldapname)); return memberof; } @@ -783,12 +783,12 @@ function ldap_get_groups($username, $authcfg) { /* bind as user that has rights to read group attributes */ if ($ldapanon == true) { if (!($res = @ldap_bind($ldap))) { - log_error("ERROR! ldap_get_groups() could not bind anonymously to server {$ldapname}."); + log_error(sprintf(gettext("ERROR! ldap_get_groups() could not bind anonymously to server %s."), $ldapname)); @ldap_close($ldap); return false; } } else if (!($res = @ldap_bind($ldap, $ldapbindun, $ldapbindpw))) { - log_error("ERROR! ldap_get_groups() could not bind to server {$ldapname}."); + log_error(sprintf(gettext("ERROR! ldap_get_groups() could not bind to server %s."), $ldapname)); @ldap_close($ldap); return memberof; } @@ -872,10 +872,10 @@ function ldap_backed($username, $passwd, $authcfg) { /* first check if there is even an LDAP server populated */ if(!$ldapserver) { if ($ldapfallback) { - log_error("ERROR! ldap_backed() called with no LDAP authentication server defined. Defaulting to local user database. Visit System -> User Manager."); + log_error(gettext("ERROR! ldap_backed() called with no LDAP authentication server defined. Defaulting to local user database. Visit System -> User Manager.")); return local_backed($username, $passwd); } else - log_error("ERROR! ldap_backed() called with no LDAP authentication server defined."); + log_error(gettext("ERROR! ldap_backed() called with no LDAP authentication server defined.")); return false; } @@ -893,7 +893,7 @@ function ldap_backed($username, $passwd, $authcfg) { $error = true; if ($error == true) { - log_error("ERROR! Could not connect to server {$ldapname}."); + log_error(sprintf(gettext("ERROR! Could not connect to server %s."), $ldapname)); return false; } @@ -907,7 +907,7 @@ function ldap_backed($username, $passwd, $authcfg) { if ($error == true) { @ldap_close($ldap); - log_error("ERROR! Could not bind to server {$ldapname}."); + log_error(sprintf(gettext("ERROR! Could not bind to server %s."), $ldapname)); return false; } @@ -924,11 +924,11 @@ function ldap_backed($username, $passwd, $authcfg) { /* Person. To later be used by ldap_get_groups. */ /* that way we don't have to search twice. */ /*****************************************************************/ - log_error("Now Searching for {$username} in directory."); + log_error(sprintf(gettext("Now Searching for %s in directory."), $username)); /* 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("Now Searching in server {$ldapname}, container {$ldac_split} with filter {$ldapfilter}."); + log_error(sprintf(gettext("Now Searching in server %s, container %s with filter %s."), $ldapname, $ldac_split, $ldapfilter)); if ($ldapscope == "one") $ldapfunc = "ldap_list"; else @@ -939,7 +939,7 @@ function ldap_backed($username, $passwd, $authcfg) { else $search = @$ldapfunc($ldap,"{$ldac_split},{$ldapbasedn}",$ldapfilter); if (!$search) { - log_error("Search resulted in error: " . ldap_error($ldap)); + log_error(sprintf(gettext("Search resulted in error: %s"), ldap_error($ldap))); continue; } $info = ldap_get_entries($ldap,$search); @@ -955,18 +955,18 @@ function ldap_backed($username, $passwd, $authcfg) { if ($usercount != 1){ @ldap_unbind($ldap); - log_error("ERROR! Either LDAP search failed, or multiple users were found."); + log_error(gettext("ERROR! Either LDAP search failed, or multiple users were found.")); return false; } /* Now lets bind as the user we found */ if (!($res = @ldap_bind($ldap, $userdn, $passwd))) { - log_error("ERROR! Could not login to server {$ldapname} as user {$username}."); + log_error(sprintf(gettext("ERROR! Could not login to server %s as user %s."), $ldapname, $username)); @ldap_unbind($ldap); return false; } - log_error("Logged in successfully as {$username} via LDAP server {$ldapname} with DN = {$userdn}."); + log_error(sprintf(gettext("Logged in successfully as %s via LDAP server %s with DN = %s."), $username, $ldapname, $userdn)); /* At this point we are bound to LDAP so the user was auth'd okay. Close connection. */ @ldap_unbind($ldap); @@ -997,7 +997,7 @@ function radius_backed($username, $passwd, $authcfg){ $retvalue['auth_val'] = 1; $retvalue['error'] = $rauth->getError(); if ($debug) - printf("Radius start: %s
\n", $retvalue['error']); + printf(gettext("Radius start: %s%s"), $retvalue['error'], "
\n"); } // XXX - billm - somewhere in here we need to handle securid challenge/response @@ -1008,7 +1008,7 @@ function radius_backed($username, $passwd, $authcfg){ $retvalue['auth_val'] = 1; $retvalue['error'] = $result->getMessage(); if ($debug) - printf("Radius send failed: %s
\n", $retvalue['error']); + printf(gettext("Radius send failed: %s%s"), $retvalue['error'], "
\n"); } else if ($result === true) { $retvalue['auth_val'] = 2; if ($debug) @@ -1060,7 +1060,7 @@ function auth_get_authserver($name) { } } if ($name == "Local Database") - return array("name" => "Local Database", "type" => "Local Auth", "host" => $config['system']['hostname']); + return array("name" => gettext("Local Database"), "type" => gettext("Local Auth"), "host" => $config['system']['hostname']); } function auth_get_authserver_list() { @@ -1075,7 +1075,7 @@ function auth_get_authserver_list() { } } - $list["Local Database"] = array( "name" => "Local Database", "type" => "Local Auth", "host" => $config['system']['hostname']); + $list["Local Database"] = array( "name" => gettext("Local Database"), "type" => gettext("Local Auth"), "host" => $config['system']['hostname']); return $list; } @@ -1145,7 +1145,7 @@ function session_auth() { $_SESSION['Logged_In'] = "True"; $_SESSION['Username'] = $_POST['usernamefld']; $_SESSION['last_access'] = time(); - log_error("Successful login for user '{$_POST['usernamefld']}' from: {$_SERVER['REMOTE_ADDR']}"); + log_error(sprintf(gettext("Successful login for user '%s' from: %s"), $_POST['usernamefld'], $_SERVER['REMOTE_ADDR'])); $HTTP_SERVER_VARS['AUTH_USER'] = $_SESSION['Username']; if (isset($_POST['postafterlogin'])) return true; @@ -1157,8 +1157,8 @@ function session_auth() { exit; } else { /* give the user an error message */ - $_SESSION['Login_Error'] = "Username or Password incorrect"; - log_error("Login attempt with user: '{$_POST['usernamefld']}' from: '{$_SERVER['REMOTE_ADDR']}' failed."); + $_SESSION['Login_Error'] = gettext("Username or Password incorrect"); + log_error(sprintf(gettext("Login attempt with user: '%s' from: '%s' failed."), $_POST['usernamefld'], $_SERVER['REMOTE_ADDR'])); if(isAjax()) { echo "showajaxmessage('{$_SESSION['Login_Error']}');"; return; @@ -1198,9 +1198,9 @@ function session_auth() { if (isset($_GET['logout'])) { if ($_SESSION['Logout']) - log_error("Session timed out for user '{$_SESSION['Username']}' from: {$_SERVER['REMOTE_ADDR']}"); + log_error(sprintf(gettext("Session timed out for user '%s' from: %s"), $_SESSION['Username'], $_SERVER['REMOTE_ADDR'])); else - log_error("User logged out for user '{$_SESSION['Username']}' from: {$_SERVER['REMOTE_ADDR']}"); + log_error(sprintf(gettext("User logged out for user '%s' from: %s"), $_SESSION['Username'], $_SERVER['REMOTE_ADDR'])); /* wipe out $_SESSION */ $_SESSION = array(); -- cgit v1.1 From fdc55311b47180f0fd584eb40e6a260037e86aab Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Fri, 13 Aug 2010 17:05:36 -0300 Subject: Implement gettext() calls on captiveportal.inc --- etc/inc/captiveportal.inc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index 9918f1f..9c78017 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -55,7 +55,7 @@ function captiveportal_configure() { if (isset($config['captiveportal']['enable'])) { if ($g['booting']) - echo "Starting captive portal... "; + echo gettext("Starting captive portal... "); /* kill any running mini_httpd */ killbypid("{$g['varrun_path']}/lighty-CaptivePortal.pid"); @@ -253,7 +253,7 @@ EOD; $fd = @fopen("{$g['vardb_path']}/captiveportal_radius.db", "w"); if (!$fd) { - printf("Error: cannot open radius DB file in captiveportal_configure().\n"); + printf(gettext("Error: cannot open radius DB file in captiveportal_configure().%s"), "\n"); return 1; } else if (isset($radiusip2, $radiuskey2)) { fwrite($fd,$radiusip . "," . $radiusport . "," . $radiusacctport . "," . $radiuskey . "\n" @@ -265,7 +265,7 @@ EOD; } if ($g['booting']) - echo "done\n"; + printf(gettext("done%s"), "\n"); } else { killbypid("{$g['varrun_path']}/lighty-CaptivePortal.pid"); @@ -996,7 +996,7 @@ function radius($username,$password,$clientip,$clientmac,$type) { if (is_null($ruleno)) { $auth_list = array(); $auth_list['auth_val'] = 1; - $auth_list['error'] = "System reached maximum login capacity"; + $auth_list['error'] = gettext("System reached maximum login capacity"); unlock($captiveportallck); return $auth_list; } @@ -1086,7 +1086,7 @@ function captiveportal_write_elements() { foreach ($config['captiveportal']['element'] as $data) { $fd = @fopen($g['captiveportal_element_path'] . '/' . $data['name'], "wb"); if (!$fd) { - printf("Error: cannot open '{$data['name']}' in captiveportal_write_elements().\n"); + printf(gettext("Error: cannot open '%s' in captiveportal_write_elements()%s"), $data['name'], "\n"); return 1; } $decoded = base64_decode($data['content']); -- cgit v1.1 From e96d2182cddab944ecc6de439d81ad95ca09ac62 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Mon, 16 Aug 2010 08:40:25 -0300 Subject: Implement gettext() calls on cmd_chain.inc --- etc/inc/cmd_chain.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etc/inc/cmd_chain.inc b/etc/inc/cmd_chain.inc index eb81954..ea295cd 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("CmdCHAIN is executing -> {$cmd_title} - {$command}"); + log_error(sprintf(gettext("CmdCHAIN is executing -> %s - %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("{$cmd_title} failed with return code -> {$status}. The command was {$command}"); + log_error(sprintf(gettext("%s failed with return code -> %s. The command was %s"), $cmd_title, $status, $command)); if($this->halt_on_errors == true) - return("{$cmd_title} failed with return code -> {$status}. The command was {$command}"); + return(sprintf(gettext("%s failed with return code -> %s. The command was %s"), $cmd_title, $status, $command)); } } return; @@ -129,4 +129,4 @@ $cmdchain->clear(); // clears the previous added entries */ -?> \ No newline at end of file +?> -- cgit v1.1 From 814f9e6495dad2476926738cd7b670622738b812 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Mon, 16 Aug 2010 09:36:21 -0300 Subject: Implement gettext() calls on config.console.inc --- etc/inc/config.console.inc | 64 +++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/etc/inc/config.console.inc b/etc/inc/config.console.inc index 5c5590c..3c783b2 100644 --- a/etc/inc/config.console.inc +++ b/etc/inc/config.console.inc @@ -55,10 +55,10 @@ function set_networking_interfaces_ports() { if($avail < $g['minimum_ram_warning']) { echo "\n\n\n"; - echo "DANGER! WARNING! ACHTUNG!\n\n"; - echo "{$g['product_name']} requires *AT LEAST* {$g['minimum_ram_warning_text']} RAM to function correctly.\n"; - echo "Only ({$avail}) MB RAM has been detected.\n"; - echo "\nPress ENTER to continue. "; + echo gettext("DANGER! WARNING! ACHTUNG!") . "\n\n"; + printf(gettext("%s requires *AT LEAST* %s RAM to function correctly.%s"), $g['product_name'], $g['minimum_ram_warning_text'], "\n"); + printf(gettext("Only (%s) MB RAM has been detected.%s"), $avail, "\n"); + echo "\n" . gettext("Press ENTER to continue.") . " "; fgets($fp); echo "\n"; } @@ -80,7 +80,7 @@ Valid interfaces are: EOD; if(!is_array($iflist)) { - echo "No interfaces found!\n"; + echo gettext("No interfaces found!") . "\n"; $iflist = array(); } else { foreach ($iflist as $iface => $ifa) { @@ -178,7 +178,7 @@ EOD; if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) { - echo "\n\nVLAN interfaces:\n\n"; + echo "\n\n" . gettext("VLAN interfaces:") . "\n\n"; foreach ($config['vlans']['vlan'] as $vlan) { echo sprintf("% -16s%s\n", "{$vlan['if']}_vlan{$vlan['tag']}", @@ -204,7 +204,7 @@ hitting 'a' to initiate auto detection. EOD; do { - echo "\nEnter the WAN interface name or 'a' for auto-detection: "; + echo "\n" . gettext("Enter the WAN interface name or 'a' for auto-detection:") . " "; $wanif = chop(fgets($fp)); if ($wanif === "") { return; @@ -212,16 +212,16 @@ EOD; if ($wanif === "a") $wanif = autodetect_interface("WAN", $fp); else if (!array_key_exists($wanif, $iflist)) { - echo "\nInvalid interface name '{$wanif}'\n"; + printf(gettext("%sInvalid interface name '%s'%s"), "\n", $wanif, "\n"); unset($wanif); continue; } } while (!$wanif); do { - echo "\nEnter the LAN interface name or 'a' for auto-detection \n" . - "NOTE: this enables full Firewalling/NAT mode.\n" . - "(or nothing if finished): "; + printf(gettext("%sEnter the LAN interface name or 'a' for auto-detection %s" . + "NOTE: this enables full Firewalling/NAT mode.%s" . + "(or nothing if finished):%s"), "\n", "\n", "\n", " "); $lanif = chop(fgets($fp)); @@ -241,7 +241,7 @@ EOD; if ($lanif === "a") $lanif = autodetect_interface("LAN", $fp); else if (!array_key_exists($lanif, $iflist)) { - echo "\nInvalid interface name '{$lanif}'\n"; + printf(gettext("%sInvalid interface name '%s'%s)", "\n", $lanif), "\n"); unset($lanif); continue; } @@ -258,22 +258,22 @@ EOD; $i1 = $i + 1; if($config['interfaces']['opt' . $i1]['descr']) - echo "\nOptional interface {$i1} description found: {$config['interfaces']['opt' . $i1]['descr']}"; + printf(gettext("%sOptional interface %s description found: %s"), "\n", $config['interfaces']['opt' . $i1]['descr']); - echo "\nEnter the Optional {$i1} interface name or 'a' for auto-detection\n" . - "(or nothing if finished): "; + printf(gettext("%sEnter the Optional %s{$i1} interface name or 'a' for auto-detection%s" . + "(or nothing if finished):%s"), "\n", $i1, "\n", " "); $optif[$i] = chop(fgets($fp)); if ($optif[$i]) { if ($optif[$i] === "a") { - $ad = autodetect_interface("Optional " . $i1, $fp); + $ad = autodetect_interface(gettext("Optional") . " " . $i1, $fp); if ($ad) $optif[$i] = $ad; else unset($optif[$i]); } else if (!array_key_exists($optif[$i], $iflist)) { - echo "\nInvalid interface name '{$optif[$i]}'\n"; + printf(gettext("%sInvalid interface name '%s'%s"), "\n", $optif[$i], "\n"); unset($optif[$i]); continue; } @@ -301,7 +301,7 @@ EOD; } } - echo "\nThe interfaces will be assigned as follows: \n\n"; + printf(gettext("%sThe interfaces will be assigned as follows: %s%s"), "\n", "\n", "\n"); if ($lanif != "") echo "LAN -> " . $lanif . "\n"; @@ -407,16 +407,16 @@ EODD; for (; isset($config['interfaces']['opt' . ($i+1)]); $i++) unset($config['interfaces']['opt' . ($i+1)]); - echo "\nWriting configuration..."; + printf(gettext("%sWriting configuration..."), "\n"); write_config(); - echo "done.\n"; + printf(gettext("done.%s"), "\n"); fclose($fp); if($g['booting']) return; - echo "One moment while we reload the settings..."; + echo gettext("One moment while we reload the settings..."); $g['booting'] = false; @@ -426,7 +426,7 @@ EODD; reload_all_sync(); */ - echo " done!\n"; + echo " " . gettext("done!") . "\n"; touch("{$g['tmp_path']}/assign_complete"); @@ -446,12 +446,12 @@ EOD; foreach ($iflist_prev as $ifn => $ifa) { if (!$ifa['up'] && $iflist[$ifn]['up']) { - echo "Detected link-up on interface {$ifn}.\n"; + printf(gettext("Detected link-up on interface %s.%s"), $ifn, "\n"); return $ifn; } } - echo "No link-up detected.\n"; + printf(gettext("No link-up detected.%s"), "\n"); return null; } @@ -490,9 +490,9 @@ EOD; while (1) { $vlan = array(); - echo "\n\nVLAN Capable interfaces:\n\n"; + echo "\n\n" . gettext("VLAN Capable interfaces:") . "\n\n"; if(!is_array($iflist)) { - echo "No interfaces found!\n"; + echo gettext("No interfaces found!") . "\n"; } else { $vlan_capable=0; foreach ($iflist as $iface => $ifa) { @@ -505,28 +505,28 @@ EOD; } if($vlan_capable == 0) { - echo "No VLAN capable interfaces detected.\n"; + echo gettext("No VLAN capable interfaces detected.") . "\n"; return; } - echo "\nEnter the parent interface name for the new VLAN (or nothing if finished): "; + echo "\n" . gettext("Enter the parent interface name for the new VLAN (or nothing if finished):") . " "; $vlan['if'] = chop(fgets($fp)); if ($vlan['if']) { if (!array_key_exists($vlan['if'], $iflist) or !is_jumbo_capable($vlan['if'])) { - echo "\nInvalid interface name '{$vlan['if']}'\n"; + printf(gettext("%sInvalid interface name '%s'%s"), "\n", $vlan['if'], "\n"); continue; } } else { break; } - echo "Enter the VLAN tag (1-4094): "; + echo gettext("Enter the VLAN tag (1-4094):") . " "; $vlan['tag'] = chop(fgets($fp)); $vlan['vlanif'] = "{$vlan['if']}_vlan{$vlan['tag']}"; if (!is_numericint($vlan['tag']) || ($vlan['tag'] < 1) || ($vlan['tag'] > 4094)) { - echo "\nInvalid VLAN tag '{$vlan['tag']}'\n"; + printf(gettext("%sInvalid VLAN tag '%s'%s"), "\n", $vlan['tag'], "\n"); continue; } @@ -535,4 +535,4 @@ EOD; } } -?> \ No newline at end of file +?> -- cgit v1.1 From 10e91486fa5c2d467135bcaa887aee83458442a0 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Mon, 16 Aug 2010 09:54:11 -0300 Subject: Implement gettext() calls on config.inc --- etc/inc/config.inc | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/etc/inc/config.inc b/etc/inc/config.inc index 724615a..98592c9 100644 --- a/etc/inc/config.inc +++ b/etc/inc/config.inc @@ -88,10 +88,10 @@ if($g['booting'] && file_exists("/cf/conf/config.xml")) { if(stristr($config_contents, "") == true) { if($g['booting']) echo "."; /* user has just upgraded to m0n0wall, replace root xml tags */ - log_error("Upgrading m0n0wall configuration to pfSense... "); + log_error(gettext("Upgrading m0n0wall configuration to pfSense... ")); $config_contents = str_replace("m0n0wall","pfsense", $config_contents); if (!config_validate("{$g['conf_path']}/config.xml")) - log_error("ERROR! Could not convert m0n0wall -> pfsense in config.xml"); + log_error(gettext("ERROR! Could not convert m0n0wall -> pfsense in config.xml")); conf_mount_rw(); $fd = fopen("/cf/conf/config.xml", "w"); fwrite($fd, $config_contents); @@ -121,9 +121,10 @@ else if ($g['booting'] and !file_exists($g['cf_conf_path'] . "/config.xml") ) { } } $cfgfstype = "msdosfs"; - echo "CDROM build\n"; - echo " CFG: {$cfgpartition}\n"; - echo " TYPE: {$cfgfstype}\n"; + echo gettext("CDROM build") . "\n"; + echo " " . gettext("CFG:") . " {$cfgpartition}\n"; + echo " " . gettext("CFG:") . " {$cfgpartition}\n"; + echo " " . gettext("TYPE:") . " {$cfgfstype}\n"; } else { if($g['booting']) echo "."; /* probe kernel known disks until we find one with config.xml */ @@ -138,7 +139,7 @@ else if ($g['booting'] and !file_exists($g['cf_conf_path'] . "/config.xml") ) { $cfgdevice = $mountdisk; $cfgpartition = $cfgdevice . "a"; $cfgfstype = "ufs"; - echo "Found configuration on $cfgdevice.\n"; + printf(gettext("Found configuration on %s.%s"), $cfgdevice, "\n"); } mwexec("/sbin/umount -f {$g['cf_path']}"); @@ -153,7 +154,7 @@ else if ($g['booting'] and !file_exists($g['cf_conf_path'] . "/config.xml") ) { $cfgdevice = $mountdisk; $cfgpartition = $cfgdevice . "d"; $cfgfstype = "ufs"; - echo "Found configuration on $cfgdevice.\n"; + printf(gettext("Found configuration on %s.%s"), $cfgdevice, "\n"); } mwexec("/sbin/umount -f {$g['cf_path']}"); @@ -167,11 +168,11 @@ else if ($g['booting'] and !file_exists($g['cf_conf_path'] . "/config.xml") ) { if (!$cfgdevice) { $last_backup = discover_last_backup(); if($last_backup) { - log_error("No config.xml found, attempting last known config restore."); - file_notice("config.xml", "No config.xml found, attempting last known config restore.", "pfSenseConfigurator", ""); + log_error(gettext("No config.xml found, attempting last known config restore.")); + file_notice("config.xml", gettext("No config.xml found, attempting last known config restore."), "pfSenseConfigurator", ""); restore_backup("/cf/conf/backup/{$last_backup}"); } else { - log_error("No config.xml or config backups found, resetting to factory defaults."); + log_error(gettext("No config.xml or config backups found, resetting to factory defaults.")); restore_backup('/conf.default/config.xml'); } } @@ -211,4 +212,4 @@ if($config_parsed == true) { } } -?> \ No newline at end of file +?> -- cgit v1.1 From 5bd033a03083c496bc33f2cbef41034b847f9d83 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Mon, 16 Aug 2010 10:21:27 -0300 Subject: Implement gettext() calls on easyrule.inc --- etc/inc/easyrule.inc | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/etc/inc/easyrule.inc b/etc/inc/easyrule.inc index c23cf6c..2e3af4b 100644 --- a/etc/inc/easyrule.inc +++ b/etc/inc/easyrule.inc @@ -110,7 +110,7 @@ function easyrule_block_rule_create($int = 'wan') { $filterent['interface'] = $int; $filterent['source']['address'] = $blockaliasname . strtoupper($int); $filterent['destination']['any'] = ''; - $filterent['descr'] = "Easy Rule: Blocked from Firewall Log View"; + $filterent['descr'] = gettext("Easy Rule: Blocked from Firewall Log View"); $a_filter[] = $filterent; @@ -159,15 +159,15 @@ function easyrule_block_alias_add($host, $int = 'wan') { $alias['descr'] = $a_aliases[$id]['descr']; $alias['address'] = $a_aliases[$id]['address'] . ' ' . $host . '/32'; - $alias['detail'] = $a_aliases[$id]['detail'] . 'Entry added ' . date('r') . '||'; + $alias['detail'] = $a_aliases[$id]['detail'] . gettext('Entry added') . ' ' . date('r') . '||'; } else { /* Create a new alias with all the proper information */ - $alias['name'] = $blockaliasname . strtoupper($int); - $alias['type'] = 'network'; - $alias['descr'] = mb_convert_encoding("Hosts blocked from Firewall Log view","HTML-ENTITIES","auto"); + $alias['name'] = $blockaliasname . strtoupper($int); + $alias['type'] = 'network'; + $alias['descr'] = mb_convert_encoding(gettext("Hosts blocked from Firewall Log view"),"HTML-ENTITIES","auto"); $alias['address'] = $host . '/32'; - $alias['detail'] = 'Entry added ' . date('r') . '||'; + $alias['detail'] = gettext('Entry added') . ' ' . date('r') . '||'; } /* Replace the old alias if needed, otherwise tack it on the end */ @@ -242,7 +242,7 @@ function easyrule_pass_rule_add($int, $proto, $srchost, $dsthost, $dstport) { $filterent = array(); $filterent['type'] = 'pass'; $filterent['interface'] = $int; - $filterent['descr'] = "Easy Rule: Passed from Firewall Log View"; + $filterent['descr'] = gettext("Easy Rule: Passed from Firewall Log View"); if ($proto != "any") $filterent['protocol'] = $proto; @@ -272,21 +272,21 @@ function easyrule_pass_rule_add($int, $proto, $srchost, $dsthost, $dstport) { function easyrule_parse_block($int, $src) { if (!empty($src) && !empty($int)) { if (!is_ipaddr($src)) { - return "Tried to block invalid IP: " . htmlspecialchars($src); + return gettext("Tried to block invalid IP:") . ' ' . htmlspecialchars($src); } $int = easyrule_find_rule_interface($int); if ($int === false) { - return "Invalid interface for block rule: " . htmlspecialchars($int); + return gettext("Invalid interface for block rule:") . ' ' . htmlspecialchars($int); } if (easyrule_block_host_add($src, $int)) { - return "Host added successfully"; + return gettext("Host added successfully"); } else { - return "Failed to create block rule, alias, or add host."; + return gettext("Failed to create block rule, alias, or add host."); } } else { - return "Tried to block but had no host IP or interface"; + return gettext("Tried to block but had no host IP or interface"); } - return "Unknown block error."; + return gettext("Unknown block error."); } function easyrule_parse_pass($int, $proto, $src, $dst, $dstport = 0) { /* Check for valid int, srchost, dsthost, dstport, and proto */ @@ -295,36 +295,36 @@ function easyrule_parse_pass($int, $proto, $src, $dst, $dstport = 0) { if (!empty($int) && !empty($proto) && !empty($src) && !empty($dst)) { $int = easyrule_find_rule_interface($int); if ($int === false) { - return "Invalid interface for pass rule: " . htmlspecialchars($int); + return gettext("Invalid interface for pass rule:") . ' ' . htmlspecialchars($int); } if (getprotobyname($proto) == -1) { - return "Invalid protocol for pass rule: " . htmlspecialchars($proto); + return gettext("Invalid protocol for pass rule:") . ' ' . htmlspecialchars($proto); } if (!is_ipaddr($src)) { - return "Tried to pass invalid source IP: " . htmlspecialchars($src); + return gettext("Tried to pass invalid source IP:") . ' ' . htmlspecialchars($src); } if (!is_ipaddr($dst)) { - return "Tried to pass invalid destination IP: " . htmlspecialchars($dst); + return gettext("Tried to pass invalid destination IP:") . ' ' . htmlspecialchars($dst); } if (in_array($proto, $protocols_with_ports)) { if (empty($dstport)) { - return "Missing destination port: " . htmlspecialchars($dstport); + return gettext("Missing destination port:") . ' ' . htmlspecialchars($dstport); } if (!is_port($dstport)) { - return "Tried to pass invalid destination port: " . htmlspecialchars($dstport); + return gettext("Tried to pass invalid destination port:") . ' ' . htmlspecialchars($dstport); } } else { $dstport = 0; } /* Should have valid input... */ if (easyrule_pass_rule_add($int, $proto, $src, $dst, $dstport)) { - return "Successfully added pass rule!"; + return gettext("Successfully added pass rule!"); } else { - return "Failed to add pass rule."; + return gettext("Failed to add pass rule."); } } else { - return "Missing parameters for pass rule."; + return gettext("Missing parameters for pass rule."); } - return "Unknown pass error."; + return gettext("Unknown pass error."); } ?> -- cgit v1.1 From 4e038d31d9ec1c60b18e0cf10a0718a2e62cc97e Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Mon, 16 Aug 2010 10:36:09 -0300 Subject: Implement gettext() calls on config.lib.inc --- etc/inc/config.lib.inc | 98 +++++++++++++++++++++++++------------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/etc/inc/config.lib.inc b/etc/inc/config.lib.inc index 120f8b1..dd2a9b2 100644 --- a/etc/inc/config.lib.inc +++ b/etc/inc/config.lib.inc @@ -59,9 +59,9 @@ function encrypted_configxml() { if(tagfile_deformat($configtxt, $configtxt, "config.xml")) { $fp = fopen('php://stdin', 'r'); $data = ""; - echo "\n\n*** Encrypted config.xml detected ***\n"; + echo "\n\n" . gettext("*** Encrypted config.xml detected ***") . "\n"; while($data == "") { - echo "\nEnter the password to decrypt config.xml: "; + echo "\n" . gettext("Enter the password to decrypt config.xml:") . " "; $decrypt_password = chop(fgets($fp)); $data = decrypt_data($configtxt, $decrypt_password); if(!strstr($data, "")) @@ -71,10 +71,10 @@ function encrypted_configxml() { fwrite($fd, $data); fclose($fd); exec("/bin/mv {$g['conf_path']}/config.xml.tmp {$g['conf_path']}/config.xml"); - echo "\nConfig.xml unlocked.\n"; + echo "\n" . gettext("Config.xml unlocked.") . "\n"; fclose($fp); } else { - echo "\nInvalid password entered. Please try again.\n"; + echo "\n" . gettext("Invalid password entered. Please try again.") . "\n"; } } } @@ -98,12 +98,12 @@ function parse_config($parse = false) { if (!file_exists("{$g['conf_path']}/config.xml") || filesize("{$g['conf_path']}/config.xml") == 0) { $last_backup = discover_last_backup(); if($last_backup) { - log_error("No config.xml found, attempting last known config restore."); - file_notice("config.xml", "No config.xml found, attempting last known config restore.", "pfSenseConfigurator", ""); + log_error(gettext("No config.xml found, attempting last known config restore.")); + file_notice("config.xml", gettext("No config.xml found, attempting last known config restore."), "pfSenseConfigurator", ""); restore_backup("{$g['conf_path']}/backup/{$last_backup}"); } else { unlock($lockkey); - die("Config.xml is corrupted and is 0 bytes. Could not restore a previous backup."); + die(gettext("Config.xml is corrupted and is 0 bytes. Could not restore a previous backup.")); } } if($g['booting']) echo "."; @@ -119,13 +119,13 @@ function parse_config($parse = false) { } } else { if(!file_exists($g['conf_path'] . "/config.xml")) { - log_error("No config.xml found, attempting last known config restore."); - file_notice("config.xml", "No config.xml found, attempting last known config restore.", "pfSenseConfigurator", ""); + log_error(gettext("No config.xml found, attempting last known config restore.")); + file_notice("config.xml", gettext("No config.xml found, attempting last known config restore."), "pfSenseConfigurator", ""); $last_backup = discover_last_backup(); if ($last_backup) restore_backup("/cf/conf/backup/{$last_backup}"); else - log_error("Could not restore config.xml."); + log_error(gettext("Could not restore config.xml.")); } unlock($lockkey); $config = parse_config(true); @@ -134,13 +134,13 @@ function parse_config($parse = false) { } else { if(!file_exists($g['conf_path'] . "/config.xml")) { if($g['booting']) echo "."; - log_error("No config.xml found, attempting last known config restore."); - file_notice("config.xml", "No config.xml found, attempting last known config restore.", "pfSenseConfigurator", ""); + log_error(gettext("No config.xml found, attempting last known config restore.")); + file_notice("config.xml", gettext("No config.xml found, attempting last known config restore."), "pfSenseConfigurator", ""); $last_backup = discover_last_backup(); if ($last_backup) restore_backup("/cf/conf/backup/{$last_backup}"); else - log_error("Could not restore config.xml."); + log_error(gettext("Could not restore config.xml.")); } $config = parse_xml_config($g['conf_path'] . '/config.xml', $g['xml_rootobj']); if($config == "-1") { @@ -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("{$g['product_name']} is restoring the configuration $file"); - file_notice("config.xml", "{$g['product_name']} is restoring the configuration $file", "pfSenseConfigurator", ""); + log_error(sprintf(gettext("%s is restoring the configuration %s"), $g['product_name'], $file)); + file_notice("config.xml", sprintf(gettext("%s is restoring the configuration %s"), $g['product_name'], $file), "pfSenseConfigurator", ""); conf_mount_ro(); } } @@ -224,30 +224,30 @@ function parse_config_bootup() { if ($g['booting']) { if (strstr($g['platform'], "cdrom")) { /* try copying the default config. to the floppy */ - echo "Resetting factory defaults...\n"; + echo gettext("Resetting factory defaults...") . "\n"; reset_factory_defaults(true); if (file_exists("{$g['conf_path']}/config.xml")) { /* do nothing, we have a file. */ } else { - echo "No XML configuration file found - using factory defaults.\n"; - echo "Make sure that the configuration floppy disk with the conf/config.xml\n"; - echo "file is inserted. If it isn't, your configuration changes will be lost\n"; - echo "on reboot.\n"; + echo gettext("No XML configuration file found - using factory defaults.") . "\n"; + echo gettext("Make sure that the configuration floppy disk with the conf/config.xml") . "\n"; + echo gettext("file is inserted. If it isn't, your configuration changes will be lost") . "\n"; + echo gettext("on reboot.") . "\n"; } } else { $last_backup = discover_last_backup(); if($last_backup) { - log_error("No config.xml found, attempting last known config restore."); - file_notice("config.xml", "No config.xml found, attempting last known config restore.", "pfSenseConfigurator", ""); + log_error(gettext("No config.xml found, attempting last known config restore.")); + file_notice("config.xml", gettext("No config.xml found, attempting last known config restore."), "pfSenseConfigurator", ""); restore_backup("/cf/conf/backup/{$last_backup}"); } if(!file_exists("{$g['conf_path']}/config.xml")) { - echo "XML configuration file not found. {$g['product_name']} cannot continue booting.\n"; + printf(gettext("XML configuration file not found. %s cannot continue booting.%s"), $g['product_name'], "\n"); mwexec("/sbin/halt"); exit; } - log_error("Last known config found and restored. Please double check your configuration file for accuracy."); - file_notice("config.xml", "Last known config found and restored. Please double check your configuration file for accuracy.", "pfSenseConfigurator", ""); + log_error(gettext("Last known config found and restored. Please double check your configuration file for accuracy.")); + file_notice("config.xml", gettext("Last known config found and restored. Please double check your configuration file for accuracy."), "pfSenseConfigurator", ""); } } else { unlock($lockkey); @@ -258,12 +258,12 @@ function parse_config_bootup() { if (filesize("{$g['conf_path']}/config.xml") == 0) { $last_backup = discover_last_backup(); if($last_backup) { - log_error("No config.xml found, attempting last known config restore."); - file_notice("config.xml", "No config.xml found, attempting last known config restore.", "pfSenseConfigurator", ""); + log_error(gettext("No config.xml found, attempting last known config restore.")); + file_notice("config.xml", gettext("No config.xml found, attempting last known config restore."), "pfSenseConfigurator", ""); restore_backup("{$g['conf_path']}/backup/{$last_backup}"); } else { unlock($lockkey); - die("Config.xml is corrupted and is 0 bytes. Could not restore a previous backup."); + die(gettext("Config.xml is corrupted and is 0 bytes. Could not restore a previous backup.")); } } unlock($lockkey); @@ -309,7 +309,7 @@ function conf_mount_rw() { $status = mwexec("/sbin/mount -u -w {$g['cf_path']}"); if($status <> 0) { if($g['booting']) - echo "Disk is dirty. Running fsck -y\n"; + echo gettext("Disk is dirty. Running fsck -y") . "\n"; mwexec("/sbin/fsck -y {$g['cf_path']}"); $status = mwexec("/sbin/mount -u -w {$g['cf_path']}"); } @@ -320,7 +320,7 @@ function conf_mount_rw() { $status = mwexec("/sbin/mount -u -w /"); /* we could not mount this correctly. kick off fsck */ if($status <> 0) { - log_error("File system is dirty. Launching FSCK for /"); + log_error(gettext("File system is dirty. Launching FSCK for /")); mwexec("/sbin/fsck -y /"); $status = mwexec("/sbin/mount -u -w /"); } @@ -366,7 +366,7 @@ function conf_mount_ro() { function convert_config() { global $config, $g; $now = date("H:i:s"); - log_error("Start Configuration upgrade at $now, set execution timeout to 15 minutes"); + log_error(sprintf(gettext("Start Configuration upgrade at %s, set execution timeout to 15 minutes"), $now)); //ini_set("max_execution_time", "900"); /* special case upgrades */ @@ -376,8 +376,8 @@ function convert_config() { if(stristr($config['cron']['item'][$x]['command'], "rc.update_bogons.sh")) { if($config['cron']['item'][$x]['hour'] == "*" ) { $config['cron']['item'][$x]['hour'] = "3"; - write_config("Updated bogon update frequency to 3am"); - log_error("Updated bogon update frequency to 3am"); + write_config(gettext("Updated bogon update frequency to 3am")); + log_error(gettext("Updated bogon update frequency to 3am")); } } } @@ -401,13 +401,13 @@ function convert_config() { } $now = date("H:i:s"); - log_error("Ended Configuration upgrade at $now"); + log_error(sprintf(gettext("Ended Configuration upgrade at %s"), $now)); if ($prev_version != $config['version']) - write_config("Upgraded config version level from {$prev_version} to {$config['version']}"); + write_config(sprintf(gettext("Upgraded config version level from %s to %s"), $prev_version, $config['version'])); if($g['booting']) - echo "Loading new configuration..."; + echo gettext("Loading new configuration..."); } /****f* config/safe_write_file @@ -470,7 +470,7 @@ function write_config($desc="Unknown", $backup = true) { // $config = parse_config(true, false, false); if($g['bootup']) - log_error("WARNING! Configuration written on bootup. This can cause stray openvpn and load balancing items in config.xml"); + log_error(gettext("WARNING! Configuration written on bootup. This can cause stray openvpn and load balancing items in config.xml")); if($backup) backup_config(); @@ -480,7 +480,7 @@ function write_config($desc="Unknown", $backup = true) { /* Log the running script so it's not entirely unlogged what changed */ if ($desc == "Unknown") - $desc = "{$_SERVER['SCRIPT_NAME']} made unknown change"; + $desc = sprintf(gettext("%s made unknown change"), $_SERVER['SCRIPT_NAME']); $config['revision']['description'] = "{$_SESSION['Username']}: " . $desc; $config['revision']['username'] = $_SESSION["Username"]; @@ -493,9 +493,9 @@ function write_config($desc="Unknown", $backup = true) { /* write new configuration */ if (!safe_write_file("{$g['cf_conf_path']}/config.xml", $xmlconfig, false)) { - log_error("WARNING: Config contents could not be save. Could not open file!"); + log_error(gettext("WARNING: Config contents could not be save. Could not open file!")); unlock($lockkey); - file_notice("config.xml", "Unable to open {$g['cf_conf_path']}/config.xml for writing in write_config()\n"); + file_notice("config.xml", sprintf(gettext("Unable to open %s/config.xml for writing in write_config()%s"), $g['cf_conf_path'], "\n")); return -1; } @@ -593,7 +593,7 @@ function config_restore($conffile) { conf_mount_ro(); - write_config("Reverted to " . array_pop(explode("/", $conffile)) . ".", false); + write_config(gettext("Reverted to") . " " . array_pop(explode("/", $conffile)) . ".", false); return 0; } @@ -608,9 +608,9 @@ function config_install($conffile) { return 1; if($g['booting'] == true) - echo "Installing configuration...\n"; + echo gettext("Installing configuration...") . "\n"; else - log_error("Installing configuration ...."); + log_error(gettext("Installing configuration ....")); conf_mount_rw(); $lockkey = lock('config', LOCK_EX); @@ -634,13 +634,13 @@ function config_validate($conffile) { $xml_parser = xml_parser_create(); if (!($fp = fopen($conffile, "r"))) { - $xmlerr = "XML error: unable to open file"; + $xmlerr = gettext("XML error: unable to open file"); return false; } while ($data = fread($fp, 4096)) { if (!xml_parse($xml_parser, $data, feof($fp))) { - $xmlerr = sprintf("%s at line %d", + $xmlerr = sprintf(gettext("%s at line %d"), xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser)); return false; @@ -686,9 +686,9 @@ function cleanup_backupcache($revisions = 30, $lock = false) { echo "."; $newxml = parse_xml_config($backup, $g['xml_rootobj']); if($newxml == "-1") { - log_error("The backup cache file $backup is corrupted. Unlinking."); + log_error(sprintf(gettext("The backup cache file %s is corrupted. Unlinking."), $backup)); unlink($backup); - log_error("The backup cache file $backup is corrupted. Unlinking."); + log_error(sprintf(gettext("The backup cache file %s is corrupted. Unlinking."), $backup)); continue; } if($newxml['revision']['description'] == "") @@ -723,7 +723,7 @@ function cleanup_backupcache($revisions = 30, $lock = false) { conf_mount_ro(); if($g['booting'] && $i) - print "done.\n"; + print gettext("done.") . "\n"; if (!$lock) unlock($lockkey); } @@ -799,4 +799,4 @@ function set_device_perms() { } } -?> \ No newline at end of file +?> -- cgit v1.1 From 8abd095a53ee096606eac2fbf19e87d4c868d20b Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Mon, 16 Aug 2010 10:56:04 -0300 Subject: Implement gettext() calls on filter_log.inc --- etc/inc/filter_log.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/inc/filter_log.inc b/etc/inc/filter_log.inc index ed4b311..e78bc0c 100644 --- a/etc/inc/filter_log.inc +++ b/etc/inc/filter_log.inc @@ -159,7 +159,7 @@ function parse_filter_line($line) { return $flent; } else { if($g['debug']) { - log_error("There was a error parsing rule: $errline. Please report to mailing list or forum."); + log_error(sprintf(gettext("There was a error parsing rule: %s. Please report to mailing list or forum."), $errline)); } return ""; } @@ -203,7 +203,7 @@ function get_port_with_service($port, $proto) { $service = getservbyport($port, $proto); $portstr = ""; if ($service) { - $portstr = "" . htmlspecialchars($port) . ""; + $portstr = sprintf(gettext("%s"), $port, $proto, $service, htmlspecialchars($port)); } else { $portstr = htmlspecialchars($port); } @@ -279,4 +279,4 @@ function handle_ajax($nentries, $tail = 50) { } } -?> \ No newline at end of file +?> -- cgit v1.1 From 5c7296d27f1c4fbc2eff629b17bccb80136fc5b8 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Mon, 16 Aug 2010 12:53:12 -0300 Subject: Implement gettext() calls on gwlb.inc --- etc/inc/gwlb.inc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 4a9decb..bea0bed 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -230,7 +230,7 @@ EOD; mwexec("/sbin/route delete -host " . escapeshellarg($gateway['monitor'])); mwexec("/sbin/route add -host " . escapeshellarg($gateway['monitor']) . " " . escapeshellarg($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 %s and adding a new route through %s"), $gateway['monitor'], $gateway['gateway'])); } } } @@ -383,13 +383,13 @@ function return_gateway_groups_array() { continue; } if (stristr($status['status'], "down")) { - $msg = "MONITOR: $gwname has high latency, removing from routing group"; + $msg = sprintf(gettext("MONITOR: %s has high latency, removing from routing group"), $gwname); log_error($msg); notify_via_growl($msg); } elseif (stristr($status['status'], "loss")) { if (strstr($group['trigger'], "loss")) { /* packet loss */ - $msg = "MONITOR: $gwname has packet loss, removing from routing group"; + $msg = sprintf(gettext("MONITOR: %s has packet loss, removing from routing group"), $gwname); log_error($msg); notify_via_growl($msg); } else { @@ -398,6 +398,7 @@ function return_gateway_groups_array() { } elseif (stristr($status['status'], "delay")) { if (strstr($group['trigger'] , "latency")) { /* high latency */ + $msg = sprintf(gettext("MONITOR: %s has high latency, removing from routing group"), $gwname); $msg = "MONITOR: $gwname has high latency, removing from routing group"; log_error($msg); notify_via_growl($msg); @@ -413,7 +414,7 @@ function return_gateway_groups_array() { $tiers_count = count($tiers); if($tiers_count == 0) { /* Oh dear, we have no members! Engage Plan B */ - $msg = "All gateways are unavailable, proceeding with configured XML settings!"; + $msg = gettext("All gateways are unavailable, proceeding with configured XML settings!"); log_error($msg); notify_via_growl($msg); foreach($group['item'] as $item) { @@ -468,7 +469,7 @@ function dhclient_update_gateway_groups_defaultroute($interface = "wan") { } } if($changed && $current_gw) - write_config("Updating gateway group gateway for $interface - new gateway is $current_gw"); + write_config(sprintf(gettext("Updating gateway group gateway for %s - new gateway is %s"), $interfac, $current_gw)); } function lookup_gateway_ip_by_name($name) { -- cgit v1.1 From 07e40c1faea86d969327722eb101ad0d202bd84e Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Mon, 16 Aug 2010 15:41:30 -0300 Subject: Implement gettext() calls on interfaces.inc --- etc/inc/interfaces.inc | 134 ++++++++++++++++++++++++------------------------- 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 021d76d..9156815 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -47,7 +47,7 @@ require_once("cmd_chain.inc"); function interfaces_bring_up($interface) { if(!$interface) { - log_error("interfaces_bring_up() was called but no variable defined."); + log_error(gettext("interfaces_bring_up() was called but no variable defined.")); log_error( "Backtrace: " . debug_backtrace() ); return; } @@ -86,19 +86,19 @@ function does_interface_exist($interface) { function interfaces_loopback_configure() { if($g['booting']) - echo "Configuring loopback interface..."; + echo gettext("Configuring loopback interface..."); pfSense_interface_setaddress("lo0", "127.0.0.1"); interfaces_bring_up("lo0"); exec("/sbin/route add 127.0.0.2 127.0.0.1"); if($g['booting']) - echo "done.\n"; + echo gettext("done.") . "\n"; return 0; } function interfaces_vlan_configure() { global $config, $g; if($g['booting']) - echo "Configuring VLAN interfaces..."; + echo gettext("Configuring VLAN interfaces..."); if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) { foreach ($config['vlans']['vlan'] as $vlan) { if(empty($vlan['vlanif'])) @@ -108,14 +108,14 @@ function interfaces_vlan_configure() { } } if($g['booting']) - echo "done.\n"; + echo gettext("done.") . "\n"; } function interface_vlan_configure(&$vlan) { global $config, $g; if (!is_array($vlan)) { - log_error("VLAN: called with wrong options. Problems with config!"); + log_error(gettext("VLAN: called with wrong options. Problems with config!")); return; } $if = $vlan['if']; @@ -123,7 +123,7 @@ function interface_vlan_configure(&$vlan) { $tag = $vlan['tag']; if (empty($if)) { - log_error("interface_vlan_confgure called with if undefined."); + log_error(gettext("interface_vlan_confgure called with if undefined.")); return; } @@ -157,14 +157,14 @@ function interface_qinq_configure(&$vlan, $fd = NULL) { global $config, $g; if (!is_array($vlan)) { - log_error("QinQ compat VLAN: called with wrong options. Problems with config!\n"); + log_error(sprintf(gettext("QinQ compat VLAN: called with wrong options. Problems with config!%s"), "\n")); return; } $qinqif = $vlan['if']; $tag = $vlan['tag']; if(empty($qinqif)) { - log_error("interface_qinq_confgure called with if undefined.\n"); + log_error(sprintf(gettext("interface_qinq_confgure called with if undefined.%s"), "\n")); return; } $vlanif = interface_vlan_configure($vlan); @@ -225,7 +225,7 @@ function interface_qinq_configure(&$vlan, $fd = NULL) { function interfaces_qinq_configure() { global $config, $g; if($g['booting']) - echo "Configuring QinQ interfaces..."; + echo gettext("Configuring QinQ interfaces..."); if (is_array($config['qinqs']['qinqentry']) && count($config['qinqs']['qinqentry'])) { foreach ($config['qinqs']['qinqentry'] as $qinq) { /* XXX: Maybe we should report any errors?! */ @@ -233,14 +233,14 @@ function interfaces_qinq_configure() { } } if($g['booting']) - echo "done.\n"; + echo gettext( "done.") . "\n"; } function interface_qinq2_configure(&$qinq, $fd, $macaddr) { global $config, $g; if (!is_array($qinq)) { - log_error("QinQ compat VLAN: called with wrong options. Problems with config!\n"); + log_error(sprintf(gettext("QinQ compat VLAN: called with wrong options. Problems with config!%s"), "\n")); return; } @@ -248,7 +248,7 @@ function interface_qinq2_configure(&$qinq, $fd, $macaddr) { $tag = $qinq['tag']; $vlanif = "{$if}_{$tag}"; if(empty($if)) { - log_error("interface_qinq_confgure called with if undefined.\n"); + log_error(sprintf(gettext("interface_qinq_confgure called with if undefined.%s"), "\n")); return; } @@ -269,7 +269,7 @@ function interfaces_create_wireless_clones() { global $config; if($g['booting']) - echo "Creating other wireless clone interfaces..."; + echo gettext("Creating other wireless clone interfaces..."); if (is_array($config['wireless']['clone']) && count($config['wireless']['clone'])) { foreach ($config['wireless']['clone'] as $clone) { if(empty($clone['cloneif'])) @@ -283,7 +283,7 @@ function interfaces_create_wireless_clones() { } } if($g['booting']) - echo " done.\n"; + echo " " . gettext("done.") . "\n"; } function interfaces_bridge_configure() { @@ -308,7 +308,7 @@ function interface_bridge_configure(&$bridge) { return -1; if (empty($bridge['members'])) { - log_error("No members found on {$bridge['bridgeif']}"); + log_error(sprintf(gettext("No members found on %s"), $bridge['bridgeif'])); return -1; } @@ -349,7 +349,7 @@ function interface_bridge_configure(&$bridge) { /* make sure the parent interface is up */ pfSense_interface_mtu($realif, $smallermtu); if(!$realif) - log_error("realif not defined in interfaces bridge - up"); + log_error(gettext("realif not defined in interfaces bridge - up")); interfaces_bring_up($realif1); mwexec("/sbin/ifconfig {$bridgeif} addm {$realif}"); } @@ -457,7 +457,7 @@ function interface_bridge_configure(&$bridge) { if($bridgeif) interfaces_bring_up($bridgeif); else - log_error("bridgeif not defined -- could not bring interface up"); + log_error(gettext("bridgeif not defined -- could not bring interface up")); return $bridgeif; } @@ -492,7 +492,7 @@ function interfaces_lagg_configure() { global $config, $g; if($g['booting']) - echo "Configuring LAGG interfaces..."; + echo gettext("Configuring LAGG interfaces..."); $i = 0; if (is_array($config['laggs']['lagg']) && count($config['laggs']['lagg'])) { foreach ($config['laggs']['lagg'] as $lagg) { @@ -504,7 +504,7 @@ function interfaces_lagg_configure() } } if($g['booting']) - echo "done.\n"; + echo gettext("done.") . "\n"; } function interface_lagg_configure(&$lagg) { @@ -603,7 +603,7 @@ function interface_gre_configure(&$gre) { if($greif) interfaces_bring_up($greif); else - log_error("Could not bring greif up -- variable not defined."); + log_error(gettext("Could not bring greif up -- variable not defined.")); if (isset($gre['link1']) && $gre['link1']) mwexec("/sbin/route add {$gre['tunnel-remote-addr']}/{$gre['tunnel-remote-net']} {$gre['tunnel-local-addr']}"); @@ -639,7 +639,7 @@ function interface_gif_configure(&$gif) { if($realif) interfaces_bring_up($realif); else - log_error("could not bring realif up -- variable not defined -- interface_gif_configure()"); + log_error(gettext("could not bring realif up -- variable not defined -- interface_gif_configure()")); if ($g['booting'] || !(empty($gif['gifif']))) { pfSense_interface_destroy($gif['gifif']); @@ -658,7 +658,7 @@ function interface_gif_configure(&$gif) { if($gifif) interfaces_bring_up($gifif); else - log_error("could not bring gifif up -- variable not defined"); + log_error(gettext("could not bring gifif up -- variable not defined")); /* XXX: Needed?! */ //mwexec("/sbin/route add {$gif['tunnel-remote-addr']}/{$gif['tunnel-remote-net']} -iface {$gifif}"); @@ -700,12 +700,12 @@ function interfaces_configure() { $delayed_list[$if] = $ifname; else { if ($g['booting']) - echo "Configuring {$ifname} interface..."; + printf(gettext("Configuring %s interface..."), $ifname); if($g['debug']) - log_error("Configuring {$ifname}"); + log_error(sprintf(gettext("Configuring %s"), $ifname)); interface_configure($if, $reload); if ($g['booting']) - echo "done.\n"; + echo gettext( "done.") . "\n"; } } @@ -720,14 +720,14 @@ function interfaces_configure() { foreach ($delayed_list as $if => $ifname) { if ($g['booting']) - echo "Configuring {$ifname} interface..."; + printf(gettext("Configuring %s interface..."), $ifname); if ($g['debug']) - log_error("Configuring {$ifname}"); + log_error(sprintf(gettext("Configuring %s"), $ifname)); interface_configure($if, $reload); if ($g['booting']) - echo "done.\n"; + echo gettext("done.") . "\n"; } /* set up BRIDGe virtual interfaces */ @@ -735,14 +735,14 @@ function interfaces_configure() { foreach ($bridge_list as $if => $ifname) { if ($g['booting']) - echo "Configuring {$ifname} interface..."; + printf(gettext("Configuring %s interface..."), $ifname); if($g['debug']) - log_error("Configuring {$ifname}"); + log_error(sprintf(gettext("Configuring %s"), $ifname)); interface_configure($if, $reload); if ($g['booting']) - echo "done.\n"; + echo gettext("done.") . "\n"; } /* bring up vip interfaces */ @@ -1030,7 +1030,7 @@ function interface_ppps_configure($interface) { } } if (!$ppp || $ifcfg['if'] != $ppp['if']){ - log_error("Can't find PPP config for {$ifcfg['if']} in interface_ppps_configure()."); + log_error(sprintf(gettext("Can't find PPP config for %s in interface_ppps_configure()."), $ifcfg['if'])); return 0; } $pppif = $ifcfg['if']; @@ -1077,7 +1077,7 @@ function interface_ppps_configure($interface) { $localips[$pid] = get_interface_ip($port); // try to get the interface IP from the port if(!is_ipaddr($localips[$pid])){ - log_error("Could not get a Local IP address for PPTP/L2TP link on {$port} in interfaces_ppps_configure."); + log_error(sprintf(gettext("Could not get a Local IP address for PPTP/L2TP link on %s in interfaces_ppps_configure."), $port)); return 0; } /* XXX: This needs to go away soon! [It's commented out!] */ @@ -1092,18 +1092,18 @@ function interface_ppps_configure($interface) { */ } if(!is_ipaddr($gateways[$pid])){ - log_error("Could not get a PPTP/L2TP Remote IP address from {$dhcp_gateway} for {$gway} in interfaces_ppps_configure."); + log_error(sprintf(gettext("Could not get a PPTP/L2TP Remote IP address from %s for %s in interfaces_ppps_configure."), $dhcp_gateway, $gway)); return 0; } break; case "ppp": if (!file_exists("{$port}")) { - log_error("Device {$port} does not exist. PPP link cannot start without the modem device."); + log_error(sprintf(gettext("Device %s does not exist. PPP link cannot start without the modem device."), $port)); return 0; } break; default: - log_error("Unkown {$type} configured as ppp interface."); + log_error(sprintf(gettext("Unkown %s configured as ppp interface."), $type)); break; } } @@ -1368,7 +1368,7 @@ EOD; else { $fd = fopen("{$g['varetc_path']}/mpd_{$interface}.conf", "w"); if (!$fd) { - log_error("Error: cannot open mpd_{$interface}.conf in interface_ppps_configure().\n"); + log_error(sprintf(gettext("Error: cannot open mpd_%s.conf in interface_ppps_configure().%s"), $interface, "\n")); return 0; } // Write out mpd_ppp.conf @@ -1420,7 +1420,7 @@ function interfaces_carp_setup() { $cmdchain = new CmdCHAIN(); if ($g['booting']) { - echo "Configuring CARP settings..."; + echo gettext("Configuring CARP settings..."); mute_kernel_msgs(); } @@ -1440,14 +1440,14 @@ function interfaces_carp_setup() { unset($pfsyncenabled); } - $cmdchain->add("Allow CARP", "/sbin/sysctl net.inet.carp.allow=1", true); + $cmdchain->add(gettext("Allow CARP"), "/sbin/sysctl net.inet.carp.allow=1", true); if($balanacing) { - $cmdchain->add("Enable CARP ARP-balancing", "/sbin/sysctl net.inet.carp.arpbalance=1", true); - $cmdchain->add("Disallow CARP preemption", "/sbin/sysctl net.inet.carp.preempt=0", true); + $cmdchain->add(gettext("Enable CARP ARP-balancing"), "/sbin/sysctl net.inet.carp.arpbalance=1", true); + $cmdchain->add(gettext("Disallow CARP preemption"), "/sbin/sysctl net.inet.carp.preempt=0", true); } else - $cmdchain->add("Enable CARP preemption", "/sbin/sysctl net.inet.carp.preempt=1", true); + $cmdchain->add(gettext("Enable CARP preemption"), "/sbin/sysctl net.inet.carp.preempt=1", true); - $cmdchain->add("Enable CARP logging", "/sbin/sysctl net.inet.carp.log=2", true); + $cmdchain->add(gettext("Enable CARP logging"), "/sbin/sysctl net.inet.carp.log=2", true); if (!empty($pfsyncinterface)) $carp_sync_int = get_real_interface($pfsyncinterface); @@ -1463,22 +1463,22 @@ function interfaces_carp_setup() { fclose($fd); mwexec("/sbin/pfctl -f {$g['tmp_path']}/rules.boot"); } else - log_error("Could not create rules.boot file!"); + log_error(gettext("Could not create rules.boot file!")); } /* setup pfsync interface */ if($carp_sync_int and $pfsyncenabled) { if (is_ipaddr($pfsyncpeerip)) - $cmdchain->add("Bring up pfsync0 syncpeer", "/sbin/ifconfig pfsync0 syncdev {$carp_sync_int} syncpeer {$pfsyncpeerip} up", false); + $cmdchain->add(gettext("Bring up pfsync0 syncpeer"), "/sbin/ifconfig pfsync0 syncdev {$carp_sync_int} syncpeer {$pfsyncpeerip} up", false); else - $cmdchain->add("Bring up pfsync0 syncdev", "/sbin/ifconfig pfsync0 syncdev {$carp_sync_int} up", false); + $cmdchain->add(gettext("Bring up pfsync0 syncdev"), "/sbin/ifconfig pfsync0 syncdev {$carp_sync_int} up", false); } else - $cmdchain->add("Bring up pfsync0", "/sbin/ifconfig pfsync0 syncdev lo0 up", false); + $cmdchain->add(gettext("Bring up pfsync0"), "/sbin/ifconfig pfsync0 syncdev lo0 up", false); if($config['virtualip']['vip']) - $cmdchain->add("Allow CARP.", "/sbin/sysctl net.inet.carp.allow=1", true); + $cmdchain->add(gettext("Allow CARP."), "/sbin/sysctl net.inet.carp.allow=1", true); else - $cmdchain->add("Disallow CARP.", "/sbin/sysctl net.inet.carp.allow=0", true); + $cmdchain->add(gettext("Disallow CARP."), "/sbin/sysctl net.inet.carp.allow=0", true); if($g['debug']) $cmdchain->setdebug(); // optional for verbose logging @@ -1488,7 +1488,7 @@ function interfaces_carp_setup() { if ($g['booting']) { unmute_kernel_msgs(); - echo "done.\n"; + echo gettext("done.") . "\n"; } } @@ -1665,7 +1665,7 @@ function interface_carp_configure(&$vip) { */ $realif = get_real_interface($vip['interface']); if (!does_interface_exist($realif)) { - file_notice("CARP", "Interface specified for the virtual IP address {$vip['subnet']} does not exist. Skipping this VIP.", "Firewall: Virtual IP", ""); + file_notice("CARP", sprintf(gettext("Interface specified for the virtual IP address %s does not exist. Skipping this VIP."), $vip['subnet']), "Firewall: Virtual IP", ""); return; } @@ -1673,7 +1673,7 @@ function interface_carp_configure(&$vip) { $ww_subnet_ip = find_interface_ip($realif); $ww_subnet_bits = find_interface_subnet($realif); if (!ip_in_subnet($vip['subnet'], gen_subnet($ww_subnet_ip, $ww_subnet_bits) . "/" . $ww_subnet_bits)) { - file_notice("CARP", "Sorry but we could not find a matching real interface subnet for the virtual IP address {$vip['subnet']}.", "Firewall: Virtual IP", ""); + file_notice("CARP", sprintf(gettext("Sorry but we could not find a matching real interface subnet for the virtual IP address %s."), $vip['subnet']), "Firewall: Virtual IP", ""); return; } @@ -1708,7 +1708,7 @@ function interface_carpdev_configure(&$vip) { if($vip['password'] != "") $password = " pass \"" . $vip_password . "\""; - log_error("Found carpdev interface {$vip['interface']} on top of interface {$interface}"); + log_error(sprintf(gettext("Found carpdev interface %s on top of interface %s"), $vip['interface'], $interface)); if (empty($vip['interface'])) return; @@ -1720,7 +1720,7 @@ function interface_carpdev_configure(&$vip) { * prevents a panic if the interface is missing or invalid */ if (!does_interface_exist($realif)) { - file_notice("CARP", "Interface specified for the virtual IP address {$vip['subnet']} does not exist. Skipping this VIP.", "Firewall: Virtual IP", ""); + file_notice("CARP", sprintf(gettext("Interface specified for the virtual IP address %s does not exist. Skipping this VIP."), $vip['subnet']), "Firewall: Virtual IP", ""); return; } @@ -1766,7 +1766,7 @@ EOD; /* fire up dhclient */ mwexec("/sbin/dhclient -c {$g['varetc_path']}/dhclient_{$vipif}.conf {$vipif} > {$g['tmp_path']}/{$vipif}_output > {$g['tmp_path']}/{$vipif}_error_output", false); } else { - log_error("Error: cannot open dhclient_{$vipif}.conf in interfaces_carpdev_configure() for writing.\n"); + log_error(sprintf(gettext("Error: cannot open dhclient_%s.conf in interfaces_carpdev_configure() for writing.%s"), $vipif, "\n")); mwexec("/sbin/dhclient -b {$vipif}"); } @@ -1799,15 +1799,15 @@ function interface_wireless_clone($realif, $wlcfg) { exec("/sbin/ifconfig {$realif}", $output, $ret); $ifconfig_str = implode($output); if(($wlcfg_mode == "hostap") && (! preg_match("/hostap/si", $ifconfig_str))) { - log_error("Interface {$realif} changed to hostap mode"); + log_error(sprintf(gettext("Interface %s changed to hostap mode"), $realif)); $needs_clone = true; } if(($wlcfg_mode == "adhoc") && (! preg_match("/adhoc/si", $ifconfig_str))) { - log_error("Interface {$realif} changed to adhoc mode"); + log_error(sprintf(gettext("Interface %s changed to adhoc mode"), $realif)); $needs_clone = true; } if(($wlcfg_mode == "bss") && (preg_match("/hostap|adhoc/si", $ifconfig_str))) { - log_error("Interface {$realif} changed to infrastructure mode"); + log_error(sprintf(gettext("Interface %s changed to infrastructure mode"), $realif)); $needs_clone = true; } } else { @@ -1819,12 +1819,12 @@ function interface_wireless_clone($realif, $wlcfg) { if(does_interface_exist($realif)) pfSense_interface_destroy($realif); - log_error("Cloning new wireless interface {$realif}"); + log_error(sprintf(gettext("Cloning new wireless interface %s"), $realif)); // Create the new wlan interface. FreeBSD returns the new interface name. // example: wlan2 exec("/sbin/ifconfig wlan create wlandev {$baseif} {$mode} bssid 2>&1", $out, $ret); if($ret <> 0) { - log_error("Failed to clone interface {$baseif} with error code {$ret}, output {$out[0]}"); + log_error(sprintf(gettext("Failed to clone interface %s with error code %s, output %s"), $baseif, $ret, $out[0])); return false; } $newif = trim($out[0]); @@ -2335,13 +2335,13 @@ function interface_configure($interface = "wan", $reloadall = false) { /* this is not a valid mac address. generate a * temporary mac address so the machine can get online. */ - echo "Generating new MAC address."; + echo gettext("Generating new MAC address."); $random_mac = generate_random_mac_address(); mwexec("/sbin/ifconfig " . escapeshellarg(get_real_interface($wancfg['if'])) . " link " . escapeshellarg($random_mac)); $wancfg['spoofmac'] = $random_mac; write_config(); - file_notice("MAC Address altered", "The INVALID MAC address (ff:ff:ff:ff:ff:ff) on interface {$realif} has been automatically replaced with {$random_mac}", "Interfaces"); + file_notice("MAC Address altered", sprintf(gettext("The INVALID MAC address (ff:ff:ff:ff:ff:ff) on interface %s has been automatically replaced with %s"), $realif, $random_mac), "Interfaces"); } } @@ -2464,7 +2464,7 @@ function interface_carpdev_dhcp_configure($interface = "wan") { if($wanif) interfaces_bring_up($wanif); else - log_error("Could not bring wanif up in terface_carpdev_dhcp_configure()"); + log_error(gettext("Could not bring wanif up in terface_carpdev_dhcp_configure()")); return 0; } @@ -2479,7 +2479,7 @@ function interface_dhcp_configure($interface = "wan") { /* generate dhclient_wan.conf */ $fd = fopen("{$g['varetc_path']}/dhclient_{$interface}.conf", "w"); if (!$fd) { - printf("Error: cannot open dhclient_{$interface}.conf in interfaces_wan_dhcp_configure() for writing.\n"); + printf(printf(gettext("Error: cannot open dhclient_%s.conf in interfaces_wan_dhcp_configure() for writing.%s"), $interface, "\n")); return 1; } @@ -2492,7 +2492,7 @@ function interface_dhcp_configure($interface = "wan") { $wanif = get_real_interface($interface); if (empty($wanif)) { - log_error("Invalid interface \"{$interface}\" in interface_dhcp_configure()"); + log_error(sprintf(gettext("Invalid interface \"%s\" in interface_dhcp_configure()"), $interface)); return 0; } $dhclientconf = ""; @@ -2527,7 +2527,7 @@ EOD; if($wanif) interfaces_bring_up($wanif); else - log_error("Could not bring up {$wanif} interface in interface_dhcp_configure()"); + log_error(printf(gettext("Could not bring up %s interface in interface_dhcp_configure()"), $wanif)); /* fire up dhclient */ mwexec("/sbin/dhclient -c {$g['varetc_path']}/dhclient_{$interface}.conf {$wanif} > {$g['tmp_path']}/{$wanif}_output > {$g['tmp_path']}/{$wanif}_error_output"); -- cgit v1.1 From c3d32df4651091760e2e195b459c92f9389eaed4 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Mon, 16 Aug 2010 16:06:05 -0300 Subject: Implement gettext() calls on filter.inc --- etc/inc/filter.inc | 108 +++++++++++++++++++++++++++-------------------------- 1 file changed, 55 insertions(+), 53 deletions(-) diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 5fe9cfb..695f6f0 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -162,7 +162,7 @@ function filter_configure_sync() { filter_pflog_start(); - update_filter_reload_status("Initializing"); + update_filter_reload_status(gettext("Initializing")); /* invalidate interface cache */ get_interface_arr(true); @@ -174,43 +174,43 @@ function filter_configure_sync() { /* Get interface list to work with. */ filter_generate_optcfg_array(); if($g['booting'] == true) - echo "Configuring firewall"; + echo gettext("Configuring firewall"); /* generate aliases */ if($g['booting'] == true) echo "."; - update_filter_reload_status("Creating aliases"); + update_filter_reload_status(gettext("Creating aliases")); $aliases = filter_generate_aliases(); $gateways = filter_generate_gateways(); if($g['booting'] == true) echo "."; - update_filter_reload_status("Generating NAT rules"); + update_filter_reload_status(gettext("Generating NAT rules")); /* generate nat rules */ $natrules = filter_nat_rules_generate(); if($g['booting'] == true) echo "."; - update_filter_reload_status("Generating filter rules"); + update_filter_reload_status(gettext("Generating filter rules")); /* generate pfctl rules */ $pfrules = filter_rules_generate(); /* generate altq, limiter */ if($g['booting'] == true) echo "."; - update_filter_reload_status("Generating ALTQ queues"); + update_filter_reload_status(gettext("Generating ALTQ queues")); $altq_queues = filter_generate_altq_queues(); - update_filter_reload_status("Generating Limiter rules"); + update_filter_reload_status(gettext("Generating Limiter rules")); $dummynet_rules = filter_generate_dummynet_rules(); - update_filter_reload_status("Generating Layer7 rules"); + update_filter_reload_status(gettext("Generating Layer7 rules")); generate_layer7_files(); if($g['booting'] == true) echo "."; - update_filter_reload_status("Loading filter rules"); + update_filter_reload_status(gettext("Loading filter rules")); /* enable pf if we need to, otherwise disable */ if(!isset ($config['system']['disablefilter'])) { mwexec("/sbin/pfctl -e", true); } else { mwexec("/sbin/pfctl -d"); unlink_if_exists("{$g['tmp_path']}/filter_loading"); - update_filter_reload_status("Filter is disabled. Not loading rules."); + update_filter_reload_status(gettext("Filter is disabled. Not loading rules.")); if($g['booting'] == true) echo "done.\n"; unlock($filterlck); @@ -224,7 +224,7 @@ function filter_configure_sync() { $rules = ""; $rules .= "{$aliases} \n"; $rules .= "{$gateways} \n"; - update_filter_reload_status("Setting up logging information"); + update_filter_reload_status(gettext("Setting up logging information")); $rules .= filter_setup_logging_interfaces(); if($config['system']['optimization'] <> "") { $rules .= "set optimization {$config['system']['optimization']}\n"; @@ -255,7 +255,7 @@ function filter_configure_sync() { $rules .= "\n"; $rules .= "set skip on pfsync0\n"; $rules .= "\n"; - update_filter_reload_status("Setting up SCRUB information"); + update_filter_reload_status(gettext("Setting up SCRUB information")); $rules .= filter_generate_scrubing(); $rules .= "\n"; /* NOTE: Disabled until we catch up with dummynet changes. */ @@ -267,7 +267,7 @@ function filter_configure_sync() { $rules .= discover_pkg_rules("filter"); if(!file_put_contents("{$g['tmp_path']}/rules.debug", $rules, LOCK_EX)) { - log_error("WARNING: Could not write new rules!"); + log_error(gettext("WARNING: Could not write new rules!")); unlock($filterlck); return; } @@ -301,11 +301,12 @@ function filter_configure_sync() { $line_number = $line_error[1]; $line_split = file("{$g['tmp_path']}/rules.debug"); if(is_array($line_split)) - $line_error = "The line in question reads [{$line_number}]: {$line_split[$line_number-1]}"; + $line_error = sprintf(gettext("The line in question reads [%d]: %s"), $line_number, $line_split[$line_number-1]); if($line_error and $line_number) { - file_notice("filter_load", "There were error(s) loading the rules: {$rules_error} {$line_error}", "Filter Reload", ""); - log_error("There were error(s) loading the rules: {$rules_error} - {$line_error}"); - update_filter_reload_status("There were error(s) loading the rules: {$rules_error} - {$line_error}"); + $error_msg = gettext("There were error(s) loading the rules: %s - %s"), $rules_error, $line_error); + file_notice("filter_load", $error_msg, "Filter Reload", ""); + log_error($error_msg); + update_filter_reload_status($error_msg); unlock($filterlck); return; } @@ -314,12 +315,13 @@ function filter_configure_sync() { exec("/sbin/pfctl -d"); exec("/sbin/pfctl -e"); exec("/sbin/pfctl -f {$g['tmp_path']}/rules.debug"); - file_notice("pf_busy", "PF was wedged/busy and has been reset.", "pf_busy", ""); - log_error("PF was wedged/busy and has been reset."); + $error_msg = gettext("PF was wedged/busy and has been reset."); + file_notice("pf_busy", $error_msg, "pf_busy", ""); + log_error($error_msg); } } - update_filter_reload_status("Starting up layer7 daemon"); + update_filter_reload_status(gettext("Starting up layer7 daemon")); layer7_start_l7daemon(); if(!empty($filterdns)) { @@ -368,19 +370,19 @@ function filter_configure_sync() { if($g['booting'] == true) echo "."; - update_filter_reload_status("Processing down interface states"); + update_filter_reload_status(gettext("Processing down interface states")); filter_delete_states_for_down_gateways(); - update_filter_reload_status("Running plugins"); + update_filter_reload_status(gettext("Running plugins")); if(is_dir("/usr/local/pkg/pf/")) { /* process packager manager custom rules */ - update_filter_reload_status("Running plugins (pf)"); + update_filter_reload_status(gettext("Running plugins (pf)")); run_plugins("/usr/local/pkg/pf/"); - update_filter_reload_status("Plugins completed."); + update_filter_reload_status(gettext("Plugins completed.")); } - update_filter_reload_status("Done"); + update_filter_reload_status(gettext("Done")); if($g['booting'] == true) echo "done.\n"; @@ -558,7 +560,7 @@ function filter_generate_gateways() { $rules = "# Gateways\n"; - update_filter_reload_status("Creating gateway group item..."); + update_filter_reload_status(gettext("Creating gateway group item...")); /* Lookup Gateways to be used in filter rules once */ $GatewaysList = return_gateways_array(); @@ -588,14 +590,14 @@ function filter_generate_gateways() { $gatewayip = $member['gwip']; if (($int <> "") && is_ipaddr($gatewayip)) { if ($g['debug']) - log_error("Setting up route with {$gatewayip} om $int"); + log_error(sprintf(gettext("Setting up route with %s on %s"), $gatewayip, $int)); if ($member['weight'] > 1) { $routeto .= str_repeat("( {$int} {$gatewayip} ) ", $member['weight']); } else $routeto .= "( {$int} {$gatewayip} ) "; $foundlb++; } else - log_error("An error occurred while trying to find the interface got $gatewayip . The rule has not been added."); + log_error(sprintf(gettext("An error occurred while trying to find the interface got %s . The rule has not been added."), $gatewayip)); } $route = ""; if ($foundlb > 0) { @@ -821,7 +823,7 @@ function filter_generate_reflection_nat($rule, $nat_ifs, $protocol, $target, $ta // Initialize natrules holder string $natrules = ""; - update_filter_reload_status("Creating reflection NAT rule for {$rule['descr']}..."); + update_filter_reload_status(sprintf(gettext("Creating reflection NAT rule for %s..."), $rule['descr'])); /* TODO: Add this option to port forwards page. */ if(isset($rule['staticnatport'])) { @@ -870,7 +872,7 @@ function filter_generate_reflection($rule, $nordr, $rdr_ifs, $srcaddr, $dstaddr_ else $reflectiontimeout = "2000"; - update_filter_reload_status("Creating reflection rule for {$rule['descr']}..."); + update_filter_reload_status(sprintf(gettext("Creating reflection rule for %s..."), $rule['descr'])); $rdr_if_list = implode(" ", $rdr_ifs); if(count($rdr_ifs) > 1) @@ -941,7 +943,7 @@ function filter_generate_reflection($rule, $nordr, $rdr_ifs, $srcaddr, $dstaddr_ if($rule['local-port']) $lrange_start = $rule['local-port']; if(($range_end + 1) - $dstport[0] > 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")); /* only install reflection rules for < 19991 items */ } else if($starting_localhost_port < 19991) { $loc_pt = $lrange_start; @@ -949,7 +951,7 @@ function filter_generate_reflection($rule, $nordr, $rdr_ifs, $srcaddr, $dstaddr_ if(is_alias($loc_pt)) { $loc_pt_translated = filter_expand_alias($loc_pt); if(!$loc_pt_translated) { - log_error("Reflection processing: {$loc_pt} is not a vaild port alias."); + log_error(sprintf(gettext("Reflection processing: %s is not a vaild port alias."), $loc_pt)); continue; } $toadd_array = split(" ", $loc_pt_translated); @@ -961,7 +963,7 @@ function filter_generate_reflection($rule, $nordr, $rdr_ifs, $srcaddr, $dstaddr_ $rflctrange = "{$starting_localhost_port}"; $delta = $range_end - $dstport[0]; if(($starting_localhost_port + $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 - $starting_localhost_port; $range_end = $dstport[0] + $delta; $rflctintrange = ""; @@ -1073,7 +1075,7 @@ function filter_nat_rules_generate() { $natrules = "nat-anchor \"natearly/*\"\n"; $natrules .= "nat-anchor \"natrules/*\"\n\n"; - update_filter_reload_status("Creating 1:1 rules..."); + update_filter_reload_status(gettext("Creating 1:1 rules...")); $reflection_txt = ""; @@ -1121,7 +1123,7 @@ function filter_nat_rules_generate() { /* advanced outbound rules */ if(is_array($config['nat']['advancedoutbound']['rule'])) { foreach ($config['nat']['advancedoutbound']['rule'] as $obent) { - update_filter_reload_status("Creating advanced outbound rule {$obent['descr']}"); + update_filter_reload_status(sprintf(gettext("Creating advanced outbound rule %s"), $obent['descr'])); $src = $obent['source']['network']; if(isset($obent['destination']['not']) && !isset($obent['destination']['any'])) $dst = "!" . $obent['destination']['address']; @@ -1150,7 +1152,7 @@ function filter_nat_rules_generate() { } } else { /* standard outbound rules (one for each interface) */ - update_filter_reload_status("Creating outbound NAT rules"); + update_filter_reload_status(gettext("Creating outbound NAT rules")); $tonathosts = ""; $numberofnathosts = 0; @@ -1234,7 +1236,7 @@ function filter_nat_rules_generate() { } if($numberofnathosts > 0): foreach ($FilterIflist as $if => $ifcfg) { - update_filter_reload_status("Creating outbound rules {$if} - ({$ifcfg['descr']})"); + update_filter_reload_status(sprintf(gettext("Creating outbound rules %s - (%s)"), $if, $ifcfg['descr'])); if(interface_has_gateway($if)) { $target = $ifcfg['ip']; /* create outbound nat entries for all local networks */ @@ -1252,7 +1254,7 @@ function filter_nat_rules_generate() { $natrules .= "\n# Load balancing anchor\n"; $natrules .= "rdr-anchor \"relayd/*\"\n"; - update_filter_reload_status("Setting up TFTP helper"); + update_filter_reload_status(gettext("Setting up TFTP helper")); $natrules .= "# TFTP proxy\n"; $natrules .= "rdr-anchor \"tftp-proxy/*\"\n"; @@ -1292,7 +1294,7 @@ function filter_nat_rules_generate() { $starting_localhost_port = 19000; $natrules .= "# NAT Inbound Redirects\n"; foreach ($config['nat']['rule'] as $rule) { - update_filter_reload_status("Creating NAT rule {$rule['descr']}"); + update_filter_reload_status(sprintf(gettext("Creating NAT rule %s"), $rule['descr'])); if(isset($rule['disabled'])) continue; @@ -1431,7 +1433,7 @@ EOD; function filter_generate_user_rule_arr($rule) { global $config; - update_filter_reload_status("Creating filter rule {$rule['descr']} ..."); + update_filter_reload_status(sprintf(gettext("Creating filter rule %s ..."), $rule['descr'])); $ret = array(); $line = filter_generate_user_rule($rule); $ret['rule'] = $line; @@ -1513,7 +1515,7 @@ function filter_generate_address(& $rule, $target = "source", $isnat = false) { $srcport = explode("-", $rule[$target]['port']); $srcporta = alias_expand($srcport[0]); if(!$srcporta) - log_error("filter_generate_address: {$srcport[0]} is not a valid source port."); + log_error(sprintf(gettext("filter_generate_address: %s is not a valid source port."), $srcport[0])); else if((!$srcport[1]) || ($srcport[0] == $srcport[1])) { $src .= " port {$srcporta} "; } else if(($srcport[0] == 1) && ($srcport[1] == 65535)) { @@ -1613,7 +1615,7 @@ function filter_generate_user_rule($rule) { $aline['quick'] = " quick "; /* set the gateway interface */ - update_filter_reload_status("Setting up pass/block rules {$rule['descr']}"); + update_filter_reload_status(sprintf(gettext("Setting up pass/block rules %s"), $rule['descr'])); /* do not process reply-to for gateway'd rules */ if($rule['gateway'] == "" && interface_has_gateway($rule['interface']) && !isset($rule['disablereplyto'])) { @@ -1622,7 +1624,7 @@ function filter_generate_user_rule($rule) { $aline['reply'] = "reply-to ( {$ifcfg['if']} {$rg} ) "; } else { if($rule['interface'] <> "pptp") { - log_error("Could not find gateway for interface({$rule['interface']})."); + log_error(sprintf(gettext("Could not find gateway for interface (%s)."), $rule['interface'])); } } } @@ -1632,7 +1634,7 @@ function filter_generate_user_rule($rule) { /* Add the load balanced gateways */ $aline['route'] = " \$GW{$rule['gateway']} "; else - log_error("The gateway: {$rule['gateway']} is invalid/unkown not using it."); + log_error(sprintf(gettext("The gateway: %s is invalid/unkown not using it."), $rule['gateway'])); } if(isset($rule['protocol'])) { @@ -1646,7 +1648,7 @@ function filter_generate_user_rule($rule) { if($rule['source']['port'] <> "" || $rule['destination']['port'] <> "") $aline['prot'] = " proto tcp "; } - update_filter_reload_status("Creating rule {$rule['descr']}"); + update_filter_reload_status(sprintf(gettext("Creating rule %s"), $rule['descr'])); /* source address */ $src = filter_generate_address($rule, "source"); @@ -1852,7 +1854,7 @@ function filter_generate_user_rule($rule) { function filter_rules_generate() { global $config, $g, $FilterIflist, $time_based_rules, $GatewaysList; - update_filter_reload_status("Creating default rules"); + update_filter_reload_status(gettext("Creating default rules")); if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "filter_rules_generate() being called $mt\n"; @@ -2120,7 +2122,7 @@ EOD; /* this shouldnt ever happen but instead of breaking the clients ruleset * log an error. */ - log_error("ERROR! PPTP enabled but could not resolve the \$pptpdtarget"); + log_error(sprintf(gettext("ERROR! PPTP enabled but could not resolve the %s"), \$pptpdtarget")); } } @@ -2198,7 +2200,7 @@ EOD; } } - update_filter_reload_status("Creating IPsec rules..."); + update_filter_reload_status(gettext("Creating IPsec rules...")); $ipfrules .= filter_generate_ipsec_rules(); $ipfrules .= << 0) { - $errorrules = "There was an error while parsing the package filter rules for {$pkg_inc}.\n"; + $errorrules = sprintf(gettext("There was an error while parsing the package filter rules for %s."), $pkg_inc) . "\n"; log_error($errorrules); file_put_contents("{$g['tmp_path']}/rules.packages.{$pkg}", "#{$errorrules}\n"); continue; -- cgit v1.1 From b1fd7536620baa7f5000216e114b025d990b0a0f Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Mon, 16 Aug 2010 16:27:00 -0300 Subject: Implement gettext() calls on ipsec.inc --- etc/inc/ipsec.inc | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/etc/inc/ipsec.inc b/etc/inc/ipsec.inc index 0dd0fe0..12f106a 100644 --- a/etc/inc/ipsec.inc +++ b/etc/inc/ipsec.inc @@ -36,21 +36,21 @@ /* IPsec defines */ $my_identifier_list = array( - 'myaddress' => array( 'desc' => 'My IP address', 'mobile' => true ), - 'address' => array( 'desc' => 'IP address', 'mobile' => true ), - 'fqdn' => array( 'desc' => 'Distinguished name', 'mobile' => true ), - 'user_fqdn' => array( 'desc' => 'User distinguished name', 'mobile' => true ), - 'asn1dn' => array( 'desc' => 'ASN.1 distinguished Name', 'mobile' => true ), - 'keyid tag' => array( 'desc' => 'KeyID tag', 'mobile' => true ), - 'dyn_dns' => array( 'desc' => 'Dynamic DNS', 'mobile' => true )); + 'myaddress' => array( 'desc' => gettext('My IP address'), 'mobile' => true ), + 'address' => array( 'desc' => gettext('IP address'), 'mobile' => true ), + 'fqdn' => array( 'desc' => gettext('Distinguished name'), 'mobile' => true ), + 'user_fqdn' => array( 'desc' => gettext('User distinguished name'), 'mobile' => true ), + 'asn1dn' => array( 'desc' => gettext('ASN.1 distinguished Name'), 'mobile' => true ), + 'keyid tag' => array( 'desc' => gettext('KeyID tag'), 'mobile' => true ), + 'dyn_dns' => array( 'desc' => gettext('Dynamic DNS'), 'mobile' => true )); $peer_identifier_list = array( - 'peeraddress' => array( 'desc' => 'Peer IP address', 'mobile' => false ), - 'address' => array( 'desc' => 'IP address', 'mobile' => false ), - 'fqdn' => array( 'desc' => 'Distinguished name', 'mobile' => true ), - 'user_fqdn' => array( 'desc' => 'User distinguished name', 'mobile' => true ), - 'asn1dn' => array( 'desc' => 'ASN.1 distinguished Name', 'mobile' => true ), - 'keyid tag' => array( 'desc' =>'KeyID tag', 'mobile' => true )); + 'peeraddress' => array( 'desc' => gettext('Peer IP address'), 'mobile' => false ), + 'address' => array( 'desc' => gettext('IP address'), 'mobile' => false ), + 'fqdn' => array( 'desc' => gettext('Distinguished name'), 'mobile' => true ), + 'user_fqdn' => array( 'desc' => gettext('User distinguished name'), 'mobile' => true ), + 'asn1dn' => array( 'desc' => gettext('ASN.1 distinguished Name'), 'mobile' => true ), + 'keyid tag' => array( 'desc' =>gettext('KeyID tag'), 'mobile' => true )); $p1_ealgos = array( 'aes' => array( 'name' => 'AES', 'keysel' => array( 'lo' => 128, 'hi' => 256, 'step' => 64 ) ), @@ -213,9 +213,9 @@ function ipsec_idinfo_to_text(& $idinfo) { case "network": return $idinfo['address']."/".$idinfo['netbits']; case "mobile": - return "Mobile Client"; + return gettext("Mobile Client"); case "none": - return "None"; + return gettext("None"); default: return strtoupper($idinfo['type']); } -- cgit v1.1 From 930fc5add493e5bb3ff57c8581770fc9c2985e4a Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Mon, 16 Aug 2010 16:51:26 -0300 Subject: Implement gettext() calls on meta.inc --- etc/inc/meta.inc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/etc/inc/meta.inc b/etc/inc/meta.inc index 3090319..63c9391 100644 --- a/etc/inc/meta.inc +++ b/etc/inc/meta.inc @@ -65,7 +65,7 @@ function list_phpfiles($path, & $found) { $dir = opendir($path); if (!$dir) { - echo "list_phpfiles: unable to examine path {$path}\n"; + printf(gettext("list_phpfiles: unable to examine path %s%s"), $path, "\n"); return; } @@ -96,7 +96,7 @@ function read_file_metadata($fpath, & $metadata, $taglist = false) { $fdata = @file_get_contents($fpath); if (!$fdata) { - echo "unable to read {$fpath}\n"; + printf(gettext("unable to read %s%s"), $fpath, "\n"); continue; } @@ -129,7 +129,7 @@ function read_file_metadata($fpath, & $metadata, $taglist = false) { $tagend = substr($fdata, $tagend_off + 4, $tagend_len - 4); if ($tagbeg != $tagend) { - echo "error: tag mismatch ( {$tagbeg} != {$tagend} ) in '$fpath'\n"; + printf(gettext("error: tag mismatch ( %s != %s ) in '%s'%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)) { - echo "warning: tag {$tagbeg} has no data in '$fpath'\n"; + printf(gettext("warning: tag %s has no data in '%s'%s"), $tagbeg, $fpath, "\n"); break; } @@ -160,7 +160,7 @@ function read_file_metadata($fpath, & $metadata, $taglist = false) { $valtag = stripos($line, "##|*"); if ($valtag === false || $valtag) { - echo "warning: tag {$tagbeg} has malformed data in '$fpath'\n"; + printf(gettext("warning: tag %s has malformed data in '%s'%s"), $tagbeg, $fpath, "\n"); continue; } @@ -182,7 +182,7 @@ function read_file_metadata($fpath, & $metadata, $taglist = false) { } if (!isset($vname) || !isset($vdata)) { - echo "warning: tag {$tagbeg} has invalid data in '$fpath'\n"; + printf(gettext("warning: tag %s has invalid data in '%s'%s"), $tagbeg, $fpath, "\n"); continue; } -- cgit v1.1 From 5025dfe3476903d4aefe9e4a1d1a15df082852ee Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Mon, 16 Aug 2010 17:14:27 -0300 Subject: Implement gettext() calls on notices.inc --- etc/inc/notices.inc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/etc/inc/notices.inc b/etc/inc/notices.inc index 4415987..6d4ed1e 100644 --- a/etc/inc/notices.inc +++ b/etc/inc/notices.inc @@ -73,12 +73,12 @@ function file_notice($id, $notice, $category = "General", $url = "", $priority = $queue[$queuekey] = $toqueue; $queueout = fopen($notice_path, "w"); if(!$queueout) { - log_error("Could not open {$notice_path} for writing"); + log_error(printf(gettext("Could not open %s for writing"), $notice_path)); return; } fwrite($queueout, serialize($queue)); fclose($queueout); - log_error("New alert found: {$notice}"); + log_error(printf(gettext("New alert found: %s"), $notice)); /* soekris */ if(file_exists("/dev/led/error")) exec("/bin/echo 1 > /dev/led/error"); @@ -323,11 +323,11 @@ function notify_via_smtp($message) { fclose($fd); if($smtp->SendMessage($from, array($to), $headers, $message)) { - log_error("Message sent to {$to} OK"); + log_error(sprintf(gettext("Message sent to %s OK"), $to)); return; } else { - log_error("Could not send the message to {$to} -- Error: {$smtp->error}"); - return("Could not send the message to {$to} -- Error: {$smtp->error}"); + log_error(sprintf(gettext("Could not send the message to %s -- Error: %s"), $to, $smtp->error)); + return(sprintf(gettext("Could not send the message to %s -- Error: %s"), $to, $smtp->error)); } } -- cgit v1.1 From 4aa02281b02f74ed44b18e1ee98dd5b57f77ae0c Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Mon, 16 Aug 2010 17:27:33 -0300 Subject: Implement gettext() calls on openvpn.inc --- etc/inc/openvpn.inc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc index a529322..8116f96 100644 --- a/etc/inc/openvpn.inc +++ b/etc/inc/openvpn.inc @@ -72,15 +72,15 @@ $openvpn_dh_lengths = array( 1024, 2048, 4096 ); $openvpn_server_modes = array( - 'p2p_tls' => "Peer to Peer ( SSL/TLS )", - 'p2p_shared_key' => "Peer to Peer ( Shared Key )", - 'server_tls' => "Remote Access ( SSL/TLS )", - 'server_user' => "Remote Access ( User Auth )", - 'server_tls_user' => "Remote Access ( SSL/TLS + User Auth )"); + 'p2p_tls' => gettext("Peer to Peer ( SSL/TLS )"), + 'p2p_shared_key' => gettext("Peer to Peer ( Shared Key )"), + 'server_tls' => gettext("Remote Access ( SSL/TLS )"), + 'server_user' => gettext("Remote Access ( User Auth )"), + 'server_tls_user' => gettext("Remote Access ( SSL/TLS + User Auth )")); $openvpn_client_modes = array( - 'p2p_tls' => "Peer to Peer ( SSL/TLS )", - 'p2p_shared_key' => "Peer to Peer ( Shared Key )" ); + 'p2p_tls' => gettext("Peer to Peer ( SSL/TLS )"), + 'p2p_shared_key' => gettext("Peer to Peer ( Shared Key )") ); function openvpn_create_key() { @@ -168,21 +168,21 @@ function openvpn_get_cipherlist() { $words = explode(' ', $line); $ciphers[$words[0]] = "{$words[0]} {$words[1]}"; } - $ciphers["none"] = "None (No Encryption)"; + $ciphers["none"] = gettext("None (No Encryption)"); return $ciphers; } function openvpn_validate_host($value, $name) { $value = trim($value); if (empty($value) || (!is_domain($value) && !is_ipaddr($value))) - return "The field '$name' must contain a valid IP address or domain name."; + return sprintf(gettext("The field '%s' must contain a valid IP address or domain name."), $name); return false; } function openvpn_validate_port($value, $name) { $value = trim($value); if (empty($value) || !is_numeric($value) || $value < 0 || ($value > 65535)) - return "The field '$name' must contain a valid port, ranging from 0 to 65535."; + return sprintf(gettext("The field '%s' must contain a valid port, ranging from 0 to 65535."), $name); return false; } @@ -191,7 +191,7 @@ function openvpn_validate_cidr($value, $name) { if (!empty($value)) { list($ip, $mask) = explode('/', $value); if (!is_ipaddr($ip) or !is_numeric($mask) or ($mask > 32) or ($mask < 0)) - return "The field '$name' must contain a valid CIDR range."; + return sprintf(gettext("The field '%s' must contain a valid CIDR range."), $name); } return false; } -- cgit v1.1 From 487415e888a9c82484809a10de24f66447171c49 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Mon, 16 Aug 2010 17:43:15 -0300 Subject: Implement gettext() calls on PEAR.inc --- etc/inc/PEAR.inc | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/etc/inc/PEAR.inc b/etc/inc/PEAR.inc index 26d1159..ac5cc12 100644 --- a/etc/inc/PEAR.inc +++ b/etc/inc/PEAR.inc @@ -158,7 +158,7 @@ class PEAR { $classname = strtolower(get_class($this)); if ($this->_debug) { - print "PEAR constructor called, class=$classname\n"; + printf(gettext("PEAR constructor called, class=%s%s"), $classname, "\n"); } if ($error_class !== null) { $this->_error_class = $error_class; @@ -195,7 +195,7 @@ class PEAR */ function _PEAR() { if ($this->_debug) { - printf("PEAR destructor called, class=%s\n", strtolower(get_class($this))); + printf(gettext("PEAR destructor called, class=%s%s"), strtolower(get_class($this)), "\n"); } } @@ -334,12 +334,12 @@ class PEAR if (is_callable($options)) { $setoptions = $options; } else { - trigger_error("invalid error callback", E_USER_WARNING); + trigger_error(gettext("invalid error callback"), E_USER_WARNING); } break; default: - trigger_error("invalid error mode", E_USER_WARNING); + trigger_error(gettext("invalid error mode"), E_USER_WARNING); break; } } @@ -442,17 +442,17 @@ class PEAR $deleted = false; } } - return $deleted ? true : PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME + return $deleted ? true : PEAR::raiseError(gettext("The expected error you submitted does not exist")); // IMPROVE ME } elseif (!empty($error_code)) { // $error_code comes alone, trying to unset it if ($this->_checkDelExpect($error_code)) { return true; } else { - return PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME + return PEAR::raiseError(gettext("The expected error you submitted does not exist")); // IMPROVE ME } } else { // $error_code is empty - return PEAR::raiseError("The expected error you submitted is empty"); // IMPROVE ME + return PEAR::raiseError(gettext("The expected error you submitted is empty")); // IMPROVE ME } } @@ -592,12 +592,12 @@ class PEAR if (is_callable($options)) { $def_options = $options; } else { - trigger_error("invalid error callback", E_USER_WARNING); + trigger_error(gettext("invalid error callback"), E_USER_WARNING); } break; default: - trigger_error("invalid error mode", E_USER_WARNING); + trigger_error(gettext("invalid error mode"), E_USER_WARNING); break; } $stack[] = array($mode, $options); @@ -629,12 +629,12 @@ class PEAR if (is_callable($options)) { $setoptions = $options; } else { - trigger_error("invalid error callback", E_USER_WARNING); + trigger_error(gettext("invalid error callback"), E_USER_WARNING); } break; default: - trigger_error("invalid error mode", E_USER_WARNING); + trigger_error(gettext("invalid error mode"), E_USER_WARNING); break; } return true; @@ -863,7 +863,7 @@ class PEAR_Error } } if ($this->mode & PEAR_ERROR_EXCEPTION) { - trigger_error("PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_ErrorStack for exceptions", E_USER_WARNING); + trigger_error(gettext("PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_ErrorStack for exceptions"), E_USER_WARNING); eval('$e = new Exception($this->message, $this->code);$e->PEAR_Error = $this;throw($e);'); } } @@ -1020,8 +1020,8 @@ class PEAR_Error } else { $callback = $this->callback; } - return sprintf('[%s: message="%s" code=%d mode=callback '. - 'callback=%s prefix="%s" info="%s"]', + return sprintf(gettext('[%s: message="%s" code=%d mode=callback '. + 'callback=%s prefix="%s" info="%s"]'), strtolower(get_class($this)), $this->message, $this->code, $callback, $this->error_message_prefix, $this->userinfo); @@ -1038,8 +1038,8 @@ class PEAR_Error if ($this->mode & PEAR_ERROR_RETURN) { $modes[] = 'return'; } - return sprintf('[%s: message="%s" code=%d mode=%s level=%s '. - 'prefix="%s" info="%s"]', + return sprintf(gettext('[%s: message="%s" code=%d mode=%s level=%s '. + 'prefix="%s" info="%s"]'), strtolower(get_class($this)), $this->message, $this->code, implode("|", $modes), $levels[$this->level], $this->error_message_prefix, @@ -1056,4 +1056,4 @@ class PEAR_Error * c-basic-offset: 4 * End: */ -?> \ No newline at end of file +?> -- cgit v1.1 From 62bf5cd09f322d3234674eaa51409abbefc617cb Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Mon, 16 Aug 2010 17:44:53 -0300 Subject: Fix some syntax errors --- etc/inc/filter.inc | 4 ++-- etc/inc/zeromq.inc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 695f6f0..3182d9e 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -303,7 +303,7 @@ function filter_configure_sync() { if(is_array($line_split)) $line_error = sprintf(gettext("The line in question reads [%d]: %s"), $line_number, $line_split[$line_number-1]); if($line_error and $line_number) { - $error_msg = gettext("There were error(s) loading the rules: %s - %s"), $rules_error, $line_error); + $error_msg = sprintf(gettext("There were error(s) loading the rules: %s - %s"), $rules_error, $line_error); file_notice("filter_load", $error_msg, "Filter Reload", ""); log_error($error_msg); update_filter_reload_status($error_msg); @@ -2122,7 +2122,7 @@ EOD; /* this shouldnt ever happen but instead of breaking the clients ruleset * log an error. */ - log_error(sprintf(gettext("ERROR! PPTP enabled but could not resolve the %s"), \$pptpdtarget")); + log_error(gettext("ERROR! PPTP enabled but could not resolve the \$pptpdtarget")); } } diff --git a/etc/inc/zeromq.inc b/etc/inc/zeromq.inc index 27ffc4f..0e96aef 100644 --- a/etc/inc/zeromq.inc +++ b/etc/inc/zeromq.inc @@ -265,4 +265,4 @@ function get_notices_zeromq($raw_params) { return $response; } -?> \ No newline at end of file +?> -- cgit v1.1 From 7d1b238c1910966e144ff17e211f3fecbdfd3485 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Mon, 16 Aug 2010 18:25:08 -0300 Subject: Implement gettext() calls on pfsense-utils.inc --- etc/inc/pfsense-utils.inc | 62 +++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index fa7da13..89eac5b 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -433,11 +433,11 @@ function get_carp_interface_status($carpinterface) { $carp_query = split("\n", `/sbin/ifconfig $carpinterface | grep carp`); 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; } @@ -466,7 +466,7 @@ function add_rule_to_anchor($anchor, $rule, $label) { function remove_text_from_file($file, $text) { global $fd_log; if($fd_log) - fwrite($fd_log, "Adding needed text items:\n"); + fwrite($fd_log, sprintf(gettext("Adding needed text items:%s"), "\n")); $filecontents = file_get_contents($file); $textTMP = str_replace($text, "", $filecontents); $text = $textTMP; @@ -515,7 +515,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")); } /* @@ -560,16 +560,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 '%s' - %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 (%s) to {%s} MAC=%s"), $e, $addr, $mac)); return true; } @@ -646,7 +646,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)); conf_mount_ro(); return; } @@ -667,7 +667,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)); conf_mount_ro(); return; } @@ -812,10 +812,10 @@ function call_pfsense_method($method, $params, $timeout = 0) { } $resp = $cli->send($msg, $timeout); if(!$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 %s: %s"), $resp->faultCode(), $resp->faultString())); return false; } else { return XML_RPC_Decode($resp->value()); @@ -890,13 +890,13 @@ function reload_interfaces_sync() { /* XXX: Use locks?! */ if (file_exists("{$g['tmp_path']}/reloading_all")) { - log_error("WARNING: Recursive call to interfaces sync!"); + log_error(gettext("WARNING: Recursive call to interfaces sync!")); return; } touch("{$g['tmp_path']}/reloading_all"); 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); @@ -904,17 +904,17 @@ 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(); /* remove reloading_all trigger */ if($g['debug']) - log_error("Removing {$g['tmp_path']}/reloading_all"); + log_error(sprintf(gettext("Removing %s/reloading_all"), $g['tmp_path'])); /* start devd back up */ mwexec("/bin/rm {$g['tmp_path']}/reload*"); @@ -961,7 +961,7 @@ function reload_all_sync() { /* XXX: Use locks?! */ if (file_exists("{$g['tmp_path']}/reloading_all")) { - log_error("WARNING: Recursive call to reload all sync!"); + log_error(gettext("WARNING: Recursive call to reload all sync!")); return; } touch("{$g['tmp_path']}/reloading_all"); @@ -1031,7 +1031,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) { @@ -1179,7 +1179,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; } } @@ -1287,7 +1287,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'])) @@ -1327,8 +1327,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]; @@ -1363,13 +1363,13 @@ function get_interface_info($ifdescr) { if($bridge) { $bridge_text = `/sbin/ifconfig {$bridge}`; if(stristr($bridge_text, "blocking") <> false) { - $ifinfo['bridge'] = "blocking - check for ethernet loops"; + $ifinfo['bridge'] = "" . gettext("blocking") . " - " . 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; } } @@ -1480,7 +1480,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 %s and new IP %s"), $oldcontents, $contents)); } return ($oldcontents); } else { @@ -1647,11 +1647,11 @@ function update_alias_names_upon_change($section, $subsection, $fielda, $fieldb, if($debug) fwrite($fd, print_r($pconfig, true)); if($fieldb) { - if($debug) fwrite($fd, "fieldb exists\n"); + if($debug) fwrite($fd, sprintf(gettext("fieldb exists%s"), "\n")); 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, "Setting old alias value $origname to $new_alias_name\n"); + if($debug) fwrite($fd, sprintf(gettext("Setting old alias value %s to %s%s"), $origname, $new_alias_name, "\n")); $config["$section"]["$subsection"][$i]["$fielda"]["$fieldb"] = $new_alias_name; } } @@ -1660,7 +1660,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, "Setting old alias value $origname to $new_alias_name\n"); + if($debug) fwrite($fd, sprintf(gettext("Setting old alias value %s to %s%s"), $origname, $new_alias_name, "\n")); } } } -- cgit v1.1 From 6acdf659ce8ea7d4752fa8dd246e7d0921d2af39 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Tue, 17 Aug 2010 08:38:40 -0300 Subject: Implement gettext() calls on pkg-utils.inc --- etc/inc/pkg-utils.inc | 178 +++++++++++++++++++++++++------------------------- 1 file changed, 89 insertions(+), 89 deletions(-) diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index c4402a4..d3d0e48 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -171,7 +171,7 @@ function get_pkg_sizes($pkgs = 'all') { function resync_all_package_configs($show_message = false) { global $config, $restart_sync, $pkg_interface; $i = 0; - log_error("Resyncing configuration for all packages."); + log_error(gettext("Resyncing configuration for all packages.")); if(!$config['installedpackages']['package']) return; if($show_message == true) @@ -186,7 +186,7 @@ function resync_all_package_configs($show_message = false) { if($restart_sync == true) { $restart_sync = false; if($pkg_interface == "console") - echo "\nSyncing packages:"; + echo "\n" . gettext("Syncing packages:"); } $i++; } @@ -224,7 +224,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("The {$package['name']} package is missing required dependencies and must be reinstalled." . $package['configurationfile']); + log_error(sprintf(gettext("The %s package is missing required dependencies and must be reinstalled. %s"), $package['name'], $package['configurationfile'])); install_package($package['name']); uninstall_package_from_name($package['name']); install_package($package['name']); @@ -246,7 +246,7 @@ function get_pkg_depends($pkg_name, $filetype = ".xml", $format = "files", $retu if(!is_dir($prefix)) exec("mkdir -p {$prefix}"); if(!file_exists($prefix . $depend_file)) - log_error("The {$package['name']} package is missing required dependencies and must be reinstalled."); + log_error(sprintf(gettext("The %s package is missing required dependencies and must be reinstalled."), $package['name'])); switch ($format) { case "files": $depends[] = $prefix . $depend_file; @@ -315,7 +315,7 @@ function sync_package($pkg_name, $sync_depends = true, $show_message = false) { else return; /* empty package tag */ if(!file_exists("/usr/local/pkg/" . $package['configurationfile'])) { - log_error("The {$package['name']} package is missing its configuration file and must be reinstalled."); + log_error(sprintf(gettext("The %s package is missing its configuration file and must be reinstalled."), $package['name'])); force_remove_package($package['name']); } else { $pkg_config = parse_xml_config_pkg("/usr/local/pkg/" . $package['configurationfile'], "packagegui"); @@ -327,7 +327,7 @@ function sync_package($pkg_name, $sync_depends = true, $show_message = false) { require_once($include_file); else { /* XXX: What the heck is this?! */ - log_error("Could not locate {$include_file}."); + log_error(sprintf(gettext("Could not locate %s."), $include_file)); install_package($package['name']); uninstall_package_from_name($package['name']); install_package($package['name']); @@ -347,8 +347,8 @@ function sync_package($pkg_name, $sync_depends = true, $show_message = false) { if(is_array($depends)) { foreach($depends as $item) { if(!file_exists($item)) { - file_notice($package['name'], "The {$package['name']} package is missing required dependencies and must be reinstalled.", "Packages", "/pkg_mgr_install.php?mode=reinstallpkg&pkg={$package['name']}", 1); - log_error("Could not find {$item}. Reinstalling package."); + file_notice($package['name'], sprintf(gettext("The %s package is missing required dependencies and must be reinstalled."), $package['name']), "Packages", "/pkg_mgr_install.php?mode=reinstallpkg&pkg={$package['name']}", 1); + log_error(sprintf(gettext("Could not find %s. Reinstalling package."), $item)); install_package($pkg_name); uninstall_package_from_name($pkg_name); install_package($pkg_name); @@ -420,7 +420,7 @@ function install_package($package, $pkg_info = "") { /* open logfiles and begin installation */ if(!$fd_log) { if(!$fd_log = fopen("{$g['tmp_path']}/pkg_mgr_{$package}.log", "w")) { - update_output_window("Warning, could not open log for writing."); + update_output_window(gettext("Warning, could not open log for writing.")); } } /* fetch package information if needed */ @@ -428,45 +428,45 @@ function install_package($package, $pkg_info = "") { $pkg_info = get_pkg_info(array($package)); $pkg_info = $pkg_info[$package]; // We're only dealing with one package, so we can strip away the extra array. } - @fwrite($fd_log, "Beginning package installation.\n"); - log_error('Beginning package installation for ' . $pkg_info['name'] . '.'); - update_status("Beginning package installation for " . $pkg_info['name'] . "..."); + @fwrite($fd_log, gettext("Beginning package installation.\n")); + log_error(gettext('Beginning package installation for') . ' ' . $pkg_info['name'] . '.'); + update_status(gettext("Beginning package installation for") . " " . $pkg_info['name'] . "..."); /* fetch the package's configuration file */ if($pkg_info['config_file'] != "") { - $static_output .= "Downloading package configuration file... "; + $static_output .= gettext("Downloading package configuration file...") . " "; update_output_window($static_output); - @fwrite($fd_log, "Downloading package configuration file...\n"); + @fwrite($fd_log, gettext("Downloading package configuration file...\n")); $fetchto = substr(strrchr($pkg_info['config_file'], '/'), 1); download_file_with_progress_bar($pkg_info['config_file'], '/usr/local/pkg/' . $fetchto); if(!file_exists('/usr/local/pkg/' . $fetchto)) { - @fwrite($fd_log, "ERROR! Unable to fetch package configuration file. Aborting installation.\n"); + @fwrite($fd_log, gettext("ERROR! Unable to fetch package configuration file. Aborting installation.\n")); if($pkg_interface == "console") { conf_mount_ro(); - print "\nERROR! Unable to fetch package configuration file. Aborting package installation.\n"; + print gettext("\nERROR! Unable to fetch package configuration file. Aborting package installation.\n"); return; } else { - $static_output .= "failed!\n\nInstallation aborted."; + $static_output .= gettext("failed!") . "\n\n" . gettext("Installation aborted."); update_output_window($static_output); - echo "
Show install log"; + echo "
Show " . gettext("install log") . ""; conf_mount_ro(); return -1; } } - $static_output .= "done.\n"; + $static_output .= gettext("done.") . "\n"; update_output_window($static_output); } /* add package information to config.xml */ $pkgid = get_pkg_id($pkg_info['name']); - $static_output .= "Saving updated package information... "; + $static_output .= gettext("Saving updated package information...") . " "; update_output_window($static_output); if($pkgid == -1) { $config['installedpackages']['package'][] = $pkg_info; - $changedesc = "Installed {$pkg_info['name']} package."; - $to_output = "done.\n"; + $changedesc = gettext("Installed") . $pkg_info['name'] . gettext("package."); + $to_output = gettext("done.") . "\n"; } else { $config['installedpackages']['package'][$pkgid] = $pkg_info; - $changedesc = "Overwrote previous installation of {$pkg_info['name']}."; - $to_output = "overwrite!\n"; + $changedesc = sprintf(gettext("Overwrote previous installation of %s."), $pkg_info['name']); + $to_output = gettext("overwrite!") . "\n"; } /* XXX: Fix inclusion of config.inc that causes data loss! */ conf_mount_ro(); @@ -475,12 +475,12 @@ function install_package($package, $pkg_info = "") { update_output_window($static_output); /* install other package components */ install_package_xml($package); - $static_output .= "Writing configuration... "; + $static_output .= gettext("Writing configuration...") . " "; update_output_window($static_output); write_config($changedesc); $static_output .= "done.\n"; update_output_window($static_output); - $static_output .= "Starting service.\n"; + $static_output .= gettext("Starting service.") . "\n"; update_output_window($static_output); if($pkg_info['after_install_info']) update_output_window($pkg_info['after_install_info']); @@ -513,7 +513,7 @@ function eval_once($toeval) { function install_package_xml($pkg) { global $g, $config, $fd_log, $static_output, $pkg_interface; if(($pkgid = get_pkg_id($pkg)) == -1) { - $static_output .= "The {$pkg} package is not installed.\n\nInstallation aborted."; + $static_output .= sprintf(gettext("The %s package is not installed.%sInstallation aborted."), $pkg, "\n\n"); update_output_window($static_output); if($pkg_interface <> "console") { echo "\n"; @@ -527,7 +527,7 @@ function install_package_xml($pkg) { /* set up logging if needed */ if(!$fd_log) { if(!$fd_log = fopen("{$g['tmp_path']}/pkg_mgr_{$pkg}.log", "w")) { - update_output_window("Warning, could not open log for writing."); + update_output_window(gettext("Warning, could not open log for writing.")); } } @@ -535,7 +535,7 @@ function install_package_xml($pkg) { if($pkg_info['logging']) { mwexec("/usr/sbin/fifolog_create -s 32768 {$g['varlog_path']}/{$pkg_info['logging']['logfilename']}"); @chmod($g['varlog_path'] . '/' . $pkg_info['logging']['logfilename'], 0600); - @fwrite($fd_log, "Adding text to file /etc/syslog.conf\n"); + @fwrite($fd_log, gettext("Adding text to file /etc/syslog.conf\n")); if(is_process_running("syslogd")) mwexec("killall syslogd"); system_syslogd_start(); @@ -552,8 +552,8 @@ function install_package_xml($pkg) { if($pkg_info['depends_on_package_base_url'] != "") { if($pkg_interface == "console") echo "\n"; - update_status("Installing " . $pkg_info['name'] . " and its dependencies."); - $static_output .= "Downloading " . $pkg_info['name'] . " and its dependencies... "; + update_status(gettext("Installing") . " " . $pkg_info['name'] . " " . gettext("and its dependencies.")); + $static_output .= gettext("Downloading") . " " . $pkg_info['name'] . " " . gettext("and its dependencies... "); $static_orig = $static_output; $static_output .= "\n"; update_output_window($static_output); @@ -566,19 +566,19 @@ function install_package_xml($pkg) { } if($pkg_installed == false) pkg_fetch_recursive($pkg_name, $pkgdep, 0, $pkg_info['depends_on_package_base_url']); - $static_output = $static_orig . "done.\nChecking for successful package installation... "; + $static_output = $static_orig . gettext("done.") . "\n" . gettext("Checking for successful package installation... "); update_output_window($static_output); /* make sure our package was successfully installed */ if($pkg_installed == false) $pkg_installed = is_freebsd_pkg_installed($pkg_name); if($pkg_installed == true) { - $static_output .= "done.\n"; + $static_output .= gettext("done.") . "\n"; update_output_window($static_output); - fwrite($fd_log, "pkg_add successfully completed.\n"); + fwrite($fd_log, gettext("pkg_add successfully completed.\n")); } else { $static_output .= "of {$pkg_name} failed!\n\nInstallation aborted."; update_output_window($static_output); - fwrite($fd_log, "Package WAS NOT installed properly.\n"); + fwrite($fd_log, gettext("Package WAS NOT installed properly.\n")); fclose($fd_log); if($pkg_interface <> "console") { echo "\n"; @@ -591,30 +591,30 @@ function install_package_xml($pkg) { } $configfile = substr(strrchr($pkg_info['config_file'], '/'), 1); if(file_exists("/usr/local/pkg/" . $configfile)) { - $static_output .= "Loading package configuration... "; + $static_output .= gettext("Loading package configuration... "); update_output_window($static_output); $pkg_config = parse_xml_config_pkg("/usr/local/pkg/" . $configfile, "packagegui"); - $static_output .= "done.\n"; + $static_output .= gettext("done.") . "\n"; update_output_window($static_output); - $static_output .= "Configuring package components...\n"; + $static_output .= gettext("Configuring package components...") . "\n"; if (!empty($pkg_config['filter_rules_needed'])) $config['installedpackages']['package'][$pkgid]['filter_rule_function'] = $pkg_config['filter_rules_needed']; update_output_window($static_output); /* modify system files */ if(is_array($pkg_config['modify_system']['item'])) { - $static_output .= "\tSystem files... "; + $static_output .= "\t" . gettext("System files... "); update_output_window($static_output); foreach($pkg_config['modify_system']['item'] as $ms) { if($ms['textneeded']) { add_text_to_file($ms['modifyfilename'], $ms['textneeded']); } } - $static_output .= "done.\n"; + $static_output .= gettext("done.") . "\n"; update_output_window($static_output); } /* download additional files */ if(is_array($pkg_config['additional_files_needed'])) { - $static_output .= "\tAdditional files... "; + $static_output .= "\t" . gettext("Additional files... "); $static_orig = $static_output; update_output_window($static_output); foreach($pkg_config['additional_files_needed'] as $afn) { @@ -635,20 +635,20 @@ function install_package_xml($pkg) { update_output_window($static_output); download_file_with_progress_bar($afn['item'][0], $prefix . $filename); if(stristr($filename, ".tgz") <> "") { - fwrite($fd_log, "Extracting tarball to -C for " . $filename . "...\n"); + fwrite($fd_log, gettext("Extracting tarball to -C for") . " " . $filename . "...\n"); $tarout = ""; exec("/usr/bin/tar xvzf " . $prefix . $filename . " -C / 2>&1", $tarout); fwrite($fd_log, print_r($tarout, true) . "\n"); } if($pkg_chmod <> "") { - fwrite($fd_log, "Changing file mode to {$pkg_chmod} for {$prefix}{$filename}\n"); + fwrite($fd_log, sprintf(gettext("Changing file mode to %s for %s%s%s"), $pkg_chmod, $prefix, $filename, "\n")); @chmod($prefix . $filename, $pkg_chmod); system("/bin/chmod {$pkg_chmod} {$prefix}{$filename}"); } $static_output = $static_orig; update_output_window($static_output); } - $static_output .= "done.\n"; + $static_output .= gettext("done.") . "\n"; update_output_window($static_output); } /* if a require exists, include it. this will @@ -656,7 +656,7 @@ function install_package_xml($pkg) { * instead of making us blindly guess */ if($pkg_config['include_file'] <> "") { - $static_output = "Loading package instructions..."; + $static_output = gettext("Loading package instructions..."); update_output_window($static_output); fwrite($fd_log, "require_once('{$pkg_config['include_file']}')\n"); if (file_exists($pkg_config['include_file'])) @@ -664,7 +664,7 @@ function install_package_xml($pkg) { } /* sidebar items */ if(is_array($pkg_config['menu'])) { - $static_output .= "\tMenu items... "; + $static_output .= "\t" . gettext("Menu items... "); update_output_window($static_output); foreach($pkg_config['menu'] as $menu) { if(is_array($config['installedpackages']['menu'])) @@ -673,12 +673,12 @@ function install_package_xml($pkg) { continue 2; $config['installedpackages']['menu'][] = $menu; } - $static_output .= "done.\n"; + $static_output .= gettext("done.") . "\n"; update_output_window($static_output); } /* integrated tab items */ if(is_array($pkg_config['tabs']['tab'])) { - $static_output .= "\tIntegrated Tab items... "; + $static_output .= "\t" . gettext("Integrated Tab items... "); update_output_window($static_output); foreach($pkg_config['tabs']['tab'] as $tab) { if(is_array($config['installedpackages']['tab'])) @@ -687,12 +687,12 @@ function install_package_xml($pkg) { continue 2; $config['installedpackages']['tab'][] = $tab; } - $static_output .= "done.\n"; + $static_output .= gettext("done.") . "\n"; update_output_window($static_output); } /* services */ if(is_array($pkg_config['service'])) { - $static_output .= "\tServices... "; + $static_output .= "\t" . gettext("Services... "); update_output_window($static_output); foreach($pkg_config['service'] as $service) { if(is_array($config['installedpackages']['service'])) @@ -701,33 +701,33 @@ function install_package_xml($pkg) { continue 2; $config['installedpackages']['service'][] = $service; } - $static_output .= "done.\n"; + $static_output .= gettext("done.") . "\n"; update_output_window($static_output); } /* custom commands */ - $static_output .= "\tCustom commands... "; + $static_output .= "\t" . gettext("Custom commands... "); update_output_window($static_output); if($pkg_config['custom_php_global_functions'] <> "") { - $static_output = "Executing custom_php_global_functions()..."; + $static_output = gettext("Executing custom_php_global_functions()..."); update_output_window($static_output); eval_once($pkg_config['custom_php_global_functions']); } if($pkg_config['custom_php_install_command']) { - $static_output = "Executing custom_php_install_command()..."; + $static_output = gettext("Executing custom_php_install_command()..."); update_output_window($static_output); eval_once($pkg_config['custom_php_install_command']); } if($pkg_config['custom_php_resync_config_command'] <> "") { - $static_output = "Executing custom_php_resync_config_command()..."; + $static_output = gettext("Executing custom_php_resync_config_command()..."); update_output_window($static_output); eval_once($pkg_config['custom_php_resync_config_command']); } - $static_output .= "done.\n"; + $static_output .= gettext("done.") . "\n"; update_output_window($static_output); } else { - $static_output .= "Loading package configuration... failed!\n\nInstallation aborted."; + $static_output .= gettext("Loading package configuration... failed!") . "\n\n" . gettext("Installation aborted."); update_output_window($static_output); - fwrite($fd_log, "Unable to load package configuration. Installation aborted.\n"); + fwrite($fd_log, gettext("Unable to load package configuration. Installation aborted.\n")); fclose($fd_log); if($pkg_interface <> "console") { echo "\n"; @@ -740,8 +740,8 @@ function install_package_xml($pkg) { function delete_package($pkg, $pkgid) { global $g, $config, $fd_log, $static_output; - update_status("Removing package..."); - $static_output .= "Removing package... "; + update_status(gettext("Removing package...")); + $static_output .= gettext("Removing package... "); update_output_window($static_output); $pkgid = get_pkg_id($pkgid); $pkg_info = $config['installedpackages']['package'][$pkgid]; @@ -750,11 +750,11 @@ function delete_package($pkg, $pkgid) { if(empty($configfile)) return; - $static_output .= "\nStarting package deletion for {$pkg_info['name']}...\n"; + $static_output .= sprintf(gettext("%sStarting package deletion for %s...%s"), "\n", $pkg_info['name'], "\n"); update_output_window($static_output); if (!empty($pkg)) delete_package_recursive($pkg); - $static_output .= "done.\n"; + $static_output .= gettext("done.") . "\n"; update_output_window($static_output); return; } @@ -785,7 +785,7 @@ function delete_package_xml($pkg) { conf_mount_rw(); if(($pkgid = get_pkg_id($pkg)) == -1) { - $static_output .= "The {$pkg} package is not installed.\n\nDeletion aborted."; + $static_output .= sprintf(gettext("The %s package is not installed.%sDeletion aborted."), $pkg, "\n\n"); update_output_window($static_output); if($pkg_interface <> "console") { echo "\n"; @@ -799,12 +799,12 @@ function delete_package_xml($pkg) { /* set up logging if needed */ if(!$fd_log) { if(!$fd_log = fopen("{$g['tmp_path']}/pkg_mgr_{$pkg}.log", "w")) { - update_output_window("Warning, could not open log for writing."); + update_output_window(gettext("Warning, could not open log for writing.")); } } - update_status("Removing {$pkg} components..."); - fwrite($fd_log, "Removing {$pkg} package... "); - $static_output .= "Removing {$pkg} components...\n"; + update_status(sprintf(gettext("Removing %s components..."), $pkg)); + fwrite($fd_log, sprintf(gettext("Removing %s package... "), $pkg)); + $static_output .= sprintf(gettext("Removing %s components...%s"), $pkg, "\n"); update_output_window($static_output); /* parse package configuration */ $packages = &$config['installedpackages']['package']; @@ -815,7 +815,7 @@ function delete_package_xml($pkg) { $pkg_config = parse_xml_config_pkg("/usr/local/pkg/" . $packages[$pkgid]['configurationfile'], "packagegui"); /* remove tab items */ if(is_array($pkg_config['tabs'])) { - $static_output .= "\tMenu items... "; + $static_output .= "\t" . gettext("Menu items... "); update_output_window($static_output); if(is_array($pkg_config['tabs']['tab']) && is_array($tabs)) { foreach($pkg_config['tabs']['tab'] as $tab) { @@ -824,12 +824,12 @@ function delete_package_xml($pkg) { unset($tabs[$key]); } } - $static_output .= "done.\n"; + $static_output .= gettext("done.") . "\n"; update_output_window($static_output); } /* remove menu items */ if(is_array($pkg_config['menu'])) { - $static_output .= "\tMenu items... "; + $static_output .= "\t" . gettext("Menu items... "); update_output_window($static_output); if (is_array($pkg_config['menu']) && is_array($menus)) { foreach($pkg_config['menu'] as $menu) { @@ -838,12 +838,12 @@ function delete_package_xml($pkg) { unset($menus[$key]); } } - $static_output .= "done.\n"; + $static_output .= gettext("done.") . "\n"; update_output_window($static_output); } /* remove services */ if(is_array($pkg_config['service'])) { - $static_output .= "\tServices... "; + $static_output .= "\t" . gettext("Services... "); update_output_window($static_output); if (is_array($pkg_config['service']) && is_array($services)) { foreach($pkg_config['service'] as $service) { @@ -855,7 +855,7 @@ function delete_package_xml($pkg) { } } } - $static_output .= "done.\n"; + $static_output .= gettext("done.") . "\n"; update_output_window($static_output); } /* if a require exists, include it. this will @@ -863,7 +863,7 @@ function delete_package_xml($pkg) { * instead of making us blindly guess */ if($pkg_config['include_file'] <> "") { - $static_output = "Loading package instructions..."; + $static_output = gettext("Loading package instructions..."); update_output_window($static_output); fwrite($fd_log, "require_once(\"{$pkg_config['include_file']}\")\n"); if(file_exists($pkg_config['include_file'])) @@ -877,34 +877,34 @@ function delete_package_xml($pkg) { eval_once($pkg_config['custom_php_pre_deinstall_command']); /* system files */ if(is_array($pkg_config['modify_system']['item'])) { - $static_output .= "\tSystem files... "; + $static_output .= "\t" . gettext("System files... "); update_output_window($static_output); foreach($pkg_config['modify_system']['item'] as $ms) { if($ms['textneeded']) remove_text_from_file($ms['modifyfilename'], $ms['textneeded']); } - $static_output .= "done.\n"; + $static_output .= gettext("done.") . "\n"; update_output_window($static_output); } /* syslog */ if($pkg_config['logging']['logfile_name'] <> "") { - $static_output .= "\tSyslog entries... "; + $static_output .= "\t" . gettext("Syslog entries... "); update_output_window($static_output); remove_text_from_file("/etc/syslog.conf", $pkg_config['logging']['facilityname'] . "\t\t\t\t" . $pkg_config['logging']['logfilename']); - $static_output .= "done.\n"; + $static_output .= gettext("done.") . "\n"; update_output_window($static_output); } /* deinstall commands */ if($pkg_config['custom_php_deinstall_command'] <> "") { - $static_output .= "\tDeinstall commands... "; + $static_output .= "\t" . gettext("Deinstall commands... "); update_output_window($static_output); eval_once($pkg_config['custom_php_deinstall_command']); - $static_output .= "done.\n"; + $static_output .= gettext("done.") . "\n"; update_output_window($static_output); } if($pkg_config['include_file'] <> "") { - $static_output = "\tRemoving pacakge instructions..."; + $static_output = "\t" . gettext("Removing pacakge instructions..."); update_output_window($static_output); - fwrite($fd_log, "Remove '{$pkg_config['include_file']}'\n"); + fwrite($fd_log, sprintf(gettext("Remove '%s'%s"), $pkg_config['include_file'], "\n")); unlink_if_exists("/usr/local/pkg/" . $pkg_config['include_file']); $static_output .= "done.\n"; update_output_window($static_output); @@ -912,7 +912,7 @@ function delete_package_xml($pkg) { } /* remove all additional files */ if(is_array($pkg_config['additional_files_needed'])) { - $static_output .= "\tAuxiliary files... "; + $static_output .= "\t" . gettext("Auxiliary files... "); update_output_window($static_output); foreach($pkg_config['additional_files_needed'] as $afn) { $filename = get_filename_from_url($afn['item'][0]); @@ -925,24 +925,24 @@ function delete_package_xml($pkg) { if(file_exists($prefix . $filename)) mwexec("rm -rf {$prefix}{$filename}"); } - $static_output .= "done.\n"; + $static_output .= gettext("done.") . "\n"; update_output_window($static_output); } /* package XML file */ - $static_output .= "\tPackage XML... "; + $static_output .= "\t" . gettext("Package XML... "); update_output_window($static_output); unlink_if_exists("/usr/local/pkg/" . $packages[$pkgid]['configurationfile']); - $static_output .= "done.\n"; + $static_output .= gettext("done.") . "\n"; update_output_window($static_output); } /* remove config.xml entries */ conf_mount_ro(); - $static_output .= "\tConfiguration... "; + $static_output .= "\t" . gettext("Configuration... "); update_output_window($static_output); unset($config['installedpackages']['package'][$pkgid]); - $static_output .= "done.\n"; + $static_output .= gettext("done.") . "\n"; update_output_window($static_output); - write_config("Removed {$pkg} package."); + write_config(sprintf(gettext("Removed %s package."), $pkg)); /* file cleanup */ $ctag = file("/etc/crontab"); foreach($ctag as $line) { -- cgit v1.1 From f55943aa30f4bf5f0b916454bbbdc7bd7de0e63f Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Tue, 17 Aug 2010 09:27:14 -0300 Subject: Implement gettext() calls on xmlparse_attr.inc --- etc/inc/xmlparse_attr.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etc/inc/xmlparse_attr.inc b/etc/inc/xmlparse_attr.inc index 06d02c4..04428cc 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("XML error: %s at line %d cannot occur more than once\n", + die(sprintf(gettext("XML error: %s at line %d cannot occur more than once") . "\n", $name, xml_get_current_line_number($parser))); } else if (isset($writeattrs)) { @@ -184,7 +184,7 @@ function parse_xml_config_raw_attr($cffile, $rootobj, &$parsed_attributes, $isst xml_parser_set_option($xml_parser,XML_OPTION_SKIP_WHITE, 1); if (!($fp = fopen($cffile, "r"))) { - log_error("Error: could not open XML input\n"); + log_error(gettext("Error: could not open XML input") . "\n"); if (isset($parsed_attributes)) { $parsed_attributes = array(); unset($parsedattrs); @@ -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("XML error: %s at line %d\n", + log_error(sprintf(gettext("XML error: %s at line %d") . "\n", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); if (isset($parsed_attributes)) { @@ -207,7 +207,7 @@ function parse_xml_config_raw_attr($cffile, $rootobj, &$parsed_attributes, $isst xml_parser_free($xml_parser); if (!$parsedcfg[$rootobj]) { - log_error("XML error: no $rootobj object found!\n"); + log_error(sprintf(gettext("XML error: no %s object found!") . "\n", $rootobj)); if (isset($parsed_attributes)) { $parsed_attributes = array(); unset($parsedattrs); -- cgit v1.1 From ada992bd115db157ef8f21090e79135b1c26c152 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Tue, 17 Aug 2010 09:34:12 -0300 Subject: Implement gettext() calls on xmlparse.inc --- etc/inc/xmlparse.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etc/inc/xmlparse.inc b/etc/inc/xmlparse.inc index 3d20ebb..cb01253 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("XML error: %s at line %d cannot occur more than once\n", + die(sprintf(gettext("XML error: %s at line %d cannot occur more than once") . "\n", $name, xml_get_current_line_number($parser))); } @@ -173,13 +173,13 @@ function parse_xml_config_raw($cffile, $rootobj, $isstring = "false") { xml_parser_set_option($xml_parser,XML_OPTION_SKIP_WHITE, 1); if (!($fp = fopen($cffile, "r"))) { - log_error("Error: could not open XML input\n"); + log_error(gettext("Error: could not open XML input") . "\n"); return -1; } while ($data = fread($fp, 4096)) { if (!xml_parse($xml_parser, $data, feof($fp))) { - log_error(sprintf("XML error: %s at line %d\n", + log_error(sprintf(gettext("XML error: %s at line %d") . "\n", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); return -1; @@ -188,7 +188,7 @@ function parse_xml_config_raw($cffile, $rootobj, $isstring = "false") { xml_parser_free($xml_parser); if (!$parsedcfg[$rootobj]) { - log_error("XML error: no $rootobj object found!\n"); + log_error(sprintf(gettext("XML error: no %s object found!") . "\n", $rootobj)); return -1; } -- cgit v1.1 From 61349b3fa848091e84ff0cd9e7e8d2386d51eee8 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Tue, 17 Aug 2010 09:36:17 -0300 Subject: Implement gettext() on xmlreader.inc --- etc/inc/xmlreader.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/inc/xmlreader.inc b/etc/inc/xmlreader.inc index 41f2938..9c6eb99 100644 --- a/etc/inc/xmlreader.inc +++ b/etc/inc/xmlreader.inc @@ -126,7 +126,7 @@ function parse_xml_config_raw($cffile, $rootobj, $isstring = "false") { add_elements($parsedcfg, $par); $par->close(); } else - log_error("Error returned while trying to parse {$cffile}"); + log_error(sprintf(gettext("Error returned while trying to parse %s"), $cffile")); return $parsedcfg[$rootobj]; } -- cgit v1.1 From 4d814149a95852c258f97d95ef1c4c2a2aab19a1 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Tue, 17 Aug 2010 10:54:42 -0300 Subject: Implement gettext() calls on priv.defs.inc --- etc/inc/priv.defs.inc | 768 +++++++++++++++++++++++++------------------------- 1 file changed, 384 insertions(+), 384 deletions(-) diff --git a/etc/inc/priv.defs.inc b/etc/inc/priv.defs.inc index d991316..079dfa5 100644 --- a/etc/inc/priv.defs.inc +++ b/etc/inc/priv.defs.inc @@ -7,1107 +7,1107 @@ $priv_list = array(); $priv_list['page-all'] = array(); -$priv_list['page-all']['name'] = "WebCfg - All pages"; -$priv_list['page-all']['descr'] = "Allow access to all pages"; +$priv_list['page-all']['name'] = gettext("WebCfg - All pages"); +$priv_list['page-all']['descr'] = gettext("Allow access to all pages"); $priv_list['page-all']['match'] = array(); $priv_list['page-all']['match'][] = "*"; $priv_list['page-status-carp'] = array(); -$priv_list['page-status-carp']['name'] = "WebCfg - Status: CARP page"; -$priv_list['page-status-carp']['descr'] = "Allow access to the 'Status: CARP' page."; +$priv_list['page-status-carp']['name'] = gettext("WebCfg - Status: CARP page"); +$priv_list['page-status-carp']['descr'] = gettext("Allow access to the 'Status: CARP' page."); $priv_list['page-status-carp']['match'] = array(); $priv_list['page-status-carp']['match'][] = "carp_status.php*"; $priv_list['page-diagnostics-configurationhistory'] = array(); -$priv_list['page-diagnostics-configurationhistory']['name'] = "WebCfg - Diagnostics: Configuration History page"; -$priv_list['page-diagnostics-configurationhistory']['descr'] = "Allow access to the 'Diagnostics: Configuration History' page."; +$priv_list['page-diagnostics-configurationhistory']['name'] = gettext("WebCfg - Diagnostics: Configuration History page"); +$priv_list['page-diagnostics-configurationhistory']['descr'] = gettext("Allow access to the 'Diagnostics: Configuration History' page."); $priv_list['page-diagnostics-configurationhistory']['match'] = array(); $priv_list['page-diagnostics-configurationhistory']['match'][] = "diag_confbak.php*"; $priv_list['page-diagnostics-arptable'] = array(); -$priv_list['page-diagnostics-arptable']['name'] = "WebCfg - Diagnostics: ARP Table page"; -$priv_list['page-diagnostics-arptable']['descr'] = "Allow access to the 'Diagnostics: ARP Table' page."; +$priv_list['page-diagnostics-arptable']['name'] = gettext("WebCfg - Diagnostics: ARP Table page"); +$priv_list['page-diagnostics-arptable']['descr'] = gettext("Allow access to the 'Diagnostics: ARP Table' page."); $priv_list['page-diagnostics-arptable']['match'] = array(); $priv_list['page-diagnostics-arptable']['match'][] = "diag_arp.php*"; $priv_list['page-diagnostics-backup/restore'] = array(); -$priv_list['page-diagnostics-backup/restore']['name'] = "WebCfg - Diagnostics: Backup/restore page"; -$priv_list['page-diagnostics-backup/restore']['descr'] = "Allow access to the 'Diagnostics: Backup/restore' page."; +$priv_list['page-diagnostics-backup/restore']['name'] = gettext("WebCfg - Diagnostics: Backup/restore page"); +$priv_list['page-diagnostics-backup/restore']['descr'] = gettext("Allow access to the 'Diagnostics: Backup/restore' page."); $priv_list['page-diagnostics-backup/restore']['match'] = array(); $priv_list['page-diagnostics-backup/restore']['match'][] = "diag_backup.php*"; $priv_list['page-status-dhcpleases'] = array(); -$priv_list['page-status-dhcpleases']['name'] = "WebCfg - Status: DHCP leases page"; -$priv_list['page-status-dhcpleases']['descr'] = "Allow access to the 'Status: DHCP leases' page."; +$priv_list['page-status-dhcpleases']['name'] = gettext("WebCfg - Status: DHCP leases page"); +$priv_list['page-status-dhcpleases']['descr'] = gettext("Allow access to the 'Status: DHCP leases' page."); $priv_list['page-status-dhcpleases']['match'] = array(); $priv_list['page-status-dhcpleases']['match'][] = "status_dhcp_leases.php*"; $priv_list['page-diagnostics-factorydefaults'] = array(); -$priv_list['page-diagnostics-factorydefaults']['name'] = "WebCfg - Diagnostics: Factory defaults page"; -$priv_list['page-diagnostics-factorydefaults']['descr'] = "Allow access to the 'Diagnostics: Factory defaults' page."; +$priv_list['page-diagnostics-factorydefaults']['name'] = gettext("WebCfg - Diagnostics: Factory defaults page"); +$priv_list['page-diagnostics-factorydefaults']['descr'] = gettext("Allow access to the 'Diagnostics: Factory defaults' page."); $priv_list['page-diagnostics-factorydefaults']['match'] = array(); $priv_list['page-diagnostics-factorydefaults']['match'][] = "diag_defaults.php*"; $priv_list['page-diagnostics-showstates'] = array(); -$priv_list['page-diagnostics-showstates']['name'] = "WebCfg - Diagnostics: Show States page"; -$priv_list['page-diagnostics-showstates']['descr'] = "Allow access to the 'Diagnostics: Show States' page."; +$priv_list['page-diagnostics-showstates']['name'] = gettext("WebCfg - Diagnostics: Show States page"); +$priv_list['page-diagnostics-showstates']['descr'] = gettext("Allow access to the 'Diagnostics: Show States' page."); $priv_list['page-diagnostics-showstates']['match'] = array(); $priv_list['page-diagnostics-showstates']['match'][] = "diag_dump_states.php*"; $priv_list['page-status-ipsec'] = array(); -$priv_list['page-status-ipsec']['name'] = "WebCfg - Status: IPsec page"; -$priv_list['page-status-ipsec']['descr'] = "Allow access to the 'Status: IPsec' page."; +$priv_list['page-status-ipsec']['name'] = gettext("WebCfg - Status: IPsec page"); +$priv_list['page-status-ipsec']['descr'] = gettext("Allow access to the 'Status: IPsec' page."); $priv_list['page-status-ipsec']['match'] = array(); $priv_list['page-status-ipsec']['match'][] = "diag_ipsec.php*"; $priv_list['page-status-ipsec-sad'] = array(); -$priv_list['page-status-ipsec-sad']['name'] = "WebCfg - Status: IPsec: SAD page"; -$priv_list['page-status-ipsec-sad']['descr'] = "Allow access to the 'Status: IPsec: SAD' page."; +$priv_list['page-status-ipsec-sad']['name'] = gettext("WebCfg - Status: IPsec: SAD page"); +$priv_list['page-status-ipsec-sad']['descr'] = gettext("Allow access to the 'Status: IPsec: SAD' page."); $priv_list['page-status-ipsec-sad']['match'] = array(); $priv_list['page-status-ipsec-sad']['match'][] = "diag_ipsec_sad.php*"; $priv_list['page-status-ipsec-spd'] = array(); -$priv_list['page-status-ipsec-spd']['name'] = "WebCfg - Status: IPsec: SPD page"; -$priv_list['page-status-ipsec-spd']['descr'] = "Allow access to the 'Status: IPsec: SPD' page."; +$priv_list['page-status-ipsec-spd']['name'] = gettext("WebCfg - Status: IPsec: SPD page"); +$priv_list['page-status-ipsec-spd']['descr'] = gettext("Allow access to the 'Status: IPsec: SPD' page."); $priv_list['page-status-ipsec-spd']['match'] = array(); $priv_list['page-status-ipsec-spd']['match'][] = "diag_ipsec_spd.php*"; $priv_list['page-diagnostics-logs-system'] = array(); -$priv_list['page-diagnostics-logs-system']['name'] = "WebCfg - Diagnostics: Logs: System page"; -$priv_list['page-diagnostics-logs-system']['descr'] = "Allow access to the 'Diagnostics: Logs: System' page."; +$priv_list['page-diagnostics-logs-system']['name'] = gettext("WebCfg - Diagnostics: Logs: System page"); +$priv_list['page-diagnostics-logs-system']['descr'] = gettext("Allow access to the 'Diagnostics: Logs: System' page."); $priv_list['page-diagnostics-logs-system']['match'] = array(); $priv_list['page-diagnostics-logs-system']['match'][] = "diag_logs.php*"; $priv_list['page-status-systemlogs-portalauth'] = array(); -$priv_list['page-status-systemlogs-portalauth']['name'] = "WebCfg - Status: System logs: Portal Auth page"; -$priv_list['page-status-systemlogs-portalauth']['descr'] = "Allow access to the 'Status: System logs: Portal Auth' page."; +$priv_list['page-status-systemlogs-portalauth']['name'] = gettext("WebCfg - Status: System logs: Portal Auth page"); +$priv_list['page-status-systemlogs-portalauth']['descr'] = gettext("Allow access to the 'Status: System logs: Portal Auth' page."); $priv_list['page-status-systemlogs-portalauth']['match'] = array(); $priv_list['page-status-systemlogs-portalauth']['match'][] = "diag_logs_auth.php*"; $priv_list['page-diagnostics-logs-dhcp'] = array(); -$priv_list['page-diagnostics-logs-dhcp']['name'] = "WebCfg - Diagnostics: Logs: DHCP page"; -$priv_list['page-diagnostics-logs-dhcp']['descr'] = "Allow access to the 'Diagnostics: Logs: DHCP' page."; +$priv_list['page-diagnostics-logs-dhcp']['name'] = gettext("WebCfg - Diagnostics: Logs: DHCP page"); +$priv_list['page-diagnostics-logs-dhcp']['descr'] = gettext("Allow access to the 'Diagnostics: Logs: DHCP' page."); $priv_list['page-diagnostics-logs-dhcp']['match'] = array(); $priv_list['page-diagnostics-logs-dhcp']['match'][] = "diag_logs_dhcp.php*"; $priv_list['page-diagnostics-logs-firewall'] = array(); -$priv_list['page-diagnostics-logs-firewall']['name'] = "WebCfg - Diagnostics: Logs: Firewall page"; -$priv_list['page-diagnostics-logs-firewall']['descr'] = "Allow access to the 'Diagnostics: Logs: Firewall' page."; +$priv_list['page-diagnostics-logs-firewall']['name'] = gettext("WebCfg - Diagnostics: Logs: Firewall page"); +$priv_list['page-diagnostics-logs-firewall']['descr'] = gettext("Allow access to the 'Diagnostics: Logs: Firewall' page."); $priv_list['page-diagnostics-logs-firewall']['match'] = array(); $priv_list['page-diagnostics-logs-firewall']['match'][] = "diag_logs_filter.php*"; $priv_list['page-hidden-nolongerincluded'] = array(); -$priv_list['page-hidden-nolongerincluded']['name'] = "WebCfg - Hidden: No longer included page"; -$priv_list['page-hidden-nolongerincluded']['descr'] = "Allow access to the 'Hidden: No longer included' page."; +$priv_list['page-hidden-nolongerincluded']['name'] = gettext("WebCfg - Hidden: No longer included page"); +$priv_list['page-hidden-nolongerincluded']['descr'] = gettext("Allow access to the 'Hidden: No longer included' page."); $priv_list['page-hidden-nolongerincluded']['match'] = array(); $priv_list['page-hidden-nolongerincluded']['match'][] = "diag_logs_filter_dynamic.php*"; $priv_list['page-status-systemlogs-ipsecvpn'] = array(); -$priv_list['page-status-systemlogs-ipsecvpn']['name'] = "WebCfg - Status: System logs: IPsec VPN page"; -$priv_list['page-status-systemlogs-ipsecvpn']['descr'] = "Allow access to the 'Status: System logs: IPsec VPN' page."; +$priv_list['page-status-systemlogs-ipsecvpn']['name'] = gettext("WebCfg - Status: System logs: IPsec VPN page"); +$priv_list['page-status-systemlogs-ipsecvpn']['descr'] = gettext("Allow access to the 'Status: System logs: IPsec VPN' page."); $priv_list['page-status-systemlogs-ipsecvpn']['match'] = array(); $priv_list['page-status-systemlogs-ipsecvpn']['match'][] = "diag_logs_ipsec.php*"; $priv_list['page-status-systemlogs-openntpd'] = array(); -$priv_list['page-status-systemlogs-openntpd']['name'] = "WebCfg - Status: System logs: OpenNTPD page"; -$priv_list['page-status-systemlogs-openntpd']['descr'] = "Allow access to the 'Status: System logs: OpenNTPD' page."; +$priv_list['page-status-systemlogs-openntpd']['name'] = gettext("WebCfg - Status: System logs: OpenNTPD page"); +$priv_list['page-status-systemlogs-openntpd']['descr'] = gettext("Allow access to the 'Status: System logs: OpenNTPD' page."); $priv_list['page-status-systemlogs-openntpd']['match'] = array(); $priv_list['page-status-systemlogs-openntpd']['match'][] = "diag_logs_ntpd.php*"; $priv_list['page-status-systemlogs-openvpn'] = array(); -$priv_list['page-status-systemlogs-openvpn']['name'] = "WebCfg - Status: System logs: OpenVPN page"; -$priv_list['page-status-systemlogs-openvpn']['descr'] = "Allow access to the 'Status: System logs: OpenVPN' page."; +$priv_list['page-status-systemlogs-openvpn']['name'] = gettext("WebCfg - Status: System logs: OpenVPN page"); +$priv_list['page-status-systemlogs-openvpn']['descr'] = gettext("Allow access to the 'Status: System logs: OpenVPN' page."); $priv_list['page-status-systemlogs-openvpn']['match'] = array(); $priv_list['page-status-systemlogs-openvpn']['match'][] = "diag_logs_openvpn.php*"; $priv_list['page-status-systemlogs-loadbalancer'] = array(); -$priv_list['page-status-systemlogs-loadbalancer']['name'] = "WebCfg - Status: System logs: Load Balancer page"; -$priv_list['page-status-systemlogs-loadbalancer']['descr'] = "Allow access to the 'Status: System logs: Load Balancer' page."; +$priv_list['page-status-systemlogs-loadbalancer']['name'] = gettext("WebCfg - Status: System logs: Load Balancer page"); +$priv_list['page-status-systemlogs-loadbalancer']['descr'] = gettext("Allow access to the 'Status: System logs: Load Balancer' page."); $priv_list['page-status-systemlogs-loadbalancer']['match'] = array(); $priv_list['page-status-systemlogs-loadbalancer']['match'][] = "diag_logs_relayd.php*"; $priv_list['page-diagnostics-logs-settings'] = array(); -$priv_list['page-diagnostics-logs-settings']['name'] = "WebCfg - Diagnostics: Logs: Settings page"; -$priv_list['page-diagnostics-logs-settings']['descr'] = "Allow access to the 'Diagnostics: Logs: Settings' page."; +$priv_list['page-diagnostics-logs-settings']['name'] = gettext("WebCfg - Diagnostics: Logs: Settings page"); +$priv_list['page-diagnostics-logs-settings']['descr'] = gettext("Allow access to the 'Diagnostics: Logs: Settings' page."); $priv_list['page-diagnostics-logs-settings']['match'] = array(); $priv_list['page-diagnostics-logs-settings']['match'][] = "diag_logs_settings.php*"; $priv_list['page-diagnostics-logs-pptpvpn'] = array(); -$priv_list['page-diagnostics-logs-pptpvpn']['name'] = "WebCfg - Diagnostics: Logs: VPN page"; -$priv_list['page-diagnostics-logs-pptpvpn']['descr'] = "Allow access to the 'Diagnostics: Logs: VPN' page."; +$priv_list['page-diagnostics-logs-pptpvpn']['name'] = gettext("WebCfg - Diagnostics: Logs: VPN page"); +$priv_list['page-diagnostics-logs-pptpvpn']['descr'] = gettext("Allow access to the 'Diagnostics: Logs: VPN' page."); $priv_list['page-diagnostics-logs-pptpvpn']['match'] = array(); $priv_list['page-diagnostics-logs-pptpvpn']['match'][] = "diag_logs_vpn.php*"; $priv_list['page-diagnostics-packetcapture'] = array(); -$priv_list['page-diagnostics-packetcapture']['name'] = "WebCfg - Diagnostics: Packet Capture page"; -$priv_list['page-diagnostics-packetcapture']['descr'] = "Allow access to the 'Diagnostics: Packet Capture' page."; +$priv_list['page-diagnostics-packetcapture']['name'] = gettext("WebCfg - Diagnostics: Packet Capture page"); +$priv_list['page-diagnostics-packetcapture']['descr'] = gettext("Allow access to the 'Diagnostics: Packet Capture' page."); $priv_list['page-diagnostics-packetcapture']['match'] = array(); $priv_list['page-diagnostics-packetcapture']['match'][] = "diag_packet_capture.php*"; $priv_list['page-diagnostics-patters'] = array(); -$priv_list['page-diagnostics-patters']['name'] = "WebCfg - Diagnostics: Patterns page"; -$priv_list['page-diagnostics-patters']['descr'] = "Allow access to the 'Diagnostics: Patterns' page."; +$priv_list['page-diagnostics-patters']['name'] = gettext("WebCfg - Diagnostics: Patterns page"); +$priv_list['page-diagnostics-patters']['descr'] = gettext("Allow access to the 'Diagnostics: Patterns' page."); $priv_list['page-diagnostics-patters']['match'] = array(); $priv_list['page-diagnostics-patters']['match'][] = "patterns.php*"; $priv_list['page-diagnostics-ping'] = array(); -$priv_list['page-diagnostics-ping']['name'] = "WebCfg - Diagnostics: Ping page"; -$priv_list['page-diagnostics-ping']['descr'] = "Allow access to the 'Diagnostics: Ping' page."; +$priv_list['page-diagnostics-ping']['name'] = gettext("WebCfg - Diagnostics: Ping page"); +$priv_list['page-diagnostics-ping']['descr'] = gettext("Allow access to the 'Diagnostics: Ping' page."); $priv_list['page-diagnostics-ping']['match'] = array(); $priv_list['page-diagnostics-ping']['match'][] = "diag_ping.php*"; $priv_list['page-status-packagelogs'] = array(); -$priv_list['page-status-packagelogs']['name'] = "WebCfg - Status: Package logs page"; -$priv_list['page-status-packagelogs']['descr'] = "Allow access to the 'Status: Package logs' page."; +$priv_list['page-status-packagelogs']['name'] = gettext("WebCfg - Status: Package logs page"); +$priv_list['page-status-packagelogs']['descr'] = gettext("Allow access to the 'Status: Package logs' page."); $priv_list['page-status-packagelogs']['match'] = array(); $priv_list['page-status-packagelogs']['match'][] = "diag_pkglogs.php*"; $priv_list['page-diagnostics-resetstate'] = array(); -$priv_list['page-diagnostics-resetstate']['name'] = "WebCfg - Diagnostics: Reset state page"; -$priv_list['page-diagnostics-resetstate']['descr'] = "Allow access to the 'Diagnostics: Reset state' page."; +$priv_list['page-diagnostics-resetstate']['name'] = gettext("WebCfg - Diagnostics: Reset state page"); +$priv_list['page-diagnostics-resetstate']['descr'] = gettext("Allow access to the 'Diagnostics: Reset state' page."); $priv_list['page-diagnostics-resetstate']['match'] = array(); $priv_list['page-diagnostics-resetstate']['match'][] = "diag_resetstate.php*"; $priv_list['page-diagnostics-routingtables'] = array(); -$priv_list['page-diagnostics-routingtables']['name'] = "WebCfg - Diagnostics: Routing tables page"; -$priv_list['page-diagnostics-routingtables']['descr'] = "Allow access to the 'Diagnostics: Routing tables' page."; +$priv_list['page-diagnostics-routingtables']['name'] = gettext("WebCfg - Diagnostics: Routing tables page"); +$priv_list['page-diagnostics-routingtables']['descr'] = gettext("Allow access to the 'Diagnostics: Routing tables' page."); $priv_list['page-diagnostics-routingtables']['match'] = array(); $priv_list['page-diagnostics-routingtables']['match'][] = "diag_routes.php*"; $priv_list['page-diagnostics-interfacetraffic'] = array(); -$priv_list['page-diagnostics-interfacetraffic']['name'] = "WebCfg - Diagnostics: Interface Traffic page"; -$priv_list['page-diagnostics-interfacetraffic']['descr'] = "Allow access to the 'Diagnostics: Interface Traffic' page."; +$priv_list['page-diagnostics-interfacetraffic']['name'] = gettext("WebCfg - Diagnostics: Interface Traffic page"); +$priv_list['page-diagnostics-interfacetraffic']['descr'] = gettext("Allow access to the 'Diagnostics: Interface Traffic' page."); $priv_list['page-diagnostics-interfacetraffic']['match'] = array(); $priv_list['page-diagnostics-interfacetraffic']['match'][] = "graph.php*"; $priv_list['page-diag-system-activity'] = array(); -$priv_list['page-diag-system-activity']['name'] = "WebCfg - Diagnostics: System Activity"; -$priv_list['page-diag-system-activity']['descr'] = "Allows access to the 'Diagnostics: System Activity' page"; +$priv_list['page-diag-system-activity']['name'] = gettext("WebCfg - Diagnostics: System Activity"); +$priv_list['page-diag-system-activity']['descr'] = gettext("Allows access to the 'Diagnostics: System Activity' page"); $priv_list['page-diag-system-activity']['match'] = array(); $priv_list['page-diag-system-activity']['match'][] = "diag_system_activity*"; $priv_list['page-diag-system-activity'] = array(); -$priv_list['page-diag-system-activity']['name'] = "WebCfg - Diagnostics: System Activity"; -$priv_list['page-diag-system-activity']['descr'] = "Allows access to the 'Diagnostics: System Activity' page"; +$priv_list['page-diag-system-activity']['name'] = gettext("WebCfg - Diagnostics: System Activity"); +$priv_list['page-diag-system-activity']['descr'] = gettext("Allows access to the 'Diagnostics: System Activity' page"); $priv_list['page-diag-system-activity']['match'] = array(); $priv_list['page-diag-system-activity']['match'][] = "diag_system_pftop*"; $priv_list['page-diagnostics-traceroute'] = array(); -$priv_list['page-diagnostics-traceroute']['name'] = "WebCfg - Diagnostics: Traceroute page"; -$priv_list['page-diagnostics-traceroute']['descr'] = "Allow access to the 'Diagnostics: Traceroute' page."; +$priv_list['page-diagnostics-traceroute']['name'] = gettext("WebCfg - Diagnostics: Traceroute page"); +$priv_list['page-diagnostics-traceroute']['descr'] = gettext("Allow access to the 'Diagnostics: Traceroute' page."); $priv_list['page-diagnostics-traceroute']['match'] = array(); $priv_list['page-diagnostics-traceroute']['match'][] = "diag_traceroute.php*"; $priv_list['page-diagnostics-command'] = array(); -$priv_list['page-diagnostics-command']['name'] = "WebCfg - Diagnostics: Command page"; -$priv_list['page-diagnostics-command']['descr'] = "Allow access to the 'Diagnostics: Command' page."; +$priv_list['page-diagnostics-command']['name'] = gettext("WebCfg - Diagnostics: Command page"); +$priv_list['page-diagnostics-command']['descr'] = gettext("Allow access to the 'Diagnostics: Command' page."); $priv_list['page-diagnostics-command']['match'] = array(); $priv_list['page-diagnostics-command']['match'][] = "exec.php*"; $priv_list['page-hidden-execraw'] = array(); -$priv_list['page-hidden-execraw']['name'] = "WebCfg - Hidden: Exec Raw page"; -$priv_list['page-hidden-execraw']['descr'] = "Allow access to the 'Hidden: Exec Raw' page."; +$priv_list['page-hidden-execraw']['name'] = gettext("WebCfg - Hidden: Exec Raw page"); +$priv_list['page-hidden-execraw']['descr'] = gettext("Allow access to the 'Hidden: Exec Raw' page."); $priv_list['page-hidden-execraw']['match'] = array(); $priv_list['page-hidden-execraw']['match'][] = "exec_raw.php*"; $priv_list['page-firewall-alias-edit'] = array(); -$priv_list['page-firewall-alias-edit']['name'] = "WebCfg - Firewall: Alias: Edit page"; -$priv_list['page-firewall-alias-edit']['descr'] = "Allow access to the 'Firewall: Alias: Edit' page."; +$priv_list['page-firewall-alias-edit']['name'] = gettext("WebCfg - Firewall: Alias: Edit page"); +$priv_list['page-firewall-alias-edit']['descr'] = gettext("Allow access to the 'Firewall: Alias: Edit' page."); $priv_list['page-firewall-alias-edit']['match'] = array(); $priv_list['page-firewall-alias-edit']['match'][] = "firewall_aliases_edit.php*"; $priv_list['page-firewall-aliases'] = array(); -$priv_list['page-firewall-aliases']['name'] = "WebCfg - Firewall: Aliases page"; -$priv_list['page-firewall-aliases']['descr'] = "Allow access to the 'Firewall: Aliases' page."; +$priv_list['page-firewall-aliases']['name'] = gettext("WebCfg - Firewall: Aliases page"); +$priv_list['page-firewall-aliases']['descr'] = gettext("Allow access to the 'Firewall: Aliases' page."); $priv_list['page-firewall-aliases']['match'] = array(); $priv_list['page-firewall-aliases']['match'][] = "firewall_aliases.php*"; $priv_list['page-firewall-alias-import'] = array(); -$priv_list['page-firewall-alias-import']['name'] = "WebCfg - Firewall: Alias: Import page"; -$priv_list['page-firewall-alias-import']['descr'] = "Allow access to the 'Firewall: Alias: Import' page."; +$priv_list['page-firewall-alias-import']['name'] = gettext("WebCfg - Firewall: Alias: Import page"); +$priv_list['page-firewall-alias-import']['descr'] = gettext("Allow access to the 'Firewall: Alias: Import' page."); $priv_list['page-firewall-alias-import']['match'] = array(); $priv_list['page-firewall-alias-import']['match'][] = "firewall_aliases_import.php*"; $priv_list['page-firewall-nat-portforward'] = array(); -$priv_list['page-firewall-nat-portforward']['name'] = "WebCfg - Firewall: NAT: Port Forward page"; -$priv_list['page-firewall-nat-portforward']['descr'] = "Allow access to the 'Firewall: NAT: Port Forward' page."; +$priv_list['page-firewall-nat-portforward']['name'] = gettext("WebCfg - Firewall: NAT: Port Forward page"); +$priv_list['page-firewall-nat-portforward']['descr'] = gettext("Allow access to the 'Firewall: NAT: Port Forward' page."); $priv_list['page-firewall-nat-portforward']['match'] = array(); $priv_list['page-firewall-nat-portforward']['match'][] = "firewall_nat.php*"; $priv_list['page-firewall-nat-1-1'] = array(); -$priv_list['page-firewall-nat-1-1']['name'] = "WebCfg - Firewall: NAT: 1:1 page"; -$priv_list['page-firewall-nat-1-1']['descr'] = "Allow access to the 'Firewall: NAT: 1:1' page."; +$priv_list['page-firewall-nat-1-1']['name'] = gettext("WebCfg - Firewall: NAT: 1:1 page"); +$priv_list['page-firewall-nat-1-1']['descr'] = gettext("Allow access to the 'Firewall: NAT: 1:1' page."); $priv_list['page-firewall-nat-1-1']['match'] = array(); $priv_list['page-firewall-nat-1-1']['match'][] = "firewall_nat_1to1.php*"; $priv_list['page-firewall-nat-1-1-edit'] = array(); -$priv_list['page-firewall-nat-1-1-edit']['name'] = "WebCfg - Firewall: NAT: 1:1: Edit page"; -$priv_list['page-firewall-nat-1-1-edit']['descr'] = "Allow access to the 'Firewall: NAT: 1:1: Edit' page."; +$priv_list['page-firewall-nat-1-1-edit']['name'] = gettext("WebCfg - Firewall: NAT: 1:1: Edit page"); +$priv_list['page-firewall-nat-1-1-edit']['descr'] = gettext("Allow access to the 'Firewall: NAT: 1:1: Edit' page."); $priv_list['page-firewall-nat-1-1-edit']['match'] = array(); $priv_list['page-firewall-nat-1-1-edit']['match'][] = "firewall_nat_1to1_edit.php*"; $priv_list['page-firewall-nat-portforward-edit'] = array(); -$priv_list['page-firewall-nat-portforward-edit']['name'] = "WebCfg - Firewall: NAT: Port Forward: Edit page"; -$priv_list['page-firewall-nat-portforward-edit']['descr'] = "Allow access to the 'Firewall: NAT: Port Forward: Edit' page."; +$priv_list['page-firewall-nat-portforward-edit']['name'] = gettext("WebCfg - Firewall: NAT: Port Forward: Edit page"); +$priv_list['page-firewall-nat-portforward-edit']['descr'] = gettext("Allow access to the 'Firewall: NAT: Port Forward: Edit' page."); $priv_list['page-firewall-nat-portforward-edit']['match'] = array(); $priv_list['page-firewall-nat-portforward-edit']['match'][] = "firewall_nat_edit.php*"; $priv_list['page-firewall-nat-outbound'] = array(); -$priv_list['page-firewall-nat-outbound']['name'] = "WebCfg - Firewall: NAT: Outbound page"; -$priv_list['page-firewall-nat-outbound']['descr'] = "Allow access to the 'Firewall: NAT: Outbound' page."; +$priv_list['page-firewall-nat-outbound']['name'] = gettext("WebCfg - Firewall: NAT: Outbound page"); +$priv_list['page-firewall-nat-outbound']['descr'] = gettext("Allow access to the 'Firewall: NAT: Outbound' page."); $priv_list['page-firewall-nat-outbound']['match'] = array(); $priv_list['page-firewall-nat-outbound']['match'][] = "firewall_nat_out.php*"; $priv_list['page-services-loadbalancer-relay-protocol-edit'] = array(); -$priv_list['page-services-loadbalancer-relay-protocol-edit']['name'] = "WebCfg - Services: Load Balancer: Relay Protocol: Edit page"; -$priv_list['page-services-loadbalancer-relay-protocol-edit']['descr'] = "Allow access to the 'Services: Load Balancer: Relay Protocol: Edit' page."; +$priv_list['page-services-loadbalancer-relay-protocol-edit']['name'] = gettext("WebCfg - Services: Load Balancer: Relay Protocol: Edit page"); +$priv_list['page-services-loadbalancer-relay-protocol-edit']['descr'] = gettext("Allow access to the 'Services: Load Balancer: Relay Protocol: Edit' page."); $priv_list['page-services-loadbalancer-relay-protocol-edit']['match'] = array(); $priv_list['page-services-loadbalancer-relay-protocol-edit']['match'][] = "load_balancer_relay_protocol_edit.php*"; $priv_list['page-firewall-schedules'] = array(); -$priv_list['page-firewall-schedules']['name'] = "WebCfg - Firewall: Schedules page"; -$priv_list['page-firewall-schedules']['descr'] = "Allow access to the 'Firewall: Schedules' page."; +$priv_list['page-firewall-schedules']['name'] = gettext("WebCfg - Firewall: Schedules page"); +$priv_list['page-firewall-schedules']['descr'] = gettext("Allow access to the 'Firewall: Schedules' page."); $priv_list['page-firewall-schedules']['match'] = array(); $priv_list['page-firewall-schedules']['match'][] = "firewall_schedule.php*"; $priv_list['page-firewall-trafficshaper'] = array(); -$priv_list['page-firewall-trafficshaper']['name'] = "WebCfg - Firewall: Traffic Shaper page"; -$priv_list['page-firewall-trafficshaper']['descr'] = "Allow access to the 'Firewall: Traffic Shaper' page."; +$priv_list['page-firewall-trafficshaper']['name'] = gettext("WebCfg - Firewall: Traffic Shaper page"); +$priv_list['page-firewall-trafficshaper']['descr'] = gettext("Allow access to the 'Firewall: Traffic Shaper' page."); $priv_list['page-firewall-trafficshaper']['match'] = array(); $priv_list['page-firewall-trafficshaper']['match'][] = "firewall_shaper.php*"; $priv_list['page-firewall-trafficshaper-layer7'] = array(); -$priv_list['page-firewall-trafficshaper-layer7']['name'] = "WebCfg - Firewall: Traffic Shaper: Layer7 page"; -$priv_list['page-firewall-trafficshaper-layer7']['descr'] = "Allow access to the 'Firewall: Traffic Shaper: Layer7' page."; +$priv_list['page-firewall-trafficshaper-layer7']['name'] = gettext("WebCfg - Firewall: Traffic Shaper: Layer7 page"); +$priv_list['page-firewall-trafficshaper-layer7']['descr'] = gettext("Allow access to the 'Firewall: Traffic Shaper: Layer7' page."); $priv_list['page-firewall-trafficshaper-layer7']['match'] = array(); $priv_list['page-firewall-trafficshaper-layer7']['match'][] = "firewall_shaper_layer7.php*"; $priv_list['page-firewall-trafficshaper-queues'] = array(); -$priv_list['page-firewall-trafficshaper-queues']['name'] = "WebCfg - Firewall: Traffic Shaper: Queues page"; -$priv_list['page-firewall-trafficshaper-queues']['descr'] = "Allow access to the 'Firewall: Traffic Shaper: Queues' page."; +$priv_list['page-firewall-trafficshaper-queues']['name'] = gettext("WebCfg - Firewall: Traffic Shaper: Queues page"); +$priv_list['page-firewall-trafficshaper-queues']['descr'] = gettext("Allow access to the 'Firewall: Traffic Shaper: Queues' page."); $priv_list['page-firewall-trafficshaper-queues']['match'] = array(); $priv_list['page-firewall-trafficshaper-queues']['match'][] = "firewall_shaper_queues.php*"; $priv_list['page-firewall-trafficshaper-limiter'] = array(); -$priv_list['page-firewall-trafficshaper-limiter']['name'] = "WebCfg - Firewall: Traffic Shaper: Limiter page"; -$priv_list['page-firewall-trafficshaper-limiter']['descr'] = "Allow access to the 'Firewall: Traffic Shaper: Limiter' page."; +$priv_list['page-firewall-trafficshaper-limiter']['name'] = gettext("WebCfg - Firewall: Traffic Shaper: Limiter page"); +$priv_list['page-firewall-trafficshaper-limiter']['descr'] = gettext("Allow access to the 'Firewall: Traffic Shaper: Limiter' page."); $priv_list['page-firewall-trafficshaper-limiter']['match'] = array(); $priv_list['page-firewall-trafficshaper-limiter']['match'][] = "firewall_shaper_vinterface.php*"; $priv_list['page-firewall-trafficshaper-wizard'] = array(); -$priv_list['page-firewall-trafficshaper-wizard']['name'] = "WebCfg - Firewall: Traffic Shaper: Wizard page"; -$priv_list['page-firewall-trafficshaper-wizard']['descr'] = "Allow access to the 'Firewall: Traffic Shaper: Wizard' page."; +$priv_list['page-firewall-trafficshaper-wizard']['name'] = gettext("WebCfg - Firewall: Traffic Shaper: Wizard page"); +$priv_list['page-firewall-trafficshaper-wizard']['descr'] = gettext("Allow access to the 'Firewall: Traffic Shaper: Wizard' page."); $priv_list['page-firewall-trafficshaper-wizard']['match'] = array(); $priv_list['page-firewall-trafficshaper-wizard']['match'][] = "firewall_shaper_wizards.php*"; $priv_list['page-firewall-virtualipaddresses'] = array(); -$priv_list['page-firewall-virtualipaddresses']['name'] = "WebCfg - Firewall: Virtual IP Addresses page"; -$priv_list['page-firewall-virtualipaddresses']['descr'] = "Allow access to the 'Firewall: Virtual IP Addresses' page."; +$priv_list['page-firewall-virtualipaddresses']['name'] = gettext("WebCfg - Firewall: Virtual IP Addresses page"); +$priv_list['page-firewall-virtualipaddresses']['descr'] = gettext("Allow access to the 'Firewall: Virtual IP Addresses' page."); $priv_list['page-firewall-virtualipaddresses']['match'] = array(); $priv_list['page-firewall-virtualipaddresses']['match'][] = "firewall_virtual_ip.php*"; $priv_list['page-firewall-virtualipaddress-edit'] = array(); -$priv_list['page-firewall-virtualipaddress-edit']['name'] = "WebCfg - Firewall: Virtual IP Address: Edit page"; -$priv_list['page-firewall-virtualipaddress-edit']['descr'] = "Allow access to the 'Firewall: Virtual IP Address: Edit' page."; +$priv_list['page-firewall-virtualipaddress-edit']['name'] = gettext("WebCfg - Firewall: Virtual IP Address: Edit page"); +$priv_list['page-firewall-virtualipaddress-edit']['descr'] = gettext("Allow access to the 'Firewall: Virtual IP Address: Edit' page."); $priv_list['page-firewall-virtualipaddress-edit']['match'] = array(); $priv_list['page-firewall-virtualipaddress-edit']['match'][] = "firewall_virtual_ip_edit.php*"; $priv_list['page-getstats'] = array(); -$priv_list['page-getstats']['name'] = "WebCfg - AJAX: Get Stats"; -$priv_list['page-getstats']['descr'] = "Allow access to the 'AJAX: Get Stats' page."; +$priv_list['page-getstats']['name'] = gettext("WebCfg - AJAX: Get Stats"); +$priv_list['page-getstats']['descr'] = gettext("Allow access to the 'AJAX: Get Stats' page."); $priv_list['page-getstats']['match'] = array(); $priv_list['page-getstats']['match'][] = "getstats.php*"; $priv_list['page-status-systemlogs-ppp'] = array(); -$priv_list['page-status-systemlogs-ppp']['name'] = "WebCfg - Status: System logs: IPsec VPN page"; -$priv_list['page-status-systemlogs-ppp']['descr'] = "Allow access to the 'Status: System logs: IPsec VPN' page."; +$priv_list['page-status-systemlogs-ppp']['name'] = gettext("WebCfg - Status: System logs: IPsec VPN page"); +$priv_list['page-status-systemlogs-ppp']['descr'] = gettext("Allow access to the 'Status: System logs: IPsec VPN' page."); $priv_list['page-status-systemlogs-ppp']['match'] = array(); $priv_list['page-status-systemlogs-ppp']['match'][] = "diag_logs_ppp.php*"; $priv_list['page-diagnostics-nanobsd'] = array(); -$priv_list['page-diagnostics-nanobsd']['name'] = "WebCfg - Diagnostics: NanoBSD"; -$priv_list['page-diagnostics-nanobsd']['descr'] = "Allow access to the 'Diagnostics: NanoBSD' page."; +$priv_list['page-diagnostics-nanobsd']['name'] = gettext("WebCfg - Diagnostics: NanoBSD"); +$priv_list['page-diagnostics-nanobsd']['descr'] = gettext("Allow access to the 'Diagnostics: NanoBSD' page."); $priv_list['page-diagnostics-nanobsd']['match'] = array(); $priv_list['page-diagnostics-nanobsd']['match'][] = "diag_nanobsd.php*"; $priv_list['page-interfaces-gif'] = array(); -$priv_list['page-interfaces-gif']['name'] = "WebCfg - Interfaces: GIF page"; -$priv_list['page-interfaces-gif']['descr'] = "Allow access to the 'Interfaces: GIF' page."; +$priv_list['page-interfaces-gif']['name'] = gettext("WebCfg - Interfaces: GIF page"); +$priv_list['page-interfaces-gif']['descr'] = gettext("Allow access to the 'Interfaces: GIF' page."); $priv_list['page-interfaces-gif']['match'] = array(); $priv_list['page-interfaces-gif']['match'][] = "interfaces_gif.php*"; $priv_list['page-diagnostics-cpuutilization'] = array(); -$priv_list['page-diagnostics-cpuutilization']['name'] = "WebCfg - Diagnostics: CPU Utilization page"; -$priv_list['page-diagnostics-cpuutilization']['descr'] = "Allow access to the 'Diagnostics: CPU Utilization' page."; +$priv_list['page-diagnostics-cpuutilization']['name'] = gettext("WebCfg - Diagnostics: CPU Utilization page"); +$priv_list['page-diagnostics-cpuutilization']['descr'] = gettext("Allow access to the 'Diagnostics: CPU Utilization' page."); $priv_list['page-diagnostics-cpuutilization']['match'] = array(); $priv_list['page-diagnostics-cpuutilization']['match'][] = "graph_cpu.php*"; $priv_list['page-diagnostics-haltsystem'] = array(); -$priv_list['page-diagnostics-haltsystem']['name'] = "WebCfg - Diagnostics: Halt system page"; -$priv_list['page-diagnostics-haltsystem']['descr'] = "Allow access to the 'Diagnostics: Halt system' page."; +$priv_list['page-diagnostics-haltsystem']['name'] = gettext("WebCfg - Diagnostics: Halt system page"); +$priv_list['page-diagnostics-haltsystem']['descr'] = gettext("Allow access to the 'Diagnostics: Halt system' page."); $priv_list['page-diagnostics-haltsystem']['match'] = array(); $priv_list['page-diagnostics-haltsystem']['match'][] = "halt.php*"; $priv_list['page-requiredforjavascript'] = array(); -$priv_list['page-requiredforjavascript']['name'] = "WebCfg - Required for javascript page"; -$priv_list['page-requiredforjavascript']['descr'] = "Allow access to the 'Required for javascript' page."; +$priv_list['page-requiredforjavascript']['name'] = gettext("WebCfg - Required for javascript page"); +$priv_list['page-requiredforjavascript']['descr'] = gettext("Allow access to the 'Required for javascript' page."); $priv_list['page-requiredforjavascript']['match'] = array(); $priv_list['page-requiredforjavascript']['match'][] = "headjs.php*"; $priv_list['page-xmlrpcinterfacestats'] = array(); -$priv_list['page-xmlrpcinterfacestats']['name'] = "WebCfg - XMLRPC Interface Stats page"; -$priv_list['page-xmlrpcinterfacestats']['descr'] = "Allow access to the 'XMLRPC Interface Stats' page."; +$priv_list['page-xmlrpcinterfacestats']['name'] = gettext("WebCfg - XMLRPC Interface Stats page"); +$priv_list['page-xmlrpcinterfacestats']['descr'] = gettext("Allow access to the 'XMLRPC Interface Stats' page."); $priv_list['page-xmlrpcinterfacestats']['match'] = array(); $priv_list['page-xmlrpcinterfacestats']['match'][] = "ifstats.php*"; $priv_list['page-system-login/logout'] = array(); -$priv_list['page-system-login/logout']['name'] = "WebCfg - System: Login / Logout page"; -$priv_list['page-system-login/logout']['descr'] = "Allow access to the 'System: Login / Logout' page."; +$priv_list['page-system-login/logout']['name'] = gettext("WebCfg - System: Login / Logout page"); +$priv_list['page-system-login/logout']['descr'] = gettext("Allow access to the 'System: Login / Logout' page."); $priv_list['page-system-login/logout']['match'] = array(); $priv_list['page-system-login/logout']['match'][] = "index.php*"; $priv_list['page-interfaces'] = array(); -$priv_list['page-interfaces']['name'] = "WebCfg - Interfaces: WAN page"; -$priv_list['page-interfaces']['descr'] = "Allow access to the 'Interfaces' page."; +$priv_list['page-interfaces']['name'] = gettext("WebCfg - Interfaces: WAN page"); +$priv_list['page-interfaces']['descr'] = gettext("Allow access to the 'Interfaces' page."); $priv_list['page-interfaces']['match'] = array(); $priv_list['page-interfaces']['match'][] = "interfaces.php*"; $priv_list['page-interfaces-assignnetworkports'] = array(); -$priv_list['page-interfaces-assignnetworkports']['name'] = "WebCfg - Interfaces: Assign network ports page"; -$priv_list['page-interfaces-assignnetworkports']['descr'] = "Allow access to the 'Interfaces: Assign network ports' page."; +$priv_list['page-interfaces-assignnetworkports']['name'] = gettext("WebCfg - Interfaces: Assign network ports page"); +$priv_list['page-interfaces-assignnetworkports']['descr'] = gettext("Allow access to the 'Interfaces: Assign network ports' page."); $priv_list['page-interfaces-assignnetworkports']['match'] = array(); $priv_list['page-interfaces-assignnetworkports']['match'][] = "interfaces_assign.php*"; $priv_list['page-interfaces-bridge'] = array(); -$priv_list['page-interfaces-bridge']['name'] = "WebCfg - Interfaces: Bridge page"; -$priv_list['page-interfaces-bridge']['descr'] = "Allow access to the 'Interfaces: Bridge' page."; +$priv_list['page-interfaces-bridge']['name'] = gettext("WebCfg - Interfaces: Bridge page"); +$priv_list['page-interfaces-bridge']['descr'] = gettext("Allow access to the 'Interfaces: Bridge' page."); $priv_list['page-interfaces-bridge']['match'] = array(); $priv_list['page-interfaces-bridge']['match'][] = "interfaces_bridge.php*"; $priv_list['page-interfaces-bridge-edit'] = array(); -$priv_list['page-interfaces-bridge-edit']['name'] = "WebCfg - Interfaces: Bridge edit page"; -$priv_list['page-interfaces-bridge-edit']['descr'] = "Allow access to the 'Interfaces: Bridge : Edit' page."; +$priv_list['page-interfaces-bridge-edit']['name'] = gettext("WebCfg - Interfaces: Bridge edit page"); +$priv_list['page-interfaces-bridge-edit']['descr'] = gettext("Allow access to the 'Interfaces: Bridge : Edit' page."); $priv_list['page-interfaces-bridge-edit']['match'] = array(); $priv_list['page-interfaces-bridge-edit']['match'][] = "interfaces_bridge_edit.php*"; $priv_list['page-interfaces-gif-edit'] = array(); -$priv_list['page-interfaces-gif-edit']['name'] = "WebCfg - Interfaces: GIF: Edit page"; -$priv_list['page-interfaces-gif-edit']['descr'] = "Allow access to the 'Interfaces: GIF: Edit' page."; +$priv_list['page-interfaces-gif-edit']['name'] = gettext("WebCfg - Interfaces: GIF: Edit page"); +$priv_list['page-interfaces-gif-edit']['descr'] = gettext("Allow access to the 'Interfaces: GIF: Edit' page."); $priv_list['page-interfaces-gif-edit']['match'] = array(); $priv_list['page-interfaces-gif-edit']['match'][] = "interfaces_gif_edit.php*"; $priv_list['page-interfaces-gre'] = array(); -$priv_list['page-interfaces-gre']['name'] = "WebCfg - Interfaces: GRE page"; -$priv_list['page-interfaces-gre']['descr'] = "Allow access to the 'Interfaces: GRE' page."; +$priv_list['page-interfaces-gre']['name'] = gettext("WebCfg - Interfaces: GRE page"); +$priv_list['page-interfaces-gre']['descr'] = gettext("Allow access to the 'Interfaces: GRE' page."); $priv_list['page-interfaces-gre']['match'] = array(); $priv_list['page-interfaces-gre']['match'][] = "interfaces_gre.php*"; $priv_list['page-package-settings'] = array(); -$priv_list['page-package-settings']['name'] = "WebCfg - Package: Settings page"; -$priv_list['page-package-settings']['descr'] = "Allow access to the 'Package: Settings' page."; +$priv_list['page-package-settings']['name'] = gettext("WebCfg - Package: Settings page"); +$priv_list['page-package-settings']['descr'] = gettext("Allow access to the 'Package: Settings' page."); $priv_list['page-package-settings']['match'] = array(); $priv_list['page-package-settings']['match'][] = "pkg.php*"; $priv_list['page-interfaces-gre-edit'] = array(); -$priv_list['page-interfaces-gre-edit']['name'] = "WebCfg - Interfaces: GRE: Edit page"; -$priv_list['page-interfaces-gre-edit']['descr'] = "Allow access to the 'Interfaces: GRE: Edit' page."; +$priv_list['page-interfaces-gre-edit']['name'] = gettext("WebCfg - Interfaces: GRE: Edit page"); +$priv_list['page-interfaces-gre-edit']['descr'] = gettext("Allow access to the 'Interfaces: GRE: Edit' page."); $priv_list['page-interfaces-gre-edit']['match'] = array(); $priv_list['page-interfaces-gre-edit']['match'][] = "interfaces_gre_edit.php*"; $priv_list['page-interfacess-lagg'] = array(); -$priv_list['page-interfacess-lagg']['name'] = "WebCfg - Interfaces: LAGG: page"; -$priv_list['page-interfacess-lagg']['descr'] = "Edit Interface LAGG"; +$priv_list['page-interfacess-lagg']['name'] = gettext("WebCfg - Interfaces: LAGG: page"); +$priv_list['page-interfacess-lagg']['descr'] = gettext("Edit Interface LAGG"); $priv_list['page-interfacess-lagg']['match'] = array(); $priv_list['page-interfacess-lagg']['match'][] = "interfaces_lagg.php*"; $priv_list['page-interfaces-ppps-edit'] = array(); -$priv_list['page-interfaces-ppps-edit']['name'] = "WebCfg - Interfaces: PPP: Edit page"; -$priv_list['page-interfaces-ppps-edit']['descr'] = "Allow access to the 'Interfaces: PPP: Edit' page."; +$priv_list['page-interfaces-ppps-edit']['name'] = gettext("WebCfg - Interfaces: PPP: Edit page"); +$priv_list['page-interfaces-ppps-edit']['descr'] = gettext("Allow access to the 'Interfaces: PPP: Edit' page."); $priv_list['page-interfaces-ppps-edit']['match'] = array(); $priv_list['page-interfaces-ppps-edit']['match'][] = "interfaces_ppps_edit.php*"; $priv_list['page-interfaces-ppps'] = array(); -$priv_list['page-interfaces-ppps']['name'] = "WebCfg - Interfaces: PPP page"; -$priv_list['page-interfaces-ppps']['descr'] = "Allow access to the 'Interfaces: PPP' page."; +$priv_list['page-interfaces-ppps']['name'] = gettext("WebCfg - Interfaces: PPP page"); +$priv_list['page-interfaces-ppps']['descr'] = gettext("Allow access to the 'Interfaces: PPP' page."); $priv_list['page-interfaces-ppps']['match'] = array(); $priv_list['page-interfaces-ppps']['match'][] = "interfaces_ppps.php*"; $priv_list['page-interfaces-groups'] = array(); -$priv_list['page-interfaces-groups']['name'] = "WebCfg - Interfaces: Groups page"; -$priv_list['page-interfaces-groups']['descr'] = "Create interface groups"; +$priv_list['page-interfaces-groups']['name'] = gettext("WebCfg - Interfaces: Groups page"); +$priv_list['page-interfaces-groups']['descr'] = gettext("Create interface groups"); $priv_list['page-interfaces-groups']['match'] = array(); $priv_list['page-interfaces-groups']['match'][] = "interfaces_groups.php*"; $priv_list['page-interfacess-groups'] = array(); -$priv_list['page-interfacess-groups']['name'] = "WebCfg - Interfaces: Groups: Edit page"; -$priv_list['page-interfacess-groups']['descr'] = "Edit Interface groups"; +$priv_list['page-interfacess-groups']['name'] = gettext("WebCfg - Interfaces: Groups: Edit page"); +$priv_list['page-interfacess-groups']['descr'] = gettext("Edit Interface groups"); $priv_list['page-interfacess-groups']['match'] = array(); $priv_list['page-interfacess-groups']['match'][] = "interfaces_groups_edit.php*"; $priv_list['page-interfacess-lagg'] = array(); -$priv_list['page-interfacess-lagg']['name'] = "WebCfg - Interfaces: LAGG: Edit page"; -$priv_list['page-interfacess-lagg']['descr'] = "Edit Interface LAGG"; +$priv_list['page-interfacess-lagg']['name'] = gettext("WebCfg - Interfaces: LAGG: Edit page"); +$priv_list['page-interfacess-lagg']['descr'] = gettext("Edit Interface LAGG"); $priv_list['page-interfacess-lagg']['match'] = array(); $priv_list['page-interfacess-lagg']['match'][] = "interfaces_lagg_edit.php*"; $priv_list['page-interfaces-vlan'] = array(); -$priv_list['page-interfaces-vlan']['name'] = "WebCfg - Interfaces: VLAN page"; -$priv_list['page-interfaces-vlan']['descr'] = "Allow access to the 'Interfaces: VLAN' page."; +$priv_list['page-interfaces-vlan']['name'] = gettext("WebCfg - Interfaces: VLAN page"); +$priv_list['page-interfaces-vlan']['descr'] = gettext("Allow access to the 'Interfaces: VLAN' page."); $priv_list['page-interfaces-vlan']['match'] = array(); $priv_list['page-interfaces-vlan']['match'][] = "interfaces_vlan.php*"; $priv_list['page-interfaces-vlan-edit'] = array(); -$priv_list['page-interfaces-vlan-edit']['name'] = "WebCfg - Interfaces: VLAN: Edit page"; -$priv_list['page-interfaces-vlan-edit']['descr'] = "Allow access to the 'Interfaces: VLAN: Edit' page."; +$priv_list['page-interfaces-vlan-edit']['name'] = gettext("WebCfg - Interfaces: VLAN: Edit page"); +$priv_list['page-interfaces-vlan-edit']['descr'] = gettext("Allow access to the 'Interfaces: VLAN: Edit' page."); $priv_list['page-interfaces-vlan-edit']['match'] = array(); $priv_list['page-interfaces-vlan-edit']['match'][] = "interfaces_vlan_edit.php*"; $priv_list['page-interfaces-wireless'] = array(); -$priv_list['page-interfaces-wireless']['name'] = "WebCfg - Interfaces: Wireless page"; -$priv_list['page-interfaces-wireless']['descr'] = "Allow access to the 'Interfaces: Wireless' page."; +$priv_list['page-interfaces-wireless']['name'] = gettext("WebCfg - Interfaces: Wireless page"); +$priv_list['page-interfaces-wireless']['descr'] = gettext("Allow access to the 'Interfaces: Wireless' page."); $priv_list['page-interfaces-wireless']['match'] = array(); $priv_list['page-interfaces-wireless']['match'][] = "interfaces_wireless.php*"; $priv_list['page-interfaces-wireless-edit'] = array(); -$priv_list['page-interfaces-wireless-edit']['name'] = "WebCfg - Interfaces: Wireless edit page"; -$priv_list['page-interfaces-wireless-edit']['descr'] = "Allow access to the 'Interfaces: Wireless : Edit' page."; +$priv_list['page-interfaces-wireless-edit']['name'] = gettext("WebCfg - Interfaces: Wireless edit page"); +$priv_list['page-interfaces-wireless-edit']['descr'] = gettext("Allow access to the 'Interfaces: Wireless : Edit' page."); $priv_list['page-interfaces-wireless-edit']['match'] = array(); $priv_list['page-interfaces-wireless-edit']['match'][] = "interfaces_wireless_edit.php*"; $priv_list['page-system-license'] = array(); -$priv_list['page-system-license']['name'] = "WebCfg - System: License page"; -$priv_list['page-system-license']['descr'] = "Allow access to the 'System: License' page."; +$priv_list['page-system-license']['name'] = gettext("WebCfg - System: License page"); +$priv_list['page-system-license']['descr'] = gettext("Allow access to the 'System: License' page."); $priv_list['page-system-license']['match'] = array(); $priv_list['page-system-license']['match'][] = "license.php*"; $priv_list['page-services-loadbalancer-monitor'] = array(); -$priv_list['page-services-loadbalancer-monitor']['name'] = "WebCfg - Services: Load Balancer: Monitors page"; -$priv_list['page-services-loadbalancer-monitor']['descr'] = "Allow access to the 'Services: Load Balancer: Monitors' page."; +$priv_list['page-services-loadbalancer-monitor']['name'] = gettext("WebCfg - Services: Load Balancer: Monitors page"); +$priv_list['page-services-loadbalancer-monitor']['descr'] = gettext("Allow access to the 'Services: Load Balancer: Monitors' page."); $priv_list['page-services-loadbalancer-monitor']['match'] = array(); $priv_list['page-services-loadbalancer-monitor']['match'][] = "load_balancer_monitor.php*"; $priv_list['page-services-loadbalancer-monitor-edit'] = array(); -$priv_list['page-services-loadbalancer-monitor-edit']['name'] = "WebCfg - Services: Load Balancer: Monitor: Edit page"; -$priv_list['page-services-loadbalancer-monitor-edit']['descr'] = "Allow access to the 'Services: Load Balancer: Monitor: Edit' page."; +$priv_list['page-services-loadbalancer-monitor-edit']['name'] = gettext("WebCfg - Services: Load Balancer: Monitor: Edit page"); +$priv_list['page-services-loadbalancer-monitor-edit']['descr'] = gettext("Allow access to the 'Services: Load Balancer: Monitor: Edit' page."); $priv_list['page-services-loadbalancer-monitor-edit']['match'] = array(); $priv_list['page-services-loadbalancer-monitor-edit']['match'][] = "load_balancer_monitor_edit.php*"; $priv_list['page-loadbalancer-pool'] = array(); -$priv_list['page-loadbalancer-pool']['name'] = "WebCfg - Load Balancer: Pool page"; -$priv_list['page-loadbalancer-pool']['descr'] = "Allow access to the 'Load Balancer: Pool' page."; +$priv_list['page-loadbalancer-pool']['name'] = gettext("WebCfg - Load Balancer: Pool page"); +$priv_list['page-loadbalancer-pool']['descr'] = gettext("Allow access to the 'Load Balancer: Pool' page."); $priv_list['page-loadbalancer-pool']['match'] = array(); $priv_list['page-loadbalancer-pool']['match'][] = "load_balancer_pool.php*"; $priv_list['page-loadbalancer-pool-edit'] = array(); -$priv_list['page-loadbalancer-pool-edit']['name'] = "WebCfg - Load Balancer: Pool: Edit page"; -$priv_list['page-loadbalancer-pool-edit']['descr'] = "Allow access to the 'Load Balancer: Pool: Edit' page."; +$priv_list['page-loadbalancer-pool-edit']['name'] = gettext("WebCfg - Load Balancer: Pool: Edit page"); +$priv_list['page-loadbalancer-pool-edit']['descr'] = gettext("Allow access to the 'Load Balancer: Pool: Edit' page."); $priv_list['page-loadbalancer-pool-edit']['match'] = array(); $priv_list['page-loadbalancer-pool-edit']['match'][] = "load_balancer_pool_edit.php*"; $priv_list['page-system-packagemanager'] = array(); -$priv_list['page-system-packagemanager']['name'] = "WebCfg - System: Package Manager page"; -$priv_list['page-system-packagemanager']['descr'] = "Allow access to the 'System: Package Manager' page."; +$priv_list['page-system-packagemanager']['name'] = gettext("WebCfg - System: Package Manager page"); +$priv_list['page-system-packagemanager']['descr'] = gettext("Allow access to the 'System: Package Manager' page."); $priv_list['page-system-packagemanager']['match'] = array(); $priv_list['page-system-packagemanager']['match'][] = "pkg_mgr.php*"; $priv_list['page-services-captiveportal-allowedips'] = array(); -$priv_list['page-services-captiveportal-allowedips']['name'] = "WebCfg - Services: Captive portal: Allowed IPs page"; -$priv_list['page-services-captiveportal-allowedips']['descr'] = "Allow access to the 'Services: Captive portal: Allowed IPs' page."; +$priv_list['page-services-captiveportal-allowedips']['name'] = gettext("WebCfg - Services: Captive portal: Allowed IPs page"); +$priv_list['page-services-captiveportal-allowedips']['descr'] = gettext("Allow access to the 'Services: Captive portal: Allowed IPs' page."); $priv_list['page-services-captiveportal-allowedips']['match'] = array(); $priv_list['page-services-captiveportal-allowedips']['match'][] = "services_captiveportal_ip.php*"; $priv_list['page-interfacess-qinq'] = array(); -$priv_list['page-interfacess-qinq']['name'] = "WebCfg - Interfaces: QinQ: Edit page"; -$priv_list['page-interfacess-qinq']['descr'] = "Edit Interface qinq"; +$priv_list['page-interfacess-qinq']['name'] = gettext("WebCfg - Interfaces: QinQ: Edit page"); +$priv_list['page-interfacess-qinq']['descr'] = gettext("Edit Interface qinq"); $priv_list['page-interfacess-qinq']['match'] = array(); $priv_list['page-interfacess-qinq']['match'][] = "interfaces_qinq_edit.php*"; $priv_list['page-services-loadbalancer-relay-action'] = array(); -$priv_list['page-services-loadbalancer-relay-action']['name'] = "WebCfg - Services: Load Balancer: Relay Actions page"; -$priv_list['page-services-loadbalancer-relay-action']['descr'] = "Allow access to the 'Services: Load Balancer: Relay Actions' page."; +$priv_list['page-services-loadbalancer-relay-action']['name'] = gettext("WebCfg - Services: Load Balancer: Relay Actions page"); +$priv_list['page-services-loadbalancer-relay-action']['descr'] = gettext("Allow access to the 'Services: Load Balancer: Relay Actions' page."); $priv_list['page-services-loadbalancer-relay-action']['match'] = array(); $priv_list['page-services-loadbalancer-relay-action']['match'][] = "load_balancer_relay_action.php*"; $priv_list['page-services-loadbalancer-relay-action-edit'] = array(); -$priv_list['page-services-loadbalancer-relay-action-edit']['name'] = "WebCfg - Services: Load Balancer: Relay Action: Edit page"; -$priv_list['page-services-loadbalancer-relay-action-edit']['descr'] = "Allow access to the 'Services: Load Balancer: Relay Action: Edit' page."; +$priv_list['page-services-loadbalancer-relay-action-edit']['name'] = gettext("WebCfg - Services: Load Balancer: Relay Action: Edit page"); +$priv_list['page-services-loadbalancer-relay-action-edit']['descr'] = gettext("Allow access to the 'Services: Load Balancer: Relay Action: Edit' page."); $priv_list['page-services-loadbalancer-relay-action-edit']['match'] = array(); $priv_list['page-services-loadbalancer-relay-action-edit']['match'][] = "load_balancer_relay_action_edit.php*"; $priv_list['page-services-loadbalancer-relay-protocol'] = array(); -$priv_list['page-services-loadbalancer-relay-protocol']['name'] = "WebCfg - Services: Load Balancer: Relay Protocols page"; -$priv_list['page-services-loadbalancer-relay-protocol']['descr'] = "Allow access to the 'Services: Load Balancer: Relay Protocols' page."; +$priv_list['page-services-loadbalancer-relay-protocol']['name'] = gettext("WebCfg - Services: Load Balancer: Relay Protocols page"); +$priv_list['page-services-loadbalancer-relay-protocol']['descr'] = gettext("Allow access to the 'Services: Load Balancer: Relay Protocols' page."); $priv_list['page-services-loadbalancer-relay-protocol']['match'] = array(); $priv_list['page-services-loadbalancer-relay-protocol']['match'][] = "load_balancer_relay_protocol.php*"; $priv_list['page-services-loadbalancer-virtualservers'] = array(); -$priv_list['page-services-loadbalancer-virtualservers']['name'] = "WebCfg - Services: Load Balancer: Virtual Servers page"; -$priv_list['page-services-loadbalancer-virtualservers']['descr'] = "Allow access to the 'Services: Load Balancer: Virtual Servers' page."; +$priv_list['page-services-loadbalancer-virtualservers']['name'] = gettext("WebCfg - Services: Load Balancer: Virtual Servers page"); +$priv_list['page-services-loadbalancer-virtualservers']['descr'] = gettext("Allow access to the 'Services: Load Balancer: Virtual Servers' page."); $priv_list['page-services-loadbalancer-virtualservers']['match'] = array(); $priv_list['page-services-loadbalancer-virtualservers']['match'][] = "load_balancer_virtual_server.php*"; $priv_list['page-loadbalancer-virtualserver-edit'] = array(); -$priv_list['page-loadbalancer-virtualserver-edit']['name'] = "WebCfg - Load Balancer: Virtual Server: Edit page"; -$priv_list['page-loadbalancer-virtualserver-edit']['descr'] = "Allow access to the 'Load Balancer: Virtual Server: Edit' page."; +$priv_list['page-loadbalancer-virtualserver-edit']['name'] = gettext("WebCfg - Load Balancer: Virtual Server: Edit page"); +$priv_list['page-loadbalancer-virtualserver-edit']['descr'] = gettext("Allow access to the 'Load Balancer: Virtual Server: Edit' page."); $priv_list['page-loadbalancer-virtualserver-edit']['match'] = array(); $priv_list['page-loadbalancer-virtualserver-edit']['match'][] = "load_balancer_virtual_server_edit.php*"; $priv_list['page-package-edit'] = array(); -$priv_list['page-package-edit']['name'] = "WebCfg - Package: Edit page"; -$priv_list['page-package-edit']['descr'] = "Allow access to the 'Package: Edit' page."; +$priv_list['page-package-edit']['name'] = gettext("WebCfg - Package: Edit page"); +$priv_list['page-package-edit']['descr'] = gettext("Allow access to the 'Package: Edit' page."); $priv_list['page-package-edit']['match'] = array(); $priv_list['page-package-edit']['match'][] = "pkg_edit.php*"; $priv_list['page-system-packagemanager-installpackage'] = array(); -$priv_list['page-system-packagemanager-installpackage']['name'] = "WebCfg - System: Package Manager: Install Package page"; -$priv_list['page-system-packagemanager-installpackage']['descr'] = "Allow access to the 'System: Package Manager: Install Package' page."; +$priv_list['page-system-packagemanager-installpackage']['name'] = gettext("WebCfg - System: Package Manager: Install Package page"); +$priv_list['page-system-packagemanager-installpackage']['descr'] = gettext("Allow access to the 'System: Package Manager: Install Package' page."); $priv_list['page-system-packagemanager-installpackage']['match'] = array(); $priv_list['page-system-packagemanager-installpackage']['match'][] = "pkg_mgr_install.php*"; $priv_list['page-system-packagemanager-installed'] = array(); -$priv_list['page-system-packagemanager-installed']['name'] = "WebCfg - System: Package Manager: Installed page"; -$priv_list['page-system-packagemanager-installed']['descr'] = "Allow access to the 'System: Package Manager: Installed' page."; +$priv_list['page-system-packagemanager-installed']['name'] = gettext("WebCfg - System: Package Manager: Installed page"); +$priv_list['page-system-packagemanager-installed']['descr'] = gettext("Allow access to the 'System: Package Manager: Installed' page."); $priv_list['page-system-packagemanager-installed']['match'] = array(); $priv_list['page-system-packagemanager-installed']['match'][] = "pkg_mgr_installed.php*"; $priv_list['page-diagnostics-rebootsystem'] = array(); -$priv_list['page-diagnostics-rebootsystem']['name'] = "WebCfg - Diagnostics: Reboot System page"; -$priv_list['page-diagnostics-rebootsystem']['descr'] = "Allow access to the 'Diagnostics: Reboot System' page."; +$priv_list['page-diagnostics-rebootsystem']['name'] = gettext("WebCfg - Diagnostics: Reboot System page"); +$priv_list['page-diagnostics-rebootsystem']['descr'] = gettext("Allow access to the 'Diagnostics: Reboot System' page."); $priv_list['page-diagnostics-rebootsystem']['match'] = array(); $priv_list['page-diagnostics-rebootsystem']['match'][] = "reboot.php*"; $priv_list['page-services-captiveportal-filemanager'] = array(); -$priv_list['page-services-captiveportal-filemanager']['name'] = "WebCfg - Services: Captive portal: File Manager page"; -$priv_list['page-services-captiveportal-filemanager']['descr'] = "Allow access to the 'Services: Captive portal: File Manager' page."; +$priv_list['page-services-captiveportal-filemanager']['name'] = gettext("WebCfg - Services: Captive portal: File Manager page"); +$priv_list['page-services-captiveportal-filemanager']['descr'] = gettext("Allow access to the 'Services: Captive portal: File Manager' page."); $priv_list['page-services-captiveportal-filemanager']['match'] = array(); $priv_list['page-services-captiveportal-filemanager']['match'][] = "services_captiveportal_filemanager.php*"; $priv_list['page-diagnostics-restart-httpd'] = array(); -$priv_list['page-diagnostics-restart-httpd']['name'] = "WebCfg - Diagnostics: Restart HTTPD : System page"; -$priv_list['page-diagnostics-restart-httpd']['descr'] = "Allow access to the 'Diagnostics: Restart HTTPD: System' page."; +$priv_list['page-diagnostics-restart-httpd']['name'] = gettext("WebCfg - Diagnostics: Restart HTTPD : System page"); +$priv_list['page-diagnostics-restart-httpd']['descr'] = gettext("Allow access to the 'Diagnostics: Restart HTTPD: System' page."); $priv_list['page-diagnostics-restart-httpd']['match'] = array(); $priv_list['page-diagnostics-restart-httpd']['match'][] = "restart_httpd.php*"; $priv_list['page-services-captiveportal'] = array(); -$priv_list['page-services-captiveportal']['name'] = "WebCfg - Services: Captive portal page"; -$priv_list['page-services-captiveportal']['descr'] = "Allow access to the 'Services: Captive portal' page."; +$priv_list['page-services-captiveportal']['name'] = gettext("WebCfg - Services: Captive portal page"); +$priv_list['page-services-captiveportal']['descr'] = gettext("Allow access to the 'Services: Captive portal' page."); $priv_list['page-services-captiveportal']['match'] = array(); $priv_list['page-services-captiveportal']['match'][] = "services_captiveportal.php*"; $priv_list['page-services-captiveportal-macaddresses'] = array(); -$priv_list['page-services-captiveportal-macaddresses']['name'] = "WebCfg - Services: Captive portal: Mac Addresses page"; -$priv_list['page-services-captiveportal-macaddresses']['descr'] = "Allow access to the 'Services: Captive portal: Mac Addresses' page."; +$priv_list['page-services-captiveportal-macaddresses']['name'] = gettext("WebCfg - Services: Captive portal: Mac Addresses page"); +$priv_list['page-services-captiveportal-macaddresses']['descr'] = gettext("Allow access to the 'Services: Captive portal: Mac Addresses' page."); $priv_list['page-services-captiveportal-macaddresses']['match'] = array(); $priv_list['page-services-captiveportal-macaddresses']['match'][] = "services_captiveportal_mac.php*"; $priv_list['page-services-captiveportal-editmacaddresses'] = array(); -$priv_list['page-services-captiveportal-editmacaddresses']['name'] = "WebCfg - Services: Captive portal: Edit MAC Addresses page"; -$priv_list['page-services-captiveportal-editmacaddresses']['descr'] = "Allow access to the 'Services: Captive portal: Edit MAC Addresses' page."; +$priv_list['page-services-captiveportal-editmacaddresses']['name'] = gettext("WebCfg - Services: Captive portal: Edit MAC Addresses page"); +$priv_list['page-services-captiveportal-editmacaddresses']['descr'] = gettext("Allow access to the 'Services: Captive portal: Edit MAC Addresses' page."); $priv_list['page-services-captiveportal-editmacaddresses']['match'] = array(); $priv_list['page-services-captiveportal-editmacaddresses']['match'][] = "services_captiveportal_mac_edit.php*"; $priv_list['page-services-dhcpserver-editstaticmapping'] = array(); -$priv_list['page-services-dhcpserver-editstaticmapping']['name'] = "WebCfg - Services: DHCP Server : Edit static mapping page"; -$priv_list['page-services-dhcpserver-editstaticmapping']['descr'] = "Allow access to the 'Services: DHCP Server : Edit static mapping' page."; +$priv_list['page-services-dhcpserver-editstaticmapping']['name'] = gettext("WebCfg - Services: DHCP Server : Edit static mapping page"); +$priv_list['page-services-dhcpserver-editstaticmapping']['descr'] = gettext("Allow access to the 'Services: DHCP Server : Edit static mapping' page."); $priv_list['page-services-dhcpserver-editstaticmapping']['match'] = array(); $priv_list['page-services-dhcpserver-editstaticmapping']['match'][] = "services_dhcp_edit.php*"; $priv_list['page-services-dhcprelay'] = array(); -$priv_list['page-services-dhcprelay']['name'] = "WebCfg - Services: DHCP Relay page"; -$priv_list['page-services-dhcprelay']['descr'] = "Allow access to the 'Services: DHCP Relay' page."; +$priv_list['page-services-dhcprelay']['name'] = gettext("WebCfg - Services: DHCP Relay page"); +$priv_list['page-services-dhcprelay']['descr'] = gettext("Allow access to the 'Services: DHCP Relay' page."); $priv_list['page-services-dhcprelay']['match'] = array(); $priv_list['page-services-dhcprelay']['match'][] = "services_dhcp_relay.php*"; $priv_list['page-services-dhcpserver'] = array(); -$priv_list['page-services-dhcpserver']['name'] = "WebCfg - Services: DHCP server page"; -$priv_list['page-services-dhcpserver']['descr'] = "Allow access to the 'Services: DHCP server' page."; +$priv_list['page-services-dhcpserver']['name'] = gettext("WebCfg - Services: DHCP server page"); +$priv_list['page-services-dhcpserver']['descr'] = gettext("Allow access to the 'Services: DHCP server' page."); $priv_list['page-services-dhcpserver']['match'] = array(); $priv_list['page-services-dhcpserver']['match'][] = "services_dhcp.php*"; $priv_list['page-services-dnsforwarder'] = array(); -$priv_list['page-services-dnsforwarder']['name'] = "WebCfg - Services: DNS Forwarder page"; -$priv_list['page-services-dnsforwarder']['descr'] = "Allow access to the 'Services: DNS Forwarder' page."; +$priv_list['page-services-dnsforwarder']['name'] = gettext("WebCfg - Services: DNS Forwarder page"); +$priv_list['page-services-dnsforwarder']['descr'] = gettext("Allow access to the 'Services: DNS Forwarder' page."); $priv_list['page-services-dnsforwarder']['match'] = array(); $priv_list['page-services-dnsforwarder']['match'][] = "services_dnsmasq.php*"; $priv_list['page-services-igmpproxy'] = array(); -$priv_list['page-services-igmpproxy']['name'] = "WebCfg - Services: Igmpproxy page"; -$priv_list['page-services-igmpproxy']['descr'] = "Allow access to the 'Services: Igmpproxy' page."; +$priv_list['page-services-igmpproxy']['name'] = gettext("WebCfg - Services: Igmpproxy page"); +$priv_list['page-services-igmpproxy']['descr'] = gettext("Allow access to the 'Services: Igmpproxy' page."); $priv_list['page-services-igmpproxy']['match'] = array(); $priv_list['page-services-igmpproxy']['match'][] = "services_igmpproxy.php*"; $priv_list['page-services-dnsforwarder-edithost'] = array(); -$priv_list['page-services-dnsforwarder-edithost']['name'] = "WebCfg - Services: DNS Forwarder: Edit host page"; -$priv_list['page-services-dnsforwarder-edithost']['descr'] = "Allow access to the 'Services: DNS Forwarder: Edit host' page."; +$priv_list['page-services-dnsforwarder-edithost']['name'] = gettext("WebCfg - Services: DNS Forwarder: Edit host page"); +$priv_list['page-services-dnsforwarder-edithost']['descr'] = gettext("Allow access to the 'Services: DNS Forwarder: Edit host' page."); $priv_list['page-services-dnsforwarder-edithost']['match'] = array(); $priv_list['page-services-dnsforwarder-edithost']['match'][] = "services_dnsmasq_edit.php*"; $priv_list['page-services-dynamicdnsclients'] = array(); -$priv_list['page-services-dynamicdnsclients']['name'] = "WebCfg - Services: Dynamic DNS clients page"; -$priv_list['page-services-dynamicdnsclients']['descr'] = "Allow access to the 'Services: Dynamic DNS clients' page."; +$priv_list['page-services-dynamicdnsclients']['name'] = gettext("WebCfg - Services: Dynamic DNS clients page"); +$priv_list['page-services-dynamicdnsclients']['descr'] = gettext("Allow access to the 'Services: Dynamic DNS clients' page."); $priv_list['page-services-dynamicdnsclients']['match'] = array(); $priv_list['page-services-dynamicdnsclients']['match'][] = "services_dyndns.php*"; $priv_list['page-system-usermanager-settings-testldap'] = array(); -$priv_list['page-system-usermanager-settings-testldap']['name'] = "WebCfg - System: User Manager: Settings: Test LDAP page"; -$priv_list['page-system-usermanager-settings-testldap']['descr'] = "Allow access to the 'System: User Manager: Settings: Test LDAP' page."; +$priv_list['page-system-usermanager-settings-testldap']['name'] = gettext("WebCfg - System: User Manager: Settings: Test LDAP page"); +$priv_list['page-system-usermanager-settings-testldap']['descr'] = gettext("Allow access to the 'System: User Manager: Settings: Test LDAP' page."); $priv_list['page-system-usermanager-settings-testldap']['match'] = array(); $priv_list['page-system-usermanager-settings-testldap']['match'][] = "system_usermanager_settings_test.php*"; $priv_list['page-services-dynamicdnsclient'] = array(); -$priv_list['page-services-dynamicdnsclient']['name'] = "WebCfg - Services: Dynamic DNS client page"; -$priv_list['page-services-dynamicdnsclient']['descr'] = "Allow access to the 'Services: Dynamic DNS client' page."; +$priv_list['page-services-dynamicdnsclient']['name'] = gettext("WebCfg - Services: Dynamic DNS client page"); +$priv_list['page-services-dynamicdnsclient']['descr'] = gettext("Allow access to the 'Services: Dynamic DNS client' page."); $priv_list['page-services-dynamicdnsclient']['match'] = array(); $priv_list['page-services-dynamicdnsclient']['match'][] = "services_dyndns_edit.php*"; $priv_list['page-services-igmpproxy'] = array(); -$priv_list['page-services-igmpproxy']['name'] = "WebCfg - Firewall: Igmpproxy: Edit page"; -$priv_list['page-services-igmpproxy']['descr'] = "Allow access to the 'Firewall: Igmpproxy' page."; +$priv_list['page-services-igmpproxy']['name'] = gettext("WebCfg - Firewall: Igmpproxy: Edit page"); +$priv_list['page-services-igmpproxy']['descr'] = gettext("Allow access to the 'Firewall: Igmpproxy' page."); $priv_list['page-services-igmpproxy']['match'] = array(); $priv_list['page-services-igmpproxy']['match'][] = "services_igmpproxy_edit.php*"; $priv_list['page-services-proxyarp'] = array(); -$priv_list['page-services-proxyarp']['name'] = "WebCfg - Services: Proxy ARP page"; -$priv_list['page-services-proxyarp']['descr'] = "Allow access to the 'Services: Proxy ARP' page."; +$priv_list['page-services-proxyarp']['name'] = gettext("WebCfg - Services: Proxy ARP page"); +$priv_list['page-services-proxyarp']['descr'] = gettext("Allow access to the 'Services: Proxy ARP' page."); $priv_list['page-services-proxyarp']['match'] = array(); $priv_list['page-services-proxyarp']['match'][] = "services_proxyarp.php*"; $priv_list['page-services-proxyarp-edit'] = array(); -$priv_list['page-services-proxyarp-edit']['name'] = "WebCfg - Services: Proxy ARP: Edit page"; -$priv_list['page-services-proxyarp-edit']['descr'] = "Allow access to the 'Services: Proxy ARP: Edit' page."; +$priv_list['page-services-proxyarp-edit']['name'] = gettext("WebCfg - Services: Proxy ARP: Edit page"); +$priv_list['page-services-proxyarp-edit']['descr'] = gettext("Allow access to the 'Services: Proxy ARP: Edit' page."); $priv_list['page-services-proxyarp-edit']['match'] = array(); $priv_list['page-services-proxyarp-edit']['match'][] = "services_proxyarp_edit.php*"; $priv_list['page-services-rfc2136clients'] = array(); -$priv_list['page-services-rfc2136clients']['name'] = "WebCfg - Services: RFC 2136 clients page"; -$priv_list['page-services-rfc2136clients']['descr'] = "Allow access to the 'Services: RFC 2136 clients' page."; +$priv_list['page-services-rfc2136clients']['name'] = gettext("WebCfg - Services: RFC 2136 clients page"); +$priv_list['page-services-rfc2136clients']['descr'] = gettext("Allow access to the 'Services: RFC 2136 clients' page."); $priv_list['page-services-rfc2136clients']['match'] = array(); $priv_list['page-services-rfc2136clients']['match'][] = "services_rfc2136.php*"; $priv_list['page-services-snmp'] = array(); -$priv_list['page-services-snmp']['name'] = "WebCfg - Services: SNMP page"; -$priv_list['page-services-snmp']['descr'] = "Allow access to the 'Services: SNMP' page."; +$priv_list['page-services-snmp']['name'] = gettext("WebCfg - Services: SNMP page"); +$priv_list['page-services-snmp']['descr'] = gettext("Allow access to the 'Services: SNMP' page."); $priv_list['page-services-snmp']['match'] = array(); $priv_list['page-services-snmp']['match'][] = "services_snmp.php*"; $priv_list['page-firewall-rules'] = array(); -$priv_list['page-firewall-rules']['name'] = "WebCfg - Firewall: Rules page"; -$priv_list['page-firewall-rules']['descr'] = "Allow access to the 'Firewall: Rules' page."; +$priv_list['page-firewall-rules']['name'] = gettext("WebCfg - Firewall: Rules page"); +$priv_list['page-firewall-rules']['descr'] = gettext("Allow access to the 'Firewall: Rules' page."); $priv_list['page-firewall-rules']['match'] = array(); $priv_list['page-firewall-rules']['match'][] = "firewall_rules.php*"; $priv_list['page-services-wakeonlan'] = array(); -$priv_list['page-services-wakeonlan']['name'] = "WebCfg - Services: Wake on LAN page"; -$priv_list['page-services-wakeonlan']['descr'] = "Allow access to the 'Services: Wake on LAN' page."; +$priv_list['page-services-wakeonlan']['name'] = gettext("WebCfg - Services: Wake on LAN page"); +$priv_list['page-services-wakeonlan']['descr'] = gettext("Allow access to the 'Services: Wake on LAN' page."); $priv_list['page-services-wakeonlan']['match'] = array(); $priv_list['page-services-wakeonlan']['match'][] = "services_wol.php*"; $priv_list['page-services-wakeonlan-edit'] = array(); -$priv_list['page-services-wakeonlan-edit']['name'] = "WebCfg - Services: Wake on LAN: Edit page"; -$priv_list['page-services-wakeonlan-edit']['descr'] = "Allow access to the 'Services: Wake on LAN: Edit' page."; +$priv_list['page-services-wakeonlan-edit']['name'] = gettext("WebCfg - Services: Wake on LAN: Edit page"); +$priv_list['page-services-wakeonlan-edit']['descr'] = gettext("Allow access to the 'Services: Wake on LAN: Edit' page."); $priv_list['page-services-wakeonlan-edit']['match'] = array(); $priv_list['page-services-wakeonlan-edit']['match'][] = "services_wol_edit.php*"; $priv_list['page-hidden-detailedstatus'] = array(); -$priv_list['page-hidden-detailedstatus']['name'] = "WebCfg - Hidden: Detailed Status page"; -$priv_list['page-hidden-detailedstatus']['descr'] = "Allow access to the 'Hidden: Detailed Status' page."; +$priv_list['page-hidden-detailedstatus']['name'] = gettext("WebCfg - Hidden: Detailed Status page"); +$priv_list['page-hidden-detailedstatus']['descr'] = gettext("Allow access to the 'Hidden: Detailed Status' page."); $priv_list['page-hidden-detailedstatus']['match'] = array(); $priv_list['page-hidden-detailedstatus']['match'][] = "status.php*"; $priv_list['page-status-captiveportal'] = array(); -$priv_list['page-status-captiveportal']['name'] = "WebCfg - Status: Captive portal page"; -$priv_list['page-status-captiveportal']['descr'] = "Allow access to the 'Status: Captive portal' page."; +$priv_list['page-status-captiveportal']['name'] = gettext("WebCfg - Status: Captive portal page"); +$priv_list['page-status-captiveportal']['descr'] = gettext("Allow access to the 'Status: Captive portal' page."); $priv_list['page-status-captiveportal']['match'] = array(); $priv_list['page-status-captiveportal']['match'][] = "status_captiveportal.php*"; $priv_list['page-status-filterreloadstatus'] = array(); -$priv_list['page-status-filterreloadstatus']['name'] = "WebCfg - Status: Filter Reload Status page"; -$priv_list['page-status-filterreloadstatus']['descr'] = "Allow access to the 'Status: Filter Reload Status' page."; +$priv_list['page-status-filterreloadstatus']['name'] = gettext("WebCfg - Status: Filter Reload Status page"); +$priv_list['page-status-filterreloadstatus']['descr'] = gettext("Allow access to the 'Status: Filter Reload Status' page."); $priv_list['page-status-filterreloadstatus']['match'] = array(); $priv_list['page-status-filterreloadstatus']['match'][] = "status_filter_reload.php*"; $priv_list['page-status-gateways'] = array(); -$priv_list['page-status-gateways']['name'] = "WebCfg - Status: Gateways page"; -$priv_list['page-status-gateways']['descr'] = "Allow access to the 'Status: Gateways' page."; +$priv_list['page-status-gateways']['name'] = gettext("WebCfg - Status: Gateways page"); +$priv_list['page-status-gateways']['descr'] = gettext("Allow access to the 'Status: Gateways' page."); $priv_list['page-status-gateways']['match'] = array(); $priv_list['page-status-gateways']['match'][] = "status_gateways.php*"; $priv_list['page-status-cpuload'] = array(); -$priv_list['page-status-cpuload']['name'] = "WebCfg - Status: CPU load page"; -$priv_list['page-status-cpuload']['descr'] = "Allow access to the 'Status: CPU load' page."; +$priv_list['page-status-cpuload']['name'] = gettext("WebCfg - Status: CPU load page"); +$priv_list['page-status-cpuload']['descr'] = gettext("Allow access to the 'Status: CPU load' page."); $priv_list['page-status-cpuload']['match'] = array(); $priv_list['page-status-cpuload']['match'][] = "status_graph_cpu.php*"; $priv_list['page-status-gatewaygroups'] = array(); -$priv_list['page-status-gatewaygroups']['name'] = "WebCfg - Status: Gateway Groups page"; -$priv_list['page-status-gatewaygroups']['descr'] = "Allow access to the 'Status: Gateway Groups' page."; +$priv_list['page-status-gatewaygroups']['name'] = gettext("WebCfg - Status: Gateway Groups page"); +$priv_list['page-status-gatewaygroups']['descr'] = gettext("Allow access to the 'Status: Gateway Groups' page."); $priv_list['page-status-gatewaygroups']['match'] = array(); $priv_list['page-status-gatewaygroups']['match'][] = "status_gateway_groups.php*"; $priv_list['page-status-interfaces'] = array(); -$priv_list['page-status-interfaces']['name'] = "WebCfg - Status: Interfaces page"; -$priv_list['page-status-interfaces']['descr'] = "Allow access to the 'Status: Interfaces' page."; +$priv_list['page-status-interfaces']['name'] = gettext("WebCfg - Status: Interfaces page"); +$priv_list['page-status-interfaces']['descr'] = gettext("Allow access to the 'Status: Interfaces' page."); $priv_list['page-status-interfaces']['match'] = array(); $priv_list['page-status-interfaces']['match'][] = "status_interfaces.php*"; $priv_list['page-status-openvpn'] = array(); -$priv_list['page-status-openvpn']['name'] = "WebCfg - Status: OpenVPN page"; -$priv_list['page-status-openvpn']['descr'] = "Allow access to the 'Status: OpenVPN' page."; +$priv_list['page-status-openvpn']['name'] = gettext("WebCfg - Status: OpenVPN page"); +$priv_list['page-status-openvpn']['descr'] = gettext("Allow access to the 'Status: OpenVPN' page."); $priv_list['page-status-openvpn']['match'] = array(); $priv_list['page-status-openvpn']['match'][] = "status_openvpn.php*"; $priv_list['page-status-trafficshaper-queues'] = array(); -$priv_list['page-status-trafficshaper-queues']['name'] = "WebCfg - Status: Traffic shaper: Queues page"; -$priv_list['page-status-trafficshaper-queues']['descr'] = "Allow access to the 'Status: Traffic shaper: Queues' page."; +$priv_list['page-status-trafficshaper-queues']['name'] = gettext("WebCfg - Status: Traffic shaper: Queues page"); +$priv_list['page-status-trafficshaper-queues']['descr'] = gettext("Allow access to the 'Status: Traffic shaper: Queues' page."); $priv_list['page-status-trafficshaper-queues']['match'] = array(); $priv_list['page-status-trafficshaper-queues']['match'][] = "status_queues.php*"; $priv_list['page-status-rrdgraphs'] = array(); -$priv_list['page-status-rrdgraphs']['name'] = "WebCfg - Status: RRD Graphs page"; -$priv_list['page-status-rrdgraphs']['descr'] = "Allow access to the 'Status: RRD Graphs' page."; +$priv_list['page-status-rrdgraphs']['name'] = gettext("WebCfg - Status: RRD Graphs page"); +$priv_list['page-status-rrdgraphs']['descr'] = gettext("Allow access to the 'Status: RRD Graphs' page."); $priv_list['page-status-rrdgraphs']['match'] = array(); $priv_list['page-status-rrdgraphs']['match'][] = "status_rrd_graph.php*"; $priv_list['page-status-rrdgraphs']['match'][] = "status_rrd_graph_img.php*"; $priv_list['page-status-rrdgraph-settings'] = array(); -$priv_list['page-status-rrdgraph-settings']['name'] = "WebCfg - Status: RRD Graphs settings page"; -$priv_list['page-status-rrdgraph-settings']['descr'] = "Allow access to the 'Status: RRD Graphs: settings' page."; +$priv_list['page-status-rrdgraph-settings']['name'] = gettext("WebCfg - Status: RRD Graphs settings page"); +$priv_list['page-status-rrdgraph-settings']['descr'] = gettext("Allow access to the 'Status: RRD Graphs: settings' page."); $priv_list['page-status-rrdgraph-settings']['match'] = array(); $priv_list['page-status-rrdgraph-settings']['match'][] = "status_rrd_graph_settings.php*"; $priv_list['page-status-services'] = array(); -$priv_list['page-status-services']['name'] = "WebCfg - Status: Services page"; -$priv_list['page-status-services']['descr'] = "Allow access to the 'Status: Services' page."; +$priv_list['page-status-services']['name'] = gettext("WebCfg - Status: Services page"); +$priv_list['page-status-services']['descr'] = gettext("Allow access to the 'Status: Services' page."); $priv_list['page-status-services']['match'] = array(); $priv_list['page-status-services']['match'][] = "status_services.php*"; $priv_list['page-status-loadbalancer-pool'] = array(); -$priv_list['page-status-loadbalancer-pool']['name'] = "WebCfg - Status: Load Balancer: Pool page"; -$priv_list['page-status-loadbalancer-pool']['descr'] = "Allow access to the 'Status: Load Balancer: Pool' page."; +$priv_list['page-status-loadbalancer-pool']['name'] = gettext("WebCfg - Status: Load Balancer: Pool page"); +$priv_list['page-status-loadbalancer-pool']['descr'] = gettext("Allow access to the 'Status: Load Balancer: Pool' page."); $priv_list['page-status-loadbalancer-pool']['match'] = array(); $priv_list['page-status-loadbalancer-pool']['match'][] = "status_lb_pool.php*"; $priv_list['page-status-loadbalancer-virtualserver'] = array(); -$priv_list['page-status-loadbalancer-virtualserver']['name'] = "WebCfg - Status: Load Balancer: Virtual Server page"; -$priv_list['page-status-loadbalancer-virtualserver']['descr'] = "Allow access to the 'Status: Load Balancer: Virtual Server' page."; +$priv_list['page-status-loadbalancer-virtualserver']['name'] = gettext("WebCfg - Status: Load Balancer: Virtual Server page"); +$priv_list['page-status-loadbalancer-virtualserver']['descr'] = gettext("Allow access to the 'Status: Load Balancer: Virtual Server' page."); $priv_list['page-status-loadbalancer-virtualserver']['match'] = array(); $priv_list['page-status-loadbalancer-virtualserver']['match'][] = "status_lb_vs.php*"; $priv_list['page-status-upnpstatus'] = array(); -$priv_list['page-status-upnpstatus']['name'] = "WebCfg - Status: UPnP Status page"; -$priv_list['page-status-upnpstatus']['descr'] = "Allow access to the 'Status: UPnP Status' page."; +$priv_list['page-status-upnpstatus']['name'] = gettext("WebCfg - Status: UPnP Status page"); +$priv_list['page-status-upnpstatus']['descr'] = gettext("Allow access to the 'Status: UPnP Status' page."); $priv_list['page-status-upnpstatus']['match'] = array(); $priv_list['page-status-upnpstatus']['match'][] = "status_upnp.php*"; $priv_list['page-diagnostics-wirelessstatus'] = array(); -$priv_list['page-diagnostics-wirelessstatus']['name'] = "WebCfg - Status: Wireless page"; -$priv_list['page-diagnostics-wirelessstatus']['descr'] = "Allow access to the 'Status: Wireless' page."; +$priv_list['page-diagnostics-wirelessstatus']['name'] = gettext("WebCfg - Status: Wireless page"); +$priv_list['page-diagnostics-wirelessstatus']['descr'] = gettext("Allow access to the 'Status: Wireless' page."); $priv_list['page-diagnostics-wirelessstatus']['match'] = array(); $priv_list['page-diagnostics-wirelessstatus']['match'][] = "status_wireless.php*"; $priv_list['page-system-generalsetup'] = array(); -$priv_list['page-system-generalsetup']['name'] = "WebCfg - System: General Setup page"; -$priv_list['page-system-generalsetup']['descr'] = "Allow access to the 'System: General Setup' page."; +$priv_list['page-system-generalsetup']['name'] = gettext("WebCfg - System: General Setup page"); +$priv_list['page-system-generalsetup']['descr'] = gettext("Allow access to the 'System: General Setup' page."); $priv_list['page-system-generalsetup']['match'] = array(); $priv_list['page-system-generalsetup']['match'][] = "system.php*"; $priv_list['page-system-advanced-admin'] = array(); -$priv_list['page-system-advanced-admin']['name'] = "WebCfg - System: Advanced: Admin Access Page"; -$priv_list['page-system-advanced-admin']['descr'] = "Allow access to the 'System: Advanced: Admin Access' page."; +$priv_list['page-system-advanced-admin']['name'] = gettext("WebCfg - System: Advanced: Admin Access Page"); +$priv_list['page-system-advanced-admin']['descr'] = gettext("Allow access to the 'System: Advanced: Admin Access' page."); $priv_list['page-system-advanced-admin']['match'] = array(); $priv_list['page-system-advanced-admin']['match'][] = "system_advanced_admin.php*"; $priv_list['page-system-firmware-manualupdate'] = array(); -$priv_list['page-system-firmware-manualupdate']['name'] = "WebCfg - System: Firmware: Manual Update page"; -$priv_list['page-system-firmware-manualupdate']['descr'] = "Allow access to the 'System: Firmware: Manual Update' page."; +$priv_list['page-system-firmware-manualupdate']['name'] = gettext("WebCfg - System: Firmware: Manual Update page"); +$priv_list['page-system-firmware-manualupdate']['descr'] = gettext("Allow access to the 'System: Firmware: Manual Update' page."); $priv_list['page-system-firmware-manualupdate']['match'] = array(); $priv_list['page-system-firmware-manualupdate']['match'][] = "system_firmware.php*"; $priv_list['page-system-firmware-checkforupdate'] = array(); -$priv_list['page-system-firmware-checkforupdate']['name'] = "WebCfg - System: Firmware: Check For Update page"; -$priv_list['page-system-firmware-checkforupdate']['descr'] = "Allow access to the 'System: Firmware: Check For Update' page."; +$priv_list['page-system-firmware-checkforupdate']['name'] = gettext("WebCfg - System: Firmware: Check For Update page"); +$priv_list['page-system-firmware-checkforupdate']['descr'] = gettext("Allow access to the 'System: Firmware: Check For Update' page."); $priv_list['page-system-firmware-checkforupdate']['match'] = array(); $priv_list['page-system-firmware-checkforupdate']['match'][] = "system_firmware_auto.php*"; $priv_list['page-system-advanced-firewall'] = array(); -$priv_list['page-system-advanced-firewall']['name'] = "WebCfg - System: Advanced: Firewall and NAT page"; -$priv_list['page-system-advanced-firewall']['descr'] = "Allow access to the 'System: Advanced: Firewall and NAT' page."; +$priv_list['page-system-advanced-firewall']['name'] = gettext("WebCfg - System: Advanced: Firewall and NAT page"); +$priv_list['page-system-advanced-firewall']['descr'] = gettext("Allow access to the 'System: Advanced: Firewall and NAT' page."); $priv_list['page-system-advanced-firewall']['match'] = array(); $priv_list['page-system-advanced-firewall']['match'][] = "system_advanced.php*"; $priv_list['page-system-advanced-misc'] = array(); -$priv_list['page-system-advanced-misc']['name'] = "WebCfg - System: Advanced: Miscellaneous page"; -$priv_list['page-system-advanced-misc']['descr'] = "Allow access to the 'System: Advanced: Miscellaneous' page."; +$priv_list['page-system-advanced-misc']['name'] = gettext("WebCfg - System: Advanced: Miscellaneous page"); +$priv_list['page-system-advanced-misc']['descr'] = gettext("Allow access to the 'System: Advanced: Miscellaneous' page."); $priv_list['page-system-advanced-misc']['match'] = array(); $priv_list['page-system-advanced-misc']['match'][] = "system_advanced.php*"; $priv_list['page-system-advanced-network'] = array(); -$priv_list['page-system-advanced-network']['name'] = "WebCfg - System: Advanced: Network page"; -$priv_list['page-system-advanced-network']['descr'] = "Allow access to the 'System: Advanced: Networking' page."; +$priv_list['page-system-advanced-network']['name'] = gettext("WebCfg - System: Advanced: Network page"); +$priv_list['page-system-advanced-network']['descr'] = gettext("Allow access to the 'System: Advanced: Networking' page."); $priv_list['page-system-advanced-network']['match'] = array(); $priv_list['page-system-advanced-network']['match'][] = "system_advanced-network.php*"; $priv_list['page-system-advanced-sysctl'] = array(); -$priv_list['page-system-advanced-sysctl']['name'] = "WebCfg - System: Advanced: Tunables page"; -$priv_list['page-system-advanced-sysctl']['descr'] = "Allow access to the 'System: Advanced: Tunables' page."; +$priv_list['page-system-advanced-sysctl']['name'] = gettext("WebCfg - System: Advanced: Tunables page"); +$priv_list['page-system-advanced-sysctl']['descr'] = gettext("Allow access to the 'System: Advanced: Tunables' page."); $priv_list['page-system-advanced-sysctl']['match'] = array(); $priv_list['page-system-advanced-sysctl']['match'][] = "system_advanced-sysctrl.php*"; $priv_list['page-system-authservers'] = array(); -$priv_list['page-system-authservers']['name'] = "WebCfg - System: Authentication Servers"; -$priv_list['page-system-authservers']['descr'] = "Allow access to the 'System: Authentication Servers' page."; +$priv_list['page-system-authservers']['name'] = gettext("WebCfg - System: Authentication Servers"); +$priv_list['page-system-authservers']['descr'] = gettext("Allow access to the 'System: Authentication Servers' page."); $priv_list['page-system-authservers']['match'] = array(); $priv_list['page-system-authservers']['match'][] = "system_authservers.php*"; $priv_list['page-system-camanager'] = array(); -$priv_list['page-system-camanager']['name'] = "WebCfg - System: CA Manager"; -$priv_list['page-system-camanager']['descr'] = "Allow access to the 'System: CA Manager' page."; +$priv_list['page-system-camanager']['name'] = gettext("WebCfg - System: CA Manager"); +$priv_list['page-system-camanager']['descr'] = gettext("Allow access to the 'System: CA Manager' page."); $priv_list['page-system-camanager']['match'] = array(); $priv_list['page-system-camanager']['match'][] = "system_camanager.php*"; $priv_list['page-system-certmanager'] = array(); -$priv_list['page-system-certmanager']['name'] = "WebCfg - System: Certificate Manager"; -$priv_list['page-system-certmanager']['descr'] = "Allow access to the 'System: Certificate Manager' page."; +$priv_list['page-system-certmanager']['name'] = gettext("WebCfg - System: Certificate Manager"); +$priv_list['page-system-certmanager']['descr'] = gettext("Allow access to the 'System: Certificate Manager' page."); $priv_list['page-system-certmanager']['match'] = array(); $priv_list['page-system-certmanager']['match'][] = "system_certmanager.php*"; $priv_list['page-system-firmware-autoupdate'] = array(); -$priv_list['page-system-firmware-autoupdate']['name'] = "WebCfg - System: Firmware: Auto Update page"; -$priv_list['page-system-firmware-autoupdate']['descr'] = "Allow access to the 'System: Firmware: Auto Update' page."; +$priv_list['page-system-firmware-autoupdate']['name'] = gettext("WebCfg - System: Firmware: Auto Update page"); +$priv_list['page-system-firmware-autoupdate']['descr'] = gettext("Allow access to the 'System: Firmware: Auto Update' page."); $priv_list['page-system-firmware-autoupdate']['match'] = array(); $priv_list['page-system-firmware-autoupdate']['match'][] = "system_firmware_check.php*"; $priv_list['page-system-firmware-settings'] = array(); -$priv_list['page-system-firmware-settings']['name'] = "WebCfg - System: Firmware: Settings page"; -$priv_list['page-system-firmware-settings']['descr'] = "Allow access to the 'System: Firmware: Settings' page."; +$priv_list['page-system-firmware-settings']['name'] = gettext("WebCfg - System: Firmware: Settings page"); +$priv_list['page-system-firmware-settings']['descr'] = gettext("Allow access to the 'System: Firmware: Settings' page."); $priv_list['page-system-firmware-settings']['match'] = array(); $priv_list['page-system-firmware-settings']['match'][] = "system_firmware_settings.php*"; $priv_list['page-system-gatewaygroups'] = array(); -$priv_list['page-system-gatewaygroups']['name'] = "WebCfg - System: Gateway Groups page"; -$priv_list['page-system-gatewaygroups']['descr'] = "Allow access to the 'System: Gateway Groups' page."; +$priv_list['page-system-gatewaygroups']['name'] = gettext("WebCfg - System: Gateway Groups page"); +$priv_list['page-system-gatewaygroups']['descr'] = gettext("Allow access to the 'System: Gateway Groups' page."); $priv_list['page-system-gatewaygroups']['match'] = array(); $priv_list['page-system-gatewaygroups']['match'][] = "system_gateway_groups.php*"; $priv_list['page-system-gateways-editgatewaygroups'] = array(); -$priv_list['page-system-gateways-editgatewaygroups']['name'] = "WebCfg - System: Gateways: Edit Gateway Groups page"; -$priv_list['page-system-gateways-editgatewaygroups']['descr'] = "Allow access to the 'System: Gateways: Edit Gateway Groups' page."; +$priv_list['page-system-gateways-editgatewaygroups']['name'] = gettext("WebCfg - System: Gateways: Edit Gateway Groups page"); +$priv_list['page-system-gateways-editgatewaygroups']['descr'] = gettext("Allow access to the 'System: Gateways: Edit Gateway Groups' page."); $priv_list['page-system-gateways-editgatewaygroups']['match'] = array(); $priv_list['page-system-gateways-editgatewaygroups']['match'][] = "system_gateway_groups_edit.php*"; $priv_list['page-system-gateways'] = array(); -$priv_list['page-system-gateways']['name'] = "WebCfg - System: Gateways page"; -$priv_list['page-system-gateways']['descr'] = "Allow access to the 'System: Gateways' page."; +$priv_list['page-system-gateways']['name'] = gettext("WebCfg - System: Gateways page"); +$priv_list['page-system-gateways']['descr'] = gettext("Allow access to the 'System: Gateways' page."); $priv_list['page-system-gateways']['match'] = array(); $priv_list['page-system-gateways']['match'][] = "system_gateways.php*"; $priv_list['page-system-staticroutes'] = array(); -$priv_list['page-system-staticroutes']['name'] = "WebCfg - System: Static Routes page"; -$priv_list['page-system-staticroutes']['descr'] = "Allow access to the 'System: Static Routes' page."; +$priv_list['page-system-staticroutes']['name'] = gettext("WebCfg - System: Static Routes page"); +$priv_list['page-system-staticroutes']['descr'] = gettext("Allow access to the 'System: Static Routes' page."); $priv_list['page-system-staticroutes']['match'] = array(); $priv_list['page-system-staticroutes']['match'][] = "system_routes.php*"; $priv_list['page-pfsensewizardsubsystem'] = array(); -$priv_list['page-pfsensewizardsubsystem']['name'] = "WebCfg - pfSense wizard subsystem page"; -$priv_list['page-pfsensewizardsubsystem']['descr'] = "Allow access to the 'pfSense wizard subsystem' page."; +$priv_list['page-pfsensewizardsubsystem']['name'] = gettext("WebCfg - pfSense wizard subsystem page"); +$priv_list['page-pfsensewizardsubsystem']['descr'] = gettext("Allow access to the 'pfSense wizard subsystem' page."); $priv_list['page-pfsensewizardsubsystem']['match'] = array(); $priv_list['page-pfsensewizardsubsystem']['match'][] = "wizard.php*"; $priv_list['page-system-gateways-editgateway'] = array(); -$priv_list['page-system-gateways-editgateway']['name'] = "WebCfg - System: Gateways: Edit Gateway page"; -$priv_list['page-system-gateways-editgateway']['descr'] = "Allow access to the 'System: Gateways: Edit Gateway' page."; +$priv_list['page-system-gateways-editgateway']['name'] = gettext("WebCfg - System: Gateways: Edit Gateway page"); +$priv_list['page-system-gateways-editgateway']['descr'] = gettext("Allow access to the 'System: Gateways: Edit Gateway' page."); $priv_list['page-system-gateways-editgateway']['match'] = array(); $priv_list['page-system-gateways-editgateway']['match'][] = "system_gateways_edit.php*"; $priv_list['page-system-groupmanager-addprivs'] = array(); -$priv_list['page-system-groupmanager-addprivs']['name'] = "WebCfg - System: Group Manager: Add Privileges page"; -$priv_list['page-system-groupmanager-addprivs']['descr'] = "Allow access to the 'System: Group Manager: Add Privileges' page."; +$priv_list['page-system-groupmanager-addprivs']['name'] = gettext("WebCfg - System: Group Manager: Add Privileges page"); +$priv_list['page-system-groupmanager-addprivs']['descr'] = gettext("Allow access to the 'System: Group Manager: Add Privileges' page."); $priv_list['page-system-groupmanager-addprivs']['match'] = array(); $priv_list['page-system-groupmanager-addprivs']['match'][] = "system_groupmanager_addprivs.php*"; $priv_list['page-system-staticroutes-editroute'] = array(); -$priv_list['page-system-staticroutes-editroute']['name'] = "WebCfg - System: Static Routes: Edit route page"; -$priv_list['page-system-staticroutes-editroute']['descr'] = "Allow access to the 'System: Static Routes: Edit route' page."; +$priv_list['page-system-staticroutes-editroute']['name'] = gettext("WebCfg - System: Static Routes: Edit route page"); +$priv_list['page-system-staticroutes-editroute']['descr'] = gettext("Allow access to the 'System: Static Routes: Edit route' page."); $priv_list['page-system-staticroutes-editroute']['match'] = array(); $priv_list['page-system-staticroutes-editroute']['match'][] = "system_routes_edit.php*"; $priv_list['page-system-usermanager'] = array(); -$priv_list['page-system-usermanager']['name'] = "WebCfg - System: User Manager page"; -$priv_list['page-system-usermanager']['descr'] = "Allow access to the 'System: User Manager' page."; +$priv_list['page-system-usermanager']['name'] = gettext("WebCfg - System: User Manager page"); +$priv_list['page-system-usermanager']['descr'] = gettext("Allow access to the 'System: User Manager' page."); $priv_list['page-system-usermanager']['match'] = array(); $priv_list['page-system-usermanager']['match'][] = "system_usermanager.php*"; $priv_list['page-system-usermanager_addcert'] = array(); -$priv_list['page-system-usermanager_addcert']['name'] = "WebCfg - System: User Manager: Add Certificate"; -$priv_list['page-system-usermanager_addcert']['descr'] = "Allow access to the 'User Manager: Add Certificate' page."; +$priv_list['page-system-usermanager_addcert']['name'] = gettext("WebCfg - System: User Manager: Add Certificate"); +$priv_list['page-system-usermanager_addcert']['descr'] = gettext("Allow access to the 'User Manager: Add Certificate' page."); $priv_list['page-system-usermanager_addcert']['match'] = array(); $priv_list['page-system-usermanager_addcert']['match'][] = "system_usermanager_addcert.php*"; $priv_list['page-system-usermanager-addprivs'] = array(); -$priv_list['page-system-usermanager-addprivs']['name'] = "WebCfg - System: User Manager: Add Privileges page"; -$priv_list['page-system-usermanager-addprivs']['descr'] = "Allow access to the 'System: User Manager: Add Privileges' page."; +$priv_list['page-system-usermanager-addprivs']['name'] = gettext("WebCfg - System: User Manager: Add Privileges page"); +$priv_list['page-system-usermanager-addprivs']['descr'] = gettext("Allow access to the 'System: User Manager: Add Privileges' page."); $priv_list['page-system-usermanager-addprivs']['match'] = array(); $priv_list['page-system-usermanager-addprivs']['match'][] = "system_usermanager_addprivs.php*"; $priv_list['page-upload_progress'] = array(); -$priv_list['page-upload_progress']['name'] = "WebCfg - System: Firmware: Manual Update page (progress bar)"; -$priv_list['page-upload_progress']['descr'] = "Allow access to the 'System: Firmware: Manual Update: Progress bar' page."; +$priv_list['page-upload_progress']['name'] = gettext("WebCfg - System: Firmware: Manual Update page (progress bar)"); +$priv_list['page-upload_progress']['descr'] = gettext("Allow access to the 'System: Firmware: Manual Update: Progress bar' page."); $priv_list['page-upload_progress']['match'] = array(); $priv_list['page-upload_progress']['match'][] = "upload_progress*"; $priv_list['page-services-captiveportal-editallowedips'] = array(); -$priv_list['page-services-captiveportal-editallowedips']['name'] = "WebCfg - Services: Captive portal: Edit Allowed IPs page"; -$priv_list['page-services-captiveportal-editallowedips']['descr'] = "Allow access to the 'Services: Captive portal: Edit Allowed IPs' page."; +$priv_list['page-services-captiveportal-editallowedips']['name'] = gettext("WebCfg - Services: Captive portal: Edit Allowed IPs page"); +$priv_list['page-services-captiveportal-editallowedips']['descr'] = gettext("Allow access to the 'Services: Captive portal: Edit Allowed IPs' page."); $priv_list['page-services-captiveportal-editallowedips']['match'] = array(); $priv_list['page-services-captiveportal-editallowedips']['match'][] = "services_captiveportal_ip_edit.php*"; $priv_list['page-services-dnsforwarder-editdomainoverride'] = array(); -$priv_list['page-services-dnsforwarder-editdomainoverride']['name'] = "WebCfg - Services: DNS Forwarder: Edit Domain Override page"; -$priv_list['page-services-dnsforwarder-editdomainoverride']['descr'] = "Allow access to the 'Services: DNS Forwarder: Edit Domain Override' page."; +$priv_list['page-services-dnsforwarder-editdomainoverride']['name'] = gettext("WebCfg - Services: DNS Forwarder: Edit Domain Override page"); +$priv_list['page-services-dnsforwarder-editdomainoverride']['descr'] = gettext("Allow access to the 'Services: DNS Forwarder: Edit Domain Override' page."); $priv_list['page-services-dnsforwarder-editdomainoverride']['match'] = array(); $priv_list['page-services-dnsforwarder-editdomainoverride']['match'][] = "services_dnsmasq_domainoverride_edit.php*"; $priv_list['page-services-pppoeserver-user-edit'] = array(); -$priv_list['page-services-pppoeserver-user-edit']['name'] = "WebCfg - Services: PPPoE Server: User: Edit page"; -$priv_list['page-services-pppoeserver-user-edit']['descr'] = "Allow access to the 'Services: PPPoE Server: User: Edit' page."; +$priv_list['page-services-pppoeserver-user-edit']['name'] = gettext("WebCfg - Services: PPPoE Server: User: Edit page"); +$priv_list['page-services-pppoeserver-user-edit']['descr'] = gettext("Allow access to the 'Services: PPPoE Server: User: Edit' page."); $priv_list['page-services-pppoeserver-user-edit']['match'] = array(); $priv_list['page-services-pppoeserver-user-edit']['match'][] = "vpn_pppoe_users_edit.php*"; $priv_list['page-hidden-uploadconfiguration'] = array(); -$priv_list['page-hidden-uploadconfiguration']['name'] = "WebCfg - Hidden: Upload Configuration page"; -$priv_list['page-hidden-uploadconfiguration']['descr'] = "Allow access to the 'Hidden: Upload Configuration' page."; +$priv_list['page-hidden-uploadconfiguration']['name'] = gettext("WebCfg - Hidden: Upload Configuration page"); +$priv_list['page-hidden-uploadconfiguration']['descr'] = gettext("Allow access to the 'Hidden: Upload Configuration' page."); $priv_list['page-hidden-uploadconfiguration']['match'] = array(); $priv_list['page-hidden-uploadconfiguration']['match'][] = "uploadconfig.php*"; $priv_list['page-vpn-ipsec'] = array(); -$priv_list['page-vpn-ipsec']['name'] = "WebCfg - VPN: IPsec page"; -$priv_list['page-vpn-ipsec']['descr'] = "Allow access to the 'VPN: IPsec' page."; +$priv_list['page-vpn-ipsec']['name'] = gettext("WebCfg - VPN: IPsec page"); +$priv_list['page-vpn-ipsec']['descr'] = gettext("Allow access to the 'VPN: IPsec' page."); $priv_list['page-vpn-ipsec']['match'] = array(); $priv_list['page-vpn-ipsec']['match'][] = "vpn_ipsec.php*"; $priv_list['page-vpn-ipsec-mobile'] = array(); -$priv_list['page-vpn-ipsec-mobile']['name'] = "WebCfg - VPN: IPsec: Mobile page"; -$priv_list['page-vpn-ipsec-mobile']['descr'] = "Allow access to the 'VPN: IPsec: Mobile' page."; +$priv_list['page-vpn-ipsec-mobile']['name'] = gettext("WebCfg - VPN: IPsec: Mobile page"); +$priv_list['page-vpn-ipsec-mobile']['descr'] = gettext("Allow access to the 'VPN: IPsec: Mobile' page."); $priv_list['page-vpn-ipsec-mobile']['match'] = array(); $priv_list['page-vpn-ipsec-mobile']['match'][] = "vpn_ipsec_mobile.php*"; $priv_list['page-vpn-ipsec-editphase1'] = array(); -$priv_list['page-vpn-ipsec-editphase1']['name'] = "WebCfg - VPN: IPsec: Edit Phase 1 page"; -$priv_list['page-vpn-ipsec-editphase1']['descr'] = "Allow access to the 'VPN: IPsec: Edit Phase 1' page."; +$priv_list['page-vpn-ipsec-editphase1']['name'] = gettext("WebCfg - VPN: IPsec: Edit Phase 1 page"); +$priv_list['page-vpn-ipsec-editphase1']['descr'] = gettext("Allow access to the 'VPN: IPsec: Edit Phase 1' page."); $priv_list['page-vpn-ipsec-editphase1']['match'] = array(); $priv_list['page-vpn-ipsec-editphase1']['match'][] = "vpn_ipsec_phase1.php*"; $priv_list['page-vpn-ipsec-editphase2'] = array(); -$priv_list['page-vpn-ipsec-editphase2']['name'] = "WebCfg - VPN: IPsec: Edit Phase 2 page"; -$priv_list['page-vpn-ipsec-editphase2']['descr'] = "Allow access to the 'VPN: IPsec: Edit Phase 2' page."; +$priv_list['page-vpn-ipsec-editphase2']['name'] = gettext("WebCfg - VPN: IPsec: Edit Phase 2 page"); +$priv_list['page-vpn-ipsec-editphase2']['descr'] = gettext("Allow access to the 'VPN: IPsec: Edit Phase 2' page."); $priv_list['page-vpn-ipsec-editphase2']['match'] = array(); $priv_list['page-vpn-ipsec-editphase2']['match'][] = "vpn_ipsec_phase2.php*"; $priv_list['page-vpn-vpnl2tp'] = array(); -$priv_list['page-vpn-vpnl2tp']['name'] = "WebCfg - VPN: VPN L2TP page"; -$priv_list['page-vpn-vpnl2tp']['descr'] = "Allow access to the 'VPN: VPN L2TP' page."; +$priv_list['page-vpn-vpnl2tp']['name'] = gettext("WebCfg - VPN: VPN L2TP page"); +$priv_list['page-vpn-vpnl2tp']['descr'] = gettext("Allow access to the 'VPN: VPN L2TP' page."); $priv_list['page-vpn-vpnl2tp']['match'] = array(); $priv_list['page-vpn-vpnl2tp']['match'][] = "vpn_l2tp.php*"; $priv_list['page-vpn-vpnl2tp-users'] = array(); -$priv_list['page-vpn-vpnl2tp-users']['name'] = "WebCfg - VPN: VPN L2TP : Users page"; -$priv_list['page-vpn-vpnl2tp-users']['descr'] = "Allow access to the 'VPN: VPN L2TP : Users' page."; +$priv_list['page-vpn-vpnl2tp-users']['name'] = gettext("WebCfg - VPN: VPN L2TP : Users page"); +$priv_list['page-vpn-vpnl2tp-users']['descr'] = gettext("Allow access to the 'VPN: VPN L2TP : Users' page."); $priv_list['page-vpn-vpnl2tp-users']['match'] = array(); $priv_list['page-vpn-vpnl2tp-users']['match'][] = "vpn_l2tp_users.php*"; $priv_list['page-vpn-vpnl2tp-users-edit'] = array(); -$priv_list['page-vpn-vpnl2tp-users-edit']['name'] = "WebCfg - VPN: VPN L2TP : Users : Edit page"; -$priv_list['page-vpn-vpnl2tp-users-edit']['descr'] = "Allow access to the 'VPN: VPN L2TP : Users : Edit' page."; +$priv_list['page-vpn-vpnl2tp-users-edit']['name'] = gettext("WebCfg - VPN: VPN L2TP : Users : Edit page"); +$priv_list['page-vpn-vpnl2tp-users-edit']['descr'] = gettext("Allow access to the 'VPN: VPN L2TP : Users : Edit' page."); $priv_list['page-vpn-vpnl2tp-users-edit']['match'] = array(); $priv_list['page-vpn-vpnl2tp-users-edit']['match'][] = "vpn_l2tp_users_edit.php*"; $priv_list['page-openvpn-client'] = array(); -$priv_list['page-openvpn-client']['name'] = "WebCfg - OpenVPN: Client page"; -$priv_list['page-openvpn-client']['descr'] = "Allow access to the 'OpenVPN: Client' page."; +$priv_list['page-openvpn-client']['name'] = gettext("WebCfg - OpenVPN: Client page"); +$priv_list['page-openvpn-client']['descr'] = gettext("Allow access to the 'OpenVPN: Client' page."); $priv_list['page-openvpn-client']['match'] = array(); $priv_list['page-openvpn-client']['match'][] = "vpn_openvpn_client.php*"; $priv_list['page-openvpn-csc'] = array(); -$priv_list['page-openvpn-csc']['name'] = "WebCfg - OpenVPN: Client Specific Override page"; -$priv_list['page-openvpn-csc']['descr'] = "Allow access to the 'OpenVPN: Client Specific Override' page."; +$priv_list['page-openvpn-csc']['name'] = gettext("WebCfg - OpenVPN: Client Specific Override page"); +$priv_list['page-openvpn-csc']['descr'] = gettext("Allow access to the 'OpenVPN: Client Specific Override' page."); $priv_list['page-openvpn-csc']['match'] = array(); $priv_list['page-openvpn-csc']['match'][] = "vpn_openvpn_csc.php*"; $priv_list['page-openvpn-server'] = array(); -$priv_list['page-openvpn-server']['name'] = "WebCfg - OpenVPN: Server page"; -$priv_list['page-openvpn-server']['descr'] = "Allow access to the 'OpenVPN: Server' page."; +$priv_list['page-openvpn-server']['name'] = gettext("WebCfg - OpenVPN: Server page"); +$priv_list['page-openvpn-server']['descr'] = gettext("Allow access to the 'OpenVPN: Server' page."); $priv_list['page-openvpn-server']['match'] = array(); $priv_list['page-openvpn-server']['match'][] = "vpn_openvpn_server.php*"; $priv_list['page-services-pppoeserver'] = array(); -$priv_list['page-services-pppoeserver']['name'] = "WebCfg - Services: PPPoE Server page"; -$priv_list['page-services-pppoeserver']['descr'] = "Allow access to the 'Services: PPPoE Server' page."; +$priv_list['page-services-pppoeserver']['name'] = gettext("WebCfg - Services: PPPoE Server page"); +$priv_list['page-services-pppoeserver']['descr'] = gettext("Allow access to the 'Services: PPPoE Server' page."); $priv_list['page-services-pppoeserver']['match'] = array(); $priv_list['page-services-pppoeserver']['match'][] = "vpn_pppoe.php*"; $priv_list['page-services-pppoeserver-users'] = array(); -$priv_list['page-services-pppoeserver-users']['name'] = "WebCfg - Services: PPPoE Server: Users page"; -$priv_list['page-services-pppoeserver-users']['descr'] = "Allow access to the 'Services: PPPoE Server: Users' page."; +$priv_list['page-services-pppoeserver-users']['name'] = gettext("WebCfg - Services: PPPoE Server: Users page"); +$priv_list['page-services-pppoeserver-users']['descr'] = gettext("Allow access to the 'Services: PPPoE Server: Users' page."); $priv_list['page-services-pppoeserver-users']['match'] = array(); $priv_list['page-services-pppoeserver-users']['match'][] = "vpn_pppoe_users.php*"; $priv_list['page-vpn-vpnpptp'] = array(); -$priv_list['page-vpn-vpnpptp']['name'] = "WebCfg - VPN: VPN PPTP page"; -$priv_list['page-vpn-vpnpptp']['descr'] = "Allow access to the 'VPN: VPN PPTP' page."; +$priv_list['page-vpn-vpnpptp']['name'] = gettext("WebCfg - VPN: VPN PPTP page"); +$priv_list['page-vpn-vpnpptp']['descr'] = gettext("Allow access to the 'VPN: VPN PPTP' page."); $priv_list['page-vpn-vpnpptp']['match'] = array(); $priv_list['page-vpn-vpnpptp']['match'][] = "vpn_pptp.php*"; $priv_list['page-vpn-vpnpptp-users'] = array(); -$priv_list['page-vpn-vpnpptp-users']['name'] = "WebCfg - VPN: VPN PPTP: Users page"; -$priv_list['page-vpn-vpnpptp-users']['descr'] = "Allow access to the 'VPN: VPN PPTP: Users' page."; +$priv_list['page-vpn-vpnpptp-users']['name'] = gettext("WebCfg - VPN: VPN PPTP: Users page"); +$priv_list['page-vpn-vpnpptp-users']['descr'] = gettext("Allow access to the 'VPN: VPN PPTP: Users' page."); $priv_list['page-vpn-vpnpptp-users']['match'] = array(); $priv_list['page-vpn-vpnpptp-users']['match'][] = "vpn_pptp_users.php*"; $priv_list['page-vpn-vpnpptp-user-edit'] = array(); -$priv_list['page-vpn-vpnpptp-user-edit']['name'] = "WebCfg - VPN: VPN PPTP: User: Edit page"; -$priv_list['page-vpn-vpnpptp-user-edit']['descr'] = "Allow access to the 'VPN: VPN PPTP: User: Edit' page."; +$priv_list['page-vpn-vpnpptp-user-edit']['name'] = gettext("WebCfg - VPN: VPN PPTP: User: Edit page"); +$priv_list['page-vpn-vpnpptp-user-edit']['descr'] = gettext("Allow access to the 'VPN: VPN PPTP: User: Edit' page."); $priv_list['page-vpn-vpnpptp-user-edit']['match'] = array(); $priv_list['page-vpn-vpnpptp-user-edit']['match'][] = "vpn_pptp_users_edit.php*"; $priv_list['page-firewall-nat-outbound-edit'] = array(); -$priv_list['page-firewall-nat-outbound-edit']['name'] = "WebCfg - Firewall: NAT: Outbound: Edit page"; -$priv_list['page-firewall-nat-outbound-edit']['descr'] = "Allow access to the 'Firewall: NAT: Outbound: Edit' page."; +$priv_list['page-firewall-nat-outbound-edit']['name'] = gettext("WebCfg - Firewall: NAT: Outbound: Edit page"); +$priv_list['page-firewall-nat-outbound-edit']['descr'] = gettext("Allow access to the 'Firewall: NAT: Outbound: Edit' page."); $priv_list['page-firewall-nat-outbound-edit']['match'] = array(); $priv_list['page-firewall-nat-outbound-edit']['match'][] = "firewall_nat_out_edit.php*"; $priv_list['page-xmlrpclibrary'] = array(); -$priv_list['page-xmlrpclibrary']['name'] = "WebCfg - XMLRPC Library page"; -$priv_list['page-xmlrpclibrary']['descr'] = "Allow access to the 'XMLRPC Library' page."; +$priv_list['page-xmlrpclibrary']['name'] = gettext("WebCfg - XMLRPC Library page"); +$priv_list['page-xmlrpclibrary']['descr'] = gettext("Allow access to the 'XMLRPC Library' page."); $priv_list['page-xmlrpclibrary']['match'] = array(); $priv_list['page-xmlrpclibrary']['match'][] = "xmlrpc.php*"; $priv_list['page-interfaces-qinq'] = array(); -$priv_list['page-interfaces-qinq']['name'] = "WebCfg - Interfaces: QinQ page"; -$priv_list['page-interfaces-qinq']['descr'] = "Allow access to the 'Interfaces: QinQ' page."; +$priv_list['page-interfaces-qinq']['name'] = gettext("WebCfg - Interfaces: QinQ page"); +$priv_list['page-interfaces-qinq']['descr'] = gettext("Allow access to the 'Interfaces: QinQ' page."); $priv_list['page-interfaces-qinq']['match'] = array(); $priv_list['page-interfaces-qinq']['match'][] = "interfaces_qinq.php*"; $priv_list['page-pkg-mgr-settings'] = array(); -$priv_list['page-pkg-mgr-settings']['name'] = "WebCfg - Packages: Settings page"; -$priv_list['page-pkg-mgr-settings']['descr'] = "Allow access to the 'Packages: Settings' page."; +$priv_list['page-pkg-mgr-settings']['name'] = gettext("WebCfg - Packages: Settings page"); +$priv_list['page-pkg-mgr-settings']['descr'] = gettext("Allow access to the 'Packages: Settings' page."); $priv_list['page-pkg-mgr-settings']['match'] = array(); $priv_list['page-pkg-mgr-settings']['match'][] = "pkg_mgr_settings.php*"; $priv_list['page-system-groupmanager'] = array(); -$priv_list['page-system-groupmanager']['name'] = "WebCfg - System: Group manager page"; -$priv_list['page-system-groupmanager']['descr'] = "Allow access to the 'System: Group manager' page."; +$priv_list['page-system-groupmanager']['name'] = gettext("WebCfg - System: Group manager page"); +$priv_list['page-system-groupmanager']['descr'] = gettext("Allow access to the 'System: Group manager' page."); $priv_list['page-system-groupmanager']['match'] = array(); $priv_list['page-system-groupmanager']['match'][] = "system_groupmanager.php*"; $priv_list['page-diag-showbogons'] = array(); -$priv_list['page-diag-showbogons']['name'] = "WebCfg - Diagnostics: System Activity"; -$priv_list['page-diag-showbogons']['descr'] = "Allows access to the 'Diagnostics: Show Bogons' page"; +$priv_list['page-diag-showbogons']['name'] = gettext("WebCfg - Diagnostics: System Activity"); +$priv_list['page-diag-showbogons']['descr'] = gettext("Allows access to the 'Diagnostics: Show Bogons' page"); $priv_list['page-diag-showbogons']['match'] = array(); $priv_list['page-diag-showbogons']['match'][] = "diag_showbogons.php"; $priv_list['page-status-trafficgraph'] = array(); -$priv_list['page-status-trafficgraph']['name'] = "WebCfg - Status: Traffic Graph page"; -$priv_list['page-status-trafficgraph']['descr'] = "Allow access to the 'Status: Traffic Graph' page."; +$priv_list['page-status-trafficgraph']['name'] = gettext("WebCfg - Status: Traffic Graph page"); +$priv_list['page-status-trafficgraph']['descr'] = gettext("Allow access to the 'Status: Traffic Graph' page."); $priv_list['page-status-trafficgraph']['match'] = array(); $priv_list['page-status-trafficgraph']['match'][] = "status_graph.php*"; $priv_list['page-status-trafficgraph']['match'][] = "bandwidth_by_ip.php*"; @@ -1115,50 +1115,50 @@ $priv_list['page-status-trafficgraph']['match'][] = "graph.php*"; $priv_list['page-status-trafficgraph']['match'][] = "traffic_graphs.widget.php*"; $priv_list['page-services-captiveportal-vouchers'] = array(); -$priv_list['page-services-captiveportal-vouchers']['name'] = "WebCfg - Services: Captive portal Vouchers page"; -$priv_list['page-services-captiveportal-vouchers']['descr'] = "Allow access to the 'Services: Captive portal Vouchers' page."; +$priv_list['page-services-captiveportal-vouchers']['name'] = gettext("WebCfg - Services: Captive portal Vouchers page"); +$priv_list['page-services-captiveportal-vouchers']['descr'] = gettext("Allow access to the 'Services: Captive portal Vouchers' page."); $priv_list['page-services-captiveportal-vouchers']['match'] = array(); $priv_list['page-services-captiveportal-vouchers']['match'][] = "services_captiveportal_vouchers.php*"; $priv_list['page-services-captiveportal-voucher-edit'] = array(); -$priv_list['page-services-captiveportal-voucher-edit']['name'] = "WebCfg - Services: Captive portal Voucher Rolls page"; -$priv_list['page-services-captiveportal-voucher-edit']['descr'] = "Allow access to the 'Services: Captive portal Edit Voucher Rolls' page."; +$priv_list['page-services-captiveportal-voucher-edit']['name'] = gettext("WebCfg - Services: Captive portal Voucher Rolls page"); +$priv_list['page-services-captiveportal-voucher-edit']['descr'] = gettext("Allow access to the 'Services: Captive portal Edit Voucher Rolls' page."); $priv_list['page-services-captiveportal-voucher-edit']['match'] = array(); $priv_list['page-services-captiveportal-voucher-edit']['match'][] = "services_captiveportal_vouchers_edit.php*"; $priv_list['page-status-captiveportal-test'] = array(); -$priv_list['page-status-captiveportal-test']['name'] = "WebCfg - Status: Captive portal test Vouchers page"; -$priv_list['page-status-captiveportal-test']['descr'] = "Allow access to the 'Status: Captive portal Test Vouchers' page."; +$priv_list['page-status-captiveportal-test']['name'] = gettext("WebCfg - Status: Captive portal test Vouchers page"); +$priv_list['page-status-captiveportal-test']['descr'] = gettext("Allow access to the 'Status: Captive portal Test Vouchers' page."); $priv_list['page-status-captiveportal-test']['match'] = array(); $priv_list['page-status-captiveportal-test']['match'][] = "status_captiveportal_test.php*"; $priv_list['page-status-captiveportal-voucher-rolls'] = array(); -$priv_list['page-status-captiveportal-voucher-rolls']['name'] = "WebCfg - Status: Captive portal Voucher Rolls page"; -$priv_list['page-status-captiveportal-voucher-rolls']['descr'] = "Allow access to the 'Status: Captive portal Voucher Rolls' page."; +$priv_list['page-status-captiveportal-voucher-rolls']['name'] = gettext("WebCfg - Status: Captive portal Voucher Rolls page"); +$priv_list['page-status-captiveportal-voucher-rolls']['descr'] = gettext("Allow access to the 'Status: Captive portal Voucher Rolls' page."); $priv_list['page-status-captiveportal-voucher-rolls']['match'] = array(); $priv_list['page-status-captiveportal-voucher-rolls']['match'][] = "status_captiveportal_voucher_rolls.php*"; $priv_list['page-status-captiveportal-vouchers'] = array(); -$priv_list['page-status-captiveportal-vouchers']['name'] = "WebCfg - Status: Captive portal Vouchers page"; -$priv_list['page-status-captiveportal-vouchers']['descr'] = "Allow access to the 'Status: Captive portal Vouchers' page."; +$priv_list['page-status-captiveportal-vouchers']['name'] = gettext("WebCfg - Status: Captive portal Vouchers page"); +$priv_list['page-status-captiveportal-vouchers']['descr'] = gettext("Allow access to the 'Status: Captive portal Vouchers' page."); $priv_list['page-status-captiveportal-vouchers']['match'] = array(); $priv_list['page-status-captiveportal-vouchers']['match'][] = "status_captiveportal_vouchers.php*"; $priv_list['page-firewall-rules-edit'] = array(); -$priv_list['page-firewall-rules-edit']['name'] = "WebCfg - Firewall: Rules: Edit page"; -$priv_list['page-firewall-rules-edit']['descr'] = "Allow access to the 'Firewall: Rules: Edit' page."; +$priv_list['page-firewall-rules-edit']['name'] = gettext("WebCfg - Firewall: Rules: Edit page"); +$priv_list['page-firewall-rules-edit']['descr'] = gettext("Allow access to the 'Firewall: Rules: Edit' page."); $priv_list['page-firewall-rules-edit']['match'] = array(); $priv_list['page-firewall-rules-edit']['match'][] = "firewall_rules_edit.php*"; $priv_list['page-system-advanced-notifications'] = array(); -$priv_list['page-system-advanced-notifications']['name'] = "WebCfg - System: Advanced: Tunables page"; -$priv_list['page-system-advanced-notifications']['descr'] = "Allow access to the 'System: Advanced: Tunables' page."; +$priv_list['page-system-advanced-notifications']['name'] = gettext("WebCfg - System: Advanced: Tunables page"); +$priv_list['page-system-advanced-notifications']['descr'] = gettext("Allow access to the 'System: Advanced: Tunables' page."); $priv_list['page-system-advanced-notifications']['match'] = array(); $priv_list['page-system-advanced-notifications']['match'][] = "system_advanced-sysctrl.php*"; $priv_list['page-firewall-schedules-edit'] = array(); -$priv_list['page-firewall-schedules-edit']['name'] = "WebCfg - Firewall: Schedules: Edit page"; -$priv_list['page-firewall-schedules-edit']['descr'] = "Allow access to the 'Firewall: Schedules: Edit' page."; +$priv_list['page-firewall-schedules-edit']['name'] = gettext("WebCfg - Firewall: Schedules: Edit page"); +$priv_list['page-firewall-schedules-edit']['descr'] = gettext("Allow access to the 'Firewall: Schedules: Edit' page."); $priv_list['page-firewall-schedules-edit']['match'] = array(); $priv_list['page-firewall-schedules-edit']['match'][] = "firewall_schedule_edit.php*"; -- cgit v1.1 From 93fd3db82b8c5852453dae410cbf47d4f6667151 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Tue, 17 Aug 2010 12:27:06 -0300 Subject: Implement gettext() calls on radius.inc --- etc/inc/radius.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etc/inc/radius.inc b/etc/inc/radius.inc index dddacc3..2c433d1 100644 --- a/etc/inc/radius.inc +++ b/etc/inc/radius.inc @@ -401,13 +401,13 @@ class Auth_RADIUS extends PEAR { { $req = radius_send_request($this->res); if (!$req) { - return $this->raiseError('Error sending request: ' . $this->getError()); + return $this->raiseError(gettext('Error sending request:') . ' ' . $this->getError()); } switch($req) { case RADIUS_ACCESS_ACCEPT: if (is_subclass_of($this, 'auth_radius_acct')) { - return $this->raiseError('RADIUS_ACCESS_ACCEPT is unexpected for accounting'); + return $this->raiseError(gettext('RADIUS_ACCESS_ACCEPT is unexpected for accounting')); } return true; @@ -416,12 +416,12 @@ class Auth_RADIUS extends PEAR { case RADIUS_ACCOUNTING_RESPONSE: if (is_subclass_of($this, 'auth_radius_pap')) { - return $this->raiseError('RADIUS_ACCOUNTING_RESPONSE is unexpected for authentication'); + return $this->raiseError(gettext('RADIUS_ACCOUNTING_RESPONSE is unexpected for authentication')); } return true; default: - return $this->raiseError("Unexpected return value: $req"); + return $this->raiseError(gettext("Unexpected return value:") . $req); } } -- cgit v1.1 From 069503a181bf2a80b32134ec37d0b08d1d5c6c9a Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Tue, 17 Aug 2010 12:48:24 -0300 Subject: Implement gettext() calls on xmlrpc_client.php --- etc/inc/xmlrpc_client.inc | 51 +++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/etc/inc/xmlrpc_client.inc b/etc/inc/xmlrpc_client.inc index bac5e1f..229bb7f 100644 --- a/etc/inc/xmlrpc_client.inc +++ b/etc/inc/xmlrpc_client.inc @@ -166,13 +166,13 @@ $GLOBALS['XML_RPC_err'] = array( * @global array $GLOBALS['XML_RPC_str'] */ $GLOBALS['XML_RPC_str'] = array( - 'unknown_method' => 'Unknown method', - 'invalid_return' => 'Invalid return payload: enable debugging to examine incoming payload', - 'incorrect_params' => 'Incorrect parameters passed to method', - 'introspect_unknown' => 'Can\'t introspect: method unknown', - 'http_error' => 'Didn\'t receive 200 OK from remote server.', - 'not_response_object' => 'The requested method didn\'t return an XML_RPC_Response object.', - 'invalid_request' => 'Invalid request payload', + 'unknown_method' => gettext("Unknown method"), + 'invalid_return' => gettext("Invalid return payload: enable debugging to examine incoming payload"), + 'incorrect_params' => gettext("Incorrect parameters passed to method"), + 'introspect_unknown' => gettext("Can't introspect: method unknown"), + 'http_error' => gettext("Didn't receive 200 OK from remote server."), + 'not_response_object' => gettext("The requested method didn't return an XML_RPC_Response object."), + 'invalid_request' => gettext("Invalid request payload"), ); @@ -295,7 +295,7 @@ function XML_RPC_se($parser_resource, $name, $attrs) if (count($XML_RPC_xh[$parser]['stack']) == 0) { if ($name != 'METHODRESPONSE' && $name != 'METHODCALL') { $XML_RPC_xh[$parser]['isf'] = 2; - $XML_RPC_xh[$parser]['isf_reason'] = 'missing top level xmlrpc element'; + $XML_RPC_xh[$parser]['isf_reason'] = gettext('missing top level xmlrpc element'); return; } } else { @@ -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'] = "xmlrpc element $name cannot be child of {$XML_RPC_xh[$parser]['stack'][0]}"; + $XML_RPC_xh[$parser]['isf_reason'] = sprintf(gettext("xmlrpc element %s cannot be child of %s"), $name, $XML_RPC_xh[$parser]['stack'][0]); return; } } @@ -466,7 +466,7 @@ function XML_RPC_ee($parser_resource, $name) // we have an I4, INT or a DOUBLE // we must check that only 0123456789-. are characters here if (!$GLOBALS['XML_RPC_func_ereg']("^[+-]?[0123456789 \t\.]+$", $XML_RPC_xh[$parser]['ac'])) { - XML_RPC_Base::raiseError('Non-numeric value received in INT or DOUBLE', + XML_RPC_Base::raiseError(gettext('Non-numeric value received in INT or DOUBLE'), XML_RPC_ERROR_NON_NUMERIC_FOUND); $XML_RPC_xh[$parser]['value'] = XML_RPC_ERROR_NON_NUMERIC_FOUND; } else { @@ -889,8 +889,10 @@ class XML_RPC_Client extends XML_RPC_Base { function send($msg, $timeout = 0) { if (!is_a($msg, 'XML_RPC_Message')) { - $this->errstr = 'send()\'s $msg parameter must be an' - . ' XML_RPC_Message object.'; + $this->errstr = sprintf( + gettext( + "send()'s %s parameter must be an XML_RPC_Message object." + ), $msg); $this->raiseError($this->errstr, XML_RPC_ERROR_PROGRAMMING); return 0; } @@ -960,15 +962,15 @@ class XML_RPC_Client extends XML_RPC_Base { * but keep it here for backwards compatibility. */ if (!$fp && $this->proxy) { - $this->raiseError('Connection to proxy server ' + $this->raiseError(gettext('Connection to proxy server ') . $this->proxy . ':' . $this->proxy_port - . ' failed. ' . $this->errstr, + . gettext(' failed. ') . $this->errstr, XML_RPC_ERROR_CONNECTION_FAILED); return 0; } elseif (!$fp) { - $this->raiseError('Connection to RPC server ' + $this->raiseError(gettext('Connection to RPC server ') . $server . ':' . $port - . ' failed. ' . $this->errstr, + . gettext(' failed. ') . $this->errstr, XML_RPC_ERROR_CONNECTION_FAILED); return 0; } @@ -1351,7 +1353,7 @@ class XML_RPC_Message extends XML_RPC_Base if (isset($this->params[$i])) { return $this->params[$i]; } else { - $this->raiseError('The submitted request did not contain this parameter', + $this->raiseError(gettext('The submitted request did not contain this parameter'), XML_RPC_ERROR_INCORRECT_PARAMS); return new XML_RPC_Response(0, $XML_RPC_err['incorrect_params'], $XML_RPC_str['incorrect_params']); @@ -1382,7 +1384,7 @@ class XML_RPC_Message extends XML_RPC_Base function setConvertPayloadEncoding($in) { if ($in && !function_exists('mb_convert_encoding')) { - return $this->raiseError('mb_convert_encoding() is not available', + return $this->raiseError(gettext('mb_convert_encoding() is not available'), XML_RPC_ERROR_PROGRAMMING); } $this->convert_payload_encoding = $in; @@ -1611,14 +1613,15 @@ class XML_RPC_Value extends XML_RPC_Base function addScalar($val, $type = 'string') { if ($this->mytype == 1) { - $this->raiseError('Scalar can have only one value', + $this->raiseError(gettext('Scalar can have only one value'), XML_RPC_ERROR_INVALID_TYPE); return 0; } $typeof = $GLOBALS['XML_RPC_Types'][$type]; if ($typeof != 1) { - $this->raiseError("Not a scalar type (${typeof})", - XML_RPC_ERROR_INVALID_TYPE); + $this->raiseError( + sprintf(gettext("Not a scalar type (%s)"), $typeof), + XML_RPC_ERROR_INVALID_TYPE); return 0; } @@ -1653,7 +1656,7 @@ class XML_RPC_Value extends XML_RPC_Base { if ($this->mytype != 0) { $this->raiseError( - 'Already initialized as a [' . $this->kindOf() . ']', + sprintf(gettext('Already initialized as a [%s]'), $this->kindOf()), XML_RPC_ERROR_ALREADY_INITIALIZED); return 0; } @@ -1669,7 +1672,7 @@ class XML_RPC_Value extends XML_RPC_Base { if ($this->mytype != 0) { $this->raiseError( - 'Already initialized as a [' . $this->kindOf() . ']', + sprintf(gettext('Already initialized as a [%s]'), $this->kindOf()), XML_RPC_ERROR_ALREADY_INITIALIZED); return 0; } @@ -2077,4 +2080,4 @@ function XML_RPC_encode($php_val) * End: */ -?> \ No newline at end of file +?> -- cgit v1.1 From 9eda6186fb788c712b534517f1788bc2522fbc1f Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Tue, 17 Aug 2010 12:54:18 -0300 Subject: Implement gettext() calls on rrd.inc --- etc/inc/rrd.inc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/etc/inc/rrd.inc b/etc/inc/rrd.inc index 96981da..da7f7e4 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("RRD dump failed exited with $dumpret, the error is: $dumpout"); + log_error(sprintf(gettext("RRD dump failed exited with %s, the error is: %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("RRD create failed exited with $rrdcreatereturn, the error is: $rrdcreateoutput"); + log_error(sprintf(gettext("RRD create failed exited with %s, the error is: %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("Import RRD has $numdsold DS values and $numrraold RRA databases, new format RRD has $numdsnew DS values and $numrranew RRA databases"); + log_error(sprintf(gettext("Import RRD has %s DS values and %s RRA databases, new format RRD has %s DS values and %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("The new RRD now has $numdsnew DS values and $numrranew RRA databases"); + log_error(sprintf(gettext("The new RRD now has %s DS values and %s RRA databases"), $numdsnew, $numrranew)); return $rrdoldxml; } @@ -159,7 +159,7 @@ function enable_rrd_graphing() { global $config, $g, $altq_list_queues; if($g['booting']) - echo "Generating RRD graphs..."; + echo gettext("Generating RRD graphs..."); $rrddbpath = "/var/db/rrd/"; $rrdgraphpath = "/usr/local/www/rrd"; @@ -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("RRD restore failed exited with $rrdreturn, the error is: $rrdrestore\n"); + log_error(sprintf(gettext("RRD restore failed exited with %s, the error is: %s%s"), $rrdreturn, $rrdrestore, "\n")); } } } @@ -662,7 +662,7 @@ function enable_rrd_graphing() { $rrdupdatesh .= "sleep 60\n"; $rrdupdatesh .= "done\n"; - log_error("Creating rrd update script"); + log_error(gettext("Creating rrd update script")); /* write the rrd update script */ $updaterrdscript = "{$g['vardb_path']}/rrd/updaterrd.sh"; $fd = fopen("$updaterrdscript", "w"); @@ -686,7 +686,7 @@ function enable_rrd_graphing() { } if($g['booting']) - echo "done.\n"; + echo gettext("done.") . "\n"; } -- cgit v1.1 From b53f56d937a5754bc50b0d680c466a7eba59d960 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Tue, 17 Aug 2010 13:40:14 -0300 Subject: Implement gettext() calls on xmlrpc_server.inc --- etc/inc/xmlrpc_server.inc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/etc/inc/xmlrpc_server.inc b/etc/inc/xmlrpc_server.inc index 8887bdf..ff828e6 100644 --- a/etc/inc/xmlrpc_server.inc +++ b/etc/inc/xmlrpc_server.inc @@ -62,8 +62,8 @@ $GLOBALS['XML_RPC_Server_listMethods_sig'] = array( * docstring for system.listMethods * @global string $GLOBALS['XML_RPC_Server_listMethods_doc'] */ -$GLOBALS['XML_RPC_Server_listMethods_doc'] = 'This method lists all the' - . ' methods that the XML-RPC server knows how to dispatch'; +$GLOBALS['XML_RPC_Server_listMethods_doc'] = gettext('This method lists all the' + . ' methods that the XML-RPC server knows how to dispatch'); /** * signature for system.methodSignature: return = array, @@ -80,10 +80,10 @@ $GLOBALS['XML_RPC_Server_methodSignature_sig'] = array( * docstring for system.methodSignature * @global string $GLOBALS['XML_RPC_Server_methodSignature_doc'] */ -$GLOBALS['XML_RPC_Server_methodSignature_doc'] = 'Returns an array of known' +$GLOBALS['XML_RPC_Server_methodSignature_doc'] = gettext('Returns an array of known' . ' signatures (an array of arrays) for the method name passed. If' . ' no signatures are known, returns a none-array (test for type !=' - . ' array to detect missing signature)'; + . ' array to detect missing signature)'); /** * signature for system.methodHelp: return = string, @@ -100,8 +100,8 @@ $GLOBALS['XML_RPC_Server_methodHelp_sig'] = array( * docstring for methodHelp * @global string $GLOBALS['XML_RPC_Server_methodHelp_doc'] */ -$GLOBALS['XML_RPC_Server_methodHelp_doc'] = 'Returns help text if defined' - . ' for the method passed, otherwise returns an empty string'; +$GLOBALS['XML_RPC_Server_methodHelp_doc'] = gettext('Returns help text if defined' + . ' for the method passed, otherwise returns an empty string'); /** * dispatch map for the automatically declared XML-RPC methods. @@ -685,4 +685,4 @@ class XML_RPC_Server * End: */ -?> \ No newline at end of file +?> -- cgit v1.1 From f1a44a3a98814171d36584d1cd35e1c444ccc55a Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Tue, 17 Aug 2010 13:55:42 -0300 Subject: Implement gettext() calls on services.inc --- etc/inc/services.inc | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/etc/inc/services.inc b/etc/inc/services.inc index de186d0..95d14fc 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -93,7 +93,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("DHCP leases restore failed exited with $dhcpreturn, the error is: $dhcprestore\n"); + log_error(sprintf(gettext("DHCP leases restore failed exited with %s, the error is: %s%s"), $dhcpreturn, $dhcprestore, "\n")); } } } @@ -104,14 +104,14 @@ function services_dhcpd_configure() { $Iflist = get_configured_interface_list(); if ($g['booting']) - echo "Starting DHCP service..."; + echo gettext("Starting DHCP service..."); else sleep(1); /* write dhcpd.conf */ $fd = fopen("{$g['dhcpd_chroot_path']}/etc/dhcpd.conf", "w"); if (!$fd) { - printf("Error: cannot open dhcpd.conf in services_dhcpd_configure().\n"); + printf(gettext("Error: cannot open dhcpd.conf in services_dhcpd_configure().%s"), "\n"); return 1; } @@ -178,7 +178,7 @@ EOD; } } } else { - log_error("Warning! DHCP Failover setup and no CARP virtual IP's defined!"); + log_error(gettext("Warning! DHCP Failover setup and no CARP virtual IP's defined!")); } if($skew > 10) { $type = "secondary"; @@ -377,7 +377,7 @@ EOD; join(" ", $dhcpdifs)); if ($g['booting']) { - print "done.\n"; + print gettext("done.") . "\n"; } return 0; @@ -426,14 +426,14 @@ EOD; $igmpfl = fopen($g['tmp_path'] . "/igmpproxy.conf", "w"); if (!$igmpfl) { - log_error("Could not write Igmpproxy configuration file!"); + log_error(gettext("Could not write Igmpproxy configuration file!")); return; } fwrite($igmpfl, $igmpconf); fclose($igmpfl); mwexec("/usr/local/sbin/igmpproxy -c " . $g['tmp_path'] . "/igmpproxy.conf"); - log_error("Started Igmpproxy service sucsesfully."); + log_error(gettext("Started Igmpproxy service sucsesfully.")); return 0; } @@ -495,7 +495,7 @@ function services_dhcrelay_configure() { return 0; if ($g['booting']) - echo "Starting DHCP relay service..."; + echo gettext("Starting DHCP relay service..."); else sleep(1); @@ -594,7 +594,7 @@ function services_dyndns_configure($int = "") { if (is_array($dyndnscfg)) { if ($g['booting']) - echo "Starting DynDNS clients..."; + echo gettext("Starting DynDNS clients..."); foreach ($dyndnscfg as $dyndns) { if (!empty($int) && $int != $dyndns['interface']) @@ -609,7 +609,7 @@ function services_dyndns_configure($int = "") { } if ($g['booting']) - echo "done.\n"; + echo gettext("done.") . "\n"; } return 0; @@ -630,7 +630,7 @@ function services_dnsmasq_configure() { if (isset($config['dnsmasq']['enable'])) { if ($g['booting']) - echo "Starting DNS forwarder..."; + echo gettext("Starting DNS forwarder..."); else sleep(1); @@ -667,7 +667,7 @@ function services_dnsmasq_configure() { mwexec("/usr/local/sbin/dnsmasq --local-ttl 1 --all-servers {$dns_rebind} --dns-forward-max=5000 --cache-size=10000 {$args}"); if ($g['booting']) - echo "done.\n"; + echo gettext("done.") . "\n"; } if (!$g['booting']) { @@ -693,12 +693,12 @@ function services_snmpd_configure() { if (isset($config['snmpd']['enable'])) { if ($g['booting']) - echo "Starting SNMP daemon... "; + echo gettext("Starting SNMP daemon... "); /* generate snmpd.conf */ $fd = fopen("{$g['varetc_path']}/snmpd.conf", "w"); if (!$fd) { - printf("Error: cannot open snmpd.conf in services_snmpd_configure().\n"); + printf(gettext("Error: cannot open snmpd.conf in services_snmpd_configure().%s"),"\n"); return 1; } @@ -846,7 +846,7 @@ EOD; "{$bindlan} -p {$g['varrun_path']}/snmpd.pid"); if ($g['booting']) - echo "done.\n"; + echo gettext("done.") . "\n"; } return 0; @@ -1241,8 +1241,8 @@ function configure_cron() { if (is_array($config['cron']['item'])) { $crontab_contents .= "#\n"; - $crontab_contents .= "# pfSense specific crontab entries\n"; - $crontab_contents .= "# Created: " . date("F j, Y, g:i a") . "\n"; + $crontab_contents .= "# " . gettext("pfSense specific crontab entries") . "\n"; + $crontab_contents .= "# " .gettext( "Created:") . " " . date("F j, Y, g:i a") . "\n"; $crontab_contents .= "#\n"; foreach ($config['cron']['item'] as $item) { @@ -1256,8 +1256,8 @@ function configure_cron() { } $crontab_contents .= "\n#\n"; - $crontab_contents .= "# If possible do not add items to this file manually.\n"; - $crontab_contents .= "# If you do so, this file must be terminated with a blank line (e.g. new line)\n"; + $crontab_contents .= "# " . gettext("If possible do not add items to this file manually.") . "\n"; + $crontab_contents .= "# " . gettext("If you do so, this file must be terminated with a blank line (e.g. new line)") . "\n"; $crontab_contents .= "#\n\n"; } @@ -1294,10 +1294,10 @@ function upnp_start() { if($config['installedpackages']['miniupnpd']['config'][0]['enable']) { if($g['booting']) { - echo "Starting UPnP service... "; + echo gettext("Starting UPnP service... "); require_once('/usr/local/pkg/miniupnpd.inc'); sync_package_miniupnpd(); - echo "done.\n"; + echo gettext("done.") . "\n"; } else { upnp_action('start'); @@ -1333,15 +1333,15 @@ function install_cron_job($command, $active=false, $minute="0", $hour="*", $mont $cron_item['command'] = $command; if(!$is_installed) { $config['cron']['item'][] = $cron_item; - write_config("Installed cron job for {$command}"); + write_config(sprintf(gettext("Installed cron job for %s"), $command)); } else { $config['cron']['item'][$x] = $cron_item; - write_config("Updated cron job for {$command}"); + write_config(sprintf(gettext("Updated cron job for %s"), $command)); } } else { if(($is_installed == true) && ($x > 0)) { unset($config['cron']['item'][$x]); - write_config("Remvoed cron job for {$command}"); + write_config(sprintf(gettext("Remvoed cron job for %s"), $command)); } } configure_cron(); -- cgit v1.1 From 5cfa35dfe4a498d9aa953f8d72399cb2a7eb077f Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Tue, 17 Aug 2010 14:17:46 -0300 Subject: Fix syntax --- etc/inc/xmlreader.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/inc/xmlreader.inc b/etc/inc/xmlreader.inc index 9c6eb99..a215bc9 100644 --- a/etc/inc/xmlreader.inc +++ b/etc/inc/xmlreader.inc @@ -126,7 +126,7 @@ function parse_xml_config_raw($cffile, $rootobj, $isstring = "false") { add_elements($parsedcfg, $par); $par->close(); } else - log_error(sprintf(gettext("Error returned while trying to parse %s"), $cffile")); + log_error(sprintf(gettext("Error returned while trying to parse %s"), $cffile)); return $parsedcfg[$rootobj]; } -- cgit v1.1 From 0b8993076e3188de90e63f769c82d6a68ec1e21e Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Tue, 17 Aug 2010 14:36:38 -0300 Subject: Implement gettext() calls on service-utils.inc --- etc/inc/service-utils.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/inc/service-utils.inc b/etc/inc/service-utils.inc index 02b235c..cc342c5 100644 --- a/etc/inc/service-utils.inc +++ b/etc/inc/service-utils.inc @@ -41,7 +41,7 @@ function write_rcfile($params) { $fileprefix = "/usr/local/etc/rc.d/"; if(!(is_writable($fileprefix . $params['file']) or $params['start'])) return false; - $towrite .= "#!/bin/sh\n# This file was automatically generated\n# by the {$g['product_website']} service handler.\n\n"; + $towrite .= "#!/bin/sh\n# " . gettext("This file was automatically generated") . "\n# " . gettext("by the") . " {$g['product_website']} service handler.\n\n"; /* write our rc functions */ $towrite .= "rc_start() {\n\t" . $params['start'] . "\n}\n\n"; if($params['stop']) { -- cgit v1.1 From 847673aede29142424c282121b79594ea62688cb Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Tue, 17 Aug 2010 15:29:50 -0300 Subject: Implement gettext() calls on smtp.inc --- etc/inc/smtp.inc | 96 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/etc/inc/smtp.inc b/etc/inc/smtp.inc index 4f39682..7276ed8 100644 --- a/etc/inc/smtp.inc +++ b/etc/inc/smtp.inc @@ -89,10 +89,10 @@ class smtp_class { $status=socket_get_status($this->connection); if($status["timed_out"]) - $this->error.=": data access time out"; + $this->error.=gettext(": data access time out"); elseif($status["eof"]) { - $this->error.=": the server disconnected"; + $this->error.=gettext(": the server disconnected"); $this->disconnected_error=1; } } @@ -104,13 +104,13 @@ class smtp_class { if(feof($this->connection)) { - $this->error="reached the end of data while reading from the SMTP server conection"; + $this->error=gettext("reached the end of data while reading from the SMTP server conection"); return(""); } if(GetType($data=@fgets($this->connection,100))!="string" || strlen($data)==0) { - $this->SetDataAccessError("it was not possible to read line from the SMTP server"); + $this->SetDataAccessError(gettext("it was not possible to read line from the SMTP server")); return(""); } $line.=$data; @@ -132,7 +132,7 @@ class smtp_class $this->OutputDebug("C $line"); if(!@fputs($this->connection,"$line\r\n")) { - $this->SetDataAccessError("it was not possible to send a line to the SMTP server"); + $this->SetDataAccessError(gettext("it was not possible to send a line to the SMTP server")); return(0); } return(1); @@ -146,7 +146,7 @@ class smtp_class $this->OutputDebug("C $data"); if(!@fputs($this->connection,$data)) { - $this->SetDataAccessError("it was not possible to send data to the SMTP server"); + $this->SetDataAccessError(gettext("it was not possible to send data to the SMTP server")); return(0); } } @@ -218,10 +218,10 @@ class smtp_class $version=explode(".",function_exists("phpversion") ? phpversion() : "3.0.7"); $php_version=intval($version[0])*1000000+intval($version[1])*1000+intval($version[2]); if($php_version<4003000) - return("establishing SSL connections requires at least PHP version 4.3.0"); + return(gettext("establishing SSL connections requires at least PHP version 4.3.0")); if(!function_exists("extension_loaded") || !extension_loaded("openssl")) - return("establishing SSL connections requires the OpenSSL extension enabled"); + return(gettext("establishing SSL connections requires the OpenSSL extension enabled")); } if(ereg('^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$',$domain)) $ip=$domain; @@ -230,30 +230,30 @@ class smtp_class if($this->debug) $this->OutputDebug($resolve_message); if(!strcmp($ip=@gethostbyname($domain),$domain)) - return("could not resolve host \"".$domain."\""); + return(sprintf(gettext("could not resolve host \"%s\""), $domain)); } if(strlen($this->exclude_address) && !strcmp(@gethostbyname($this->exclude_address),$ip)) - return("domain \"".$domain."\" resolved to an address excluded to be valid"); + return(sprintf(gettext("domain \"%s\" resolved to an address excluded to be valid"), $domain)); if($this->debug) - $this->OutputDebug("Connecting to host address \"".$ip."\" port ".$port."..."); + $this->OutputDebug(sprintf(gettext("Connecting to host address \"%s\" port %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) : "??"); switch($error) { case "-3": - return("-3 socket could not be created"); + return(gettext("-3 socket could not be created")); case "-4": - return("-4 dns lookup on hostname \"".$domain."\" failed"); + return(sprintf(gettext("-4 dns lookup on hostname \"%s\" failed"), $domain)); case "-5": - return("-5 connection refused or timed out"); + return(gettext("-5 connection refused or timed out")); case "-6": - return("-6 fdopen() call failed"); + return(gettext("-6 fdopen() call failed")); case "-7": - return("-7 setvbuf() call failed"); + return(gettext("-7 setvbuf() call failed")); } - return("could not connect to the host \"".$domain."\": ".$error); + return(sprintf(gettext("could not connect to the host \"%s\": %s"), $domain, $error)); } Function SASLAuthenticate($mechanisms, $credentials, &$authenticated, &$mechanism) @@ -262,7 +262,7 @@ class smtp_class if(!function_exists("class_exists") || !class_exists("sasl_client_class")) { - $this->error="it is not possible to authenticate using the specified mechanism because the SASL library class is not loaded"; + $this->error=gettext("it is not possible to authenticate using the specified mechanism because the SASL library class is not loaded"); return(0); } $sasl=new sasl_client_class; @@ -286,19 +286,19 @@ class smtp_class case SASL_NOMECH: if(strlen($this->authentication_mechanism)) { - $this->error="authenticated mechanism ".$this->authentication_mechanism." may not be used: ".$sasl->error; + $this->error=printf(gettext("authenticated mechanism %s may not be used: %s"), $this->authentication_mechanism, $sasl->error); return(0); } break; default: - $this->error="Could not start the SASL authentication client: ".$sasl->error; + $this->error=gettext("Could not start the SASL authentication client:") . " ".$sasl->error; return(0); } if(strlen($mechanism=$sasl->mechanism)) { if($this->PutLine("AUTH ".$sasl->mechanism.(IsSet($message) ? " ".base64_encode($message) : ""))==0) { - $this->error="Could not send the AUTH command"; + $this->error=gettext("Could not send the AUTH command"); return(0); } if(!$this->VerifyResultLines(array("235","334"),$responses)) @@ -313,7 +313,7 @@ class smtp_class $response=base64_decode($responses[0]); break; default: - $this->error="Authentication error: ".$responses[0]; + $this->error=gettext("Authentication error:") . " ".$responses[0]; return(0); } for(;!$authenticated;) @@ -328,7 +328,7 @@ class smtp_class case SASL_CONTINUE: if($this->PutLine(base64_encode($message))==0) { - $this->error="Could not send the authentication step message"; + $this->error=gettext("Could not send the authentication step message"); return(0); } if(!$this->VerifyResultLines(array("235","334"),$responses)) @@ -343,12 +343,12 @@ class smtp_class $response=base64_decode($responses[0]); break; default: - $this->error="Authentication error: ".$responses[0]; + $this->error=gettext("Authentication error:") . " ".$responses[0]; return(0); } break; default: - $this->error="Could not process the SASL authentication step: ".$sasl->error; + $this->error=gettext("Could not process the SASL authentication step:") . " ".$sasl->error; return(0); } } @@ -362,7 +362,7 @@ class smtp_class { if(strcmp($this->state,"Disconnected")) { - $this->error="connection is already established"; + $this->error=gettext("connection is already established"); return(0); } $this->disconnected_error=0; @@ -400,24 +400,24 @@ class smtp_class $user=$this->user; if(strlen($user)==0) { - $this->error="it was not specified the POP3 authentication user"; + $this->error=gettext("it was not specified the POP3 authentication user"); return(0); } $password=$this->password; if(strlen($password)==0) { - $this->error="it was not specified the POP3 authentication password"; + $this->error=gettext("it was not specified the POP3 authentication password"); return(0); } $domain=$this->pop3_auth_host; - $this->error=$this->ConnectToHost($domain, $this->pop3_auth_port, "Resolving POP3 authentication host \"".$domain."\"..."); + $this->error=$this->ConnectToHost($domain, $this->pop3_auth_port, sprintf(gettext("Resolving POP3 authentication host \"%s\"..."), $domain)); if(strlen($this->error)) return(0); if(strlen($response=$this->GetLine())==0) return(0); if(strcmp($this->Tokenize($response," "),"+OK")) { - $this->error="POP3 authentication server greeting was not found"; + $this->error=gettext("POP3 authentication server greeting was not found"); return(0); } if(!$this->PutLine("USER ".$this->user) @@ -425,7 +425,7 @@ class smtp_class return(0); if(strcmp($this->Tokenize($response," "),"+OK")) { - $this->error="POP3 authentication user was not accepted: ".$this->Tokenize("\r\n"); + $this->error=gettext("POP3 authentication user was not accepted:") . " ".$this->Tokenize("\r\n"); return(0); } if(!$this->PutLine("PASS ".$password) @@ -433,7 +433,7 @@ class smtp_class return(0); if(strcmp($this->Tokenize($response," "),"+OK")) { - $this->error="POP3 authentication password was not accepted: ".$this->Tokenize("\r\n"); + $this->error=gettext("POP3 authentication password was not accepted:") . " ".$this->Tokenize("\r\n"); return(0); } fclose($this->connection); @@ -442,13 +442,13 @@ class smtp_class } if(count($hosts)==0) { - $this->error="could not determine the SMTP to connect"; + $this->error=gettext("could not determine the SMTP to connect"); return(0); } for($host=0, $error="not connected";strlen($error) && $hostConnectToHost($domain, $this->host_port, "Resolving SMTP server domain \"$domain\"..."); + $error=$this->ConnectToHost($domain, $this->host_port, sprintf(gettext("Resolving SMTP server domain \"%s\"..."), $domain)); } if(strlen($error)) { @@ -460,7 +460,7 @@ class smtp_class && function_exists("socket_set_timeout")) socket_set_timeout($this->connection,$timeout,0); if($this->debug) - $this->OutputDebug("Connected to SMTP server \"".$domain."\"."); + $this->OutputDebug(sprintf(gettext("Connected to SMTP server \"%s\"."), $domain)); if(!strcmp($localhost=$this->localhost,"") && !strcmp($localhost=getenv("SERVER_NAME"),"") && !strcmp($localhost=getenv("HOST"),"")) @@ -514,7 +514,7 @@ class smtp_class { if(!IsSet($this->esmtp_extensions["AUTH"])) { - $this->error="server does not require authentication"; + $this->error=gettext("server does not require authentication"); $success=0; } else @@ -578,7 +578,7 @@ class smtp_class if($success && strlen($mechanism)==0) { - $this->error="it is not supported any of the authentication mechanisms required by the server"; + $this->error=gettext("it is not supported any of the authentication mechanisms required by the server"); $success=0; } } @@ -610,7 +610,7 @@ class smtp_class $sender=$this->direct_sender; break; default: - $this->error="direct delivery connection is already established and sender is already set"; + $this->error=gettext("direct delivery connection is already established and sender is already set"); return(0); } } @@ -618,7 +618,7 @@ class smtp_class { if(strcmp($this->state,"Connected")) { - $this->error="connection is not in the initial state"; + $this->error=gettext("connection is not in the initial state"); return(0); } } @@ -640,7 +640,7 @@ class smtp_class if($this->direct_delivery) { if(GetType($at=strrpos($recipient,"@"))!="integer") - return("it was not specified a valid direct recipient"); + return(gettext("it was not specified a valid direct recipient")); $domain=substr($recipient,$at+1); switch($this->state) { @@ -659,12 +659,12 @@ class smtp_class case "RecipientSet": if(strcmp($this->connected_domain,$domain)) { - $this->error="it is not possible to deliver directly to recipients of different domains"; + $this->error=gettext("it is not possible to deliver directly to recipients of different domains"); return(0); } break; default: - $this->error="connection is already established and the recipient is already set"; + $this->error=gettext("connection is already established and the recipient is already set"); return(0); } } @@ -676,7 +676,7 @@ class smtp_class case "RecipientSet": break; default: - $this->error="connection is not in the recipient setting state"; + $this->error=gettext("connection is not in the recipient setting state"); return(0); } } @@ -705,7 +705,7 @@ class smtp_class { if(strcmp($this->state,"RecipientSet")) { - $this->error="connection is not in the start sending data state"; + $this->error=gettext("connection is not in the start sending data state"); return(0); } $this->error=""; @@ -735,7 +735,7 @@ class smtp_class { if(strcmp($this->state,"SendingData")) { - $this->error="connection is not in the sending data state"; + $this->error=gettext("connection is not in the sending data state"); return(0); } $this->error=""; @@ -746,7 +746,7 @@ class smtp_class { if(strcmp($this->state,"SendingData")) { - $this->error="connection is not in the sending data state"; + $this->error=gettext("connection is not in the sending data state"); return(0); } $this->error=""; @@ -782,7 +782,7 @@ class smtp_class { if(!strcmp($this->state,"Disconnected")) { - $this->error="it was not previously established a SMTP connection"; + $this->error=gettext("it was not previously established a SMTP connection"); return(0); } $this->error=""; @@ -840,4 +840,4 @@ class smtp_class }; -?> \ No newline at end of file +?> -- cgit v1.1 From 4a896b862460bd026ff9fc055e59e8ec00a467af Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Tue, 17 Aug 2010 17:23:58 -0300 Subject: Implement gettext() calls on system.inc --- etc/inc/system.inc | 76 +++++++++++++++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/etc/inc/system.inc b/etc/inc/system.inc index e7fc684..3606621 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -89,7 +89,7 @@ function system_resolvconf_generate($dynupdate = false) { $fd = fopen("{$g['varetc_path']}/resolv.conf", "w"); if (!$fd) { - printf("Error: cannot open resolv.conf in system_resolvconf_generate().\n"); + printf(gettext("Error: cannot open resolv.conf in system_resolvconf_generate().%s"), "\n"); return 1; } @@ -188,7 +188,7 @@ function system_hosts_generate() { $fd = fopen("{$g['varetc_path']}/hosts", "w"); if (!$fd) { - log_error("Error: cannot open hosts file in system_hosts_generate().\n"); + log_error(sprintf(gettext("Error: cannot open hosts file in system_hosts_generate().%s"), "\n")); return 1; } @@ -332,14 +332,14 @@ function system_routing_configure($interface = "") { if(isset($route_arr['default'])) { $action = "change"; } - log_error("ROUTING: $action default route to $gatewayip"); + log_error(sprintf(gettext("ROUTING: %s default route to %s"), $action, $gatewayip)); mwexec("/sbin/route {$action} default " . escapeshellarg($gatewayip)); } else if (is_ipaddr($config['interfaces']['wan']['gateway'])) { /* Adding gateway for 1.2-style configs without the new * gateway setup configured. * Force WAN to be default gateway because that is the 1.2 behavior. */ - log_error("WARNING: There is no default gateway in the configuration."); + log_error(gettext("WARNING: There is no default gateway in the configuration.")); $gatewayip = $config['interfaces']['wan']['gateway']; mwexec("/sbin/route add default " . escapeshellarg($gatewayip), true); } @@ -358,7 +358,7 @@ function system_routing_configure($interface = "") { } else if (is_ipaddr($rtent['gateway'])) { $gatewayip = $rtent['gateway']; } else { - log_error("Static Routes: Gateway IP could not be found for {$rtent['network']}"); + log_error(sprintf(gettext("Static Routes: Gateway IP could not be found for %s"), $rtent['network'])); continue; } @@ -399,7 +399,7 @@ function system_syslogd_start() { $syslogcfg = $config['syslog']; if ($g['booting']) - echo "Starting syslog..."; + echo gettext("Starting syslog..."); else killbypid("{$g['varrun_path']}/syslog.pid"); @@ -440,7 +440,7 @@ function system_syslogd_start() { /* write syslog.conf */ $fd = fopen("{$g['varetc_path']}/syslog.conf", "w"); if (!$fd) { - printf("Error: cannot open syslog.conf in system_syslogd_start().\n"); + printf(gettext("Error: cannot open syslog.conf in system_syslogd_start().%s"), "\n"); return 1; } $syslogconf .= "!ntpdate,!ntpd\n"; @@ -603,7 +603,7 @@ EOD; } if ($g['booting']) - echo "done.\n"; + echo gettext("done.") . "\n"; return $retval; } @@ -616,7 +616,7 @@ function system_pccard_start() { } if ($g['booting']) - echo "Initializing PCMCIA..."; + echo gettext("Initializing PCMCIA..."); /* kill any running pccardd */ killbypid("{$g['varrun_path']}/pccardd.pid"); @@ -626,9 +626,9 @@ function system_pccard_start() { if ($g['booting']) { if ($res == 0) - echo "done.\n"; + echo gettext("done.") . "\n"; else - echo "failed!\n"; + echo gettext("failed!") . "\n"; } return $res; @@ -639,7 +639,7 @@ function system_webgui_start() { global $config, $g; if ($g['booting']) - echo "Starting webConfigurator..."; + echo gettext("Starting webConfigurator..."); /* kill any running lighttpd */ killbypid("{$g['varrun_path']}/lighty-webConfigurator.pid"); @@ -668,10 +668,10 @@ function system_webgui_start() { if (!is_array($config['system']['cert'])) $config['system']['cert'] = array(); $a_cert =& $config['system']['cert']; - echo "Creating SSL Certificate... "; + echo gettext("Creating SSL Certificate... "); $cert = array(); $cert['refid'] = uniqid(); - $cert['name'] = "webConfigurator default"; + $cert['name'] = gettext("webConfigurator default"); mwexec("/usr/bin/openssl genrsa 1024 > {$g['tmp_path']}/ssl.key"); mwexec("/usr/bin/openssl req -new -x509 -nodes -sha1 -days 2000 -key {$g['tmp_path']}/ssl.key > {$g['tmp_path']}/ssl.crt"); $crt = file_get_contents("{$g['tmp_path']}/ssl.crt"); @@ -681,7 +681,7 @@ function system_webgui_start() { cert_import($cert, $crt, $key); $a_cert[] = $cert; $config['system']['webgui']['ssl-certref'] = $cert['refid']; - write_config("Importing HTTPS certificate"); + write_config(gettext("Importing HTTPS certificate")); if(!$config['system']['webgui']['port']) $portarg = "443"; $ca = ca_chain($cert); @@ -709,9 +709,9 @@ function system_webgui_start() { if ($g['booting']) { if ($res == 0) - echo "done.\n"; + echo gettext("done.") . "\n"; else - echo "failed!\n"; + echo gettext("failed!") . "\n"; } return $res; @@ -1025,7 +1025,7 @@ EOD; if($cert <> "" and $key <> "") { $fd = fopen("{$g['varetc_path']}/{$cert_location}", "w"); if (!$fd) { - printf("Error: cannot open cert.pem in system_webgui_start().\n"); + printf(gettext("Error: cannot open cert.pem in system_webgui_start().%s"), "\n"); return 1; } chmod("{$g['varetc_path']}/{$cert_location}", 0600); @@ -1036,7 +1036,7 @@ EOD; if($ca <> "") { $fd = fopen("{$g['varetc_path']}/{$ca_location}", "w"); if (!$fd) { - printf("Error: cannot open ca.pem in system_webgui_start().\n"); + printf(gettext("Error: cannot open ca.pem in system_webgui_start().%s"), "\n"); return 1; } chmod("{$g['varetc_path']}/{$ca_location}", 0600); @@ -1044,7 +1044,7 @@ EOD; fclose($fd); } $lighty_config .= "\n"; - $lighty_config .= "## ssl configuration\n"; + $lighty_config .= "## " . gettext("ssl configuration") . "\n"; $lighty_config .= "ssl.engine = \"enable\"\n"; $lighty_config .= "ssl.pemfile = \"{$g['varetc_path']}/{$cert_location}\"\n\n"; if($ca <> "") @@ -1066,7 +1066,7 @@ EOD; $fd = fopen("{$filename}", "w"); if (!$fd) { - printf("Error: cannot open {$filename} in system_generate_lighty_config().\n"); + printf(gettext("Error: cannot open %s in system_generate_lighty_config().%s"), $filename, "\n"); return 1; } fwrite($fd, $lighty_config); @@ -1086,7 +1086,7 @@ function system_timezone_configure() { $syscfg = $config['system']; if ($g['booting']) - echo "Setting timezone..."; + echo gettext("Setting timezone..."); /* extract appropriate timezone file */ $timezone = $syscfg['timezone']; @@ -1102,7 +1102,7 @@ function system_timezone_configure() { conf_mount_ro(); if ($g['booting']) - echo "done.\n"; + echo gettext("done.") . "\n"; } function system_ntp_configure() { @@ -1113,17 +1113,17 @@ function system_ntp_configure() { /* open configuration for wrting or bail */ $fd = fopen("{$g['varetc_path']}/ntpd.conf","w"); if(!$fd) { - log_error("Could not open {$g['varetc_path']}/ntpd.conf for writing"); + log_error(sprintf(gettext("Could not open %s/ntpd.conf for writing"), $g['varetc_path'])); return; } fwrite($fd, "# \n"); - fwrite($fd, "# pfSense OpenNTPD configuration file \n"); + fwrite($fd, "# " . gettext("pfSense OpenNTPD configuration file") . " \n"); fwrite($fd, "# \n\n"); /* foreach through servers and write out to ntpd.conf */ foreach (explode(' ', $syscfg['timeservers']) as $ts) - fwrite($fd, "servers {$ts}\n"); + fwrite($fd, sprintf(gettext("servers %s%s"), $ts, "\n")); /* Setup listener(s) if the user has configured one */ if ($config['installedpackages']['openntpd']) { @@ -1172,7 +1172,7 @@ function sync_system_time() { $syscfg = $config['system']; if ($g['booting']) - echo "Syncing system time before startup..."; + echo gettext("Syncing system time before startup..."); /* foreach through servers and write out to ntpd.conf */ foreach (explode(' ', $syscfg['timeservers']) as $ts) { @@ -1180,7 +1180,7 @@ function sync_system_time() { } if ($g['booting']) - echo "done.\n"; + echo gettext("done.") . "\n"; } @@ -1277,7 +1277,7 @@ function system_dmesg_save() { $fd = fopen("{$g['varlog_path']}/dmesg.boot", "w"); if (!$fd) { - printf("Error: cannot open dmesg.boot in system_dmesg_save().\n"); + printf(gettext("Error: cannot open dmesg.boot in system_dmesg_save().%s"), "\n"); return 1; } @@ -1298,7 +1298,7 @@ function system_set_harddisk_standby() { if (isset($config['system']['harddiskstandby'])) { if ($g['booting']) { - echo 'Setting hard disk standby... '; + echo gettext('Setting hard disk standby... '); } $standby = $config['system']['harddiskstandby']; @@ -1310,13 +1310,13 @@ function system_set_harddisk_standby() { // Reinitialize ATA-drives mwexec('/usr/local/sbin/atareinit'); if ($g['booting']) { - echo "done.\n"; + echo gettext("done.") . "\n"; } } else if ($g['booting']) { - echo "failed!\n"; + echo gettext("failed!") . "\n"; } } else if ($g['booting']) { - echo "failed!\n"; + echo gettext("failed!") . "\n"; } } } @@ -1415,10 +1415,10 @@ function system_identify_specific_platform() { global $g; if ($g['platform'] == 'generic-pc') - return array('name' => 'generic-pc', 'descr' => "Generic PC"); + return array('name' => 'generic-pc', 'descr' => gettext("Generic PC")); if ($g['platform'] == 'generic-pc-cdrom') - return array('name' => 'generic-pc-cdrom', 'descr' => "Generic PC (CD-ROM)"); + return array('name' => 'generic-pc-cdrom', 'descr' => gettext("Generic PC (CD-ROM)")); /* the rest of the code only deals with 'embedded' platforms */ if ($g['platform'] != 'nanobsd') @@ -1427,10 +1427,10 @@ function system_identify_specific_platform() { $dmesg = system_get_dmesg_boot(); if (strpos($dmesg, "PC Engines WRAP") !== false) - return array('name' => 'wrap', 'descr' => 'PC Engines WRAP'); + return array('name' => 'wrap', 'descr' => gettext('PC Engines WRAP')); if (strpos($dmesg, "PC Engines ALIX") !== false) - return array('name' => 'alix', 'descr' => 'PC Engines ALIX'); + return array('name' => 'alix', 'descr' => gettext('PC Engines ALIX')); if (preg_match("/Soekris net45../", $dmesg, $matches)) return array('name' => 'net45xx', 'descr' => $matches[0]); @@ -1442,7 +1442,7 @@ function system_identify_specific_platform() { return array('name' => 'net55xx', 'descr' => $matches[0]); /* unknown embedded platform */ - return array('name' => 'embedded', 'descr' => 'embedded (unknown)'); + return array('name' => 'embedded', 'descr' => gettext('embedded (unknown)')); } function system_get_dmesg_boot() { -- cgit v1.1 From 4b48d1b9c1b40bfca925458d26e34198a9bf3c8c Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Wed, 18 Aug 2010 08:24:51 -0300 Subject: Implement gettext() calls on upgrade_config.inc --- etc/inc/upgrade_config.inc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index 574be98..3def794 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -110,8 +110,8 @@ function upgrade_010_to_011() { $fr['interface'] = $ifmap[$fr['interface']]; else { /* remove the rule */ - echo "\nWarning: filter rule removed " . - "(interface '{$fr['interface']}' does not exist anymore)."; + printf(gettext("%sWarning: filter rule removed " . + "(interface '%s' does not exist anymore)."), "\n", $fr['interface']); unset($config['filter']['rule'][$i]); continue; } @@ -122,8 +122,8 @@ function upgrade_010_to_011() { $fr['source']['network'] = $ifmap[$fr['source']['network']]; else { /* remove the rule */ - echo "\nWarning: filter rule removed " . - "(source network '{$fr['source']['network']}' does not exist anymore)."; + printf(gettext("%sWarning: filter rule removed " . + "(source network '%s' does not exist anymore)."), "\n", $fr['source']['network']); unset($config['filter']['rule'][$i]); continue; } @@ -135,8 +135,8 @@ function upgrade_010_to_011() { $fr['destination']['network'] = $ifmap[$fr['destination']['network']]; else { /* remove the rule */ - echo "\nWarning: filter rule removed " . - "(destination network '{$fr['destination']['network']}' does not exist anymore)."; + printf(gettext("%sWarning: filter rule removed " . + "(destination network '%s' does not exist anymore)."), "\n", $fr['destination']['network']); unset($config['filter']['rule'][$i]); continue; } @@ -155,8 +155,8 @@ function upgrade_010_to_011() { $fr['interface'] = $ifmap[$fr['interface']]; else { /* remove the rule */ - echo "\nWarning: traffic shaper rule removed " . - "(interface '{$fr['interface']}' does not exist anymore)."; + printf(gettext("%sWarning: traffic shaper rule removed " . + "(interface '%s' does not exist anymore)."), "\n", $fr['interface']); unset($config['pfqueueing']['rule'][$i]); continue; } -- cgit v1.1 From dbaf21d4944dd9616c4553a5f8380fa5d3a1fe9d Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Wed, 18 Aug 2010 10:36:29 -0300 Subject: Implement gettext() calls on shaper.inc --- etc/inc/shaper.inc | 391 ++++++++++++++++++++++++++--------------------------- 1 file changed, 194 insertions(+), 197 deletions(-) diff --git a/etc/inc/shaper.inc b/etc/inc/shaper.inc index 7d95f82..7f4b644 100644 --- a/etc/inc/shaper.inc +++ b/etc/inc/shaper.inc @@ -184,13 +184,13 @@ function shaper_do_input_validation($postdata, $reqdfields, $reqdfieldsn, $input /* check for bad control characters */ foreach ($postdata as $pn => $pd) { if (is_string($pd) && preg_match("/[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f]/", $pd)) { - $input_errors[] = "The field '" . $pn . "' contains invalid characters."; + $input_errors[] = sprintf(gettext("The field '%s' contains invalid characters."), $pn); } } for ($i = 0; $i < count($reqdfields); $i++) { if ($postdata[$reqdfields[$i]] == "") { - $input_errors[] = "The field '" . $reqdfieldsn[$i] . "' is required."; + $input_errors[] = sprintf(gettext("The field '%s' is required."), $reqdfieldsn[$i]); } } } @@ -309,24 +309,24 @@ class altq_root_queue { function validate_input($data, &$input_errors) { $reqdfields[] = "bandwidth"; - $reqdfieldsn[] = "Bandwidth"; + $reqdfieldsn[] = gettext("Bandwidth"); $reqdfields[] = "bandwidthtype"; - $reqdfieldsn[] = "Bandwidthtype"; + $reqdfieldsn[] = gettext("Bandwidthtype"); shaper_do_input_validation($data, $reqdfields, $reqdfieldsn, $input_errors); if ($data['bandwidth'] && (!is_numeric($data['bandwidth']))) - $input_errors[] = "Bandwidth must be an integer."; + $input_errors[] = gettext("Bandwidth must be an integer."); if ($data['bandwidth'] < 0) - $input_errors[] = "Bandwidth cannot be negative."; + $input_errors[] = gettext("Bandwidth cannot be negative."); if ($data['qlimit'] && (!is_numeric($data['qlimit']))) - $input_errors[] = "Qlimit must be an integer."; + $input_errors[] = gettext("Qlimit must be an integer."); if ($data['qlimit'] < 0) - $input_errors[] = "Qlimit must be an positive."; + $input_errors[] = gettext("Qlimit must be an positive."); if ($data['tbrconfig'] && (!is_numeric($data['tbrconfig']))) - $input_errors[] = "Tbrsize must be an integer."; + $input_errors[] = gettext("Tbrsize must be an integer."); if ($data['tbrconfig'] < 0) - $input_errors[] = "Tbrsize must be an positive."; + $input_errors[] = gettext("Tbrsize must be an positive."); } /* Implement this to shorten some code on the frontend page */ @@ -597,18 +597,18 @@ class altq_root_queue { */ function build_form() { $form = "
"; - $form .= "Enable/Disable"; + $form .= gettext("Enable/Disable"); $form .= "
"; $form .= " GetEnabled() == "on") $form .= " CHECKED"; - $form .= " > Enable/disable discipline and its children"; + $form .= " > " . gettext("Enable/disable discipline and its children") . ""; $form .= ""; - $form .= "
Name"; + $form .= "
" . gettext("Name") . ""; $form .= ""; $form .= "".$this->GetQname().""; $form .= ""; - $form .= "Scheduler Type "; + $form .= "" . gettext("Scheduler Type "); $form .= ""; $form .= ""; $form .= ""; $form .= "
"; - $form .= "NOTE: Changing this changes all child queues!"; - $form .= " Beware you can lose information."; + $form .= gettext("NOTE: Changing this changes all child queues!"); + $form .= gettext(" Beware you can lose information."); $form .= ""; $form .= ""; - $form .= "Bandwidth"; + $form .= "" . gettext("Bandwidth"); $form .= ""; $form .= "GetBandwidth() . "\">"; @@ -669,9 +669,9 @@ class altq_root_queue { $form .= $this->GetTbrConfig(); $form .= "\">"; $form .= "
"; - $form .= "Adjusts the size, in bytes, of the token bucket regulator. "; - $form .= "If not specified, heuristics based on the interface "; - $form .= "bandwidth are used to determine the size."; + $form .= gettext("Adjusts the size, in bytes, of the token bucket regulator. " + . "If not specified, heuristics based on the interface " + . "bandwidth are used to determine the size."); $form .= ""; $form .= "GetInterface() . "\">"; @@ -938,19 +938,19 @@ class priq_queue { function validate_input($data, &$input_errors) { $reqdfields[] = "name"; - $reqdfieldsn[] = "Name"; + $reqdfieldsn[] = gettext("Name"); shaper_do_input_validation($data, $reqdfields, $reqdfieldsn, $input_errors); if ($data['priority'] && (!is_numeric($data['priority']) || ($data['priority'] < 1) || ($data['priority'] > 15))) { - $input_errors[] = "The priority must be an integer between 1 and 15."; + $input_errors[] = gettext("The priority must be an integer between 1 and 15."); } if ($data['qlimit'] && (!is_numeric($data['qlimit']))) - $input_errors[] = "Queue limit must be an integer"; + $input_errors[] = gettext("Queue limit must be an integer"); if ($data['qlimit'] < 0) - $input_errors[] = "Queue limit must be positive"; + $input_errors[] = gettext("Queue limit must be positive"); if (!preg_match("/^[a-zA-Z0-9_-]*$/", $data['name'])) - $input_errors[] = "Queue names must be alphanumeric and _ or - only."; + $input_errors[] = gettext("Queue names must be alphanumeric and _ or - only."); } @@ -1077,12 +1077,12 @@ class priq_queue { */ function build_form() { $form = "
"; - $form .= "Enable/Disable"; + $form .= gettext("Enable/Disable"); $form .= "
"; $form .= " GetEnabled() == "on") $form .= " CHECKED"; - $form .= " > Enable/Disable queue and its children"; + $form .= " > " . gettext("Enable/Disable queue and its children") . ""; $form .= ""; $form .= ""; $form .= ""; @@ -1090,51 +1090,51 @@ class priq_queue { $form .= "GetQname()); $form .= "\">"; - $form .= "
Enter the name of the queue here. Do not use spaces and limit the size to 15 characters."; + $form .= "
" . gettext("Enter the name of the queue here. Do not use spaces and limit the size to 15 characters."); $form .= "
"; $form .= ""; $form .= "Priority"; $form .= " GetQpriority()); $form .= "\">"; - $form .= "
For hfsc, the range is 0 to 7. The default is 1. Hfsc queues with a higher priority are preferred in the case of overload."; + $form .= "
" . gettext("For hfsc, the range is 0 to 7. The default is 1. Hfsc queues with a higher priority are preferred in the case of overload.") . ""; $form .= ""; $form .= ""; - $form .= "Queue limit"; + $form .= "" . gettext("Queue limit") . ""; $form .= " GetQlimit()); $form .= "\">"; - $form .= "
Queue limit in packets per second."; + $form .= "
" . gettext("Queue limit in packets per second."); $form .= ""; $form .= ""; - $form .= "Scheduler options"; + $form .= "" . gettext("Scheduler options") . ""; $form .= ""; $tmpvalue = $this->GetDefault(); if (!empty($tmpvalue)) { $form .= ""; } else { $form .= ""; } $form .= "GetRed(); if(!empty($tmpvalue)) $form .= " CHECKED"; - $form .= "> Random Early Detection
"; + $form .= "> " . gettext("Random Early Detection") . "
"; $form .= "GetRio(); if(!empty($tmpvalue)) $form .= " CHECKED"; - $form .= "> Random Early Detection In and Out
"; + $form .= "> " . gettext("Random Early Detection In and Out") . "
"; $form .= "GetEcn(); if(!empty($tmpvalue)) $form .= " CHECKED"; - $form .= "> Explicit Congestion Notification
"; - $form .= "
Select options for this queue"; + $form .= "> " . gettext("Explicit Congestion Notification") . "
"; + $form .= "
" . gettext("Select options for this queue"); $form .= ""; - $form .= "Description"; + $form .= "" . gettext("Description") . ""; $form .= ""; $form .= "GetDescription() . "\" >"; $form .= ""; @@ -1160,23 +1160,23 @@ class priq_queue { */ $form .= ""; $form .= ""; - $form .= "Bandwidth: " . $this->GetBandwidth().$this->GetBwscale(); + $form .= gettext("Bandwidth:") . " " . $this->GetBandwidth().$this->GetBwscale(); $form .= ""; $form .= ""; $tmpvalue = $this->GetQpriority(); if (!empty($tmpvalue)) - $form .= "Priority: on "; + $form .= gettext("Priority: on") . " "; $tmpvalue = $this->GetDefault(); if (!empty($tmpvalue)) - $form .= "Default: on "; + $form .= "" . gettext("Default: on") . " "; $form .= ""; $form .= "GetInterface() . "&queue="; $form .= $this->GetQname() . "&action=delete\">"; $form .= ""; - $form .= "Delete queue from interface"; + $form .= " width=\"17\" height=\"17\" border=\"0\" title=\"" . gettext("Delete queue from interface") . "\">"; + $form .= "" . gettext("Delete queue from interface") . ""; return $form; @@ -1499,22 +1499,22 @@ class hfsc_queue extends priq_queue { parent::validate_input($data, $input_errors); $reqdfields[] = "bandwidth"; - $reqdfieldsn[] = "Bandwidth"; + $reqdfieldsn[] = gettext("Bandwidth"); $reqdfields[] = "bandwidthtype"; - $reqdfieldsn[] = "Bandwidthtype"; + $reqdfieldsn[] = gettext("Bandwidthtype"); shaper_do_input_validation($data, $reqdfields, $reqdfieldsn, $input_errors); if (isset($data['linkshare3']) && $data['linkshare3'] <> "") { if ($data['bandwidth'] && (!is_numeric($data['bandwidth']))) - $input_errors[] = "Bandwidth must be an integer."; + $input_errors[] = gettext("Bandwidth must be an integer."); - if ($data['bandwidth'] < 0) - $input_errors[] = "Bandwidth cannot be negative."; + if ($data['bandwidth'] < 0) + $input_errors[] = gettext("Bandwidth cannot be negative."); if ($data['bandwidthtype'] == "%") { if ($data['bandwidth'] > 100 || $data['bandwidth'] < 0) - $input_errors[] = "Bandwidth in percentage should be between 1 and 100 bounds."; + $input_errors[] = gettext("Bandwidth in percentage should be between 1 and 100 bounds."); } /* $parent =& $this->GetParent(); @@ -1531,15 +1531,15 @@ class hfsc_queue extends priq_queue { } if ($data['upperlimit1'] <> "" && $data['upperlimit2'] == "") - $input_errors[] = ("upperlimit service curve defined but missing (d) value"); + $input_errors[] = gettext("upperlimit service curve defined but missing (d) value"); if ($data['upperlimit2'] <> "" && $data['upperlimit1'] == "") - $input_errors[] = ("upperlimit service curve defined but missing initial bandwidth (m1) value"); + $input_errors[] = gettext("upperlimit service curve defined but missing initial bandwidth (m1) value"); if ($data['upperlimit1'] <> "" && !is_valid_shaperbw($data['upperlimit1'])) - $input_errors[] = ("upperlimit m1 value needs to be Kb, Mb, Gb, or %"); + $input_errors[] = gettext("upperlimit m1 value needs to be Kb, Mb, Gb, or %"); if ($data['upperlimit2'] <> "" && !is_numeric($data['upperlimit2'])) - $input_errors[] = ("upperlimit d value needs to be numeric"); + $input_errors[] = gettext("upperlimit d value needs to be numeric"); if ($data['upperlimit3'] <> "" && !is_valid_shaperbw($data['upperlimit3'])) - $input_errors[] = ("upperlimit m2 value needs to be Kb, Mb, Gb, or %"); + $input_errors[] = gettext("upperlimit m2 value needs to be Kb, Mb, Gb, or %"); /* if (isset($data['upperlimit']) && $data['upperlimit3'] <> "" && $data['upperlimit1'] <> "") { @@ -1553,19 +1553,19 @@ class hfsc_queue extends priq_queue { } */ if ($data['linkshare1'] <> "" && $data['linkshare2'] == "") - $input_errors[] = ("linkshare service curve defined but missing (d) value"); + $input_errors[] = gettext("linkshare service curve defined but missing (d) value"); if ($data['linkshare2'] <> "" && $data['linkshare1'] == "") - $input_errors[] = ("linkshare service curve defined but missing initial bandwidth (m1) value"); + $input_errors[] = gettext("linkshare service curve defined but missing initial bandwidth (m1) value"); if ($data['linkshare1'] <> "" && !is_valid_shaperbw($data['linkshare1'])) - $input_errors[] = ("linkshare m1 value needs to be Kb, Mb, Gb, or %"); + $input_errors[] = gettext("linkshare m1 value needs to be Kb, Mb, Gb, or %"); if ($data['linkshare2'] <> "" && !is_numeric($data['linkshare2'])) - $input_errors[] = ("linkshare d value needs to be numeric"); + $input_errors[] = gettext("linkshare d value needs to be numeric"); if ($data['linkshare3'] <> "" && !is_valid_shaperbw($data['linkshare3'])) - $input_errors[] = ("linkshare m2 value needs to be Kb, Mb, Gb, or %"); + $input_errors[] = gettext("linkshare m2 value needs to be Kb, Mb, Gb, or %"); if ($data['realtime1'] <> "" && $data['realtime2'] == "") - $input_errors[] = ("realtime service curve defined but missing (d) value"); + $input_errors[] = gettext("realtime service curve defined but missing (d) value"); if ($data['realtime2'] <> "" && $data['realtime1'] == "") - $input_errors[] = ("realtime service curve defined but missing initial bandwidth (m1) value"); + $input_errors[] = gettext("realtime service curve defined but missing initial bandwidth (m1) value"); /* if (isset($data['linkshare']) && $data['linkshare3'] <> "" && $data['linkshare1'] <> "" && 0) { @@ -1580,11 +1580,11 @@ class hfsc_queue extends priq_queue { */ if ($data['realtime1'] <> "" && !is_valid_shaperbw($data['realtime1'])) - $input_errors[] = ("realtime m1 value needs to be Kb, Mb, Gb, or %"); + $input_errors[] = gettext("realtime m1 value needs to be Kb, Mb, Gb, or %"); if ($data['realtime2'] <> "" && !is_numeric($data['realtime2'])) - $input_errors[] = ("realtime d value needs to be numeric"); + $input_errors[] = gettext("realtime d value needs to be numeric"); if ($data['realtime3'] <> "" && !is_valid_shaperbw($data['realtime3'])) - $input_errors[] = ("realtime m2 value needs to be Kb, Mb, Gb, or %"); + $input_errors[] = gettext("realtime m2 value needs to be Kb, Mb, Gb, or %"); /* if (isset($data['realtime']) && $data['realtime3'] <> "" && $data['realtime1'] <> "" && 0) { @@ -1805,7 +1805,7 @@ class hfsc_queue extends priq_queue { function build_form() { $form = parent::build_form(); $form .= ""; - $form .= "Bandwidth"; + $form .= "" . gettext("Bandwidth") . ""; $form .= " GetBandwidth()); $form .= "\">"; @@ -1831,10 +1831,10 @@ class hfsc_queue extends priq_queue { $form .= " selected=\"yes\""; $form .= ">%"; $form .= "
"; - $form .= "Choose the amount of bandwidth for this queue"; + $form .= "" . gettext("Choose the amount of bandwidth for this queue"); $form .= ""; $form .= ""; - $form .= "Service Curve (sc)"; + $form .= "" . gettext("Service Curve (sc)") . ""; $form .= ""; $form .= ""; $form .= ""; @@ -1856,7 +1856,7 @@ class hfsc_queue extends priq_queue { $form .= "\" id=\"upperlimit3\" name=\"upperlimit3\" "; if ($this->GetUpperlimit() == "") $form .= " disabled"; - $form .= ">"; + $form .= ">"; $form .= ""; + $form .= ">"; $form .= ""; + $form .= ">"; $form .= "
 
m1
d
m2
The maximum allowed bandwidth for the queue.
" . gettext("The maximum allowed bandwidth for the queue.") . "
GetRealtime() <> "") $form .= " CHECKED "; @@ -1875,11 +1875,11 @@ class hfsc_queue extends priq_queue { $form .= "\" id=\"realtime3\" name=\"realtime3\" "; if ($this->GetRealtime() == "") $form .= " disabled"; - $form .= ">The minimum required bandwidth for the queue.
" . gettext("The minimum required bandwidth for the queue.") . "
GetLinkshare() <> "") $form .= " CHECKED "; - $form .= "onChange=\"enable_linkshare()\"> Link share: " . gettext("Link share:") . "GetL_m1()); $form .= "\" id=\"linkshare1\" name=\"linkshare1\" "; if ($this->GetLinkshare() == "") @@ -1894,12 +1894,12 @@ class hfsc_queue extends priq_queue { $form .= "\" id=\"linkshare3\" name=\"linkshare3\" "; if ($this->GetLinkshare() == "") $form .= " disabled"; - $form .= ">The bandwidth share of a backlogged queue - this overrides priority.
" . gettext("The bandwidth share of a backlogged queue - this overrides priority.") . "

"; - $form .= "The format for service curve specifications is (m1, d, m2). m2 controls"; - $form .= "the bandwidth assigned to the queue. m1 and d are optional and can be"; - $form .= "used to control the initial bandwidth assignment. For the first d milliseconds the queue gets the bandwidth given as m1, afterwards the value"; - $form .= "given in m2."; + $form .= gettext("The format for service curve specifications is (m1, d, m2). m2 controls " + . "the bandwidth assigned to the queue. m1 and d are optional and can be " + . "used to control the initial bandwidth assignment. For the first d milliseconds the queue gets the bandwidth given as m1, afterwards the value " + . "given in m2."); $form .= "
"; $form .= ""; @@ -2146,24 +2146,24 @@ class cbq_queue extends priq_queue { parent::validate_input($data, $input_errors); if ($data['priority'] > 7) - $input_errors[] = "Priority must be an integer between 1 and 7."; + $input_errors[] = gettext("Priority must be an integer between 1 and 7."); $reqdfields[] = "bandwidth"; - $reqdfieldsn[] = "Bandwidth"; + $reqdfieldsn[] = gettext("Bandwidth"); $reqdfields[] = "bandwidthtype"; - $reqdfieldsn[] = "Bandwidthtype"; + $reqdfieldsn[] = gettext("Bandwidthtype"); shaper_do_input_validation($data, $reqdfields, $reqdfieldsn, $input_errors); if ($data['bandwidth'] && !is_numeric($data['bandwidth'])) - $input_errors[] = "Bandwidth must be an integer."; + $input_errors[] = gettext("Bandwidth must be an integer."); if ($data['bandwidth'] < 0) - $input_errors[] = "Bandwidth cannot be negative."; + $input_errors[] = gettext("Bandwidth cannot be negative."); if ($data['bandwidthtype'] == "%") { if ($data['bandwidth'] > 100 || $data['bandwidth'] < 0) - $input_errors[] = "Bandwidth in percentage should be between 1 and 100 bounds."; + $input_errors[] = gettext("Bandwidth in percentage should be between 1 and 100 bounds."); } /* @@ -2281,7 +2281,7 @@ class cbq_queue extends priq_queue { function build_form() { $form = parent::build_form(); $form .= ""; - $form .= "Bandwidth"; + $form .= "" . gettext("Bandwidth") . ""; $form .= " GetBandwidth() > 0) $form .= htmlspecialchars($this->GetBandwidth()); @@ -2308,13 +2308,13 @@ class cbq_queue extends priq_queue { $form .= " selected=\"yes\""; $form .= ">%"; $form .= "
"; - $form .= "Choose the amount of bandwidth for this queue"; + $form .= "" . gettext("Choose the amount of bandwidth for this queue"); $form .= ""; - $form .= "Scheduler specific options"; + $form .= "" . gettext("Scheduler specific options") . ""; $form .= "GetBorrow() == "on") $form .= " CHECKED "; - $form .= "> Borrow from other queues when available
"; + $form .= "> " . gettext("Borrow from other queues when available") . "
"; return $form; } @@ -2421,26 +2421,26 @@ class fairq_queue extends priq_queue { parent::validate_input($data, $input_errors); if ($data['priority'] > 255) - $input_errors[] = "Priority must be an integer between 1 and 255."; + $input_errors[] = gettext("Priority must be an integer between 1 and 255."); $reqdfields[] = "bandwidth"; - $reqdfieldsn[] = "Bandwidth"; + $reqdfieldsn[] = gettext("Bandwidth"); $reqdfields[] = "bandwidthtype"; - $reqdfieldsn[] = "Bandwidthtype"; + $reqdfieldsn[] = gettext("Bandwidthtype"); shaper_do_input_validation($data, $reqdfields, $reqdfieldsn, $input_errors); if ($data['bandwidth'] && !is_numeric($data['bandwidth'])) - $input_errors[] = "Bandwidth must be an integer."; + $input_errors[] = gettext("Bandwidth must be an integer."); - if ($data['bandwidth'] < 0) - $input_errors[] = "Bandwidth cannot be negative."; + if ($data['bandwidth'] < 0) + $input_errors[] = gettext("Bandwidth cannot be negative."); - if ($data['bandwidthtype'] == "%") { - if ($data['bandwidth'] > 100 || $data['bandwidth'] < 0) - $input_errors[] = "Bandwidth in percentage should be between 1 and 100 bounds."; - } + if ($data['bandwidthtype'] == "%") { + if ($data['bandwidth'] > 100 || $data['bandwidth'] < 0) + $input_errors[] = gettext("Bandwidth in percentage should be between 1 and 100 bounds."); + } /* $parent =& $this->GetParent(); @@ -2548,7 +2548,7 @@ class fairq_queue extends priq_queue { function build_form() { $form = parent::build_form(); $form .= ""; - $form .= "Bandwidth"; + $form .= "" . gettext("Bandwidth") . ""; $form .= " GetBandwidth() > 0) $form .= htmlspecialchars($this->GetBandwidth()); @@ -2575,20 +2575,20 @@ class fairq_queue extends priq_queue { $form .= " selected=\"yes\""; $form .= ">%"; $form .= "
"; - $form .= "Choose the amount of bandwidth for this queue"; + $form .= "" . gettext("Choose the amount of bandwidth for this queue"); $form .= ""; - $form .= "Scheduler specific options"; + $form .= "" . gettext("Scheduler specific options") . ""; $form .= ""; + $form .= "\"> " . gettext("Number of buckets available.") . "
"; $form .= ""; + $form .= "\"> " . gettext("Bandwidth limit for hosts to not saturate link.") . "
"; $form .= "
"; $form .= "GetBuckets()); if(!empty($tmpvalue)) $form .= $this->GetBuckets(); - $form .= "\"> Number of buckets available.
GetHogs()); if(!empty($tmpvalue)) $form .= $this->GetHogs(); - $form .= "\"> Bandwidth limit for hosts to not saturate link.
"; return $form; } @@ -2742,24 +2742,24 @@ class dummynet_class { function validate_input($data, &$input_errors) { $reqdfields[] = "bandwidth"; - $reqdfieldsn[] = "Bandwidth"; + $reqdfieldsn[] = gettext("Bandwidth"); $reqdfields[] = "bandwidthtype"; - $reqdfieldsn[] = "Bandwidthtype"; + $reqdfieldsn[] = gettext("Bandwidthtype"); $reqdfields[] = "name"; - $reqdfieldsn[] = "Name"; + $reqdfieldsn[] = gettext("Name"); shaper_do_input_validation($data, $reqdfields, $reqdfieldsn, $input_errors); if ($data['plr'] && ((!is_numeric($data['plr'])) || ($data['plr'] <= 0 && $data['plr'] > 1))) - $input_errors[] = "Plr must be an integer between 1 and 100."; + $input_errors[] = gettext("Plr must be an integer between 1 and 100."); if (($data['buckets'] && (!is_numeric($data['buckets']))) || ($data['buckets'] < 1 && $data['buckets'] > 100)) - $input_errors[] = "Buckets must be an integer between 16 and 65535."; + $input_errors[] = gettext("Buckets must be an integer between 16 and 65535."); if ($data['qlimit'] && (!is_numeric($data['qlimit']))) - $input_errors[] = "Queue limit must be an integer"; - if (!preg_match("/^[a-zA-Z0-9_-]+$/", $data['name'])) - $input_errors[] = "Queue names must be alphanumeric and _ or - only."; + $input_errors[] = gettext("Queue limit must be an integer"); + if (!preg_match("/^[a-zA-Z0-9_-]+$/", $data['name'])) + $input_errors[] = gettext("Queue names must be alphanumeric and _ or - only."); } } @@ -2851,10 +2851,10 @@ class dnpipe_class extends dummynet_class { parent::validate_input($data, $input_errors); if ($data['bandwidth'] && (!is_numeric($data['bandwidth']))) - $input_errors[] = "Bandwidth must be an integer."; + $input_errors[] = gettext("Bandwidth must be an integer."); if ($data['delay'] && (!is_numeric($data['delay']))) - $input_errors[] = "Delay must be an integer."; - } + $input_errors[] = gettext("Delay must be an integer."); + } function ReadConfig(&$q) { $this->SetQname($q['name']); @@ -2942,19 +2942,19 @@ class dnpipe_class extends dummynet_class { function build_form() { $form = "
"; - $form .= "Enable/Disable"; + $form .= gettext("Enable/Disable"); $form .= ""; $form .= " GetEnabled() == "on") $form .= " CHECKED"; - $form .= " > Enable/Disable limiter and its children"; + $form .= " > " . gettext("Enable/Disable limiter and its children") . ""; $form .= ""; - $form .= "
Name"; + $form .= "
" . gettext("Name") . ""; $form .= ""; $form .= "GetQname()."\">"; $form .= ""; - $form .= "Bandwidth"; + $form .= "" . gettext("Bandwidth"); $form .= ""; $form .= "GetBandwidth() . "\">"; @@ -2974,10 +2974,10 @@ class dnpipe_class extends dummynet_class { $form .= ""; + $form .= ">" . gettext("Bit/s") . ""; $form .= ""; $form .= ""; - $form .= "Mask"; + $form .= "" . gettext("Mask") . ""; $form .= ""; $form .= ""; $form .= " 
"; - $form .= "If 'source' or 'destination' is chosen, \n"; - $form .= "a dynamic pipe with the bandwidth, delay, packet loss and queue size given above will \n"; - $form .= "be created for each source/destination IP address encountered, \n"; - $form .= "respectively. This makes it possible to easily specify bandwidth \n"; - $form .= "limits per host."; + $form .= "" . gettext("If 'source' or 'destination' is chosen, \n" + . "a dynamic pipe with the bandwidth, delay, packet loss and queue size given above will \n" + . "be created for each source/destination IP address encountered, \n" + . "respectively. This makes it possible to easily specify bandwidth \n" + . "limits per host.") . ""; $form .= ""; - $form .= "Description"; + $form .= "" . gettext("Description") . ""; $form .= ""; $form .= "GetDescription(); $form .= "\">"; $form .= "
"; - $form .= "You may enter a description here "; - $form .= "for your reference (not parsed)."; + $form .= gettext("You may enter a description here for your reference (not parsed).") . "
"; $form .= ""; $form .= ""; $form .= ""; $form .= "
"; $form .= "

"; + $form .= " value=\"" . gettext("Show advanced options") . "\">"; $form .= "

"; $form .= ""; @@ -3021,37 +3020,37 @@ class dnpipe_class extends dummynet_class { $form .= ""; $form .= "GetDelay() . "\">"; - $form .= " ms
Hint: in most cases, you "; - $form .= "should specify 0 here (or leave the field empty)"; + $form .= " ms
" . gettext("Hint: in most cases, you " + . "should specify 0 here (or leave the field empty)") . ""; $form .= "
"; $form .= ""; $form .= "Packet loss rate"; $form .= ""; $form .= "GetPlr() . "\">"; - $form .= " 
Hint: in most cases, you "; - $form .= "should specify 0 here (or leave the field empty)."; - $form .= "A value of 0.001 means one packet in 1000 gets dropped"; + $form .= " 
" . gettext("Hint: in most cases, you " + . "should specify 0 here (or leave the field empty). " + . "A value of 0.001 means one packet in 1000 gets dropped") . ""; $form .= ""; $form .= ""; - $form .= "Queue Size"; + $form .= "" . gettext("Queue Size") . ""; $form .= ""; $form .= "GetQlimit() . "\">"; $form .= " slots
"; - $form .= "Hint: in most cases, you "; - $form .= "should leave the field empty. All packets in this pipe are placed into a fixed-size queue first,"; - $form .= "then they are delayed by value specified in the Delay field, and then they "; - $form .= "are delivered to their destination."; + $form .= "" . gettext("Hint: in most cases, you " + . "should leave the field empty. All packets in this pipe are placed into a fixed-size queue first, " + . "then they are delayed by value specified in the Delay field, and then they " + . "are delivered to their destination.") . ""; $form .= ""; $form .= ""; - $form .= "Bucket Size"; + $form .= "" . gettext("Bucket Size") . ""; $form .= ""; $form .= "GetBuckets() . "\">"; $form .= " slots
"; - $form .= "Hint: in most cases, you "; - $form .= "should leave the field empty. It increases the hash size set."; + $form .= "" . gettext("Hint: in most cases, you " + . "should leave the field empty. It increases the hash size set."); $form .= ""; return $form; @@ -3108,7 +3107,7 @@ class dnqueue_class extends dummynet_class { if ($data['weight'] && ((!is_numeric($data['weight'])) || ($data['weight'] < 1 && $data['weight'] > 100))) - $input_errors[] = "Weight must be an integer between 1 and 100."; + $input_errors[] = gettext("Weight must be an integer between 1 and 100."); } /* @@ -3185,40 +3184,40 @@ class dnqueue_class extends dummynet_class { function build_form() { $form = "
"; - $form .= "Enable/Disable"; + $form .= gettext("Enable/Disable"); $form .= ""; $form .= " GetEnabled() == "on") $form .= " CHECKED"; - $form .= " > Enable/Disable queue and its children"; + $form .= " > " . gettext("Enable/Disable queue and its children") . ""; $form .= ""; - $form .= "
Name"; + $form .= "
" . gettext("Name") . ""; $form .= ""; $form .= "GetQname()."\">"; $form .= ""; - $form .= "Mask"; + $form .= "" . gettext("Mask") . ""; $form .= ""; $form .= ""; $form .= " slots
"; - $form .= "If 'source' or 'destination' is chosen, \n"; - $form .= "a dynamic pipe with the bandwidth, delay, packet loss and queue size given above will \n"; - $form .= "be created for each source/destination IP address encountered, \n"; - $form .= "respectively. This makes it possible to easily specify bandwidth \n"; - $form .= "limits per host."; + $form .= "" . gettext("If 'source' or 'destination' is chosen, \n" + . "a dynamic pipe with the bandwidth, delay, packet loss and queue size given above will \n" + . "be created for each source/destination IP address encountered, \n" + . "respectively. This makes it possible to easily specify bandwidth \n" + . "limits per host.") . ""; $form .= ""; $form .= "Description"; $form .= ""; @@ -3226,51 +3225,50 @@ class dnqueue_class extends dummynet_class { $form .= $this->GetDescription(); $form .= "\">"; $form .= "
"; - $form .= "You may enter a description here "; - $form .= "for your reference (not parsed)."; + $form .= gettext("You may enter a description here for your reference (not parsed).") . "
"; $form .= ""; $form .= ""; $form .= ""; $form .= "
"; $form .= "

"; + $form .= " value=\"" . gettext("Show advanced options") . "\">"; $form .= "

"; $form .= ""; - $form .= "Weight"; + $form .= "" . gettext("Weight") . ""; $form .= ""; $form .= "GetWeight() . "\">"; - $form .= " ms
Hint: For queues under the same parent "; - $form .= "this specifies the share that a queue gets(values range from 1 to 100, you can leave it blank otherwise)"; + $form .= " ms
" . gettext("Hint: For queues under the same parent " + . "this specifies the share that a queue gets(values range from 1 to 100, you can leave it blank otherwise)") . ""; $form .= ""; $form .= ""; - $form .= "Packet loss rate"; + $form .= "" . gettext("Packet loss rate") . ""; $form .= ""; $form .= "GetPlr() . "\">"; - $form .= " 
Hint: in most cases, you "; - $form .= "should specify 0 here (or leave the field empty)."; - $form .= "A value of 0.001 means one packet in 1000 gets dropped"; + $form .= " 
" . gettext("Hint: in most cases, you " + . "should specify 0 here (or leave the field empty). " + . "A value of 0.001 means one packet in 1000 gets dropped") . ""; $form .= ""; $form .= ""; - $form .= "Queue Size"; + $form .= "" . gettext("Queue Size") . ""; $form .= ""; $form .= "GetQlimit() . "\">"; $form .= " slots
"; - $form .= "Hint: in most cases, you "; - $form .= "should leave the field empty. All packets in this pipe are placed into a fixed-size queue first, "; - $form .= "then they are delayed by value specified in the Delay field, and then they "; - $form .= "are delivered to their destination."; + $form .= "" . gettext("Hint: in most cases, you " + . "should leave the field empty. All packets in this pipe are placed into a fixed-size queue first, " + . "then they are delayed by value specified in the Delay field, and then they " + . "are delivered to their destination.") . ""; $form .= ""; $form .= ""; - $form .= "Bucket Size"; + $form .= "" . gettext("Bucket Size") . ""; $form .= ""; $form .= "GetBuckets() . "\">"; - $form .= " slots
"; - $form .= "Hint: in most cases, you "; - $form .= "should leave the field empty. It increases the hash size set."; + $form .= " " . gettext("slots") . "
"; + $form .= "" . gettext("Hint: in most cases, you " + . "should leave the field empty. It increases the hash size set."); $form .= ""; $form .= "
"; - $form .= "Enable/Disable"; + $form .= gettext("Enable/Disable"); $form .= ""; $form .= " GetREnabled() == "on") { $form .= "checked = \"CHECKED\""; } - $form .= " > Enable/Disable layer7 Container"; + $form .= " > " . gettext("Enable/Disable layer7 Container") . ""; $form .= ""; - $form .= "
Name"; + $form .= "
" . gettext("Name") . ""; $form .= ""; $form .= "GetRName()."\">"; $form .= ""; - $form .= "Description"; + $form .= "" . gettext("Description") . ""; $form .= ""; $form .= "GetRDescription(); $form .= "\">"; $form .= "
"; - $form .= "You may enter a description here "; - $form .= "for your reference (not parsed)."; + $form .= gettext("You may enter a description here for your reference (not parsed).") . "
"; $form .= ""; return $form; @@ -3484,12 +3481,12 @@ class layer7 { function validate_input($data, &$input_errors) { $reqdfields[] = "container"; - $reqdfieldsn[] = "Name"; + $reqdfieldsn[] = gettext("Name"); shaper_do_input_validation($data, $reqdfields, $reqdfieldsn, $input_errors); if (!preg_match("/^[a-zA-Z0-9_-]+$/", $data['container'])) - $input_errors[] = "Queue names must be alphanumeric and _ or - only."; + $input_errors[] = gettext("Queue names must be alphanumeric and _ or - only."); } function delete_l7c() { @@ -3966,31 +3963,31 @@ function build_iface_without_this_queue($iface, $qname) { $scheduler = ": " . $altq->GetScheduler(); $form = ""; $form .= "".$iface.": ".$scheduler.""; - $form .= ""; - $form .= ""; - $form .= ""; - $form .= ""; - $form .= " Clone shaper/queue on this interface"; + $form .= ""; + $form .= ""; + $form .= ""; + $form .= ""; + $form .= gettext(" Clone shaper/queue on this interface") . ""; - return $form; + return $form; } $default_shaper_msg = ""; -$default_shaper_msg .= "

Welcome to the {$g['product_name']} Traffic Shaper.
"; -$default_shaper_msg .= "The tree on the left helps you navigate through the queues
"; -$default_shaper_msg .= "buttons at the bottom represent queue actions and are activated accordingly."; +$default_shaper_msg .= "

" . sprintf(gettext("Welcome to the %s Traffic Shaper."), $g['product_name']) . "
"; +$default_shaper_msg .= gettext("The tree on the left helps you navigate through the queues
" + . "buttons at the bottom represent queue actions and are activated accordingly."); $default_shaper_msg .= "

"; $default_shaper_msg .= ""; $dn_default_shaper_msg = ""; -$dn_default_shaper_msg .= "

Welcome to the {$g['product_name']} Traffic Shaper.
"; -$dn_default_shaper_msg .= "The tree on the left helps you navigate through the queues
"; -$dn_default_shaper_msg .= "buttons at the bottom represent queue actions and are activated accordingly."; +$dn_default_shaper_msg .= "

" . sprintf(gettext("Welcome to the %s Traffic Shaper."), $g['product_name']) . "
"; +$dn_default_shaper_msg .= gettext("The tree on the left helps you navigate through the queues
" + . "buttons at the bottom represent queue actions and are activated accordingly."); $dn_default_shaper_msg .= "

"; $dn_default_shaper_msg .= ""; -- cgit v1.1 From 4d511e5b646c24ced446c528f64336bc78572a2d Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Wed, 18 Aug 2010 12:50:18 -0300 Subject: Implement gettext calls on upgrade_config.inc --- etc/inc/upgrade_config.inc | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index 3def794..be3ff31 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -167,8 +167,8 @@ function upgrade_010_to_011() { $fr['source']['network'] = $ifmap[$fr['source']['network']]; else { /* remove the rule */ - echo "\nWarning: traffic shaper rule removed " . - "(source network '{$fr['source']['network']}' does not exist anymore)."; + printf(gettext("%sWarning: traffic shaper rule removed " . + "(source network '%s' does not exist anymore)."), "\n", $fr['source']['network']); unset($config['pfqueueing']['rule'][$i]); continue; } @@ -180,8 +180,8 @@ function upgrade_010_to_011() { $fr['destination']['network'] = $ifmap[$fr['destination']['network']]; else { /* remove the rule */ - echo "\nWarning: traffic shaper rule removed " . - "(destination network '{$fr['destination']['network']}' does not exist anymore)."; + printf(gettext("%sWarning: traffic shaper rule removed " . + "(destination network '%s' does not exist anymore)."), "\n", $fr['destination']['network']); unset($config['pfqueueing']['rule'][$i]); continue; } @@ -330,7 +330,7 @@ function upgrade_017_to_018() { $vip = array(); $vip['mode'] = "carp"; $vip['interface'] = "AUTO"; - $vip['descr'] = "CARP vhid {$carpent['vhid']}"; + $vip['descr'] = sprintf(gettext("CARP vhid %s"), $carpent['vhid']); $vip['type'] = "single"; $vip['vhid'] = $carpent['vhid']; $vip['advskew'] = $carpent['advskew']; @@ -534,7 +534,7 @@ function upgrade_028_to_029() { $rule_item['type'] = "pass"; $rule_item['source']['any'] = true; $rule_item['destination']['any'] = true; - $rule_item['descr'] = "Permit IPsec traffic."; + $rule_item['descr'] = gettext("Permit IPsec traffic."); $rule_item['statetype'] = "keep state"; $a_filter[] = $rule_item; } @@ -609,7 +609,7 @@ function upgrade_039_to_040() { if (isset ($config['system']['username'])) { $config['system']['group'] = array(); $config['system']['group'][0]['name'] = "admins"; - $config['system']['group'][0]['description'] = "System Administrators"; + $config['system']['group'][0]['description'] = gettext("System Administrators"); $config['system']['group'][0]['scope'] = "system"; $config['system']['group'][0]['pages'] = "ANY"; $config['system']['group'][0]['home'] = "index.php"; @@ -628,19 +628,19 @@ function upgrade_039_to_040() { $config['system']['user'][0]['priv'] = array(); $config['system']['user'][0]['priv'][0]['id'] = "lockwc"; $config['system']['user'][0]['priv'][0]['name'] = "Lock webConfigurator"; - $config['system']['user'][0]['priv'][0]['descr'] = "Indicates whether this user will lock access to the webConfigurator for other users."; + $config['system']['user'][0]['priv'][0]['descr'] = gettext("Indicates whether this user will lock access to the webConfigurator for other users."); $config['system']['user'][0]['priv'][1]['id'] = "lock-ipages"; $config['system']['user'][0]['priv'][1]['name'] = "Lock individual pages"; - $config['system']['user'][0]['priv'][1]['descr'] = "Indicates whether this user will lock individual HTML pages after having accessed a particular page (the lock will be freed if the user leaves or saves the page form)."; + $config['system']['user'][0]['priv'][1]['descr'] = gettext("Indicates whether this user will lock individual HTML pages after having accessed a particular page (the lock will be freed if the user leaves or saves the page form)."); $config['system']['user'][0]['priv'][2]['id'] = "hasshell"; $config['system']['user'][0]['priv'][2]['name'] = "Has shell access"; - $config['system']['user'][0]['priv'][2]['descr'] = "Indicates whether this user is able to login for example via SSH."; + $config['system']['user'][0]['priv'][2]['descr'] = gettext("Indicates whether this user is able to login for example via SSH."); $config['system']['user'][0]['priv'][3]['id'] = "copyfiles"; $config['system']['user'][0]['priv'][3]['name'] = "Is allowed to copy files"; - $config['system']['user'][0]['priv'][3]['descr'] = "Indicates whether this user is allowed to copy files onto the {$g['product_name']} appliance via SCP/SFTP. If you are going to use this privilege, you must install scponly on the appliance (Hint: pkg_add -r scponly)."; + $config['system']['user'][0]['priv'][3]['descr'] = sprintf(gettext("Indicates whether this user is allowed to copy files onto the %s appliance via SCP/SFTP. If you are going to use this privilege, you must install scponly on the appliance (Hint: pkg_add -r scponly)."), $g['product_name']); $config['system']['user'][0]['priv'][4]['id'] = "isroot"; $config['system']['user'][0]['priv'][4]['name'] = "Is root user"; - $config['system']['user'][0]['priv'][4]['descr'] = "This user is associated with the UNIX root user (you should associate this privilege only with one single user)."; + $config['system']['user'][0]['priv'][4]['descr'] = gettext("This user is associated with the UNIX root user (you should associate this privilege only with one single user)."); $config['system']['nextuid'] = "111"; $config['system']['nextgid'] = "111"; @@ -769,10 +769,10 @@ function upgrade_042_to_043() { } if(is_ipaddr($config['interfaces'][$ifname]['gateway'])) { $config['gateways']['gateway_item'][$i]['gateway'] = $config['interfaces'][$ifname]['gateway']; - $config['gateways']['gateway_item'][$i]['descr'] = "Interface $ifname Static Gateway"; + $config['gateways']['gateway_item'][$i]['descr'] = sprintf(gettext("Interface %s Static Gateway"), $ifname); } else { $config['gateways']['gateway_item'][$i]['gateway'] = "dynamic"; - $config['gateways']['gateway_item'][$i]['descr'] = "Interface $ifname Dynamic Gateway"; + $config['gateways']['gateway_item'][$i]['descr'] = sprintf(gettext("Interface %s Dynamic Gateway"), $ifname); } $config['gateways']['gateway_item'][$i]['interface'] = $ifname; $config['gateways']['gateway_item'][$i]['name'] = "GW_" . strtoupper($ifname); @@ -830,7 +830,7 @@ function upgrade_043_to_044() { $gateway['name'] = "SROUTE{$i}"; $gateway['gateway'] = $sroute['gateway']; $gateway['interface'] = $sroute['interface']; - $gateway['descr'] = "Upgraded static route for {$sroute['network']}"; + $gateway['descr'] = sprintf(gettext("Upgraded static route for %s"), $sroute['network']); if (!is_array($config['gateways']['gateway_item'])) $config['gateways']['gateway_item'] = array(); $config['gateways']['gateway_item'][] = $gateway; @@ -883,7 +883,7 @@ function upgrade_045_to_046() { $pool['type'] = 'server'; $pool['behaviour'] = 'balance'; $pool['name'] = "{$vs_a[$i]['name']}-sitedown"; - $pool['desc'] = "Sitedown pool for VS: {$vs_a[$i]['name']}"; + $pool['desc'] = sprintf(gettext("Sitedown pool for VS: %s"), $vs_a[$i]['name']); $pool['port'] = $pools[$vs_a[$i]['pool']]['port']; $pool['servers'] = array(); $pool['servers'][] = $vs_a[$i]['sitedown']; @@ -1028,7 +1028,7 @@ function upgrade_046_to_047() { if (isset($tunnel['disabled'])) $ph1ent['disabled'] = $tunnel['disabled']; - $ph2ent['descr'] = "phase2 for ".$tunnel['descr']; + $ph2ent['descr'] = sprintf(gettext("phase2 for %s"), $tunnel['descr']); $type = "lan"; if ($tunnel['local-subnet']['network']) @@ -1118,7 +1118,7 @@ function upgrade_047_to_048() { $tempdyn['host'] = $config['dyndns'][0]['host']; $tempdyn['mx'] = $config['dyndns'][0]['mx']; $tempdyn['interface'] = "wan"; - $tempdyn['descr'] = "Upgraded Dyndns {$tempdyn['type']}"; + $tempdyn['descr'] = sprintf(gettext("Upgraded Dyndns %s"), $tempdyn['type']); $config['dyndnses']['dyndns'][] = $tempdyn; } unset($config['dyndns']); @@ -1170,7 +1170,7 @@ function upgrade_048_to_049() { /* setup new all users group */ $all = array(); $all['name'] = "all"; - $all['description'] = "All Users"; + $all['description'] = gettext("All Users"); $all['scope'] = "system"; $all['gid'] = 1998; $all['member'] = array(); @@ -1297,7 +1297,7 @@ function upgrade_050_to_051() { if (isset($intf['bridge']) && $intf['bridge'] <> "") { $nbridge = array(); $nbridge['members'] = "{$ifr},{$intf['bridge']}"; - $nbridge['descr'] = "Converted bridged {$ifr}"; + $nbridge['descr'] = sprintf(gettext("Converted bridged %s"), $ifr); $nbridge['bridgeif'] = "bridge{$i}"; $config['bridges']['bridged'][] = $nbridge; unset($intf['bridge']); @@ -1555,7 +1555,7 @@ function upgrade_051_to_052() { $ovpnrule['destination'] = array(); $ovpnrule['source']['any'] = true; $ovpnrule['destination']['any'] = true; - $ovpnrule['descr'] = "Auto added OpenVPN rule from config upgrade."; + $ovpnrule['descr'] = gettext("Auto added OpenVPN rule from config upgrade."); $config['filter']['rule'][] = $ovpnrule; } -- cgit v1.1 From fd7b47b6f815a52a8cf699d7506c43d8661109b1 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Wed, 18 Aug 2010 14:08:01 -0300 Subject: Implement gettext() calls on util.inc --- etc/inc/util.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etc/inc/util.inc b/etc/inc/util.inc index 8632540..77af86d 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -102,7 +102,7 @@ function mark_subsystem_dirty($subsystem = "") { global $g; if (!file_put_contents("{$g['varrun_path']}/{$subsystem}.dirty", "DIRTY")) - log_error("WARNING: Could not mark subsystem: {$subsytem} dirty"); + log_error(sprintf(gettext("WARNING: Could not mark subsystem: %s dirty"), $subsystem)); } function clear_subsystem_dirty($subsystem = "") { @@ -122,7 +122,7 @@ function config_unlock() { function lock($lock, $op = LOCK_SH) { global $g, $cfglckkeyconsumers; if (!$lock) - die("WARNING: You must give a name as parameter to lock() function."); + die(gettext("WARNING: You must give a name as parameter to lock() function.")); if (!file_exists("{$g['tmp_path']}/{$lock}.lock")) @touch("{$g['tmp_path']}/{$lock}.lock"); $cfglckkeyconsumers++; @@ -169,7 +169,7 @@ function refcount_unreference($reference) { $shm_data = intval($shm_data) - 1; if ($shm_data < 0) { //debug_backtrace(); - log_error("Reference {$reference} is going negative, not doing unreference."); + log_error(sprintf(gettext("Reference %s is going negative, not doing unreference."), $reference)); } else shmop_write($shmid, $shm_data, 0); shmop_close($shmid); @@ -785,7 +785,7 @@ function mwexec($command, $mute = false) { $mute = false; if(($retval <> 0) && ($mute === false)) { $output = implode(" ", $oarr); - log_error("The command '$command' returned exit code '$retval', the output was '$output' "); + log_error(sprintf(gettext("The command '%s' returned exit code '%d', the output was '%s' "), $command, $retval, $output)); } return $retval; } -- cgit v1.1 From 89ceb4ba3c6eb536dfd8c5905e3278c6bb27fa6e Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Wed, 18 Aug 2010 15:49:52 -0300 Subject: Implement gettext() calls on vpn.inc --- etc/inc/vpn.inc | 64 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc index 1c204f0..33feb8e 100644 --- a/etc/inc/vpn.inc +++ b/etc/inc/vpn.inc @@ -123,7 +123,7 @@ function vpn_ipsec_configure($ipchg = false) mwexec("/sbin/ifconfig enc0 up"); if ($g['booting']) - echo "Configuring IPsec VPN... "; + echo gettext("Configuring IPsec VPN... "); /* fastforwarding is not compatible with ipsec tunnels */ mwexec("/sbin/sysctl net.inet.ip.fastforwarding=0"); @@ -209,18 +209,18 @@ function vpn_ipsec_configure($ipchg = false) if (is_array($config['system']['ca']) && count($config['system']['ca'])) { foreach ($config['system']['ca'] as $ca) { if (!isset($ca['crt'])) { - log_error("Error: Invalid certificate info for {$ca['name']}"); + log_error(sprintf(gettext("Error: Invalid certificate info for %s"), $ca['name'])); continue; } $cert = base64_decode($ca['crt']); $x509cert = openssl_x509_parse(openssl_x509_read($cert)); if (!is_array($x509cert) || !isset($x509cert['hash'])) { - log_error("Error: Invalid certificate hash info for {$ca['name']}"); + log_error(sprintf(gettext("Error: Invalid certificate hash info for %s"), $ca['name'])); continue; } $fname = $g['varetc_path']."/".$x509cert['hash'].".0"; if (!file_put_contents($fname, $cert)) { - log_error("Error: Cannot write IPsec CA file for {$ca['name']}"); + log_error(sprintf(gettext("Error: Cannot write IPsec CA file for %s"), $ca['name'])); continue; } } @@ -229,7 +229,7 @@ function vpn_ipsec_configure($ipchg = false) /* generate psk.txt */ $fd = fopen("{$g['varetc_path']}/psk.txt", "w"); if (!$fd) { - printf("Error: cannot open psk.txt in vpn_ipsec_configure().\n"); + printf(gettext("Error: cannot open psk.txt in vpn_ipsec_configure().") . "\n"); return 1; } @@ -291,7 +291,7 @@ function vpn_ipsec_configure($ipchg = false) $fd = fopen("{$g['varetc_path']}/racoon.conf", "w"); if (!$fd) { - printf("Error: cannot open racoon.conf in vpn_ipsec_configure().\n"); + printf(gettext("Error: cannot open racoon.conf in vpn_ipsec_configure().") . "\n"); return 1; } @@ -381,7 +381,7 @@ function vpn_ipsec_configure($ipchg = false) $fn = "{$g['varetc_path']}/racoon.motd"; $fd1 = fopen($fn, "w"); if (!$fd1) { - printf("Error: cannot open server{$fn} in vpn.\n"); + printf(gettext("Error: cannot open server %s in vpn.%s"). $fn, "\n"); return 1; } @@ -509,7 +509,7 @@ function vpn_ipsec_configure($ipchg = false) if (!$cert) { - log_error("Error: Invalid phase1 certificate reference for {$ph1ent['name']}"); + log_error(sprintf(gettext("Error: Invalid phase1 certificate reference for %s"), $ph1ent['name'])); continue; } @@ -518,7 +518,7 @@ function vpn_ipsec_configure($ipchg = false) if (!file_put_contents($certpath, base64_decode($cert['crt']))) { - log_error("Error: Cannot write phase1 certificate file for {$ph1ent['name']}"); + log_error(sprintf(gettext("Error: Cannot write phase1 certificate file for %s"), $ph1ent['name'])); continue; } @@ -529,7 +529,7 @@ function vpn_ipsec_configure($ipchg = false) if (!file_put_contents($keypath, base64_decode($cert['prv']))) { - log_error("Error: Cannot write phase1 key file for {$ph1ent['name']}"); + log_error(sprintf(gettext("Error: Cannot write phase1 key file for %s"), $ph1ent['name'])); continue; } @@ -542,7 +542,7 @@ function vpn_ipsec_configure($ipchg = false) if (!file_put_contents($capath, base64_decode($ca['crt']))) { - log_error("Error: Cannot write phase1 CA certificate file for {$ph1ent['name']}"); + log_error(sprintf(gettext("Error: Cannot write phase1 CA certificate file for %s"), $ph1ent['name'])); continue; } @@ -761,7 +761,7 @@ EOD; /* generate spd.conf */ $fd = fopen("{$g['varetc_path']}/spd.conf", "w"); if (!$fd) { - printf("Error: cannot open spd.conf in vpn_ipsec_configure().\n"); + printf(gettext("Error: cannot open spd.conf in vpn_ipsec_configure().") . "\n"); return 1; } @@ -840,7 +840,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("IPSEC interface is not WAN but {$parentinterface}, adding static route for VPN endpoint {$rgip} via {$gatewayip}"); + log_error(sprintf(gettext("IPSEC interface is not WAN but %s, adding static route for VPN endpoint %s via %s"), $parentinterface, $rgip, $gatewayip)); mwexec("/sbin/route delete -host {$rgip}"); mwexec("/sbin/route add -host {$rgip} {$gatewayip}"); } @@ -931,7 +931,7 @@ function vpn_ipsec_force_reload() { /* if ipsec is enabled, start up again */ if (isset($ipseccfg['enable'])) { - log_error("Forcefully reloading IPsec racoon daemon"); + log_error(gettext("Forcefully reloading IPsec racoon daemon")); vpn_ipsec_configure(); } @@ -959,7 +959,7 @@ function vpn_pptpd_configure() { if (!$pptpdcfg['mode'] || ($pptpdcfg['mode'] == "off")) return 0; - echo "Configuring PPTP VPN service... "; + echo gettext("Configuring PPTP VPN service... "); } else { /* kill mpd */ killbypid("{$g['varrun_path']}/pptp-vpn.pid"); @@ -969,7 +969,7 @@ function vpn_pptpd_configure() { if (is_process_running("mpd -b")) { killbypid("{$g['varrun_path']}/pptp-vpn.pid"); - log_error("Could not kill mpd within 3 seconds. Trying again."); + log_error(gettext("Could not kill mpd within 3 seconds. Trying again.")); } /* remove mpd.conf, if it exists */ @@ -987,7 +987,7 @@ function vpn_pptpd_configure() { /* write mpd.conf */ $fd = fopen("{$g['varetc_path']}/pptp-vpn/mpd.conf", "w"); if (!$fd) { - printf("Error: cannot open mpd.conf in vpn_pptpd_configure().\n"); + printf(gettext("Error: cannot open mpd.conf in vpn_pptpd_configure().") . "\n"); return 1; } @@ -1100,7 +1100,7 @@ EOD; /* write mpd.links */ $fd = fopen("{$g['varetc_path']}/pptp-vpn/mpd.links", "w"); if (!$fd) { - printf("Error: cannot open mpd.links in vpn_pptpd_configure().\n"); + printf(gettext("Error: cannot open mpd.links in vpn_pptpd_configure().") . "\n"); return 1; } @@ -1124,7 +1124,7 @@ EOD; /* write mpd.secret */ $fd = fopen("{$g['varetc_path']}/pptp-vpn/mpd.secret", "w"); if (!$fd) { - printf("Error: cannot open mpd.secret in vpn_pptpd_configure().\n"); + printf(gettext("Error: cannot open mpd.secret in vpn_pptpd_configure().") . "\n"); return 1; } @@ -1168,7 +1168,7 @@ function vpn_pppoe_configure() { if (!$pppoecfg['mode'] || ($pppoecfg['mode'] == "off")) return 0; - echo "Configuring PPPoE VPN service... "; + echo gettext("Configuring PPPoE VPN service... "); } else { /* kill mpd */ killbypid("{$g['varrun_path']}/pppoe-vpn.pid"); @@ -1196,7 +1196,7 @@ function vpn_pppoe_configure() { /* write mpd.conf */ $fd = fopen("{$g['varetc_path']}/pppoe-vpn/mpd.conf", "w"); if (!$fd) { - printf("Error: cannot open mpd.conf in vpn_pppoe_configure().\n"); + printf(gettext("Error: cannot open mpd.conf in vpn_pppoe_configure().") . "\n"); return 1; } $mpdconf = "\n\n"; @@ -1296,7 +1296,7 @@ EOD; /* write mpd.links */ $fd = fopen("{$g['varetc_path']}/pppoe-vpn/mpd.links", "w"); if (!$fd) { - printf("Error: cannot open mpd.links in vpn_pppoe_configure().\n"); + printf(gettext("Error: cannot open mpd.links in vpn_pppoe_configure().") . "\n"); return 1; } @@ -1321,7 +1321,7 @@ EOD; /* write mpd.secret */ $fd = fopen("{$g['varetc_path']}/pppoe-vpn/mpd.secret", "w"); if (!$fd) { - printf("Error: cannot open mpd.secret in vpn_pppoe_configure().\n"); + printf(gettext("Error: cannot open mpd.secret in vpn_pppoe_configure().") . "\n"); return 1; } @@ -1365,7 +1365,7 @@ function vpn_l2tp_configure() { if (!$l2tpcfg['mode'] || ($l2tpcfg['mode'] == "off")) return 0; - echo "Configuring l2tp VPN service... "; + echo gettext("Configuring l2tp VPN service... "); } else { /* kill mpd */ killbypid("{$g['varrun_path']}/l2tp-vpn.pid"); @@ -1390,7 +1390,7 @@ function vpn_l2tp_configure() { /* write mpd.conf */ $fd = fopen("{$g['varetc_path']}/l2tp-vpn/mpd.conf", "w"); if (!$fd) { - printf("Error: cannot open mpd.conf in vpn_l2tp_configure().\n"); + printf(gettext("Error: cannot open mpd.conf in vpn_l2tp_configure().") . "\n"); return 1; } $mpdconf = "\n\n"; @@ -1480,7 +1480,7 @@ EOD; /* write mpd.links */ $fd = fopen("{$g['varetc_path']}/l2tp-vpn/mpd.links", "w"); if (!$fd) { - printf("Error: cannot open mpd.links in vpn_l2tp_configure().\n"); + printf(gettext("Error: cannot open mpd.links in vpn_l2tp_configure().") . "\n"); return 1; } @@ -1505,7 +1505,7 @@ EOD; /* write mpd.secret */ $fd = fopen("{$g['varetc_path']}/l2tp-vpn/mpd.secret", "w"); if (!$fd) { - printf("Error: cannot open mpd.secret in vpn_l2tp_configure().\n"); + printf(gettext("Error: cannot open mpd.secret in vpn_l2tp_configure().") . "\n"); return 1; } @@ -1636,22 +1636,22 @@ function reload_tunnel_spd_policy($phase1, $phase2, $old_phase1, $old_phase2) { $rgip = resolve_retry($phase1['remote-gateway']); add_hostname_to_watch($phase1['remote-gateway']); if (!$rgip) { - log_error("Could not determine VPN endpoint for '{$phase1['descr']}'"); + log_error(sprintf(gettext("Could not determine VPN endpoint for '%s'"), $phase1['descr'])); return false; } } else { $rgip = $phase1['remote-gateway']; } if (!$ep) { - log_error("Could not determine VPN endpoint for '{$phase1['descr']}'"); + log_error(sprintf(gettext("Could not determine VPN endpoint for '%s'"), $phase1['descr'])); return false; } if((!is_ipaddr($old_ep)) || (! is_ipaddr($ep))) { - log_error("IPSEC: ERROR: One of the endpoints is not a IP address. Old EP '{$old_ep}' new EP '{$ep}'"); + log_error(sprintf(gettext("IPSEC: ERROR: One of the endpoints is not a IP address. Old EP '%s' new EP '%s'"), $old_ep, $ep)); } if((! is_ipaddr($rgip)) || (! is_ipaddr($old_gw))) { - log_error("IPSEC: ERROR: One of the remote endpoints is not a IP address. Old RG '{$old_gw}' new RG '{$rgip}'"); + log_error(sprintf(gettext("IPSEC: ERROR: One of the remote endpoints is not a IP address. Old RG '%s' new RG '%s'"), $old_gw, $rgip)); } $spdconf = ""; @@ -1697,7 +1697,7 @@ function reload_tunnel_spd_policy($phase1, $phase2, $old_phase1, $old_phase2) { "{$phase2['protocol']}/tunnel/{$rgip}-" . "{$ep}/unique;\n"; - log_error("Reloading IPsec tunnel '{$phase1['descr']}'. Previous IP '{$old_gw}', current IP '{$rgip}'. Reloading policy"); + log_error(sprintf(gettext("Reloading IPsec tunnel '%s'. Previous IP '%s', current IP '%s'. Reloading policy"), $phase1['descr'], $old_gw, $rgip)); $now = time(); $spdfile = tempnam("{$g['tmp_path']}", "spd.conf.reload.{$now}."); -- cgit v1.1 From 6ac0439bbcc38e9d1fdfdbc499563aa374aeab3d Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Wed, 18 Aug 2010 16:08:54 -0300 Subject: Implement gettext() calls on voucher.inc --- etc/inc/voucher.inc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/etc/inc/voucher.inc b/etc/inc/voucher.inc index 1cd4679..aec3951 100644 --- a/etc/inc/voucher.inc +++ b/etc/inc/voucher.inc @@ -89,7 +89,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[] = "$voucher ($roll/$nr) active and good for $remaining Minutes"; + $test_result[] = sprintf(gettext("%s (%s/%s) active and good for %d Minutes"), $voucher, $roll, $nr, $remaining); $total_minutes += $remaining; } else { // voucher not used. Check if ticket Id is on the roll (not too high) @@ -100,22 +100,22 @@ 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[] = "$voucher ($roll/$nr) already used and expired"; + $test_result[] = sprintf(gettext("%s (%s/%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[] = "$voucher ($roll/$nr) good for {$minutes_per_roll[$roll]} Minutes"; + $test_result[] = sprintf(gettext("%s (%s/%s) good for %d Minutes"), $voucher, $roll, $nr, $minutes_per_roll[$roll]); $total_minutes += $minutes_per_roll[$roll]; } } } else { - $test_result[] = "$voucher ($roll/$nr): not found on any registererd Roll"; + $test_result[] = sprintf(gettext("%s (%s/%s): not found on any registererd Roll"), $voucher, $roll, $nr); } } else { // hmm, thats weird ... not what I expected - $test_result[] = "$voucher invalid: $result !!"; + $test_result[] = "$voucher " . gettext("invalid:") . " $result !!"; $error++; } } @@ -123,9 +123,9 @@ function voucher_auth($voucher_received, $test = 0) { // if this was a test call, we're done. Return the result. if ($test) { if ($error) { - $test_result[] = "Access denied!"; + $test_result[] = gettext("Access denied!"); } else { - $test_result[] = "Access granted for $total_minutes Minutes in total."; + $test_result[] = sprintf(gettext("Access granted for %d Minutes in total."), $total_minutes); } unlock($voucherlck); return $test_result; @@ -198,7 +198,7 @@ function voucher_configure() { $pubkey = base64_decode($config['voucher']['publickey']); $fd = fopen("{$g['varetc_path']}/voucher.public", "w"); if (!$fd) { - printf("Error: cannot write voucher.public\n"); + printf(gettext("Error: cannot write voucher.public") . "\n"); unlock($voucherlck); return 1; } @@ -209,7 +209,7 @@ function voucher_configure() { /* write config file used by voucher binary to decode vouchers */ $fd = fopen("{$g['varetc_path']}/voucher.cfg", "w"); if (!$fd) { - printf("Error: cannot write voucher.cfg\n"); + printf(gettext("Error: cannot write voucher.cfg") . "\n"); unlock($voucherlck); return 1; } -- cgit v1.1 From 32296995fe9b67d1f89f93a520b7eec8ac19cb38 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Thu, 19 Aug 2010 10:59:53 -0300 Subject: Fix gettext on upgrade_config.inc --- etc/inc/upgrade_config.inc | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index be3ff31..a59c855 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -657,91 +657,91 @@ function upgrade_040_to_041() { $config['sysctl']['item'] = array(); $config['sysctl']['item'][0]['tunable'] = "net.inet.tcp.blackhole"; - $config['sysctl']['item'][0]['desc'] = "Drop packets to closed TCP ports without returning a RST"; + $config['sysctl']['item'][0]['desc'] = gettext("Drop packets to closed TCP ports without returning a RST"); $config['sysctl']['item'][0]['value'] = "default"; $config['sysctl']['item'][1]['tunable'] = "net.inet.udp.blackhole"; - $config['sysctl']['item'][1]['desc'] = "Do not send ICMP port unreachable messages for closed UDP ports"; + $config['sysctl']['item'][1]['desc'] = gettext("Do not send ICMP port unreachable messages for closed UDP ports"); $config['sysctl']['item'][1]['value'] = "default"; $config['sysctl']['item'][2]['tunable'] = "net.inet.ip.random_id"; - $config['sysctl']['item'][2]['desc'] = "Randomize the ID field in IP packets (default is 0: sequential IP IDs)"; + $config['sysctl']['item'][2]['desc'] = gettext("Randomize the ID field in IP packets (default is 0: sequential IP IDs)"); $config['sysctl']['item'][2]['value'] = "default"; $config['sysctl']['item'][3]['tunable'] = "net.inet.tcp.drop_synfin"; - $config['sysctl']['item'][3]['desc'] = "Drop SYN-FIN packets (breaks RFC1379, but nobody uses it anyway)"; + $config['sysctl']['item'][3]['desc'] = gettext("Drop SYN-FIN packets (breaks RFC1379, but nobody uses it anyway)"); $config['sysctl']['item'][3]['value'] = "default"; $config['sysctl']['item'][4]['tunable'] = "net.inet.ip.redirect"; - $config['sysctl']['item'][4]['desc'] = "Sending of IPv4 ICMP redirects"; + $config['sysctl']['item'][4]['desc'] = gettext("Sending of IPv4 ICMP redirects"); $config['sysctl']['item'][4]['value'] = "default"; $config['sysctl']['item'][5]['tunable'] = "net.inet6.ip6.redirect"; - $config['sysctl']['item'][5]['desc'] = "Sending of IPv6 ICMP redirects"; + $config['sysctl']['item'][5]['desc'] = gettext("Sending of IPv6 ICMP redirects"); $config['sysctl']['item'][5]['value'] = "default"; $config['sysctl']['item'][6]['tunable'] = "net.inet.tcp.syncookies"; - $config['sysctl']['item'][6]['desc'] = "Generate SYN cookies for outbound SYN-ACK packets"; + $config['sysctl']['item'][6]['desc'] = gettext("Generate SYN cookies for outbound SYN-ACK packets"); $config['sysctl']['item'][6]['value'] = "default"; $config['sysctl']['item'][7]['tunable'] = "net.inet.tcp.recvspace"; - $config['sysctl']['item'][7]['desc'] = "Maximum incoming TCP datagram size"; + $config['sysctl']['item'][7]['desc'] = gettext("Maximum incoming TCP datagram size"); $config['sysctl']['item'][7]['value'] = "default"; $config['sysctl']['item'][8]['tunable'] = "net.inet.tcp.sendspace"; - $config['sysctl']['item'][8]['desc'] = "Maximum outgoing TCP datagram size"; + $config['sysctl']['item'][8]['desc'] = gettext("Maximum outgoing TCP datagram size"); $config['sysctl']['item'][8]['value'] = "default"; $config['sysctl']['item'][9]['tunable'] = "net.inet.ip.fastforwarding"; - $config['sysctl']['item'][9]['desc'] = "Fastforwarding (see http://lists.freebsd.org/pipermail/freebsd-net/2004-January/002534.html)"; + $config['sysctl']['item'][9]['desc'] = gettext("Fastforwarding (see http://lists.freebsd.org/pipermail/freebsd-net/2004-January/002534.html)"); $config['sysctl']['item'][9]['value'] = "default"; $config['sysctl']['item'][10]['tunable'] = "net.inet.tcp.delayed_ack"; - $config['sysctl']['item'][10]['desc'] = "Do not delay ACK to try and piggyback it onto a data packet"; + $config['sysctl']['item'][10]['desc'] = gettext("Do not delay ACK to try and piggyback it onto a data packet"); $config['sysctl']['item'][10]['value'] = "default"; $config['sysctl']['item'][11]['tunable'] = "net.inet.udp.maxdgram"; - $config['sysctl']['item'][11]['desc'] = "Maximum outgoing UDP datagram size"; + $config['sysctl']['item'][11]['desc'] = gettext("Maximum outgoing UDP datagram size"); $config['sysctl']['item'][11]['value'] = "default"; $config['sysctl']['item'][12]['tunable'] = "net.link.bridge.pfil_onlyip"; - $config['sysctl']['item'][12]['desc'] = "Handling of non-IP packets which are not passed to pfil (see if_bridge(4))"; + $config['sysctl']['item'][12]['desc'] = gettext("Handling of non-IP packets which are not passed to pfil (see if_bridge(4))"); $config['sysctl']['item'][12]['value'] = "default"; $config['sysctl']['item'][13]['tunable'] = "net.link.tap.user_open"; - $config['sysctl']['item'][13]['desc'] = "Allow unprivileged access to tap(4) device nodes"; + $config['sysctl']['item'][13]['desc'] = gettext("Allow unprivileged access to tap(4) device nodes"); $config['sysctl']['item'][13]['value'] = "default"; $config['sysctl']['item'][14]['tunable'] = "kern.rndtest.verbose"; - $config['sysctl']['item'][14]['desc'] = "Verbosity of the rndtest driver (0: do not display results on console)"; + $config['sysctl']['item'][14]['desc'] = gettext("Verbosity of the rndtest driver (0: do not display results on console)"); $config['sysctl']['item'][14]['value'] = "default"; $config['sysctl']['item'][15]['tunable'] = "kern.randompid"; - $config['sysctl']['item'][15]['desc'] = "Randomize PID's (see src/sys/kern/kern_fork.c: sysctl_kern_randompid())"; + $config['sysctl']['item'][15]['desc'] = gettext("Randomize PID's (see src/sys/kern/kern_fork.c: sysctl_kern_randompid())"); $config['sysctl']['item'][15]['value'] = "default"; $config['sysctl']['item'][16]['tunable'] = "net.inet.tcp.inflight.enable"; - $config['sysctl']['item'][16]['desc'] = "The system will attempt to calculate the bandwidth delay product for each connection and limit the amount of data queued to the network to just the amount required to maintain optimum throughput. "; + $config['sysctl']['item'][16]['desc'] = gettext("The system will attempt to calculate the bandwidth delay product for each connection and limit the amount of data queued to the network to just the amount required to maintain optimum throughput. "); $config['sysctl']['item'][16]['value'] = "default"; $config['sysctl']['item'][17]['tunable'] = "net.inet.icmp.icmplim"; - $config['sysctl']['item'][17]['desc'] = "Set ICMP Limits"; + $config['sysctl']['item'][17]['desc'] = gettext("Set ICMP Limits"); $config['sysctl']['item'][17]['value'] = "default"; $config['sysctl']['item'][18]['tunable'] = "net.inet.tcp.tso"; - $config['sysctl']['item'][18]['desc'] = "TCP Offload engine"; + $config['sysctl']['item'][18]['desc'] = gettext("TCP Offload engine"); $config['sysctl']['item'][18]['value'] = "default"; $config['sysctl']['item'][19]['tunable'] = "hw.bce.tso_enable"; - $config['sysctl']['item'][19]['desc'] = "TCP Offload engine - BCE"; + $config['sysctl']['item'][19]['desc'] = gettext("TCP Offload engine - BCE"); $config['sysctl']['item'][19]['value'] = "default"; $config['sysctl']['item'][20]['tunable'] = "net.inet.ip.portrange.first"; - $config['sysctl']['item'][20]['desc'] = "Set the ephemeral port range starting port"; + $config['sysctl']['item'][20]['desc'] = gettext("Set the ephemeral port range starting port"); $config['sysctl']['item'][20]['value'] = "default"; $config['sysctl']['item'][21]['tunable'] = "hw.syscons.kbd_reboot "; - $config['sysctl']['item'][21]['desc'] = "Enables ctrl+alt+delete"; + $config['sysctl']['item'][21]['desc'] = gettext("Enables ctrl+alt+delete"); $config['sysctl']['item'][21]['value'] = "default"; } -- cgit v1.1 From ed462aae2ba226b0242474f7fd032b7cd988fe0a Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Thu, 19 Aug 2010 16:06:48 -0300 Subject: Fix gettext on voucher.inc --- etc/inc/voucher.inc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/etc/inc/voucher.inc b/etc/inc/voucher.inc index aec3951..29e35c8 100644 --- a/etc/inc/voucher.inc +++ b/etc/inc/voucher.inc @@ -181,7 +181,7 @@ function voucher_configure() { if (isset($config['voucher']['enable'])) { if ($g['booting']) { - echo "Enabling voucher support... "; + echo gettext("Enabling voucher support... "); } // start cron if we're asked to save runtime DB periodically @@ -245,7 +245,7 @@ function voucher_configure() { } unlock($voucherlck); - echo "done\n"; + echo gettext("done") . "\n"; } } return 0; @@ -263,7 +263,7 @@ function voucher_write_used_db($roll, $vdb) { fwrite($fd, $vdb . "\n"); fclose($fd); } else { - voucher_log(LOG_ERR, "cant write {$g['vardb_path']}/voucher_used_$roll.db"); + voucher_log(LOG_ERR, sprintf(gettext("cant write %s/voucher_used_%s.db"), $g['vardb_path'], $roll)); } } @@ -342,7 +342,7 @@ function voucher_read_used_db($roll) { $vdb = trim(fgets($fd)); fclose($fd); } else { - voucher_log(LOG_ERR, "cant read {$g['vardb_path']}/voucher_used_$roll.db"); + voucher_log(LOG_ERR, sprintf(gettext("cant read %s/voucher_used_%s.db"), $g['vardb_path'], $roll)); } } return base64_decode($vdb); @@ -361,7 +361,7 @@ function voucher_log($priority, $message) { define_syslog_variables(); $message = trim($message); openlog("logportalauth", LOG_PID, LOG_LOCAL4); - syslog($priority, "Voucher: " . $message); + syslog($priority, gettext("Voucher: ") . $message); closelog(); } -- cgit v1.1 From 561130e43b6b131e94a30852890e1c0cf3b844e9 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Thu, 19 Aug 2010 16:23:38 -0300 Subject: Fix gettext on vpn.inc --- etc/inc/vpn.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc index 33feb8e..922cd5f 100644 --- a/etc/inc/vpn.inc +++ b/etc/inc/vpn.inc @@ -1346,7 +1346,7 @@ EOD; } if ($g['booting']) - echo "done\n"; + echo gettext("done") . "\n"; return 0; } -- cgit v1.1 From 94258864263fd7f1224c294e836f0a79bdededb5 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Thu, 19 Aug 2010 17:02:40 -0300 Subject: Fix gettext on xmlrpc_client.inc --- etc/inc/xmlrpc_client.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/inc/xmlrpc_client.inc b/etc/inc/xmlrpc_client.inc index 229bb7f..59a9678 100644 --- a/etc/inc/xmlrpc_client.inc +++ b/etc/inc/xmlrpc_client.inc @@ -1493,7 +1493,7 @@ class XML_RPC_Message extends XML_RPC_Base !$GLOBALS['XML_RPC_func_ereg']('^HTTP/[0-9\.]+ 10[0-9]([A-Z ]+)?[\r\n]+HTTP/[0-9\.]+ 200', $data)) { $errstr = substr($data, 0, strpos($data, "\n") - 1); - error_log('HTTP error, got response: ' . $errstr); + error_log(gettext("HTTP error, got response: ") . $errstr); $r = new XML_RPC_Response(0, $XML_RPC_err['http_error'], $XML_RPC_str['http_error'] . ' (' . $errstr . ')'); @@ -1519,7 +1519,7 @@ class XML_RPC_Message extends XML_RPC_Base if (!xml_parse($parser_resource, $data, sizeof($data))) { // thanks to Peter Kocks if (xml_get_current_line_number($parser_resource) == 1) { - $errstr = 'XML error at line 1, check URL'; + $errstr = gettext("XML error at line 1, check URL"); } else { $errstr = sprintf('XML error: %s at line %d', xml_error_string(xml_get_error_code($parser_resource)), -- cgit v1.1 From 18efed8bcebbcbcd28e94d9780db8f910f951ceb Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Fri, 20 Aug 2010 09:41:26 -0300 Subject: Fix gettext on shaper.inc --- etc/inc/shaper.inc | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/etc/inc/shaper.inc b/etc/inc/shaper.inc index 7f4b644..06cc4ba 100644 --- a/etc/inc/shaper.inc +++ b/etc/inc/shaper.inc @@ -1086,14 +1086,14 @@ class priq_queue { $form .= ""; $form .= ""; $form .= ""; - $form .= "Queue Name"; + $form .= gettext("Queue Name") . ""; $form .= "GetQname()); $form .= "\">"; $form .= "
" . gettext("Enter the name of the queue here. Do not use spaces and limit the size to 15 characters."); $form .= "
"; $form .= ""; - $form .= "Priority"; + $form .= "" . gettext("Priority") . ""; $form .= " GetQpriority()); $form .= "\">"; @@ -1813,19 +1813,19 @@ class hfsc_queue extends priq_queue { $form .= ""; + $form .= ">" . gettext("Gbit/s") . ""; $form .= ""; + $form .= ">" . gettext("Mbit/s") . ""; $form .= ""; + $form .= ">" . gettext("Kbit/s") . ""; $form .= ""; + $form .= ">" . gettext("Bit/s") . ""; $form .= ""; + $form .= ">" . gettext("Gbit/s") . ""; $form .= ""; + $form .= ">" . gettext("Mbit/s") . ""; $form .= ""; + $form .= ">" . gettext("Kbit/s") . ""; $form .= ""; + $form .= ">" . gettext("Bit/s") . ""; $form .= ""; + $form .= ">" . gettext("Gbit/s") . ""; $form .= ""; + $form .= ">" . gettext("Mbit/s") . ""; $form .= ""; + $form .= ">" . gettext("Kbit/s") . ""; $form .= ""; + $form .= ">" . gettext("Bit/s") . ""; $form .= ""; + $form .= ">" .gettext( "Kbit/s") . ""; $form .= ""; + $form .= ">" . gettext("Mbit/s") . ""; $form .= ""; + $form .= ">" . gettext("Gbit/s") . ""; $form .= "
"; $form .= "
"; $form .= ""; - $form .= "Packet loss rate"; + $form .= "" . gettext("Packet loss rate") . ""; $form .= ""; $form .= "GetPlr() . "\">"; @@ -3657,7 +3657,7 @@ function layer7_start_l7daemon() { /* Only reread the configuration rather than restart to avoid loosing information. */ exec("/bin/pgrep -f 'ipfw-classifyd .* -p ". $l7rules->GetRPort() . "'", $l7pid); if (count($l7pid) > 0) { - log_error("Sending HUP signal to {$l7pid[0]}"); + log_error(sprintf(gettext("Sending HUP signal to %s"), $l7pid[0])); mwexec("/bin/kill -HUP {$l7pid[0]}"); } else { // XXX: Hardcoded number of packets to garbage collect and queue length.. -- cgit v1.1 From a8cc4ac70e1018f4ce146c909f1e81f2562eef47 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Fri, 20 Aug 2010 10:23:15 -0300 Subject: Fix gettext on filter.inc --- etc/inc/filter.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 1f50139..4371aec 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -213,7 +213,7 @@ function filter_configure_sync() { unlink_if_exists("{$g['tmp_path']}/filter_loading"); update_filter_reload_status(gettext("Filter is disabled. Not loading rules.")); if($g['booting'] == true) - echo "done.\n"; + echo gettext("done.") . "\n"; unlock($filterlck); return; } @@ -385,7 +385,7 @@ function filter_configure_sync() { update_filter_reload_status(gettext("Done")); if($g['booting'] == true) - echo "done.\n"; + echo gettext("done.") . "\n"; return 0; } -- cgit v1.1 From 701a250b6ede4936d1dd677b8e1813a440e90c71 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Mon, 30 Aug 2010 19:45:58 -0300 Subject: Fix gettext calls with printf to permit change strings order --- etc/inc/auth.inc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc index 6fa418c..1180174 100644 --- a/etc/inc/auth.inc +++ b/etc/inc/auth.inc @@ -928,7 +928,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 %s, container %s with filter %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 @@ -961,12 +961,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 %s as user %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 %s via LDAP server %s with DN = %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); @@ -1145,7 +1145,7 @@ function session_auth() { $_SESSION['Logged_In'] = "True"; $_SESSION['Username'] = $_POST['usernamefld']; $_SESSION['last_access'] = time(); - log_error(sprintf(gettext("Successful login for user '%s' from: %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; @@ -1158,7 +1158,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: '%s' from: '%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; @@ -1198,9 +1198,9 @@ function session_auth() { if (isset($_GET['logout'])) { if ($_SESSION['Logout']) - log_error(sprintf(gettext("Session timed out for user '%s' from: %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 '%s' from: %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(); -- cgit v1.1 From 47f12397b3ec7f6fa860d21136a7deca9f6573e8 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Mon, 30 Aug 2010 20:36:30 -0300 Subject: Fix gettext calls with printf to permit change strings order --- etc/inc/authgui.inc | 2 +- etc/inc/cmd_chain.inc | 6 +++--- etc/inc/config.lib.inc | 8 ++++---- etc/inc/filter.inc | 12 ++++++------ etc/inc/filter_log.inc | 2 +- etc/inc/gwlb.inc | 4 ++-- etc/inc/interfaces.inc | 8 ++++---- etc/inc/meta.inc | 8 ++++---- etc/inc/notices.inc | 4 ++-- etc/inc/pfsense-utils.inc | 12 ++++++------ etc/inc/pkg-utils.inc | 4 ++-- etc/inc/rrd.inc | 10 +++++----- etc/inc/services.inc | 2 +- etc/inc/smtp.inc | 6 +++--- etc/inc/system.inc | 2 +- etc/inc/util.inc | 2 +- etc/inc/voucher.inc | 12 ++++++------ etc/inc/vpn.inc | 8 ++++---- etc/inc/xmlparse.inc | 4 ++-- etc/inc/xmlparse_attr.inc | 4 ++-- etc/inc/xmlrpc_client.inc | 2 +- 21 files changed, 61 insertions(+), 61 deletions(-) diff --git a/etc/inc/authgui.inc b/etc/inc/authgui.inc index 97b2899..143e4a2 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: %s Description: %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 ea295cd..399210e 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 -> %s - %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 -> %s. The command was %s"), $cmd_title, $status, $command)); + log_error(sprintf(gettext("%s failed with return code -> %1$s. The command was %2$s"), $cmd_title, $status, $command)); if($this->halt_on_errors == true) - return(sprintf(gettext("%s failed with return code -> %s. The command was %s"), $cmd_title, $status, $command)); + return(sprintf(gettext("%s failed with return code -> %1$s. The command was %2$s"), $cmd_title, $status, $command)); } } return; diff --git a/etc/inc/config.lib.inc b/etc/inc/config.lib.inc index f38cfd9..29576cb 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("%s is restoring the configuration %s"), $g['product_name'], $file)); - file_notice("config.xml", sprintf(gettext("%s is restoring the configuration %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 %s to %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("%s at line %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 ec11bf0..8e7757a 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -319,9 +319,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 [%d]: %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: %s - %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); @@ -608,7 +608,7 @@ function filter_generate_gateways() { $gatewayip = $member['gwip']; if (($int <> "") && is_ipaddr($gatewayip)) { if ($g['debug']) - log_error(sprintf(gettext("Setting up route with %s on %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 @@ -1254,7 +1254,7 @@ function filter_nat_rules_generate() { } if($numberofnathosts > 0): foreach ($FilterIflist as $if => $ifcfg) { - update_filter_reload_status(sprintf(gettext("Creating outbound rules %s - (%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 */ @@ -2653,12 +2653,12 @@ function discover_pkg_rules($ruletype) { foreach($files as $pkg_inc) { if($pkg_inc == "ls: No match.") continue; - update_filter_reload_status(sprintf(gettext("Checking for %s PF hooks in package %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 %s rules for package %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", $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 e78bc0c..b027f6e 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("%s"), $port, $proto, $service, htmlspecialchars($port)); + $portstr = sprintf(gettext("%4$s"), $port, $proto, $service, htmlspecialchars($port)); } else { $portstr = htmlspecialchars($port); } diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 637d9ac..0e40341 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -230,7 +230,7 @@ EOD; mwexec("/sbin/route delete -host " . escapeshellarg($gateway['monitor'])); mwexec("/sbin/route add -host " . escapeshellarg($gateway['monitor']) . " " . escapeshellarg($gateway['gateway'])); - log_error(sprintf(gettext("Removing static route for monitor %s and adding a new route through %s"), $gateway['monitor'], $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'])); } } } @@ -469,7 +469,7 @@ function dhclient_update_gateway_groups_defaultroute($interface = "wan") { } } if($changed && $current_gw) - write_config(sprintf(gettext("Updating gateway group gateway for %s - new gateway is %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 11e8321..5366ebc 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1109,7 +1109,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 %s for %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; @@ -1725,7 +1725,7 @@ function interface_carpdev_configure(&$vip) { if($vip['password'] != "") $password = " pass \"" . $vip_password . "\""; - log_error(sprintf(gettext("Found carpdev interface %s on top of interface %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; @@ -1841,7 +1841,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 %s with error code %s, output %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]); @@ -2358,7 +2358,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 %s has been automatically replaced with %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 63c9391..4216185 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 ( %s != %s ) in '%s'%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 %s has no data in '%s'%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 %s has malformed data in '%s'%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 %s has invalid data in '%s'%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 6d4ed1e..224e680 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 %s -- Error: %s"), $to, $smtp->error)); - return(sprintf(gettext("Could not send the message to %s -- Error: %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 37cb340..833c802 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 '%s' - %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 (%s) to {%s} MAC=%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 %s: %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 %s and new IP %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 %s to %s%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 %s to %s%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 d3d0e48..3766350 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -224,7 +224,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 %s package is missing required dependencies and must be reinstalled. %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'])); install_package($package['name']); uninstall_package_from_name($package['name']); install_package($package['name']); @@ -641,7 +641,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 %s for %s%s%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 574c6a6..34ed887 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 %s, the error is: %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 %s, the error is: %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 %s DS values and %s RRA databases, new format RRD has %s DS values and %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 %s DS values and %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 %s, the error is: %s%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 682472a..1c1f1fd 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 %s, the error is: %s%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 7276ed8..c33978d 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 \"%s\" port %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 \"%s\": %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 %s may not be used: %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 bcc0e0e..c21be19 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -338,7 +338,7 @@ function system_routing_configure($interface = "") { if(isset($route_arr['default'])) { $action = "change"; } - log_error(sprintf(gettext("ROUTING: %s default route to %s"), $action, $gatewayip)); + log_error(sprintf(gettext("ROUTING: %1$s default route to %2$s"), $action, $gatewayip)); mwexec("/sbin/route {$action} default " . escapeshellarg($gatewayip)); } else if (is_ipaddr($config['interfaces']['wan']['gateway'])) { /* Adding gateway for 1.2-style configs without the new diff --git a/etc/inc/util.inc b/etc/inc/util.inc index 77af86d..8a9db4f 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -785,7 +785,7 @@ function mwexec($command, $mute = false) { $mute = false; if(($retval <> 0) && ($mute === false)) { $output = implode(" ", $oarr); - log_error(sprintf(gettext("The command '%s' returned exit code '%d', the output was '%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 978b1d2..e746d8a 100644 --- a/etc/inc/voucher.inc +++ b/etc/inc/voucher.inc @@ -89,7 +89,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("%s (%s/%s) active and good for %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) @@ -100,18 +100,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("%s (%s/%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("%s (%s/%s) good for %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("%s (%s/%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 @@ -330,7 +330,7 @@ function voucher_write_used_db($roll, $vdb) { fwrite($fd, $vdb . "\n"); fclose($fd); } else { - voucher_log(LOG_ERR, sprintf(gettext("cant write %s/voucher_used_%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)); } } @@ -409,7 +409,7 @@ function voucher_read_used_db($roll) { $vdb = trim(fgets($fd)); fclose($fd); } else { - voucher_log(LOG_ERR, sprintf(gettext("cant read %s/voucher_used_%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 ab8d474..ce7d501 100644 --- a/etc/inc/vpn.inc +++ b/etc/inc/vpn.inc @@ -840,7 +840,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 %s, adding static route for VPN endpoint %s via %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}"); } @@ -1648,10 +1648,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 '%s' new EP '%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 '%s' new RG '%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 = ""; @@ -1697,7 +1697,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 '%s'. Previous IP '%s', current IP '%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 aa4d7e4..013f81d 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: %s at line %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: %s at line %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 04428cc..534ffb5 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: %s at line %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: %s at line %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 59a9678..bd0f1bd 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 %s cannot be child of %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; } } -- cgit v1.1 From addc0439931fb28c626c7024b1e9857adfe29f29 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Fri, 1 Oct 2010 10:17:13 -0300 Subject: Fix quotes to use %N$X on gettext calls --- etc/inc/auth.inc | 14 +++++++------- etc/inc/authgui.inc | 2 +- etc/inc/cmd_chain.inc | 6 +++--- etc/inc/config.lib.inc | 8 ++++---- etc/inc/filter.inc | 12 ++++++------ etc/inc/filter_log.inc | 2 +- etc/inc/gwlb.inc | 2 +- etc/inc/interfaces.inc | 8 ++++---- etc/inc/meta.inc | 8 ++++---- etc/inc/notices.inc | 4 ++-- etc/inc/pfsense-utils.inc | 12 ++++++------ etc/inc/pkg-utils.inc | 4 ++-- etc/inc/rrd.inc | 10 +++++----- etc/inc/services.inc | 2 +- etc/inc/smtp.inc | 6 +++--- etc/inc/system.inc | 2 +- etc/inc/util.inc | 2 +- etc/inc/voucher.inc | 12 ++++++------ etc/inc/vpn.inc | 8 ++++---- etc/inc/xmlparse.inc | 4 ++-- etc/inc/xmlparse_attr.inc | 4 ++-- 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("%4$s"), $port, $proto, $service, htmlspecialchars($port)); + $portstr = sprintf('' . htmlspecialchars($port) . '', $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; } } -- cgit v1.1 From 8e1fd4fea9d0d6f16f3119b36bd8323e9b76d5ef Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Fri, 1 Oct 2010 10:29:29 -0300 Subject: More gettext fixes --- etc/inc/PEAR.inc | 4 ++-- etc/inc/auth.inc | 4 ++-- etc/inc/config.console.inc | 2 +- etc/inc/meta.inc | 4 ++-- etc/inc/system.inc | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/etc/inc/PEAR.inc b/etc/inc/PEAR.inc index ac5cc12..961a548 100644 --- a/etc/inc/PEAR.inc +++ b/etc/inc/PEAR.inc @@ -158,7 +158,7 @@ class PEAR { $classname = strtolower(get_class($this)); if ($this->_debug) { - printf(gettext("PEAR constructor called, class=%s%s"), $classname, "\n"); + printf(gettext("PEAR constructor called, class=%s\n"), $classname); } if ($error_class !== null) { $this->_error_class = $error_class; @@ -195,7 +195,7 @@ class PEAR */ function _PEAR() { if ($this->_debug) { - printf(gettext("PEAR destructor called, class=%s%s"), strtolower(get_class($this)), "\n"); + printf(gettext("PEAR destructor called, class=%s\n"), strtolower(get_class($this))); } } diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc index f48a9bc..0d01e50 100644 --- a/etc/inc/auth.inc +++ b/etc/inc/auth.inc @@ -999,7 +999,7 @@ function radius_backed($username, $passwd, $authcfg){ $retvalue['auth_val'] = 1; $retvalue['error'] = $rauth->getError(); if ($debug) - printf(gettext("Radius start: %s%s"), $retvalue['error'], "
\n"); + printf(gettext("Radius start: %s
\n"), $retvalue['error']); } // XXX - billm - somewhere in here we need to handle securid challenge/response @@ -1010,7 +1010,7 @@ function radius_backed($username, $passwd, $authcfg){ $retvalue['auth_val'] = 1; $retvalue['error'] = $result->getMessage(); if ($debug) - printf(gettext("Radius send failed: %s%s"), $retvalue['error'], "
\n"); + printf(gettext("Radius send failed: %s
\n"), $retvalue['error']); } else if ($result === true) { $retvalue['auth_val'] = 2; if ($debug) diff --git a/etc/inc/config.console.inc b/etc/inc/config.console.inc index 3c783b2..934f0d1 100644 --- a/etc/inc/config.console.inc +++ b/etc/inc/config.console.inc @@ -301,7 +301,7 @@ EOD; } } - printf(gettext("%sThe interfaces will be assigned as follows: %s%s"), "\n", "\n", "\n"); + echo "\n" . gettext("The interfaces will be assigned as follows:") . "\n\n"; if ($lanif != "") echo "LAN -> " . $lanif . "\n"; diff --git a/etc/inc/meta.inc b/etc/inc/meta.inc index cad7942..11295f5 100644 --- a/etc/inc/meta.inc +++ b/etc/inc/meta.inc @@ -65,7 +65,7 @@ function list_phpfiles($path, & $found) { $dir = opendir($path); if (!$dir) { - printf(gettext("list_phpfiles: unable to examine path %s%s"), $path, "\n"); + printf(gettext("list_phpfiles: unable to examine path %s\n"), $path); return; } @@ -96,7 +96,7 @@ function read_file_metadata($fpath, & $metadata, $taglist = false) { $fdata = @file_get_contents($fpath); if (!$fdata) { - printf(gettext("unable to read %s%s"), $fpath, "\n"); + printf(gettext("unable to read %s\n"), $fpath); continue; } diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 69fb427..4318446 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -1142,7 +1142,7 @@ function system_ntp_configure() { /* foreach through servers and write out to ntpd.conf */ foreach (explode(' ', $syscfg['timeservers']) as $ts) - fwrite($fd, sprintf(gettext("servers %s%s"), $ts, "\n")); + fwrite($fd, sprintf(gettext("servers %s\n"), $ts)); /* Setup listener(s) if the user has configured one */ if ($config['installedpackages']['openntpd']) { -- cgit v1.1 From 26f131b816e4925b94a7c74601238e5250c620c8 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Fri, 15 Oct 2010 09:14:56 -0300 Subject: Fix typo --- etc/inc/voucher.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/inc/voucher.inc b/etc/inc/voucher.inc index 27e6763..1aaf91e 100644 --- a/etc/inc/voucher.inc +++ b/etc/inc/voucher.inc @@ -170,7 +170,7 @@ function voucher_auth($voucher_received, $test = 0) { } 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$s) good for %4$d Minutes'), $voucher, $roll, $nr, $minutes_per_roll[$roll]); $total_minutes += $minutes_per_roll[$roll]; } } -- cgit v1.1 From 94044c40dc4d868b65b4e717f582bec965bb6697 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Thu, 2 Dec 2010 16:46:41 -0200 Subject: BP: Implement gettext() calls on fbegin.inc #multilang --- usr/local/www/fbegin.inc | 166 +++++++++++++++++++++++------------------------ 1 file changed, 83 insertions(+), 83 deletions(-) diff --git a/usr/local/www/fbegin.inc b/usr/local/www/fbegin.inc index 92d90fb..098a4f2 100755 --- a/usr/local/www/fbegin.inc +++ b/usr/local/www/fbegin.inc @@ -80,16 +80,16 @@ function output_menu($arrayitem, $target="") { // System $system_menu = array(); -$system_menu[] = array("Advanced", "/system_advanced_admin.php"); -$system_menu[] = array("Firmware", "/system_firmware.php"); -$system_menu[] = array("General Setup", "/system.php"); -$system_menu[] = array("Logout", "/index.php?logout"); +$system_menu[] = array(gettext("Advanced"), "/system_advanced_admin.php"); +$system_menu[] = array(gettext("Firmware"), "/system_firmware.php"); +$system_menu[] = array(gettext("General Setup"), "/system.php"); +$system_menu[] = array(gettext("Logout"), "/index.php?logout"); if ($g['platform'] == "pfSense" or $g['platform'] == "nanobsd") - $system_menu[] = array("Packages", "/pkg_mgr_installed.php"); -$system_menu[] = array("Setup Wizard", "/wizard.php?xml=setup_wizard.xml"); -$system_menu[] = array("Routing", "/system_gateways.php"); -$system_menu[] = array("Cert Manager", "/system_camanager.php"); -$system_menu[] = array("User Manager", "/system_usermanager.php"); + $system_menu[] = array(gettext("Packages"), "/pkg_mgr_installed.php"); +$system_menu[] = array(gettext("Setup Wizard"), "/wizard.php?xml=setup_wizard.xml"); +$system_menu[] = array(gettext("Routing"), "/system_gateways.php"); +$system_menu[] = array(gettext("Cert Manager"), "/system_camanager.php"); +$system_menu[] = array(gettext("User Manager"), "/system_usermanager.php"); $system_menu = msort(array_merge($system_menu, return_ext_menu("System")),0); // Interfaces @@ -104,68 +104,68 @@ $interfaces_menu = msort(array_merge($interfaces_menu, return_ext_menu("Interfac // Firewall $firewall_menu = array(); -$firewall_menu[] = array("Aliases", "/firewall_aliases.php"); -$firewall_menu[] = array("NAT", "/firewall_nat.php"); -$firewall_menu[] = array("Rules", "/firewall_rules.php"); -$firewall_menu[] = array("Schedules", "/firewall_schedule.php"); -$firewall_menu[] = array("Traffic Shaper", "/firewall_shaper.php"); -$firewall_menu[] = array("Virtual IPs", "/firewall_virtual_ip.php"); +$firewall_menu[] = array(gettext("Aliases"), "/firewall_aliases.php"); +$firewall_menu[] = array(gettext("NAT"), "/firewall_nat.php"); +$firewall_menu[] = array(gettext("Rules"), "/firewall_rules.php"); +$firewall_menu[] = array(gettext("Schedules"), "/firewall_schedule.php"); +$firewall_menu[] = array(gettext("Traffic Shaper"), "/firewall_shaper.php"); +$firewall_menu[] = array(gettext("Virtual IPs"), "/firewall_virtual_ip.php"); $firewall_menu = msort(array_merge($firewall_menu, return_ext_menu("Firewall")),0); // Services $services_menu = array(); -$services_menu[] = array("Captive Portal", "/services_captiveportal.php"); -$services_menu[] = array("DNS Forwarder", "/services_dnsmasq.php"); -$services_menu[] = array("DHCP Relay", "/services_dhcp_relay.php"); +$services_menu[] = array(gettext("Captive Portal"), "/services_captiveportal.php"); +$services_menu[] = array(gettext("DNS Forwarder"), "/services_dnsmasq.php"); +$services_menu[] = array(gettext("DHCP Relay"), "/services_dhcp_relay.php"); if($g['services_dhcp_server_enable']) - $services_menu[] = array("DHCP Server", "/services_dhcp.php"); -$services_menu[] = array("Dynamic DNS", "/services_dyndns.php"); -$services_menu[] = array("IGMP proxy", "/services_igmpproxy.php"); -$services_menu[] = array("Load Balancer", "/load_balancer_pool.php"); -$services_menu[] = array("OLSR", "/pkg_edit.php?xml=olsrd.xml&id=0"); -$services_menu[] = array("PPPoE Server", "/vpn_pppoe.php"); -$services_menu[] = array("RIP", "/pkg_edit.php?xml=routed.xml&id=0"); -$services_menu[] = array("SNMP", "/services_snmp.php"); + $services_menu[] = array(gettext("DHCP Server"), "/services_dhcp.php"); +$services_menu[] = array(gettext("Dynamic DNS"), "/services_dyndns.php"); +$services_menu[] = array(gettext("IGMP proxy"), "/services_igmpproxy.php"); +$services_menu[] = array(gettext("Load Balancer"), "/load_balancer_pool.php"); +$services_menu[] = array(gettext("OLSR"), "/pkg_edit.php?xml=olsrd.xml&id=0"); +$services_menu[] = array(gettext("PPPoE Server"), "/vpn_pppoe.php"); +$services_menu[] = array(gettext("RIP"), "/pkg_edit.php?xml=routed.xml&id=0"); +$services_menu[] = array(gettext("SNMP"), "/services_snmp.php"); if(count($config['interfaces']) > 1) { /* no use for UPnP in single-interface deployments remove to reduce user confusion */ - $services_menu[] = array("UPnP & NAT-PMP", "/pkg_edit.php?xml=miniupnpd.xml&id=0"); + $services_menu[] = array(gettext("UPnP & NAT-PMP"), "/pkg_edit.php?xml=miniupnpd.xml&id=0"); } -$services_menu[] = array("OpenNTPD", "/pkg_edit.php?xml=openntpd.xml&id=0"); -$services_menu[] = array("Wake on LAN", "/services_wol.php"); +$services_menu[] = array(gettext("OpenNTPD"), "/pkg_edit.php?xml=openntpd.xml&id=0"); +$services_menu[] = array(gettext("Wake on LAN"), "/services_wol.php"); $services_menu = msort(array_merge($services_menu, return_ext_menu("Services")),0); // VPN $vpn_menu = array(); -$vpn_menu[] = array("IPsec", "/vpn_ipsec.php"); -$vpn_menu[] = array("OpenVPN", "/vpn_openvpn_server.php"); -$vpn_menu[] = array("PPTP", "/vpn_pptp.php"); -$vpn_menu[] = array("L2TP", "/vpn_l2tp.php"); +$vpn_menu[] = array(gettext("IPsec"), "/vpn_ipsec.php"); +$vpn_menu[] = array(gettext("OpenVPN"), "/vpn_openvpn_server.php"); +$vpn_menu[] = array(gettext("PPTP"), "/vpn_pptp.php"); +$vpn_menu[] = array(gettext("L2TP"), "/vpn_l2tp.php"); $vpn_menu = msort(array_merge($vpn_menu, return_ext_menu("VPN")),0); // Status $status_menu = array(); if (isset($config['captiveportal']['enable'])) - $status_menu[] = array("Captive Portal", "/status_captiveportal.php"); -$status_menu[] = array("CARP (failover)", "/carp_status.php"); -$status_menu[] = array("Dashboard", "/index.php"); -$status_menu[] = array("Gateways", "/status_gateways.php"); -$status_menu[] = array("DHCP Leases", "/status_dhcp_leases.php"); -$status_menu[] = array("Filter Reload", "/status_filter_reload.php"); -$status_menu[] = array("Interfaces", "/status_interfaces.php"); -$status_menu[] = array("IPsec", "/diag_ipsec.php"); -$status_menu[] = array("Load Balancer", "/status_lb_pool.php"); -$status_menu[] = array("OpenVPN", "/status_openvpn.php"); + $status_menu[] = array(gettext("Captive Portal"), "/status_captiveportal.php"); +$status_menu[] = array(gettext("CARP (failover)"), "/carp_status.php"); +$status_menu[] = array(gettext("Dashboard"), "/index.php"); +$status_menu[] = array(gettext("Gateways"), "/status_gateways.php"); +$status_menu[] = array(gettext("DHCP Leases"), "/status_dhcp_leases.php"); +$status_menu[] = array(gettext("Filter Reload"), "/status_filter_reload.php"); +$status_menu[] = array(gettext("Interfaces"), "/status_interfaces.php"); +$status_menu[] = array(gettext("IPsec"), "/diag_ipsec.php"); +$status_menu[] = array(gettext("Load Balancer"), "/status_lb_pool.php"); +$status_menu[] = array(gettext("OpenVPN"), "/status_openvpn.php"); if ($g['platform'] == "pfSense") - $status_menu[] = array("Package Logs", "/diag_pkglogs.php"); -$status_menu[] = array("Queues", "/status_queues.php"); -$status_menu[] = array("RRD Graphs", "/status_rrd_graph.php"); -$status_menu[] = array("Services", "/status_services.php"); -$status_menu[] = array("System Logs", "/diag_logs.php"); -$status_menu[] = array("Traffic Graph", "/status_graph.php?if=wan"); + $status_menu[] = array(gettext("Package Logs"), "/diag_pkglogs.php"); +$status_menu[] = array(gettext("Queues"), "/status_queues.php"); +$status_menu[] = array(gettext("RRD Graphs"), "/status_rrd_graph.php"); +$status_menu[] = array(gettext("Services"), "/status_services.php"); +$status_menu[] = array(gettext("System Logs"), "/diag_logs.php"); +$status_menu[] = array(gettext("Traffic Graph"), "/status_graph.php?if=wan"); if(count($config['interfaces']) > 1) - $status_menu[] = array("UPnP & NAT-PMP", "/status_upnp.php"); + $status_menu[] = array(gettext("UPnP & NAT-PMP"), "/status_upnp.php"); $ifentries = get_configured_interface_with_descr(); foreach ($ifentries as $ent => $entdesc) { if (is_array($config['interfaces'][$ent]['wireless']) && @@ -173,49 +173,49 @@ foreach ($ifentries as $ent => $entdesc) { $ifdescrs[$ent] = $entdesc; } if (count($ifdescrs) > 0) - $status_menu[] = array("Wireless", "/status_wireless.php"); + $status_menu[] = array(gettext("Wireless"), "/status_wireless.php"); $status_menu = msort(array_merge($status_menu, return_ext_menu("Status")),0); // Diagnostics $diagnostics_menu = array(); -$diagnostics_menu[] = array("ARP Tables", "/diag_arp.php"); -$diagnostics_menu[] = array("Authentication", "/diag_authentication.php"); -$diagnostics_menu[] = array("Backup/Restore", "/diag_backup.php"); -$diagnostics_menu[] = array("Command Prompt", "/exec.php"); -$diagnostics_menu[] = array("DNS Lookup", "/diag_dns.php"); -$diagnostics_menu[] = array("Edit File", "/edit.php"); -$diagnostics_menu[] = array("Factory Defaults", "/diag_defaults.php"); -$diagnostics_menu[] = array("Halt System", "/halt.php" ); -$diagnostics_menu[] = array("Tables", "/diag_tables.php"); -$diagnostics_menu[] = array("Ping", "/diag_ping.php"); -$diagnostics_menu[] = array("pfTOP", "/diag_system_pftop.php"); -$diagnostics_menu[] = array("Reboot", "/reboot.php"); -$diagnostics_menu[] = array("Routes", "/diag_routes.php"); -$diagnostics_menu[] = array("SMART Status", "/diag_smart.php"); -$diagnostics_menu[] = array("States", "/diag_dump_states.php"); -$diagnostics_menu[] = array("States Summary", "/diag_states_summary.php"); -$diagnostics_menu[] = array("System Activity", "/diag_system_activity.php"); -$diagnostics_menu[] = array("Traceroute", "/diag_traceroute.php"); -$diagnostics_menu[] = array("Packet Capture", "/diag_packet_capture.php"); +$diagnostics_menu[] = array(gettext("ARP Tables"), "/diag_arp.php"); +$diagnostics_menu[] = array(gettext("Authentication"), "/diag_authentication.php"); +$diagnostics_menu[] = array(gettext("Backup/Restore"), "/diag_backup.php"); +$diagnostics_menu[] = array(gettext("Command Prompt"), "/exec.php"); +$diagnostics_menu[] = array(gettext("DNS Lookup"), "/diag_dns.php"); +$diagnostics_menu[] = array(gettext("Edit File"), "/edit.php"); +$diagnostics_menu[] = array(gettext("Factory Defaults"), "/diag_defaults.php"); +$diagnostics_menu[] = array(gettext("Halt System"), "/halt.php" ); +$diagnostics_menu[] = array(gettext("Tables"), "/diag_tables.php"); +$diagnostics_menu[] = array(gettext("Ping"), "/diag_ping.php"); +$diagnostics_menu[] = array(gettext("pfTOP"), "/diag_system_pftop.php"); +$diagnostics_menu[] = array(gettext("Reboot"), "/reboot.php"); +$diagnostics_menu[] = array(gettext("Routes"), "/diag_routes.php"); +$diagnostics_menu[] = array(gettext("SMART Status"), "/diag_smart.php"); +$diagnostics_menu[] = array(gettext("States"), "/diag_dump_states.php"); +$diagnostics_menu[] = array(gettext("States Summary"), "/diag_states_summary.php"); +$diagnostics_menu[] = array(gettext("System Activity"), "/diag_system_activity.php"); +$diagnostics_menu[] = array(gettext("Traceroute"), "/diag_traceroute.php"); +$diagnostics_menu[] = array(gettext("Packet Capture"), "/diag_packet_capture.php"); if($g['platform'] == "nanobsd") - $diagnostics_menu[] = array("NanoBSD", "/diag_nanobsd.php"); + $diagnostics_menu[] = array(gettext("NanoBSD"), "/diag_nanobsd.php"); if (isset($config['system']['developer'])) { echo "

  • "; - $diagnostics_menu[] = array("Restart HTTPD", "/restart_httpd.php"); + $diagnostics_menu[] = array(gettext("Restart HTTPD"), "/restart_httpd.php"); } $diagnostics_menu = msort(array_merge($diagnostics_menu, return_ext_menu("Diagnostics")),0); if(! $g['disablehelpmenu']) { $help_menu = array(); - $help_menu[] = array("About this Page", $helpurl); - $help_menu[] = array("User Forum", "http://www.pfsense.org/j.php?jumpto=forum"); - $help_menu[] = array("Documentation", "http://www.pfsense.org/j.php?jumpto=doc"); - $help_menu[] = array("Developers Wiki", "http://www.pfsense.org/j.php?jumpto=devwiki"); - $help_menu[] = array("Paid Support", "http://www.pfsense.org/j.php?jumpto=portal"); - $help_menu[] = array("pfSense Book", "http://www.pfsense.org/j.php?jumpto=book"); - $help_menu[] = array("Search portal", "http://www.pfsense.org/j.php?jumpto=searchportal"); - $help_menu[] = array("FreeBSD Handbook", "http://www.pfsense.org/j.php?jumpto=fbsdhandbook"); + $help_menu[] = array(gettext("About this Page"), $helpurl); + $help_menu[] = array(gettext("User Forum"), "http://www.pfsense.org/j.php?jumpto=forum"); + $help_menu[] = array(gettext("Documentation"), "http://www.pfsense.org/j.php?jumpto=doc"); + $help_menu[] = array(gettext("Developers Wiki"), "http://www.pfsense.org/j.php?jumpto=devwiki"); + $help_menu[] = array(gettext("Paid Support"), "http://www.pfsense.org/j.php?jumpto=portal"); + $help_menu[] = array(gettext("pfSense Book"), "http://www.pfsense.org/j.php?jumpto=book"); + $help_menu[] = array(gettext("Search portal"), "http://www.pfsense.org/j.php?jumpto=searchportal"); + $help_menu[] = array(gettext("FreeBSD Handbook"), "http://www.pfsense.org/j.php?jumpto=fbsdhandbook"); $help_menu = msort(array_merge($help_menu, return_ext_menu("Help")),0); } @@ -409,13 +409,13 @@ function add_to_menu($url, $name) { - +"> - +"> - +"> -- cgit v1.1 From 8c06f62fffc22a94f1f82c4cd299ec6d38889c17 Mon Sep 17 00:00:00 2001 From: Vinicius Coque Date: Thu, 2 Dec 2010 17:44:19 -0200 Subject: Fix gettext in priv.defs.inc --- etc/inc/priv.defs.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/inc/priv.defs.inc b/etc/inc/priv.defs.inc index 0699ce8..f16603f 100644 --- a/etc/inc/priv.defs.inc +++ b/etc/inc/priv.defs.inc @@ -361,8 +361,8 @@ $priv_list['page-xmlrpcinterfacestats']['match'] = array(); $priv_list['page-xmlrpcinterfacestats']['match'][] = "ifstats.php*"; $priv_list['page-system-login/logout'] = array(); -$priv_list['page-system-login/logout']['name'] = gettext(""WebCfg - System: Login / Logout page / Dashboard"); -$priv_list['page-system-login/logout']['descr'] = gettext(""Allow access to the 'System: Login / Logout' page and Dashboard."); +$priv_list['page-system-login/logout']['name'] = gettext("WebCfg - System: Login / Logout page / Dashboard"); +$priv_list['page-system-login/logout']['descr'] = gettext("Allow access to the 'System: Login / Logout' page and Dashboard."); $priv_list['page-system-login/logout']['match'] = array(); $priv_list['page-system-login/logout']['match'][] = "index.php*"; -- cgit v1.1 From 386447eaa7cfe727678455955285b1ecd4e6e9f9 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Thu, 2 Dec 2010 16:46:41 -0200 Subject: BP: Implement gettext() calls on fbegin.inc #multilang --- usr/local/www/fbegin.inc | 166 +++++++++++++++++++++++------------------------ 1 file changed, 83 insertions(+), 83 deletions(-) diff --git a/usr/local/www/fbegin.inc b/usr/local/www/fbegin.inc index 92d90fb..098a4f2 100755 --- a/usr/local/www/fbegin.inc +++ b/usr/local/www/fbegin.inc @@ -80,16 +80,16 @@ function output_menu($arrayitem, $target="") { // System $system_menu = array(); -$system_menu[] = array("Advanced", "/system_advanced_admin.php"); -$system_menu[] = array("Firmware", "/system_firmware.php"); -$system_menu[] = array("General Setup", "/system.php"); -$system_menu[] = array("Logout", "/index.php?logout"); +$system_menu[] = array(gettext("Advanced"), "/system_advanced_admin.php"); +$system_menu[] = array(gettext("Firmware"), "/system_firmware.php"); +$system_menu[] = array(gettext("General Setup"), "/system.php"); +$system_menu[] = array(gettext("Logout"), "/index.php?logout"); if ($g['platform'] == "pfSense" or $g['platform'] == "nanobsd") - $system_menu[] = array("Packages", "/pkg_mgr_installed.php"); -$system_menu[] = array("Setup Wizard", "/wizard.php?xml=setup_wizard.xml"); -$system_menu[] = array("Routing", "/system_gateways.php"); -$system_menu[] = array("Cert Manager", "/system_camanager.php"); -$system_menu[] = array("User Manager", "/system_usermanager.php"); + $system_menu[] = array(gettext("Packages"), "/pkg_mgr_installed.php"); +$system_menu[] = array(gettext("Setup Wizard"), "/wizard.php?xml=setup_wizard.xml"); +$system_menu[] = array(gettext("Routing"), "/system_gateways.php"); +$system_menu[] = array(gettext("Cert Manager"), "/system_camanager.php"); +$system_menu[] = array(gettext("User Manager"), "/system_usermanager.php"); $system_menu = msort(array_merge($system_menu, return_ext_menu("System")),0); // Interfaces @@ -104,68 +104,68 @@ $interfaces_menu = msort(array_merge($interfaces_menu, return_ext_menu("Interfac // Firewall $firewall_menu = array(); -$firewall_menu[] = array("Aliases", "/firewall_aliases.php"); -$firewall_menu[] = array("NAT", "/firewall_nat.php"); -$firewall_menu[] = array("Rules", "/firewall_rules.php"); -$firewall_menu[] = array("Schedules", "/firewall_schedule.php"); -$firewall_menu[] = array("Traffic Shaper", "/firewall_shaper.php"); -$firewall_menu[] = array("Virtual IPs", "/firewall_virtual_ip.php"); +$firewall_menu[] = array(gettext("Aliases"), "/firewall_aliases.php"); +$firewall_menu[] = array(gettext("NAT"), "/firewall_nat.php"); +$firewall_menu[] = array(gettext("Rules"), "/firewall_rules.php"); +$firewall_menu[] = array(gettext("Schedules"), "/firewall_schedule.php"); +$firewall_menu[] = array(gettext("Traffic Shaper"), "/firewall_shaper.php"); +$firewall_menu[] = array(gettext("Virtual IPs"), "/firewall_virtual_ip.php"); $firewall_menu = msort(array_merge($firewall_menu, return_ext_menu("Firewall")),0); // Services $services_menu = array(); -$services_menu[] = array("Captive Portal", "/services_captiveportal.php"); -$services_menu[] = array("DNS Forwarder", "/services_dnsmasq.php"); -$services_menu[] = array("DHCP Relay", "/services_dhcp_relay.php"); +$services_menu[] = array(gettext("Captive Portal"), "/services_captiveportal.php"); +$services_menu[] = array(gettext("DNS Forwarder"), "/services_dnsmasq.php"); +$services_menu[] = array(gettext("DHCP Relay"), "/services_dhcp_relay.php"); if($g['services_dhcp_server_enable']) - $services_menu[] = array("DHCP Server", "/services_dhcp.php"); -$services_menu[] = array("Dynamic DNS", "/services_dyndns.php"); -$services_menu[] = array("IGMP proxy", "/services_igmpproxy.php"); -$services_menu[] = array("Load Balancer", "/load_balancer_pool.php"); -$services_menu[] = array("OLSR", "/pkg_edit.php?xml=olsrd.xml&id=0"); -$services_menu[] = array("PPPoE Server", "/vpn_pppoe.php"); -$services_menu[] = array("RIP", "/pkg_edit.php?xml=routed.xml&id=0"); -$services_menu[] = array("SNMP", "/services_snmp.php"); + $services_menu[] = array(gettext("DHCP Server"), "/services_dhcp.php"); +$services_menu[] = array(gettext("Dynamic DNS"), "/services_dyndns.php"); +$services_menu[] = array(gettext("IGMP proxy"), "/services_igmpproxy.php"); +$services_menu[] = array(gettext("Load Balancer"), "/load_balancer_pool.php"); +$services_menu[] = array(gettext("OLSR"), "/pkg_edit.php?xml=olsrd.xml&id=0"); +$services_menu[] = array(gettext("PPPoE Server"), "/vpn_pppoe.php"); +$services_menu[] = array(gettext("RIP"), "/pkg_edit.php?xml=routed.xml&id=0"); +$services_menu[] = array(gettext("SNMP"), "/services_snmp.php"); if(count($config['interfaces']) > 1) { /* no use for UPnP in single-interface deployments remove to reduce user confusion */ - $services_menu[] = array("UPnP & NAT-PMP", "/pkg_edit.php?xml=miniupnpd.xml&id=0"); + $services_menu[] = array(gettext("UPnP & NAT-PMP"), "/pkg_edit.php?xml=miniupnpd.xml&id=0"); } -$services_menu[] = array("OpenNTPD", "/pkg_edit.php?xml=openntpd.xml&id=0"); -$services_menu[] = array("Wake on LAN", "/services_wol.php"); +$services_menu[] = array(gettext("OpenNTPD"), "/pkg_edit.php?xml=openntpd.xml&id=0"); +$services_menu[] = array(gettext("Wake on LAN"), "/services_wol.php"); $services_menu = msort(array_merge($services_menu, return_ext_menu("Services")),0); // VPN $vpn_menu = array(); -$vpn_menu[] = array("IPsec", "/vpn_ipsec.php"); -$vpn_menu[] = array("OpenVPN", "/vpn_openvpn_server.php"); -$vpn_menu[] = array("PPTP", "/vpn_pptp.php"); -$vpn_menu[] = array("L2TP", "/vpn_l2tp.php"); +$vpn_menu[] = array(gettext("IPsec"), "/vpn_ipsec.php"); +$vpn_menu[] = array(gettext("OpenVPN"), "/vpn_openvpn_server.php"); +$vpn_menu[] = array(gettext("PPTP"), "/vpn_pptp.php"); +$vpn_menu[] = array(gettext("L2TP"), "/vpn_l2tp.php"); $vpn_menu = msort(array_merge($vpn_menu, return_ext_menu("VPN")),0); // Status $status_menu = array(); if (isset($config['captiveportal']['enable'])) - $status_menu[] = array("Captive Portal", "/status_captiveportal.php"); -$status_menu[] = array("CARP (failover)", "/carp_status.php"); -$status_menu[] = array("Dashboard", "/index.php"); -$status_menu[] = array("Gateways", "/status_gateways.php"); -$status_menu[] = array("DHCP Leases", "/status_dhcp_leases.php"); -$status_menu[] = array("Filter Reload", "/status_filter_reload.php"); -$status_menu[] = array("Interfaces", "/status_interfaces.php"); -$status_menu[] = array("IPsec", "/diag_ipsec.php"); -$status_menu[] = array("Load Balancer", "/status_lb_pool.php"); -$status_menu[] = array("OpenVPN", "/status_openvpn.php"); + $status_menu[] = array(gettext("Captive Portal"), "/status_captiveportal.php"); +$status_menu[] = array(gettext("CARP (failover)"), "/carp_status.php"); +$status_menu[] = array(gettext("Dashboard"), "/index.php"); +$status_menu[] = array(gettext("Gateways"), "/status_gateways.php"); +$status_menu[] = array(gettext("DHCP Leases"), "/status_dhcp_leases.php"); +$status_menu[] = array(gettext("Filter Reload"), "/status_filter_reload.php"); +$status_menu[] = array(gettext("Interfaces"), "/status_interfaces.php"); +$status_menu[] = array(gettext("IPsec"), "/diag_ipsec.php"); +$status_menu[] = array(gettext("Load Balancer"), "/status_lb_pool.php"); +$status_menu[] = array(gettext("OpenVPN"), "/status_openvpn.php"); if ($g['platform'] == "pfSense") - $status_menu[] = array("Package Logs", "/diag_pkglogs.php"); -$status_menu[] = array("Queues", "/status_queues.php"); -$status_menu[] = array("RRD Graphs", "/status_rrd_graph.php"); -$status_menu[] = array("Services", "/status_services.php"); -$status_menu[] = array("System Logs", "/diag_logs.php"); -$status_menu[] = array("Traffic Graph", "/status_graph.php?if=wan"); + $status_menu[] = array(gettext("Package Logs"), "/diag_pkglogs.php"); +$status_menu[] = array(gettext("Queues"), "/status_queues.php"); +$status_menu[] = array(gettext("RRD Graphs"), "/status_rrd_graph.php"); +$status_menu[] = array(gettext("Services"), "/status_services.php"); +$status_menu[] = array(gettext("System Logs"), "/diag_logs.php"); +$status_menu[] = array(gettext("Traffic Graph"), "/status_graph.php?if=wan"); if(count($config['interfaces']) > 1) - $status_menu[] = array("UPnP & NAT-PMP", "/status_upnp.php"); + $status_menu[] = array(gettext("UPnP & NAT-PMP"), "/status_upnp.php"); $ifentries = get_configured_interface_with_descr(); foreach ($ifentries as $ent => $entdesc) { if (is_array($config['interfaces'][$ent]['wireless']) && @@ -173,49 +173,49 @@ foreach ($ifentries as $ent => $entdesc) { $ifdescrs[$ent] = $entdesc; } if (count($ifdescrs) > 0) - $status_menu[] = array("Wireless", "/status_wireless.php"); + $status_menu[] = array(gettext("Wireless"), "/status_wireless.php"); $status_menu = msort(array_merge($status_menu, return_ext_menu("Status")),0); // Diagnostics $diagnostics_menu = array(); -$diagnostics_menu[] = array("ARP Tables", "/diag_arp.php"); -$diagnostics_menu[] = array("Authentication", "/diag_authentication.php"); -$diagnostics_menu[] = array("Backup/Restore", "/diag_backup.php"); -$diagnostics_menu[] = array("Command Prompt", "/exec.php"); -$diagnostics_menu[] = array("DNS Lookup", "/diag_dns.php"); -$diagnostics_menu[] = array("Edit File", "/edit.php"); -$diagnostics_menu[] = array("Factory Defaults", "/diag_defaults.php"); -$diagnostics_menu[] = array("Halt System", "/halt.php" ); -$diagnostics_menu[] = array("Tables", "/diag_tables.php"); -$diagnostics_menu[] = array("Ping", "/diag_ping.php"); -$diagnostics_menu[] = array("pfTOP", "/diag_system_pftop.php"); -$diagnostics_menu[] = array("Reboot", "/reboot.php"); -$diagnostics_menu[] = array("Routes", "/diag_routes.php"); -$diagnostics_menu[] = array("SMART Status", "/diag_smart.php"); -$diagnostics_menu[] = array("States", "/diag_dump_states.php"); -$diagnostics_menu[] = array("States Summary", "/diag_states_summary.php"); -$diagnostics_menu[] = array("System Activity", "/diag_system_activity.php"); -$diagnostics_menu[] = array("Traceroute", "/diag_traceroute.php"); -$diagnostics_menu[] = array("Packet Capture", "/diag_packet_capture.php"); +$diagnostics_menu[] = array(gettext("ARP Tables"), "/diag_arp.php"); +$diagnostics_menu[] = array(gettext("Authentication"), "/diag_authentication.php"); +$diagnostics_menu[] = array(gettext("Backup/Restore"), "/diag_backup.php"); +$diagnostics_menu[] = array(gettext("Command Prompt"), "/exec.php"); +$diagnostics_menu[] = array(gettext("DNS Lookup"), "/diag_dns.php"); +$diagnostics_menu[] = array(gettext("Edit File"), "/edit.php"); +$diagnostics_menu[] = array(gettext("Factory Defaults"), "/diag_defaults.php"); +$diagnostics_menu[] = array(gettext("Halt System"), "/halt.php" ); +$diagnostics_menu[] = array(gettext("Tables"), "/diag_tables.php"); +$diagnostics_menu[] = array(gettext("Ping"), "/diag_ping.php"); +$diagnostics_menu[] = array(gettext("pfTOP"), "/diag_system_pftop.php"); +$diagnostics_menu[] = array(gettext("Reboot"), "/reboot.php"); +$diagnostics_menu[] = array(gettext("Routes"), "/diag_routes.php"); +$diagnostics_menu[] = array(gettext("SMART Status"), "/diag_smart.php"); +$diagnostics_menu[] = array(gettext("States"), "/diag_dump_states.php"); +$diagnostics_menu[] = array(gettext("States Summary"), "/diag_states_summary.php"); +$diagnostics_menu[] = array(gettext("System Activity"), "/diag_system_activity.php"); +$diagnostics_menu[] = array(gettext("Traceroute"), "/diag_traceroute.php"); +$diagnostics_menu[] = array(gettext("Packet Capture"), "/diag_packet_capture.php"); if($g['platform'] == "nanobsd") - $diagnostics_menu[] = array("NanoBSD", "/diag_nanobsd.php"); + $diagnostics_menu[] = array(gettext("NanoBSD"), "/diag_nanobsd.php"); if (isset($config['system']['developer'])) { echo "

  • "; - $diagnostics_menu[] = array("Restart HTTPD", "/restart_httpd.php"); + $diagnostics_menu[] = array(gettext("Restart HTTPD"), "/restart_httpd.php"); } $diagnostics_menu = msort(array_merge($diagnostics_menu, return_ext_menu("Diagnostics")),0); if(! $g['disablehelpmenu']) { $help_menu = array(); - $help_menu[] = array("About this Page", $helpurl); - $help_menu[] = array("User Forum", "http://www.pfsense.org/j.php?jumpto=forum"); - $help_menu[] = array("Documentation", "http://www.pfsense.org/j.php?jumpto=doc"); - $help_menu[] = array("Developers Wiki", "http://www.pfsense.org/j.php?jumpto=devwiki"); - $help_menu[] = array("Paid Support", "http://www.pfsense.org/j.php?jumpto=portal"); - $help_menu[] = array("pfSense Book", "http://www.pfsense.org/j.php?jumpto=book"); - $help_menu[] = array("Search portal", "http://www.pfsense.org/j.php?jumpto=searchportal"); - $help_menu[] = array("FreeBSD Handbook", "http://www.pfsense.org/j.php?jumpto=fbsdhandbook"); + $help_menu[] = array(gettext("About this Page"), $helpurl); + $help_menu[] = array(gettext("User Forum"), "http://www.pfsense.org/j.php?jumpto=forum"); + $help_menu[] = array(gettext("Documentation"), "http://www.pfsense.org/j.php?jumpto=doc"); + $help_menu[] = array(gettext("Developers Wiki"), "http://www.pfsense.org/j.php?jumpto=devwiki"); + $help_menu[] = array(gettext("Paid Support"), "http://www.pfsense.org/j.php?jumpto=portal"); + $help_menu[] = array(gettext("pfSense Book"), "http://www.pfsense.org/j.php?jumpto=book"); + $help_menu[] = array(gettext("Search portal"), "http://www.pfsense.org/j.php?jumpto=searchportal"); + $help_menu[] = array(gettext("FreeBSD Handbook"), "http://www.pfsense.org/j.php?jumpto=fbsdhandbook"); $help_menu = msort(array_merge($help_menu, return_ext_menu("Help")),0); } @@ -409,13 +409,13 @@ function add_to_menu($url, $name) { - +"> - +"> - +"> -- cgit v1.1 From eac181cad00c25a90432ebbc35327ac9cfbed5b0 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Tue, 25 Jan 2011 16:50:23 -0200 Subject: BP: Add gettext() function #multilang --- usr/local/www/guiconfig.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc index 70f9459..1e30482 100755 --- a/usr/local/www/guiconfig.inc +++ b/usr/local/www/guiconfig.inc @@ -290,7 +290,7 @@ function print_info_box_np($msg, $name="apply",$value="Apply changes") { if($nifty_background == "") $nifty_background = "#FFF"; - if(stristr($msg, "apply") != false || stristr($msg, "save") != false || stristr($msg, "create") != false) { + if(stristr($msg, gettext("apply")) != false || stristr($msg, gettext("save")) != false || stristr($msg, gettext("create")) != false) { $savebutton = ""; $savebutton .= ""; if($_POST['if']) -- cgit v1.1 From b638ef519a8e1ad3e843c55e091fc2649e834797 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Tue, 25 Jan 2011 16:50:23 -0200 Subject: BP: Add gettext() function #multilang --- usr/local/www/guiconfig.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc index 70f9459..1e30482 100755 --- a/usr/local/www/guiconfig.inc +++ b/usr/local/www/guiconfig.inc @@ -290,7 +290,7 @@ function print_info_box_np($msg, $name="apply",$value="Apply changes") { if($nifty_background == "") $nifty_background = "#FFF"; - if(stristr($msg, "apply") != false || stristr($msg, "save") != false || stristr($msg, "create") != false) { + if(stristr($msg, gettext("apply")) != false || stristr($msg, gettext("save")) != false || stristr($msg, gettext("create")) != false) { $savebutton = ""; $savebutton .= ""; if($_POST['if']) -- cgit v1.1 From a120c194b5d55f806d3402a30d68594b6b9994f5 Mon Sep 17 00:00:00 2001 From: Vinicius Coque Date: Tue, 8 Feb 2011 13:51:19 -0200 Subject: BP: Fix gettext implementation --- etc/inc/config.console.inc | 2 +- etc/inc/notices.inc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/inc/config.console.inc b/etc/inc/config.console.inc index 536c976..7b2cab7 100644 --- a/etc/inc/config.console.inc +++ b/etc/inc/config.console.inc @@ -258,7 +258,7 @@ EOD; $i1 = $i + 1; if($config['interfaces']['opt' . $i1]['descr']) - printf(gettext("%sOptional interface %s description found: %s"), "\n", $config['interfaces']['opt' . $i1]['descr']); + printf(gettext("%sOptional interface %s description found: %s"), "\n", $i1, $config['interfaces']['opt' . $i1]['descr']); printf(gettext("%sEnter the Optional %s{$i1} interface name or 'a' for auto-detection%s" . "(or nothing if finished):%s"), "\n", $i1, "\n", " "); diff --git a/etc/inc/notices.inc b/etc/inc/notices.inc index b0e95c5..54a8489 100644 --- a/etc/inc/notices.inc +++ b/etc/inc/notices.inc @@ -78,7 +78,7 @@ function file_notice($id, $notice, $category = "General", $url = "", $priority = } fwrite($queueout, serialize($queue)); fclose($queueout); - log_error(printf(gettext("New alert found: %s"), $notice)); + log_error("New alert found: $notice"); /* soekris */ if(file_exists("/dev/led/error")) exec("/bin/echo 1 > /dev/led/error"); -- cgit v1.1 From b845290619244e8cfe3bc2aa6271c6629eeb86b5 Mon Sep 17 00:00:00 2001 From: Vinicius Coque Date: Fri, 11 Feb 2011 09:40:03 -0200 Subject: BP: fix syntax error on gettext implementation --- etc/inc/gwlb.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 1dcd6c1..8ca69cc 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -210,7 +210,7 @@ EOD; * not strictly necessary but is a added level of protection. */ if (is_ipaddr($gateway['gateway']) && $gateway['monitor'] != $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'])); + log_error(sprintf(gettext('Removing static route for monitor %1$s and adding a new route through %2$s'), $gateway['monitor'], $gateway['gateway'])); mwexec("/sbin/route delete -host " . escapeshellarg($gateway['monitor']), true); mwexec("/sbin/route add -host " . escapeshellarg($gateway['monitor']) . " " . escapeshellarg($gateway['gateway']), true); -- cgit v1.1 From 67f0f0a772722d418f0f660bf2b16ff5b4c94fd5 Mon Sep 17 00:00:00 2001 From: Vinicius Coque Date: Thu, 31 Mar 2011 13:47:48 -0300 Subject: Add gettext calls on main menu --- usr/local/www/fbegin.inc | 16 ++++++++-------- usr/local/www/system_firmware.php | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/usr/local/www/fbegin.inc b/usr/local/www/fbegin.inc index 8687e3a..89d1555 100755 --- a/usr/local/www/fbegin.inc +++ b/usr/local/www/fbegin.inc @@ -308,7 +308,7 @@ if ($_REQUEST['noticeaction'] == 'acknowledge') {