|
88 | 88 | import sys as _sys |
89 | 89 | import textwrap as _textwrap |
90 | 90 |
|
91 | | -from gettext import gettext as _ |
| 91 | +from gettext import gettext as _, ngettext |
92 | 92 |
|
93 | 93 |
|
94 | 94 | def _callable(obj): |
@@ -1438,7 +1438,9 @@ def _check_conflict(self, action): |
1438 | 1438 | conflict_handler(action, confl_optionals) |
1439 | 1439 |
|
1440 | 1440 | def _handle_conflict_error(self, action, conflicting_actions): |
1441 | | - message = _('conflicting option string(s): %s') |
| 1441 | + message = ngettext('conflicting option string: %s', |
| 1442 | + 'conflicting option strings: %s', |
| 1443 | + len(conflicting_actions)) |
1442 | 1444 | conflict_string = ', '.join([option_string |
1443 | 1445 | for option_string, action |
1444 | 1446 | in conflicting_actions]) |
@@ -1995,7 +1997,9 @@ def _match_argument(self, action, arg_strings_pattern): |
1995 | 1997 | OPTIONAL: _('expected at most one argument'), |
1996 | 1998 | ONE_OR_MORE: _('expected at least one argument'), |
1997 | 1999 | } |
1998 | | - default = _('expected %s argument(s)') % action.nargs |
| 2000 | + default = ngettext('expected %s argument', |
| 2001 | + 'expected %s arguments', |
| 2002 | + action.nargs) % action.nargs |
1999 | 2003 | msg = nargs_errors.get(action.nargs, default) |
2000 | 2004 | raise ArgumentError(action, msg) |
2001 | 2005 |
|
|
0 commit comments