diff --git a/ChangeLog b/ChangeLog index 7e3e25ccf..73092666f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2007-10-22 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoUser.m ([SOGoUser +language]): new method + that returns any generically-found language. + ([SoUser -language]): modified to call the above. + ([SOGoUser -language]): modified to call the above if the user + language has a null length. + * SoObjects/Contacts/SOGoContactLDIFEntry.m ([SOGoContactLDIFEntry -davEntityTag]): modified to return the "hash" of the vCard string. diff --git a/SoObjects/SOGo/SOGoUser.h b/SoObjects/SOGo/SOGoUser.h index 97711c563..203f1c220 100644 --- a/SoObjects/SOGo/SOGoUser.h +++ b/SoObjects/SOGo/SOGoUser.h @@ -67,6 +67,8 @@ extern NSString *SOGoWeekStartFirstFullWeek; NSMutableArray *mailAccounts; } ++ (NSString *) language; + + (SOGoUser *) userWithLogin: (NSString *) login roles: (NSArray *) roles; - (void) setCurrentPassword: (NSString *) newPassword; diff --git a/SoObjects/SOGo/SOGoUser.m b/SoObjects/SOGo/SOGoUser.m index 7f43654f1..2354d868f 100644 --- a/SoObjects/SOGo/SOGoUser.m +++ b/SoObjects/SOGo/SOGoUser.m @@ -61,19 +61,7 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek"; - (NSString *) language { - NSArray *bLanguages; - WOContext *context; - NSString *language; - - context = [[WOApplication application] context]; - bLanguages = [[context request] browserLanguages]; - if ([bLanguages count] > 0) - language = [bLanguages objectAtIndex: 0]; - - if (![language length]) - language = defaultLanguage; - - return language; + return [SOGoUser language]; } @end @@ -118,6 +106,23 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek"; isEqualToString: @"bypass"]); } ++ (NSString *) language +{ + NSArray *bLanguages; + WOContext *context; + NSString *language; + + context = [[WOApplication application] context]; + bLanguages = [[context request] browserLanguages]; + if ([bLanguages count] > 0) + language = [bLanguages objectAtIndex: 0]; + + if (![language length]) + language = defaultLanguage; + + return language; +} + + (SOGoUser *) userWithLogin: (NSString *) newLogin roles: (NSArray *) newRoles { @@ -338,14 +343,7 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek"; { language = [[self userDefaults] stringForKey: @"Language"]; if (![language length]) - { - context = [[WOApplication application] context]; - bLanguages = [[context request] browserLanguages]; - if ([bLanguages count] > 0) - language = [bLanguages objectAtIndex: 0]; - } - if (![language length]) - language = defaultLanguage; + language = [SOGoUser language]; [language retain]; }