SimplyKiwi
SimplyKiwi

Reputation: 12444

Get a language's ISO identifier from its name

I know I can get the device's current Locale easily but in my case, the user chooses the language from a UIPickerView. Each language is a string in a array typed exactly the same way the phone has it in the settings for setting the device language.

Is it possible to get the language abbreviation from a string like @"English" or @"Arabic"?

Thanks!

Upvotes: 3

Views: 947

Answers (1)

一二三
一二三

Reputation: 21249

NSLocale's +canonicalLocaleIdentifierFromString: does this translation.

Upvotes: 3

Related Questions