]> git.saurik.com Git - cydia.git/commitdiff
iOS 7's UILocalizedIndexedCollation fails Chinese.
authorJay Freeman (saurik) <saurik@saurik.com>
Thu, 12 Jun 2014 19:24:58 +0000 (12:24 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 12 Jun 2014 19:25:54 +0000 (12:25 -0700)
MobileCydia.mm

index f93806aadf40d463bb298aedbb6efed90e8a0c7a..33bed9e4fdadf5fd90fa1c9dc75c697e8e6f6270 100644 (file)
@@ -10232,6 +10232,14 @@ int main(int argc, char *argv[]) {
 
         CollationLocale_ = MSHookIvar<NSLocale *>(collation, "_locale");
 
+        if (kCFCoreFoundationVersionNumber >= 800 && [[CollationLocale_ localeIdentifier] isEqualToString:@"zh@collation=stroke"]) {
+            CollationThumbs_ = [NSArray arrayWithObjects:@"1",@"•",@"4",@"•",@"7",@"•",@"10",@"•",@"13",@"•",@"16",@"•",@"19",@"A",@"•",@"E",@"•",@"I",@"•",@"M",@"•",@"R",@"•",@"V",@"•",@"Z",@"#",nil];
+            for (NSInteger offset : (NSInteger[]) {0,1,3,4,6,7,9,10,12,13,15,16,18,25,26,29,30,33,34,37,38,42,43,46,47,50,51})
+                CollationOffset_.push_back(offset);
+            CollationTitles_ = [NSArray arrayWithObjects:@"1 畫",@"2 畫",@"3 畫",@"4 畫",@"5 畫",@"6 畫",@"7 畫",@"8 畫",@"9 畫",@"10 畫",@"11 畫",@"12 畫",@"13 畫",@"14 畫",@"15 畫",@"16 畫",@"17 畫",@"18 畫",@"19 畫",@"20 畫",@"21 畫",@"22 畫",@"23 畫",@"24 畫",@"25 畫以上",@"A",@"B",@"C",@"D",@"E",@"F",@"G",@"H",@"I",@"J",@"K",@"L",@"M",@"N",@"O",@"P",@"Q",@"R",@"S",@"T",@"U",@"V",@"W",@"X",@"Y",@"Z",@"#",nil];
+            CollationStarts_ = [NSArray arrayWithObjects:@"一",@"丁",@"丈",@"不",@"且",@"丞",@"串",@"並",@"亭",@"乘",@"乾",@"傀",@"亂",@"僎",@"僵",@"儐",@"償",@"叢",@"儳",@"嚴",@"儷",@"儻",@"囌",@"囑",@"廳",@"a",@"b",@"c",@"d",@"e",@"f",@"g",@"h",@"i",@"j",@"k",@"l",@"m",@"n",@"o",@"p",@"q",@"r",@"s",@"t",@"u",@"v",@"w",@"x",@"y",@"z",@"ʒ",nil];
+        } else {
+
         CollationThumbs_ = [collation sectionIndexTitles];
         for (size_t index(0), end([CollationThumbs_ count]); index != end; ++index)
             CollationOffset_.push_back([collation sectionForSectionIndexTitleAtIndex:index]);
@@ -10249,6 +10257,8 @@ int main(int argc, char *argv[]) {
             if (!U_SUCCESS(code))
                 NSLog(@"%s", u_errorName(code));
         }
+
+        }
     } else {
         CollationLocale_ = [[[NSLocale alloc] initWithLocaleIdentifier:@"en@collation=dictionary"] autorelease];