Problems with latest pylupdate6

Detlev Offenbach detlev at die-offenbachs.de
Tue Dec 22 14:30:33 GMT 2020


Hello Phil,

I am trying to extract translation strings with latest pylupdate6 
(6.0.0.dev2012201836) for the eric6 project. That fails miserably. The 
problematic display string/tr() is:

self.tr("%n supported device(s) detected.", "", len(devices))

The issue occurs in file "python_source.py" in line 145 but seems to be 
caused in line 307 ('n = self._get_int(args[2])'). The a.m. tr() call 
results in args[2] to be an ast.Call object causing _get_int() to return 
None.

Another troublesome constructs are

txt = self.tr("Deleting %n byte(s)", "", length)

self.tr("%n file(s) changed", None, totals["files"])

self.tr("Ran %n test(s) in {0:.3f}s", "", self.runCount)

self.tr("Snapshot will be taken in %n seconds", "", self.__length - 
self.__time)

I think, that the method '_get_int()' should be bypassed because there 
are too many possibilities. Furthermore, when run with progress output, 
some 'message.source' have value 'None' causing a failure in pretty(). 
The.ts file created with all the above issues bypassed is incorrect. 
When opening it in Qt Linguist, it gives a bunch of errors and opening 
it in an editor reveals a bunch of lines like

<message><location filename="../WebBrowser/AdBlock/AdBlockDialog.ui" 
line="0" /><location filename="../WebBrowser/AdBlock/AdBlockDialog.ui" 
line="0" /><source /><translation type="unfinished" /></message>

The example used is the eric-ide sources.

Regards,
Detlev

-- 
Detlev Offenbach
detlev at die-offenbachs.de



More information about the PyQt mailing list