Monotone-Parent: f4861ebaae0a55ed464809d54f5ecd4f0bef9913

Monotone-Revision: d23a6bb43fc70fa7f45420eb293780b9dcfbd02c

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-04-09T18:45:14
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2010-04-09 18:45:14 +00:00
parent 7a072049ab
commit 0fc3588ff3
121 changed files with 912 additions and 2557 deletions
-59
View File
@@ -1013,65 +1013,6 @@
return nil;
}
- (NSArray *) _languagesForLabels
{
NSMutableArray *languages;
NSArray *browserLanguages;
NSString *language;
SOGoUser *user;
#warning the purpose of this method needs to be reviewed
languages = [NSMutableArray array];
user = [context activeUser];
if ([user isKindOfClass: [SOGoUser class]])
{
language = [[user userDefaults] language];
[languages addObject: language];
}
else
{
browserLanguages = [[context request] browserLanguages];
[languages addObjectsFromArray: browserLanguages];
}
return languages;
}
- (NSString *) labelForKey: (NSString *) key
{
NSString *language, *label;
NSArray *paths;
NSEnumerator *languages;
NSBundle *bundle;
NSDictionary *strings;
label = nil;
bundle = [NSBundle bundleForClass: [self class]];
if (!bundle)
bundle = [NSBundle mainBundle];
languages = [[self _languagesForLabels] objectEnumerator];
while (!label && (language = [languages nextObject]))
{
paths = [bundle pathsForResourcesOfType: @"strings"
inDirectory: [NSString stringWithFormat: @"%@.lproj",
language]
forLocalization: language];
if ([paths count] > 0)
{
strings = [NSDictionary
dictionaryFromStringsFile: [paths objectAtIndex: 0]];
label = [strings objectForKey: key];
}
}
if (!label)
label = key;
return label;
}
/* description */
- (void) appendAttributesToDescription: (NSMutableString *) _ms