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:
2019-05-13 08:36:47 +00:00
parent b54fc6baa0
commit 5fcd1731fd
12 changed files with 703 additions and 511 deletions

View File

@@ -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);