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

Specify lupdate options per output file with qt_add_lupdate

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Fixed
    • P2: Important
    • 6.7.0 FF
    • 6.5.2
    • Build System: CMake
    • None
    • All
    • ababa6b40 (dev), ff6eca008 (dev), 17680273b (dev), ffe105e1a (dev)

    Description

      It's common for the source language to be English. In such cases you typically want to specify -pluralonly when generating/updating the .ts file for English, to only leave plural forms for "translation" to English. You don't want to give this flag when generating the .ts files for other languages.

      But the new target-based qt_add_lupdate and qt_add_translations, which are now the recommended helpers to use in favour of the deprecated file/folder based qt_create_translation, only allows specification of one set of lupdate options for all given output .ts files.

      It's also not possible to work around this limitation by calling qt_add_lupdate twice, once for your English .ts file and once for the .ts files for other languages, unless you (a) give up on the convenience of having sources deduced from the target and specify all source files manually and (b) create a dummy empty target just to have something to pass to the second call, since otherwise it will try to create a ${target}_lupdate target that already exists.

      It would be good if there was a better way to handle this use case.

      Attachments

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

        Activity

          People

            jbornema Joerg Bornemann
            estan Elvis Stansvik
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes