Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
-
None
Description
Within the Qt cross-platform frameworks, we expose the current input method's locale. Although that may be more than necessary for most applications, the important information is the primary language associated for the current input method. This allows 3rd-party developers to add features supporting the intended language, or complementing the platform input context in their applications, either in a cross-platform or platform-dependent way.
While moving away from old and undocumented Carbon APIs, we noticed that there is no Cocoa replacement for some parts of HIToolbox' Text Input Source. In particular, there is no way to obtain the preferred language for the current input source. For example, NSTextInputContext.allowedInputSourceLocales does not return any meaningful information. It must be noted that UIKit has had a similar API, documented as since iOS 4.2, as UITextInputMode.primaryLanguage.
Up to now, we've been using TISCopyCurrentKeyboardInputSource() followed by TISGetInputSourceProperty() with kTISPropertyInputSourceLanguages, then we'd use the first language available. This has worked fairly well as it allowed us to create a locale object from the language identifier alone.
Quite surprisingly, we're using the NSLocaleIdentifier key form the current locale in our iOS port. This has proven not to work the same way on macOS.
Steps to Reproduce:
Look for documentation on primary language for the current input context, for example in NSTextInputContext.
Expected Results:
Find something, like it's the case in UIKit.
Attachments
Issue Links
- relates to
-
QTBUG-73868 Cocoa UCKeyTranslate replacement API (rdar://problem/33246214)
- Reported