diff --git a/ChangeLog b/ChangeLog index 36a280a0c..5a7a898d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-01-31 Francis Lachapelle + + * SoObjects/SOGo/WOResourceManager+SOGo.m + (-pathToLocaleForLanguageNamed:): if the language has a CamelCase + form, add the first part to the lookup languages. + 2012-01-30 Francis Lachapelle * UI/WebServerResources/UIxCalUserRightsEditor.js (onUpdateACL): diff --git a/SoObjects/SOGo/WOResourceManager+SOGo.m b/SoObjects/SOGo/WOResourceManager+SOGo.m index 37c2bc665..fe804f041 100644 --- a/SoObjects/SOGo/WOResourceManager+SOGo.m +++ b/SoObjects/SOGo/WOResourceManager+SOGo.m @@ -20,6 +20,7 @@ * Boston, MA 02111-1307, USA. */ +#import #import #import @@ -33,12 +34,21 @@ { static Class MainProduct = Nil; NSString *lpath; + NSRange range; + NSMutableArray *languages; -#warning TODO: create method "languagesBeginingWith:" + languages = [NSMutableArray arrayWithObject: _name]; + + // If the language has a CamelCase form, add the first part to the lookup languages. + range = [_name rangeOfCharacterFromSet: [NSCharacterSet uppercaseLetterCharacterSet] + options: NSBackwardsSearch + range: NSMakeRange(1, [_name length] - 1)]; + if (range.location != NSNotFound && range.location > 0) + [languages addObject: [_name substringToIndex: range.location]]; lpath = [self pathForResourceNamed: @"Locale" inFramework: nil - languages: [NSArray arrayWithObject:_name]]; + languages: languages]; if (![lpath length]) { if (!MainProduct)