Pref // Add Apple ZhuyinBopomofo to basisKeyboardLayout menu.

This commit is contained in:
ShikiSuen 2022-02-02 14:58:32 +08:00
parent 67af8b40b1
commit 02b1733031
5 changed files with 11 additions and 0 deletions

View File

@ -63,6 +63,7 @@ extension RangeReplaceableCollection where Element: Hashable {
basisKeyboardLayoutButton.menu?.removeAllItems() basisKeyboardLayoutButton.menu?.removeAllItems()
let basisKeyboardLayoutID = Preferences.basisKeyboardLayout let basisKeyboardLayoutID = Preferences.basisKeyboardLayout
for source in list { for source in list {
func getString(_ key: CFString) -> String? { func getString(_ key: CFString) -> String? {
@ -121,6 +122,11 @@ extension RangeReplaceableCollection where Element: Hashable {
basisKeyboardLayoutButton.menu?.addItem(menuItem) basisKeyboardLayoutButton.menu?.addItem(menuItem)
} }
let menuItem = NSMenuItem()
menuItem.title = String(format: NSLocalizedString("Apple Zhuyin Bopomofo", comment: ""))
menuItem.representedObject = String("com.apple.keylayout.ZhuyinBopomofo")
basisKeyboardLayoutButton.menu?.addItem(menuItem)
basisKeyboardLayoutButton.select(chosenItem ?? usKeyboardLayoutItem) basisKeyboardLayoutButton.select(chosenItem ?? usKeyboardLayoutItem)
selectionKeyComboBox.usesDataSource = false selectionKeyComboBox.usesDataSource = false
selectionKeyComboBox.removeAllItems() selectionKeyComboBox.removeAllItems()

View File

@ -43,3 +43,4 @@
"zh-Hans" = "Simplified Chinese"; "zh-Hans" = "Simplified Chinese";
"zh-Hant" = "Traditional Chinese"; "zh-Hant" = "Traditional Chinese";
"ja" = "Japanese"; "ja" = "Japanese";
"Apple Zhuyin Bopomofo" = "Apple Zhuyin Bopomofo";

View File

@ -43,3 +43,4 @@
"zh-Hans" = "簡體中国語"; "zh-Hans" = "簡體中国語";
"zh-Hant" = "繁體中国語"; "zh-Hant" = "繁體中国語";
"ja" = "和語"; "ja" = "和語";
"Apple Zhuyin Bopomofo" = "Apple 注音ボポモフォ配列";

View File

@ -43,3 +43,4 @@
"zh-Hans" = "简体中文"; "zh-Hans" = "简体中文";
"zh-Hant" = "繁体中文"; "zh-Hant" = "繁体中文";
"ja" = "和文"; "ja" = "和文";
"Apple Zhuyin Bopomofo" = "Apple 注音键盘布局";

View File

@ -43,3 +43,5 @@
"zh-Hans" = "簡體中文"; "zh-Hans" = "簡體中文";
"zh-Hant" = "繁體中文"; "zh-Hant" = "繁體中文";
"ja" = "和文"; "ja" = "和文";
"Apple Zhuyin Bopomofo" = "Apple Zhuyin Bopomofo";
"Apple Zhuyin Bopomofo" = "Apple 注音鍵盤佈局";