Currently format_size() returns bytes for all cases < 1024. So if size is 1 it will return "1 bytes". This patch fixes it to return "1 byte".

CommentFileSizeAuthor
#3 format_size_0.patch1.01 KBChrisKennedy
format_size.patch567 bytesChrisKennedy
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ChrisKennedy’s picture

Hmm my < was filtered as html. Here it is again:

Currently format_size() returns bytes for all cases where size < 1024. So if size == 1 it returns "1 bytes". This patch causes it to return "1 byte".

Dries’s picture

Status: Needs review » Needs work

That only works for English, but not for certain other languages. I'm afraid this isn't the proper fix. We have to let the locale module decide this because that is where we keep per-language plural/singular rules.

ChrisKennedy’s picture

Status: Needs work » Needs review
FileSize
1.01 KB

Good point - how about this?

drumm’s picture

Status: Needs review » Fixed

Committed to HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)