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

Translations in resources do not work reliably if QML compiler is used

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2: Important P2: Important
    • None
    • 5.12.0 Beta 1
    • QML: Compiler
    • None

      Translations loaded from resources do not work reliably if the QML compiler is used. I attached a small example. To reproduce the bug, compile it and run it. Both texts should be translated, but only the text written to the console is translated, the text in the menu item is not.

      Then comment out "CONFIG += qtquickcompiler" in the project file. Make sure to start with a fresh build directory. Compile and run again. Now both strings are translated as expected.

      I tested this example on Ubuntu Linux 18.10beta. The bug does not occur with Qt 5.11.2.

        1. main.cpp
          0.5 kB
          Markus Enzenberger
        2. main.qml
          0.3 kB
          Markus Enzenberger
        3. qml.qrc
          0.1 kB
          Markus Enzenberger
        4. translation-bug.pro
          0.1 kB
          Markus Enzenberger
        5. translation.qm
          0.2 kB
          Markus Enzenberger
        6. translation.ts
          0.4 kB
          Markus Enzenberger
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            shausman Simon Hausmann
            enz Markus Enzenberger
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes