Skip to content

currently selected language – iPhone

June 3, 2010

A titbit now. It is easy to find currently selected language in the iPhone. we can use  NSLocale class to get that. This will give you the Language prefix..(for English – en)

NSString *preferredLang =[[NSLocalepreferredLanguages] objectAtIndex:0];

Another way to get the language is by  using the following lines:

NSUserDefaults* defs = [NSUserDefaults standardUserDefaults];

NSArray* languages = [defs objectForKey:@”AppleLanguages”];

NSString* preferredLang =[languages objectAtIndex:0];


Advertisements

From → iPhone

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: