From 5a62eea6fb68d9f911175cc22189221f5f8ac88f Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Fri, 8 Jul 2022 22:14:05 +0800 Subject: [PATCH 01/20] KeyHandler // Simplify findHighestScore(). --- .../Modules/ControllerModules/KeyHandler_Core.swift | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Source/Modules/ControllerModules/KeyHandler_Core.swift b/Source/Modules/ControllerModules/KeyHandler_Core.swift index 5b3786e2..2331b7ae 100644 --- a/Source/Modules/ControllerModules/KeyHandler_Core.swift +++ b/Source/Modules/ControllerModules/KeyHandler_Core.swift @@ -294,7 +294,7 @@ class KeyHandler { compositor.grid.overrideNodeScoreForSelectedCandidate( location: min(actualCandidateCursorIndex + (mgrPrefs.useRearCursorMode ? 1 : 0), compositorLength), value: overrideValue, - overridingScore: findHighestScore(nodes: rawAnchorsOfNodes, epsilon: kEpsilon) + overridingScore: findHighestScore(nodeAnchors: rawAnchorsOfNodes, epsilon: kEpsilon) ) } else { IME.prtDebugIntel("UOM: Blank suggestion retrieved, dismissing.") @@ -306,14 +306,8 @@ class KeyHandler { /// - nodes: 給定的節錨陣列。 /// - epsilon: 半衰模組的衰減指數。 /// - Returns: 尋獲的最高權重數值。 - func findHighestScore(nodes: [Megrez.NodeAnchor], epsilon: Double) -> Double { - var highestScore: Double = 0 - for currentAnchor in nodes { - if let theNode = currentAnchor.node { - highestScore = max(theNode.highestUnigramScore, highestScore) - } - } - return highestScore + epsilon + func findHighestScore(nodeAnchors: [Megrez.NodeAnchor], epsilon: Double) -> Double { + return nodeAnchors.compactMap(\.node?.highestUnigramScore).max() ?? 0 + epsilon } // MARK: - Extracted methods and functions (Tekkon). From 1eae81986fd3f2ba9f2a5deb0ff1b64023db1241 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Sat, 9 Jul 2022 18:57:34 +0800 Subject: [PATCH 02/20] Tekkon // v1.2.4 update. --- .../ControllerModules/SyllableComposer.swift | 50 +++++++++++++++---- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/Source/Modules/ControllerModules/SyllableComposer.swift b/Source/Modules/ControllerModules/SyllableComposer.swift index 5807d6d3..d76d4636 100644 --- a/Source/Modules/ControllerModules/SyllableComposer.swift +++ b/Source/Modules/ControllerModules/SyllableComposer.swift @@ -236,18 +236,11 @@ public struct Tekkon { public func getComposition(isHanyuPinyin: Bool = false, isTextBookStyle: Bool = false) -> String { switch isHanyuPinyin { case false: // 注音輸出的場合 - var valReturnZhuyin = value.replacingOccurrences(of: " ", with: "") - if isTextBookStyle, valReturnZhuyin.contains("˙") { - valReturnZhuyin = String(valReturnZhuyin.dropLast()) - valReturnZhuyin.insert("˙", at: valReturnZhuyin.startIndex) - } - return valReturnZhuyin + let valReturnZhuyin = value.replacingOccurrences(of: " ", with: "") + return isTextBookStyle ? cnvZhuyinChainToTextbookReading(target: valReturnZhuyin) : valReturnZhuyin case true: // 拼音輸出的場合 - var valReturnPinyin = Tekkon.cnvPhonaToHanyuPinyin(target: value) - if isTextBookStyle { - valReturnPinyin = Tekkon.cnvHanyuPinyinToTextbookStyle(target: valReturnPinyin) - } - return valReturnPinyin + let valReturnPinyin = Tekkon.cnvPhonaToHanyuPinyin(target: value) + return isTextBookStyle ? Tekkon.cnvHanyuPinyinToTextbookStyle(target: valReturnPinyin) : valReturnPinyin } } @@ -852,6 +845,41 @@ public struct Tekkon { return targetConverted } + /// 該函式負責將注音轉為教科書印刷的方式(先寫輕聲)。 + /// - Parameters: + /// - target: 要拿來做轉換處理的讀音鏈,以英文減號來分隔每個讀音。 + /// - newSeparator: 新的讀音分隔符。 + /// - Returns: 經過轉換處理的讀音鏈。 + static func cnvZhuyinChainToTextbookReading(target: String, newSeparator: String = "-") -> String { + var arrReturn: [String] = [] + for neta in target.split(separator: "-") { + var newString = String(neta) + if String(neta.reversed()[0]) == "˙" { + newString = String(neta.dropLast()) + newString.insert("˙", at: newString.startIndex) + } + arrReturn.append(newString) + } + return arrReturn.joined(separator: newSeparator) + } + + /// 該函式用來恢復注音當中的陰平聲調,恢復之後會以「1」表示陰平。 + /// - Parameters: + /// - target: 要拿來做轉換處理的讀音鏈,以英文減號來分隔每個讀音。 + /// - newSeparator: 新的讀音分隔符。 + /// - Returns: 經過轉換處理的讀音鏈。 + static func restoreToneOneInZhuyinKey(target: String, newSeparator: String = "-") -> String { + var arrReturn: [String] = [] + for neta in target.split(separator: "-") { + var newNeta = String(neta) + if !"ˊˇˋ˙".contains(String(neta.reversed()[0])), !neta.contains("_") { + newNeta += "1" + } + arrReturn.append(newNeta) + } + return arrReturn.joined(separator: newSeparator) + } + /// 原始轉換對照表資料貯存專用佇列(數字標調格式) static let arrPhonaToHanyuPinyin = [ // 排序很重要。先處理最長的,再處理短的。不然會出亂子。 [" ", "1"], ["ˊ", "2"], ["ˇ", "3"], ["ˋ", "4"], ["˙", "5"], From e681c2e31ba37c042d5647d51cfebcee79a11ae6 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Sat, 9 Jul 2022 10:15:21 +0800 Subject: [PATCH 03/20] KeyHandler // Comment fix. --- Source/Modules/ControllerModules/KeyHandler_Core.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Modules/ControllerModules/KeyHandler_Core.swift b/Source/Modules/ControllerModules/KeyHandler_Core.swift index 2331b7ae..751e4005 100644 --- a/Source/Modules/ControllerModules/KeyHandler_Core.swift +++ b/Source/Modules/ControllerModules/KeyHandler_Core.swift @@ -190,8 +190,8 @@ class KeyHandler { } if addToUserOverrideModel { IME.prtDebugIntel("UOM: Start Observation.") - // 令半衰記憶模組觀測給定的 trigram。 - // 這個過程會讓半衰引擎根據當前上下文生成 trigram 索引鍵。 + // 令半衰記憶模組觀測給定的三元圖。 + // 這個過程會讓半衰引擎根據當前上下文生成三元圖索引鍵。 currentUOM.observe( walkedAnchors: walkedAnchors, cursorIndex: cursorIndex, candidate: value, timestamp: NSDate().timeIntervalSince1970 @@ -284,7 +284,7 @@ class KeyHandler { if mgrPrefs.useSCPCTypingMode { return } /// 如果這個開關沒打開的話,直接放棄執行這個函式。 if !mgrPrefs.fetchSuggestionsFromUserOverrideModel { return } - /// 先就當前上下文讓半衰引擎重新生成 trigram 索引鍵。 + /// 先就當前上下文讓半衰引擎重新生成三元圖索引鍵。 let overrideValue = fetchSuggestedCandidates().first?.keyValue.value ?? "" /// 再拿著索引鍵去問半衰模組有沒有選字建議。有的話就遵循之、讓天權星引擎對指定節錨下的節點複寫權重。 From f8086500a0737c49267cb460686a4ff8ab938da5 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Sat, 9 Jul 2022 10:24:15 +0800 Subject: [PATCH 04/20] KeyHandler // Implement Alt+Fwd/Bwd support. --- .../ControllerModules/KeyHandler_Core.swift | 24 +++++++++++++++---- .../ControllerModules/KeyHandler_States.swift | 21 ++++++++++++++++ 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/Source/Modules/ControllerModules/KeyHandler_Core.swift b/Source/Modules/ControllerModules/KeyHandler_Core.swift index 751e4005..0cdf9c6a 100644 --- a/Source/Modules/ControllerModules/KeyHandler_Core.swift +++ b/Source/Modules/ControllerModules/KeyHandler_Core.swift @@ -166,10 +166,10 @@ class KeyHandler { /// - value: 給定之候選字字串。 /// - respectCursorPushing: 若該選項為 true,則會在選字之後始終將游標推送至選字厚的節錨的前方。 func fixNode(value: String, respectCursorPushing: Bool = true) { - let cursorIndex = min(actualCandidateCursorIndex + (mgrPrefs.useRearCursorMode ? 1 : 0), compositorLength) + let adjustedIndex = max(0, min(actualCandidateCursorIndex + (mgrPrefs.useRearCursorMode ? 1 : 0), compositorLength)) // 開始讓半衰模組觀察目前的狀況。 let selectedNode: Megrez.NodeAnchor = compositor.grid.fixNodeSelectedCandidate( - location: cursorIndex, value: value + location: adjustedIndex, value: value ) // 不要針對逐字選字模式啟用臨時半衰記憶模型。 if !mgrPrefs.useSCPCTypingMode { @@ -193,7 +193,7 @@ class KeyHandler { // 令半衰記憶模組觀測給定的三元圖。 // 這個過程會讓半衰引擎根據當前上下文生成三元圖索引鍵。 currentUOM.observe( - walkedAnchors: walkedAnchors, cursorIndex: cursorIndex, candidate: value, + walkedAnchors: walkedAnchors, cursorIndex: adjustedIndex, candidate: value, timestamp: NSDate().timeIntervalSince1970 ) } @@ -206,7 +206,7 @@ class KeyHandler { if mgrPrefs.moveCursorAfterSelectingCandidate, respectCursorPushing { var nextPosition = 0 for theAnchor in walkedAnchors { - if nextPosition >= cursorIndex { break } + if nextPosition >= adjustedIndex { break } nextPosition += theAnchor.spanningLength } if nextPosition <= compositorLength { @@ -452,4 +452,20 @@ class KeyHandler { func deleteCompositorReadingToTheFrontOfCursor() { compositor.deleteReadingToTheFrontOfCursor() } + + /// 獲取指定游標位置的鍵值長度。 + /// - Returns: 指定游標位置的鍵值長度。 + var keyLengthAtCurrentIndex: Int { + guard let node = walkedAnchors[compositorCursorIndex].node else { return 0 } + return node.key.split(separator: "-").count + } + + var nextPhrasePosition: Int { + var nextPosition = 0 + for theAnchor in walkedAnchors { + if nextPosition > actualCandidateCursorIndex { break } + nextPosition += theAnchor.spanningLength + } + return min(nextPosition, compositorLength) + } } diff --git a/Source/Modules/ControllerModules/KeyHandler_States.swift b/Source/Modules/ControllerModules/KeyHandler_States.swift index b84fad5a..c8334146 100644 --- a/Source/Modules/ControllerModules/KeyHandler_States.swift +++ b/Source/Modules/ControllerModules/KeyHandler_States.swift @@ -651,6 +651,15 @@ extension KeyHandler { errorCallback() stateCallback(state) } + } else if input.isOptionHold { + if compositorCursorIndex < compositorLength { + compositorCursorIndex = nextPhrasePosition + stateCallback(buildInputtingState) + } else { + IME.prtDebugIntel("33C3B580") + errorCallback() + stateCallback(state) + } } else { if compositorCursorIndex < compositorLength { compositorCursorIndex += 1 @@ -707,6 +716,18 @@ extension KeyHandler { errorCallback() stateCallback(state) } + } else if input.isOptionHold { + if compositorCursorIndex > 1 { + compositorCursorIndex -= 2 + stateCallback(buildInputtingState) + } else if compositorCursorIndex == 1 { + compositorCursorIndex = 0 + stateCallback(buildInputtingState) + } else { + IME.prtDebugIntel("8D50DD9E") + errorCallback() + stateCallback(state) + } } else { if compositorCursorIndex > 0 { compositorCursorIndex -= 1 From 9a369a71cc5888f0e4845e87f555857c70547f43 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Sat, 9 Jul 2022 12:41:41 +0800 Subject: [PATCH 05/20] KeyHandler // Ensure textbook reading display in tooltip. --- .../ControllerModules/KeyHandler_Core.swift | 35 ------------------- .../ControllerModules/KeyHandler_States.swift | 18 ++++++++-- 2 files changed, 15 insertions(+), 38 deletions(-) diff --git a/Source/Modules/ControllerModules/KeyHandler_Core.swift b/Source/Modules/ControllerModules/KeyHandler_Core.swift index 0cdf9c6a..28c1d288 100644 --- a/Source/Modules/ControllerModules/KeyHandler_Core.swift +++ b/Source/Modules/ControllerModules/KeyHandler_Core.swift @@ -353,41 +353,6 @@ class KeyHandler { composer.clear() } - /// 用於網頁 Ruby 的注音需要按照教科書印刷的方式來顯示輕聲。該函式負責這種轉換。 - /// - Parameters: - /// - target: 要拿來做轉換處理的讀音鏈。 - /// - newSeparator: 新的讀音分隔符。 - /// - Returns: 經過轉換處理的讀音鏈。 - func cnvZhuyinKeyToTextbookReading(target: String, newSeparator: String = "-") -> String { - var arrReturn: [String] = [] - for neta in target.split(separator: "-") { - var newString = String(neta) - if String(neta.reversed()[0]) == "˙" { - newString = String(neta.dropLast()) - newString.insert("˙", at: newString.startIndex) - } - arrReturn.append(newString) - } - return arrReturn.joined(separator: newSeparator) - } - - /// 用於網頁 Ruby 的拼音的陰平必須顯示,這裡處理一下。 - /// - Parameters: - /// - target: 要拿來做轉換處理的讀音鏈。 - /// - newSeparator: 新的讀音分隔符。 - /// - Returns: 經過轉換處理的讀音鏈。 - func restoreToneOneInZhuyinKey(target: String, newSeparator: String = "-") -> String { - var arrReturn: [String] = [] - for neta in target.split(separator: "-") { - var newNeta = String(neta) - if !"ˊˇˋ˙".contains(String(neta.reversed()[0])), !neta.contains("_") { - newNeta += "1" - } - arrReturn.append(newNeta) - } - return arrReturn.joined(separator: newSeparator) - } - // MARK: - Extracted methods and functions (Megrez). /// 組字器是否為空。 diff --git a/Source/Modules/ControllerModules/KeyHandler_States.swift b/Source/Modules/ControllerModules/KeyHandler_States.swift index c8334146..affc3bc3 100644 --- a/Source/Modules/ControllerModules/KeyHandler_States.swift +++ b/Source/Modules/ControllerModules/KeyHandler_States.swift @@ -86,6 +86,18 @@ extension KeyHandler { tooltipParameterRef[1] = compositor.readings[compositorCursorIndex] } } + /// 注音轉拼音 + for (i, _) in tooltipParameterRef.enumerated() { + if tooltipParameterRef[i].isEmpty { continue } + if tooltipParameterRef[i].contains("_") { continue } + if mgrPrefs.showHanyuPinyinInCompositionBuffer { // 恢復陰平標記->注音轉拼音->轉教科書式標調 + tooltipParameterRef[i] = Tekkon.restoreToneOneInZhuyinKey(target: tooltipParameterRef[i]) + tooltipParameterRef[i] = Tekkon.cnvPhonaToHanyuPinyin(target: tooltipParameterRef[i]) + tooltipParameterRef[i] = Tekkon.cnvHanyuPinyinToTextbookStyle(target: tooltipParameterRef[i]) + } else { + tooltipParameterRef[i] = Tekkon.cnvZhuyinChainToTextbookReading(target: tooltipParameterRef[i]) + } + } } } } @@ -364,7 +376,7 @@ extension KeyHandler { var composingBuffer = currentReadings.joined(separator: "-") if mgrPrefs.inlineDumpPinyinInLieuOfZhuyin { - composingBuffer = restoreToneOneInZhuyinKey(target: composingBuffer) // 恢復陰平標記 + composingBuffer = Tekkon.restoreToneOneInZhuyinKey(target: composingBuffer) // 恢復陰平標記 composingBuffer = Tekkon.cnvPhonaToHanyuPinyin(target: composingBuffer) // 注音轉拼音 } @@ -398,12 +410,12 @@ extension KeyHandler { if let node = theAnchor.node { var key = node.key if mgrPrefs.inlineDumpPinyinInLieuOfZhuyin { - key = restoreToneOneInZhuyinKey(target: key) // 恢復陰平標記 + key = Tekkon.restoreToneOneInZhuyinKey(target: key) // 恢復陰平標記 key = Tekkon.cnvPhonaToHanyuPinyin(target: key) // 注音轉拼音 key = Tekkon.cnvHanyuPinyinToTextbookStyle(target: key) // 轉教科書式標調 key = key.replacingOccurrences(of: "-", with: " ") } else { - key = cnvZhuyinKeyToTextbookReading(target: key, newSeparator: " ") + key = Tekkon.cnvZhuyinChainToTextbookReading(target: key, newSeparator: " ") } let value = node.currentKeyValue.value From 331942c0b45a05661d6cde76c720f317b74c4e82 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Sun, 10 Jul 2022 09:17:08 +0800 Subject: [PATCH 06/20] InputState // Show readings when in-place marking phrases. --- .../ControllerModules/InputState.swift | 31 ++++++++++++++++--- .../Resources/Base.lproj/Localizable.strings | 2 +- Source/Resources/en.lproj/Localizable.strings | 2 +- Source/Resources/ja.lproj/Localizable.strings | 2 +- .../zh-Hans.lproj/Localizable.strings | 2 +- .../zh-Hant.lproj/Localizable.strings | 2 +- Source/UI/PrefUI/suiPrefPaneGeneral.swift | 2 +- .../WindowNIBs/Base.lproj/frmPrefWindow.xib | 2 +- .../WindowNIBs/en.lproj/frmPrefWindow.strings | 2 +- .../WindowNIBs/ja.lproj/frmPrefWindow.strings | 2 +- .../zh-Hans.lproj/frmPrefWindow.strings | 2 +- .../zh-Hant.lproj/frmPrefWindow.strings | 2 +- 12 files changed, 37 insertions(+), 16 deletions(-) diff --git a/Source/Modules/ControllerModules/InputState.swift b/Source/Modules/ControllerModules/InputState.swift index 4587c486..bfe0cab9 100644 --- a/Source/Modules/ControllerModules/InputState.swift +++ b/Source/Modules/ControllerModules/InputState.swift @@ -228,6 +228,27 @@ enum InputState { return lowerBoundLiteral..注音轉拼音->轉教科書式標調 + neta = Tekkon.restoreToneOneInZhuyinKey(target: neta) + neta = Tekkon.cnvPhonaToHanyuPinyin(target: neta) + neta = Tekkon.cnvHanyuPinyinToTextbookStyle(target: neta) + } else { + neta = Tekkon.cnvZhuyinChainToTextbookReading(target: neta) + } + arrOutput.append(neta) + } + return arrOutput.joined(separator: " ") + } + private var deleteTargetExists = false var tooltip: String { if composingBuffer.count != readings.count { @@ -252,15 +273,14 @@ enum InputState { return String( format: NSLocalizedString( "\"%@\" length must ≥ 2 for a user phrase.", comment: "" - ), text + ) + "\n// " + literalReadingThread, text ) } else if literalMarkedRange.count > allowedMarkRange.upperBound { ctlInputMethod.tooltipController.setColor(state: .denialOverflow) return String( format: NSLocalizedString( "\"%@\" length should ≤ %d for a user phrase.", comment: "" - ), - text, allowedMarkRange.upperBound + ) + "\n// " + literalReadingThread, text, allowedMarkRange.upperBound ) } @@ -275,12 +295,13 @@ enum InputState { return String( format: NSLocalizedString( "\"%@\" already exists: ENTER to boost, \n SHIFT+CMD+ENTER to exclude.", comment: "" - ), text + ) + "\n// " + literalReadingThread, text ) } ctlInputMethod.tooltipController.resetColor() return String( - format: NSLocalizedString("\"%@\" selected. ENTER to add user phrase.", comment: ""), + format: NSLocalizedString("\"%@\" selected. ENTER to add user phrase.", comment: "") + "\n// " + + literalReadingThread, text ) } diff --git a/Source/Resources/Base.lproj/Localizable.strings b/Source/Resources/Base.lproj/Localizable.strings index 261aa368..c4faf713 100644 --- a/Source/Resources/Base.lproj/Localizable.strings +++ b/Source/Resources/Base.lproj/Localizable.strings @@ -146,7 +146,7 @@ "Push the cursor in front of the phrase after selection" = "Push the cursor in front of the phrase after selection"; "Secondary Pinyin with Numeral Intonation" = "Secondary Pinyin with Numeral Intonation"; "Selection Keys:" = "Selection Keys:"; -"Show Hanyu-Pinyin in the inline composition buffer" = "Show Hanyu-Pinyin in the inline composition buffer"; +"Show Hanyu-Pinyin in the inline composition buffer & tooltip" = "Show Hanyu-Pinyin in the inline composition buffer & tooltip"; "Show page buttons in candidate window" = "Show page buttons in candidate window"; "Simplified Chinese" = "Simplified Chinese"; "Space & ESC Key:" = "Space & ESC Key:"; diff --git a/Source/Resources/en.lproj/Localizable.strings b/Source/Resources/en.lproj/Localizable.strings index 261aa368..c4faf713 100644 --- a/Source/Resources/en.lproj/Localizable.strings +++ b/Source/Resources/en.lproj/Localizable.strings @@ -146,7 +146,7 @@ "Push the cursor in front of the phrase after selection" = "Push the cursor in front of the phrase after selection"; "Secondary Pinyin with Numeral Intonation" = "Secondary Pinyin with Numeral Intonation"; "Selection Keys:" = "Selection Keys:"; -"Show Hanyu-Pinyin in the inline composition buffer" = "Show Hanyu-Pinyin in the inline composition buffer"; +"Show Hanyu-Pinyin in the inline composition buffer & tooltip" = "Show Hanyu-Pinyin in the inline composition buffer & tooltip"; "Show page buttons in candidate window" = "Show page buttons in candidate window"; "Simplified Chinese" = "Simplified Chinese"; "Space & ESC Key:" = "Space & ESC Key:"; diff --git a/Source/Resources/ja.lproj/Localizable.strings b/Source/Resources/ja.lproj/Localizable.strings index 057cc480..79a8751b 100644 --- a/Source/Resources/ja.lproj/Localizable.strings +++ b/Source/Resources/ja.lproj/Localizable.strings @@ -146,7 +146,7 @@ "Push the cursor in front of the phrase after selection" = "候補選択の直後、すぐカーソルを単語の向こうに推し進める"; "Secondary Pinyin with Numeral Intonation" = "国音二式 (ローマ字+数字音調)"; "Selection Keys:" = "言選り用キー:"; -"Show Hanyu-Pinyin in the inline composition buffer" = "弁音合併入力(入力緩衝列で代わりに漢語弁音の音読み)"; +"Show Hanyu-Pinyin in the inline composition buffer & tooltip" = "弁音合併入力(入力緩衝列とヒントで音読みを漢語弁音に)"; "Show page buttons in candidate window" = "入力候補陳列の側にページボタンを表示"; "Simplified Chinese" = "簡体中国語"; "Space & ESC Key:" = "ESC と Space:"; diff --git a/Source/Resources/zh-Hans.lproj/Localizable.strings b/Source/Resources/zh-Hans.lproj/Localizable.strings index 81e9a423..8cb3ee1f 100644 --- a/Source/Resources/zh-Hans.lproj/Localizable.strings +++ b/Source/Resources/zh-Hans.lproj/Localizable.strings @@ -147,7 +147,7 @@ "Push the cursor in front of the phrase after selection" = "在选字后将游标置于该字词的前方"; "Secondary Pinyin with Numeral Intonation" = "国音二式+数字标调"; "Selection Keys:" = "选字键:"; -"Show Hanyu-Pinyin in the inline composition buffer" = "拼音并击模式(组字区内看到的是汉语拼音)"; +"Show Hanyu-Pinyin in the inline composition buffer & tooltip" = "拼音并击(组字区与工具提示内显示汉语拼音)"; "Show page buttons in candidate window" = "在选字窗内显示翻页按钮"; "Simplified Chinese" = "简体中文"; "Space & ESC Key:" = "ESC 与空格键:"; diff --git a/Source/Resources/zh-Hant.lproj/Localizable.strings b/Source/Resources/zh-Hant.lproj/Localizable.strings index b4c27069..2f13703c 100644 --- a/Source/Resources/zh-Hant.lproj/Localizable.strings +++ b/Source/Resources/zh-Hant.lproj/Localizable.strings @@ -146,7 +146,7 @@ "Push the cursor in front of the phrase after selection" = "在選字後將游標置於該字詞的前方"; "Secondary Pinyin with Numeral Intonation" = "國音二式+數字標調"; "Selection Keys:" = "選字鍵:"; -"Show Hanyu-Pinyin in the inline composition buffer" = "拼音並擊模式(組字區內看到的是漢語拼音)"; +"Show Hanyu-Pinyin in the inline composition buffer & tooltip" = "拼音並擊(組字區與工具提示內顯示漢語拼音)"; "Show page buttons in candidate window" = "在選字窗內顯示翻頁按鈕"; "Simplified Chinese" = "簡體中文"; "Space & ESC Key:" = "ESC 與空格鍵:"; diff --git a/Source/UI/PrefUI/suiPrefPaneGeneral.swift b/Source/UI/PrefUI/suiPrefPaneGeneral.swift index 1551f0e9..093b9ba9 100644 --- a/Source/UI/PrefUI/suiPrefPaneGeneral.swift +++ b/Source/UI/PrefUI/suiPrefPaneGeneral.swift @@ -158,7 +158,7 @@ struct suiPrefPaneGeneral: View { } } Toggle( - LocalizedStringKey("Show Hanyu-Pinyin in the inline composition buffer"), + LocalizedStringKey("Show Hanyu-Pinyin in the inline composition buffer & tooltip"), isOn: $selShowHanyuPinyinInCompositionBuffer ).onChange(of: selShowHanyuPinyinInCompositionBuffer) { value in mgrPrefs.showHanyuPinyinInCompositionBuffer = value diff --git a/Source/WindowNIBs/Base.lproj/frmPrefWindow.xib b/Source/WindowNIBs/Base.lproj/frmPrefWindow.xib index 7dc12991..ae6afabc 100644 --- a/Source/WindowNIBs/Base.lproj/frmPrefWindow.xib +++ b/Source/WindowNIBs/Base.lproj/frmPrefWindow.xib @@ -269,7 +269,7 @@