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];
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;
}