From c91bc8e76a5f64c5880834503545817f23dda972 Mon Sep 17 00:00:00 2001 From: groverlynn Date: Tue, 3 Oct 2023 07:00:09 +0200 Subject: [PATCH] say ZH voices --- en.lproj/Localizable.strings | 5 +++++ main.m | 10 ++++------ zh-HK.lproj/Localizable.strings | 5 +++++ zh-Hans.lproj/Localizable.strings | 5 +++++ zh-Hant.lproj/Localizable.strings | 5 +++++ 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/en.lproj/Localizable.strings b/en.lproj/Localizable.strings index 02184186b..f18edf7fd 100644 --- a/en.lproj/Localizable.strings +++ b/en.lproj/Localizable.strings @@ -4,3 +4,8 @@ "deploy_start" = "Deploying Rime input method engine…"; "deploy_success" = "Squirrel is ready."; "deploy_failure" = "Error occurred. See log file $TMPDIR/rime.squirrel.INFO."; + +"problematic_launch" = "Problematic launch detected! \ + Squirrel may be suffering a crash due to imporper configuration. \ + Revert previous modifications to see if the problem recurs."; +"say_voice" = "Alex"; diff --git a/main.m b/main.m index 2a1a556f3..55a7703a2 100644 --- a/main.m +++ b/main.m @@ -78,12 +78,10 @@ int main(int argc, char *argv[]) { if (NSApp.squirrelAppDelegate.problematicLaunchDetected) { NSLog(@"Problematic launch detected!"); - NSArray *args = @[ - @"Problematic launch detected! \ - Squirrel may be suffering a crash due to imporper configuration. \ - Revert previous modifications to see if the problem recurs." - ]; - [NSTask launchedTaskWithLaunchPath:@"/usr/bin/say" arguments:args]; + NSArray *args = @[@"-v", NSLocalizedString(@"say_voice", nil), + NSLocalizedString(@"problematic_launch", nil)]; + [NSTask launchedTaskWithExecutableURL:[[NSURL alloc] initFileURLWithPath:@"/usr/bin/say"] + arguments:args error:nil terminationHandler:nil]; } else { [NSApp.squirrelAppDelegate setupRime]; [NSApp.squirrelAppDelegate startRimeWithFullCheck:NO]; diff --git a/zh-HK.lproj/Localizable.strings b/zh-HK.lproj/Localizable.strings index 7d9d8c7e2..89b943f52 100644 --- a/zh-HK.lproj/Localizable.strings +++ b/zh-HK.lproj/Localizable.strings @@ -11,3 +11,8 @@ "deploy_start" = "部署輸入法引擎⋯"; "deploy_success" = "部署完成。"; "deploy_failure" = "有錯誤!請查看日誌 $TMPDIR/rime.squirrel.INFO"; + +"problematic_launch" = "啟動時偵測到錯誤!\ + 「鼠鬚筆」可能由於設定不當而崩潰。\ + 請嘗試回退先前的改動,然後查看問題是否仍然存在。"; +"say_voice" = "Sinji"; diff --git a/zh-Hans.lproj/Localizable.strings b/zh-Hans.lproj/Localizable.strings index b1b90801a..26a54a014 100644 --- a/zh-Hans.lproj/Localizable.strings +++ b/zh-Hans.lproj/Localizable.strings @@ -11,3 +11,8 @@ "deploy_start" = "部署输入法引擎…"; "deploy_success" = "部署完成。"; "deploy_failure" = "有错误!请查看日志 $TMPDIR/rime.squirrel.INFO"; + +"problematic_launch" = "检测到启动有问题!\ + “鼠须管”可能因错误设置而崩溃。\ + 请尝试撤销之前的修改,然后查看问题是否仍旧存在。"; +"say_voice" = "TingTing"; diff --git a/zh-Hant.lproj/Localizable.strings b/zh-Hant.lproj/Localizable.strings index 80748bebf..b51f6b7ea 100644 --- a/zh-Hant.lproj/Localizable.strings +++ b/zh-Hant.lproj/Localizable.strings @@ -11,3 +11,8 @@ "deploy_start" = "部署輸入法引擎⋯"; "deploy_success" = "部署完成。"; "deploy_failure" = "有錯誤!請查看日誌 $TMPDIR/rime.squirrel.INFO"; + +"problematic_launch" = "啟動時偵測到問題!\ + 「鼠鬚管」可能因設定不當而崩潰。\ + 請嘗試回退先前的修改,然後查看問題是否依然存在。"; +"say_voice" = "MeiJia";