NSString *languageCode = [NSLocale preferredLanguages][0];
NSString *countryCode = [NSString stringWithFormat:@"-%@",[[NSLocale currentLocale] objectForKey:NSLocaleCountryCode]];
if(languageCode)
{
languageCode = [languageCodestringByReplacingOccurrencesOfString:countryCodewithString:@""];
}
return languageCode;
网友评论