ios获取系统语言
2023-12-07 本文已影响0人
小小鸟他大爷
NSString *languageCode = [NSLocale preferredLanguages][0];
NSString *countryCode = [NSString stringWithFormat:@"-%@",[[NSLocale currentLocale] objectForKey:NSLocaleCountryCode]];
if(languageCode)
{
languageCode = [languageCodestringByReplacingOccurrencesOfString:countryCodewithString:@""];
}
return languageCode;