Index: trunk/virtaal/source_tree_infrastructure/optparse.py =================================================================== --- trunk.orig/virtaal/source_tree_infrastructure/optparse.py +++ trunk/virtaal/source_tree_infrastructure/optparse.py @@ -81,11 +81,16 @@ def _repr(self): # 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 +n_ = ngettext class OptParseError (Exception): @@ -1480,11 +1485,7 @@ class OptionParser (OptionContainer): if option.takes_value(): 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(n_("%s option requires %d arguments") % % (opt, nargs)) elif nargs == 1: value = rargs.pop(0) else: