From c4958799adc87df26869db3ad701e4a27c32913f Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Tue, 1 Feb 2022 20:06:23 +0800 Subject: [PATCH] Shiki: Installer // Tweaks in AlertPanel and Japanese Localization. - The word "Warning" requires careful translation in Japanese since native Japanese users are sensitive to the choice of words. --- Source/Installer/AppDelegate.swift | 21 +++++++++++++------ Source/Installer/ja.lproj/Localizable.strings | 2 +- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Source/Installer/AppDelegate.swift b/Source/Installer/AppDelegate.swift index f4b08791..ed2e0fa6 100644 --- a/Source/Installer/AppDelegate.swift +++ b/Source/Installer/AppDelegate.swift @@ -228,18 +228,27 @@ class AppDelegate: NSWindowController, NSApplicationDelegate { NSLog("Failed to enable input method: \(imeIdentifier)"); } } - + + // Alert Panel + let ntfPostInstall = NSAlert() if warning { - runAlertPanel(title: NSLocalizedString("Attention", comment: ""), message: NSLocalizedString("vChewing is upgraded, but please log out or reboot for the new version to be fully functional.", comment: ""), buttonTitle: NSLocalizedString("OK", comment: "")) + ntfPostInstall.messageText = NSLocalizedString("Attention", comment: "") + ntfPostInstall.informativeText = NSLocalizedString("vChewing is upgraded, but please log out or reboot for the new version to be fully functional.", comment: "") + ntfPostInstall.addButton(withTitle: NSLocalizedString("OK", comment: "")) } else { if !mainInputSourceEnabled && !isMacOS12OrAbove { - runAlertPanel(title: NSLocalizedString("Warning", comment: ""), message: NSLocalizedString("Input method may not be fully enabled. Please enable it through System Preferences > Keyboard > Input Sources.", comment: ""), buttonTitle: NSLocalizedString("Continue", comment: "")) + ntfPostInstall.messageText = NSLocalizedString("Warning", comment: "") + ntfPostInstall.informativeText = NSLocalizedString("Input method may not be fully enabled. Please enable it through System Preferences > Keyboard > Input Sources.", comment: "") + ntfPostInstall.addButton(withTitle: NSLocalizedString("Continue", comment: "")) } else { - runAlertPanel(title: NSLocalizedString("Installation Successful", comment: ""), message: NSLocalizedString("vChewing is ready to use.", comment: ""), buttonTitle: NSLocalizedString("OK", comment: "")) + ntfPostInstall.messageText = NSLocalizedString("Installation Successful", comment: "") + ntfPostInstall.informativeText = NSLocalizedString("vChewing is ready to use.", comment: "") + ntfPostInstall.addButton(withTitle: NSLocalizedString("OK", comment: "")) } } - - endAppWithDelay() + ntfPostInstall.beginSheetModal(for: window!) { response in + self.endAppWithDelay() + } } func endAppWithDelay() { diff --git a/Source/Installer/ja.lproj/Localizable.strings b/Source/Installer/ja.lproj/Localizable.strings index 44d4c467..bbb3011e 100644 --- a/Source/Installer/ja.lproj/Localizable.strings +++ b/Source/Installer/ja.lproj/Localizable.strings @@ -13,6 +13,6 @@ "Abort" = "中止"; "Cannot register input source %@ at %@." = "「%2$@」で入力アプリ「\"%1$@\"」の実装は失敗しました。"; "Cannot find input source %@ after registration." = "登録済みですが「%@」は見つけませんでした。"; -"Warning" = "警告"; +"Warning" = "お知らせ"; "Input method may not be fully enabled. Please enable it through System Preferences > Keyboard > Input Sources." = "入力アプリの自動起動はうまく出来なかったかもしれません。ご自分で「システム環境設定→キーボード→入力ソース」で起動してください。"; "Continue" = "続行";