diff options
author | Carlos Eduardo Ramos <carlos.ramos@bluepex.com> | 2010-08-16 17:43:15 -0300 |
---|---|---|
committer | Carlos Eduardo Ramos <carlos.ramos@bluepex.com> | 2010-08-16 17:43:15 -0300 |
commit | 487415e888a9c82484809a10de24f66447171c49 (patch) | |
tree | b98eae0173730008160fc37b610a8e910cb6d296 /etc/inc/PEAR.inc | |
parent | 4aa02281b02f74ed44b18e1ee98dd5b57f77ae0c (diff) | |
download | pfsense-487415e888a9c82484809a10de24f66447171c49.zip pfsense-487415e888a9c82484809a10de24f66447171c49.tar.gz |
Implement gettext() calls on PEAR.inc
Diffstat (limited to 'etc/inc/PEAR.inc')
-rw-r--r-- | etc/inc/PEAR.inc | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/etc/inc/PEAR.inc b/etc/inc/PEAR.inc index 26d1159..ac5cc12 100644 --- a/etc/inc/PEAR.inc +++ b/etc/inc/PEAR.inc @@ -158,7 +158,7 @@ class PEAR { $classname = strtolower(get_class($this)); if ($this->_debug) { - print "PEAR constructor called, class=$classname\n"; + printf(gettext("PEAR constructor called, class=%s%s"), $classname, "\n"); } if ($error_class !== null) { $this->_error_class = $error_class; @@ -195,7 +195,7 @@ class PEAR */ function _PEAR() { if ($this->_debug) { - printf("PEAR destructor called, class=%s\n", strtolower(get_class($this))); + printf(gettext("PEAR destructor called, class=%s%s"), strtolower(get_class($this)), "\n"); } } @@ -334,12 +334,12 @@ class PEAR if (is_callable($options)) { $setoptions = $options; } else { - trigger_error("invalid error callback", E_USER_WARNING); + trigger_error(gettext("invalid error callback"), E_USER_WARNING); } break; default: - trigger_error("invalid error mode", E_USER_WARNING); + trigger_error(gettext("invalid error mode"), E_USER_WARNING); break; } } @@ -442,17 +442,17 @@ class PEAR $deleted = false; } } - return $deleted ? true : PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME + return $deleted ? true : PEAR::raiseError(gettext("The expected error you submitted does not exist")); // IMPROVE ME } elseif (!empty($error_code)) { // $error_code comes alone, trying to unset it if ($this->_checkDelExpect($error_code)) { return true; } else { - return PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME + return PEAR::raiseError(gettext("The expected error you submitted does not exist")); // IMPROVE ME } } else { // $error_code is empty - return PEAR::raiseError("The expected error you submitted is empty"); // IMPROVE ME + return PEAR::raiseError(gettext("The expected error you submitted is empty")); // IMPROVE ME } } @@ -592,12 +592,12 @@ class PEAR if (is_callable($options)) { $def_options = $options; } else { - trigger_error("invalid error callback", E_USER_WARNING); + trigger_error(gettext("invalid error callback"), E_USER_WARNING); } break; default: - trigger_error("invalid error mode", E_USER_WARNING); + trigger_error(gettext("invalid error mode"), E_USER_WARNING); break; } $stack[] = array($mode, $options); @@ -629,12 +629,12 @@ class PEAR if (is_callable($options)) { $setoptions = $options; } else { - trigger_error("invalid error callback", E_USER_WARNING); + trigger_error(gettext("invalid error callback"), E_USER_WARNING); } break; default: - trigger_error("invalid error mode", E_USER_WARNING); + trigger_error(gettext("invalid error mode"), E_USER_WARNING); break; } return true; @@ -863,7 +863,7 @@ class PEAR_Error } } if ($this->mode & PEAR_ERROR_EXCEPTION) { - trigger_error("PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_ErrorStack for exceptions", E_USER_WARNING); + trigger_error(gettext("PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_ErrorStack for exceptions"), E_USER_WARNING); eval('$e = new Exception($this->message, $this->code);$e->PEAR_Error = $this;throw($e);'); } } @@ -1020,8 +1020,8 @@ class PEAR_Error } else { $callback = $this->callback; } - return sprintf('[%s: message="%s" code=%d mode=callback '. - 'callback=%s prefix="%s" info="%s"]', + return sprintf(gettext('[%s: message="%s" code=%d mode=callback '. + 'callback=%s prefix="%s" info="%s"]'), strtolower(get_class($this)), $this->message, $this->code, $callback, $this->error_message_prefix, $this->userinfo); @@ -1038,8 +1038,8 @@ class PEAR_Error if ($this->mode & PEAR_ERROR_RETURN) { $modes[] = 'return'; } - return sprintf('[%s: message="%s" code=%d mode=%s level=%s '. - 'prefix="%s" info="%s"]', + return sprintf(gettext('[%s: message="%s" code=%d mode=%s level=%s '. + 'prefix="%s" info="%s"]'), strtolower(get_class($this)), $this->message, $this->code, implode("|", $modes), $levels[$this->level], $this->error_message_prefix, @@ -1056,4 +1056,4 @@ class PEAR_Error * c-basic-offset: 4 * End: */ -?>
\ No newline at end of file +?> |