From 7cbfb9fb1a5b1e0acd600d138772f32f51ac7b3e Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Fri, 9 Sep 2022 23:23:19 +0800 Subject: [PATCH] ctlTooltip // Disable vertical display if UI language is English. --- Source/Modules/UIModules/PrefUI/suiPrefPaneExperience.swift | 4 ++-- Source/Modules/UIModules/TooltipUI/ctlTooltip.swift | 1 + Source/Resources/Base.lproj/Localizable.strings | 2 +- Source/Resources/en.lproj/Localizable.strings | 2 +- Source/Resources/ja.lproj/Localizable.strings | 2 +- Source/Resources/zh-Hans.lproj/Localizable.strings | 2 +- Source/Resources/zh-Hant.lproj/Localizable.strings | 2 +- 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Source/Modules/UIModules/PrefUI/suiPrefPaneExperience.swift b/Source/Modules/UIModules/PrefUI/suiPrefPaneExperience.swift index 666c563a..430686e8 100644 --- a/Source/Modules/UIModules/PrefUI/suiPrefPaneExperience.swift +++ b/Source/Modules/UIModules/PrefUI/suiPrefPaneExperience.swift @@ -243,10 +243,10 @@ struct suiPrefPaneExperience: View { isOn: $selAlwaysShowTooltipTextsHorizontally.onChange { mgrPrefs.alwaysShowTooltipTextsHorizontally = selAlwaysShowTooltipTextsHorizontally } - ) + ).disabled(Bundle.main.preferredLocalizations[0] == "en") Text( LocalizedStringKey( - "Key names in tooltip will be shown as symbols when the typing direction of the client app is vertical." + "Key names in tooltip will be shown as symbols when the tooltip is vertical. However, this option will be ignored since tooltip will always be horizontal if the UI language is English." ) ).preferenceDescription() } diff --git a/Source/Modules/UIModules/TooltipUI/ctlTooltip.swift b/Source/Modules/UIModules/TooltipUI/ctlTooltip.swift index cd8fb857..23b5df9b 100644 --- a/Source/Modules/UIModules/TooltipUI/ctlTooltip.swift +++ b/Source/Modules/UIModules/TooltipUI/ctlTooltip.swift @@ -29,6 +29,7 @@ public class ctlTooltip: NSWindowController { public var direction: NSAttributedTextView.writingDirection = .horizontal { didSet { if #unavailable(macOS 10.13) { direction = .horizontal } + if Bundle.main.preferredLocalizations[0] == "en" { direction = .horizontal } messageText.direction = direction } } diff --git a/Source/Resources/Base.lproj/Localizable.strings b/Source/Resources/Base.lproj/Localizable.strings index 7747f0f2..286e1235 100644 --- a/Source/Resources/Base.lproj/Localizable.strings +++ b/Source/Resources/Base.lproj/Localizable.strings @@ -174,7 +174,7 @@ "in front of the phrase (like macOS built-in Zhuyin IME)" = "in front of the phrase (like macOS built-in Zhuyin IME)"; "Intonation Key:" = "Intonation Key:"; "Japanese" = "Japanese"; -"Key names in tooltip will be shown as symbols when the typing direction of the client app is vertical." = "Key names in tooltip will be shown as symbols when the typing direction of the client app is vertical."; +"Key names in tooltip will be shown as symbols when the tooltip is vertical. However, this option will be ignored since tooltip will always be horizontal if the UI language is English." = "Key names in tooltip will be shown as symbols when the tooltip is vertical. However, this option will be ignored since tooltip will always be horizontal if the UI language is English."; "Keyboard Shortcuts:" = "Keyboard Shortcuts:"; "Keyboard" = "Keyboard"; "Misc Settings:" = "Misc Settings:"; diff --git a/Source/Resources/en.lproj/Localizable.strings b/Source/Resources/en.lproj/Localizable.strings index 7747f0f2..286e1235 100644 --- a/Source/Resources/en.lproj/Localizable.strings +++ b/Source/Resources/en.lproj/Localizable.strings @@ -174,7 +174,7 @@ "in front of the phrase (like macOS built-in Zhuyin IME)" = "in front of the phrase (like macOS built-in Zhuyin IME)"; "Intonation Key:" = "Intonation Key:"; "Japanese" = "Japanese"; -"Key names in tooltip will be shown as symbols when the typing direction of the client app is vertical." = "Key names in tooltip will be shown as symbols when the typing direction of the client app is vertical."; +"Key names in tooltip will be shown as symbols when the tooltip is vertical. However, this option will be ignored since tooltip will always be horizontal if the UI language is English." = "Key names in tooltip will be shown as symbols when the tooltip is vertical. However, this option will be ignored since tooltip will always be horizontal if the UI language is English."; "Keyboard Shortcuts:" = "Keyboard Shortcuts:"; "Keyboard" = "Keyboard"; "Misc Settings:" = "Misc Settings:"; diff --git a/Source/Resources/ja.lproj/Localizable.strings b/Source/Resources/ja.lproj/Localizable.strings index 6d0b4f7b..f8aa5afb 100644 --- a/Source/Resources/ja.lproj/Localizable.strings +++ b/Source/Resources/ja.lproj/Localizable.strings @@ -174,7 +174,7 @@ "in front of the phrase (like macOS built-in Zhuyin IME)" = "単語の前で // macOS 内蔵注音入力のやり方"; "Intonation Key:" = "音調キー:"; "Japanese" = "和語"; -"Key names in tooltip will be shown as symbols when the typing direction of the client app is vertical." = "縦書き入力の場合、ヒントにはキーの名前は常に符号で表示する。"; +"Key names in tooltip will be shown as symbols when the tooltip is vertical. However, this option will be ignored since tooltip will always be horizontal if the UI language is English." = "縦書き入力の場合、ヒントにはキーの名前は常に符号で表示する。"; "Keyboard Shortcuts:" = "ショートカット:"; "Keyboard" = "配列設定"; "Misc Settings:" = "他の設定:"; diff --git a/Source/Resources/zh-Hans.lproj/Localizable.strings b/Source/Resources/zh-Hans.lproj/Localizable.strings index c42c896b..d5c0036e 100644 --- a/Source/Resources/zh-Hans.lproj/Localizable.strings +++ b/Source/Resources/zh-Hans.lproj/Localizable.strings @@ -174,7 +174,7 @@ "in front of the phrase (like macOS built-in Zhuyin IME)" = "将游标置于词语前方 // macOS 内建注音风格"; "Intonation Key:" = "声调键:"; "Japanese" = "和语"; -"Key names in tooltip will be shown as symbols when the typing direction of the client app is vertical." = "纵排输入的情况下,工具提示内的按键名称会以符号显示。"; +"Key names in tooltip will be shown as symbols when the tooltip is vertical. However, this option will be ignored since tooltip will always be horizontal if the UI language is English." = "纵排输入的情况下,工具提示内的按键名称会以符号显示。"; "Keyboard Shortcuts:" = "键盘快速键:"; "Keyboard" = "键盘设定"; "Misc Settings:" = "杂项:"; diff --git a/Source/Resources/zh-Hant.lproj/Localizable.strings b/Source/Resources/zh-Hant.lproj/Localizable.strings index 188b03ec..e279ade0 100644 --- a/Source/Resources/zh-Hant.lproj/Localizable.strings +++ b/Source/Resources/zh-Hant.lproj/Localizable.strings @@ -174,7 +174,7 @@ "in front of the phrase (like macOS built-in Zhuyin IME)" = "將游標置於詞語前方 // macOS 內建注音風格"; "Intonation Key:" = "聲調鍵:"; "Japanese" = "和語"; -"Key names in tooltip will be shown as symbols when the typing direction of the client app is vertical." = "縱排輸入的情況下,工具提示內的按鍵名稱會以符號顯示。"; +"Key names in tooltip will be shown as symbols when the tooltip is vertical. However, this option will be ignored since tooltip will always be horizontal if the UI language is English." = "縱排輸入的情況下,工具提示內的按鍵名稱會以符號顯示。"; "Keyboard Shortcuts:" = "鍵盤快速鍵:"; "Keyboard" = "鍵盤設定"; "Misc Settings:" = "雜項:";