From 161bcfac875b73d8a0301b67dc8446c106663058 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Wed, 19 Aug 2015 10:39:10 -0400 Subject: [PATCH] (fix) proper loading of transalations --- SoObjects/SOGo/NSObject+Utilities.h | 4 +--- SoObjects/SOGo/NSObject+Utilities.m | 4 +--- UI/MailerUI/UIxMailFolderActions.m | 14 +++++++------- UI/MailerUI/UIxMailListActions.m | 13 +++++++------ UI/Scheduler/UIxCalListingActions.m | 10 +++++----- 5 files changed, 21 insertions(+), 24 deletions(-) diff --git a/SoObjects/SOGo/NSObject+Utilities.h b/SoObjects/SOGo/NSObject+Utilities.h index 102ab7ef3..138ecd7b1 100644 --- a/SoObjects/SOGo/NSObject+Utilities.h +++ b/SoObjects/SOGo/NSObject+Utilities.h @@ -1,8 +1,6 @@ /* NSObject+Utilities.h - this file is part of SOGo * - * Copyright (C) 2007 Inverse inc. - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2007-2015 Inverse inc. * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/SoObjects/SOGo/NSObject+Utilities.m b/SoObjects/SOGo/NSObject+Utilities.m index 3dca1f0f5..6047468f0 100644 --- a/SoObjects/SOGo/NSObject+Utilities.m +++ b/SoObjects/SOGo/NSObject+Utilities.m @@ -1,8 +1,6 @@ /* NSObject+Utilities.m - this file is part of SOGo * - * Copyright (C) 2007 Inverse inc. - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2007-2015 Inverse inc. * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/UI/MailerUI/UIxMailFolderActions.m b/UI/MailerUI/UIxMailFolderActions.m index bc36cb91a..c07c834c4 100644 --- a/UI/MailerUI/UIxMailFolderActions.m +++ b/UI/MailerUI/UIxMailFolderActions.m @@ -92,7 +92,7 @@ } else { - errorFormat = [self labelForKey: @"The folder with name \"%@\" could not be created."]; + errorFormat = [self labelForKey: @"The folder with name \"%@\" could not be created." inContext: context]; jsonResponse = [NSDictionary dictionaryWithObject: [NSString stringWithFormat: errorFormat, folderName] forKey: @"error"]; response = [self responseWithStatus: 500 @@ -101,7 +101,7 @@ } else { - jsonResponse = [NSDictionary dictionaryWithObject: [self labelForKey: @"Missing 'name' parameter."] + jsonResponse = [NSDictionary dictionaryWithObject: [self labelForKey: @"Missing 'name' parameter." inContext: context] forKey: @"error"]; response = [self responseWithStatus: 500 andJSONRepresentation: jsonResponse]; @@ -149,7 +149,7 @@ if (!newFolderName || [newFolderName length] == 0) { - message = [NSDictionary dictionaryWithObject: [self labelForKey: @"Missing name parameter"] + message = [NSDictionary dictionaryWithObject: [self labelForKey: @"Missing name parameter" inContext: context] forKey: @"error"]; response = [self responseWithStatus: 500 andString: [message jsonRepresentation]]; @@ -160,7 +160,7 @@ error = [co renameTo: newFolderName]; if (error) { - message = [NSDictionary dictionaryWithObject: [self labelForKey: @"Unable to rename folder."] + message = [NSDictionary dictionaryWithObject: [self labelForKey: @"Unable to rename folder." inContext: context] forKey: @"error"]; response = [self responseWithStatus: 500 andString: [message jsonRepresentation]]; @@ -251,7 +251,7 @@ error = [connection moveMailboxAtURL: srcURL toURL: destURL]; if (error) { - jsonResponse = [NSDictionary dictionaryWithObject: [self labelForKey: @"Unable to move folder."] + jsonResponse = [NSDictionary dictionaryWithObject: [self labelForKey: @"Unable to move folder." inContext: context] forKey: @"error"]; response = [self responseWithStatus: 500 andString: [jsonResponse jsonRepresentation]]; @@ -283,7 +283,7 @@ } else { - jsonResponse = [NSDictionary dictionaryWithObject: [self labelForKey: @"Unable to move folder."] + jsonResponse = [NSDictionary dictionaryWithObject: [self labelForKey: @"Unable to move folder." inContext: context] forKey: @"error"]; response = [self responseWithStatus: 500 andString: [jsonResponse jsonRepresentation]]; @@ -374,7 +374,7 @@ { uids = [value componentsSeparatedByString: @","]; response = [co archiveUIDs: uids - inArchiveNamed: [self labelForKey: @"Saved Messages.zip"] + inArchiveNamed: [self labelForKey: @"Saved Messages.zip" inContext: context] inContext: context]; if (!response) response = [self responseWith204]; diff --git a/UI/MailerUI/UIxMailListActions.m b/UI/MailerUI/UIxMailListActions.m index 555fa969e..4427b008d 100644 --- a/UI/MailerUI/UIxMailListActions.m +++ b/UI/MailerUI/UIxMailListActions.m @@ -55,6 +55,7 @@ #import #import #import +#import #import #import #import @@ -131,7 +132,7 @@ else if ([now dayOfCommonEra] - [messageDate dayOfCommonEra] == 1) { // Yesterday - return [self labelForKey: @"Yesterday"]; + return [self labelForKey: @"Yesterday" inContext: context]; } else if ([now dayOfCommonEra] - [messageDate dayOfCommonEra] < 7) { @@ -190,10 +191,10 @@ s = [[s substringFromIndex: r.location+1] stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]]; - if ([s hasPrefix: @"1"]) result = [self labelForKey: @"highest"]; - else if ([s hasPrefix: @"2"]) result = [self labelForKey: @"high"]; - else if ([s hasPrefix: @"4"]) result = [self labelForKey: @"low"]; - else if ([s hasPrefix: @"5"]) result = [self labelForKey: @"lowest"]; + if ([s hasPrefix: @"1"]) result = [self labelForKey: @"highest" inContext: context]; + else if ([s hasPrefix: @"2"]) result = [self labelForKey: @"high" inContext: context]; + else if ([s hasPrefix: @"4"]) result = [self labelForKey: @"low" inContext: context]; + else if ([s hasPrefix: @"5"]) result = [self labelForKey: @"lowest" inContext: context]; } } } @@ -242,7 +243,7 @@ { NSString *s; - s = [self labelForKey:@"View Mail Folder"]; + s = [self labelForKey:@"View Mail Folder" inContext: context]; s = [s stringByAppendingString:@": "]; s = [s stringByAppendingString:[self objectTitle]]; return s; diff --git a/UI/Scheduler/UIxCalListingActions.m b/UI/Scheduler/UIxCalListingActions.m index 9a8aaec35..3504b6c9a 100644 --- a/UI/Scheduler/UIxCalListingActions.m +++ b/UI/Scheduler/UIxCalListingActions.m @@ -258,7 +258,7 @@ static NSArray *tasksFields = nil; labelKey = [NSString stringWithFormat: @"%@_class%@", type, [component objectForKey: @"c_classification"]]; - [component setObject: [self labelForKey: labelKey] + [component setObject: [self labelForKey: labelKey inContext: context] forKey: @"c_title"]; } @@ -548,19 +548,19 @@ static NSArray *tasksFields = nil; { // Same day if (forAllDay) - return [self labelForKey: @"Today"]; + return [self labelForKey: @"Today" inContext: context]; else return [dateFormatter formattedTime: date]; } else if ([now dayOfCommonEra] - [date dayOfCommonEra] == 1) { // Yesterday - return [self labelForKey: @"Yesterday"]; + return [self labelForKey: @"Yesterday" inContext: context]; } else if ([date dayOfCommonEra] - [now dayOfCommonEra] == 1) { // Tomorrow - return [self labelForKey: @"Tomorrow"]; + return [self labelForKey: @"Tomorrow" inContext: context]; } else if (abs(delta = [date dayOfCommonEra] - [now dayOfCommonEra]) < 7) { @@ -573,7 +573,7 @@ static NSArray *tasksFields = nil; return dayOfWeek; else // With the past 7 days - return [NSString stringWithFormat: [self labelForKey: @"last %@"], dayOfWeek]; + return [NSString stringWithFormat: [self labelForKey: @"last %@" inContext: context], dayOfWeek]; } else {