Localized project with several targets with localized app names
Just keep all the InfoPlist.strings files, under separate paths. Each would only be a member of one target.
Or did I not understand the question?
I cracked this nut in an XCode project which, I believe, tackles the same issue as you have, so hopefully this will help you. The solution contains two targets built from the same codebase (with a different app name) and which are fully localized, including the app's names. (It builds my freemium app called Growth (French: Croissance, Spanish: Crecer) and the paid version called Growth+ (French: Croissance+, Spanish: Crecer+).
I also stumbled on the InfoPlist.string
files (which contain only the app's name). I got around the issue through the use of subfolders in my solution, and changing the targets to include the localized set of InfoPlist.strings from the relevant subfolder. Specifically, I have this structure:
Root +-- en.lproj ¦ +-- Localizable.strings ¦ +-- SomeXib.xib +-- es.lproj ¦ +-- Localizable.strings ¦ +-- SomeXib.xib +-- fr.lproj ¦ +-- Localizable.strings ¦ +-- SomeXib.xib +-- OnlyInAppA ¦ +-- en.lproj ¦ ¦ +-- InfoPlist.strings ¦ +-- es.lproj ¦ ¦ +-- InfoPlist.strings ¦ +-- fr.lproj ¦ +-- InfoPlist.strings +-- OnlyInAppB ¦ +-- en.lproj ¦ ¦ +-- InfoPlist.strings ¦ +-- es.lproj ¦ ¦ +-- InfoPlist.strings ¦ +-- fr.lproj ¦ +-- InfoPlist.strings +-- AppA.plist +-- AppB.plist
And the only difference among my targets (other than different preprocessor symbols and different .plist file) is that AppA's build settings includes the InfoPlist.strings files under OnlyInAppA, whereas AppB's build settings includes the InfoPlist.strings files under OnlyInAppB.
The naming convention I used (OnlyInAppA/OnlyInAppB folders, AppB/AppB plist files) is obvious enough to make this a satisfactory approach, in my personal opinion.
Edit:
Please see these two XCode 4 screenshots to see where exactly to find the settings which are changed in the targets.
In the target build settings, a different plist file is specified (note: XCode automatically does this for you when you add a new target)
In the target build phases, in section Copy Bundle Resources, pick the version of InfoPlist.strings from the relevant OnlyInAppX subfolder (notice the gray text next to InfoPlist.strings on this screenshot--this will show a different location for the other target). You can achieve this by using the +/- buttons and replace the file with the intended one.
If this problem still persist: I have found a solution on how to add multiple InfoPlist.string localized for each target in your project. Please follow these steps:
- I assume you already have multiple targets.
- Go to the project folder in Finder.
Create a folder specific for each target:
Create an InfoPlist.strings file in each folder:
Add folders to targets specifying proper (and only!) target for each folder in your project:
Remove target dependency for original InfoPlist.strings file for each new target.
Localize new InfoPlist.strings files:
Build targets and check by changing language settings: