Linguist, lupdate and translator comments missing
-
wrote on 18 Oct 2021, 07:47 last edited by tmarplatt
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.
-
wrote on 19 Oct 2021, 00:17 last edited by tmarplatt
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.
-
wrote on 21 Oct 2021, 18:04 last edited by
I'm closing this thread since I understand now that the python qt toolset and bindings is maintained somewhere else. Thank you regardless.
-
Hi,
It depends, are you talking about PySide2/6 or PyQt5/6 ?
3/6