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

qt_add_lupdate() won't generate "*.ts" files unless there already exist.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 6.3.0
    • Build System: CMake
    • None
    • Windows 11
      MSVC 2019
      Qt 6.3.0
      VSCode 1.68.1
      VSCode-CMake-Tools 1.12.4
      Conan 1.48.1
    • Windows

    Description

      According to the Documentation, qt_add_lupdate() should automatically create *.ts files if there doesn't exist originally. Am I right?

      Add targets to generate or update Qt Linguist .ts files

      However, it didn't work as I thought. The *.ts files won't be generated if there doesn't exist.

      After some experiments, I found that I have to do the following steps:

      1. Create some empty *.ts files (zh_TW.ts and zh_CN.ts).
      2. Configure and Execute the custom target ${target}_lupdate.
        It will definitely show errors of parsing. For example:
        [build] Parse error at D:/Code-Cpp-MyFavorite/Code-CMake-Qt-LiNing/source/15-International/ts/zh_TW.ts:1:0: Premature end of document.
      1. Delete those empty *.ts files (zh_TW.ts and zh_CN.ts).
      2. Configure and Execute the custom target ${target}_lupdate.
        This time, it works. For example:
        [build] Updating '../../../../source/15-International/ts/zh_TW.ts'...
        [build]     Found 7 source text(s) (7 new and 0 already existing)

      GIF of Experiments

        

       

      Attachments

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

        Activity

          People

            qtbuildsystem Qt Build System Team
            hwhsu1231 Haowei Hsu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes