From 1aa2ad16f3e37a5c98e54b1ef8770fc53d0c6de0 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 22 Aug 2007 15:11:41 +0000 Subject: [PATCH] Monotone-Parent: c982aaa9740225283281797deea837869cd14b36 Monotone-Revision: 54dfcd97cab5ce72c0aceaae23ebf28c39d50601 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-08-22T15:11:41 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++++ SoObjects/Appointments/SOGoCalendarComponent.m | 11 +++-------- 2 files changed, 9 insertions(+), 8 deletions(-) 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];