It seems that gettext is not able to recognise Python format strings with replacement fields properly and hence does not flag them as "python-format". E.g.
ugettext("This is a sample format string with a {kwarg}").format(kwarg='key word argument')
However, gettext identifies Python strings with format specifiers properly and flags such source strings with "python-format", e.g.,
ugettext("This is a sample string with a %(format_spec).") % {'format_spec': 'format specifier'}
I have tried using xgettext and Django's manage.py makemessages tools to generate PO files for Python format strings, but didn't see the Python format strings being flagged as "python-format".
Also, http://www.gnu.org/software/gettext/manual/html_node/Python.html does not specify anything about the new Python format strings.
Please help me find a work around for this issue.
I suppose you are being hit by this bug: the gettext tools support only the old Python string format for substitutions. So you should use old string format. Or you can use a different tool for doing your translations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With