Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-73869

Cocoa kTISPropertyInputSourceLanguages replacement API (rdar://problem/33217689)

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P2: Important
    • None
    • None
    • QPA
    • None
    • macOS

    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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              vestbo Tor Arne Vestbø
              sorvig Morten Sørvig
              Veli-Pekka Heinonen Veli-Pekka Heinonen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes