Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-27780

lrelease warnings are displayed as errors in the "issues" window

    XMLWordPrintable

    Details

    • Platform/s:
      Windows
    • Commits:
      f587a0b1862d277b063296b56f6614d1d92343f1

      Description

      Let's say I have multiple ts files that have some overlap (created with qt5_create_translation but that doesn't matter).

      For the sake of simplicity multiple copies of the same ts file can be used to reproduce this issue.

      <?xml version="1.0" encoding="utf-8"?>
      <!DOCTYPE TS>
      <TS version="2.1" language="en_US">
      <context>
          <name>MainWindow</name>
          <message>
              <source>MainWindow</source>
              <translation>MainWindow</translation>
          </message>
      </context>
      </TS>
      

      Then I use some CMake wizardry to create a target which outputs a single qm file for all these ts files. The follwing snipped can be used to test it without the CMake wizardry.

      find_package(Qt5LinguistTools)
      
      set(ts_files "${CMAKE_CURRENT_SOURCE_DIR}/ts1.ts" "${CMAKE_CURRENT_SOURCE_DIR}/ts2.ts")
      set(qm_file mega_qm.qm)
      add_custom_target(mega_qm DEPENDS ${qm_file})
      add_custom_command(
          OUTPUT ${qm_file}
          COMMAND ${Qt5_LRELEASE_EXECUTABLE}
          ARGS ${ts_files} -qm ${qm_file}
          DEPENDS ${ts_files}
          COMMAND_EXPAND_LISTS VERBATIM)
      

      lupdate gives (a reasonable) warning `dropping duplicate messages in 'mega_qm.qm'`, which is displayed as an error in the "Issues" window.

      In the "Compile output" window we can see that it has exited normally.

        Attachments

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

          Activity

            People

            Assignee:
            cadam Cristian Adam
            Reporter:
            hedede hedede
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes