24 @global CFBundleCopyBundleLocalizations
25 @global CFBundleCopyLocalizedString
32 - (void)bundleDidFinishLoading:(
CPBundle)aBundle;
46 id <CPBundleDelegate> _delegate;
51 return [[
self alloc] initWithURL:aURL];
61 var bundle = CFBundle.bundleWithIdentifier(anIdentifier);
65 var url = bundle.bundleURL(),
79 return [
self bundleWithURL:CFBundle.bundleForClass(aClass).bundleURL()];
89 aURL =
new CFURL(aURL);
95 return existingBundle;
101 _bundle =
new CFBundle(aURL);
136 return _bundle.resourcesDirectoryURL();
139 - (Class)principalClass
150 return _bundle.identifier();
160 return _bundle.pathForResource(aFilename);
165 return _bundle.pathForResource(aFilename, extension);
170 return _bundle.pathForResource(aFilename, extension, subpath);
175 return _bundle.pathForResource(aFilename, extension, subpath, localizationName);
185 return _bundle.valueForInfoDictionaryKey(aKey);
188 - (void)loadWithDelegate:(
id <CPBundleDelegate>)aDelegate
190 _delegate = aDelegate;
192 _bundle.addEventListener(
"load",
function()
194 [_delegate bundleDidFinishLoading:self];
200 _bundle.addEventListener(
"error",
function()
202 CPLog.error(
"Could not find bundle: " +
self);
208 - (CPArray)staticResourceURLs
210 var staticResources = _bundle.staticResources();
212 return [staticResources arrayByApplyingBlock:function(resource)
214 return resource.URL();
218 - (CPArray)environments
235 #pragma mark Localization 237 - (CPArray)localizations
239 return CFBundleCopyBundleLocalizations(_bundle);
244 return CFBundleCopyLocalizedString(_bundle, aKey, aValue, aTable);
251 return CFCopyLocalizedString(key, comment);
256 return CFCopyLocalizedStringFromTable(key, table, comment);
261 return CFCopyLocalizedStringFromTableInBundle(key, table, bundle._bundle, comment);
global CFBundleCopyBundleLocalizations global CFBundleCopyLocalizedString CPBundleDidLoadNotification
function CPLocalizedStringFromTable(key, table, comment)
void postNotificationName:object:userInfo:(CPString aNotificationName, [object] id anObject, [userInfo] CPDictionary aUserInfo)
function CPLocalizedString(key, comment)
var CPBundlesForURLStrings
Groups information about an application's code & resources.
CPNotificationCenter defaultCenter()
A mutable key-value pair collection.
An immutable string (collection of characters).
CPString absoluteString()
CPBundle bundleWithURL:(CPURL aURL)
CPString mostEligibleEnvironment()
id objectForInfoDictionaryKey:(CPString aKey)
Sends messages (CPNotification) between objects.
CPBundle bundleWithPath:(CPString aPath)
id initWithURL:(CPURL aURL)
CPDictionary infoDictionary()
function CPCopyLocalizedStringFromTableInBundle(key, table, bundle, comment)
function CPClassFromString(aClassName)
FrameUpdater prototype description