1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-03 04:53:27 +00:00

on 10.6 use localizedStringFromDate:dateStyle:timeStyle: for formatting the blocklist update date

This commit is contained in:
Mitchell Livingston 2009-08-30 19:23:20 +00:00
parent 9206b7e107
commit abe1206e6e

View file

@ -27,6 +27,7 @@
#import "BlocklistScheduler.h" #import "BlocklistScheduler.h"
#import "PortChecker.h" #import "PortChecker.h"
#import "BonjourController.h" #import "BonjourController.h"
#import "NSApplicationAdditions.h"
#import "NSStringAdditions.h" #import "NSStringAdditions.h"
#import "UKKQueue.h" #import "UKKQueue.h"
#import "utils.h" #import "utils.h"
@ -524,12 +525,18 @@ tr_session * fHandle;
NSDate * updatedDate = [fDefaults objectForKey: @"BlocklistLastUpdate"]; NSDate * updatedDate = [fDefaults objectForKey: @"BlocklistLastUpdate"];
if (updatedDate) if (updatedDate)
{ {
NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init]; if ([NSApp isOnSnowLeopardOrBetter])
[dateFormatter setDateStyle: NSDateFormatterFullStyle]; updatedDateString = [NSDateFormatter localizedStringFromDate: updatedDate dateStyle: NSDateFormatterFullStyle
[dateFormatter setTimeStyle: NSDateFormatterShortStyle]; timeStyle: NSDateFormatterShortStyle];
else
updatedDateString = [dateFormatter stringFromDate: updatedDate]; {
[dateFormatter release]; NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateStyle: NSDateFormatterFullStyle];
[dateFormatter setTimeStyle: NSDateFormatterShortStyle];
updatedDateString = [dateFormatter stringFromDate: updatedDate];
[dateFormatter release];
}
} }
else else
updatedDateString = NSLocalizedString(@"N/A", "Prefs -> blocklist -> message"); updatedDateString = NSLocalizedString(@"N/A", "Prefs -> blocklist -> message");