/** 获取当前是否是汉语 */

+ (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        英文

 

版权声明:本文为shaoquanzhijia原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/shaoquanzhijia/p/10156600.html