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

將鼠鬚管就簡體輸入法與繁體輸入法分類各自分為一個輸入法副本。 #648

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 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
46 changes: 37 additions & 9 deletions Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>TISInputSourceID</key>
ShikiSuen marked this conversation as resolved.
Show resolved Hide resolved
<string>im.rime.inputmethod.Squirrel.Rime</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
Expand All @@ -24,18 +26,42 @@
<dict>
<key>tsInputModeListKey</key>
<dict>
<key>im.rime.inputmethod.Squirrel</key>
ShikiSuen marked this conversation as resolved.
Show resolved Hide resolved
<key>im.rime.inputmethod.Squirrel.Hans</key>
<dict>
<key>TISInputSourceID</key>
<string>im.rime.inputmethod.Squirrel.Rime</string>
<key>TISIntendedLanguage</key>
<string>zh</string>
<string>zh-Hans</string>
<key>tsInputModeAlternateMenuIconFileKey</key>
<string>rime.pdf</string>
<key>tsInputModeCharacterRepertoireKey</key>
<array>
<string>zh-Hans</string>
<string>zh-Hant</string>
<string>Hans</string>
<string>Han</string>
</array>
<key>tsInputModeDefaultStateKey</key>
<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.Hant</key>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm very confused. Is this an input mode, conceptually?

For your reference, mozc defined one input source per input mode:
https://github.com/google/mozc/blob/master/src/mac/Info.plist

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an input mode stating RIME's instance under the region of zh-Hant.

I know nothing about mozc. Wherever TISInputSourceID gets put, this PR will require existing users to reenable RIME, since the tsInputModeListKey of the instances are changed.

P.S.: 我沒分析過 mozc。萬一 mozc 的多副本是用諸如衛星應用等形式做背後支持的話,那將 TISInputSourceID 塞到 tsInputModeListKey 下方就還能說得過去。如果你實在不放心的話,要不要改天我問問 Apple Japan 的 mzp 老師?或者你電郵問一下 Apple Developer Relations?(Apple Developer Relations 應該更負責一些,畢竟你交了會員費。)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

另外,input mode 差分化了之後,可以在輸入法的 input controller 內依據當前不同的 input mode 做出不同的準備行為(比如威注音就是載入不同的簡繁辭庫。)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apple的代碼文檔說得比較清楚。InputMode和總體的InputMethod都要定義TISInputSourceID,也都可以缺省定義。

<dict>
<key>TISIntendedLanguage</key>
<string>zh-Hant</string>
<key>tsInputModeAlternateMenuIconFileKey</key>
<string>rime.pdf</string>
<key>tsInputModeCharacterRepertoireKey</key>
<array>
<string>Hant</string>
<string>Han</string>
</array>
<key>tsInputModeDefaultStateKey</key>
<true/>
Expand All @@ -55,7 +81,8 @@
</dict>
<key>tsVisibleInputModeOrderedArrayKey</key>
<array>
<string>im.rime.inputmethod.Squirrel.Rime</string>
ShikiSuen marked this conversation as resolved.
Show resolved Hide resolved
<string>im.rime.inputmethod.Squirrel.Hans</string>
<string>im.rime.inputmethod.Squirrel.Hant</string>
</array>
</dict>
<key>InputMethodConnectionName</key>
Expand All @@ -82,8 +109,9 @@
<true/>
<key>tsInputMethodCharacterRepertoireKey</key>
<array>
<string>zh-Hans</string>
<string>zh-Hant</string>
<string>Hans</string>
<string>Hant</string>
<string>Han</string>
</array>
<key>tsInputMethodIconFileKey</key>
<string>rime.pdf</string>
Expand Down
2 changes: 2 additions & 0 deletions en.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
NSHumanReadableCopyright = "Copyleft 2017, RIME Developers";

im.rime.inputmethod.Squirrel = "Squirrel";
im.rime.inputmethod.Squirrel.Hans = "Squirrel-Hans";
im.rime.inputmethod.Squirrel.Hant = "Squirrel-Hant";

CFBundleName = "Squirrel";
CFBundleDisplayName = "Squirrel";
2 changes: 1 addition & 1 deletion input_source.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
static NSString *const kSourceID =
@"im.rime.inputmethod.Squirrel";
ShikiSuen marked this conversation as resolved.
Show resolved Hide resolved
static NSString *const kInputModeID =
@"im.rime.inputmethod.Squirrel.Rime";
@"im.rime.inputmethod.Squirrel.Rime.Hans";
ShikiSuen marked this conversation as resolved.
Show resolved Hide resolved

void RegisterInputSource() {
CFURLRef installedLocationURL = CFURLCreateFromFileSystemRepresentation(
Expand Down
2 changes: 2 additions & 0 deletions zh-Hans.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
NSHumanReadableCopyright = "Copyleft 2017, 式恕堂";

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

CFBundleName = "鼠须管";
CFBundleDisplayName = "鼠须管";
2 changes: 2 additions & 0 deletions zh-Hant.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
NSHumanReadableCopyright = "Copyleft 2017, 式恕堂";

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

CFBundleName = "鼠鬚管";
CFBundleDisplayName = "鼠鬚管";