Roundup Tracker - Issues

Issue 2551287

classification
Enhance roundup_gettext.py to extract strings from detectors/extensions
Type: behavior Severity: normal
Components: Web interface, Mail interface Versions: 2.5.0
process
Status: fixed fixed
:
: rouilj : rouilj
Priority: : patch

Created on 2023-07-21 00:22 by rouilj, last changed 2024-07-13 22:39 by rouilj.

Files
File name Uploaded Description Edit Remove
roundup_gettext_enhancements.patch rouilj, 2023-07-21 00:35
pygettext_2to3.diff rouilj, 2024-07-13 22:39 unidiff of changes needed to make pygettext.py work under python 3.
Messages
msg7806 Author: [hidden] (rouilj) Date: 2023-07-21 00:33
In issue2551184 the 4th mega patch included updates for roundup_gettext.py
to extract text from detectors and extensions. It used to only get translations from
templates.

This patch requires a vendored pygettext.py which is mostly abandoned although
some interest was expressed:

 https://discuss.python.org/t/modernize-and-add-missing-features-to-pygettext/26455

It also requires that polib (https://polib.readthedocs.io) be installed to merge
the po files generated from the html template files and detector/extensions (msg7469).

Not sure we want to require that.

Ralf thoughts?


I'll upload the patch I currently synthesized out of the mega patch.
msg8097 Author: [hidden] (rouilj) Date: 2024-07-13 22:35
pygettext.py which makes up a large part of this patch is python2. It uses:

   print >> filehandle, ...

   except Exception, var

   import imp

   dictionary.sort()

   reduce() (without importing it)

   tokenize(file.readline, tokeneater)

I got all of the above sorted.

I will attach a diff for anybody who might want to convert pygettext.py from python2 
to python3. Not sure everything is working ok, but in testing it found an error
in one of my extensions. I was using '_( template % values)' rather than '_(template) % 
values' and it flagged it. Reported that % was unexpected. Running it on itself
checked out ok.

See: changeset:   8080:d1c29284ccd9
History
Date User Action Args
2024-07-13 22:39:04rouiljsetfiles: + pygettext_2to3.diff
2024-07-13 22:37:32rouiljsetstatus: new -> fixed
assignee: rouilj
resolution: remind -> fixed
versions: + 2.5.0
2024-07-13 22:35:48rouiljsetmessages: + msg8097
2023-07-21 00:36:58rouiljsetresolution: remind
2023-07-21 00:35:33rouiljsetfiles: + roundup_gettext_enhancements.patch
keywords: + patch
2023-07-21 00:33:24rouiljsettype: behavior
messages: + msg7806
nosy: + rouilj
components: + Web interface, Mail interface
title: Enhance roundup -> Enhance roundup_gettext.py to extract strings from detectors/extensions
2023-07-21 00:22:48rouiljcreate