// // CCNSLocale.m // CCFC // // Created by xichen on 11-12-27. // Copyright 2011 ccteam. All rights reserved. // #import "CCNSLocale.h" @implementation NSLocale(cc) + (NSString *)localeLanguageCode { NSLocale *currentLocale = [NSLocale currentLocale]; return [currentLocale objectForKey:NSLocaleLanguageCode]; } + (NSString *)localeCountryCode { NSLocale *currentLocale = [NSLocale currentLocale]; return [currentLocale objectForKey:NSLocaleCountryCode]; } @end
可能有更新:
googlecode链接地址:http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCNSLocale.m
github地址:https://github.com/cxsjabc/iphone-common-codes-ccteam/tree/master/CCFC/files/CCNSLocale.m