summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSiebrand Mazeland <s.mazeland@xs4all.nl>2010-10-31 00:34:28 +0200
committerSiebrand Mazeland <s.mazeland@xs4all.nl>2010-10-31 00:34:28 +0200
commit83233a8a43d45b10ad64f05123ee9b7f4d3b160b (patch)
treeafe2cc327895f84ab8a2a88da94ebd59cc417224 /lib
parent234b03d945b64ce43d2460be67ff11df74857da8 (diff)
Fix i18n for B/kB/MB and add translator documentation.
Diffstat (limited to 'lib')
-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);
}
}