Qt World Summit: Submit your Presentation

Android keyboard stays English latin when it should be Hindi

  • Hi there,
    I am developing a bilingual (English/Hindi) Android app with Qt.5.11 and QML.
    The language switch is established by setting the locales "en_IN" or "hi_IN" of a Translatormanager Class, which triggers then an ID based translation of the app content via .ts and .qm files. So far so good.

    In QML, there are some text boxes, where users can write and send data .
    TextEdit { textFormat: TextEdit.AutoText ... }

    When touching the TextEdit boxes on Android, the softkeyboard shows up as it has to. But no matter, what the current locale is, I cannot change the language of the keyboard to Hindi. Clicking on the globe of the keyboard, I seem to be able to change the language but the layout is always English latin. Strange enough, in some instances the numbers are shown in Hindi but not the letters.

    • Adding Hindi besides English as a language in the settings of the Android device didn't change anything.
    • Installing Google Indic Keyboard from the app store as an alternative to Gboard and setting it to English & Indic Languages with Hindi selected didn't help.

    It needs to be mentioned that when I use a note pad app on the same device, the keyboard switches beautifully between the different languages and input systems. (English, English phonetic to Devanagari and Devanagari)

    Can anyone point me into a direction?
    What am I missing?
    Does Android need to know the locale?

    And the console shows the following error. But I am unsure, if that is related.
    W IInputConnectionWrapper: finishComposingText on inactive InputConnection

    Thanks a lot in advance

    To illustrate, the expected behaviour, this is the keyboard when I toggle through by pressing on the globe.


    And this is my app and again I am toggling through keyboard layouts by pressing on the globe. But the Android keyboard always sticks with the English layout, even though the space bar indicates Hindi.


  • Alright, I found the error:

    In the TextEdit {} I had inputMethodHints: Qt.ImhNoPredictiveText because in earlier tests, sending emojis to TextEdit crashed the app.

    But with PredictiveText disabled, all fancy input methods and hence the different keyboards don't work. Also, Emojis are no problem anymore and animated Gifs are disabled.