Properly do i18n in common.fsize().

This commit is contained in:
Alex Dedul 2007-07-20 19:03:15 +00:00
parent a6e8db9bb0
commit 3bac6bcfc8
1 changed files with 3 additions and 3 deletions

View File

@ -63,12 +63,12 @@ def get_eta(size, done, speed):
def fsize(fsize_b):
fsize_kb = float (fsize_b / 1024.0)
if fsize_kb < 1000:
return _("%.1f KiB")%fsize_kb
return "%.1f %s" % (fsize_kb, _("KiB"))
fsize_mb = float (fsize_kb / 1024.0)
if fsize_mb < 1000:
return _("%.1f MiB")%fsize_mb
return "%.1f %s" % (fsize_mb, _("MiB"))
fsize_gb = float (fsize_mb / 1024.0)
return _("%.1f GiB")%fsize_gb
return "%.1f %s" % (fsize_gb, _("GiB"))
# Returns a formatted string representing a percentage
def fpcnt(dec):