Repo // Add Wade-Gyles pinyin support.

This commit is contained in:
ShikiSuen 2023-03-31 22:40:01 +08:00
parent fa72e41d22
commit 49dd4b1a9a
7 changed files with 25 additions and 15 deletions

View File

@ -181,6 +181,7 @@ public enum KeyboardParser: Int, CaseIterable {
case ofYalePinyin = 12
case ofHualuoPinyin = 13
case ofUniversalPinyin = 14
case ofWadeGilesPinyin = 15
public var localizedMenuName: String {
let rawString: String = {
@ -200,6 +201,7 @@ public enum KeyboardParser: Int, CaseIterable {
case .ofYalePinyin: return "Yale Pinyin with Numeral Intonation"
case .ofHualuoPinyin: return "Hualuo Pinyin with Numeral Intonation"
case .ofUniversalPinyin: return "Universal Pinyin with Numeral Intonation"
case .ofWadeGilesPinyin: return "Wade-Giles Pinyin with Numeral Intonation"
}
}()
return NSLocalizedString(rawString, comment: "")
@ -237,6 +239,8 @@ public enum KeyboardParser: Int, CaseIterable {
return "HualuoPinyin"
case .ofUniversalPinyin:
return "UniversalPinyin"
case .ofWadeGilesPinyin:
return "WadeGilesPinyin"
}
}
}

View File

@ -450,21 +450,22 @@ public class InputHandler: InputHandlerProtocol {
///
public func ensureKeyboardParser() {
switch currentKeyboardParserType {
case KeyboardParser.ofStandard: composer.ensureParser(arrange: .ofDachen)
case KeyboardParser.ofDachen26: composer.ensureParser(arrange: .ofDachen26)
case KeyboardParser.ofETen: composer.ensureParser(arrange: .ofETen)
case KeyboardParser.ofHsu: composer.ensureParser(arrange: .ofHsu)
case KeyboardParser.ofETen26: composer.ensureParser(arrange: .ofETen26)
case KeyboardParser.ofIBM: composer.ensureParser(arrange: .ofIBM)
case KeyboardParser.ofMiTAC: composer.ensureParser(arrange: .ofMiTAC)
case KeyboardParser.ofFakeSeigyou: composer.ensureParser(arrange: .ofFakeSeigyou)
case KeyboardParser.ofSeigyou: composer.ensureParser(arrange: .ofSeigyou)
case KeyboardParser.ofStarlight: composer.ensureParser(arrange: .ofStarlight)
case KeyboardParser.ofHanyuPinyin: composer.ensureParser(arrange: .ofHanyuPinyin)
case KeyboardParser.ofSecondaryPinyin: composer.ensureParser(arrange: .ofSecondaryPinyin)
case KeyboardParser.ofYalePinyin: composer.ensureParser(arrange: .ofYalePinyin)
case KeyboardParser.ofHualuoPinyin: composer.ensureParser(arrange: .ofHualuoPinyin)
case KeyboardParser.ofUniversalPinyin: composer.ensureParser(arrange: .ofUniversalPinyin)
case .ofStandard: composer.ensureParser(arrange: .ofDachen)
case .ofDachen26: composer.ensureParser(arrange: .ofDachen26)
case .ofETen: composer.ensureParser(arrange: .ofETen)
case .ofHsu: composer.ensureParser(arrange: .ofHsu)
case .ofETen26: composer.ensureParser(arrange: .ofETen26)
case .ofIBM: composer.ensureParser(arrange: .ofIBM)
case .ofMiTAC: composer.ensureParser(arrange: .ofMiTAC)
case .ofFakeSeigyou: composer.ensureParser(arrange: .ofFakeSeigyou)
case .ofSeigyou: composer.ensureParser(arrange: .ofSeigyou)
case .ofStarlight: composer.ensureParser(arrange: .ofStarlight)
case .ofHanyuPinyin: composer.ensureParser(arrange: .ofHanyuPinyin)
case .ofSecondaryPinyin: composer.ensureParser(arrange: .ofSecondaryPinyin)
case .ofYalePinyin: composer.ensureParser(arrange: .ofYalePinyin)
case .ofHualuoPinyin: composer.ensureParser(arrange: .ofHualuoPinyin)
case .ofUniversalPinyin: composer.ensureParser(arrange: .ofUniversalPinyin)
case .ofWadeGilesPinyin: composer.ensureParser(arrange: .ofWadeGilesPinyin)
}
composer.clear()
composer.phonabetCombinationCorrectionEnabled = prefs.autoCorrectReadingCombination

View File

@ -345,4 +345,5 @@
"Use only one row / column in candidate window." = "Use only one row / column in candidate window.";
"Vertical" = "Vertical";
"Warning: This page is for testing future features. \nFeatures listed here may not work as expected." = "Warning: This page is for testing future features. \nFeatures listed here may not work as expected.";
"Wade-Giles Pinyin with Numeral Intonation" = "Wade-Giles Pinyin with Numeral Intonation";
"Yale Pinyin with Numeral Intonation" = "Yale Pinyin with Numeral Intonation";

View File

@ -345,4 +345,5 @@
"Use only one row / column in candidate window." = "Use only one row / column in candidate window.";
"Vertical" = "Vertical";
"Warning: This page is for testing future features. \nFeatures listed here may not work as expected." = "Warning: This page is for testing future features. \nFeatures listed here may not work as expected.";
"Wade-Giles Pinyin with Numeral Intonation" = "Wade-Giles Pinyin with Numeral Intonation";
"Yale Pinyin with Numeral Intonation" = "Yale Pinyin with Numeral Intonation";

View File

@ -346,4 +346,5 @@
"Use only one row / column in candidate window." = "ただ1つ行・列で文字候補を陳列。";
"Vertical" = "縦型陳列";
"Warning: This page is for testing future features. \nFeatures listed here may not work as expected." = "警告:これからの新機能テストのために作ったページですから、\nここで陳列されている諸機能は予想通り動けるだと思わないでください。";
"Wade-Giles Pinyin with Numeral Intonation" = "ウェード式弁音 (ローマ字+数字音調)";
"Yale Pinyin with Numeral Intonation" = "イェール弁音 (ローマ字+数字音調)";

View File

@ -345,4 +345,5 @@
"Use only one row / column in candidate window." = "仅以单行/单列来陈列候选字。";
"Vertical" = "纵向布局";
"Warning: This page is for testing future features. \nFeatures listed here may not work as expected." = "警告:该页面仅作未来功能测试所用。\n在此列出的功能并非处于完全可用之状态。";
"Wade-Giles Pinyin with Numeral Intonation" = "韦氏拼音+数字标调";
"Yale Pinyin with Numeral Intonation" = "耶鲁拼音+数字标调";

View File

@ -345,4 +345,5 @@
"Use only one row / column in candidate window." = "僅以單行/單列來陳列候選字。";
"Vertical" = "縱向佈局";
"Warning: This page is for testing future features. \nFeatures listed here may not work as expected." = "警告:該頁面僅作未來功能測試所用。\n在此列出的功能並非處於完全可用之狀態。";
"Wade-Giles Pinyin with Numeral Intonation" = "韋氏拼音+數字標調";
"Yale Pinyin with Numeral Intonation" = "耶魯拼音+數字標調";