Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Linguist, lupdate and translator comments missing
Forum Update on Monday, May 27th 2025

Linguist, lupdate and translator comments missing

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
6 Posts 3 Posters 613 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tmarplatt
    wrote on last edited by tmarplatt
    #1

    Hello. I am localising a FOSS project to the Spanish language. This project implements i18n localisation in Qt (thanks to Linguist which is a superb tool).

    But I have noticed that, even though Linguist accepts translator comment input for every translatable string, running lupdate (in my case via qtlupdate5 pylupdate5) strips all existing <translatorcomment> tags from the XML markup of the .ts file.

    This removes all purpose from entering translator comments in Linguist. But comments are otherwise a straightforward way to give string context, insight and feedback to other translators through the codebase itself.

    Do you think this is a bug?

    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      lupdate from qt5.15 and qt6.2 works fine for me.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tmarplatt
        wrote on last edited by tmarplatt
        #3

        Indeed, lupdate itself seems to be working fine. The issue is in pylupdate5 (version v5.14.1).

        lupdate seems to be much stricter in parsing the source code, whereas pylupdate5 is forgiving, particularly these cases:

        novelWriter/novelwriter/tools/build.py:808: tr() cannot be called without context
        

        Those lines get skipped and their strings removed from the .ts file when running lupdate.

        1 Reply Last reply
        0
        • Christian EhrlicherC Online
          Christian EhrlicherC Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Sorry, can't help with the python stuff. Maybe someone else or open a bug report for this.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          0
          • T Offline
            T Offline
            tmarplatt
            wrote on last edited by
            #5

            I'm closing this thread since I understand now that the python qt toolset and bindings is maintained somewhere else. Thank you regardless.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi,

              It depends, are you talking about PySide2/6 or PyQt5/6 ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved