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

CMake: Introduce qt_update_translation function

    XMLWordPrintable

Details

    • 22c5a32c096997266d627677cf8e281c186304d7 (qt/qttools/dev)

    Description

      1. Replace qt5_create_translation(...) by a new CMake command that solely updates .ts files. The new command should support both setting sources and include directories explicitly, as well as deduce it from a target:

      Explicit mode

      qt5_update_translation(ts_file1 [ts_file2 ...]
        SOURCES file1...]
        [INCLUDE_DIRECTORIES include1 ...]
        [OPTIONS ...]
      }
      

      Options:

      INCLUDE_DIRECTORIES - sets include directories to be passed to lupdate. If not set, the default is INCLUDE_DIRECTORIES of the current directory.

      Example use

      qt5_update_translation(app_de.ts SOURCES main.cpp)
      qt5_update_translation(app_en.ts SOURCES main.cpp OPTIONS -pluralsonly)
      add_custom_target(update_translations DEPENDS app_de.ts app_en.ts)
      add_dependencies(update_translations )

      Target mode

      qt5_update_translation(ts_file1 [ts_file2 ...]
        TARGET myapp
        [OPTIONS ...]

      TODO: How to handle runtime files like .qml?

      Attachments

        Issue Links

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

          Activity

            People

              jbornema Joerg Bornemann
              kkohne Kai Köhne
              Votes:
              5 Vote for this issue
              Watchers:
              17 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes