string changes

This commit is contained in:
Kovid Goyal 2021-11-14 11:20:47 +05:30
parent 3799336890
commit 852e5ca1dd
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
4 changed files with 13 additions and 8 deletions

View File

@ -271,7 +271,7 @@ Remove books
6. **Remove matching books from device**: Allows you to remove e-book files from a connected device that match the books that are selected in the book list. 6. **Remove matching books from device**: Allows you to remove e-book files from a connected device that match the books that are selected in the book list.
.. note:: .. note::
Note that when you use :guilabel:`Remove books` to delete books from your calibre library, the book record is permanently deleted, but on Windows and macOS the files are placed into the recycle bin. This allows you to recover them if you change your mind. Note that when you use :guilabel:`Remove books` to delete books from your calibre library, the book record is permanently deleted, but the files are placed into the :guilabel:`Recycle Bin/Trash`. This allows you to recover the files if you change your mind.
.. _configuration: .. _configuration:

View File

@ -442,3 +442,7 @@ def get_windows_number_formats():
thousands_sep, decimal_point = d['thousands_sep'], d['decimal_point'] thousands_sep, decimal_point = d['thousands_sep'], d['decimal_point']
ans = get_windows_number_formats.ans = thousands_sep, decimal_point ans = get_windows_number_formats.ans = thousands_sep, decimal_point
return ans return ans
def trash_name():
return _('Trash') if ismacos else _('Recycle Bin')

View File

@ -3,6 +3,7 @@
# License: GPLv3 Copyright: 2017, Kovid Goyal <kovid at kovidgoyal.net> # License: GPLv3 Copyright: 2017, Kovid Goyal <kovid at kovidgoyal.net>
from calibre.constants import trash_name
from calibre.db.cli import integers_from_string from calibre.db.cli import integers_from_string
from calibre.db.delete_service import delete_service from calibre.db.delete_service import delete_service
from calibre.srv.changes import books_deleted from calibre.srv.changes import books_deleted
@ -35,7 +36,7 @@ list of id numbers (you can get id numbers by using the search command). For exa
'--permanent', '--permanent',
default=False, default=False,
action='store_true', action='store_true',
help=_('Do not use the recycle bin') help=_('Do not use the {}').format(trash_name())
) )
return p return p

View File

@ -12,7 +12,7 @@ from collections import Counter
from functools import partial from functools import partial
from qt.core import QDialog, QModelIndex, QObject, QTimer from qt.core import QDialog, QModelIndex, QObject, QTimer
from calibre.constants import ismacos from calibre.constants import ismacos, trash_name
from calibre.gui2 import Aborted, error_dialog, question_dialog from calibre.gui2 import Aborted, error_dialog, question_dialog
from calibre.gui2.actions import InterfaceAction from calibre.gui2.actions import InterfaceAction
from calibre.gui2.dialogs.confirm_delete import confirm from calibre.gui2.dialogs.confirm_delete import confirm
@ -35,11 +35,11 @@ class MultiDeleter(QObject): # {{{
self.permanent = False self.permanent = False
if can_recycle and len(ids) > 100: if can_recycle and len(ids) > 100:
if question_dialog(gui, _('Are you sure?'), '<p>'+ if question_dialog(gui, _('Are you sure?'), '<p>'+
_('You are trying to delete %d books. ' _('You are trying to delete {0} books. '
'Sending so many files to the Recycle' 'Sending so many files to the {1}'
' Bin <b>can be slow</b>. Should calibre skip the' ' <b>can be slow</b>. Should calibre skip the'
' recycle bin? If you click Yes the files' ' {1}? If you click Yes the files'
' will be <b>permanently deleted</b>.')%len(ids), ' will be <b>permanently deleted</b>.').format(len(ids), trash_name()),
add_abort_button=True add_abort_button=True
): ):
self.permanent = True self.permanent = True