Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register squirrel into Cantonese #696

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@
<action selector="syncUserData:" target="252" id="806"/>
</connections>
</menuItem>
<menuItem title="Settings..." id="802">
<menuItem title="Settings" id="802">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="configure:" target="252" id="803"/>
</connections>
</menuItem>
<menuItem title="Rime Wiki..." tag="2" id="797">
<menuItem title="Rime Wiki" tag="2" id="797">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="openWiki:" target="252" id="798"/>
</connections>
</menuItem>
<menuItem title="Check for updates..." tag="1" id="776">
<menuItem title="Check for updates" tag="1" id="776">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="checkForUpdates:" target="772" id="796"/>
Expand Down
31 changes: 30 additions & 1 deletion Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,33 @@
<string>Hans</string>
</array>
<key>tsInputModeDefaultStateKey</key>
<false/>
<true/>
<key>tsInputModeIsVisibleKey</key>
<true/>
<key>tsInputModeKeyEquivalentModifiersKey</key>
<integer>4608</integer>
<key>tsInputModeMenuIconFileKey</key>
<string>rime.pdf</string>
<key>tsInputModePaletteIconFileKey</key>
<string>rime.pdf</string>
<key>tsInputModePrimaryInScriptKey</key>
<true/>
<key>tsInputModeScriptKey</key>
<string>smUnicodeScript</string>
</dict>
<key>im.rime.inputmethod.Squirrel.Cant</key>
<dict>
<key>TISInputSourceID</key>
<string>im.rime.inputmethod.Squirrel.Cant</string>
<key>TISIntendedLanguage</key>
<string>yue-Hant</string>
<key>tsInputModeCharacterRepertoireKey</key>
<array>
<string>Hant</string>
<string>Hans</string>
</array>
<key>tsInputModeDefaultStateKey</key>
<true/>
<key>tsInputModeIsVisibleKey</key>
<true/>
<key>tsInputModeKeyEquivalentModifiersKey</key>
Expand All @@ -85,6 +111,7 @@
<array>
<string>im.rime.inputmethod.Squirrel.Hans</string>
<string>im.rime.inputmethod.Squirrel.Hant</string>
<string>im.rime.inputmethod.Squirrel.Cant</string>
</array>
</dict>
<key>InputMethodConnectionName</key>
Expand All @@ -109,5 +136,7 @@
<string>dsa_pub.pem</string>
<key>TICapsLockLanguageSwitchCapable</key>
<true/>
<key>tsInputMethodIconFileKey</key>
<string>rime.pdf</string>
</dict>
</plist>
7 changes: 7 additions & 0 deletions Squirrel.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@
A4FC48CA0F6530EF0069BE81 /* en */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
D26434542706A15100857391 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
E93074B60A5C264700470842 /* InputMethodKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = InputMethodKit.framework; path = /System/Library/Frameworks/InputMethodKit.framework; sourceTree = "<absolute>"; };
F4A90994297F63AE00D9F520 /* zh-HK */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-HK"; path = "zh-HK.lproj/Localizable.strings"; sourceTree = "<group>"; };
F4A90995297F63AE00D9F520 /* zh-HK */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-HK"; path = "zh-HK.lproj/InfoPlist.strings"; sourceTree = "<group>"; };
F4A90996297F63AE00D9F520 /* zh-HK */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "zh-HK"; path = "zh-HK.lproj/MainMenu.xib"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -515,6 +518,7 @@
en,
"zh-Hans",
"zh-Hant",
"zh-HK",
Base,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* Squirrel */;
Expand Down Expand Up @@ -570,6 +574,7 @@
089C165DFE840E0CC02AAC07 /* en */,
446D18E014F0191200EC3116 /* zh-Hans */,
446D18E114F0193100EC3116 /* zh-Hant */,
F4A90995297F63AE00D9F520 /* zh-HK */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
Expand All @@ -579,6 +584,7 @@
children = (
44DA191A152B8CB600FB8EF0 /* zh-Hans */,
44DA191B152B8CBC00FB8EF0 /* zh-Hant */,
F4A90996297F63AE00D9F520 /* zh-HK */,
44CB5E872585EFAE0022654F /* Base */,
);
name = MainMenu.xib;
Expand All @@ -590,6 +596,7 @@
A4FC48CA0F6530EF0069BE81 /* en */,
44FA4D891685997300116C1F /* zh-Hans */,
44FA4D8E16859B2900116C1F /* zh-Hant */,
F4A90994297F63AE00D9F520 /* zh-HK */,
);
name = Localizable.strings;
sourceTree = "<group>";
Expand Down
2 changes: 1 addition & 1 deletion en.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Localized versions of Info.plist keys */

NSHumanReadableCopyright = "Copyleft, RIME Developers";
NSHumanReadableCopyright = "Copyleft 🄯 RIME Developers";

im.rime.inputmethod.Squirrel = "Squirrel";
im.rime.inputmethod.Squirrel.Hans = "Squirrel - Simplified";
Expand Down
19 changes: 7 additions & 12 deletions en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
"Squirrel" = "Squirrel";

"deploy_update" = "Deploying Rime for updates.";
"deploy_start" = "Deploying Rime input method engine.";
"deploy_update" = "Deploying Rime for updates";
"deploy_start" = "Deploying Rime input method engine";
"deploy_success" = "Squirrel is ready.";
"deploy_failure" = "Error occurred. See log file $TMPDIR/rime.squirrel.INFO.";
"ascii_mode" = "A";
"!ascii_mode" = "中";
"full_shape" = "Full shape";
"!full_shape" = "Half shape";
"ascii_punct" = ".,";
"!ascii_punct" = "。,";
"simplification" = "Simplified";
"!simplification" = "Traditional";
"extended_charset" = "CJK extended";
"!extended_charset" = "CJK baseset";

"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";
13 changes: 10 additions & 3 deletions input_source.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
@"im.rime.inputmethod.Squirrel.Hans";
static NSString *const kHantInputModeID =
@"im.rime.inputmethod.Squirrel.Hant";
static NSString *const kCantInputModeID =
@"im.rime.inputmethod.Squirrel.Cant";

#define HANS_INPUT_MODE (1 << 0)
#define HANT_INPUT_MODE (1 << 1)
#define CANT_INPUT_MODE (1 << 2)

void RegisterInputSource(void) {
CFURLRef installedLocationURL = CFURLCreateFromFileSystemRepresentation(
Expand All @@ -31,7 +34,9 @@ void ActivateInputSource(int enabled_modes) {
if (([sourceID isEqualToString:kHansInputModeID] &&
((enabled_modes & HANS_INPUT_MODE) != 0)) ||
([sourceID isEqualToString:kHantInputModeID] &&
((enabled_modes & HANT_INPUT_MODE) != 0))) {
((enabled_modes & HANT_INPUT_MODE) != 0)) ||
([sourceID isEqualToString:kCantInputModeID] &&
((enabled_modes & CANT_INPUT_MODE) != 0))) {
TISEnableInputSource(inputSource);
NSLog(@"Enabled input source: %@", sourceID);
CFBooleanRef isSelectable = (CFBooleanRef)TISGetInputSourceProperty(
Expand All @@ -54,7 +59,8 @@ void DeactivateInputSource(void) {
inputSource, kTISPropertyInputSourceID));
//NSLog(@"Examining input source: %@", sourceID);
if ([sourceID isEqualToString:kHansInputModeID] ||
[sourceID isEqualToString:kHantInputModeID]) {
[sourceID isEqualToString:kHantInputModeID] ||
[sourceID isEqualToString:kCantInputModeID]) {
CFBooleanRef isEnabled = (CFBooleanRef)(TISGetInputSourceProperty(
inputSource, kTISPropertyInputSourceIsEnabled));
if (CFBooleanGetValue(isEnabled)) {
Expand All @@ -76,7 +82,8 @@ int GetEnabledInputModes(void) {
inputSource, kTISPropertyInputSourceID));
//NSLog(@"Examining input source: %@", sourceID);
if ([sourceID isEqualToString:kHansInputModeID] ||
[sourceID isEqualToString:kHantInputModeID]) {
[sourceID isEqualToString:kHantInputModeID] ||
[sourceID isEqualToString:kCantInputModeID]) {
CFBooleanRef isEnabled = (CFBooleanRef)(TISGetInputSourceProperty(
inputSource, kTISPropertyInputSourceIsEnabled));
if (CFBooleanGetValue(isEnabled)) {
Expand Down
10 changes: 4 additions & 6 deletions main.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
11 changes: 11 additions & 0 deletions zh-HK.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* Localized versions of Info.plist keys */

NSHumanReadableCopyright = "式恕堂🄯版權所無";

im.rime.inputmethod.Squirrel = "鼠鬚筆";
im.rime.inputmethod.Squirrel.Hans = "鼠须管";
im.rime.inputmethod.Squirrel.Hant = "鼠鬚管";
im.rime.inputmethod.Squirrel.Cant = "鼠鬚筆";

CFBundleName = "鼠鬚筆";
CFBundleDisplayName = "鼠鬚筆";
18 changes: 18 additions & 0 deletions zh-HK.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
Localizable.strings
Squirrel

Created by 弓辰 on 12/12/22.

*/
"Squirrel" = "鼠鬚筆";

"deploy_update" = "更新輸入法引擎⋯";
"deploy_start" = "部署輸入法引擎⋯";
"deploy_success" = "部署完成。";
"deploy_failure" = "有錯誤!請查看日誌 $TMPDIR/rime.squirrel.INFO";

"problematic_launch" = "啟動時偵測到錯誤!\
「鼠鬚筆」可能由於設定不當而崩潰。\
請嘗試回退先前的改動,然後查看問題是否仍然存在。";
"say_voice" = "Sinji";
59 changes: 59 additions & 0 deletions zh-HK.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="12121"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
<connections>
<outlet property="delegate" destination="252" id="253"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application"/>
<customObject id="252" userLabel="SquirrelApplicationDelegate" customClass="SquirrelApplicationDelegate">
<connections>
<outlet property="_menu" destination="773" id="779"/>
<outlet property="_panel" destination="770" id="771"/>
<outlet property="_updater" destination="772" id="794"/>
</connections>
</customObject>
<customObject id="770" userLabel="SquirrelPanel" customClass="SquirrelPanel"/>
<menu id="773" userLabel="Menu">
<items>
<menuItem title="重新部署" keyEquivalent="`" id="774">
<modifierMask key="keyEquivalentModifierMask" control="YES" option="YES"/>
<connections>
<action selector="deploy:" target="252" id="795"/>
</connections>
</menuItem>
<menuItem title="同步用户資料" id="803">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="syncUserData:" target="252" id="805"/>
</connections>
</menuItem>
<menuItem title="用户設定⋯" id="799">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="configure:" target="252" id="800"/>
</connections>
</menuItem>
<menuItem title="線上輔助説明⋯" tag="2" id="797">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="openWiki:" target="252" id="798"/>
</connections>
</menuItem>
<menuItem title="檢查更新項目⋯" tag="1" id="776">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="checkForUpdates:" target="772" id="796"/>
</connections>
</menuItem>
</items>
</menu>
<customObject id="772" userLabel="Updater" customClass="SUUpdater"/>
</objects>
</document>
3 changes: 2 additions & 1 deletion zh-Hans.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/* Localized versions of Info.plist keys */

NSHumanReadableCopyright = "式恕堂 版权所无";
NSHumanReadableCopyright = "式恕堂🄯版权所无";

im.rime.inputmethod.Squirrel = "鼠须管";
im.rime.inputmethod.Squirrel.Hans = "鼠须管";
im.rime.inputmethod.Squirrel.Hant = "鼠鬚管";
im.rime.inputmethod.Squirrel.Cant = "鼠鬚筆";

CFBundleName = "鼠须管";
CFBundleDisplayName = "鼠须管";
15 changes: 5 additions & 10 deletions zh-Hans.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,8 @@
"deploy_start" = "部署输入法引擎…";
"deploy_success" = "部署完成。";
"deploy_failure" = "有错误!请查看日志 $TMPDIR/rime.squirrel.INFO";
"ascii_mode" = "A";
"!ascii_mode" = "中";
"full_shape" = "全角";
"!full_shape" = "半角";
"ascii_punct" = ".,";
"!ascii_punct" = "。,";
"simplification" = "汉字";
"!simplification" = "漢字";
"extended_charset" = "增广";
"!extended_charset" = "通用";

"problematic_launch" = "检测到启动有问题!\
“鼠须管”可能因错误设置而崩溃。\
请尝试撤销之前的修改,然后查看问题是否仍旧存在。";
"say_voice" = "TingTing";
6 changes: 3 additions & 3 deletions zh-Hans.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@
<action selector="syncUserData:" target="252" id="804"/>
</connections>
</menuItem>
<menuItem title="用户设定..." id="799">
<menuItem title="用户设置…" id="799">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="configure:" target="252" id="800"/>
</connections>
</menuItem>
<menuItem title="在线文档..." tag="2" id="797">
<menuItem title="在线帮助…" tag="2" id="797">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="openWiki:" target="252" id="798"/>
</connections>
</menuItem>
<menuItem title="检查新版本..." tag="1" id="776">
<menuItem title="检查更新…" tag="1" id="776">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="checkForUpdates:" target="772" id="796"/>
Expand Down
3 changes: 2 additions & 1 deletion zh-Hant.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/* Localized versions of Info.plist keys */

NSHumanReadableCopyright = "式恕堂 版權所無";
NSHumanReadableCopyright = "式恕堂🄯版權所無";

im.rime.inputmethod.Squirrel = "鼠鬚管";
im.rime.inputmethod.Squirrel.Hans = "鼠须管";
im.rime.inputmethod.Squirrel.Hant = "鼠鬚管";
im.rime.inputmethod.Squirrel.Cant = "鼠鬚筆";

CFBundleName = "鼠鬚管";
CFBundleDisplayName = "鼠鬚管";
19 changes: 7 additions & 12 deletions zh-Hant.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,12 @@
*/
"Squirrel" = "鼠鬚管";

"deploy_update" = "更新輸入法引擎";
"deploy_start" = "部署輸入法引擎";
"deploy_update" = "更新輸入法引擎";
"deploy_start" = "部署輸入法引擎";
"deploy_success" = "部署完成。";
"deploy_failure" = "有錯誤!請查看日誌 $TMPDIR/rime.squirrel.INFO";
"ascii_mode" = "A";
groverlynn marked this conversation as resolved.
Show resolved Hide resolved
"!ascii_mode" = "中";
"full_shape" = "全角";
"!full_shape" = "半角";
"ascii_punct" = ".,";
"!ascii_punct" = "。,";
"simplification" = "汉字";
"!simplification" = "漢字";
"extended_charset" = "增廣";
"!extended_charset" = "通用";

"problematic_launch" = "啟動時偵測到問題!\
「鼠鬚管」可能因設定不當而崩潰。\
請嘗試回退先前的修改,然後查看問題是否依然存在。";
"say_voice" = "MeiJia";
Loading