From 49dd4b1a9acfa111589445c386a2748b83064573 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Fri, 31 Mar 2023 22:40:01 +0800 Subject: [PATCH] Repo // Add Wade-Gyles pinyin support. --- .../Sources/Shared/Shared.swift | 4 +++ Source/Modules/InputHandler_Core.swift | 31 ++++++++++--------- .../Resources/Base.lproj/Localizable.strings | 1 + Source/Resources/en.lproj/Localizable.strings | 1 + Source/Resources/ja.lproj/Localizable.strings | 1 + .../zh-Hans.lproj/Localizable.strings | 1 + .../zh-Hant.lproj/Localizable.strings | 1 + 7 files changed, 25 insertions(+), 15 deletions(-) diff --git a/Packages/vChewing_Shared/Sources/Shared/Shared.swift b/Packages/vChewing_Shared/Sources/Shared/Shared.swift index c9bb30ed..d12e9161 100644 --- a/Packages/vChewing_Shared/Sources/Shared/Shared.swift +++ b/Packages/vChewing_Shared/Sources/Shared/Shared.swift @@ -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" } } } diff --git a/Source/Modules/InputHandler_Core.swift b/Source/Modules/InputHandler_Core.swift index 38ebd031..00dd6a36 100644 --- a/Source/Modules/InputHandler_Core.swift +++ b/Source/Modules/InputHandler_Core.swift @@ -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 diff --git a/Source/Resources/Base.lproj/Localizable.strings b/Source/Resources/Base.lproj/Localizable.strings index 75329903..68d6caf3 100644 --- a/Source/Resources/Base.lproj/Localizable.strings +++ b/Source/Resources/Base.lproj/Localizable.strings @@ -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"; diff --git a/Source/Resources/en.lproj/Localizable.strings b/Source/Resources/en.lproj/Localizable.strings index 75329903..68d6caf3 100644 --- a/Source/Resources/en.lproj/Localizable.strings +++ b/Source/Resources/en.lproj/Localizable.strings @@ -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"; diff --git a/Source/Resources/ja.lproj/Localizable.strings b/Source/Resources/ja.lproj/Localizable.strings index 8998b486..e2a2c5e0 100644 --- a/Source/Resources/ja.lproj/Localizable.strings +++ b/Source/Resources/ja.lproj/Localizable.strings @@ -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" = "イェール弁音 (ローマ字+数字音調)"; diff --git a/Source/Resources/zh-Hans.lproj/Localizable.strings b/Source/Resources/zh-Hans.lproj/Localizable.strings index 488828be..dc5e45ca 100644 --- a/Source/Resources/zh-Hans.lproj/Localizable.strings +++ b/Source/Resources/zh-Hans.lproj/Localizable.strings @@ -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" = "耶鲁拼音+数字标调"; diff --git a/Source/Resources/zh-Hant.lproj/Localizable.strings b/Source/Resources/zh-Hant.lproj/Localizable.strings index ae36c07b..ad933464 100644 --- a/Source/Resources/zh-Hant.lproj/Localizable.strings +++ b/Source/Resources/zh-Hant.lproj/Localizable.strings @@ -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" = "耶魯拼音+數字標調";