NSLocale class provides information about system language like the language that iPhone is currently running on, the list of supported language etc.
To get the current language code use following lines of code.
NSString *code = [[NSLocale currentLocale] objectForKey:NSLocaleLanguageCode];
NSLog(@Current language code: %@, code);
output: Current language code: en
If you need the language name, use above language code to get language name.
NSString *language = [[NSLocale currentLocale] displayNameForKey:NSLocaleIdentifier value:code];
NSLog(@Language name: %@", language);
Output: Language name: English
0 Comment(s)