Created
July 9, 2010 06:46
-
-
Save j4johnfox/469146 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (CPString)pathForLocalizedResource:(CPString)aResourceName | |
{ | |
var mainBundle = [CPBundle mainBundle]; | |
return [mainBundle pathForResource:[mainBundle bundleLocale] + ".lproj/" +aResourceName]; | |
} | |
+ (CPCib)loadLocalizedCibNamed:(CPString)aName | |
owner:(id)anOwner | |
loadDelegate:(id)aDelegate | |
{ | |
if (![aName hasSuffix:@".cib"]) | |
aName = [aName stringByAppendingString:@".cib"]; | |
// Path is based solely on anOwner: | |
var bundle = anOwner ? [CPBundle bundleForClass:[anOwner class]] : [CPBundle mainBundle]; | |
var path = [bundle pathForLocalizedResource:aName]; | |
return [self loadCibFile:path | |
externalNameTable:[CPDictionary dictionaryWithObject:anOwner forKey:CPCibOwner] | |
loadDelegate:aDelegate]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment