SaltyNuts
SaltyNuts

Reputation: 5168

Split localized iOS app into separate apps

I have a dual language localized app that is intended for enterprise distribution and for my purposes, it would be desirable to split it into two separate apps. Some users of the app would need to use both language versions and it would be easier for them to just open a different app than to go into settings and change language each time they want to switch.

What is the easiest way to split such an app into two targets, considering it already has a couple of localized strings files (for text and for InfoPlist) and several language-specific image folders?

Upvotes: 0

Views: 123

Answers (1)

Khanh Nguyen
Khanh Nguyen

Reputation: 11132

Create a new target (one project might have more than 1 target), with a different bundle identifier.

Add a preprocessor macro, e.g. SECONDARY_LANGUAGE=1, into the new target's Build Settings so you'll know which language is being used. You can check for language inside the code with something like

#if (SECONDARY_LANGUAGE)
    ...
#else
    ...
#endif

Upvotes: 1

Related Questions