pylupdate5 forgets translations of lines containing Unicode

Anton Yablokov stsav012 at gmail.com
Mon Apr 12 18:26:00 BST 2021


Dear community,

I've just bumped into a troubling behavior of pylupdate5. Namely, it marks
the translations of lines containing Unicode symbols besides ASCII as
unfinished and actually removes the translation.

Here is an MWE:

from PyQt5.QtCore import QCoreApplication

_translate = QCoreApplication.translate
_translate('microvolts', 'uV')
_translate('microvolts', 'μV')


On it, run

 pylupdate5 -noobsolete *.py -ts microvolts.ts

once, then complete (and save) the translation using linguist, then run
pylupdate5 again with the same parameters. The translation of

'μV'

vanishes:

<         <translation>μV</translation>
---
>         <translation type="unfinished"></translation>

Checked with PyQt5 5.13.2 through 5.15.4 on Linux.

Best regards,
Anton Yablokov
🍏
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20210412/10632197/attachment.htm>


More information about the PyQt mailing list