diff --git a/MJRefresh.podspec b/MJRefresh.podspec index 6f35fa64..9541c486 100644 --- a/MJRefresh.podspec +++ b/MJRefresh.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'MJRefresh' - s.version = '3.1.5' + s.version = '3.1.6' s.summary = 'An easy way to use pull-to-refresh' s.homepage = 'https://github.com/CoderMJLee/MJRefresh' s.license = 'MIT' diff --git a/MJRefresh/Base/MJRefreshComponent.m b/MJRefresh/Base/MJRefreshComponent.m index 9c4dc2d0..8e4974c0 100644 --- a/MJRefresh/Base/MJRefreshComponent.m +++ b/MJRefresh/Base/MJRefreshComponent.m @@ -144,7 +144,7 @@ - (NSString *)localizedStringForKey:(NSString *)key withDefault:(NSString *)defa if (bundle == nil) { // 获得设备的语言 NSString *language = [NSLocale preferredLanguages].firstObject; - // 如果是iOS9以上,截取前面的语言标识 + // 如果是iOS9以上,去掉后面的设备购买地区比如zh-Hans-US和zh-Hans-CN后面的US和CN if ([UIDevice currentDevice].systemVersion.floatValue >= 9.0) { NSRange range = [language rangeOfString:@"-" options:NSBackwardsSearch]; if (range.location != NSNotFound) { @@ -152,6 +152,10 @@ - (NSString *)localizedStringForKey:(NSString *)key withDefault:(NSString *)defa } } + if ([language isEqualToString:@"zh"]) { // zh-HK被去掉了-HK + language = @"zh-Hant"; + } + if (language.length == 0) { language = @"zh-Hans"; }