aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/upload.php18
-rw-r--r--languages/en.php13
2 files changed, 19 insertions, 12 deletions
diff --git a/actions/upload.php b/actions/upload.php
index 1657210ed..c37ce2b94 100644
--- a/actions/upload.php
+++ b/actions/upload.php
@@ -26,7 +26,7 @@
// post limit exceeded
if (count($_FILES) == 0) {
trigger_error('Tidypics warning: user exceeded post limit on image upload', E_USER_WARNING);
- register_error('Too many large images - try to upload fewer or smaller images');
+ register_error(elgg_echo('tidypics:exceedpostlimit'));
forward(get_input('forward_url', $_SERVER['HTTP_REFERER']));
}
@@ -38,7 +38,7 @@
}
if ($num_images == 0) {
// have user try again
- register_error('No images were selected. Please try again');
+ register_error(elgg_echo('tidypics:noimages'));
forward(get_input('forward_url', $_SERVER['HTTP_REFERER']));
}
@@ -58,10 +58,10 @@
array_push($not_uploaded, $sent_file['name']);
if ($sent_file['error'] == 1) {
trigger_error('Tidypics warning: image exceed server php upload limit', E_USER_WARNING);
- array_push($error_msgs, 'Image was too large in MB');
+ array_push($error_msgs, elgg_echo('tidypics:image_mem'));
}
else {
- array_push($error_msgs, 'Unknown upload error');
+ array_push($error_msgs, elgg_echo('tidypics:unk_error'));
}
continue;
}
@@ -69,14 +69,14 @@
//make sure file is an image
if ($mime != 'image/jpeg' && $mime != 'image/gif' && $mime != 'image/png' && $mime != 'image/pjpeg') {
array_push($not_uploaded, $sent_file['name']);
- array_push($error_msgs, 'Not a known image type');
+ array_push($error_msgs, elgg_echo('tidypics:not_image'));
continue;
}
// make sure file does not exceed memory limit
if ($sent_file['size'] > $maxfilesize) {
array_push($not_uploaded, $sent_file['name']);
- array_push($error_msgs, 'Image was too large in MB');
+ array_push($error_msgs, elgg_echo('tidypics:image_mem'));
continue;
}
@@ -90,7 +90,7 @@
$mem_avail = $mem_avail - memory_get_peak_usage() - 4194304; // 4 MB buffer
if ($mem_required > $mem_avail) {
array_push($not_uploaded, $sent_file['name']);
- array_push($error_msgs, 'Image was too large in pixels');
+ array_push($error_msgs, elgg_echo('tidypics:image_pixels'));
trigger_error('Tidypics warning: image memory size too large for resizing so rejecting', E_USER_WARNING);
continue;
}
@@ -125,7 +125,7 @@
if (!$result) {
array_push($not_uploaded, $sent_file['name']);
- array_push($error_msgs, 'Unknown error saving the image on server');
+ array_push($error_msgs, elgg_echo('tidypics:save_error'));
continue;
}
@@ -226,7 +226,7 @@
// some images did upload so we fall through
}
} else {
- system_message(elgg_echo("images:saved"));
+ system_message(elgg_echo('tidypics:upl_success'));
}
// successful upload so check if this is a new album and throw river event if so
diff --git a/languages/en.php b/languages/en.php
index 0c7fa3efa..dbf98eb5d 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -102,9 +102,10 @@
// Status messages
+ 'tidypics:upl_success' => "Your images uploaded successfully.",
'image:saved' => "Your image was successfully saved.",
'images:saved' => "All images were successfully saved.",
- 'image:deleted' => "Your image was successfully deleted.",
+ 'image:deleted' => "Your image was successfully deleted.",
'image:delete:confirm' => "Are you sure you want to delete this image?",
'images:edited' => "Your images were successfully updated.",
@@ -118,12 +119,18 @@
//Error messages
'image:none' => "We could not find any images at the moment.",
- 'tidypics:partialuploadfailure' => "There was a partial on upload (%s of %s images).",
+ 'tidypics:partialuploadfailure' => "There were errors uploading some of the images (%s of %s images).",
'tidypics:completeuploadfailure' => "Upload of images failed.",
+ 'tidypics:exceedpostlimit' => "Too many large images - try to upload fewer or smaller images.",
+ 'tidypics:noimages' => "No images were selected.",
+ 'tidypics:image_mem' => "Image is too large - too many bytes",
+ 'tidypics:image_pixels' => "Image has too many pixels",
+ 'tidypics:unk_error' => "Unknown upload error",
+ 'tidypics:save_error' => "Unknown error saving the image on server",
+ 'tidypics:not_image' => "This is not a recognized image type",
'image:deletefailed' => "Your image could not be deleted at this time.",
'image:downloadfailed' => "Sorry; this image is not available at this time.",
- 'image:notimage' => "We only accept jpeg, gif, or png images of the allowed file size.",
'images:notedited' => "Not all images were successfully updated",
'album:none' => "No albums have been created yet.",