• 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: Strategy for varying nib contents for two product variants?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strategy for varying nib contents for two product variants?


  • Subject: Re: Strategy for varying nib contents for two product variants?
  • From: Ken Thomases <email@hidden>
  • Date: Fri, 22 Feb 2008 11:45:14 -0600

On Feb 21, 2008, at 2:53 AM, Jean-Daniel Dupas wrote:


Le 21 févr. 08 à 09:36, Ulf Dunkel a écrit :

However, I have a number of NIBs with many references to the product name. Is there a good way to put a "variable" into NIB content, like to substitute for one word that appears in many different controls (button titles, text fields, etc.)?

Did you already try this:

Use English.lproj, French.lproj, German.lproj etc. for MyApplication.
Create and use en.lproj, fr.lproj, de.lproj etc. for MyApp PRO.

Create Run Scripts which remove either the English.lproj etc. stuff or the en.lproj etc. stuff, depending on which configuration you use.

Add new configurations in your project (beside Development, Development Native, Release etc.) for the MyApp PRO stuff.

Just my 2 cents, unproved. ;-)

HTH, Ulf Dunkel

It's maybe possible to create a solution based on template nib. You create nib with for exemple {MY_PRODUCT} instead of your product name in all localizable strings, and then you use ibtool to extract the strings, you replace the text, and you create your final nib by reinjecting the new strings.


ibtool --generate-stringsfile file.strings my-template.nib
# use whatever you want to replace {MY_PRODUCT} by your product name in file.strings
ibtool --strings-file file.strings --write my-result.nib my- template.nib


I didn't try so the commands maybe not be exact. If you are using Xcode 3 and compiled nib, you will have to perform this step before copying resources in your bundle because a compiled nib cannot be edited usign ibtool.

Thanks to both of you for your suggestions.

I should have mentioned that I'm using Tiger and Xcode 2.5, so ibtool isn't available.

I've come up with another possible strategy: on loading each nib, traverse all window/view hierarchies within it and do string replacements on all textual content. I haven't yet delved into a possible implementation, though.

Does anybody have any experience trying such a thing? Any advice or warnings?

Thanks again,
Ken

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


References: 
 >Strategy for varying nib contents for two product variants? (From: Ken Thomases <email@hidden>)
 >Re: Strategy for varying nib contents for two product variants? (From: Ulf Dunkel <email@hidden>)
 >Re: Strategy for varying nib contents for two product variants? (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: Re: Single stepping suddenly stopping in routines with no symbolics
  • Next by Date: Re: Shark on MacBook Air
  • Previous by thread: Re: Strategy for varying nib contents for two product variants?
  • Next by thread: Using dSYM with atos from Xcode 2.5 Tiger
  • Index(es):
    • Date
    • Thread