From 75b4bfac3127c2136682a668402f4788190720a5 Mon Sep 17 00:00:00 2001 From: Lukhnos Liu Date: Tue, 23 Nov 2021 16:44:19 -0800 Subject: [PATCH] Localize new strings Also fine-tune the Chinese Conversion menu item text. --- Source/Installer/AppDelegate.m | 13 +++++-------- Source/Installer/en.lproj/Localizable.strings | 9 +++++++++ Source/Installer/zh-Hant.lproj/Localizable.strings | 9 +++++++++ Source/en.lproj/Localizable.strings | 2 +- Source/zh-Hant.lproj/Localizable.strings | 2 +- 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/Source/Installer/AppDelegate.m b/Source/Installer/AppDelegate.m index 863b4ec0..17485951 100644 --- a/Source/Installer/AppDelegate.m +++ b/Source/Installer/AppDelegate.m @@ -191,9 +191,8 @@ void RunAlertPanel(NSString *title, NSString *message, NSString *buttonTitle) { BOOL status = [OVInputSourceHelper registerInputSource:imeBundleURL]; if (!status) { - // TODO: Localize. - NSString *message = [NSString stringWithFormat:@"Fatal error: Cannot register input source %@ at %@.", imeIdentifier, imeBundleURL.absoluteString]; - RunAlertPanel(@"Fatal Error", message, @"Abort"); + NSString *message = [NSString stringWithFormat:NSLocalizedString(@"Cannot register input source %@ at %@.", nil), imeIdentifier, imeBundleURL.absoluteString]; + RunAlertPanel(NSLocalizedString(@"Fatal Error", nil), message, NSLocalizedString(@"Abort", nil)); [self endAppWithDelay]; return; } @@ -201,9 +200,8 @@ void RunAlertPanel(NSString *title, NSString *message, NSString *buttonTitle) { inputSource = [OVInputSourceHelper inputSourceForInputSourceID:imeIdentifier]; // if it still doesn't register successfully, bail. if (!inputSource) { - // TODO: Localize. - NSString *message = [NSString stringWithFormat:@"Fatal error: Cannot find input source %@ after registration.", imeIdentifier]; - RunAlertPanel(@"Fatal Error", message, @"Abort"); + NSString *message = [NSString stringWithFormat:NSLocalizedString(@"Cannot find input source %@ after registration.", nil), imeIdentifier]; + RunAlertPanel(NSLocalizedString(@"Fatal Error", nil), message, NSLocalizedString(@"Abort", nil)); [self endAppWithDelay]; return; } @@ -237,8 +235,7 @@ void RunAlertPanel(NSString *title, NSString *message, NSString *buttonTitle) { } else { // Only prompt a warning if pre-macOS 12. The flag is not indicative of anything meaningful due to the need of user intervention in Prefernces.app on macOS 12. if (!mainInputSourceEnabled && !isMacOS12OrAbove) { - // TODO: Localize - RunAlertPanel(@"Warning", @"Input method may not be fully enabled. Please check Preferences.app.", @"Continue"); + RunAlertPanel(NSLocalizedString(@"Warning", nil), NSLocalizedString(@"Input method may not be fully enabled. Please enable it through System Preferences > Keyboard > Input Sources.", nil), NSLocalizedString(@"Continue", nil)); } else { RunAlertPanel(NSLocalizedString(@"Installation Successful", nil), NSLocalizedString(@"McBopomofo is ready to use.", nil), NSLocalizedString(@"OK", nil)); } diff --git a/Source/Installer/en.lproj/Localizable.strings b/Source/Installer/en.lproj/Localizable.strings index 048ef949..b3f28f52 100644 --- a/Source/Installer/en.lproj/Localizable.strings +++ b/Source/Installer/en.lproj/Localizable.strings @@ -28,3 +28,12 @@ "Stopping the old version. This may take up to one minute…" = "Stopping the old version. This may take up to one minute…"; "Attention" = "Attention"; "McBopomofo is upgraded, but please log out or reboot for the new version to be fully functional." = "McBopomofo is upgraded, but please log out or reboot for the new version to be fully functional."; + +"Fatal Error" = "Fatal Error"; +"Abort" = "Abort"; +"Cannot register input source %@ at %@." = "Cannot register input source %@ at %@."; +"Cannot find input source %@ after registration." = "Cannot find input source %@ after registration."; + +"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"; diff --git a/Source/Installer/zh-Hant.lproj/Localizable.strings b/Source/Installer/zh-Hant.lproj/Localizable.strings index 97a971de..5a492caa 100644 --- a/Source/Installer/zh-Hant.lproj/Localizable.strings +++ b/Source/Installer/zh-Hant.lproj/Localizable.strings @@ -28,3 +28,12 @@ "Finish" = "結束"; "Attention" = "請注意"; "McBopomofo is upgraded, but please log out or reboot for the new version to be fully functional." = "McBopomofo 安裝完成,但建議您登出或重新開機,以便順利使用新版。"; + +"Fatal Error" = "安裝錯誤"; +"Abort" = "放棄安裝"; +"Cannot register input source %@ at %@." = "無法從檔案位置 %2$@ 安裝輸入法 \"%1$@\"。"; +"Cannot find input source %@ after registration." = "在註冊完輸入法 \"%@\" 仍然無法找到輸入法。"; + +"Warning" = "安裝不完整"; +"Input method may not be fully enabled. Please enable it through System Preferences > Keyboard > Input Sources." = "輸入法已經安裝好,但可能沒有完全啟用。請從「系統偏好設定」 > 「鍵盤」 > 「輸入方式」分頁加入輸入法。"; +"Continue" = "繼續"; diff --git a/Source/en.lproj/Localizable.strings b/Source/en.lproj/Localizable.strings index 0acd9b67..4fdc110c 100644 --- a/Source/en.lproj/Localizable.strings +++ b/Source/en.lproj/Localizable.strings @@ -49,4 +49,4 @@ /* No comment provided by engineer. */ "You're currently using McBopomofo %@ (%@), a new version %@ (%@) is now available. Do you want to visit McBopomofo's website to download the version?%@" = "You're currently using McBopomofo %@ (%@), a new version %@ (%@) is now available. Do you want to visit McBopomofo's website to download the version?%@"; -"Chinese Conversion" = "Chinese Conversion"; +"Chinese Conversion" = "Convert to Simplified Chinese"; diff --git a/Source/zh-Hant.lproj/Localizable.strings b/Source/zh-Hant.lproj/Localizable.strings index 4ac965ae..e49af527 100644 --- a/Source/zh-Hant.lproj/Localizable.strings +++ b/Source/zh-Hant.lproj/Localizable.strings @@ -49,4 +49,4 @@ /* No comment provided by engineer. */ "You're currently using McBopomofo %@ (%@), a new version %@ (%@) is now available. Do you want to visit McBopomofo's website to download the version?%@" = "目前使用的小麥注音版本是 %1$@ (%2$@),網路上有更新版本 %3$@ (%4$@) 可供下載。是否要前往小麥注音網站下載新版來安裝?%5$@"; -"Chinese Conversion" = "簡繁轉換"; +"Chinese Conversion" = "輸出簡體中文";