Renaming identifiers of sub-IMEs

This commit is contained in:
ShikiSuen 2022-01-18 11:23:27 +08:00
parent 93ee4552d5
commit 1db41fd4f6
5 changed files with 21 additions and 21 deletions

View File

@ -25,8 +25,8 @@ using namespace OpenVanilla;
static const NSInteger kMinKeyLabelSize = 10;
// input modes
static NSString *const kBopomofoModeIdentifier = @"org.atelierInmu.inputmethod.vChewing.Bopomofo";
static NSString *const kSimpBopomofoModeIdentifier = @"org.atelierInmu.inputmethod.vChewing.SimpBopomofo";
static NSString *const kBopomofoModeIdentifierCHT = @"org.atelierInmu.inputmethod.vChewing.TradBopomofo";
static NSString *const kBopomofoModeIdentifierCHS = @"org.atelierInmu.inputmethod.vChewing.SimpBopomofo";
// key code enums
enum {
@ -121,7 +121,7 @@ static double FindHighestScore(const vector<NodeAnchor>& nodes, double epsilon)
// create the composing buffer
_composingBuffer = [[NSMutableString alloc] init];
_inputMode = kBopomofoModeIdentifier;
_inputMode = kBopomofoModeIdentifierCHT;
}
return self;
@ -151,7 +151,7 @@ static double FindHighestScore(const vector<NodeAnchor>& nodes, double epsilon)
[menu addItem:[NSMenuItem separatorItem]]; // ------------------------------
if (_inputMode == kSimpBopomofoModeIdentifier) {
if (_inputMode == kBopomofoModeIdentifierCHS) {
NSMenuItem *editExcludedPhrasesItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Edit Excluded Phrases", @"") action:@selector(openExcludedPhrasesSimpBopomofo:) keyEquivalent:@""];
[menu addItem:editExcludedPhrasesItem];
}
@ -246,12 +246,12 @@ static double FindHighestScore(const vector<NodeAnchor>& nodes, double epsilon)
NSString *newInputMode;
vChewingLM *newLanguageModel;
if ([value isKindOfClass:[NSString class]] && [value isEqual:kSimpBopomofoModeIdentifier]) {
newInputMode = kSimpBopomofoModeIdentifier;
if ([value isKindOfClass:[NSString class]] && [value isEqual:kBopomofoModeIdentifierCHS]) {
newInputMode = kBopomofoModeIdentifierCHS;
newLanguageModel = [LanguageModelManager languageModelSimpBopomofo];
}
else {
newInputMode = kBopomofoModeIdentifier;
newInputMode = kBopomofoModeIdentifierCHT;
newLanguageModel = [LanguageModelManager languageModelBopomofo];
newLanguageModel->setPhraseReplacementEnabled(Preferences.phraseReplacementEnabled);
}
@ -650,7 +650,7 @@ NS_INLINE size_t max(size_t a, size_t b) { return a > b ? a : b; }
[self popOverflowComposingTextAndWalk:client];
// get user override model suggestion
string overrideValue = (_inputMode == kSimpBopomofoModeIdentifier) ? "" :
string overrideValue = (_inputMode == kBopomofoModeIdentifierCHS) ? "" :
_userOverrideModel->suggest(_walkedNodes, _builder->cursorIndex(), [[NSDate date] timeIntervalSince1970]);
if (!overrideValue.empty()) {
@ -664,7 +664,7 @@ NS_INLINE size_t max(size_t a, size_t b) { return a > b ? a : b; }
_bpmfReadingBuffer->clear();
[self updateClientComposingBuffer:client];
if (_inputMode == kSimpBopomofoModeIdentifier) {
if (_inputMode == kBopomofoModeIdentifierCHS) {
[self _showCandidateWindowUsingVerticalMode:useVerticalMode client:client];
}
@ -965,7 +965,7 @@ NS_INLINE size_t max(size_t a, size_t b) { return a > b ? a : b; }
}
[self updateClientComposingBuffer:client];
if (_inputMode == kSimpBopomofoModeIdentifier && _bpmfReadingBuffer->isEmpty()) {
if (_inputMode == kBopomofoModeIdentifierCHS && _bpmfReadingBuffer->isEmpty()) {
[self collectCandidates];
if ([_candidates count] == 1) {
[self commitComposition:client];
@ -983,14 +983,14 @@ NS_INLINE size_t max(size_t a, size_t b) { return a > b ? a : b; }
{
BOOL cancelCandidateKey =
(charCode == 27) ||
((_inputMode == kSimpBopomofoModeIdentifier) &&
((_inputMode == kBopomofoModeIdentifierCHS) &&
(charCode == 8 || keyCode == kDeleteKeyCode));
if (cancelCandidateKey) {
gCurrentCandidateController.visible = NO;
[_candidates removeAllObjects];
if (_inputMode == kSimpBopomofoModeIdentifier) {
if (_inputMode == kBopomofoModeIdentifierCHS) {
_builder->clear();
_walkedNodes.clear();
[_composingBuffer setString:@""];
@ -1147,7 +1147,7 @@ NS_INLINE size_t max(size_t a, size_t b) { return a > b ? a : b; }
}
}
if (_inputMode == kSimpBopomofoModeIdentifier) {
if (_inputMode == kBopomofoModeIdentifierCHS) {
string layout = [self _currentLayout];
string customPunctuation = string("_punctuation_") + layout + string(1, (char)charCode);
string punctuation = string("_punctuation_") + string(1, (char)charCode);
@ -1316,7 +1316,7 @@ NS_INLINE size_t max(size_t a, size_t b) { return a > b ? a : b; }
gCurrentCandidateController.keyLabels = keyLabels;
[self collectCandidates];
if (_inputMode == kSimpBopomofoModeIdentifier && [_candidates count] == 1) {
if (_inputMode == kBopomofoModeIdentifierCHS && [_candidates count] == 1) {
[self commitComposition:client];
return;
}
@ -1580,7 +1580,7 @@ NS_INLINE size_t max(size_t a, size_t b) { return a > b ? a : b; }
size_t cursorIndex = [self actualCandidateCursorIndex];
_builder->grid().fixNodeSelectedCandidate(cursorIndex, selectedValue);
if (_inputMode != kSimpBopomofoModeIdentifier) {
if (_inputMode != kBopomofoModeIdentifierCHS) {
_userOverrideModel->observe(_walkedNodes, cursorIndex, selectedValue, [[NSDate date] timeIntervalSince1970]);
}
@ -1589,7 +1589,7 @@ NS_INLINE size_t max(size_t a, size_t b) { return a > b ? a : b; }
[self walk];
[self updateClientComposingBuffer:_currentCandidateClient];
if (_inputMode == kSimpBopomofoModeIdentifier) {
if (_inputMode == kBopomofoModeIdentifierCHS) {
[self commitComposition:_currentCandidateClient];
return;
}

View File

@ -1,6 +1,6 @@
CFBundleName = "vChewing";
CFBundleDisplayName = "vChewing";
NSHumanReadableCopyright = "© 2011-2022 OpenVanilla Project & © 2021-2022 vChewing Project.";
"org.atelierInmu.inputmethod.vChewing.Bopomofo" = "vChewing-CHT";
"org.atelierInmu.inputmethod.vChewing.TradBopomofo" = "vChewing-CHT";
"org.atelierInmu.inputmethod.vChewing.SimpBopomofo" = "vChewing-CHS";
CFEULAContent = "Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n";

View File

@ -26,7 +26,7 @@
<dict>
<key>tsInputModeListKey</key>
<dict>
<key>org.atelierInmu.inputmethod.vChewing.Bopomofo</key>
<key>org.atelierInmu.inputmethod.vChewing.TradBopomofo</key>
<dict>
<key>TISDoubleSpaceSubstitution</key>
<string>。</string>
@ -85,7 +85,7 @@
</dict>
<key>tsVisibleInputModeOrderedArrayKey</key>
<array>
<string>org.atelierInmu.inputmethod.vChewing.Bopomofo</string>
<string>org.atelierInmu.inputmethod.vChewing.TradBopomofo</string>
<string>org.atelierInmu.inputmethod.vChewing.SimpBopomofo</string>
</array>
</dict>

View File

@ -1,6 +1,6 @@
CFBundleName = "威注音";
CFBundleDisplayName = "威注音";
NSHumanReadableCopyright = "© 2011-2022 OpenVanilla Project & © 2021-2022 vChewing Project.";
"org.atelierInmu.inputmethod.vChewing.Bopomofo" = "威註音";
"org.atelierInmu.inputmethod.vChewing.TradBopomofo" = "威註音";
"org.atelierInmu.inputmethod.vChewing.SimpBopomofo" = "威注音";
CFEULAContent = "该授权条款,在使用者符合以下诸条件之情形下,授予使用者使用及再散播本软件套件装原始码及二进位可执行形式之权利,无论此包装是否经改作皆然:\n\n对于本软件原始码之再散播必须保留上述之著作权宣告、此诸条件表列以及下述之免责声明。\n对于本套件二进位可执行形式之再散播必须连带以档案以及或者其他附于散播包装中之媒介方式重制上述之著作权宣告、此诸条件表列以及下述之免责声明。\n未获事前取得书面授权不得使用威注音或本软件贡献者之名称来为本软件之衍生物做任何表示支援、认可或推广、促销之行为。\n\n免责声明本软件由威注音及本软件之贡献者以现状「as is」提供本软件套件装不负任何明示或默示之担保责任包括但不限于就适售性以及特定目之之适用性为默示性担保。威注音及本软件之贡献者无论任何条件、无论成因或任何责任主义、无论此责任为因合约关系、无过失责任主义或因非违约之侵权包括过失或其他原因等而起对于任何因使用本软件套件装所产生之任何直接性、间接性、偶发性、特殊性、惩罚性或任何结果之损害包括但不限于替代商品或劳务之购用、使用损失、资料损失、利益损失、业务中断等等不负任何责任即在该种使用已获事前告知可能会造成此类损害之情形下亦然。\n";

View File

@ -1,6 +1,6 @@
CFBundleName = "威注音";
CFBundleDisplayName = "威注音";
NSHumanReadableCopyright = "© 2011-2022 OpenVanilla Project & © 2021-2022 vChewing Project.";
"org.atelierInmu.inputmethod.vChewing.Bopomofo" = "威註音";
"org.atelierInmu.inputmethod.vChewing.TradBopomofo" = "威註音";
"org.atelierInmu.inputmethod.vChewing.SimpBopomofo" = "威注音";
CFEULAContent = "該授權條款,在使用者符合以下諸條件之情形下,授予使用者使用及再散播本軟體套件裝原始碼及二進位可執行形式之權利,無論此包裝是否經改作皆然:\n\n對於本軟體原始碼之再散播必須保留上述之著作權宣告、此諸條件表列以及下述之免責聲明。\n對於本套件二進位可執行形式之再散播必須連帶以檔案以及或者其他附於散播包裝中之媒介方式重製上述之著作權宣告、此諸條件表列以及下述之免責聲明。\n未獲事前取得書面授權不得使用威注音或本軟體貢獻者之名稱來為本軟體之衍生物做任何表示支援、認可或推廣、促銷之行為。\n\n免責聲明本軟體由威注音及本軟體之貢獻者以現狀「as is」提供本軟體套件裝不負任何明示或默示之擔保責任包括但不限於就適售性以及特定目之之適用性為默示性擔保。威注音及本軟體之貢獻者無論任何條件、無論成因或任何責任主義、無論此責任為因合約關係、無過失責任主義或因非違約之侵權包括過失或其他原因等而起對於任何因使用本軟體套件裝所產生之任何直接性、間接性、偶發性、特殊性、懲罰性或任何結果之損害包括但不限於替代商品或勞務之購用、使用損失、資料損失、利益損失、業務中斷等等不負任何責任即在該種使用已獲事前告知可能會造成此類損害之情形下亦然。\n";