diff --git a/ChangeLog b/ChangeLog index 2627ab8f2..533045eb3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2007-08-22 Wolfgang Sourdeau + * SoObjects/Appointments/SOGoCalendarComponent.m + ([SOGoCalendarComponent + -sendEMailUsingTemplateNamed:_pageNameforOldObject:_oldObjectandNewObject:_newObjecttoAttendees:_attendees]): + now use a template based on the language returned from the + SOGoUser object. + * SoObjects/Mailer/SOGoMailEnglishForward.m: new module containing a subclass of SOGoMailForward for English locale. diff --git a/SoObjects/Appointments/SOGoCalendarComponent.m b/SoObjects/Appointments/SOGoCalendarComponent.m index 200346d31..73f9766d6 100644 --- a/SoObjects/Appointments/SOGoCalendarComponent.m +++ b/SoObjects/Appointments/SOGoCalendarComponent.m @@ -47,7 +47,6 @@ #import "iCalEntityObject+SOGo.h" #import "SOGoCalendarComponent.h" -static NSString *mailTemplateDefaultLanguage = nil; static BOOL sendEMailNotifications = NO; @implementation SOGoCalendarComponent @@ -62,11 +61,6 @@ static BOOL sendEMailNotifications = NO; didInit = YES; ud = [NSUserDefaults standardUserDefaults]; - mailTemplateDefaultLanguage = [[ud stringForKey:@"SOGoDefaultLanguage"] - retain]; - if (!mailTemplateDefaultLanguage) - mailTemplateDefaultLanguage = @"English"; - sendEMailNotifications = [ud boolForKey: @"SOGoAppointmentSendEMailNotifications"]; } @@ -337,7 +331,7 @@ static BOOL sendEMailNotifications = NO; WOApplication *app; unsigned i, count; iCalPerson *attendee; - NSString *recipient; + NSString *recipient, *language; SOGoAptMailNotification *p; NSString *mailDate, *subject, *text, *header; NGMutableHashMap *headerMap; @@ -380,12 +374,13 @@ static BOOL sendEMailNotifications = NO; else recipient = email; + language = [[context activeUser] language]; #warning this could be optimized in a class hierarchy common with the \ SOGoObject's acl notification mechanism /* create page name */ // TODO: select user's default language? pageName = [NSString stringWithFormat: @"SOGoAptMail%@%@", - mailTemplateDefaultLanguage, + language, _pageName]; /* construct message content */ p = [app pageWithName: pageName inContext: context];