修复西班牙语bug
This commit is contained in:
@@ -127,6 +127,9 @@ static const CGFloat kKBLettersRow2EdgeSpacerMultiplier = 0.5;
|
|||||||
}
|
}
|
||||||
|
|
||||||
KBKeyboardLayout *layout = [self kb_currentLayout];
|
KBKeyboardLayout *layout = [self kb_currentLayout];
|
||||||
|
NSLog(@"[KBKeyboardView] reloadKeys: layoutName=%@ rows=%lu shiftRows=%lu shiftOn=%d",
|
||||||
|
self.currentLayoutJsonId, (unsigned long)layout.rows.count, (unsigned long)layout.shiftRows.count, self.shiftOn);
|
||||||
|
|
||||||
NSArray<KBKeyboardRowConfig *> *rows = nil;
|
NSArray<KBKeyboardRowConfig *> *rows = nil;
|
||||||
|
|
||||||
if (self.shiftOn && layout.shiftRows.count > 0) {
|
if (self.shiftOn && layout.shiftRows.count > 0) {
|
||||||
@@ -135,7 +138,10 @@ static const CGFloat kKBLettersRow2EdgeSpacerMultiplier = 0.5;
|
|||||||
rows = layout.rows ?: @[];
|
rows = layout.rows ?: @[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NSLog(@"[KBKeyboardView] reloadKeys: usingRows=%lu", (unsigned long)rows.count);
|
||||||
|
|
||||||
if (rows.count < 4) {
|
if (rows.count < 4) {
|
||||||
|
NSLog(@"[KBKeyboardView] reloadKeys: rows.count < 4, fallback to legacy");
|
||||||
[self kb_buildLegacyLayout];
|
[self kb_buildLegacyLayout];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -146,6 +152,7 @@ static const CGFloat kKBLettersRow2EdgeSpacerMultiplier = 0.5;
|
|||||||
[self buildRow:self.row4 withRowConfig:rows[3]];
|
[self buildRow:self.row4 withRowConfig:rows[3]];
|
||||||
|
|
||||||
NSUInteger totalButtons = [self kb_totalKeyButtonCount];
|
NSUInteger totalButtons = [self kb_totalKeyButtonCount];
|
||||||
|
NSLog(@"[KBKeyboardView] reloadKeys: totalButtons=%lu", (unsigned long)totalButtons);
|
||||||
if (totalButtons == 0) {
|
if (totalButtons == 0) {
|
||||||
NSLog(@"[KBKeyboardView] config layout produced no keys, fallback to legacy.");
|
NSLog(@"[KBKeyboardView] config layout produced no keys, fallback to legacy.");
|
||||||
for (UIView *row in @[self.row1, self.row2, self.row3, self.row4]) {
|
for (UIView *row in @[self.row1, self.row2, self.row3, self.row4]) {
|
||||||
@@ -376,7 +383,7 @@ static const CGFloat kKBLettersRow2EdgeSpacerMultiplier = 0.5;
|
|||||||
|
|
||||||
// 字母键工厂:根据 shiftOn 决定显示与输出大小写
|
// 字母键工厂:根据 shiftOn 决定显示与输出大小写
|
||||||
- (KBKey *)kb_letterKeyWithChar:(NSString *)charString {
|
- (KBKey *)kb_letterKeyWithChar:(NSString *)charString {
|
||||||
NSParameterAssert(charString.length == 1);
|
if (charString.length == 0) { return nil; }
|
||||||
NSString *lower = charString.lowercaseString;
|
NSString *lower = charString.lowercaseString;
|
||||||
NSString *upper = charString.uppercaseString;
|
NSString *upper = charString.uppercaseString;
|
||||||
|
|
||||||
@@ -1151,7 +1158,7 @@ edgeSpacerMultiplier:(CGFloat)edgeSpacerMultiplier {
|
|||||||
NSString *prefix = [itemId substringToIndex:range.location];
|
NSString *prefix = [itemId substringToIndex:range.location];
|
||||||
NSString *value = [itemId substringFromIndex:range.location + 1];
|
NSString *value = [itemId substringFromIndex:range.location + 1];
|
||||||
if ([prefix isEqualToString:@"letter"]) {
|
if ([prefix isEqualToString:@"letter"]) {
|
||||||
if (value.length == 1) {
|
if (value.length >= 1) {
|
||||||
return [self kb_letterKeyWithChar:value];
|
return [self kb_letterKeyWithChar:value];
|
||||||
}
|
}
|
||||||
return nil;
|
return nil;
|
||||||
|
|||||||
@@ -117,26 +117,22 @@
|
|||||||
},
|
},
|
||||||
@{
|
@{
|
||||||
@"code": @"es",
|
@"code": @"es",
|
||||||
@"name": @"Español",
|
@"name": @"Español (Latinoamérica)",
|
||||||
@"defaultSkinZip": @"西班牙初始皮肤.zip",
|
@"defaultSkinZip": @"西班牙初始皮肤.zip",
|
||||||
@"layouts": @[
|
@"layouts": @[@{@"variant": @"qwerty", @"title": @"QWERTY", @"profileId": @"es_419_qwerty", @"layoutJsonId": @"letters_es", @"suggestionEngine": @"spanish"}]
|
||||||
@{@"variant": @"qwerty", @"title": @"QWERTY", @"profileId": @"es_ES_qwerty", @"layoutJsonId": @"letters", @"suggestionEngine": @"latin"},
|
|
||||||
@{@"variant": @"azerty", @"title": @"AZERTY", @"profileId": @"es_ES_azerty", @"layoutJsonId": @"letters_azerty", @"suggestionEngine": @"latin"},
|
|
||||||
@{@"variant": @"qwertz", @"title": @"QWERTZ", @"profileId": @"es_ES_qwertz", @"layoutJsonId": @"letters_qwertz", @"suggestionEngine": @"latin"}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
@{
|
@{
|
||||||
@"code": @"pt",
|
@"code": @"pt",
|
||||||
@"name": @"Português",
|
@"name": @"Português",
|
||||||
@"defaultSkinZip": @"",
|
@"defaultSkinZip": @"",
|
||||||
@"layouts": @[@{@"variant": @"qwerty", @"title": @"QWERTY", @"profileId": @"pt_PT_qwerty", @"layoutJsonId": @"letters", @"suggestionEngine": @"latin"}]
|
@"layouts": @[@{@"variant": @"qwerty", @"title": @"QWERTY", @"profileId": @"pt_PT_qwerty", @"layoutJsonId": @"letters_pt", @"suggestionEngine": @"latin"}]
|
||||||
},
|
},
|
||||||
@{
|
@{
|
||||||
@"code": @"zh-Hant",
|
@"code": @"zh-Hant",
|
||||||
@"name": @"繁體中文(台灣)",
|
@"name": @"繁體中文(台灣)",
|
||||||
@"defaultSkinZip": @"",
|
@"defaultSkinZip": @"",
|
||||||
@"layouts": @[
|
@"layouts": @[
|
||||||
@{@"variant": @"pinyin", @"title": @"拼音(繁體)", @"profileId": @"zh_Hant_TW_pinyin", @"layoutJsonId": @"letters", @"suggestionEngine": @"pinyin_traditional"},
|
@{@"variant": @"pinyin", @"title": @"拼音(繁體)", @"profileId": @"zh_Hant_TW_pinyin", @"layoutJsonId": @"letters_zh_hant_pinyin", @"suggestionEngine": @"pinyin_traditional"},
|
||||||
@{@"variant": @"bopomofo_full", @"title": @"注音全鍵盤", @"profileId": @"zh_Hant_TW_bopomofo_full", @"layoutJsonId": @"letters_bopomofo_full", @"suggestionEngine": @"bopomofo"},
|
@{@"variant": @"bopomofo_full", @"title": @"注音全鍵盤", @"profileId": @"zh_Hant_TW_bopomofo_full", @"layoutJsonId": @"letters_bopomofo_full", @"suggestionEngine": @"bopomofo"},
|
||||||
@{@"variant": @"bopomofo_standard", @"title": @"注音標準", @"profileId": @"zh_Hant_TW_bopomofo_standard", @"layoutJsonId": @"letters_bopomofo_standard", @"suggestionEngine": @"bopomofo"}
|
@{@"variant": @"bopomofo_standard", @"title": @"注音標準", @"profileId": @"zh_Hant_TW_bopomofo_standard", @"layoutJsonId": @"letters_bopomofo_standard", @"suggestionEngine": @"bopomofo"}
|
||||||
]
|
]
|
||||||
@@ -145,13 +141,7 @@
|
|||||||
@"code": @"id",
|
@"code": @"id",
|
||||||
@"name": @"Bahasa Indonesia",
|
@"name": @"Bahasa Indonesia",
|
||||||
@"defaultSkinZip": @"",
|
@"defaultSkinZip": @"",
|
||||||
@"layouts": @[@{@"variant": @"qwerty", @"title": @"QWERTY", @"profileId": @"id_ID_qwerty", @"layoutJsonId": @"letters", @"suggestionEngine": @"latin"}]
|
@"layouts": @[@{@"variant": @"qwerty", @"title": @"QWERTY", @"profileId": @"id_ID_qwerty", @"layoutJsonId": @"letters_id", @"suggestionEngine": @"latin"}]
|
||||||
},
|
|
||||||
@{
|
|
||||||
@"code": @"zh-Hans",
|
|
||||||
@"name": @"简体中文",
|
|
||||||
@"defaultSkinZip": @"",
|
|
||||||
@"layouts": @[@{@"variant": @"qwerty", @"title": @"QWERTY", @"profileId": @"zh_Hans_CN_qwerty", @"layoutJsonId": @"letters", @"suggestionEngine": @"pinyin_simplified"}]
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
return [self parseProfilesFromJSONArray:fallback];
|
return [self parseProfilesFromJSONArray:fallback];
|
||||||
|
|||||||
@@ -13,21 +13,22 @@
|
|||||||
"layoutJsonId": "letters",
|
"layoutJsonId": "letters",
|
||||||
"suggestionEngine": "latin"
|
"suggestionEngine": "latin"
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
{
|
},
|
||||||
"code": "es",
|
{
|
||||||
"name": "Español (Latinoamérica)",
|
"code": "es",
|
||||||
"defaultSkinZip": "西班牙初始皮肤.zip",
|
"name": "Español (Latinoamérica)",
|
||||||
"layouts": [
|
"defaultSkinZip": "西班牙初始皮肤.zip",
|
||||||
{
|
"layouts": [
|
||||||
"variant": "qwerty",
|
{
|
||||||
"title": "QWERTY",
|
"variant": "qwerty",
|
||||||
"profileId": "es_419_qwerty",
|
"title": "QWERTY",
|
||||||
"layoutJsonId": "letters_es",
|
"profileId": "es_419_qwerty",
|
||||||
"suggestionEngine": "spanish"
|
"layoutJsonId": "letters_es",
|
||||||
}
|
"suggestionEngine": "spanish"
|
||||||
]
|
}
|
||||||
},
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"code": "pt",
|
"code": "pt",
|
||||||
"name": "Português",
|
"name": "Português",
|
||||||
|
|||||||
Reference in New Issue
Block a user