Shared // Add KeyboardParser.localizedName variable.

This commit is contained in:
ShikiSuen 2022-12-06 17:21:04 +08:00
parent c58f9de2fb
commit 9973e74a19
1 changed files with 26 additions and 3 deletions

View File

@ -161,13 +161,13 @@ public enum StateType: String {
public enum KeyboardParser: Int, CaseIterable {
case ofStandard = 0
case ofETen = 1
case ofHsu = 2
case ofETen26 = 3
case ofIBM = 4
case ofMiTAC = 5
case ofSeigyou = 8
case ofFakeSeigyou = 6
case ofDachen26 = 7
case ofSeigyou = 8
case ofETen26 = 3
case ofHsu = 2
case ofStarlight = 9
case ofHanyuPinyin = 10
case ofSecondaryPinyin = 11
@ -175,6 +175,29 @@ public enum KeyboardParser: Int, CaseIterable {
case ofHualuoPinyin = 13
case ofUniversalPinyin = 14
public var localizedMenuName: String {
let rawString: String = {
switch self {
case .ofStandard: return "Dachen (Microsoft Standard / Wang / 01, etc.)"
case .ofETen: return "Eten Traditional"
case .ofIBM: return "IBM"
case .ofMiTAC: return "MiTAC"
case .ofSeigyou: return "Seigyou"
case .ofFakeSeigyou: return "Fake Seigyou"
case .ofDachen26: return "Dachen 26 (libChewing)"
case .ofETen26: return "Eten 26"
case .ofHsu: return "Hsu"
case .ofStarlight: return "Starlight"
case .ofHanyuPinyin: return "Hanyu Pinyin with Numeral Intonation"
case .ofSecondaryPinyin: return "Secondary Pinyin with Numeral Intonation"
case .ofYalePinyin: return "Yale Pinyin with Numeral Intonation"
case .ofHualuoPinyin: return "Hualuo Pinyin with Numeral Intonation"
case .ofUniversalPinyin: return "Universal Pinyin with Numeral Intonation"
}
}()
return NSLocalizedString(rawString, comment: "")
}
public var name: String {
switch self {
case .ofStandard: