iOS 获取本地语言
/** 获取当前是否是汉语 */
+ (BOOL )getZnLaunage
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSArray *languages = [defaults objectForKey:@”AppleLanguages”];
NSString *currentLang = [languages objectAtIndex:0];
if([currentLang compare:@”zh-Hans-CN” options:NSCaseInsensitiveSearch] == NSOrderedSame
|| [currentLang compare:@”zh-Hant-CN” options:NSCaseInsensitiveSearch] == NSOrderedSame
|| [currentLang compare:@”zh-Hant-TW” options:NSCaseInsensitiveSearch] == NSOrderedSame
|| [currentLang compare:@”zh-Hant-HK” options:NSCaseInsensitiveSearch] == NSOrderedSame
|| [currentLang compare:@”zh-Hant-MO” options:NSCaseInsensitiveSearch] == NSOrderedSame)
{
return YES;
}
else
{
return NO;
}
}
// zh-Hant-TW 繁体中文台湾
// zh-Hant-HK 繁体中文香港
// zh-Hant-MO 繁体中文澳门
// en-CN 英文