i18n: use plural forms where needed

In particular, when the number of objects depends on a variable.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
This commit is contained in:
Pino Toscano 2020-09-17 08:44:04 +02:00 committed by Cole Robinson
parent fb8a31ba76
commit adeabb6e40

View File

@ -84,8 +84,11 @@ def _find_objects_to_edit(guest, action_name, editval, parserclass):
fail(_("No --%s objects found in the XML") %
parserclass.cli_arg_name)
if len(objlist) < abs(idx):
fail(_("'--edit %(number)s' requested but there's only %(max)s "
"--%(type)s object in the XML") %
fail(ngettext("'--edit %(number)s' requested but there's only "
"%(max)s --%(type)s object in the XML",
"'--edit %(number)s' requested but there are only "
"%(max)s --%(type)s objects in the XML",
len(objlist)) %
{"number": idx, "max": len(objlist),
"type": parserclass.cli_arg_name})