PrefWindow // Crediting Hiraku regarding the Cocoa UI lang menu.

Co-authored-by: Hiraku <dev@hiraku.tw>
This commit is contained in:
ShikiSuen 2022-12-29 22:18:22 +08:00
parent cbdf8c3727
commit abe6375347
1 changed files with 25 additions and 21 deletions

View File

@ -114,6 +114,9 @@ class CtlPrefWindow: NSWindowController, NSWindowDelegate {
lblCurrentlySpecifiedUserDataFolder.placeholderString = LMMgr.dataFolderPath(
isDefaultFolder: true)
// Credit: Hiraku Wang (for the implementation of the UI language select support in Cocoa PrefWindow.
// Note: The SwiftUI PrefWindow has the same feature implemented by Shiki Suen.
do {
let languages = ["auto", "en", "zh-Hans", "zh-Hant", "ja"]
var autoMUISelectItem: NSMenuItem?
var chosenLanguageItem: NSMenuItem?
@ -139,6 +142,7 @@ class CtlPrefWindow: NSWindowController, NSWindowDelegate {
currentLanguageSelectItem = chosenLanguageItem ?? autoMUISelectItem
uiLanguageButton.select(currentLanguageSelectItem)
}
var usKeyboardLayoutItem: NSMenuItem?
var chosenBaseKeyboardLayoutItem: NSMenuItem?