[issue36837] Make il8n tools available from `python -m`

Toshio Kuratomi report at bugs.python.org
Thu May 9 17:47:11 EDT 2019


Toshio Kuratomi <a.badger at gmail.com> added the comment:

Note, I've been doing some tests of how our gettext module differs from GNU gettext and run into a few bugs and lack of features which make msgfmt unusable and limit pygettext's usefulness.

* msgfmt doesn't seem to store the charset from the .po file into the .mo file.  I think this might have been okay for the lgettext() and gettext() methods under Python2 as those probably passed the byte strings from the .mo files through verbatim.  Under Python3, however, we have to decode the byte strings to text and we can't do that without knowing the charset.  This leads to a UnicodeDecodeError on any .mo file which contains non-ascii characters (which is going to be the majority of them)

* So far, I have found that pygettext doesn't understand how to extract strings from ngettext().  This means that your code can't use plural forms if you want to use pygettext to extract the strings.

These deficiencies are probably things that need to be fixed if we're going to continue to promote these tools in the documentation.

----------
nosy: +a.badger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36837>
_______________________________________


More information about the Python-bugs-list mailing list