Use CFLocaleCopyCurrent, CFLocaleGetValueand CFLocaleCopyPreferredLanguages(note that the preferred language may not match the language of the locale). See the documentation .
: ok, .
#include <CoreFoundation/CoreFoundation.h>
#include <stdio.h>
int main (int argc, char **argv)
{
CFLocaleRef loc = CFLocaleCopyCurrent();
CFStringRef countryCode = CFLocaleGetValue (loc, kCFLocaleCountryCode);
CFStringRef countryName = CFLocaleCopyDisplayNameForPropertyValue (loc, kCFLocaleCountryCode, countryCode);
CFShow(countryCode);
CFShow(countryName);
CFArrayRef langs = CFLocaleCopyPreferredLanguages();
CFStringRef langCode = CFArrayGetValueAtIndex (langs, 0);
CFStringRef langName = CFLocaleCopyDisplayNameForPropertyValue (loc, kCFLocaleLanguageCode, langCode);
CFShow(langCode);
CFShow(langName);
}