• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Access to localized images in a plug-in
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Access to localized images in a plug-in


  • Subject: Re: Access to localized images in a plug-in
  • From: "Jim Turner" <email@hidden>
  • Date: Sat, 16 Jun 2007 12:14:11 -0500

I believe [[NSBundle bundleForClass:[self class]] will get you the
specific bundle you need, at least it does for me when doing text
localization from a SIMBL plugin...  but I'm not familiar with the
structure of Aperture plugins.  From there, you'd use whatever
pathForResource* you need.

Jim
http://nukethemfromorbit.com

On 6/16/07, Steve Weller <email@hidden> wrote:
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

_______________________________________________

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


  • Follow-Ups:
    • Re: Access to localized images in a plug-in
      • From: Steve Weller <email@hidden>
References: 
 >Access to localized images in a plug-in (From: Steve Weller <email@hidden>)

  • Prev by Date: Bezierpath transformation problem
  • Next by Date: Re: Access to localized images in a plug-in
  • Previous by thread: Access to localized images in a plug-in
  • Next by thread: Re: Access to localized images in a plug-in
  • Index(es):
    • Date
    • Thread