Update all the _( to dgettext ("domframework"
Update locales git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@5271 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -95,8 +95,8 @@ class authshibboleth extends auth
|
||||
{
|
||||
// Redirect to Shibboleth IDP
|
||||
if ($this->urlLogout === "")
|
||||
throw new \Exception (_("Shibboleth is not configured to allow logout"),
|
||||
405);
|
||||
throw new \Exception (dgettext("domframework",
|
||||
"Shibboleth is not configured to allow logout"), 405);
|
||||
$route = new route ();
|
||||
$route->redirect ($this->urlLogout);
|
||||
}
|
||||
|
||||
@@ -58,8 +58,8 @@ extendedKeyUsage = serverAuth, clientAuth
|
||||
// {{{
|
||||
{
|
||||
if (! function_exists ("openssl_csr_new"))
|
||||
throw new \Exception (_("No openssl support in PHP"),
|
||||
500);
|
||||
throw new \Exception (dgettext("domframework",
|
||||
"No openssl support in PHP"), 500);
|
||||
$this->opensslCnfPath = tempnam ("/tmp", "openssl-");
|
||||
file_put_contents ($this->opensslCnfPath, $this->opensslConf);
|
||||
$this->configargs = array (
|
||||
|
||||
23
dbjson.php
23
dbjson.php
@@ -38,30 +38,33 @@ class dbjson
|
||||
500);
|
||||
$pos = strpos ($dsn, "://");
|
||||
if ($pos === false)
|
||||
throw new \Exception (_("No DSN provided to dbjson"), 500);
|
||||
throw new \Exception (dgettext("domframework",
|
||||
"No DSN provided to dbjson"), 500);
|
||||
if (substr ($dsn, 0, $pos) !== "dbjson")
|
||||
throw new \Exception (_("Invalid database type provided in dbjson"), 500);
|
||||
throw new \Exception (dgettext("domframework",
|
||||
"Invalid database type provided in dbjson"), 500);
|
||||
$this->dbfile = substr ($dsn, $pos+3);
|
||||
$directory = dirname ($this->dbfile);
|
||||
if (! file_exists ($directory))
|
||||
@mkdir ($directory, 0777, true);
|
||||
if (! file_exists ($directory))
|
||||
throw new \Exception (sprintf (_("Directory '%s' doesn't exists"),
|
||||
$directory), 500);
|
||||
throw new \Exception (sprintf (dgettext("domframework",
|
||||
"Directory '%s' doesn't exists"), $directory), 500);
|
||||
if (! file_exists ($this->dbfile))
|
||||
{
|
||||
if (! is_readable ($directory))
|
||||
throw new \Exception (sprintf (
|
||||
_("Directory '%s' not writeable and dbfile '%s' not exists"),
|
||||
$directory, $this->dbfile), 500);
|
||||
dgettext("domframework",
|
||||
"Directory '%s' not writeable and dbfile '%s' not exists"),
|
||||
$directory, $this->dbfile), 500);
|
||||
touch ($this->dbfile);
|
||||
}
|
||||
if (! is_readable ($this->dbfile))
|
||||
throw new \Exception(sprintf (_("File '%s' not readable"), $this->dbfile),
|
||||
500);
|
||||
throw new \Exception(sprintf (dgettext("domframework",
|
||||
"File '%s' not readable"), $this->dbfile), 500);
|
||||
if (! is_writeable ($this->dbfile))
|
||||
throw new \Exception(sprintf (_("File '%s' not readable"), $this->dbfile),
|
||||
500);
|
||||
throw new \Exception(sprintf (dgettext("domframework",
|
||||
"File '%s' not readable"), $this->dbfile), 500);
|
||||
$this->dsn = $dsn;
|
||||
$this->dbfile = $this->dbfile;
|
||||
}
|
||||
|
||||
3
form.php
3
form.php
@@ -453,7 +453,8 @@ class form
|
||||
if ($field->mandatory !== null &&
|
||||
(! array_key_exists ($field->name, $values) ||
|
||||
trim ($values[$field->name]) === ""))
|
||||
$errors[$field->name] = _("Field mandatory and not provided");
|
||||
$errors[$field->name] = dgettext("domframework",
|
||||
"Field mandatory and not provided");
|
||||
}
|
||||
return $errors;
|
||||
}
|
||||
|
||||
4
fts.php
4
fts.php
@@ -98,8 +98,8 @@ class fts
|
||||
{
|
||||
if (! array_key_exists ($field, $dbl->fields ()))
|
||||
throw new \Exception (sprintf (
|
||||
_("The field '%s' doesn't exists in database"),
|
||||
$field), 500);
|
||||
dgettext("domframework", "The field '%s' doesn't exists in database"),
|
||||
$field), 500);
|
||||
if ($i > 0)
|
||||
$dbl->whereAddOR ();
|
||||
$dbl->whereAddParenthesisOpen ();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
60
mail.php
60
mail.php
@@ -109,7 +109,8 @@ class mail
|
||||
private function sectionAddChild ($sectionIDParent, $sectionIDchild)
|
||||
{
|
||||
if (! array_key_exists ($sectionIDParent, $this->sections))
|
||||
throw new \Exception (_("Section parent not found"), 404);
|
||||
throw new \Exception (dgettext("domframework",
|
||||
"Section parent not found"), 404);
|
||||
$this->sections[$sectionIDParent]["_partsIDchild"][] = $sectionIDchild;
|
||||
$this->sections[$sectionIDchild]["_parentID"] = $sectionIDParent;
|
||||
}
|
||||
@@ -121,7 +122,8 @@ class mail
|
||||
private function sectionAddChildFirst ($sectionIDParent, $sectionIDchild)
|
||||
{
|
||||
if (! array_key_exists ($sectionIDParent, $this->sections))
|
||||
throw new \Exception (_("Section parent not found"), 404);
|
||||
throw new \Exception (dgettext("domframework",
|
||||
"Section parent not found"), 404);
|
||||
array_unshift ($this->sections[$sectionIDParent]["_partsIDchild"],
|
||||
$sectionIDchild);
|
||||
$this->sections[$sectionIDchild]["_parentID"] = $sectionIDParent;
|
||||
@@ -134,7 +136,8 @@ class mail
|
||||
private function sectionDelChilds ($sectionID)
|
||||
{
|
||||
if (! array_key_exists ($sectionID, $this->sections))
|
||||
throw new \Exception (_("Section not found"), 404);
|
||||
throw new \Exception (dgettext("domframework",
|
||||
"Section not found"), 404);
|
||||
unset ($this->sections[$sectionID]["_partsIDchild"]);
|
||||
}
|
||||
|
||||
@@ -145,10 +148,10 @@ class mail
|
||||
private function sectionUpdate ($sectionID, $param)
|
||||
{
|
||||
if (! array_key_exists ($sectionID, $this->sections))
|
||||
throw new \Exception (_("Section not found"), 404);
|
||||
throw new \Exception (dgettext("domframework", "Section not found"), 404);
|
||||
if (! is_array ($param))
|
||||
throw new \Exception (_("Param provided to sectionUpdate is not array"),
|
||||
406);
|
||||
throw new \Exception (dgettext("domframework",
|
||||
"Param provided to sectionUpdate is not array"), 406);
|
||||
foreach ($param as $key=>$val)
|
||||
{
|
||||
$this->sections[$sectionID][$key] = $val;
|
||||
@@ -186,7 +189,8 @@ class mail
|
||||
private function sectionGet ($sectionID)
|
||||
{
|
||||
if (! array_key_exists ($sectionID, $this->sections))
|
||||
throw new \Exception (_("Section not found"), 404);
|
||||
throw new \Exception (dgettext("domframework",
|
||||
"Section not found"), 404);
|
||||
return $this->sections[$sectionID];
|
||||
}
|
||||
|
||||
@@ -260,7 +264,8 @@ class mail
|
||||
$boundaryCR = array_shift ($boundaryArray);
|
||||
}
|
||||
if ($boundary === false)
|
||||
throw new \Exception (_("Can't find boundary in multipart/"), 406);
|
||||
throw new \Exception (dgettext("domframework",
|
||||
"Can't find boundary in multipart/"), 406);
|
||||
$boundary = substr ($boundary, 2);
|
||||
unset ($boundaryArray);
|
||||
$this->sectionUpdate ($sectionIDParent,
|
||||
@@ -428,9 +433,11 @@ class mail
|
||||
public function __construct ()
|
||||
{
|
||||
if (! function_exists ("finfo_buffer"))
|
||||
throw new \Exception (_("Missing FileInfo PHP Extension"), 500);
|
||||
throw new \Exception (dgettext("domframework",
|
||||
"Missing FileInfo PHP Extension"), 500);
|
||||
if (! function_exists ("openssl_random_pseudo_bytes"))
|
||||
throw new \Exception (_("Missing OpenSSL PHP Extension"), 500);
|
||||
throw new \Exception (dgettext("domframework",
|
||||
"Missing OpenSSL PHP Extension"), 500);
|
||||
// Define default headers
|
||||
$this->addHeader ("Date", date ("r"));
|
||||
$this->addHeader ("Message-ID", $this->provideMessageID ());
|
||||
@@ -525,7 +532,8 @@ class mail
|
||||
if ($sectionIDtoChange === "")
|
||||
{
|
||||
// No existing section found : need to create one
|
||||
throw new \Exception (_("Can't find the place to store the HTML"), 500);
|
||||
throw new \Exception (dgettext("domframework",
|
||||
"Can't find the place to store the HTML"), 500);
|
||||
}
|
||||
$htmlContent = iconv ("utf-8", $charset, $htmlContent);
|
||||
$part["_charset"] = $charset;
|
||||
@@ -610,7 +618,8 @@ class mail
|
||||
if ($sectionIDtoChange === "")
|
||||
{
|
||||
// No existing section found : need to create one
|
||||
throw new \Exception (_("Can't find the place to store the TEXT"), 500);
|
||||
throw new \Exception (dgettext("domframework",
|
||||
"Can't find the place to store the TEXT"), 500);
|
||||
}
|
||||
$textContent = iconv ("utf-8", $charset, $textContent);
|
||||
$part["_charset"] = $charset;
|
||||
@@ -866,8 +875,8 @@ class mail
|
||||
{
|
||||
$attachmentIDs = $this->getAttachmentID ($inline);
|
||||
if (! array_key_exists ($number, $attachmentIDs))
|
||||
throw new \Exception (sprintf (_("Attachment '%d' not found"), $number),
|
||||
404);
|
||||
throw new \Exception (sprintf (dgettext("domframework",
|
||||
"Attachment '%d' not found"), $number), 404);
|
||||
$part = $this->sectionGet ($attachmentIDs[$number]);
|
||||
$encoding = $this->getHeaderValue ("Content-Transfer-Encoding",
|
||||
$part["_headersArray"]);
|
||||
@@ -883,8 +892,8 @@ class mail
|
||||
{
|
||||
$attachmentIDs = $this->getAttachmentID ($inline);
|
||||
if (! array_key_exists ($number, $attachmentIDs))
|
||||
throw new \Exception (sprintf (_("Attachment '%d' not found"), $number),
|
||||
404);
|
||||
throw new \Exception (sprintf (dgettext("domframework",
|
||||
"Attachment '%d' not found"), $number), 404);
|
||||
$part = $this->sectionGet ($attachmentIDs[$number]);
|
||||
foreach ($part as $key=>$val)
|
||||
{
|
||||
@@ -1419,9 +1428,8 @@ class mail
|
||||
return chunk_split ($content);
|
||||
}
|
||||
throw new \Exception (sprintf (
|
||||
_("Invalid encoding provided to encodingEncode : %s"),
|
||||
$encoding),
|
||||
500);
|
||||
dgettext("domframework",
|
||||
"Invalid encoding provided to encodingEncode : %s"), $encoding), 500);
|
||||
}
|
||||
|
||||
/** Decode the content with correct encoding.
|
||||
@@ -1439,9 +1447,8 @@ class mail
|
||||
elseif ($encoding === "8bit" || $encoding === "7bit" || $encoding === false)
|
||||
return $content;
|
||||
throw new \Exception (sprintf (
|
||||
_("Invalid encoding provided to encodingDecode : '%s'"),
|
||||
$encoding),
|
||||
500);
|
||||
dgettext("domframework",
|
||||
"Invalid encoding provided to encodingDecode : '%s'"), $encoding), 500);
|
||||
}
|
||||
|
||||
/** Encode a string to be compliant with MIME (used in headers)
|
||||
@@ -1461,8 +1468,8 @@ class mail
|
||||
elseif ($encoding === "base64")
|
||||
$prefs["scheme"] = "B";
|
||||
else
|
||||
throw new \Exception (_("Invalid encoding provided to encodeHeaders"),
|
||||
500);
|
||||
throw new \Exception (dgettext("domframework",
|
||||
"Invalid encoding provided to encodeHeaders"), 500);
|
||||
return substr (iconv_mime_encode ($header, $content, $prefs),
|
||||
strlen ($header)+2);
|
||||
}
|
||||
@@ -1496,9 +1503,8 @@ class mail
|
||||
elseif ($encoding === "base64")
|
||||
$prefs["scheme"] = "B";
|
||||
else
|
||||
throw new \Exception (_("Invalid encoding provided to ".
|
||||
"encodeHeaderStringWithPosition"),
|
||||
500);
|
||||
throw new \Exception (dgettext("domframework",
|
||||
"Invalid encoding provided to encodeHeaderStringWithPosition"), 500);
|
||||
return substr (iconv_mime_encode (str_repeat (" ", $blanks), $content,
|
||||
$prefs),
|
||||
$blanks+2);
|
||||
|
||||
@@ -203,7 +203,8 @@ class queuefile extends queue
|
||||
if (! key_exists ($i, $entries))
|
||||
{
|
||||
$file->lockUN ($this->queue);
|
||||
throw new \Exception ("Invalid entry requested", 406);
|
||||
throw new \Exception (dgettext("domframework",
|
||||
"Invalid entry requested"), 406);
|
||||
}
|
||||
$json = $entries[$i];
|
||||
$content = json_decode ($json, true);
|
||||
|
||||
27
smtp.php
27
smtp.php
@@ -79,8 +79,8 @@ class smtp
|
||||
{
|
||||
if ($errstr === "" && $php_errormsg !== "")
|
||||
$errstr = $php_errormsg;
|
||||
throw new \Exception (sprintf (_("Can't connect to SMTP server : %s"),
|
||||
$errstr), 500);
|
||||
throw new \Exception (sprintf (dgettext("domframework",
|
||||
"Can't connect to SMTP server : %s"), $errstr), 500);
|
||||
}
|
||||
stream_set_timeout ($this->smtpStream, $this->timeout);
|
||||
// Wait for banner
|
||||
@@ -103,14 +103,15 @@ class smtp
|
||||
if (@stream_socket_enable_crypto ($this->smtpStream, true,
|
||||
STREAM_CRYPTO_METHOD_TLS_CLIENT) ===
|
||||
false)
|
||||
throw new \Exception (sprintf (_("Can't activate STARTTLS %s"),
|
||||
strstr ($php_errormsg, ": ")), 500);
|
||||
throw new \Exception (sprintf (dgettext("domframework",
|
||||
"Can't activate STARTTLS %s"), strstr ($php_errormsg, ": ")), 500);
|
||||
ini_set('track_errors', 0);
|
||||
$this->debug ("STARTTLS ACTIVATED\n");
|
||||
}
|
||||
}
|
||||
elseif ($this->starttls === "encrypt")
|
||||
throw new \Exception (_("Server doesn't supports STARTTLS"), 500);
|
||||
throw new \Exception (dgettext("domframework",
|
||||
"Server doesn't supports STARTTLS"), 500);
|
||||
|
||||
if ($this->user !== null && $this->password !== null)
|
||||
{
|
||||
@@ -132,8 +133,8 @@ class smtp
|
||||
}
|
||||
else
|
||||
throw new \Exception (
|
||||
_("No authentication method available for the server"),
|
||||
500);
|
||||
dgettext("domframework",
|
||||
"No authentication method available for the server"), 500);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,8 +169,8 @@ class smtp
|
||||
{
|
||||
if ($this->smtpStream === null)
|
||||
throw new \Exception (
|
||||
_("Can't send email : not connected to SMTP server"),
|
||||
500);
|
||||
dgettext("domframework",
|
||||
"Can't send email : not connected to SMTP server"), 500);
|
||||
$from = $this->cleanMail ($from);
|
||||
if (is_string ($to))
|
||||
$to = explode (",", $to);
|
||||
@@ -198,8 +199,8 @@ class smtp
|
||||
{
|
||||
if ($this->smtpStream === null)
|
||||
throw new \Exception (
|
||||
_("Can't send email : not connected to SMTP server"),
|
||||
500);
|
||||
dgettext("domframework",
|
||||
"Can't send email : not connected to SMTP server"), 500);
|
||||
$this->putLine ("QUIT\r\n");
|
||||
fclose ($this->smtpStream);
|
||||
}
|
||||
@@ -210,8 +211,8 @@ class smtp
|
||||
{
|
||||
if ($this->smtpStream === null)
|
||||
throw new \Exception (
|
||||
_("Can't send email : not connected to SMTP server"),
|
||||
500);
|
||||
dgettext("domframework",
|
||||
"Can't send email : not connected to SMTP server"), 500);
|
||||
$this->putLine ("RSET\r\n");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user