From: Mitchell Livingston Date: Sun, 6 Apr 2008 03:35:18 +0000 (+0000) Subject: when downloading the blocklist, show amounts instead of percent X-Git-Tag: 1.20~257 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8b627d3792b5584cf0d87b00f959f3b57bd4661d;p=transmission when downloading the blocklist, show amounts instead of percent --- diff --git a/macosx/BlocklistDownloader.m b/macosx/BlocklistDownloader.m index a2acf0000..bfbc67fa9 100644 --- a/macosx/BlocklistDownloader.m +++ b/macosx/BlocklistDownloader.m @@ -162,9 +162,10 @@ NSString * string = NSLocalizedString(@"Downloading blocklist", "Blocklist -> message"); if (fExpectedSize != NSURLResponseUnknownLength) { - double progress = (double)fCurrentSize / fExpectedSize; - string = [string stringByAppendingString: [NSString localizedStringWithFormat: @" (%.1f%%)", 100.0 * progress]]; - [fProgressBar setDoubleValue: progress]; + NSString * substring = [NSString stringWithFormat: NSLocalizedString(@"%@ of %@", "Blocklist -> message"), + [NSString stringForFileSize: fCurrentSize], [NSString stringForFileSize: fExpectedSize]]; + string = [string stringByAppendingFormat: @" (%@)", substring]; + [fProgressBar setDoubleValue: (double)fCurrentSize / fExpectedSize]; } [fTextField setStringValue: string]; diff --git a/macosx/English.lproj/Localizable.strings b/macosx/English.lproj/Localizable.strings index 759cdc510..a250289a5 100644 Binary files a/macosx/English.lproj/Localizable.strings and b/macosx/English.lproj/Localizable.strings differ diff --git a/macosx/Torrent.m b/macosx/Torrent.m index e14486a4a..bdfbc4631 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -927,7 +927,7 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void * NSString * error; if (!(error = [NSString stringWithUTF8String: fStat->errorString]) && !(error = [NSString stringWithCString: fStat->errorString encoding: NSISOLatin1StringEncoding])) - error = NSLocalizedString(@"(unreadable error)", "Torrent -> error string unreadable"); + error = [NSString stringWithFormat: @"(%@)", NSLocalizedString(@"unreadable error", "Torrent -> error string unreadable")]; return error; }