From 02b17330317094a1f32a49bfbe0a605ac22ae98c Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Wed, 2 Feb 2022 14:58:32 +0800 Subject: [PATCH] Pref // Add Apple ZhuyinBopomofo to basisKeyboardLayout menu. --- Source/PreferencesWindowController.swift | 6 ++++++ Source/en.lproj/Localizable.strings | 1 + Source/ja.lproj/Localizable.strings | 1 + Source/zh-Hans.lproj/Localizable.strings | 1 + Source/zh-Hant.lproj/Localizable.strings | 2 ++ 5 files changed, 11 insertions(+) diff --git a/Source/PreferencesWindowController.swift b/Source/PreferencesWindowController.swift index bd39008a..4729477a 100644 --- a/Source/PreferencesWindowController.swift +++ b/Source/PreferencesWindowController.swift @@ -63,6 +63,7 @@ extension RangeReplaceableCollection where Element: Hashable { basisKeyboardLayoutButton.menu?.removeAllItems() let basisKeyboardLayoutID = Preferences.basisKeyboardLayout + for source in list { func getString(_ key: CFString) -> String? { @@ -121,6 +122,11 @@ extension RangeReplaceableCollection where Element: Hashable { 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) selectionKeyComboBox.usesDataSource = false selectionKeyComboBox.removeAllItems() diff --git a/Source/en.lproj/Localizable.strings b/Source/en.lproj/Localizable.strings index 8b897e3b..0a3d6720 100644 --- a/Source/en.lproj/Localizable.strings +++ b/Source/en.lproj/Localizable.strings @@ -43,3 +43,4 @@ "zh-Hans" = "Simplified Chinese"; "zh-Hant" = "Traditional Chinese"; "ja" = "Japanese"; +"Apple Zhuyin Bopomofo" = "Apple Zhuyin Bopomofo"; diff --git a/Source/ja.lproj/Localizable.strings b/Source/ja.lproj/Localizable.strings index 0224e802..40e62b1c 100644 --- a/Source/ja.lproj/Localizable.strings +++ b/Source/ja.lproj/Localizable.strings @@ -43,3 +43,4 @@ "zh-Hans" = "簡體中国語"; "zh-Hant" = "繁體中国語"; "ja" = "和語"; +"Apple Zhuyin Bopomofo" = "Apple 注音ボポモフォ配列"; diff --git a/Source/zh-Hans.lproj/Localizable.strings b/Source/zh-Hans.lproj/Localizable.strings index 5d6fb069..7f543a9d 100644 --- a/Source/zh-Hans.lproj/Localizable.strings +++ b/Source/zh-Hans.lproj/Localizable.strings @@ -43,3 +43,4 @@ "zh-Hans" = "简体中文"; "zh-Hant" = "繁体中文"; "ja" = "和文"; +"Apple Zhuyin Bopomofo" = "Apple 注音键盘布局"; diff --git a/Source/zh-Hant.lproj/Localizable.strings b/Source/zh-Hant.lproj/Localizable.strings index b0bc929f..55a0f343 100644 --- a/Source/zh-Hant.lproj/Localizable.strings +++ b/Source/zh-Hant.lproj/Localizable.strings @@ -43,3 +43,5 @@ "zh-Hans" = "簡體中文"; "zh-Hant" = "繁體中文"; "ja" = "和文"; +"Apple Zhuyin Bopomofo" = "Apple Zhuyin Bopomofo"; +"Apple Zhuyin Bopomofo" = "Apple 注音鍵盤佈局";