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

 

iOS 获取本地语言

上一篇:app点击底部菜单切换标题


下一篇:Android-加载大图片