Linguist, lupdate and translator comments missing
-
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
qtlupdate5pylupdate5) 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?
-
lupdate from qt5.15 and qt6.2 works fine for me.
-
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.
-
Sorry, can't help with the python stuff. Maybe someone else or open a bug report for this.
-
Hi,
It depends, are you talking about PySide2/6 or PyQt5/6 ?