String changes

This commit is contained in:
Kovid Goyal 2021-05-12 07:41:25 +05:30
parent 5cb5c5d0c9
commit 1c9d837e08
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
18 changed files with 30 additions and 30 deletions

View File

@ -547,7 +547,7 @@ class ChooseLibraryAction(InterfaceAction):
return return
else: else:
return error_dialog(self.gui, _('Failed'), return error_dialog(self.gui, _('Failed'),
_('Database integrity check failed, click Show details' _('Database integrity check failed, click "Show details"'
' for details.'), show=True, det_msg=d.error[1]) ' for details.'), show=True, det_msg=d.error[1])
self.gui.status_bar.show_message( self.gui.status_bar.show_message(

View File

@ -518,13 +518,13 @@ class CopyToLibraryAction(InterfaceAction):
err, tb = self.worker.failed_books[book_id] err, tb = self.worker.failed_books[book_id]
title = db.title(book_id, index_is_id=True) title = db.title(book_id, index_is_id=True)
return _('Copying: {0} failed, with error:\n{1}').format(title, tb) return _('Copying: {0} failed, with error:\n{1}').format(title, tb)
title, msg = _('Failed to copy some books'), _('Could not copy some books, click "Show Details" for more information.') title, msg = _('Failed to copy some books'), _('Could not copy some books, click "Show details" for more information.')
tb = '\n\n'.join(map(fmt_err, self.worker.failed_books)) tb = '\n\n'.join(map(fmt_err, self.worker.failed_books))
tb = ngettext('Failed to copy a book, see below for details', tb = ngettext('Failed to copy a book, see below for details',
'Failed to copy {} books, see below for details', len(self.worker.failed_books)).format( 'Failed to copy {} books, see below for details', len(self.worker.failed_books)).format(
len(self.worker.failed_books)) + '\n\n' + tb len(self.worker.failed_books)) + '\n\n' + tb
if len(ids) == len(self.worker.failed_books): if len(ids) == len(self.worker.failed_books):
title, msg = _('Failed to copy books'), _('Could not copy any books, click "Show Details" for more information.') title, msg = _('Failed to copy books'), _('Could not copy any books, click "Show details" for more information.')
error_dialog(self.gui, title, msg, det_msg=tb, show=True) error_dialog(self.gui, title, msg, det_msg=tb, show=True)
return self.worker.duplicate_ids return self.worker.duplicate_ids

View File

@ -903,7 +903,7 @@ class EditMetadataAction(InterfaceAction):
error_dialog(self.gui, _('Some failures'), error_dialog(self.gui, _('Some failures'),
_('Failed to apply updated metadata for some books' _('Failed to apply updated metadata for some books'
' in your library. Click "Show Details" to see ' ' in your library. Click "Show details" to see '
'details.'), det_msg='\n\n'.join(msg), show=True) 'details.'), det_msg='\n\n'.join(msg), show=True)
changed_books = len(self.applied_ids or ()) changed_books = len(self.applied_ids or ())
self.refresh_gui(self.applied_ids) self.refresh_gui(self.applied_ids)

View File

@ -188,7 +188,7 @@ class UnpackBook(QDialog):
if det_msg is not None: if det_msg is not None:
return error_dialog(self, _('Failed to unpack'), return error_dialog(self, _('Failed to unpack'),
_('Could not explode the %s file. Click "Show Details" for ' _('Could not explode the %s file. Click "Show details" for '
'more information.')%self.current_format, det_msg=det_msg, 'more information.')%self.current_format, det_msg=det_msg,
show=True) show=True)

View File

@ -180,7 +180,7 @@ class RegexBuilder(QDialog, Ui_RegexBuilder):
def open_book(self, pathtoebook): def open_book(self, pathtoebook):
with TemporaryFile('_prepprocess_gui') as tf: with TemporaryFile('_prepprocess_gui') as tf:
err_msg = _('Failed to generate markup for testing. Click ' err_msg = _('Failed to generate markup for testing. Click '
'"Show Details" to learn more.') '"Show details" to learn more.')
try: try:
fork_job('calibre.ebooks.oeb.iterator', 'get_preprocess_html', fork_job('calibre.ebooks.oeb.iterator', 'get_preprocess_html',
(pathtoebook, tf)) (pathtoebook, tf))

View File

@ -118,7 +118,7 @@ class AddFromISBN(QDialog):
if self.books: if self.books:
if not question_dialog(self, _('Some invalid ISBNs'), if not question_dialog(self, _('Some invalid ISBNs'),
_('Some of the ISBNs you entered were invalid. They will' _('Some of the ISBNs you entered were invalid. They will'
' be ignored. Click Show Details to see which ones.' ' be ignored. Click "Show details" to see which ones.'
' Do you want to proceed?'), det_msg='\n'.join(bad), ' Do you want to proceed?'), det_msg='\n'.join(bad),
show_copy_button=True): show_copy_button=True):
return return

View File

@ -120,12 +120,12 @@ class CheckLibraryDialog(QDialog):
correct form to be a book title.</li> correct form to be a book title.</li>
<li><b>Extra titles</b>: These are extra files in your calibre <li><b>Extra titles</b>: These are extra files in your calibre
library that appear to be correctly-formed titles, but have no corresponding library that appear to be correctly-formed titles, but have no corresponding
entries in the database</li> entries in the database.</li>
<li><b>Invalid authors</b>: These are files appearing <li><b>Invalid authors</b>: These are files appearing
in the library where only author folders should be.</li> in the library where only author folders should be.</li>
<li><b>Extra authors</b>: These are folders in the <li><b>Extra authors</b>: These are folders in the
calibre library that appear to be authors but that do not have entries calibre library that appear to be authors but that do not have entries
in the database</li> in the database.</li>
<li><b>Missing book formats</b>: These are book formats that are in <li><b>Missing book formats</b>: These are book formats that are in
the database but have no corresponding format file in the book's folder. the database but have no corresponding format file in the book's folder.
<li><b>Extra book formats</b>: These are book format files found in <li><b>Extra book formats</b>: These are book format files found in

View File

@ -131,7 +131,7 @@ class RunAction(QDialog):
if self.abort.is_set(): if self.abort.is_set():
return QDialog.reject(self) return QDialog.reject(self)
if self.tb is not None: if self.tb is not None:
error_dialog(self, _('Failed'), self.err_msg + ' ' + _('Click "Show Details" for more information.'), error_dialog(self, _('Failed'), self.err_msg + ' ' + _('Click "Show details" for more information.'),
det_msg=self.tb, show=True) det_msg=self.tb, show=True)
self.accept() self.accept()

View File

@ -87,7 +87,7 @@ def _show_success_msg(restorer, parent=None):
if r.errors_occurred: if r.errors_occurred:
warning_dialog(parent, _('Success'), warning_dialog(parent, _('Success'),
_('Restoring the database succeeded with some warnings' _('Restoring the database succeeded with some warnings'
' click Show details to see the details. %s')%olddb, ' click "Show details" to see the details. %s')%olddb,
det_msg=r.report, show=True) det_msg=r.report, show=True)
else: else:
info_dialog(parent, _('Success'), info_dialog(parent, _('Success'),
@ -118,7 +118,7 @@ def restore_database(db, parent=None):
return True return True
if r.tb is not None: if r.tb is not None:
error_dialog(parent, _('Failed'), error_dialog(parent, _('Failed'),
_('Restoring database failed, click Show details to see details'), _('Restoring database failed, click "Show details" to see details'),
det_msg=r.tb, show=True) det_msg=r.tb, show=True)
else: else:
_show_success_msg(r, parent=parent) _show_success_msg(r, parent=parent)
@ -133,7 +133,7 @@ def repair_library_at(library_path, parent=None, wait_time=2):
r = d.restorer r = d.restorer
if r.tb is not None: if r.tb is not None:
error_dialog(parent, _('Failed to repair library'), error_dialog(parent, _('Failed to repair library'),
_('Restoring database failed, click Show details to see details'), _('Restoring database failed, click "Show details" to see details'),
det_msg=r.tb, show=True) det_msg=r.tb, show=True)
return False return False
_show_success_msg(r, parent=parent) _show_success_msg(r, parent=parent)

View File

@ -706,7 +706,7 @@ class ChooseTheme(Dialog):
self.end_spinner() self.end_spinner()
if not isinstance(self.themes, list): if not isinstance(self.themes, list):
error_dialog(self, _('Failed to download list of themes'), _( error_dialog(self, _('Failed to download list of themes'), _(
'Failed to download list of themes, click "Show Details" for more information'), 'Failed to download list of themes, click "Show details" for more information'),
det_msg=self.themes, show=True) det_msg=self.themes, show=True)
self.reject() self.reject()
return return
@ -783,7 +783,7 @@ class ChooseTheme(Dialog):
if self.downloaded_theme and not isinstance(self.downloaded_theme, BytesIO): if self.downloaded_theme and not isinstance(self.downloaded_theme, BytesIO):
return error_dialog(self, _('Download failed'), _( return error_dialog(self, _('Download failed'), _(
'Failed to download icon theme, click "Show Details" for more information.'), show=True, det_msg=self.downloaded_theme) 'Failed to download icon theme, click "Show details" for more information.'), show=True, det_msg=self.downloaded_theme)
if ret == QDialog.DialogCode.Rejected or not self.keep_downloading or d.canceled or self.downloaded_theme is None: if ret == QDialog.DialogCode.Rejected or not self.keep_downloading or d.canceled or self.downloaded_theme is None:
return return
dt = self.downloaded_theme dt = self.downloaded_theme

View File

@ -1152,13 +1152,13 @@ class BooksModel(QAbstractTableModel): # {{{
det_msg=p+force_unicode(traceback.format_exc()), show=True) det_msg=p+force_unicode(traceback.format_exc()), show=True)
return False return False
error_dialog(get_gui(), _('Failed to set data'), error_dialog(get_gui(), _('Failed to set data'),
_('Could not set data, click Show Details to see why.'), _('Could not set data, click "Show details" to see why.'),
det_msg=traceback.format_exc(), show=True) det_msg=traceback.format_exc(), show=True)
except: except:
import traceback import traceback
traceback.print_exc() traceback.print_exc()
error_dialog(get_gui(), _('Failed to set data'), error_dialog(get_gui(), _('Failed to set data'),
_('Could not set data, click Show Details to see why.'), _('Could not set data, click "Show details" to see why.'),
det_msg=traceback.format_exc(), show=True) det_msg=traceback.format_exc(), show=True)
return False return False

View File

@ -318,7 +318,7 @@ class GuiRunner(QObject):
details = '' details = ''
self.show_error(_('Startup error'), _( self.show_error(_('Startup error'), _(
'There was an error during {0} startup. Parts of {0} may not function.' 'There was an error during {0} startup. Parts of {0} may not function.'
' Click Show details to learn more.').format(__appname__), det_msg=details) ' Click "Show details" to learn more.').format(__appname__), det_msg=details)
def initialize_db(self): def initialize_db(self):
from calibre.db.legacy import LibraryDatabase from calibre.db.legacy import LibraryDatabase

View File

@ -737,7 +737,7 @@ class Boss(QObject):
def rename_done(self, name_map, job, from_filelist=None): def rename_done(self, name_map, job, from_filelist=None):
if job.traceback is not None: if job.traceback is not None:
return error_dialog(self.gui, _('Failed to rename files'), return error_dialog(self.gui, _('Failed to rename files'),
_('Failed to rename files, click Show details for more information.'), _('Failed to rename files, click "Show details" for more information.'),
det_msg=job.traceback, show=True) det_msg=job.traceback, show=True)
self.gui.file_list.build(current_container()) self.gui.file_list.build(current_container())
self.set_modified() self.set_modified()
@ -1263,7 +1263,7 @@ class Boss(QObject):
def copy_saved(self, job): def copy_saved(self, job):
if job.traceback is not None: if job.traceback is not None:
return error_dialog(self.gui, _('Failed to save copy'), return error_dialog(self.gui, _('Failed to save copy'),
_('Failed to save copy, click Show details for more information.'), det_msg=job.traceback, show=True) _('Failed to save copy, click "Show details" for more information.'), det_msg=job.traceback, show=True)
msg = _('Copy saved to %s') % job.result msg = _('Copy saved to %s') % job.result
info_dialog(self.gui, _('Copy saved'), msg, show=True) info_dialog(self.gui, _('Copy saved'), msg, show=True)
self.gui.show_status_message(msg, 5) self.gui.show_status_message(msg, 5)

View File

@ -276,7 +276,7 @@ class CompletionPopup(ChoosePopupWidget):
prints(result.traceback) prints(result.traceback)
if not self.completion_error_shown: if not self.completion_error_shown:
error_dialog(self, _('Completion failed'), _( error_dialog(self, _('Completion failed'), _(
'Failed to get completions, click "Show Details" for more information.' 'Failed to get completions, click "Show details" for more information.'
' Future errors during completion will be suppressed.'), det_msg=result.traceback, show=True) ' Future errors during completion will be suppressed.'), det_msg=result.traceback, show=True)
self.completion_error_shown = True self.completion_error_shown = True
self.hide() self.hide()

View File

@ -145,7 +145,7 @@ class DownloadResources(Dialog):
return self.reject() return self.reject()
if tb is not None: if tb is not None:
error_dialog(self, _('Scan failed'), _( error_dialog(self, _('Scan failed'), _(
'Failed to scan for external resources, click "Show Details" for more information.'), 'Failed to scan for external resources, click "Show details" for more information.'),
det_msg=tb, show=True) det_msg=tb, show=True)
self.reject() self.reject()
else: else:
@ -174,7 +174,7 @@ class DownloadResources(Dialog):
return self.reject() return self.reject()
if tb is not None: if tb is not None:
error_dialog(self, _('Download failed'), _( error_dialog(self, _('Download failed'), _(
'Failed to download external resources, click "Show Details" for more information.'), 'Failed to download external resources, click "Show details" for more information.'),
det_msg=tb, show=True) det_msg=tb, show=True)
self.reject() self.reject()
else: else:
@ -183,13 +183,13 @@ class DownloadResources(Dialog):
tb = ['{}\n\t{}\n'.format(url, err) for url, err in iteritems(failures)] tb = ['{}\n\t{}\n'.format(url, err) for url, err in iteritems(failures)]
if not replacements: if not replacements:
error_dialog(self, _('Download failed'), _( error_dialog(self, _('Download failed'), _(
'Failed to download external resources, click "Show Details" for more information.'), 'Failed to download external resources, click "Show details" for more information.'),
det_msg='\n'.join(tb), show=True) det_msg='\n'.join(tb), show=True)
self.reject() self.reject()
return return
else: else:
warning_dialog(self, _('Some downloads failed'), _( warning_dialog(self, _('Some downloads failed'), _(
'Failed to download some external resources, click "Show Details" for more information.'), 'Failed to download some external resources, click "Show details" for more information.'),
det_msg='\n'.join(tb), show=True) det_msg='\n'.join(tb), show=True)
self.state = 2 self.state = 2
self.wait.msg = _('Updating resources in book...') self.wait.msg = _('Updating resources in book...')
@ -216,7 +216,7 @@ class DownloadResources(Dialog):
def _replace_done(self, ret, tb): def _replace_done(self, ret, tb):
if tb is not None: if tb is not None:
error_dialog(self, _('Replace failed'), _( error_dialog(self, _('Replace failed'), _(
'Failed to replace external resources, click "Show Details" for more information.'), 'Failed to replace external resources, click "Show details" for more information.'),
det_msg=tb, show=True) det_msg=tb, show=True)
Dialog.reject(self) Dialog.reject(self)
else: else:

View File

@ -133,7 +133,7 @@ class AddDictionary(QDialog): # {{{
except: except:
import traceback import traceback
return error_dialog(self, _('Failed to import dictionaries'), _( return error_dialog(self, _('Failed to import dictionaries'), _(
'Failed to import dictionaries from %s. Click "Show Details" for more information') % oxt, 'Failed to import dictionaries from %s. Click "Show details" for more information') % oxt,
det_msg=traceback.format_exc(), show=True) det_msg=traceback.format_exc(), show=True)
if num == 0: if num == 0:
return error_dialog(self, _('No dictionaries'), _( return error_dialog(self, _('No dictionaries'), _(

View File

@ -126,7 +126,7 @@ class TOCView(QTreeView):
m.addAction(_('Expand all items at the level of {}').format(index.data()), partial(self.expand_at_level, index)) m.addAction(_('Expand all items at the level of {}').format(index.data()), partial(self.expand_at_level, index))
m.addAction(_('Collapse all items at the level of {}').format(index.data()), partial(self.collapse_at_level, index)) m.addAction(_('Collapse all items at the level of {}').format(index.data()), partial(self.collapse_at_level, index))
m.addSeparator() m.addSeparator()
m.addAction(_('Copy table of contents to clipboard'), self.copy_to_clipboard) m.addAction(_('Copy Table of Contents to clipboard'), self.copy_to_clipboard)
m.exec_(self.mapToGlobal(pos)) m.exec_(self.mapToGlobal(pos))
def copy_to_clipboard(self): def copy_to_clipboard(self):

View File

@ -329,7 +329,7 @@ class ReadUI:
return return
if end_type is not 'load': if end_type is not 'load':
return self.show_error(_('Failed to load book manifest'), return self.show_error(_('Failed to load book manifest'),
_('The book manifest failed to load, click "Show Details" for more information.').format(title=self.current_metadata.title), _('The book manifest failed to load, click "Show details" for more information.').format(title=self.current_metadata.title),
xhr.error_html) xhr.error_html)
try: try:
manifest = JSON.parse(xhr.responseText) manifest = JSON.parse(xhr.responseText)
@ -474,7 +474,7 @@ class ReadUI:
return return
if end_type is not 'load': if end_type is not 'load':
return self.show_error(_('Failed to load MathJax manifest'), return self.show_error(_('Failed to load MathJax manifest'),
_('The MathJax manifest failed to load, click "Show Details" for more information.').format(title=self.current_metadata.title), _('The MathJax manifest failed to load, click "Show details" for more information.').format(title=self.current_metadata.title),
xhr.error_html) xhr.error_html)
try: try:
manifest = JSON.parse(xhr.responseText) manifest = JSON.parse(xhr.responseText)