From ce94db5e4eef22f447dd8ece5fe635eec7bab007 Mon Sep 17 00:00:00 2001 From: Jonas Witt Date: Sun, 18 May 2008 14:18:49 +0200 Subject: [PATCH] made byte units localizable, updated english strings file --- NSNumber+Units.m | 10 +++++----- en.lproj/Sparkle.strings | Bin 7476 -> 7580 bytes 2 files changed, 5 insertions(+), 5 deletions(-) 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 22abfbea407fb590a78412c1671721845a6a4440..0777e8161cd0aa7d04d42129b4a73c6faa22de1f 100644 GIT binary patch delta 183 zcmdmDHOG2F2(JT!0z*DS8jw_FaF{H}E?N)c88N6ZI4~$NSTk?|p+18aP)!m;B|`~A zDv(vmkjIb-WETV3T0mJYph_noR$#CNVh9_gQ;ESFMI6F|$oQhjKzP<-U`_5QQb6A1 LLaxY-e=KAGUgsF$ delta 95 zcmbPZy~S!mh`%0#0YeT$8bdaN0z*EKR$x$NK!_;;`L;l;1Qa!7P(hMGs5U|tpPa}X Ky*Z81Oa=fV84xG{