From a90966fa4ca7318f9bc74dce5a22dc7ffe76d373 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 19 Apr 2017 10:12:19 +0530 Subject: [PATCH] String changes --- src/calibre/gui2/__init__.py | 2 +- src/calibre/gui2/actions/add.py | 6 ++++-- src/calibre/gui2/actions/store.py | 4 ++-- src/calibre/gui2/add.py | 8 +++++--- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py index a1cf1849d3..89d60600bd 100644 --- a/src/calibre/gui2/__init__.py +++ b/src/calibre/gui2/__init__.py @@ -903,7 +903,7 @@ def load_builtin_fonts(): def setup_gui_option_parser(parser): if islinux: parser.add_option('--detach', default=False, action='store_true', - help=_('Detach from the controlling terminal, if any (linux only)')) + help=_('Detach from the controlling terminal, if any (Linux only)')) def show_temp_dir_error(err): diff --git a/src/calibre/gui2/actions/add.py b/src/calibre/gui2/actions/add.py index beab0015b0..bdf39a19e8 100644 --- a/src/calibre/gui2/actions/add.py +++ b/src/calibre/gui2/actions/add.py @@ -133,8 +133,10 @@ class AddAction(InterfaceAction): override = formats.intersection(nformats) if override: title = db.title(ids[0], index_is_id=True) - msg = _('The {0} format(s) will be replaced in the book {1}. Are you sure?').format( - ', '.join(override), title) + msg = ngettext( + 'The {0} format will be replaced in the book {1}. Are you sure?', + 'The {0} formats will be replaced in the book {1}. Are you sure?', + len(override)).format(', '.join(override), title) if not confirm(msg, 'confirm_format_override_on_add', title=_('Are you sure?'), parent=self.gui): return diff --git a/src/calibre/gui2/actions/store.py b/src/calibre/gui2/actions/store.py index 83a80d3078..f7c3f62f54 100644 --- a/src/calibre/gui2/actions/store.py +++ b/src/calibre/gui2/actions/store.py @@ -132,7 +132,7 @@ class StoreAction(InterfaceAction): def show_disclaimer(self): confirm(('

' + - _('Calibre helps you find the ebooks you want by searching ' + _('calibre helps you find the ebooks you want by searching ' 'the websites of various commercial and public domain ' 'book sources for you.') + '

' + @@ -141,7 +141,7 @@ class StoreAction(InterfaceAction): 'You also get DRM status and other useful information.') + '

' + _('All transactions (paid or otherwise) are handled between ' 'you and the book seller. ' - 'Calibre is not part of this process and any issues related ' + 'calibre is not part of this process and any issues related ' 'to a purchase should be directed to the website you are ' 'buying from. Be sure to double check that any books you get ' 'will work with your e-book reader, especially if the book you ' diff --git a/src/calibre/gui2/add.py b/src/calibre/gui2/add.py index 5adb286046..88591c522d 100644 --- a/src/calibre/gui2/add.py +++ b/src/calibre/gui2/add.py @@ -171,8 +171,9 @@ class Adder(QObject): unreadable_files.append(path) if unreadable_files: if not self.file_groups: - self.scan_error = _('You do not have permission to read the selected file(s).') + '\n' - self.scan_error += '\n'.join(unreadable_files) + m = ngettext('You do not have permission to read the selected file.', + 'You do not have permission to read the selected files.', len(unreadable_files)) + self.scan_error = m + '\n' + '\n'.join(unreadable_files) else: a = self.report.append for f in unreadable_files: @@ -281,7 +282,8 @@ class Adder(QObject): a = self.report.append paths = self.file_groups[group_id] a(''), a('-' * 70) - a(_('Failed to read metadata from the file(s):')) + m = ngettext('Failed to read metadata from the file:', 'Failed to read metadata from the files:', len(paths)) + a(m) [a('\t' + f) for f in paths] a(_('With error:')), a(details) mi = Metadata(_('Unknown'))