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

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

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        1. main.cpp
          0.5 kB
        2. main.qml
          0.3 kB
        3. qml.qrc
          0.1 kB
        4. translation.qm
          0.2 kB
        5. translation.ts
          0.4 kB
        6. translation-bug.pro
          0.1 kB

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes