diff --git a/NSNumber+Units.m b/NSNumber+Units.m index 2ef86bc1..d08625b5 100644 --- a/NSNumber+Units.m +++ b/NSNumber+Units.m @@ -7,22 +7,22 @@ // #import "NSNumber+Units.h" - +#import "Sparkle.h" @implementation NSNumber (Units) + (NSString *)humanReadableSizeFromDouble:(double)value { if (value < 1024) - return [NSString stringWithFormat:@"%ul", value]; + return [NSString stringWithFormat:@"%.0lf %@", value, SULocalizedString(@"B", @"the unit for bytes")]; if (value < 1024 * 1024) - return [NSString stringWithFormat:@"%.0lf KB", value / 1024.0]; + return [NSString stringWithFormat:@"%.0lf %@", value / 1024.0, SULocalizedString(@"KB", @"the unit for kilobytes")]; if (value < 1024 * 1024 * 1024) - return [NSString stringWithFormat:@"%.1lf MB", value / 1024.0 / 1024.0]; + return [NSString stringWithFormat:@"%.1lf %@", value / 1024.0 / 1024.0, SULocalizedString(@"MB", @"the unit for megabytes")]; - return [NSString stringWithFormat:@"%.2lf GB", value / 1024.0 / 1024.0 / 1024.0]; + return [NSString stringWithFormat:@"%.2lf %@", value / 1024.0 / 1024.0 / 1024.0, SULocalizedString(@"GB", @"the unit for gigabytes")]; } @end diff --git a/en.lproj/Sparkle.strings b/en.lproj/Sparkle.strings index 22abfbea..0777e816 100644 Binary files a/en.lproj/Sparkle.strings and b/en.lproj/Sparkle.strings differ