The messages.pot (superset/translations/messages.pot) had comment for the translations.
"#, python-format" is used to tag translations based on python expression like
msgid "**%(dialect)**s cannot be used as a data source for security reasons."
Some translation (tagged "#, python-format") use the % char but it is not for python expression.
, python-format --> Comment must be deleted
msgid "% calculation" msgstr ""
, python-format --> Comment must be deleted
msgid "% of parent" msgstr ""
, python-format --> Comment must be deleted
msgid "% of total" msgstr ""
, python-format --> OK
msgid "%(dialect)s cannot be used as a data source for security reasons." msgstr ""
Regards
Comment From: rusackas
@dosu do you think there's any way to grep for this, or have the .pot extraction script correct for it?
Comment From: dosubot[bot]
You can use grep or similar tools to quickly find all lines with #, python-format
in messages.pot, but distinguishing correct from incorrect usage (i.e., whether the msgid actually contains a Python-style format string like %(name)s
or %s
) is tricky with grep alone. For a robust solution, a Python script can parse messages.pot, check each msgid for real Python formatting, and remove the tag if it's not needed. This script can be added as a post-processing step in babel_update.sh after extraction and normalization—there’s currently no such logic in the workflow, but integration is straightforward and fits well with the existing process. The script would need to handle multiline msgids and edge cases, but the file structure makes this feasible.
Let me know if you want a sample script or more details on the integration!
Reference
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other