Alex Rivera | Logout

Force a specific localization to be used for a target

Asked 2012-05-07T17:28:13.883
9

I'm developing an app that, among other things, will play a large audio file (30MB).

I want to submit the app to the App Store in several countries. The audio file is different per target country, the rest of the app remains the same (Although localized).

I've created a target for each country, a bash script takes care of copying the correct audio file into compiled app based on the target, and it works great.

I've also localized the ressources (Images and Localized.strings) to make it easy to maintain.

Let's say I built my target for Sweden, I want to include only the swedish localization to force the app to always show swedish language (Which matches the audio file).

Here's the actual question:* How do I exclude all localizations from a target or force a target to ONLY use a specific localization, regardless of phone settings?

Edit
Report

1 Answer

0

If I understand your question, you don't actually need a localized app, or at least not a fully localized one. If that is the case, I would use a run-script build phase which is responsible for copying the appropriate non-localized but target-specific resources based on the current target. E.g. supposing you have an Audio folder in your project root with all the versions for the different languages, your script could look like:

cp "$PROJECT_DIR/Audio/$TARGETNAME.mp3" "$TARGET_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/audio.mp3"

which would e.g. copy/rename "Swedish.mp3" to "audio.mp3" directly accessible from the bundle.

answered 2012-05-07T20:55:18.910

Your Answer