I\'d like to show the current language that the device UI is using. What code would I use?
I want this as an NSString
in fully spelled out format. (Not
If you want to get only language here is my suggested answer:
NSString *langplusreg = [[NSLocale preferredLanguages] objectAtIndex:0];
NSString * langonly = [[langplusreg componentsSeparatedByString:@"-"]
objectAtIndex:0];
In my case i just wanted only Locale language not locale region.
Output: If your Locale language is Japanese and locale region is Japan then:
langplusreg = ja-JP
langonly = ja