]> granicus.if.org Git - transmission/commitdiff
when downloading the blocklist, show amounts instead of percent
authorMitchell Livingston <livings124@transmissionbt.com>
Sun, 6 Apr 2008 03:35:18 +0000 (03:35 +0000)
committerMitchell Livingston <livings124@transmissionbt.com>
Sun, 6 Apr 2008 03:35:18 +0000 (03:35 +0000)
macosx/BlocklistDownloader.m
macosx/English.lproj/Localizable.strings
macosx/Torrent.m

index a2acf000012793964ef3a53a9b30efb064b9be13..bfbc67fa925123ba4a95747fffbcd1e5ead62d9a 100644 (file)
     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];
index 759cdc5109b0586789942e321a0e5f7bf98e7678..a250289a5d30fad22b8e8e7769915673fc9b6c4f 100644 (file)
Binary files a/macosx/English.lproj/Localizable.strings and b/macosx/English.lproj/Localizable.strings differ
index e14486a4adff6ce69e9cab852ff52164fcf70233..bdfbc4631d9524278f4b7d8132245f9efc4c2ab9 100644 (file)
@@ -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;
 }