musicbrainz/picard — pull request #87 by zas (2013-01-20 22:56:17+00:00)
Title: Bytes to human readable conversion with i18n

This PR adds functions to do proper conversion from bytes (ie. file size) to human readable forms (short one only for now).
bytes2human is using gettext and locale to do proper i18n of the human readable form:
1.5 MB in english becomes 1,5 Mo in french (note the comma).
It supports units from bytes to petabytes, float and integer, variable precision, and has extensive unit tests for at least 2 locales (C and fr_FR.UTF-8).

Those conversions are used in Info dialog to display size of files in SI and IEC systems (decimal or binary, kB vs KiB etc...), and also size of cover art images.

I had to modify gettext stuff a bit to make it work for unit tests.