Search code examples
objective-ciosxcodexcode4localization

Force a specific localization to be used for a target


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?


Solution

  • Based on your comment in answer to Lvsti (where you say the reason you're doing this is that translations in some of your languages aren't finished yet but you want to release what you have), perhaps as an alternative to deleting all the relevant localization files or messing with your build settings you can try to edit the list of languages in your XCode project? It's not per target but per project, but it might allow you to exclude languages you don't want in your build. See under Localizations in your project settings (there's a little - icon you can use to remove a language).

    enter image description here