Access to localized images in a plug-in
Access to localized images in a plug-in
- Subject: Access to localized images in a plug-in
- From: Steve Weller <email@hidden>
- Date: Sat, 16 Jun 2007 09:55:28 -0700
I am in the process of localizing my Aperture plug-in called Random
Wok. I have a TIFF image that used to be in the Resources folder that
has been localized and so is now in the lproj folders. It needs
localizing because it contains the text "No Image".
I used to use this code:
// Returns displayed image for table for a specific image
-(NSImage *)thumbnailForImageAtIndex:(unsigned)index;
{
NSImage *thumb;
// Get the thumbnail
thumb = [_exportManager thumbnailForImageAtIndex:index
size:kExportThumbnailSizeMini];
if(nil==thumb) {
NSString *noThumbPath = [[_bundle resourcePath]
stringByAppendingPathComponent:@"NoImage.tiff"];
NSImage *nothumb = [[[NSImage alloc]
initWithContentsOfFile:noThumbPath] autorelease];
thumb = nothumb;
}
return [[thumb retain] autorelease];
}
But it no longer works because the folder structure has changed. I
would use - (NSString *)pathForResource:(NSString *)name ofType:
(NSString *)extension inDirectory:(NSString *)subpath
with subpath set to nil but there is no place to specify the bundle
to use. In my case I cannot use the main bundle because that belongs
to Aperture. I need a version of this that allows me to choose the
bundle. Does such a method exist, or do I need to roll my own?
--
Bagelturf Blog http://www.bagelturf.com/
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden