Skip to content

Commit 4678b48

Browse files
committed
zh-HK处理
zh-HK处理
1 parent ada9e24 commit 4678b48

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

MJRefresh.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'MJRefresh'
3-
s.version = '3.1.5'
3+
s.version = '3.1.6'
44
s.summary = 'An easy way to use pull-to-refresh'
55
s.homepage = 'https://github.com/CoderMJLee/MJRefresh'
66
s.license = 'MIT'

MJRefresh/Base/MJRefreshComponent.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,18 @@ - (NSString *)localizedStringForKey:(NSString *)key withDefault:(NSString *)defa
144144
if (bundle == nil) {
145145
// 获得设备的语言
146146
NSString *language = [NSLocale preferredLanguages].firstObject;
147-
// 如果是iOS9以上,截取前面的语言标识
147+
// 如果是iOS9以上,去掉后面的设备购买地区比如zh-Hans-US和zh-Hans-CN后面的US和CN
148148
if ([UIDevice currentDevice].systemVersion.floatValue >= 9.0) {
149149
NSRange range = [language rangeOfString:@"-" options:NSBackwardsSearch];
150150
if (range.location != NSNotFound) {
151151
language = [language substringToIndex:range.location];
152152
}
153153
}
154154

155+
if ([language isEqualToString:@"zh"]) { // zh-HK被去掉了-HK
156+
language = @"zh-Hant";
157+
}
158+
155159
if (language.length == 0) {
156160
language = @"zh-Hans";
157161
}

0 commit comments

Comments
 (0)