Created
May 28, 2014 06:07
-
-
Save interchen/2fe74063739207ff8a02 to your computer and use it in GitHub Desktop.
Header
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 调试中文 | |
#define Debug_Language_Chinese 0 | |
// 调试英文 | |
#define Debug_Language_English 0 | |
#define AppLanguage @"appLanguage" | |
#define AppLanguage_ZH_CN @"zh-Hans" | |
#define AppLanguage_EN_US @"en" | |
#if Debug_Language_Chinese | |
#define CustomLocalizedString(key, comment) \ | |
[[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:AppLanguage_ZH_CN ofType:@"lproj"]] localizedStringForKey:(key) value:@"" table:nil] | |
#elif Debug_Language_English | |
#define CustomLocalizedString(key, comment) \ | |
[[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:AppLanguage_EN_US ofType:@"lproj"]] localizedStringForKey:(key) value:@"" table:nil] | |
#else | |
#define CustomLocalizedString(key, comment) \ | |
[[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%@",[[NSUserDefaults standardUserDefaults] objectForKey:AppLanguage]] ofType:@"lproj"]] localizedStringForKey:(key) value:@"" table:nil] | |
#endif | |
/** | |
* 是否是 iPad,Yes is iPad, NO is iPhone | |
*/ | |
#define isiPad ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) | |
#define isBeforeiOS7 ([[[UIDevice currentDevice] systemVersion] floatValue] < 7.0) | |
#define isAfteriOS7 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment