From 0161d6ce08a6792da8b0cfae806ca12d9a70e65b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 7 Mar 2019 10:59:36 +0530 Subject: [PATCH] Some more incorrect uses of ngettext --- src/calibre/gui2/auto_add.py | 2 +- src/calibre/gui2/tools.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/calibre/gui2/auto_add.py b/src/calibre/gui2/auto_add.py index 124ee60faa..635e6833f7 100644 --- a/src/calibre/gui2/auto_add.py +++ b/src/calibre/gui2/auto_add.py @@ -316,7 +316,7 @@ class AutoAdder(QObject): if count > 0: m.books_added(count) gui.status_bar.show_message( - ngettext('Added a book automatically from {src}', 'Added {num} books automatically from {src}', count).format( + (_('Added a book automatically from {src}') if count == 1 else _('Added {num} books automatically from {src}')).format( num=count, src=self.worker.path), 2000) gui.refresh_cover_browser() diff --git a/src/calibre/gui2/tools.py b/src/calibre/gui2/tools.py index a2844eb162..ee13557ac6 100644 --- a/src/calibre/gui2/tools.py +++ b/src/calibre/gui2/tools.py @@ -118,10 +118,11 @@ def convert_single_ebook(parent, db, book_ids, auto_conversion=False, # {{{ msg = '%s' % '\n'.join(res) warning_dialog(parent, _('Could not convert some books'), - ngettext( - 'Could not convert the book because no supported source format was found', - 'Could not convert {num} of {tot} books, because no supported source formats were found.', - len(res)).format(num=len(res), tot=total), + ( + _('Could not convert the book because no supported source format was found') + if len(res) == 1 else + _('Could not convert {num} of {tot} books, because no supported source formats were found.'), + ).format(num=len(res), tot=total), msg).exec_() return jobs, changed, bad