diff --git a/ChangeLog b/ChangeLog index e5aab5532..44bd153cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2009-10-08 Francis Lachapelle + + * UI/PreferencesUI/UIxPreferences.m (-shortDateFormatsList): added + "default" option. + (-itemShortDateFormatText): added formatting for "default" option. + (-userShortDateFormat): falls back to "default" if not set for the user. + (-setUserShortDateFormat): removes user default if set to + "default". + (-longDateFormatsList, -itemLongDateFormatText, + -userLongDateFormat, -setUserLongDateFormat): new "default" option + support, like for the short date format. + (- timeFormatsList, -itemTimeFormatText, -setUserTimeFormat): new + "default" option support, like for the short date format. + 2009-10-08 Wolfgang Sourdeau * Tests/webdavlib.py (MailDAVMailQuery._initSort): now handles the diff --git a/UI/PreferencesUI/BrazilianPortuguese.lproj/Localizable.strings b/UI/PreferencesUI/BrazilianPortuguese.lproj/Localizable.strings index 5b06a9e3f..2bdc37673 100644 --- a/UI/PreferencesUI/BrazilianPortuguese.lproj/Localizable.strings +++ b/UI/PreferencesUI/BrazilianPortuguese.lproj/Localizable.strings @@ -26,14 +26,28 @@ "Long Date Format :" = "Formato da Data (Longo) :"; "Time Format :" = "Formato da Hora :"; -"shortDateFmt_0" = "%m/%e/%Y"; -"shortDateFmt_1" = "%m/%e/%y"; -"shortDateFmt_2" = "%m/%d/%Y"; -"shortDateFmt_3" = "%m/%d/%y"; -"shortDateFmt_4" = "%y/%m/%d"; -"shortDateFmt_5" = "%Y-%m-%d"; -"shortDateFmt_6" = "%d-%b-%y"; -"shortDateFmt_7" = ""; +"shortDateFmt_0" = "%d-%b-%y"; + +"shortDateFmt_1" = "%d-%m-%y"; +"shortDateFmt_2" = "%d/%m/%y"; +"shortDateFmt_3" = "%e/%m/%y"; + +"shortDateFmt_4" = "%d-%m-%Y"; +"shortDateFmt_5" = "%d/%m/%Y"; + +"shortDateFmt_6" = "%m-%d-%y"; +"shortDateFmt_7" = "%m/%d/%y"; +"shortDateFmt_8" = "%m/%e/%y"; + +"shortDateFmt_9" = "%y-%m-%d"; +"shortDateFmt_10" = "%y/%m/%d"; +"shortDateFmt_11" = "%y.%m.%d"; + +"shortDateFmt_12" = "%Y-%m-%d"; +"shortDateFmt_13" = "%Y/%m/%d"; +"shortDateFmt_14" = "%Y.%m.%d"; + +"shortDateFmt_15" = ""; "longDateFmt_0" = "%A, %B %d, %Y"; "longDateFmt_1" = "%B %d, %Y"; diff --git a/UI/PreferencesUI/Czech.lproj/Localizable.strings b/UI/PreferencesUI/Czech.lproj/Localizable.strings index 04d97f41b..5f1206cfa 100644 --- a/UI/PreferencesUI/Czech.lproj/Localizable.strings +++ b/UI/PreferencesUI/Czech.lproj/Localizable.strings @@ -26,14 +26,28 @@ "Long Date Format :" = "Dlouhý formát data :"; "Time Format :" = "Formát času :"; -"shortDateFmt_0" = "%m/%e/%Y"; -"shortDateFmt_1" = "%m/%e/%y"; -"shortDateFmt_2" = "%m/%d/%Y"; -"shortDateFmt_3" = "%m/%d/%y"; -"shortDateFmt_4" = "%y/%m/%d"; -"shortDateFmt_5" = "%Y-%m-%d"; -"shortDateFmt_6" = "%d-%b-%y"; -"shortDateFmt_7" = ""; +"shortDateFmt_0" = "%d-%b-%y"; + +"shortDateFmt_1" = "%d-%m-%y"; +"shortDateFmt_2" = "%d/%m/%y"; +"shortDateFmt_3" = "%e/%m/%y"; + +"shortDateFmt_4" = "%d-%m-%Y"; +"shortDateFmt_5" = "%d/%m/%Y"; + +"shortDateFmt_6" = "%m-%d-%y"; +"shortDateFmt_7" = "%m/%d/%y"; +"shortDateFmt_8" = "%m/%e/%y"; + +"shortDateFmt_9" = "%y-%m-%d"; +"shortDateFmt_10" = "%y/%m/%d"; +"shortDateFmt_11" = "%y.%m.%d"; + +"shortDateFmt_12" = "%Y-%m-%d"; +"shortDateFmt_13" = "%Y/%m/%d"; +"shortDateFmt_14" = "%Y.%m.%d"; + +"shortDateFmt_15" = ""; "longDateFmt_0" = "%A, %B %d, %Y"; "longDateFmt_1" = "%B %d, %Y"; diff --git a/UI/PreferencesUI/Dutch.lproj/Localizable.strings b/UI/PreferencesUI/Dutch.lproj/Localizable.strings index e4c432244..209352e95 100644 --- a/UI/PreferencesUI/Dutch.lproj/Localizable.strings +++ b/UI/PreferencesUI/Dutch.lproj/Localizable.strings @@ -26,12 +26,28 @@ "Long Date Format :" = "Lang datumformaat:"; "Time Format :" = "Tijdformaat:"; -"shortDateFmt_0" = "%d/%m/%Y"; -"shortDateFmt_1" = "%d/%m/%y"; -"shortDateFmt_2" = "%d.%m.%y"; -"shortDateFmt_3" = "%d-%m-%y"; -"shortDateFmt_4" = "%Y-%m-%d"; -"shortDateFmt_5" = ""; +"shortDateFmt_0" = "%d-%b-%y"; + +"shortDateFmt_1" = "%d-%m-%y"; +"shortDateFmt_2" = "%d/%m/%y"; +"shortDateFmt_3" = "%e/%m/%y"; + +"shortDateFmt_4" = "%d-%m-%Y"; +"shortDateFmt_5" = "%d/%m/%Y"; + +"shortDateFmt_6" = "%m-%d-%y"; +"shortDateFmt_7" = "%m/%d/%y"; +"shortDateFmt_8" = "%m/%e/%y"; + +"shortDateFmt_9" = "%y-%m-%d"; +"shortDateFmt_10" = "%y/%m/%d"; +"shortDateFmt_11" = "%y.%m.%d"; + +"shortDateFmt_12" = "%Y-%m-%d"; +"shortDateFmt_13" = "%Y/%m/%d"; +"shortDateFmt_14" = "%Y.%m.%d"; + +"shortDateFmt_15" = ""; "longDateFmt_0" = "%A %e %B %Y"; "longDateFmt_1" = "%e %b. %Y"; diff --git a/UI/PreferencesUI/English.lproj/Localizable.strings b/UI/PreferencesUI/English.lproj/Localizable.strings index 9ff0682a1..e6dae4541 100644 --- a/UI/PreferencesUI/English.lproj/Localizable.strings +++ b/UI/PreferencesUI/English.lproj/Localizable.strings @@ -26,15 +26,31 @@ "Long Date Format :" = "Long Date Format :"; "Time Format :" = "Time Format :"; -"shortDateFmt_0" = "%m/%e/%Y"; -"shortDateFmt_1" = "%m/%e/%y"; -"shortDateFmt_2" = "%m/%d/%Y"; -"shortDateFmt_3" = "%m/%d/%y"; -"shortDateFmt_4" = "%y/%m/%d"; -"shortDateFmt_5" = "%Y-%m-%d"; -"shortDateFmt_6" = "%d-%b-%y"; -"shortDateFmt_7" = ""; +"default" = "Default"; +"shortDateFmt_0" = "%d-%b-%y"; + +"shortDateFmt_1" = "%d-%m-%y"; +"shortDateFmt_2" = "%d/%m/%y"; +"shortDateFmt_3" = "%e/%m/%y"; + +"shortDateFmt_4" = "%d-%m-%Y"; +"shortDateFmt_5" = "%d/%m/%Y"; + +"shortDateFmt_6" = "%m-%d-%y"; +"shortDateFmt_7" = "%m/%d/%y"; +"shortDateFmt_8" = "%m/%e/%y"; + +"shortDateFmt_9" = "%y-%m-%d"; +"shortDateFmt_10" = "%y/%m/%d"; +"shortDateFmt_11" = "%y.%m.%d"; + +"shortDateFmt_12" = "%Y-%m-%d"; +"shortDateFmt_13" = "%Y/%m/%d"; +"shortDateFmt_14" = "%Y.%m.%d"; + +"shortDateFmt_15" = ""; + "longDateFmt_0" = "%A, %B %d, %Y"; "longDateFmt_1" = "%B %d, %Y"; "longDateFmt_2" = "%A, %d %B, %Y"; diff --git a/UI/PreferencesUI/French.lproj/Localizable.strings b/UI/PreferencesUI/French.lproj/Localizable.strings index 98d6539ee..d32781dad 100644 --- a/UI/PreferencesUI/French.lproj/Localizable.strings +++ b/UI/PreferencesUI/French.lproj/Localizable.strings @@ -26,12 +26,28 @@ "Long Date Format :" = "Style de date longue :"; "Time Format :" = "Style de l'heure :"; -"shortDateFmt_0" = "%d/%m/%Y"; -"shortDateFmt_1" = "%d/%m/%y"; -"shortDateFmt_2" = "%d.%m.%y"; -"shortDateFmt_3" = "%d-%m-%y"; -"shortDateFmt_4" = "%Y-%m-%d"; -"shortDateFmt_5" = ""; +"shortDateFmt_0" = "%d-%b-%y"; + +"shortDateFmt_1" = "%d-%m-%y"; +"shortDateFmt_2" = "%d/%m/%y"; +"shortDateFmt_3" = "%e/%m/%y"; + +"shortDateFmt_4" = "%d-%m-%Y"; +"shortDateFmt_5" = "%d/%m/%Y"; + +"shortDateFmt_6" = "%m-%d-%y"; +"shortDateFmt_7" = "%m/%d/%y"; +"shortDateFmt_8" = "%m/%e/%y"; + +"shortDateFmt_9" = "%y-%m-%d"; +"shortDateFmt_10" = "%y/%m/%d"; +"shortDateFmt_11" = "%y.%m.%d"; + +"shortDateFmt_12" = "%Y-%m-%d"; +"shortDateFmt_13" = "%Y/%m/%d"; +"shortDateFmt_14" = "%Y.%m.%d"; + +"shortDateFmt_15" = ""; "longDateFmt_0" = "%A %e %B %Y"; "longDateFmt_1" = "%e %b. %Y"; diff --git a/UI/PreferencesUI/German.lproj/Localizable.strings b/UI/PreferencesUI/German.lproj/Localizable.strings index 9e0321daa..54ec4c516 100644 --- a/UI/PreferencesUI/German.lproj/Localizable.strings +++ b/UI/PreferencesUI/German.lproj/Localizable.strings @@ -26,12 +26,28 @@ "Long Date Format :" = "Langes Datumsformat:"; "Time Format :" = "Zeitformat:"; -"shortDateFmt_0" = "%d/%m/%Y"; -"shortDateFmt_1" = "%d/%m/%y"; -"shortDateFmt_2" = "%d.%m.%y"; -"shortDateFmt_3" = "%d-%m-%y"; -"shortDateFmt_4" = "%Y-%m-%d"; -"shortDateFmt_5" = ""; +"shortDateFmt_0" = "%d-%b-%y"; + +"shortDateFmt_1" = "%d-%m-%y"; +"shortDateFmt_2" = "%d/%m/%y"; +"shortDateFmt_3" = "%e/%m/%y"; + +"shortDateFmt_4" = "%d-%m-%Y"; +"shortDateFmt_5" = "%d/%m/%Y"; + +"shortDateFmt_6" = "%m-%d-%y"; +"shortDateFmt_7" = "%m/%d/%y"; +"shortDateFmt_8" = "%m/%e/%y"; + +"shortDateFmt_9" = "%y-%m-%d"; +"shortDateFmt_10" = "%y/%m/%d"; +"shortDateFmt_11" = "%y.%m.%d"; + +"shortDateFmt_12" = "%Y-%m-%d"; +"shortDateFmt_13" = "%Y/%m/%d"; +"shortDateFmt_14" = "%Y.%m.%d"; + +"shortDateFmt_15" = ""; "longDateFmt_0" = "%A %e %B %Y"; "longDateFmt_1" = "%e %b. %Y"; diff --git a/UI/PreferencesUI/Hungarian.lproj/Localizable.strings b/UI/PreferencesUI/Hungarian.lproj/Localizable.strings index d243c9e03..9fb53188e 100644 --- a/UI/PreferencesUI/Hungarian.lproj/Localizable.strings +++ b/UI/PreferencesUI/Hungarian.lproj/Localizable.strings @@ -26,14 +26,28 @@ "Long Date Format :" = "Hosszú dátumformátum :"; "Time Format :" = "Időformátum :"; -"shortDateFmt_0" = "%Y.%m.%d"; -"shortDateFmt_1" = "%m/%e/%y"; -"shortDateFmt_2" = "%m/%d/%Y"; -"shortDateFmt_3" = "%m/%d/%y"; -"shortDateFmt_4" = "%y/%m/%d"; -"shortDateFmt_5" = "%Y-%m-%d"; -"shortDateFmt_6" = "%d-%b-%y"; -"shortDateFmt_7" = ""; +"shortDateFmt_0" = "%d-%b-%y"; + +"shortDateFmt_1" = "%d-%m-%y"; +"shortDateFmt_2" = "%d/%m/%y"; +"shortDateFmt_3" = "%e/%m/%y"; + +"shortDateFmt_4" = "%d-%m-%Y"; +"shortDateFmt_5" = "%d/%m/%Y"; + +"shortDateFmt_6" = "%m-%d-%y"; +"shortDateFmt_7" = "%m/%d/%y"; +"shortDateFmt_8" = "%m/%e/%y"; + +"shortDateFmt_9" = "%y-%m-%d"; +"shortDateFmt_10" = "%y/%m/%d"; +"shortDateFmt_11" = "%y.%m.%d"; + +"shortDateFmt_12" = "%Y-%m-%d"; +"shortDateFmt_13" = "%Y/%m/%d"; +"shortDateFmt_14" = "%Y.%m.%d"; + +"shortDateFmt_15" = ""; "longDateFmt_0" = "%Y %B %d, %A"; "longDateFmt_1" = "%B %d, %Y"; diff --git a/UI/PreferencesUI/Italian.lproj/Localizable.strings b/UI/PreferencesUI/Italian.lproj/Localizable.strings index 3b5e2b261..23feaa39c 100644 --- a/UI/PreferencesUI/Italian.lproj/Localizable.strings +++ b/UI/PreferencesUI/Italian.lproj/Localizable.strings @@ -26,14 +26,28 @@ "Long Date Format :" = "Data estesa:"; "Time Format :" = "Formato ora:"; -"shortDateFmt_0" = "%m/%e/%Y"; -"shortDateFmt_1" = "%m/%e/%y"; -"shortDateFmt_2" = "%m/%d/%Y"; -"shortDateFmt_3" = "%m/%d/%y"; -"shortDateFmt_4" = "%y/%m/%d"; -"shortDateFmt_5" = "%Y-%m-%d"; -"shortDateFmt_6" = "%d-%b-%y"; -"shortDateFmt_7" = ""; +"shortDateFmt_0" = "%d-%b-%y"; + +"shortDateFmt_1" = "%d-%m-%y"; +"shortDateFmt_2" = "%d/%m/%y"; +"shortDateFmt_3" = "%e/%m/%y"; + +"shortDateFmt_4" = "%d-%m-%Y"; +"shortDateFmt_5" = "%d/%m/%Y"; + +"shortDateFmt_6" = "%m-%d-%y"; +"shortDateFmt_7" = "%m/%d/%y"; +"shortDateFmt_8" = "%m/%e/%y"; + +"shortDateFmt_9" = "%y-%m-%d"; +"shortDateFmt_10" = "%y/%m/%d"; +"shortDateFmt_11" = "%y.%m.%d"; + +"shortDateFmt_12" = "%Y-%m-%d"; +"shortDateFmt_13" = "%Y/%m/%d"; +"shortDateFmt_14" = "%Y.%m.%d"; + +"shortDateFmt_15" = ""; "longDateFmt_0" = "%A, %B %d, %Y"; "longDateFmt_1" = "%B %d, %Y"; diff --git a/UI/PreferencesUI/Russian.lproj/Localizable.strings b/UI/PreferencesUI/Russian.lproj/Localizable.strings index 5c64f6744..a8b36c671 100644 --- a/UI/PreferencesUI/Russian.lproj/Localizable.strings +++ b/UI/PreferencesUI/Russian.lproj/Localizable.strings @@ -26,14 +26,28 @@ "Long Date Format :" = "Длинный формат даты :"; "Time Format :" = "Формат времени :"; -"shortDateFmt_0" = "%e/%m/%Y"; -"shortDateFmt_1" = "%d/%m/%Y"; -"shortDateFmt_2" = "%e-%m-%y"; -"shortDateFmt_3" = "%d-%m-%y"; -"shortDateFmt_4" = "%y/%m/%d"; -"shortDateFmt_5" = "%Y-%m-%d"; -"shortDateFmt_6" = "%d-%b-%y"; -"shortDateFmt_7" = ""; +"shortDateFmt_0" = "%d-%b-%y"; + +"shortDateFmt_1" = "%d-%m-%y"; +"shortDateFmt_2" = "%d/%m/%y"; +"shortDateFmt_3" = "%e/%m/%y"; + +"shortDateFmt_4" = "%d-%m-%Y"; +"shortDateFmt_5" = "%d/%m/%Y"; + +"shortDateFmt_6" = "%m-%d-%y"; +"shortDateFmt_7" = "%m/%d/%y"; +"shortDateFmt_8" = "%m/%e/%y"; + +"shortDateFmt_9" = "%y-%m-%d"; +"shortDateFmt_10" = "%y/%m/%d"; +"shortDateFmt_11" = "%y.%m.%d"; + +"shortDateFmt_12" = "%Y-%m-%d"; +"shortDateFmt_13" = "%Y/%m/%d"; +"shortDateFmt_14" = "%Y.%m.%d"; + +"shortDateFmt_15" = ""; "longDateFmt_0" = "%A %e %B %Y"; "longDateFmt_1" = "%e %b. %Y"; diff --git a/UI/PreferencesUI/Spanish.lproj/Localizable.strings b/UI/PreferencesUI/Spanish.lproj/Localizable.strings index dd76cde0a..d1255ea38 100644 --- a/UI/PreferencesUI/Spanish.lproj/Localizable.strings +++ b/UI/PreferencesUI/Spanish.lproj/Localizable.strings @@ -31,16 +31,28 @@ "Long Date Format :" = "Formato de fecha largo: "; "Time Format :" = "Formato de hora: "; -"shortDateFmt_0" = "%e/%m/%Y"; -"shortDateFmt_1" = "%d/%m/%Y"; -"shortDateFmt_2" = "%e/%m/%y"; -"shortDateFmt_3" = "%d/%m/%y"; -"shortDateFmt_4" = "%e-%m-%y"; -"shortDateFmt_5" = "%d-%m-%y"; -"shortDateFmt_6" = "%e-%m-%Y"; -"shortDateFmt_7" = "%d-%m-%Y"; -"shortDateFmt_8" = "%Y-%m-%d"; -"shortDateFmt_9" = ""; +"shortDateFmt_0" = "%d-%b-%y"; + +"shortDateFmt_1" = "%d-%m-%y"; +"shortDateFmt_2" = "%d/%m/%y"; +"shortDateFmt_3" = "%e/%m/%y"; + +"shortDateFmt_4" = "%d-%m-%Y"; +"shortDateFmt_5" = "%d/%m/%Y"; + +"shortDateFmt_6" = "%m-%d-%y"; +"shortDateFmt_7" = "%m/%d/%y"; +"shortDateFmt_8" = "%m/%e/%y"; + +"shortDateFmt_9" = "%y-%m-%d"; +"shortDateFmt_10" = "%y/%m/%d"; +"shortDateFmt_11" = "%y.%m.%d"; + +"shortDateFmt_12" = "%Y-%m-%d"; +"shortDateFmt_13" = "%Y/%m/%d"; +"shortDateFmt_14" = "%Y.%m.%d"; + +"shortDateFmt_15" = ""; "longDateFmt_0" = "%A, %e %B %Y"; "longDateFmt_1" = "%A, %e de %B de %Y"; diff --git a/UI/PreferencesUI/UIxPreferences.h b/UI/PreferencesUI/UIxPreferences.h index 2b916749b..fa37317ae 100644 --- a/UI/PreferencesUI/UIxPreferences.h +++ b/UI/PreferencesUI/UIxPreferences.h @@ -42,6 +42,8 @@ BOOL hasChanged, composeMessageTypeHasChanged; } +- (NSString *) userLongDateFormat; + @end #endif /* UIXPREFERENCES_H */ diff --git a/UI/PreferencesUI/UIxPreferences.m b/UI/PreferencesUI/UIxPreferences.m index a6b33c156..e006693de 100644 --- a/UI/PreferencesUI/UIxPreferences.m +++ b/UI/PreferencesUI/UIxPreferences.m @@ -173,7 +173,7 @@ static BOOL defaultShowSubscribedFoldersOnly = NO; unsigned int nbr; BOOL done; - shortDateFormatsList = [NSMutableArray array]; + shortDateFormatsList = [NSMutableArray arrayWithObject: @"default"]; nbr = 0; done = NO; @@ -195,19 +195,41 @@ static BOOL defaultShowSubscribedFoldersOnly = NO; - (NSString *) itemShortDateFormatText { - return [today descriptionWithCalendarFormat: item - locale: locale]; - //locale: [context valueForKey: @"locale"]]; + NSString *todayText, *shortDateFormatText; + + if ([item isEqualToString: @"default"]) + { + todayText = [today descriptionWithCalendarFormat: [locale objectForKey: NSShortDateFormatString] + locale: locale]; + shortDateFormatText = [NSString stringWithFormat: @"%@ (%@)", + [self labelForKey: item], + todayText]; + } + else + shortDateFormatText = [today descriptionWithCalendarFormat: item + locale: locale]; + + return shortDateFormatText; } - (NSString *) userShortDateFormat { - return [userDefaults objectForKey: @"ShortDateFormat"]; + NSString *shortDateFormat; + + shortDateFormat = [userDefaults objectForKey: @"ShortDateFormat"]; + + if (!shortDateFormat) + shortDateFormat = @"default"; + + return shortDateFormat; } - (void) setUserShortDateFormat: (NSString *) newFormat { - [userDefaults setObject: newFormat forKey: @"ShortDateFormat"]; + if ([newFormat isEqualToString: @"default"]) + [userDefaults removeObjectForKey: @"ShortDateFormat"]; + else + [userDefaults setObject: newFormat forKey: @"ShortDateFormat"]; } - (NSArray *) longDateFormatsList @@ -217,7 +239,7 @@ static BOOL defaultShowSubscribedFoldersOnly = NO; unsigned int nbr; BOOL done; - longDateFormatsList = [NSMutableArray array]; + longDateFormatsList = [NSMutableArray arrayWithObject: @"default"]; nbr = 0; done = NO; @@ -234,24 +256,47 @@ static BOOL defaultShowSubscribedFoldersOnly = NO; done = YES; } + if (![longDateFormatsList containsObject: [self userLongDateFormat]]) + [longDateFormatsList addObject: [self userLongDateFormat]]; + return longDateFormatsList; } - (NSString *) itemLongDateFormatText { - return [today descriptionWithCalendarFormat: item - locale: locale]; - //locale: [context valueForKey: @"locale"]]; + NSString *todayText, *longDateFormatText; + + if ([item isEqualToString: @"default"]) + { + todayText = [today descriptionWithCalendarFormat: [locale objectForKey: NSDateFormatString] + locale: locale]; + longDateFormatText = [NSString stringWithFormat: @"%@ (%@)", + [self labelForKey: item], + todayText]; + } + else + longDateFormatText = [today descriptionWithCalendarFormat: item + locale: locale]; } - (NSString *) userLongDateFormat { - return [userDefaults objectForKey: @"LongDateFormat"]; + NSString *longDateFormat; + + longDateFormat = [userDefaults objectForKey: @"LongDateFormat"]; + + if (!longDateFormat) + longDateFormat = @"default"; + + return longDateFormat; } - (void) setUserLongDateFormat: (NSString *) newFormat { - [userDefaults setObject: newFormat forKey: @"LongDateFormat"]; + if ([newFormat isEqualToString: @"default"]) + [userDefaults removeObjectForKey: @"LongDateFormat"]; + else + [userDefaults setObject: newFormat forKey: @"LongDateFormat"]; } - (NSArray *) timeFormatsList @@ -261,7 +306,7 @@ static BOOL defaultShowSubscribedFoldersOnly = NO; unsigned int nbr; BOOL done; - timeFormatsList = [NSMutableArray array]; + timeFormatsList = [NSMutableArray arrayWithObject: @"default"]; nbr = 0; done = NO; @@ -283,9 +328,21 @@ static BOOL defaultShowSubscribedFoldersOnly = NO; - (NSString *) itemTimeFormatText { - return [today descriptionWithCalendarFormat: item - locale: locale]; - //locale: [context valueForKey: @"locale"]]; + NSString *todayText, *timeFormatText; + + if ([item isEqualToString: @"default"]) + { + todayText = [today descriptionWithCalendarFormat: [locale objectForKey: NSTimeFormatString] + locale: locale]; + timeFormatText = [NSString stringWithFormat: @"%@ (%@)", + [self labelForKey: item], + todayText]; + } + else + timeFormatText = [today descriptionWithCalendarFormat: item + locale: locale]; + + return timeFormatText; } - (NSString *) userTimeFormat @@ -295,7 +352,10 @@ static BOOL defaultShowSubscribedFoldersOnly = NO; - (void) setUserTimeFormat: (NSString *) newFormat { - [userDefaults setObject: newFormat forKey: @"TimeFormat"]; + if ([newFormat isEqualToString: @"default"]) + [userDefaults removeObjectForKey: @"TimeFormat"]; + else + [userDefaults setObject: newFormat forKey: @"TimeFormat"]; } - (NSArray *) daysList diff --git a/UI/PreferencesUI/Welsh.lproj/Localizable.strings b/UI/PreferencesUI/Welsh.lproj/Localizable.strings index d2bf44504..b39d50349 100644 --- a/UI/PreferencesUI/Welsh.lproj/Localizable.strings +++ b/UI/PreferencesUI/Welsh.lproj/Localizable.strings @@ -26,14 +26,28 @@ "Long Date Format :" = "Dyddiad fformat hir :"; "Time Format :" = "Fformat amser :"; -"shortDateFmt_0" = "%m/%e/%Y"; -"shortDateFmt_1" = "%m/%e/%y"; -"shortDateFmt_2" = "%m/%d/%Y"; -"shortDateFmt_3" = "%m/%d/%y"; -"shortDateFmt_4" = "%y/%m/%d"; -"shortDateFmt_5" = "%Y-%m-%d"; -"shortDateFmt_6" = "%d-%b-%y"; -"shortDateFmt_7" = ""; +"shortDateFmt_0" = "%d-%b-%y"; + +"shortDateFmt_1" = "%d-%m-%y"; +"shortDateFmt_2" = "%d/%m/%y"; +"shortDateFmt_3" = "%e/%m/%y"; + +"shortDateFmt_4" = "%d-%m-%Y"; +"shortDateFmt_5" = "%d/%m/%Y"; + +"shortDateFmt_6" = "%m-%d-%y"; +"shortDateFmt_7" = "%m/%d/%y"; +"shortDateFmt_8" = "%m/%e/%y"; + +"shortDateFmt_9" = "%y-%m-%d"; +"shortDateFmt_10" = "%y/%m/%d"; +"shortDateFmt_11" = "%y.%m.%d"; + +"shortDateFmt_12" = "%Y-%m-%d"; +"shortDateFmt_13" = "%Y/%m/%d"; +"shortDateFmt_14" = "%Y.%m.%d"; + +"shortDateFmt_15" = ""; "longDateFmt_0" = "%A, %B %d, %Y"; "longDateFmt_1" = "%B %d, %Y";