• 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
calling nibtool in Objective-C code ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

calling nibtool in Objective-C code ?


  • Subject: calling nibtool in Objective-C code ?
  • From: email@hidden
  • Date: Wed, 28 Jun 2006 08:30:06 +0200 (CEST)
  • Importance: Normal

              Hello all,

 working on an "exotic" localization problem that I mentioned in
an earlier post (some main menu item titles such as "Undo" were not
translated
correctly on runtime because the titles I put in the localized nib get
lower priority
than some builtin rules)
I found out that a way to solve my problem
was to subclass NSApplication in order to override the
-setMenu method, with something like this

-(void) setMenu: (NSMenu*) aMenu
{
   NSMenu* correctedMenu=translate_all(MainMenu.strings,aMenu);
   [super setMenu: correctedMenu];
}

 Now, about the translate_all function that I need, in the terminal
this is exactly what "nibtool -d -w" does. Is there a way to invoke
that command within the Apple frameworks ?

 Even if no builtin command exists, it is certainly feasible to write
the code for it, by using NSLocalizedString or its likes recursively over
all the sub-sub-sub-items of the menu (and this is what I'm going to
do if all else fails ; in that case, does anyone know about a bit of sample
Objective-C code doing a similar recursive scanning of a structure ?)

     Thanks in advance for any help.

                                                             Ewan



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: alphabetical sorting, and line breaks in NSTextView
  • Next by Date: Re: calling nibtool in Objective-C code ?
  • Previous by thread: Re: alphabetical sorting, and line breaks in NSTextView
  • Next by thread: Re: calling nibtool in Objective-C code ?
  • Index(es):
    • Date
    • Thread