diff --git a/ChangeLog b/ChangeLog index a68afa263..273f3d344 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-06-23 Francis Lachapelle + + * SoObjects/SOGo/SOGoUserDefaults.m (-language): verify that the + language is part of the supported languages of the system configuration. + + * UI/Scheduler/UIxCalMonthView.m (-init): retrieve the locale + associated to the user's language. + 2010-06-23 Wolfgang Sourdeau * SoObjects/SOGo/SOGoGCSFolder.m (-_lastModified): new method that diff --git a/SoObjects/SOGo/SOGoUserDefaults.m b/SoObjects/SOGo/SOGoUserDefaults.m index 92496a806..bfaa27d63 100644 --- a/SoObjects/SOGo/SOGoUserDefaults.m +++ b/SoObjects/SOGo/SOGoUserDefaults.m @@ -346,11 +346,18 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek"; - (NSString *) language { NSString *language; - + NSArray *supportedLanguages; + /* see SOGoDomainDefaults for the meaning of this */ language = [source objectForKey: @"SOGoLanguage"]; if (!(language && [language isKindOfClass: [NSString class]])) language = [(SOGoDomainDefaults *) parentSource language]; + + /* make sure the language is part of the supported languages */ + supportedLanguages = [[SOGoSystemDefaults sharedSystemDefaults] + supportedLanguages]; + if (![supportedLanguages containsObject: language]) + language = [parentSource stringForKey: @"SOGoLanguage"]; return language; } diff --git a/UI/Scheduler/UIxCalMonthView.m b/UI/Scheduler/UIxCalMonthView.m index 3cd667782..310295f4f 100644 --- a/UI/Scheduler/UIxCalMonthView.m +++ b/UI/Scheduler/UIxCalMonthView.m @@ -24,12 +24,16 @@ #import #import +#import + #import #import #import -#import #import +#import + +#import "../../Main/SOGo.h" #import "UIxCalMonthView.h" @@ -38,6 +42,7 @@ - (id) init { NSDictionary *locale; + SOGoUserDefaults *ud; if ((self = [super init])) { @@ -46,7 +51,8 @@ // [monthAptFormatter setShortMonthTitleOnly]; // dateFormatter = [[SOGoDateFormatter alloc] // initWithLocale: [self locale]]; - locale = [context valueForKey: @"locale"]; + ud = [[context activeUser] userDefaults]; + locale = [[WOApplication application] localeForLanguageNamed: [ud language]]; dayNames = [locale objectForKey: NSWeekDayNameArray]; [dayNames retain]; monthNames = [locale objectForKey: NSMonthNameArray];