From 6c0be97ad5b4f5d85156ebce2d59a438cba9b525 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 7 Mar 2019 10:18:35 +0530 Subject: [PATCH] Fix incorrect use of ngettext --- src/calibre/gui2/actions/copy_to_library.py | 6 ++++-- src/calibre/gui2/dialogs/select_formats.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/calibre/gui2/actions/copy_to_library.py b/src/calibre/gui2/actions/copy_to_library.py index f9a1e269e4..b9ef0d644f 100644 --- a/src/calibre/gui2/actions/copy_to_library.py +++ b/src/calibre/gui2/actions/copy_to_library.py @@ -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: diff --git a/src/calibre/gui2/dialogs/select_formats.py b/src/calibre/gui2/dialogs/select_formats.py index 62ace67c3e..eb2d776923 100644 --- a/src/calibre/gui2/dialogs/select_formats.py +++ b/src/calibre/gui2/dialogs/select_formats.py @@ -36,8 +36,8 @@ 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', - 'There are {count} books with the {fmt} format', count).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