Fix incorrect use of ngettext

This commit is contained in:
Kovid Goyal 2019-03-07 10:18:35 +05:30
parent a4e79a2a59
commit 6c0be97ad5
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 6 additions and 4 deletions

View File

@ -483,9 +483,11 @@ class CopyToLibraryAction(InterfaceAction):
return
if delete_after:
donemsg = ngettext('Moved the book to {loc}', 'Moved {num} books to {loc}', len(self.worker.processed))
donemsg = _('Moved the book to {loc}') if len(self.worker.processed) == 1 else _(
'Moved {num} books to {loc}')
else:
donemsg = ngettext('Copied the book to {loc}', 'Copied {num} books to {loc}', len(self.worker.processed))
donemsg = _('Copied the book to {loc}') if len(self.worker.processed) == 1 else _(
'Copied {num} books to {loc}')
self.gui.status_bar.show_message(donemsg.format(num=len(self.worker.processed), loc=loc), 2000)
if self.worker.auto_merged_ids:

View File

@ -36,7 +36,7 @@ class Formats(QAbstractListModel):
if role == Qt.ToolTipRole:
fmt = self.fmts[row]
count = self.counts[fmt]
return ngettext('There is one book with the {fmt} format',
return _('There is one book with the {} format').format(fmt.upper()) if count == 1 else _(
'There are {count} books with the {fmt} format', count).format(
count=count, fmt=fmt.upper())
return None