Heena
Heena

Reputation: 754

How to set base language other than English in iPhone app?

I am implementing an app which is going to have localization.

But in this case I need to set base language as Portuguese and not English

While implementation my app is going to be in English and after that when i change settings to language Portuguese it will show in that language, but

User is going to change the language from app itself and should be able to switch the language

Upvotes: 2

Views: 3275

Answers (2)

Gaurav Patel
Gaurav Patel

Reputation: 957

In plist file set "Localization native development region " set "German". u want to set German. Must have German Localize string file.

Upvotes: 3

Michael Frederick
Michael Frederick

Reputation: 16714

What do you mean by "set the base language"?

The app will launch in whatever language the user has his device set to use. If I set the language on my phone to English the app will launch in English. If I set the language of my device to Portuguese the app will launch in Portuguese. If you don't want it to be able to launch in English, don't add localization support for English.

Edit

I see what your intention is now. Yes, you can use the "AppleLanguages" preference, like so:

[[NSUserDefaults standardUserDefaults] setObject:[NSArray arrayWithObjects:@"en", @"pr", nil] forKey:@"AppleLanguages"];

This will make English the primary language of your app, and if an English translation is not available for a string then it will check the next language in the array for a translation.

Upvotes: 0

Related Questions