summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Drumm <drumm@3064.no-reply.drupal.org>2006-12-30 21:33:04 +0000
committerNeil Drumm <drumm@3064.no-reply.drupal.org>2006-12-30 21:33:04 +0000
commitf1c869288166fd3f935393a9cfc3fddd52cd0bdc (patch)
treee7c42ab2e335b61dcaf83f6a711d95deafd4b7fa
parent36fce2f00111f75c6ef2cdd68c8abefc95753210 (diff)
downloadbrdo-f1c869288166fd3f935393a9cfc3fddd52cd0bdc.tar.gz
brdo-f1c869288166fd3f935393a9cfc3fddd52cd0bdc.tar.bz2
#101757 by ChrisKennedy. 1 byte instead of 1 bytes.
-rw-r--r--includes/common.inc16
1 files changed, 9 insertions, 7 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 730804458..4a29f12e5 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -989,16 +989,18 @@ function parse_size($size) {
* A translated string representation of the size.
*/
function format_size($size) {
- $suffix = t('bytes');
- if ($size >= 1024) {
- $size = round($size / 1024, 2);
- $suffix = t('KB');
+ if ($size < 1024) {
+ return format_plural($size, '1 byte', '@count bytes');
}
- if ($size >= 1024) {
+ else {
$size = round($size / 1024, 2);
- $suffix = t('MB');
+ $suffix = t('KB');
+ if ($size >= 1024) {
+ $size = round($size / 1024, 2);
+ $suffix = t('MB');
+ }
+ return t('@size @suffix', array('@size' => $size, '@suffix' => $suffix));
}
- return t('@size @suffix', array('@size' => $size, '@suffix' => $suffix));
}
/**