Repo // Simplify handling of localized strings.

This commit is contained in:
ShikiSuen 2022-09-01 15:31:39 +08:00
parent 8df60b8cdd
commit 667cd84441
13 changed files with 129 additions and 176 deletions

View File

@ -60,6 +60,7 @@ class AppDelegate: NSWindowController, NSApplicationDelegate {
guard guard
let installingVersion = Bundle.main.infoDictionary?[kCFBundleVersionKey as String] let installingVersion = Bundle.main.infoDictionary?[kCFBundleVersionKey as String]
as? String, as? String,
let window = window,
let versionString = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String let versionString = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
else { else {
return return
@ -71,7 +72,7 @@ class AppDelegate: NSWindowController, NSApplicationDelegate {
cancelButton.nextKeyView = installButton cancelButton.nextKeyView = installButton
installButton.nextKeyView = cancelButton installButton.nextKeyView = cancelButton
if let cell = installButton.cell as? NSButtonCell { if let cell = installButton.cell as? NSButtonCell {
window?.defaultButtonCell = cell window.defaultButtonCell = cell
} }
if let copyrightLabel = Bundle.main.localizedInfoDictionary?["NSHumanReadableCopyright"] if let copyrightLabel = Bundle.main.localizedInfoDictionary?["NSHumanReadableCopyright"]
@ -82,17 +83,12 @@ class AppDelegate: NSWindowController, NSApplicationDelegate {
if let eulaContent = Bundle.main.localizedInfoDictionary?["CFEULAContent"] as? String { if let eulaContent = Bundle.main.localizedInfoDictionary?["CFEULAContent"] as? String {
appEULAContent.string = eulaContent appEULAContent.string = eulaContent
} }
appVersionLabel.stringValue = String( appVersionLabel.stringValue = "\(versionString) Build \(installingVersion)"
format: "%@ Build %@", versionString, installingVersion
)
window?.title = String( window.title = "\(window.title) (v\(versionString), Build \(installingVersion))"
format: NSLocalizedString("%@ (for version %@, r%@)", comment: ""), window?.title ?? "", window.standardWindowButton(.closeButton)?.isHidden = true
versionString, installingVersion window.standardWindowButton(.miniaturizeButton)?.isHidden = true
) window.standardWindowButton(.zoomButton)?.isHidden = true
window?.standardWindowButton(.closeButton)?.isHidden = true
window?.standardWindowButton(.miniaturizeButton)?.isHidden = true
window?.standardWindowButton(.zoomButton)?.isHidden = true
if FileManager.default.fileExists( if FileManager.default.fileExists(
atPath: kTargetPartialPath) atPath: kTargetPartialPath)
@ -114,8 +110,8 @@ class AppDelegate: NSWindowController, NSApplicationDelegate {
installButton.title = NSLocalizedString("Upgrade", comment: "") installButton.title = NSLocalizedString("Upgrade", comment: "")
} }
window?.center() window.center()
window?.orderFront(self) window.orderFront(self)
NSApp.activate(ignoringOtherApps: true) NSApp.activate(ignoringOtherApps: true)
} }
@ -126,14 +122,15 @@ class AppDelegate: NSWindowController, NSApplicationDelegate {
} }
@objc func timerTick(_ timer: Timer) { @objc func timerTick(_ timer: Timer) {
guard let window = window else { return }
let elapsed = Date().timeIntervalSince(translocationRemovalStartTime ?? Date()) let elapsed = Date().timeIntervalSince(translocationRemovalStartTime ?? Date())
if elapsed >= kTranslocationRemovalDeadline { if elapsed >= kTranslocationRemovalDeadline {
timer.invalidate() timer.invalidate()
window?.endSheet(progressSheet, returnCode: .cancel) window.endSheet(progressSheet, returnCode: .cancel)
} else if isAppBundleTranslocated(atPath: kTargetPartialPath) == false { } else if isAppBundleTranslocated(atPath: kTargetPartialPath) == false {
progressIndicator.doubleValue = 1.0 progressIndicator.doubleValue = 1.0
timer.invalidate() timer.invalidate()
window?.endSheet(progressSheet, returnCode: .continue) window.endSheet(progressSheet, returnCode: .continue)
} }
} }
@ -145,15 +142,17 @@ class AppDelegate: NSWindowController, NSApplicationDelegate {
// return // return
// } // }
guard let window = window else { return }
let shouldWaitForTranslocationRemoval = let shouldWaitForTranslocationRemoval =
isAppBundleTranslocated(atPath: kTargetPartialPath) isAppBundleTranslocated(atPath: kTargetPartialPath)
&& (window?.responds(to: #selector(NSWindow.beginSheet(_:completionHandler:))) ?? false) && window.responds(to: #selector(NSWindow.beginSheet(_:completionHandler:)))
// //
do { do {
let sourceDir = kDestinationPartial let sourceDir = kDestinationPartial
let fileManager = FileManager.default let fileManager = FileManager.default
let fileURLString = String(format: "%@/%@", sourceDir, kTargetBundle) let fileURLString = sourceDir + "/" + kTargetBundle
let fileURL = URL(fileURLWithPath: fileURLString) let fileURL = URL(fileURLWithPath: fileURLString)
// //
@ -176,7 +175,7 @@ class AppDelegate: NSWindowController, NSApplicationDelegate {
if shouldWaitForTranslocationRemoval { if shouldWaitForTranslocationRemoval {
progressIndicator.startAnimation(self) progressIndicator.startAnimation(self)
window?.beginSheet(progressSheet) { returnCode in window.beginSheet(progressSheet) { returnCode in
DispatchQueue.main.async { DispatchQueue.main.async {
if returnCode == .continue { if returnCode == .continue {
self.installInputMethod( self.installInputMethod(

View File

@ -17,5 +17,3 @@
"Warning" = "Warning"; "Warning" = "Warning";
"Input method may not be fully enabled. Please enable it through System Preferences > Keyboard > Input Sources." = "Input method may not be fully enabled. Please enable it through System Preferences > Keyboard > Input Sources."; "Input method may not be fully enabled. Please enable it through System Preferences > Keyboard > Input Sources." = "Input method may not be fully enabled. Please enable it through System Preferences > Keyboard > Input Sources.";
"Continue" = "Continue"; "Continue" = "Continue";
"%@ (for version %@, r%@)" = "%@ (for version %@, r%@)";

View File

@ -17,5 +17,3 @@
"Warning" = "お知らせ"; "Warning" = "お知らせ";
"Input method may not be fully enabled. Please enable it through System Preferences > Keyboard > Input Sources." = "入力アプリの自動起動はうまく出来なかったかもしれません。ご自分で「システム環境設定→キーボード→入力ソース」で起動してください。"; "Input method may not be fully enabled. Please enable it through System Preferences > Keyboard > Input Sources." = "入力アプリの自動起動はうまく出来なかったかもしれません。ご自分で「システム環境設定→キーボード→入力ソース」で起動してください。";
"Continue" = "続行"; "Continue" = "続行";
"%@ (for version %@, r%@)" = "%@ (for version %@, r%@)";

View File

@ -17,5 +17,3 @@
"Warning" = "安装不完整"; "Warning" = "安装不完整";
"Input method may not be fully enabled. Please enable it through System Preferences > Keyboard > Input Sources." = "输入法已经安装好,但可能没有完全启用。请从「系统偏好设定」 > 「键盘」 > 「输入方式」分页加入输入法。"; "Input method may not be fully enabled. Please enable it through System Preferences > Keyboard > Input Sources." = "输入法已经安装好,但可能没有完全启用。请从「系统偏好设定」 > 「键盘」 > 「输入方式」分页加入输入法。";
"Continue" = "继续"; "Continue" = "继续";
"%@ (for version %@, r%@)" = "%@ (for version %@, r%@)";

View File

@ -17,5 +17,3 @@
"Warning" = "安裝不完整"; "Warning" = "安裝不完整";
"Input method may not be fully enabled. Please enable it through System Preferences > Keyboard > Input Sources." = "輸入法已經安裝好,但可能沒有完全啟用。請從「系統偏好設定」 > 「鍵盤」 > 「輸入方式」分頁加入輸入法。"; "Input method may not be fully enabled. Please enable it through System Preferences > Keyboard > Input Sources." = "輸入法已經安裝好,但可能沒有完全啟用。請從「系統偏好設定」 > 「鍵盤」 > 「輸入方式」分頁加入輸入法。";
"Continue" = "繼續"; "Continue" = "繼續";
"%@ (for version %@, r%@)" = "%@ (for version %@, r%@)";

View File

@ -24,12 +24,12 @@ extension ctlInputMethod {
if ShiftKeyUpChecker.check(event), !mgrPrefs.disableShiftTogglingAlphanumericalMode { if ShiftKeyUpChecker.check(event), !mgrPrefs.disableShiftTogglingAlphanumericalMode {
if !shouldUseHandle || (!rencentKeyHandledByKeyHandler && shouldUseHandle) { if !shouldUseHandle || (!rencentKeyHandledByKeyHandler && shouldUseHandle) {
NotifierController.notify( NotifierController.notify(
message: String( message: NSLocalizedString("Alphanumerical Mode", comment: "") + "\n"
format: "%@%@%@", NSLocalizedString("Alphanumerical Mode", comment: ""), "\n", + {
toggleASCIIMode() toggleASCIIMode()
? NSLocalizedString("NotificationSwitchON", comment: "") ? NSLocalizedString("NotificationSwitchON", comment: "")
: NSLocalizedString("NotificationSwitchOFF", comment: "") : NSLocalizedString("NotificationSwitchOFF", comment: "")
) }()
) )
} }
if shouldUseHandle { if shouldUseHandle {

View File

@ -114,12 +114,13 @@ class ctlInputMethod: IMKInputController {
isASCIIMode = false isASCIIMode = false
} else { } else {
NotifierController.notify( NotifierController.notify(
message: String( message: NSLocalizedString("Alphanumerical Mode", comment: "") + "\n"
format: "%@%@%@", NSLocalizedString("Alphanumerical Mode", comment: ""), "\n", + {
isASCIIMode isASCIIMode
? NSLocalizedString("NotificationSwitchON", comment: "") ? NSLocalizedString("NotificationSwitchON", comment: "")
: NSLocalizedString("NotificationSwitchOFF", comment: "") : NSLocalizedString("NotificationSwitchOFF", comment: "")
)) }()
)
} }
} }

View File

@ -211,102 +211,109 @@ extension ctlInputMethod {
@objc func toggleSCPCTypingMode(_: Any? = nil) { @objc func toggleSCPCTypingMode(_: Any? = nil) {
resetKeyHandler() resetKeyHandler()
NotifierController.notify( NotifierController.notify(
message: String( message: NSLocalizedString("Per-Char Select Mode", comment: "") + "\n"
format: "%@%@%@", NSLocalizedString("Per-Char Select Mode", comment: ""), "\n", + {
mgrPrefs.toggleSCPCTypingModeEnabled() mgrPrefs.toggleSCPCTypingModeEnabled()
? NSLocalizedString("NotificationSwitchON", comment: "") ? NSLocalizedString("NotificationSwitchON", comment: "")
: NSLocalizedString("NotificationSwitchOFF", comment: "") : NSLocalizedString("NotificationSwitchOFF", comment: "")
)) }()
)
} }
@objc func toggleChineseConverter(_: Any?) { @objc func toggleChineseConverter(_: Any?) {
resetKeyHandler() resetKeyHandler()
NotifierController.notify( NotifierController.notify(
message: String( message: NSLocalizedString("Force KangXi Writing", comment: "") + "\n"
format: "%@%@%@", NSLocalizedString("Force KangXi Writing", comment: ""), "\n", + {
mgrPrefs.toggleChineseConversionEnabled() mgrPrefs.toggleChineseConversionEnabled()
? NSLocalizedString("NotificationSwitchON", comment: "") ? NSLocalizedString("NotificationSwitchON", comment: "")
: NSLocalizedString("NotificationSwitchOFF", comment: "") : NSLocalizedString("NotificationSwitchOFF", comment: "")
)) }()
)
} }
@objc func toggleShiftJISShinjitaiOutput(_: Any?) { @objc func toggleShiftJISShinjitaiOutput(_: Any?) {
resetKeyHandler() resetKeyHandler()
NotifierController.notify( NotifierController.notify(
message: String( message: NSLocalizedString("JIS Shinjitai Output", comment: "") + "\n"
format: "%@%@%@", NSLocalizedString("JIS Shinjitai Output", comment: ""), "\n", + {
mgrPrefs.toggleShiftJISShinjitaiOutputEnabled() mgrPrefs.toggleShiftJISShinjitaiOutputEnabled()
? NSLocalizedString("NotificationSwitchON", comment: "") ? NSLocalizedString("NotificationSwitchON", comment: "")
: NSLocalizedString("NotificationSwitchOFF", comment: "") : NSLocalizedString("NotificationSwitchOFF", comment: "")
)) }()
)
} }
@objc func toggleCurrencyNumerals(_: Any?) { @objc func toggleCurrencyNumerals(_: Any?) {
resetKeyHandler() resetKeyHandler()
NotifierController.notify( NotifierController.notify(
message: String( message: NSLocalizedString("Currency Numeral Output", comment: "") + "\n"
format: "%@%@%@", NSLocalizedString("Currency Numeral Output", comment: ""), "\n", + {
mgrPrefs.toggleCurrencyNumeralsEnabled() mgrPrefs.toggleCurrencyNumeralsEnabled()
? NSLocalizedString("NotificationSwitchON", comment: "") ? NSLocalizedString("NotificationSwitchON", comment: "")
: NSLocalizedString("NotificationSwitchOFF", comment: "") : NSLocalizedString("NotificationSwitchOFF", comment: "")
)) }()
)
} }
@objc func toggleHalfWidthPunctuation(_: Any?) { @objc func toggleHalfWidthPunctuation(_: Any?) {
resetKeyHandler() resetKeyHandler()
NotifierController.notify( NotifierController.notify(
message: String( message: NSLocalizedString("Half-Width Punctuation Mode", comment: "") + "\n"
format: "%@%@%@", NSLocalizedString("Half-Width Punctuation Mode", comment: ""), + {
"\n", mgrPrefs.toggleHalfWidthPunctuationEnabled()
mgrPrefs.toggleHalfWidthPunctuationEnabled() ? NSLocalizedString("NotificationSwitchON", comment: "")
? NSLocalizedString("NotificationSwitchON", comment: "") : NSLocalizedString("NotificationSwitchOFF", comment: "")
: NSLocalizedString("NotificationSwitchOFF", comment: "") }()
)) )
} }
@objc func toggleCNS11643Enabled(_: Any?) { @objc func toggleCNS11643Enabled(_: Any?) {
resetKeyHandler() resetKeyHandler()
NotifierController.notify( NotifierController.notify(
message: String( message: NSLocalizedString("CNS11643 Mode", comment: "") + "\n"
format: "%@%@%@", NSLocalizedString("CNS11643 Mode", comment: ""), "\n", + {
mgrPrefs.toggleCNS11643Enabled() mgrPrefs.toggleCNS11643Enabled()
? NSLocalizedString("NotificationSwitchON", comment: "") ? NSLocalizedString("NotificationSwitchON", comment: "")
: NSLocalizedString("NotificationSwitchOFF", comment: "") : NSLocalizedString("NotificationSwitchOFF", comment: "")
)) }()
)
} }
@objc func toggleSymbolEnabled(_: Any?) { @objc func toggleSymbolEnabled(_: Any?) {
resetKeyHandler() resetKeyHandler()
NotifierController.notify( NotifierController.notify(
message: String( message: NSLocalizedString("Symbol & Emoji Input", comment: "") + "\n"
format: "%@%@%@", NSLocalizedString("Symbol & Emoji Input", comment: ""), "\n", + {
mgrPrefs.toggleSymbolInputEnabled() mgrPrefs.toggleSymbolInputEnabled()
? NSLocalizedString("NotificationSwitchON", comment: "") ? NSLocalizedString("NotificationSwitchON", comment: "")
: NSLocalizedString("NotificationSwitchOFF", comment: "") : NSLocalizedString("NotificationSwitchOFF", comment: "")
)) }()
)
} }
@objc func toggleAssociatedPhrasesEnabled(_: Any?) { @objc func toggleAssociatedPhrasesEnabled(_: Any?) {
resetKeyHandler() resetKeyHandler()
NotifierController.notify( NotifierController.notify(
message: String( message: NSLocalizedString("Per-Char Associated Phrases", comment: "") + "\n"
format: "%@%@%@", NSLocalizedString("Per-Char Associated Phrases", comment: ""), + {
"\n", mgrPrefs.toggleAssociatedPhrasesEnabled()
mgrPrefs.toggleAssociatedPhrasesEnabled() ? NSLocalizedString("NotificationSwitchON", comment: "")
? NSLocalizedString("NotificationSwitchON", comment: "") : NSLocalizedString("NotificationSwitchOFF", comment: "")
: NSLocalizedString("NotificationSwitchOFF", comment: "") }()
)) )
} }
@objc func togglePhraseReplacement(_: Any?) { @objc func togglePhraseReplacement(_: Any?) {
resetKeyHandler() resetKeyHandler()
NotifierController.notify( NotifierController.notify(
message: String( message: NSLocalizedString("Use Phrase Replacement", comment: "") + "\n"
format: "%@%@%@", NSLocalizedString("Use Phrase Replacement", comment: ""), "\n", + {
mgrPrefs.togglePhraseReplacementEnabled() mgrPrefs.togglePhraseReplacementEnabled()
? NSLocalizedString("NotificationSwitchON", comment: "") ? NSLocalizedString("NotificationSwitchON", comment: "")
: NSLocalizedString("NotificationSwitchOFF", comment: "") : NSLocalizedString("NotificationSwitchOFF", comment: "")
)) }()
)
} }
@objc func selfUninstall(_: Any?) { @objc func selfUninstall(_: Any?) {

View File

@ -54,54 +54,30 @@ class SymbolNode {
// MARK: - Static data. // MARK: - Static data.
static let catCommonSymbols = String( static let catCommonSymbols = NSLocalizedString("catCommonSymbols", comment: "")
format: NSLocalizedString("catCommonSymbols", comment: "")) static let catHoriBrackets = NSLocalizedString("catHoriBrackets", comment: "")
static let catHoriBrackets = String( static let catVertBrackets = NSLocalizedString("catVertBrackets", comment: "")
format: NSLocalizedString("catHoriBrackets", comment: "")) static let catAlphabets = NSLocalizedString("catAlphabets", comment: "")
static let catVertBrackets = String( static let catSpecialNumbers = NSLocalizedString("catSpecialNumbers", comment: "")
format: NSLocalizedString("catVertBrackets", comment: "")) static let catMathSymbols = NSLocalizedString("catMathSymbols", comment: "")
static let catAlphabets = String( static let catCurrencyUnits = NSLocalizedString("catCurrencyUnits", comment: "")
format: NSLocalizedString("catAlphabets", comment: "")) static let catSpecialSymbols = NSLocalizedString("catSpecialSymbols", comment: "")
static let catSpecialNumbers = String( static let catUnicodeSymbols = NSLocalizedString("catUnicodeSymbols", comment: "")
format: NSLocalizedString("catSpecialNumbers", comment: "")) static let catCircledKanjis = NSLocalizedString("catCircledKanjis", comment: "")
static let catMathSymbols = String( static let catCircledKataKana = NSLocalizedString("catCircledKataKana", comment: "")
format: NSLocalizedString("catMathSymbols", comment: "")) static let catBracketKanjis = NSLocalizedString("catBracketKanjis", comment: "")
static let catCurrencyUnits = String( static let catSingleTableLines = NSLocalizedString("catSingleTableLines", comment: "")
format: NSLocalizedString("catCurrencyUnits", comment: "")) static let catDoubleTableLines = NSLocalizedString("catDoubleTableLines", comment: "")
static let catSpecialSymbols = String( static let catFillingBlocks = NSLocalizedString("catFillingBlocks", comment: "")
format: NSLocalizedString("catSpecialSymbols", comment: "")) static let catLineSegments = NSLocalizedString("catLineSegments", comment: "")
static let catUnicodeSymbols = String( static let catKana = NSLocalizedString("catKana", comment: "")
format: NSLocalizedString("catUnicodeSymbols", comment: "")) static let catCombinations = NSLocalizedString("catCombinations", comment: "")
static let catCircledKanjis = String( static let catPhonabets = NSLocalizedString("catPhonabets", comment: "")
format: NSLocalizedString("catCircledKanjis", comment: "")) static let catCircledASCII = NSLocalizedString("catCircledASCII", comment: "")
static let catCircledKataKana = String( static let catBracketedASCII = NSLocalizedString("catBracketedASCII", comment: "")
format: NSLocalizedString("catCircledKataKana", comment: "")) static let catMusicSymbols = NSLocalizedString("catMusicSymbols", comment: "")
static let catBracketKanjis = String( static let catThai = NSLocalizedString("catThai", comment: "")
format: NSLocalizedString("catBracketKanjis", comment: "")) static let catYi = NSLocalizedString("catYi", comment: "")
static let catSingleTableLines = String(
format: NSLocalizedString("catSingleTableLines", comment: ""))
static let catDoubleTableLines = String(
format: NSLocalizedString("catDoubleTableLines", comment: ""))
static let catFillingBlocks = String(
format: NSLocalizedString("catFillingBlocks", comment: ""))
static let catLineSegments = String(
format: NSLocalizedString("catLineSegments", comment: ""))
static let catKana = String(
format: NSLocalizedString("catKana", comment: ""))
static let catCombinations = String(
format: NSLocalizedString("catCombinations", comment: ""))
static let catPhonabets = String(
format: NSLocalizedString("catPhonabets", comment: ""))
static let catCircledASCII = String(
format: NSLocalizedString("catCircledASCII", comment: ""))
static let catBracketedASCII = String(
format: NSLocalizedString("catBracketedASCII", comment: ""))
static let catMusicSymbols = String(
format: NSLocalizedString("catMusicSymbols", comment: ""))
static let catThai = String(
format: NSLocalizedString("catThai", comment: ""))
static let catYi = String(
format: NSLocalizedString("catYi", comment: ""))
private(set) static var root: SymbolNode = .init("/") private(set) static var root: SymbolNode = .init("/")

View File

@ -63,28 +63,20 @@ enum mgrLangModel {
} }
if !gLangModelCHT.isLanguageModelLoaded { if !gLangModelCHT.isLanguageModelLoaded {
NotifierController.notify( NotifierController.notify(
message: String( message: NSLocalizedString("Loading CHT Core Dict...", comment: "")
format: "%@", NSLocalizedString("Loading CHT Core Dict...", comment: "")
)
) )
loadCoreLanguageModelFile(filenameSansExtension: "data-cht", langModel: &gLangModelCHT) loadCoreLanguageModelFile(filenameSansExtension: "data-cht", langModel: &gLangModelCHT)
NotifierController.notify( NotifierController.notify(
message: String( message: NSLocalizedString("Core Dict loading complete.", comment: "")
format: "%@", NSLocalizedString("Core Dict loading complete.", comment: "")
)
) )
} }
if !gLangModelCHS.isLanguageModelLoaded { if !gLangModelCHS.isLanguageModelLoaded {
NotifierController.notify( NotifierController.notify(
message: String( message: NSLocalizedString("Loading CHS Core Dict...", comment: "")
format: "%@", NSLocalizedString("Loading CHS Core Dict...", comment: "")
)
) )
loadCoreLanguageModelFile(filenameSansExtension: "data-chs", langModel: &gLangModelCHS) loadCoreLanguageModelFile(filenameSansExtension: "data-chs", langModel: &gLangModelCHS)
NotifierController.notify( NotifierController.notify(
message: String( message: NSLocalizedString("Core Dict loading complete.", comment: "")
format: "%@", NSLocalizedString("Core Dict loading complete.", comment: "")
)
) )
} }
} }
@ -102,15 +94,11 @@ enum mgrLangModel {
} }
if !gLangModelCHS.isLanguageModelLoaded { if !gLangModelCHS.isLanguageModelLoaded {
NotifierController.notify( NotifierController.notify(
message: String( message: NSLocalizedString("Loading CHS Core Dict...", comment: "")
format: "%@", NSLocalizedString("Loading CHS Core Dict...", comment: "")
)
) )
loadCoreLanguageModelFile(filenameSansExtension: "data-chs", langModel: &gLangModelCHS) loadCoreLanguageModelFile(filenameSansExtension: "data-chs", langModel: &gLangModelCHS)
NotifierController.notify( NotifierController.notify(
message: String( message: NSLocalizedString("Core Dict loading complete.", comment: "")
format: "%@", NSLocalizedString("Core Dict loading complete.", comment: "")
)
) )
} }
} else if mode == InputMode.imeModeCHT { } else if mode == InputMode.imeModeCHT {
@ -125,15 +113,11 @@ enum mgrLangModel {
} }
if !gLangModelCHT.isLanguageModelLoaded { if !gLangModelCHT.isLanguageModelLoaded {
NotifierController.notify( NotifierController.notify(
message: String( message: NSLocalizedString("Loading CHT Core Dict...", comment: "")
format: "%@", NSLocalizedString("Loading CHT Core Dict...", comment: "")
)
) )
loadCoreLanguageModelFile(filenameSansExtension: "data-cht", langModel: &gLangModelCHT) loadCoreLanguageModelFile(filenameSansExtension: "data-cht", langModel: &gLangModelCHT)
NotifierController.notify( NotifierController.notify(
message: String( message: NSLocalizedString("Core Dict loading complete.", comment: "")
format: "%@", NSLocalizedString("Core Dict loading complete.", comment: "")
)
) )
} }
} }

View File

@ -36,9 +36,7 @@ class ctlAboutWindow: NSWindowController {
if let eulaContent = Bundle.main.localizedInfoDictionary?["CFEULAContent"] as? String { if let eulaContent = Bundle.main.localizedInfoDictionary?["CFEULAContent"] as? String {
appEULAContent.string = eulaContent appEULAContent.string = eulaContent
} }
appVersionLabel.stringValue = String( appVersionLabel.stringValue = "\(versionString) Build \(installingVersion)"
format: "%@ Build %@", versionString, installingVersion
)
} }
@IBAction func btnBugReport(_: NSButton) { @IBAction func btnBugReport(_: NSButton) {

View File

@ -100,15 +100,13 @@ class ctlPrefWindow: NSWindowController {
basicKeyboardLayoutButton.menu?.removeAllItems() basicKeyboardLayoutButton.menu?.removeAllItems()
let itmAppleZhuyinBopomofo = NSMenuItem() let itmAppleZhuyinBopomofo = NSMenuItem()
itmAppleZhuyinBopomofo.title = String( itmAppleZhuyinBopomofo.title = NSLocalizedString("Apple Zhuyin Bopomofo (Dachen)", comment: "")
format: NSLocalizedString("Apple Zhuyin Bopomofo (Dachen)", comment: ""))
itmAppleZhuyinBopomofo.representedObject = String( itmAppleZhuyinBopomofo.representedObject = String(
"com.apple.keylayout.ZhuyinBopomofo") "com.apple.keylayout.ZhuyinBopomofo")
basicKeyboardLayoutButton.menu?.addItem(itmAppleZhuyinBopomofo) basicKeyboardLayoutButton.menu?.addItem(itmAppleZhuyinBopomofo)
let itmAppleZhuyinEten = NSMenuItem() let itmAppleZhuyinEten = NSMenuItem()
itmAppleZhuyinEten.title = String( itmAppleZhuyinEten.title = NSLocalizedString("Apple Zhuyin Eten (Traditional)", comment: "")
format: NSLocalizedString("Apple Zhuyin Eten (Traditional)", comment: ""))
itmAppleZhuyinEten.representedObject = String("com.apple.keylayout.ZhuyinEten") itmAppleZhuyinEten.representedObject = String("com.apple.keylayout.ZhuyinEten")
basicKeyboardLayoutButton.menu?.addItem(itmAppleZhuyinEten) basicKeyboardLayoutButton.menu?.addItem(itmAppleZhuyinEten)

View File

@ -36,9 +36,7 @@ import Cocoa
if let eulaContent = Bundle.main.localizedInfoDictionary?["CFEULAContent"] as? String { if let eulaContent = Bundle.main.localizedInfoDictionary?["CFEULAContent"] as? String {
appEULAContent.string = eulaContent appEULAContent.string = eulaContent
} }
appVersionLabel.stringValue = String( appVersionLabel.stringValue = "\(versionString) Build \(installingVersion)"
format: "%@ Build %@", versionString, installingVersion
)
} }
@IBAction func btnWebsite(_: NSButton) { @IBAction func btnWebsite(_: NSButton) {