[issue8502] proposal: encourage xgettext rather than pygettext.py in gettext docs
New submission from jhg : Wanting to figure out how to support multiple languages in my applications I read the gettext documentation and got to the part saying one should use pygettext.py to create .po files. After copying that program from the python SVN repository I later found out that it cannot cope with plurals, i.e. ngettext(). xgettext can do that just fine. Since pygettext.py was not modified in 5 years I propose changing the documentation of gettext to encourage xgettext rather than pygettext.py. My proposed changes are attached (edited as text file; I do not know how to convert it to a webpage and hence did not test that). I used the 2.7b1 documentation, but the patch appears to apply just as well to the 3.1.2 documentation. -- assignee: georg.brandl components: Documentation files: gettext.txt.patch keywords: patch messages: 103988 nosy: georg.brandl, jhg severity: normal status: open title: proposal: encourage xgettext rather than pygettext.py in gettext docs versions: Python 2.7 Added file: http://bugs.python.org/file17048/gettext.txt.patch ___ Python tracker <http://bugs.python.org/issue8502> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8502] proposal: encourage xgettext rather than pygettext.py in gettext docs
jhg added the comment: It looks like msgfmt.py now parses 'msgid_plural' but pygettext.py does not produce these. It is still oblivious to plurals as produced by ngettext(). My originally proposed change to the documentation was to point people to the GNU xgettext/msgfmt tools rather than the pygettext.py/msgfmt.py pair because of this limitation. This has not changed. -- ___ Python tracker <http://bugs.python.org/issue8502> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8502] proposal: encourage xgettext rather than pygettext.py in gettext docs
jhg added the comment: Since the GNU tools work fine I had no reason to look into pygettext.py. Now I did it anyway... I added ngettext to the default keywords. Any function that is keyworded and supplied more than 2 keywords is treated like ngettext. Also simple constructs like _("foo" + 10*"bar") are now possible. Patch attached. -- Added file: http://bugs.python.org/file17639/pygettext.py.patch ___ Python tracker <http://bugs.python.org/issue8502> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8502] proposal: encourage xgettext rather than pygettext.py in gettext docs
jhg added the comment: A simple test case for the earlier changes. run pygettext.py and msgfmt.py and move the .mo file to ./locale/de/LC_MESSAGES/helloworld.mo to see that it prints the localized strings. -- Added file: http://bugs.python.org/file17640/helloworld.py ___ Python tracker <http://bugs.python.org/issue8502> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com