summaryrefslogtreecommitdiff
path: root/lib/imagefile.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-11-02 11:15:57 -0700
committerBrion Vibber <brion@pobox.com>2010-11-02 11:15:57 -0700
commit23f69c80b5c6a8730fc6ff3b9f3cec71840de03b (patch)
treee63517a180c7c1b84ccb31a2285de2250a05c646 /lib/imagefile.php
parent62408fef09990a127a58aa8f8a24777bc34d160d (diff)
parent760a1c27bc37a20b70788e5e132c4cf9da1bb579 (diff)
Merge branch '0.9.x' into twitstream
Diffstat (limited to 'lib/imagefile.php')
-rw-r--r--lib/imagefile.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/imagefile.php b/lib/imagefile.php
index e47287741..b70fd248e 100644
--- a/lib/imagefile.php
+++ b/lib/imagefile.php
@@ -85,6 +85,8 @@ class ImageFile
break;
case UPLOAD_ERR_INI_SIZE:
case UPLOAD_ERR_FORM_SIZE:
+ // TRANS: Exception thrown when too large a file is uploaded.
+ // TRANS: %s is the maximum file size, for example "500b", "10kB" or "2MB".
throw new Exception(sprintf(_('That file is too big. The maximum file size is %s.'),
ImageFile::maxFileSize()));
return;
@@ -241,11 +243,16 @@ class ImageFile
$value = ImageFile::maxFileSizeInt();
if ($value > 1024 * 1024) {
- return ($value/(1024*1024)) . _('MB');
+ $value = $value/(1024*1024);
+ // TRANS: Number of megabytes. %d is the number.
+ return sprintf(_m('%dMB','%dMB',$value),$value);
} else if ($value > 1024) {
- return ($value/(1024)) . _('kB');
+ $value = $value/1024;
+ // TRANS: Number of kilobytes. %d is the number.
+ return sprintf(_m('%dkB','%dkB',$value),$value);
} else {
- return $value;
+ // TRANS: Number of bytes. %d is the number.
+ return sprintf(_m('%dB','%dB',$value),$value);
}
}