aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/filestore.php10
-rw-r--r--engine/lib/notification.php8
-rw-r--r--languages/en.php8
3 files changed, 17 insertions, 9 deletions
diff --git a/engine/lib/filestore.php b/engine/lib/filestore.php
index 603293413..0ade1e906 100644
--- a/engine/lib/filestore.php
+++ b/engine/lib/filestore.php
@@ -221,7 +221,7 @@
if (!$owner)
$owner = $_SESSION['user'];
- if ((!$owner) || (!$owner->username)) throw InvalidParameterException("All files must have an owner!");
+ if ((!$owner) || (!$owner->username)) throw InvalidParameterException(elgg_echo('InvalidParameterException:MissingOwner'));
return $this->dir_root . $this->make_file_matrix($owner->username) . $file->getFilename();
}
@@ -234,7 +234,7 @@
protected function make_directory_root($dirroot)
{
if (!@mkdir($dirroot, 0700, true))
- throw new IOException("Could not make $dirroot");
+ throw new IOException(sprintf(elgg_echo('IOException:CouldNotMake'), $dirroot));
return true;
}
@@ -368,7 +368,7 @@
public function open($mode)
{
if (!$this->getFilename())
- throw new IOException("You must specify a name before opening a file.");
+ throw new IOException(elgg_echo('IOException:MissingFileName'));
// See if file has already been saved
// seek on datastore, parameters and name?
@@ -379,7 +379,7 @@
($mode!="write") &&
($mode!="append")
)
- throw new InvalidParameterException("Unrecognised file mode '$mode'");
+ throw new InvalidParameterException(sprintf(elgg_echo('InvalidParameterException:UnrecognisedFileMode'), $mode));
// Get the filestore
$fs = $this->getFilestore();
@@ -530,7 +530,7 @@
{
// Create new filestore object
if ((!isset($parameters['filestore'])) || (!class_exists($parameters['filestore'])))
- throw new ClassNotFoundException("Filestore not found or class not saved with file!");
+ throw new ClassNotFoundException(elgg_echo('ClassNotFoundException:NotFoundNotSavedWithFile'));
$this->filestore = new $parameters['filestore']();
diff --git a/engine/lib/notification.php b/engine/lib/notification.php
index c3bfb0745..d79266f51 100644
--- a/engine/lib/notification.php
+++ b/engine/lib/notification.php
@@ -63,13 +63,13 @@
$to = (int)$to;
if (!$method)
- throw new NotificationException("No notification method specified.");
+ throw new NotificationException(elgg_echo('NotificationException:NoNotificationMethod'));
if (!is_array($method))
$method = array($method);
if ((!array_key_exists($method, $NOTIFICATION_HANDLERS)) || (!is_callable($NOTIFICATION_HANDLERS[$method])))
- throw new NotificationExceptions("No handler found for '$method' or it was not callable.");
+ throw new NotificationExceptions(sprintf(elgg_echo('NotificationException:NoHandlerFound'), $method));
if (!is_array($to))
$to = array($to);
@@ -78,7 +78,7 @@
{
foreach ($method as $m)
if (!$NOTIFICATION_HANDLERS[$m]((int)$guid, sanitise_string($m), $params))
- throw new NotificationException("There was an error while notifying $guid");
+ throw new NotificationException(sprintf(elgg_echo('NotificationException:ErrorNotifyingGuid'), $guid));
}
return true;
@@ -103,7 +103,7 @@
$entity = get_entity($to_guid);
if ((!($entity instanceof ElggUser)) || ($entity->email==""))
- throw new NotificationException("Could not get the email address for GUID:$to_guid");
+ throw new NotificationException(sprintf(elgg_echo('NotificationException:NoEmailAddress'), $to_guid));
$to = $entity->email;
diff --git a/languages/en.php b/languages/en.php
index 063823c87..92eb2af77 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -70,6 +70,14 @@
'ImportException:NotAllImported' => "Not all elements were imported.",
'InvalidParameterException:UnrecognisedFileMode' => "Unrecognised file mode '%s'",
+ 'InvalidParameterException:MissingOwner' => "All files must have an owner!",
+ 'IOException:CouldNotMake' => "Could not make %s",
+ 'IOException:MissingFileName' => "You must specify a name before opening a file.",
+ 'ClassNotFoundException:NotFoundNotSavedWithFile' => "Filestore not found or class not saved with file!",
+ 'NotificationException:NoNotificationMethod' => "No notification method specified.",
+ 'NotificationException:NoHandlerFound' => "No handler found for '%s' or it was not callable.",
+ 'NotificationException:ErrorNotifyingGuid' => "There was an error while notifying %d",
+ 'NotificationException:NoEmailAddress' => "Could not get the email address for GUID:%d",
/**
* User details