[issue4391] optparse: use proper gettext plurals forms

Dwayne Bailey report at bugs.python.org
Sat Nov 22 22:44:28 CET 2008


New submission from Dwayne Bailey <dwayne+pythonbugs at translate.org.za>:

The following code in optparse:

            if len(rargs) < nargs:
                if nargs == 1:
                    self.error(_("%s option requires an argument") % opt)
                else:
                    self.error(_("%s option requires %d arguments")
                               % (opt, nargs))

works for languages with plurals of n!=1 but will not work for many
others that have more sophisticated plurals.

I've created a patch that handles missing gettext and implements it
correctly if it is available. Be aware that I have not been able to test
the patch.

----------
components: Library (Lib)
files: optparse_proper_gettext_plurals.diff
keywords: patch
messages: 76260
nosy: dwayne
severity: normal
status: open
title: optparse: use proper gettext plurals forms
type: behavior
versions: Python 2.5
Added file: http://bugs.python.org/file12107/optparse_proper_gettext_plurals.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4391>
_______________________________________


More information about the Python-bugs-list mailing list