summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/PEAR.inc34
-rw-r--r--etc/inc/array_intersect_key.inc8
-rw-r--r--etc/inc/auth.inc72
-rw-r--r--etc/inc/authgui.inc16
-rw-r--r--etc/inc/captiveportal.inc10
-rw-r--r--etc/inc/cmd_chain.inc8
-rw-r--r--etc/inc/config.console.inc64
-rw-r--r--etc/inc/config.inc23
-rw-r--r--etc/inc/config.lib.inc96
-rw-r--r--etc/inc/easyrule.inc46
-rw-r--r--etc/inc/filter.inc112
-rw-r--r--etc/inc/filter_log.inc6
-rw-r--r--etc/inc/gwlb.inc12
-rw-r--r--etc/inc/interfaces.inc134
-rw-r--r--etc/inc/ipsec.inc30
-rw-r--r--etc/inc/meta.inc12
-rw-r--r--etc/inc/notices.inc10
-rw-r--r--etc/inc/openvpn.inc22
-rw-r--r--etc/inc/pfsense-utils.inc62
-rw-r--r--etc/inc/pkg-utils.inc178
-rw-r--r--etc/inc/priv.defs.inc768
-rw-r--r--etc/inc/radius.inc8
-rw-r--r--etc/inc/rrd.inc16
-rw-r--r--etc/inc/services.inc48
-rw-r--r--etc/inc/shaper.inc435
-rw-r--r--etc/inc/smtp.inc96
-rw-r--r--etc/inc/system.inc74
-rw-r--r--etc/inc/upgrade_config.inc102
-rw-r--r--etc/inc/util.inc8
-rw-r--r--etc/inc/voucher.inc30
-rw-r--r--etc/inc/vpn.inc66
-rw-r--r--etc/inc/xmlparse.inc8
-rw-r--r--etc/inc/xmlparse_attr.inc8
-rw-r--r--etc/inc/xmlreader.inc2
-rw-r--r--etc/inc/xmlrpc_client.inc55
-rw-r--r--etc/inc/xmlrpc_server.inc14
-rw-r--r--etc/inc/zeromq.inc2
37 files changed, 1349 insertions, 1346 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
+?>
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
+?>
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc
index ac1e4ec..59e9128 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() */
@@ -509,7 +509,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);
}
@@ -521,7 +521,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);
}
@@ -555,7 +555,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;
}
@@ -597,7 +597,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;
}
@@ -650,7 +650,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;
}
@@ -664,7 +664,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;
}
@@ -675,12 +675,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;
}
@@ -775,7 +775,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;
}
@@ -785,12 +785,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;
}
@@ -874,10 +874,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;
}
@@ -895,7 +895,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;
}
@@ -909,7 +909,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;
}
@@ -926,11 +926,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 %1$s, container %2$s with filter %3$s."), $ldapname, $ldac_split, $ldapfilter));
if ($ldapscope == "one")
$ldapfunc = "ldap_list";
else
@@ -941,7 +941,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);
@@ -957,18 +957,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 %1$s as user %2$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 %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);
@@ -999,7 +999,7 @@ function radius_backed($username, $passwd, $authcfg){
$retvalue['auth_val'] = 1;
$retvalue['error'] = $rauth->getError();
if ($debug)
- printf("Radius start: %s<br>\n", $retvalue['error']);
+ printf(gettext("Radius start: %s%s"), $retvalue['error'], "<br>\n");
}
// 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("Radius send failed: %s<br>\n", $retvalue['error']);
+ printf(gettext("Radius send failed: %s%s"), $retvalue['error'], "<br>\n");
} else if ($result === true) {
$retvalue['auth_val'] = 2;
if ($debug)
@@ -1062,7 +1062,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() {
@@ -1077,7 +1077,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;
}
@@ -1147,7 +1147,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 '%1$s' from: %2$s"), $_POST['usernamefld'], $_SERVER['REMOTE_ADDR']));
$HTTP_SERVER_VARS['AUTH_USER'] = $_SESSION['Username'];
if (isset($_POST['postafterlogin']))
return true;
@@ -1159,8 +1159,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: '%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("Session timed out for user '{$_SESSION['Username']}' from: {$_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("User logged out for user '{$_SESSION['Username']}' from: {$_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 27e4c88..143e4a2 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: %1$s Description: %2$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'])
<div id="inputerrors"><?=$_SESSION['Login_Error'];?></div>
<p>
<span style="text-align:left">
- <?=gettext("Username"); ?>:<br>
+ <?=gettext("Username:"); ?><br>
<input onclick="clearError();" onchange="clearError();" id="usernamefld" type="text" name="usernamefld" class="formfld user" tabindex="1" />
</span>
</p>
<br>
<p>
<span style="text-align:left">
- <?=gettext("Password"); ?>: <br>
+ <?=gettext("Password:"); ?> <br>
<input onclick="clearError();" onchange="clearError();" id="passwordfld" type="password" name="passwordfld" class="formfld pwd" tabindex="2" />
</span>
</p>
@@ -261,4 +261,4 @@ if($config['virtualip'])
<?php
} // end function
-?> \ No newline at end of file
+?>
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index 007bd44..874c99c 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -439,7 +439,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"
@@ -451,7 +451,7 @@ EOD;
}
if ($g['booting'])
- echo "done\n";
+ printf(gettext("done%s"), "\n");
} else {
killbypid("{$g['varrun_path']}/lighty-CaptivePortal.pid");
@@ -1182,7 +1182,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;
}
@@ -1272,7 +1272,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']);
@@ -1471,4 +1471,4 @@ function portal_ip_from_client_ip($cliip) {
return false;
}
-?> \ No newline at end of file
+?>
diff --git a/etc/inc/cmd_chain.inc b/etc/inc/cmd_chain.inc
index eb81954..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("CmdCHAIN is executing -> {$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("{$cmd_title} failed with return code -> {$status}. The command was {$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("{$cmd_title} failed with return code -> {$status}. The command was {$command}");
+ return(sprintf(gettext("%s failed with return code -> %1$s. The command was %2$s"), $cmd_title, $status, $command));
}
}
return;
@@ -129,4 +129,4 @@ $cmdchain->clear(); // clears the previous added entries
*/
-?> \ No newline at end of file
+?>
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
+?>
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, "<m0n0wall>") == 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
+?>
diff --git a/etc/inc/config.lib.inc b/etc/inc/config.lib.inc
index 7eb0858..29576cb 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, "<pfsense>"))
@@ -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("%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();
}
}
@@ -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 %1$s to %2$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("%1$s at line %2$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'] == "")
@@ -797,4 +797,4 @@ function set_device_perms() {
}
}
-?> \ No newline at end of file
+?>
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.");
}
?>
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 80e1d46..211f33a 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -182,7 +182,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);
@@ -194,45 +194,45 @@ 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";
+ echo gettext("done.") . "\n";
unlock($filterlck);
return;
}
@@ -244,7 +244,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";
@@ -277,7 +277,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. */
@@ -289,7 +289,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;
}
@@ -323,11 +323,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 [%1$d]: %2$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 = 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);
unlock($filterlck);
return;
}
@@ -336,12 +337,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)) {
@@ -390,21 +392,21 @@ 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";
+ echo gettext("done.") . "\n";
return 0;
}
@@ -580,7 +582,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();
@@ -610,14 +612,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 %1$s on %2$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) {
@@ -847,7 +849,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'])) {
@@ -896,7 +898,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)
@@ -967,7 +969,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;
@@ -975,7 +977,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(empty($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);
@@ -987,7 +989,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 = "";
@@ -1101,7 +1103,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 = "";
@@ -1170,7 +1172,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'];
@@ -1199,7 +1201,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;
@@ -1283,7 +1285,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 %1$s - (%2$s)"), $if, $ifcfg['descr']));
if(interface_has_gateway($if)) {
$target = $ifcfg['ip'];
/* create outbound nat entries for all local networks */
@@ -1301,7 +1303,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";
@@ -1341,7 +1343,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;
@@ -1487,7 +1489,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;
@@ -1569,7 +1571,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)) {
@@ -1669,7 +1671,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'])) {
@@ -1678,7 +1680,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']));
}
}
}
@@ -1688,7 +1690,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'])) {
@@ -1702,7 +1704,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");
@@ -1908,7 +1910,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";
@@ -2188,7 +2190,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(gettext("ERROR! PPTP enabled but could not resolve the \$pptpdtarget"));
}
}
@@ -2266,7 +2268,7 @@ EOD;
}
}
- update_filter_reload_status("Creating IPsec rules...");
+ update_filter_reload_status(gettext("Creating IPsec rules..."));
$ipfrules .= filter_generate_ipsec_rules();
$ipfrules .= <<<EOD
@@ -2297,7 +2299,7 @@ function filter_rules_spoofcheck_generate($ifname, $if, $sa, $sn, $log) {
/* COMPAT Function */
function tdr_install_cron($should_install) {
- log_error("Please use filter_tdr_install_cron() function tdr_install_cron will be deprecated!");
+ log_error(gettext("Please use filter_tdr_install_cron() function tdr_install_cron will be deprecated!"));
filter_tdr_install_cron($should_install);
}
@@ -2342,7 +2344,7 @@ function filter_tdr_install_cron($should_install) {
$cron_item['who'] = "root";
$cron_item['command'] = "/etc/rc.filter_configure_sync";
$config['cron']['item'][] = $cron_item;
- write_config("Installed 15 minute filter reload for Time Based Rules");
+ write_config(gettext("Installed 15 minute filter reload for Time Based Rules"));
configure_cron();
}
break;
@@ -2699,17 +2701,17 @@ function discover_pkg_rules($ruletype) {
$rules = "";
$files = glob("/usr/local/pkg/*.inc");
foreach($files as $pkg_inc) {
- update_filter_reload_status("Checking for {$ruletype} PF hooks in package {$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("Processing early {$ruletype} rules for package {$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");
if ($status <> 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;
diff --git a/etc/inc/filter_log.inc b/etc/inc/filter_log.inc
index ed4b311..b027f6e 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 = "<span title=\"Service {$port}/{$proto}: {$service}\">" . htmlspecialchars($port) . "</span>";
+ $portstr = sprintf(gettext("<span title=\"Service %1$s/%2$s: %3$s\">%4$s</span>"), $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
+?>
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index 3ccbbb7..03cbf6f 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("Removing static route for monitor {$gateway['monitor']} and adding a new route through {$gateway['gateway']}");
+ log_error(sprintf(gettext('Removing static route for monitor %1$s and adding a new route through %2$s'), $gateway['monitor']. $gateway['gateway']));
mwexec("/sbin/route delete -host " . escapeshellarg($gateway['monitor']), true);
mwexec("/sbin/route add -host " . escapeshellarg($gateway['monitor']) .
" " . escapeshellarg($gateway['gateway']));
@@ -378,15 +378,15 @@ function return_gateway_groups_array() {
if (!empty($gateway_status[$gwname])) {
$gwdown = false;
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);
$gwdown = true;
} else if (stristr($status['status'], "loss") && 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);
$gwdown = true;
} else if (stristr($status['status'], "delay") && strstr($group['trigger'] , "latency")) {
/* high latency */
- $msg = "MONITOR: {$gwname} has high latency, removing from routing group";
+ $msg = sprintf(gettext("MONITOR: %s has high latency, removing from routing group"), $gwname);
$gwdown = true;
}
if ($gwdown == true) {
@@ -400,7 +400,7 @@ function return_gateway_groups_array() {
$tiers_count = count($tiers);
if($tiers_count == 0) {
/* Oh dear, we have no members! Engage Plan B */
- $msg = "Gateways status could not be determined, considering all as up/active.";
+ $msg = gettext("Gateways status could not be determined, considering all as up/active.");
log_error($msg);
notify_via_growl($msg);
$tiers = $backupplan;
@@ -452,7 +452,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 %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 a49c4da..93ff163 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;
}
@@ -360,7 +360,7 @@ function interface_bridge_configure(&$bridge) {
$realif1 = get_real_interface($member);
$realif = escapeshellarg($realif1);
if (!$realif) {
- log_error("realif not defined in interfaces bridge - up");
+ log_error(gettext("realif not defined in interfaces bridge - up"));
continue;
}
/* make sure the parent interface is up */
@@ -473,7 +473,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;
}
@@ -507,7 +507,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) {
@@ -519,7 +519,7 @@ function interfaces_lagg_configure()
}
}
if($g['booting'])
- echo "done.\n";
+ echo gettext("done.") . "\n";
}
function interface_lagg_configure(&$lagg) {
@@ -618,7 +618,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']}");
@@ -654,7 +654,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']);
@@ -673,7 +673,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}");
@@ -718,12 +718,12 @@ function interfaces_configure() {
continue;
} 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";
}
}
@@ -738,14 +738,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 */
@@ -753,14 +753,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 */
@@ -1051,7 +1051,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'];
@@ -1098,7 +1098,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!] */
@@ -1113,18 +1113,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 %1$s for %2$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;
}
}
@@ -1389,7 +1389,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
@@ -1441,7 +1441,7 @@ function interfaces_carp_setup() {
$cmdchain = new CmdCHAIN();
if ($g['booting']) {
- echo "Configuring CARP settings...";
+ echo gettext("Configuring CARP settings...");
mute_kernel_msgs();
}
@@ -1461,14 +1461,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);
@@ -1484,22 +1484,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
@@ -1509,7 +1509,7 @@ function interfaces_carp_setup() {
if ($g['booting']) {
unmute_kernel_msgs();
- echo "done.\n";
+ echo gettext("done.") . "\n";
}
}
@@ -1694,7 +1694,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;
}
@@ -1702,7 +1702,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) && !ip_in_interface_alias_subnet($vip['interface'], $vip['subnet'])) {
- 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;
}
@@ -1737,7 +1737,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 %1$s on top of interface %2$s"), $vip['interface'], $interface));
if (empty($vip['interface']))
return;
@@ -1749,7 +1749,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;
}
@@ -1795,7 +1795,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}");
}
@@ -1828,15 +1828,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 {
@@ -1848,12 +1848,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 %1$s with error code %2$s, output %3$s"), $baseif, $ret, $out[0]));
return false;
}
$newif = trim($out[0]);
@@ -2391,13 +2391,13 @@ function interface_configure($interface = "wan", $reloadall = false, $linkupeven
/* 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 %1$s has been automatically replaced with %2$s"), $realif, $random_mac), "Interfaces");
}
}
@@ -2572,7 +2572,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;
}
@@ -2587,7 +2587,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;
}
@@ -2600,7 +2600,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 = "";
@@ -2635,7 +2635,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");
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']);
}
diff --git a/etc/inc/meta.inc b/etc/inc/meta.inc
index 3090319..4216185 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 ( %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)) {
- echo "warning: tag {$tagbeg} has no data in '$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) {
- echo "warning: tag {$tagbeg} has malformed data in '$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)) {
- echo "warning: tag {$tagbeg} has invalid data in '$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 4415987..224e680 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 %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/openvpn.inc b/etc/inc/openvpn.inc
index e41d39e..1e7e9b8 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;
}
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 62aa2bc..8e0233e 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -355,11 +355,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;
}
@@ -388,7 +388,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;
@@ -437,7 +437,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"));
}
/*
@@ -482,16 +482,16 @@ function WakeOnLan($addr, $mac)
// send it to the broadcast address using UDP
$s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
if ($s == false) {
- log_error("Error creating socket!");
- log_error("Error code is '".socket_last_error($s)."' - " . socket_strerror(socket_last_error($s)));
+ log_error(gettext("Error creating socket!"));
+ log_error(sprintf(gettext("Error code is '%1$s' - %2$s"), socket_last_error($s), socket_strerror(socket_last_error($s))));
} else {
// setting a broadcast option to socket:
$opt_ret = socket_set_option($s, 1, 6, TRUE);
if($opt_ret < 0)
- log_error("setsockopt() failed, error: " . strerror($opt_ret));
+ log_error(sprintf(gettext("setsockopt() failed, error: %s"), strerror($opt_ret)));
$e = socket_sendto($s, $msg, strlen($msg), 0, $addr, 2050);
socket_close($s);
- log_error("Magic Packet sent ({$e}) to {$addr} MAC={$mac}");
+ log_error(sprintf(gettext("Magic Packet sent (%1$s) to {%2$s} MAC=%3$s"), $e, $addr, $mac));
return true;
}
@@ -568,7 +568,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;
}
@@ -589,7 +589,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;
}
@@ -734,10 +734,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 %1$s: %2$s"), $resp->faultCode(), $resp->faultString()));
return false;
} else {
return XML_RPC_Decode($resp->value());
@@ -812,13 +812,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);
@@ -826,17 +826,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*");
@@ -883,7 +883,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");
@@ -953,7 +953,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) {
@@ -1101,7 +1101,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;
}
}
@@ -1209,7 +1209,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']))
@@ -1249,8 +1249,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];
@@ -1285,13 +1285,13 @@ function get_interface_info($ifdescr) {
if($bridge) {
$bridge_text = `/sbin/ifconfig {$bridge}`;
if(stristr($bridge_text, "blocking") <> false) {
- $ifinfo['bridge'] = "<b><font color='red'>blocking</font></b> - check for ethernet loops";
+ $ifinfo['bridge'] = "<b><font color='red'>" . gettext("blocking") . "</font></b> - " . gettext("check for ethernet loops");
$ifinfo['bridgeint'] = $bridge;
} else if(stristr($bridge_text, "learning") <> false) {
- $ifinfo['bridge'] = "learning";
+ $ifinfo['bridge'] = gettext("learning");
$ifinfo['bridgeint'] = $bridge;
} else if(stristr($bridge_text, "forwarding") <> false) {
- $ifinfo['bridge'] = "forwarding";
+ $ifinfo['bridge'] = gettext("forwarding");
$ifinfo['bridgeint'] = $bridge;
}
}
@@ -1402,7 +1402,7 @@ function compare_hostname_to_dnscache($hostname) {
if(trim($oldcontents) != trim($contents)) {
if($g['debug']) {
- log_error("DNSCACHE: Found old IP {$oldcontents} and new IP {$contents}");
+ log_error(sprintf(gettext("DNSCACHE: Found old IP %1$s and new IP %2$s"), $oldcontents, $contents));
}
return ($oldcontents);
} else {
@@ -1569,11 +1569,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 %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, "Setting old alias value $origname to $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 4ea2932..cbeb855 100644
--- a/etc/inc/pkg-utils.inc
+++ b/etc/inc/pkg-utils.inc
@@ -176,7 +176,7 @@ 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)
@@ -194,7 +194,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++;
}
@@ -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("The {$package['name']} package is missing required dependencies and must be reinstalled." . $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;
@@ -259,7 +259,7 @@ function get_pkg_depends($pkg_name, $filetype = ".xml", $format = "files", $retu
if(!is_dir($prefix))
exec("/bin/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;
@@ -331,7 +331,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");
@@ -343,7 +343,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));
uninstall_package_from_name($package['name']);
install_package($package['name']);
}
@@ -363,8 +363,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));
uninstall_package_from_name($pkg_name);
install_package($pkg_name);
} else {
@@ -440,7 +440,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 */
@@ -448,45 +448,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 "<br>Show <a href=\"pkg_mgr_install.php?showlog=true\">install log</a></center>";
+ echo "<br>Show <a href=\"pkg_mgr_install.php?showlog=true\">" . gettext("install log") . "</a></center>";
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();
@@ -495,12 +495,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']);
@@ -534,7 +534,7 @@ 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<script language=\"JavaScript\">document.progressbar.style.visibility='hidden';</script>";
@@ -548,7 +548,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."));
}
}
@@ -556,7 +556,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();
@@ -573,8 +573,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);
@@ -587,19 +587,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<script language=\"JavaScript\">document.progressbar.style.visibility='hidden';</script>";
@@ -612,30 +612,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) {
@@ -656,20 +656,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 %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}");
}
$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
@@ -677,7 +677,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']))
@@ -685,7 +685,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']))
@@ -694,12 +694,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']))
@@ -708,12 +708,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']))
@@ -722,33 +722,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<script language=\"JavaScript\">document.progressbar.style.visibility='hidden';</script>";
@@ -762,8 +762,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);
if (!is_array($config['installedpackages']['package']))
return;
@@ -774,11 +774,11 @@ function delete_package($pkg, $pkgid) {
if (empty($pkg_info['configurationfile']))
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;
@@ -813,7 +813,7 @@ function delete_package_xml($pkg) {
$pkgid = get_pkg_id($pkg);
if ($pkgid == -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<script language=\"JavaScript\">document.progressbar.style.visibility='hidden';</script>";
@@ -827,12 +827,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'];
@@ -843,7 +843,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 .= "\tTabs items... ";
+ $static_output .= "\t" . gettext("Tabs items... ");
update_output_window($static_output);
if(is_array($pkg_config['tabs']['tab']) && is_array($tabs)) {
foreach($pkg_config['tabs']['tab'] as $tab) {
@@ -855,12 +855,12 @@ function delete_package_xml($pkg) {
}
}
}
- $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) {
@@ -872,12 +872,12 @@ function delete_package_xml($pkg) {
}
}
}
- $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) {
@@ -889,7 +889,7 @@ function delete_package_xml($pkg) {
}
}
}
- $static_output .= "done.\n";
+ $static_output .= gettext("done.") . "\n";
update_output_window($static_output);
}
/*
@@ -904,7 +904,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']))
@@ -918,34 +918,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);
@@ -953,7 +953,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]);
@@ -964,24 +964,24 @@ function delete_package_xml($pkg) {
unlink_if_exists($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)
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*";
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);
}
}
diff --git a/etc/inc/rrd.inc b/etc/inc/rrd.inc
index aaf4256..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("RRD dump failed exited with $dumpret, the error is: $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("RRD create failed exited with $rrdcreatereturn, the error is: $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("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 %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("The new RRD now has $numdsnew DS values and $numrranew RRA databases");
+ log_error(sprintf(gettext("The new RRD now has %1$s DS values and %2$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 %1$s, the error is: %2$s%3$s"), $rrdreturn, $rrdrestore, "\n"));
}
}
}
@@ -663,7 +663,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");
@@ -687,7 +687,7 @@ function enable_rrd_graphing() {
}
if($g['booting'])
- echo "done.\n";
+ echo gettext("done.") . "\n";
}
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index 9ca1166..b784108 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("DHCP leases restore failed exited with $dhcpreturn, the error is: $dhcprestore\n");
+ log_error(sprintf(gettext("DHCP leases restore failed exited with %1$s, the error is: %2$s%3$s"), $dhcpreturn, $dhcprestore, "\n"));
}
}
}
@@ -105,14 +105,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;
}
@@ -179,7 +179,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";
@@ -380,7 +380,7 @@ EOD;
join(" ", $dhcpdifs));
if ($g['booting']) {
- print "done.\n";
+ print gettext("done.") . "\n";
}
return 0;
@@ -429,14 +429,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;
}
@@ -490,7 +490,7 @@ function services_dhcrelay_configure() {
return 0;
if ($g['booting'])
- echo "Starting DHCP relay service...";
+ echo gettext("Starting DHCP relay service...");
else
sleep(1);
@@ -612,7 +612,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'])
@@ -624,7 +624,7 @@ function services_dyndns_configure($int = "") {
}
if ($g['booting'])
- echo "done.\n";
+ echo gettext("done.") . "\n";
}
return 0;
@@ -645,7 +645,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);
@@ -682,7 +682,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']) {
@@ -708,12 +708,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;
}
@@ -861,7 +861,7 @@ EOD;
"{$bindlan} -p {$g['varrun_path']}/snmpd.pid");
if ($g['booting'])
- echo "done.\n";
+ echo gettext("done.") . "\n";
}
return 0;
@@ -1256,8 +1256,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) {
@@ -1271,8 +1271,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";
}
@@ -1312,10 +1312,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');
@@ -1351,15 +1351,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();
diff --git a/etc/inc/shaper.inc b/etc/inc/shaper.inc
index 7d95f82..06cc4ba 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 = "<tr><td valign=\"center\" class=\"vncellreq\"><br>";
- $form .= "Enable/Disable";
+ $form .= gettext("Enable/Disable");
$form .= "<br/></td><td class=\"vncellreq\">";
$form .= " <input type=\"checkbox\" id=\"enabled\" name=\"enabled\" value=\"on\"";
if ($this->GetEnabled() == "on")
$form .= " CHECKED";
- $form .= " ><span class=\"vexpl\"> Enable/disable discipline and its children</span>";
+ $form .= " ><span class=\"vexpl\"> " . gettext("Enable/disable discipline and its children") . "</span>";
$form .= "</td></tr>";
- $form .= "<tr><td valign=\"center\" class=\"vncellreq\"><br><span class=\"vexpl\">Name</span></td>";
+ $form .= "<tr><td valign=\"center\" class=\"vncellreq\"><br><span class=\"vexpl\">" . gettext("Name") . "</span></td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<strong>".$this->GetQname()."</strong>";
$form .= "</td></tr>";
- $form .= "<tr><td valign=\"center\" class=\"vncellreq\">Scheduler Type ";
+ $form .= "<tr><td valign=\"center\" class=\"vncellreq\">" . gettext("Scheduler Type ");
$form .= "</td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<select id=\"scheduler\" name=\"scheduler\" class=\"formselect\">";
@@ -630,11 +630,11 @@ class altq_root_queue {
$form .= ">PRIQ</option>";
$form .= "</select>";
$form .= "<br> <span class=\"vexpl\">";
- $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 .= "</span>";
$form .= "</td></tr>";
- $form .= "<tr><td valign=\"center\" class=\"vncellreq\">Bandwidth";
+ $form .= "<tr><td valign=\"center\" class=\"vncellreq\">" . gettext("Bandwidth");
$form .= "</td><td class=\"vncellreq\">";
$form .= "<input type=\"text\" id=\"bandwidth\" name=\"bandwidth\" value=\"";
$form .= $this->GetBandwidth() . "\">";
@@ -669,9 +669,9 @@ class altq_root_queue {
$form .= $this->GetTbrConfig();
$form .= "\">";
$form .= "<br> <span class=\"vexpl\">";
- $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 .= "</span></td></tr>";
$form .= "<input type=\"hidden\" id=\"interface\" name=\"interface\"";
$form .= " value=\"" . $this->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,64 +1077,64 @@ class priq_queue {
*/
function build_form() {
$form = "<tr><td valign=\"center\" class=\"vncellreq\"><br>";
- $form .= "Enable/Disable";
+ $form .= gettext("Enable/Disable");
$form .= "<br/></td><td class=\"vncellreq\">";
$form .= " <input type=\"checkbox\" id=\"enabled\" name=\"enabled\" value=\"on\"";
if ($this->GetEnabled() == "on")
$form .= " CHECKED";
- $form .= " ><span class=\"vexpl\"> Enable/Disable queue and its children</span>";
+ $form .= " ><span class=\"vexpl\"> " . gettext("Enable/Disable queue and its children") . "</span>";
$form .= "</td></tr>";
$form .= "<tr>";
$form .= "<td width=\"22%\" valign=\"center\" class=\"vncellreq\">";
- $form .= "Queue Name</td><td width=\"78%\" class=\"vtable\">";
+ $form .= gettext("Queue Name") . "</td><td width=\"78%\" class=\"vtable\">";
$form .= "<input name=\"name\" type=\"text\" id=\"name\" class=\"formfld unknown\" size=\"15\" maxlength=\"15\" value=\"";
$form .= htmlspecialchars($this->GetQname());
$form .= "\">";
- $form .= "<br /> <span class=\"vexpl\">Enter the name of the queue here. Do not use spaces and limit the size to 15 characters.";
+ $form .= "<br /> <span class=\"vexpl\">" . gettext("Enter the name of the queue here. Do not use spaces and limit the size to 15 characters.");
$form .= "</span><br /></td>";
$form .= "</tr><tr>";
- $form .= "<td width=\"22%\" valign=\"center\" class=\"vncellreq\">Priority</td>";
+ $form .= "<td width=\"22%\" valign=\"center\" class=\"vncellreq\">" . gettext("Priority") . "</td>";
$form .= "<td width=\"78%\" class=\"vtable\"> <input name=\"priority\" type=\"text\" id=\"priority\" size=\"5\" value=\"";
$form .= htmlspecialchars($this->GetQpriority());
$form .= "\">";
- $form .= "<br> <span class=\"vexpl\">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.</span></td>";
+ $form .= "<br> <span class=\"vexpl\">" . 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.") . "</span></td>";
$form .= "</tr>";
$form .= "<tr>";
- $form .= "<td width=\"22%\" valign=\"center\" class=\"vncellreq\">Queue limit</td>";
+ $form .= "<td width=\"22%\" valign=\"center\" class=\"vncellreq\">" . gettext("Queue limit") . "</td>";
$form .= "<td width=\"78%\" class=\"vtable\"> <input name=\"qlimit\" type=\"text\" id=\"qlimit\" size=\"8\" value=\"";
$form .= htmlspecialchars($this->GetQlimit());
$form .= "\">";
- $form .= "<br> <span class=\"vexpl\">Queue limit in packets per second.";
+ $form .= "<br> <span class=\"vexpl\">" . gettext("Queue limit in packets per second.");
$form .= "</span></td>";
$form .= "<tr>";
- $form .= "<td width=\"22%\" valign=\"center\" class=\"vncell\">Scheduler options</td>";
+ $form .= "<td width=\"22%\" valign=\"center\" class=\"vncell\">" . gettext("Scheduler options") . "</td>";
$form .= "<td width=\"78%\" class=\"vtable\">";
$tmpvalue = $this->GetDefault();
if (!empty($tmpvalue)) {
$form .= "<input type=\"checkbox\" id=\"default\" CHECKED name=\"default\" value=\"default\"";
- $form .= "> Default queue<br>";
+ $form .= "> " . gettext("Default queue") . "<br>";
} else {
$form .= "<input type=\"checkbox\" id=\"default\" name=\"default\" value=\"default\"";
- $form .= "> Default queue<br>";
+ $form .= "> " . gettext("Default queue") . "<br>";
}
$form .= "<input type=\"checkbox\" id=\"red\" name=\"red\" value=\"red\" ";
$tmpvalue = $this->GetRed();
if(!empty($tmpvalue))
$form .= " CHECKED";
- $form .= "> <a target=\"_new\" href=\"http://www.openbsd.org/faq/pf/queueing.html#red\">Random Early Detection</a><br>";
+ $form .= "> <a target=\"_new\" href=\"http://www.openbsd.org/faq/pf/queueing.html#red\">" . gettext("Random Early Detection") . "</a><br>";
$form .= "<input type=\"checkbox\" id=\"rio\" name=\"rio\" value=\"rio\"";
$tmpvalue = $this->GetRio();
if(!empty($tmpvalue))
$form .= " CHECKED";
- $form .= "> <a target=\"_new\" href=\"http://www.openbsd.org/faq/pf/queueing.html#rio\">Random Early Detection In and Out</a><br>";
+ $form .= "> <a target=\"_new\" href=\"http://www.openbsd.org/faq/pf/queueing.html#rio\">" . gettext("Random Early Detection In and Out") . "</a><br>";
$form .= "<input type=\"checkbox\" id=\"ecn\" name=\"ecn\" value=\"ecn\"";
$tmpvalue = $this->GetEcn();
if(!empty($tmpvalue))
$form .= " CHECKED";
- $form .= "> <a target=\"_new\" href=\"http://www.openbsd.org/faq/pf/queueing.html#ecn\">Explicit Congestion Notification</a><br>";
- $form .= "<span class=\"vexpl\"><br>Select options for this queue";
+ $form .= "> <a target=\"_new\" href=\"http://www.openbsd.org/faq/pf/queueing.html#ecn\">" . gettext("Explicit Congestion Notification") . "</a><br>";
+ $form .= "<span class=\"vexpl\"><br>" . gettext("Select options for this queue");
$form .= "</tr><tr>";
- $form .= "<td width=\"22%\" class=\"vncellreq\">Description</td>";
+ $form .= "<td width=\"22%\" class=\"vncellreq\">" . gettext("Description") . "</td>";
$form .= "<td width=\"78%\" class=\"vtable\">";
$form .= "<input type=\"text\" name=\"description\" size=\"50%\" class=\"formfld unknown\" value=\"" . $this->GetDescription() . "\" >";
$form .= "</td></tr>";
@@ -1160,23 +1160,23 @@ class priq_queue {
*/
$form .= "<tr>";
$form .= "<td width=\"50%\" class=\"vncellreq\">";
- $form .= "Bandwidth: " . $this->GetBandwidth().$this->GetBwscale();
+ $form .= gettext("Bandwidth:") . " " . $this->GetBandwidth().$this->GetBwscale();
$form .= "</td><td width=\"50%\"></td></tr>";
$form .= "<tr><td width=\"20%\" class=\"vncellreq\">";
$tmpvalue = $this->GetQpriority();
if (!empty($tmpvalue))
- $form .= "Priority: on </td></tr>";
+ $form .= gettext("Priority: on") . " </td></tr>";
$tmpvalue = $this->GetDefault();
if (!empty($tmpvalue))
- $form .= "<tr><td class=\"vncellreq\">Default: on </td></tr>";
+ $form .= "<tr><td class=\"vncellreq\">" . gettext("Default: on") . " </td></tr>";
$form .= "<tr><td width=\"20%\" class=\"vncellreq\">";
$form .= "<a href=\"firewall_shaper_queues.php?interface=";
$form .= $this->GetInterface() . "&queue=";
$form .= $this->GetQname() . "&action=delete\">";
$form .= "<img src=\"";
$form .= "./themes/".$g['theme']."/images/icons/icon_x.gif\"";
- $form .= " width=\"17\" height=\"17\" border=\"0\" title=\"Delete queue from interface\">";
- $form .= "<span>Delete queue from interface</span></a></td></tr>";
+ $form .= " width=\"17\" height=\"17\" border=\"0\" title=\"" . gettext("Delete queue from interface") . "\">";
+ $form .= "<span>" . gettext("Delete queue from interface") . "</span></a></td></tr>";
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 .= "<tr>";
- $form .= "<td valign=\"center\" class=\"vncellreq\">Bandwidth</td>";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">" . gettext("Bandwidth") . "</td>";
$form .= "<td class=\"vtable\"> <input name=\"bandwidth\" id=\"bandwidth\" class=\"formfld unknown\" value=\"";
$form .= htmlspecialchars($this->GetBandwidth());
$form .= "\">";
@@ -1813,35 +1813,35 @@ class hfsc_queue extends priq_queue {
$form .= "<option value=\"Gb\"";
if ($this->GetBwscale() == "Gb")
$form .= " selected=\"yes\"";
- $form .= ">Gbit/s</option>";
+ $form .= ">" . gettext("Gbit/s") . "</option>";
$form .= "<option value=\"Mb\"";
if ($this->GetBwscale() == "Mb")
$form .= " selected=\"yes\"";
- $form .= ">Mbit/s</option>";
+ $form .= ">" . gettext("Mbit/s") . "</option>";
$form .= "<option value=\"Kb\"";
if ($this->GetBwscale() == "Kb")
$form .= " selected=\"yes\"";
- $form .= ">Kbit/s</option>";
+ $form .= ">" . gettext("Kbit/s") . "</option>";
$form .= "<option value=\"\"";
if ($this->GetBwscale() == "b")
$form .= " selected=\"yes\"";
- $form .= ">Bit/s</option>";
+ $form .= ">" . gettext("Bit/s") . "</option>";
$form .= "<option value=\"%\"";
if ($this->GetBwscale() == "%")
$form .= " selected=\"yes\"";
$form .= ">%</option>";
$form .= "</select> <br>";
- $form .= "<span class=\"vexpl\">Choose the amount of bandwidth for this queue";
+ $form .= "<span class=\"vexpl\">" . gettext("Choose the amount of bandwidth for this queue");
$form .= "</span></td></tr>";
$form .= "<tr>";
- $form .= "<td width=\"22%\" valign=\"center\" class=\"vncellreq\">Service Curve (sc)</td>";
+ $form .= "<td width=\"22%\" valign=\"center\" class=\"vncellreq\">" . gettext("Service Curve (sc)") . "</td>";
$form .= "<td width=\"78%\" class=\"vtable\">";
$form .= "<table>";
$form .= "<tr><td>&nbsp;</td><td><center>m1</center></td><td><center>d</center></td><td><center><b>m2</b></center></td></tr>";
$form .= "<tr><td><input type=\"checkbox\" id=\"upperlimit\" name=\"upperlimit\"";
if($this->GetUpperlimit()<> "")
$form .= " CHECKED ";
- $form .= "onChange=\"enable_upperlimit()\"> Upperlimit:</td><td><input size=\"6\" value=\"";
+ $form .= "onChange=\"enable_upperlimit()\"> " . gettext("Upperlimit:") . "</td><td><input size=\"6\" value=\"";
$form .= htmlspecialchars($this->GetU_m1());
$form .= "\" id=\"upperlimit1\" name=\"upperlimit1\" ";
if ($this->GetUpperlimit() == "")
@@ -1856,11 +1856,11 @@ class hfsc_queue extends priq_queue {
$form .= "\" id=\"upperlimit3\" name=\"upperlimit3\" ";
if ($this->GetUpperlimit() == "")
$form .= " disabled";
- $form .= "></td><td>The maximum allowed bandwidth for the queue.</td></tr>";
+ $form .= "></td><td>" . gettext("The maximum allowed bandwidth for the queue.") . "</td></tr>";
$form .= "<tr><td><input type=\"checkbox\" id=\"realtime\" name=\"realtime\"";
if($this->GetRealtime() <> "")
$form .= " CHECKED ";
- $form .= "onChange=\"enable_realtime()\"> Real time:</td><td><input size=\"6\" value=\"";
+ $form .= "onChange=\"enable_realtime()\"> " . gettext("Real time:") . "</td><td><input size=\"6\" value=\"";
$form .= htmlspecialchars($this->GetR_m1());
$form .= "\" id=\"realtime1\" name=\"realtime1\" ";
if ($this->GetRealtime() == "")
@@ -1875,11 +1875,11 @@ class hfsc_queue extends priq_queue {
$form .= "\" id=\"realtime3\" name=\"realtime3\" ";
if ($this->GetRealtime() == "")
$form .= " disabled";
- $form .= "></td><td>The minimum required bandwidth for the queue.</td></tr>";
+ $form .= "></td><td>" . gettext("The minimum required bandwidth for the queue.") . "</td></tr>";
$form .= "<tr><td><input type=\"checkbox\" id=\"linkshare\" id=\"linkshare\" name=\"linkshare\"";
if($this->GetLinkshare() <> "")
$form .= " CHECKED ";
- $form .= "onChange=\"enable_linkshare()\"> Link share:</td><td><input size=\"6\" value=\"";
+ $form .= "onChange=\"enable_linkshare()\"> " . gettext("Link share:") . "</td><td><input size=\"6\" value=\"";
$form .= htmlspecialchars($this->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 .= "></td><td>The bandwidth share of a backlogged queue - this overrides priority.</td></tr>";
+ $form .= "></td><td>" . gettext("The bandwidth share of a backlogged queue - this overrides priority.") . "</td></tr>";
$form .= "</table><br>";
- $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 .= "</span></td>";
$form .= "</tr>";
@@ -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 .= "<tr>";
- $form .= "<td valign=\"center\" class=\"vncellreq\">Bandwidth</td>";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">" . gettext("Bandwidth") . "</td>";
$form .= "<td class=\"vtable\"> <input name=\"bandwidth\" id=\"bandwidth\" class=\"formfld unknown\" value=\"";
if ($this->GetBandwidth() > 0)
$form .= htmlspecialchars($this->GetBandwidth());
@@ -2290,31 +2290,31 @@ class cbq_queue extends priq_queue {
$form .= "<option value=\"Gb\"";
if ($this->GetBwscale() == "Gb")
$form .= " selected=\"yes\"";
- $form .= ">Gbit/s</option>";
+ $form .= ">" . gettext("Gbit/s") . "</option>";
$form .= "<option value=\"Mb\"";
if ($this->GetBwscale() == "Mb")
$form .= " selected=\"yes\"";
- $form .= ">Mbit/s</option>";
+ $form .= ">" . gettext("Mbit/s") . "</option>";
$form .= "<option value=\"Kb\"";
if ($this->GetBwscale() == "Kb")
$form .= " selected=\"yes\"";
- $form .= ">Kbit/s</option>";
+ $form .= ">" . gettext("Kbit/s") . "</option>";
$form .= "<option value=\"\"";
if ($this->GetBwscale() == "b")
$form .= " selected=\"yes\"";
- $form .= ">Bit/s</option>";
+ $form .= ">" . gettext("Bit/s") . "</option>";
$form .= "<option value=\"%\"";
if ($this->GetBwscale() == "%")
$form .= " selected=\"yes\"";
$form .= ">%</option>";
$form .= "</select> <br>";
- $form .= "<span class=\"vexpl\">Choose the amount of bandwidth for this queue";
+ $form .= "<span class=\"vexpl\">" . gettext("Choose the amount of bandwidth for this queue");
$form .= "</span></td></tr>";
- $form .= "<tr><td class=\"vncellreq\">Scheduler specific options</td>";
+ $form .= "<tr><td class=\"vncellreq\">" . gettext("Scheduler specific options") . "</td>";
$form .= "<td class=\"vtable\"><input type=\"checkbox\" id=\"borrow\" name=\"borrow\"";
if($this->GetBorrow() == "on")
$form .= " CHECKED ";
- $form .= "> Borrow from other queues when available<br></td></tr>";
+ $form .= "> " . gettext("Borrow from other queues when available") . "<br></td></tr>";
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 .= "<tr>";
- $form .= "<td valign=\"center\" class=\"vncellreq\">Bandwidth</td>";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">" . gettext("Bandwidth") . "</td>";
$form .= "<td class=\"vtable\"> <input name=\"bandwidth\" id=\"bandwidth\" class=\"formfld unknown\" value=\"";
if ($this->GetBandwidth() > 0)
$form .= htmlspecialchars($this->GetBandwidth());
@@ -2557,38 +2557,38 @@ class fairq_queue extends priq_queue {
$form .= "<option value=\"Gb\"";
if ($this->GetBwscale() == "Gb")
$form .= " selected=\"yes\"";
- $form .= ">Gbit/s</option>";
+ $form .= ">" . gettext("Gbit/s") . "</option>";
$form .= "<option value=\"Mb\"";
if ($this->GetBwscale() == "Mb")
$form .= " selected=\"yes\"";
- $form .= ">Mbit/s</option>";
+ $form .= ">" . gettext("Mbit/s") . "</option>";
$form .= "<option value=\"Kb\"";
if ($this->GetBwscale() == "Kb")
$form .= " selected=\"yes\"";
- $form .= ">Kbit/s</option>";
+ $form .= ">" . gettext("Kbit/s") . "</option>";
$form .= "<option value=\"\"";
if ($this->GetBwscale() == "b")
$form .= " selected=\"yes\"";
- $form .= ">Bit/s</option>";
+ $form .= ">" . gettext("Bit/s") . "</option>";
$form .= "<option value=\"%\"";
if ($this->GetBwscale() == "%")
$form .= " selected=\"yes\"";
$form .= ">%</option>";
$form .= "</select> <br>";
- $form .= "<span class=\"vexpl\">Choose the amount of bandwidth for this queue";
+ $form .= "<span class=\"vexpl\">" . gettext("Choose the amount of bandwidth for this queue");
$form .= "</span></td></tr>";
- $form .= "<tr><td class=\"vncellreq\">Scheduler specific options</td>";
+ $form .= "<tr><td class=\"vncellreq\">" . gettext("Scheduler specific options") . "</td>";
$form .= "<td class=\"vtable\"><table><tr><td>";
$form .= "<input id=\"buckets\" name=\"buckets\" value=\"";
$tmpvalue = trim($this->GetBuckets());
if(!empty($tmpvalue))
$form .= $this->GetBuckets();
- $form .= "\"> Number of buckets available.<br></td></tr>";
+ $form .= "\"> " . gettext("Number of buckets available.") . "<br></td></tr>";
$form .= "<tr><td class=\"vtable\"><input id=\"hogs\" name=\"hogs\" value=\"";
$tmpvalue = trim($this->GetHogs());
if(!empty($tmpvalue))
$form .= $this->GetHogs();
- $form .= "\"> Bandwidth limit for hosts to not saturate link.<br></td></tr>";
+ $form .= "\"> " . gettext("Bandwidth limit for hosts to not saturate link.") . "<br></td></tr>";
$form .= "</table></td></tr>";
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 = "<tr><td valign=\"center\" class=\"vncellreq\"><br>";
- $form .= "Enable/Disable";
+ $form .= gettext("Enable/Disable");
$form .= "</td><td class=\"vncellreq\">";
$form .= " <input type=\"checkbox\" id=\"enabled\" name=\"enabled\" value=\"on\"";
if ($this->GetEnabled() == "on")
$form .= " CHECKED";
- $form .= " ><span class=\"vexpl\"> Enable/Disable limiter and its children</span>";
+ $form .= " ><span class=\"vexpl\"> " . gettext("Enable/Disable limiter and its children") . "</span>";
$form .= "</td></tr>";
- $form .= "<tr><td valign=\"center\" class=\"vncellreq\"><br><span class=\"vexpl\">Name</span></td>";
+ $form .= "<tr><td valign=\"center\" class=\"vncellreq\"><br><span class=\"vexpl\">" . gettext("Name") . "</span></td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<input type=\"text\" id=\"name\" name=\"name\" value=\"";
$form .= $this->GetQname()."\">";
$form .= "</td></tr>";
- $form .= "<tr><td valign=\"center\" class=\"vncellreq\">Bandwidth";
+ $form .= "<tr><td valign=\"center\" class=\"vncellreq\">" . gettext("Bandwidth");
$form .= "</td><td class=\"vncellreq\">";
$form .= "<input type=\"text\" id=\"bandwidth\" name=\"bandwidth\" value=\"";
$form .= $this->GetBandwidth() . "\">";
@@ -2962,22 +2962,22 @@ class dnpipe_class extends dummynet_class {
$form .= "<option value=\"Kb\"";
if ($this->GetBwscale() == "Kb")
$form .= " selected=\"yes\"";
- $form .= ">Kbit/s</option>";
+ $form .= ">" .gettext( "Kbit/s") . "</option>";
$form .= "<option value=\"Mb\"";
if ($this->GetBwscale() == "Mb")
$form .= " selected=\"yes\"";
- $form .= ">Mbit/s</option>";
+ $form .= ">" . gettext("Mbit/s") . "</option>";
$form .= "<option value=\"Gb\"";
if ($this->GetBwscale() == "Gb")
$form .= " selected=\"yes\"";
- $form .= ">Gbit/s</option>";
+ $form .= ">" . gettext("Gbit/s") . "</option>";
$form .= "<option value=\"\"";
if ($this->GetBwscale() == "b")
$form .= " selected=\"yes\"";
- $form .= ">Bit/s</option>";
+ $form .= ">" . gettext("Bit/s") . "</option>";
$form .= "</select>";
$form .= "</td></tr>";
- $form .= "<tr><td valign=\"center\" class=\"vncellreq\">Mask</td>";
+ $form .= "<tr><td valign=\"center\" class=\"vncellreq\">" . gettext("Mask") . "</td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<select name=\"mask\" class=\"formselect\">";
$form .= "<option value=\"none\"";
@@ -2987,71 +2987,70 @@ class dnpipe_class extends dummynet_class {
$form .= "<option value=\"srcaddress\"";
if ($this->GetMask() == "srcaddress")
$form .= " selected=\"yes\"";
- $form .= ">Source addresses</option>";
+ $form .= ">" . gettext("Source addresses") . "</option>";
$form .= "<option value=\"dstaddress\"";
if ($this->GetMask() == "dstaddress")
$form .= " selected=\"yes\"";
- $form .= ">Destination addresses</option>";
+ $form .= ">" . gettext("Destination addresses") . "</option>";
$form .= "</select>";
$form .= "&nbsp;<br>";
- $form .= "<span class=\"vexpl\">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.</span>";
+ $form .= "<span class=\"vexpl\">" . 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.") . "</span>";
$form .= "</td></tr>";
- $form .= "<tr><td valign=\"center\" class=\"vncellreq\">Description</td>";
+ $form .= "<tr><td valign=\"center\" class=\"vncellreq\">" . gettext("Description") . "</td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<input type=\"text\" class=\"formfld unknown\" size=\"50%\" id=\"description\" name=\"description\" value=\"";
$form .= $this->GetDescription();
$form .= "\">";
$form .= "<br> <span class=\"vexpl\">";
- $form .= "You may enter a description here ";
- $form .= "for your reference (not parsed).</span>";
+ $form .= gettext("You may enter a description here for your reference (not parsed).") . "</span>";
$form .= "</td></tr>";
$form .= "<tr id=\"sprtable4\" name=\"sprtable4\">";
$form .= "<td></td>";
$form .= "<td><div id=\"showadvancedboxspr\">";
$form .= "<p><input type=\"button\" onClick=\"show_source_port_range()\"";
- $form .= " value=\"Show advanced options\"></input></a>";
+ $form .= " value=\"" . gettext("Show advanced options") . "\"></input></a>";
$form .= "</div></td></tr>";
$form .= "<tr style=\"display:none\" id=\"sprtable\" name=\"sprtable\">";
- $form .= "<td valign=\"center\" class=\"vncellreq\">Delay</td>";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">" . gettext("Delay") . "</td>";
$form .= "<td valign=\"center\" class=\"vncellreq\">";
$form .= "<input name=\"delay\" type=\"text\" id=\"delay\" size=\"5\" value=\"";
$form .= $this->GetDelay() . "\">";
- $form .= "&nbsp;ms<br> <span class=\"vexpl\">Hint: in most cases, you ";
- $form .= "should specify 0 here (or leave the field empty)</span>";
+ $form .= "&nbsp;ms<br> <span class=\"vexpl\">" . gettext("Hint: in most cases, you "
+ . "should specify 0 here (or leave the field empty)") . "</span>";
$form .= "</td></tr><br/>";
$form .= "<tr style=\"display:none\" id=\"sprtable1\" name=\"sprtable1\">";
- $form .= "<td valign=\"center\" class=\"vncellreq\">Packet loss rate</td>";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">" . gettext("Packet loss rate") . "</td>";
$form .= "<td valign=\"center\" class=\"vncellreq\">";
$form .= "<input name=\"plr\" type=\"text\" id=\"plr\" size=\"5\" value=\"";
$form .= $this->GetPlr() . "\">";
- $form .= "&nbsp;<br> <span class=\"vexpl\">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</span>";
+ $form .= "&nbsp;<br> <span class=\"vexpl\">" . 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") . "</span>";
$form .= "</td></tr>";
$form .= "<tr style=\"display:none\" id=\"sprtable2\" name=\"sprtable2\">";
- $form .= "<td valign=\"center\" class=\"vncellreq\">Queue Size</td>";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">" . gettext("Queue Size") . "</td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<input type=\"text\" id=\"qlimit\" name=\"qlimit\" value=\"";
$form .= $this->GetQlimit() . "\">";
$form .= "&nbsp;slots<br>";
- $form .= "<span class=\"vexpl\">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.</span>";
+ $form .= "<span class=\"vexpl\">" . 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.") . "</span>";
$form .= "</td></tr>";
$form .= "<tr style=\"display:none\" id=\"sprtable5\" name=\"sprtable5\">";
- $form .= "<td valign=\"center\" class=\"vncellreq\">Bucket Size</td>";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">" . gettext("Bucket Size") . "</td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<input type=\"text\" id=\"buckets\" name=\"buckets\" value=\"";
$form .= $this->GetBuckets() . "\">";
$form .= "&nbsp;slots<br>";
- $form .= "<span class=\"vexpl\">Hint: in most cases, you ";
- $form .= "should leave the field empty. It increases the hash size set.";
+ $form .= "<span class=\"vexpl\">" . gettext("Hint: in most cases, you "
+ . "should leave the field empty. It increases the hash size set.");
$form .= "</td></tr>";
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 = "<tr><td valign=\"center\" class=\"vncellreq\"><br>";
- $form .= "Enable/Disable";
+ $form .= gettext("Enable/Disable");
$form .= "</td><td class=\"vncellreq\">";
$form .= " <input type=\"checkbox\" id=\"enabled\" name=\"enabled\" value=\"on\"";
if ($this->GetEnabled() == "on")
$form .= " CHECKED";
- $form .= " ><span class=\"vexpl\"> Enable/Disable queue and its children</span>";
+ $form .= " ><span class=\"vexpl\"> " . gettext("Enable/Disable queue and its children") . "</span>";
$form .= "</td></tr>";
- $form .= "<tr><td valign=\"center\" class=\"vncellreq\"><br><span class=\"vexpl\">Name</span></td>";
+ $form .= "<tr><td valign=\"center\" class=\"vncellreq\"><br><span class=\"vexpl\">" . gettext("Name") . "</span></td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<input type=\"text\" id=\"name\" name=\"name\" value=\"";
$form .= $this->GetQname()."\">";
$form .= "</td></tr>";
- $form .= "<tr><td valign=\"center\" class=\"vncellreq\">Mask</td>";
+ $form .= "<tr><td valign=\"center\" class=\"vncellreq\">" . gettext("Mask") . "</td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<select name=\"mask\" class=\"formselect\">";
$form .= "<option value=\"none\"";
if ($this->GetMask() == "none")
$form .= " selected=\"yes\"";
- $form .= ">none</option>";
+ $form .= ">" . gettext("none") . "</option>";
$form .= "<option value=\"srcaddress\"";
if ($this->GetMask() == "srcaddress")
$form .= " selected=\"yes\"";
- $form .= ">Source addresses</option>";
+ $form .= ">" . gettext("Source addresses") . "</option>";
$form .= "<option value=\"dstaddress\"";
if ($this->GetMask() == "dstaddress")
$form .= " selected=\"yes\"";
- $form .= ">Destination addresses</option>";
+ $form .= ">" . gettext("Destination addresses") . "</option>";
$form .= "</select>";
$form .= "&nbsp;slots<br>";
- $form .= "<span class=\"vexpl\">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.</span>";
+ $form .= "<span class=\"vexpl\">" . 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.") . "</span>";
$form .= "</td></tr>";
$form .= "<tr><td valign=\"center\" class=\"vncellreq\">Description</td>";
$form .= "<td class=\"vncellreq\">";
@@ -3226,51 +3225,50 @@ class dnqueue_class extends dummynet_class {
$form .= $this->GetDescription();
$form .= "\">";
$form .= "<br> <span class=\"vexpl\">";
- $form .= "You may enter a description here ";
- $form .= "for your reference (not parsed).</span>";
+ $form .= gettext("You may enter a description here for your reference (not parsed).") . "</span>";
$form .= "</td></tr>";
$form .= "<tr id=\"sprtable4\" name=\"sprtable4\">";
$form .= "<td></td>";
$form .= "<td><div id=\"showadvancedboxspr\">";
$form .= "<p><input type=\"button\" onClick=\"show_source_port_range()\"";
- $form .= " value=\"Show advanced options\"></input></a>";
+ $form .= " value=\"" . gettext("Show advanced options") . "\"></input></a>";
$form .= "</div></td></tr>";
$form .= "<tr style=\"display:none\" id=\"sprtable\" name=\"sprtable\">";
- $form .= "<td valign=\"center\" class=\"vncellreq\">Weight</td>";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">" . gettext("Weight") . "</td>";
$form .= "<td valign=\"center\" class=\"vncellreq\">";
$form .= "<input name=\"weight\" type=\"text\" id=\"weight\" size=\"5\" value=\"";
$form .= $this->GetWeight() . "\">";
- $form .= "&nbsp;ms<br> <span class=\"vexpl\">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)</span>";
+ $form .= "&nbsp;ms<br> <span class=\"vexpl\">" . 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)") . "</span>";
$form .= "</td></tr>";
$form .= "<tr style=\"display:none\" id=\"sprtable1\" name=\"sprtable1\">";
- $form .= "<td valign=\"center\" class=\"vncellreq\">Packet loss rate</td>";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">" . gettext("Packet loss rate") . "</td>";
$form .= "<td valign=\"center\" class=\"vncellreq\">";
$form .= "<input name=\"plr\" type=\"text\" id=\"plr\" size=\"5\" value=\"";
$form .= $this->GetPlr() . "\">";
- $form .= "&nbsp;<br> <span class=\"vexpl\">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</span>";
+ $form .= "&nbsp;<br> <span class=\"vexpl\">" . 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") . "</span>";
$form .= "</td></tr>";
$form .= "<tr style=\"display:none\" id=\"sprtable2\" name=\"sprtable2\">";
- $form .= "<td valign=\"center\" class=\"vncellreq\">Queue Size</td>";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">" . gettext("Queue Size") . "</td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<input type=\"text\" id=\"qlimit\" name=\"qlimit\" value=\"";
$form .= $this->GetQlimit() . "\">";
$form .= "&nbsp;slots<br>";
- $form .= "<span class=\"vexpl\">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.</span>";
+ $form .= "<span class=\"vexpl\">" . 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.") . "</span>";
$form .= "</td></tr>";
$form .= "<tr style=\"display:none\" id=\"sprtable5\" name=\"sprtable5\">";
- $form .= "<td valign=\"center\" class=\"vncellreq\">Bucket Size</td>";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">" . gettext("Bucket Size") . "</td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<input type=\"text\" id=\"buckets\" name=\"buckets\" value=\"";
$form .= $this->GetBuckets() . "\">";
- $form .= "&nbsp;slots<br>";
- $form .= "<span class=\"vexpl\">Hint: in most cases, you ";
- $form .= "should leave the field empty. It increases the hash size set.";
+ $form .= "&nbsp;" . gettext("slots") . "<br>";
+ $form .= "<span class=\"vexpl\">" . gettext("Hint: in most cases, you "
+ . "should leave the field empty. It increases the hash size set.");
$form .= "</td></tr>";
$form .= "<input type=\"hidden\" id=\"pipe\" name=\"pipe\"";
@@ -3403,27 +3401,26 @@ class layer7 {
function build_form() {
$form = "<tr><td valign=\"center\" class=\"vncellreq\"><br>";
- $form .= "Enable/Disable";
+ $form .= gettext("Enable/Disable");
$form .= "</td><td class=\"vncellreq\">";
$form .= " <input type=\"checkbox\" id=\"enabled\" name=\"enabled\" value=\"on\" ";
if ($this->GetREnabled() == "on") {
$form .= "checked = \"CHECKED\"";
}
- $form .= " ><span class=\"vexpl\"> Enable/Disable layer7 Container</span>";
+ $form .= " ><span class=\"vexpl\"> " . gettext("Enable/Disable layer7 Container") . "</span>";
$form .= "</td></tr>";
- $form .= "<tr><td valign=\"center\" class=\"vncellreq\"><br><span class=\"vexpl\">Name</span></td>";
+ $form .= "<tr><td valign=\"center\" class=\"vncellreq\"><br><span class=\"vexpl\">" . gettext("Name") . "</span></td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<input type=\"text\" id=\"container\" name=\"container\" value=\"";
$form .= $this->GetRName()."\">";
$form .= "</td></tr>";
- $form .= "<tr><td valign=\"center\" class=\"vncellreq\">Description</td>";
+ $form .= "<tr><td valign=\"center\" class=\"vncellreq\">" . gettext("Description") . "</td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<input type=\"text\" class=\"formfld unknown\" size=\"50%\" id=\"description\" name=\"description\" value=\"";
$form .= $this->GetRDescription();
$form .= "\">";
$form .= "<br> <span class=\"vexpl\">";
- $form .= "You may enter a description here ";
- $form .= "for your reference (not parsed).</span>";
+ $form .= gettext("You may enter a description here for your reference (not parsed).") . "</span>";
$form .= "</td></tr>";
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() {
@@ -3660,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..
@@ -3966,31 +3963,31 @@ function build_iface_without_this_queue($iface, $qname) {
$scheduler = ": " . $altq->GetScheduler();
$form = "<tr><td width=\"20%\" >";
$form .= "<a href=\"firewall_shaper.php?interface=" . $iface . "&queue=" . $iface."&action=show\">".$iface.": ".$scheduler."</a>";
- $form .= "</td></tr>";
- $form .= "<tr><td width=\"100%\" class=\"vncellreq\">";
- $form .= "<a href=\"firewall_shaper_queues.php?interface=";
- $form .= $iface . "&queue=". $qname . "&action=add\">";
- $form .= "<img src=\"";
- $form .= "./themes/".$g['theme']."/images/icons/icon_plus.gif\"";
- $form .= " width=\"17\" height=\"17\" border=\"0\" title=\"Clone shaper/queue on this interface\">";
- $form .= " Clone shaper/queue on this interface</a></td></tr>";
+ $form .= "</td></tr>";
+ $form .= "<tr><td width=\"100%\" class=\"vncellreq\">";
+ $form .= "<a href=\"firewall_shaper_queues.php?interface=";
+ $form .= $iface . "&queue=". $qname . "&action=add\">";
+ $form .= "<img src=\"";
+ $form .= "./themes/".$g['theme']."/images/icons/icon_plus.gif\"";
+ $form .= " width=\"17\" height=\"17\" border=\"0\" title=\"" . gettext("Clone shaper/queue on this interface") . "\">";
+ $form .= gettext(" Clone shaper/queue on this interface") . "</a></td></tr>";
- return $form;
+ return $form;
}
$default_shaper_msg = "<tr><td align=\"center\" width=\"80%\" >";
-$default_shaper_msg .= "<span class=\"vexpl\"><strong><p><b>Welcome to the {$g['product_name']} Traffic Shaper.</b><br />";
-$default_shaper_msg .= "The tree on the left helps you navigate through the queues <br />";
-$default_shaper_msg .= "buttons at the bottom represent queue actions and are activated accordingly.";
+$default_shaper_msg .= "<span class=\"vexpl\"><strong><p><b>" . sprintf(gettext("Welcome to the %s Traffic Shaper."), $g['product_name']) . "</b><br />";
+$default_shaper_msg .= gettext("The tree on the left helps you navigate through the queues <br />"
+ . "buttons at the bottom represent queue actions and are activated accordingly.");
$default_shaper_msg .= " </p></strong></span>";
$default_shaper_msg .= "</td></tr>";
$dn_default_shaper_msg = "<tr><td align=\"center\" width=\"80%\" >";
-$dn_default_shaper_msg .= "<span class=\"vexpl\"><strong><p><b>Welcome to the {$g['product_name']} Traffic Shaper.</b><br />";
-$dn_default_shaper_msg .= "The tree on the left helps you navigate through the queues <br />";
-$dn_default_shaper_msg .= "buttons at the bottom represent queue actions and are activated accordingly.";
+$dn_default_shaper_msg .= "<span class=\"vexpl\"><strong><p><b>" . sprintf(gettext("Welcome to the %s Traffic Shaper."), $g['product_name']) . "</b><br />";
+$dn_default_shaper_msg .= gettext("The tree on the left helps you navigate through the queues <br />"
+ . "buttons at the bottom represent queue actions and are activated accordingly.");
$dn_default_shaper_msg .= " </p></strong></span>";
$dn_default_shaper_msg .= "</td></tr>";
diff --git a/etc/inc/smtp.inc b/etc/inc/smtp.inc
index 4f39682..c33978d 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 \"%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) : "??");
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 \"%1$s\": %2$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 %1$s may not be used: %2$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) && $host<count($hosts);$host++)
{
$domain=$hosts[$host];
- $error=$this->ConnectToHost($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
+?>
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index e728910..59ea4ea 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;
}
@@ -212,7 +212,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;
}
@@ -362,7 +362,7 @@ 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: %1$s default route to %2$s"), $action, $gatewayip));
mwexec("/sbin/route {$action} default " . escapeshellarg($gatewayip));
}
}
@@ -373,7 +373,7 @@ function system_routing_configure($interface = "") {
foreach ($config['staticroutes']['route'] as $rtent) {
$gatewayip = "";
if (empty($gateways_arr[$rtent['gateway']])) {
- 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;
}
$gateway = $gateways_arr[$rtent['gateway']];
@@ -418,7 +418,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");
@@ -459,7 +459,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";
@@ -622,7 +622,7 @@ EOD;
}
if ($g['booting'])
- echo "done.\n";
+ echo gettext("done.") . "\n";
return $retval;
}
@@ -635,7 +635,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");
@@ -645,9 +645,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;
@@ -658,7 +658,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");
@@ -687,10 +687,10 @@ function system_webgui_start() {
if (!is_array($config['cert']))
$config['cert'] = array();
$a_cert =& $config['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");
@@ -700,7 +700,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);
@@ -728,9 +728,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;
@@ -1044,7 +1044,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);
@@ -1055,7 +1055,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);
@@ -1063,7 +1063,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 <> "")
@@ -1085,7 +1085,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);
@@ -1105,7 +1105,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'];
@@ -1121,7 +1121,7 @@ function system_timezone_configure() {
conf_mount_ro();
if ($g['booting'])
- echo "done.\n";
+ echo gettext("done.") . "\n";
}
function system_ntp_configure() {
@@ -1132,17 +1132,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']) {
@@ -1191,7 +1191,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) {
@@ -1199,7 +1199,7 @@ function sync_system_time() {
}
if ($g['booting'])
- echo "done.\n";
+ echo gettext("done.") . "\n";
}
@@ -1296,7 +1296,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;
}
@@ -1317,7 +1317,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'];
@@ -1329,13 +1329,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";
}
}
}
@@ -1434,10 +1434,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')
@@ -1446,10 +1446,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]);
@@ -1461,7 +1461,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() {
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc
index 1182156..e604987 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;
}
@@ -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";
@@ -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";
}
@@ -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']);
@@ -1611,7 +1611,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;
}
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index 90a5f9f..a46fae3 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -97,7 +97,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 = "") {
@@ -117,7 +117,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++;
@@ -200,7 +200,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);
@@ -783,7 +783,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 '%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 3b8e1ac..58c6dc5 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[] = "$voucher ($roll/$nr) active and good for $remaining Minutes";
+ $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,22 +164,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("%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[] = "$voucher ($roll/$nr) good for {$minutes_per_roll[$roll]} Minutes";
+ $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[] = "$voucher ($roll/$nr): not found on any registererd Roll";
+ $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
- $test_result[] = "$voucher invalid: $result !!";
+ $test_result[] = "$voucher " . gettext("invalid:") . " $result !!";
$error++;
}
}
@@ -187,9 +187,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;
@@ -257,7 +257,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
@@ -274,7 +274,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;
}
@@ -285,7 +285,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;
}
@@ -321,7 +321,7 @@ function voucher_configure() {
}
unlock($voucherlck);
- echo "done\n";
+ echo gettext("done") . "\n";
}
}
return 0;
@@ -339,7 +339,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 %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, "cant read {$g['vardb_path']}/voucher_used_$roll.db");
+ voucher_log(LOG_ERR, sprintf(gettext("cant read %1$s/voucher_used_%2$s.db"), $g['vardb_path'], $roll));
}
}
return base64_decode($vdb);
@@ -437,7 +437,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();
}
@@ -483,4 +483,4 @@ function voucher_save_db_to_config() {
return;
}
-?> \ No newline at end of file
+?>
diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc
index 0494a4d..c5802fc 100644
--- a/etc/inc/vpn.inc
+++ b/etc/inc/vpn.inc
@@ -120,7 +120,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");
@@ -206,18 +206,18 @@ function vpn_ipsec_configure($ipchg = false)
if (is_array($config['ca']) && count($config['ca'])) {
foreach ($config['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;
}
}
@@ -226,7 +226,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;
}
@@ -288,7 +288,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;
}
@@ -380,7 +380,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;
}
@@ -508,7 +508,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;
}
@@ -517,7 +517,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;
}
@@ -528,7 +528,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;
}
@@ -541,7 +541,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;
}
@@ -760,7 +760,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;
}
@@ -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("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 %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}");
}
@@ -930,7 +930,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();
}
@@ -958,7 +958,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");
@@ -968,7 +968,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 */
@@ -986,7 +986,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;
}
@@ -1099,7 +1099,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;
}
@@ -1123,7 +1123,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;
}
@@ -1175,7 +1175,7 @@ function vpn_pppoe_configure(&$pppoecfg) {
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{$pppoecfg['pppoeid']}-vpn.pid");
@@ -1199,7 +1199,7 @@ function vpn_pppoe_configure(&$pppoecfg) {
/* write mpd.conf */
$fd = fopen("{$g['varetc_path']}/pppoe{$pppoecfg['pppoeid']}-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{$pppoecfg['pppoeid']}-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;
}
@@ -1322,7 +1322,7 @@ EOD;
/* write mpd.secret */
$fd = fopen("{$g['varetc_path']}/pppoe{$pppoecfg['pppoeid']}-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;
}
@@ -1348,7 +1348,7 @@ EOD;
}
if ($g['booting'])
- echo "done\n";
+ echo gettext("done") . "\n";
return 0;
}
@@ -1367,7 +1367,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");
@@ -1392,7 +1392,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";
@@ -1482,7 +1482,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;
}
@@ -1507,7 +1507,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;
}
@@ -1638,22 +1638,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 '%1$s' new EP '%2$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 '%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("Reloading IPsec tunnel '{$phase1['descr']}'. Previous IP '{$old_gw}', current IP '{$rgip}'. Reloading policy");
+ 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 118a97b..79bbad0 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: %1$s at line %2$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: %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;
@@ -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;
}
diff --git a/etc/inc/xmlparse_attr.inc b/etc/inc/xmlparse_attr.inc
index 06d02c4..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("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)) {
@@ -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: %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)) {
@@ -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);
diff --git a/etc/inc/xmlreader.inc b/etc/inc/xmlreader.inc
index 3d21be1..f1450b8 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];
}
diff --git a/etc/inc/xmlrpc_client.inc b/etc/inc/xmlrpc_client.inc
index bac5e1f..bd0f1bd 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 %1$s cannot be child of %2$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-.<space> 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;
@@ -1491,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 . ')');
@@ -1517,7 +1519,7 @@ class XML_RPC_Message extends XML_RPC_Base
if (!xml_parse($parser_resource, $data, sizeof($data))) {
// thanks to Peter Kocks <peter.kocks@baygate.com>
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)),
@@ -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
+?>
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
+?>
diff --git a/etc/inc/zeromq.inc b/etc/inc/zeromq.inc
index 3cb1843..fe39e82 100644
--- a/etc/inc/zeromq.inc
+++ b/etc/inc/zeromq.inc
@@ -306,4 +306,4 @@ function get_notices_zeromq($raw_params) {
return serialize($toreturn);
}
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud