Index: Lib/optparse.py =================================================================== --- Lib/optparse.py (révision 87460) +++ Lib/optparse.py (copie de travail) @@ -86,10 +86,16 @@ # Id: errors.py 509 2006-04-20 00:58:24Z gward try: - from gettext import gettext + from gettext import gettext, ngettext except ImportError: def gettext(message): return message + + def ngettext(singular, plural, n): + if n == 1: + return singular + return plural + _ = gettext @@ -1479,10 +1485,10 @@ nargs = option.nargs 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)) + self.error(ngettext( + "%(option)s option requires %(number)d argument", + "%(option)s option requires %(number)d arguments", + nargs) % (opt, nargs)) elif nargs == 1: value = rargs.pop(0) else: @@ -1518,10 +1524,10 @@ nargs = option.nargs 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)) + self.error(ngettext( + "%(option)s option requires %(number)d argument", + "%(option)s option requires %(number)d arguments", + nargs) % (opt, nargs)) elif nargs == 1: value = rargs.pop(0) else: