mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-22 11:55:24 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user