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"
@ -523,6 +524,11 @@ tr_session * fHandle;
{ {
NSDate * updatedDate = [fDefaults objectForKey: @"BlocklistLastUpdate"]; NSDate * updatedDate = [fDefaults objectForKey: @"BlocklistLastUpdate"];
if (updatedDate) if (updatedDate)
{
if ([NSApp isOnSnowLeopardOrBetter])
updatedDateString = [NSDateFormatter localizedStringFromDate: updatedDate dateStyle: NSDateFormatterFullStyle
timeStyle: NSDateFormatterShortStyle];
else
{ {
NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init]; NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateStyle: NSDateFormatterFullStyle]; [dateFormatter setDateStyle: NSDateFormatterFullStyle];
@ -531,6 +537,7 @@ tr_session * fHandle;
updatedDateString = [dateFormatter stringFromDate: updatedDate]; updatedDateString = [dateFormatter stringFromDate: updatedDate];
[dateFormatter release]; [dateFormatter release];
} }
}
else else
updatedDateString = NSLocalizedString(@"N/A", "Prefs -> blocklist -> message"); updatedDateString = NSLocalizedString(@"N/A", "Prefs -> blocklist -> message");
} }