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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Invalid
    • Affects Version/s: 6.3.0
    • Fix Version/s: None
    • Component/s: Build System: CMake
    • Labels:
      None
    • Environment:
      Windows 11
      MSVC 2019
      Qt 6.3.0
      VSCode 1.68.1
      VSCode-CMake-Tools 1.12.4
      Conan 1.48.1
    • Platform/s:
      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

            Assignee:
            qtbuildsystem Qt Build System Team
            Reporter:
            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