views:

1303

answers:

5

Hi!

I am working on an application which I am planning to release both in English and Spanish languages. With this I mean, I would like it to have two separate apps in the App Store, one being displayed with English title, and the other one with Spanish title (and each with contents in their respective language).

This means that the language in the app would be static, that is, that actually the app would not be internationalized, in the sense that the app would not display the language according to the user's locale settings, but according to either English or Spanish depending on the app bought.

I initially thought of using a constants file with constants strings of all the labels, button titles, etc. and having an identical separate project for each language, and changing this constants file on each project, but of course, this involves some hassle regarding maintenance.

The other approach I am thinking of, is actually performing the whole internationalization process (NSLocale, localization files, etc), and somewhat at the app startup skip the user's locale, and set either language programmatically (here, I would only need to know is how to skip such default i18n process to set a specific language. In this case, I would see the advantage of having only one local project, and the possibilty of setting the language on each build, for a different language app.

Could you please provide advice regarding which approach or best practice to follow?? Does this make sense, or is there another approach that I should follow instead in order to have the two separate, fixed language apps?

Thank you very much in advance!

Best regards

+1  A: 

if you really want to have two separate apps in the App Store, you could do something like

http://stackoverflow.com/questions/1131812/making-multiple-versions-of-an-iphone-application

to have them both be built from a single Xcode project and make maintenance as easy as possible.

why not just have a single app version that includes both languages and automatically chooses the user's preferred language? if your goal is that bilingual people should pay you separately for two copies, then you'll need two separate apps like you suggest, I guess.

David Maymudes
+2  A: 

Duplicate: http://stackoverflow.com/questions/451776/best-way-to-make-an-iphone-application-multi-lingual

Short version: include a language file for each language. Apple'll take care of the rest - when the user changes their iPhone's language, your app will switch too (assuming a translation is available).

ceejayoz
A: 

Localize your application for English and Spanish and put the following lines of code in main.m before the call to UIApplicationMain:

NSArray *languages = [NSArray arrayWithObject:@"es"];
[[NSUserDefaults standardUserDefaults] setObject:languages forKey:@"AppleLanguages"];
[languages release];

where the language code is either "es" or en". This will put the preferred language (es or en in your case) in the application's preferences (in the property list file ../your app's UUID/Library/Preferences/yourcompany's Internetadress.your app's name.plist) and override the language set in Settings.

This makes the app use the localized strings and use the localized XIBs. However, for some reason it does not work for localizing the app's icon and bundle display name. Adding a line for setting the locale (the key seems to be "AppleLocale") does not help. The current locale remains the one set in Settings, not the one set programmatically.

occamsrazor
You have a reference counting bug.
Graham Lee
A: 

Localizing the strings and the XIBs suffices. Duplicate the target following http://www.iphonedevsdk.com/forum/iphone-sdk-development/8036-lite-game-duplicate-xcode-project.html and set Icon file and Bundle display name in the copy's plist file.

occamsrazor
+1  A: 

The line

[languages release];

shouldn't be there.

occamsrazor