Issue 2551287
Created on 2023-07-21 00:22 by rouilj, last changed 2024-07-13 22:39 by rouilj.
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
|
|
Date |
User |
Action |
Args |
2024-07-13 22:39:04 | rouilj | set | files:
+ pygettext_2to3.diff |
2024-07-13 22:37:32 | rouilj | set | status: new -> fixed assignee: rouilj resolution: remind -> fixed versions:
+ 2.5.0 |
2024-07-13 22:35:48 | rouilj | set | messages:
+ msg8097 |
2023-07-21 00:36:58 | rouilj | set | resolution: remind |
2023-07-21 00:35:33 | rouilj | set | files:
+ roundup_gettext_enhancements.patch keywords:
+ patch |
2023-07-21 00:33:24 | rouilj | set | type: 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:48 | rouilj | create | |
|