summaryrefslogtreecommitdiff
path: root/lib/imagefile.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-11-02 15:02:10 -0700
committerBrion Vibber <brion@pobox.com>2010-11-02 15:02:10 -0700
commit04ca706601a2a3b556cc52fa21b61fcd842c4e87 (patch)
treedf79bc06e080623c4d2107ae8ce212160c7669b1 /lib/imagefile.php
parentb26eccf33cf69c04a96d5d6d3eddc0ef68ffd4b1 (diff)
parent81e06530800bce5eb60eca362d4c21453632183a (diff)
Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 1.0.x
Conflicts: actions/confirmaddress.php actions/othersettings.php
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);
}
}