Since our translators didn't work as fast as we coders did, we were in
need to strip one specific language – Spanish – from an iPhone App – MedCalc – which we'll be shipping next week. And because MedCalc has more than 140 XIB files, the same number of XML files and the double amount of strings files, it would be very tedious to manually delete all Spanish localizations (not to mention to re-add them once the translators are done). So I needed a way to tell Xcode not to include one specific language for now, for which I didn't find a solution.
But there is a pretty straightforward solution: Let Xcode build the App with all the present localizations and just before code-signing kicks in
delete the Spanish.lproj folder and all localized files are gone. You can easily do this by adding a
Run Script build phase to the target, containing this one line of code (it's a Bash Script):
rm -r "${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/Spanish.lproj"
Code Signing always kicks in after all build phases have completed, so just put that build phase at the end of your current phases.
Props to macmoonshine from osxentwicklerforum.de for proposing this solution!
Update October 15, 2010
Note that this increases the time to build because Xcode recreates all Spanish files, so you might want to disable this step during testing.
Rafael: Thank you very much, I was having a huge headache to solve the very same problem!