From d7657cd34cdd5cbdbb849a5fed8cc120ea1a918b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 11 Mar 2020 17:37:19 +0530 Subject: [PATCH] String changes --- manual/virtual_libraries.rst | 23 +++++++++++------------ src/calibre/gui2/tag_browser/ui.py | 2 +- src/pyj/book_list/local_books.pyj | 13 ++++++++++--- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/manual/virtual_libraries.rst b/manual/virtual_libraries.rst index d3138d6ced..8f471dd446 100644 --- a/manual/virtual_libraries.rst +++ b/manual/virtual_libraries.rst @@ -44,15 +44,15 @@ selected author. You can switch back to the full library at any time by once again clicking the :guilabel:`Virtual library` and selecting the entry named :guilabel:``. -Virtual libraries are based on *searches*. You can use any search as the -basis of a virtual library. The virtual library will contain only the -books matched by that search. First, type in the search you want to use -in the Search bar or build a search using the :guilabel:`Tag browser`. -When you are happy with the returned results, click the Virtual library -button, choose :guilabel:`Create library` and enter a name for the new virtual -library. The virtual library will then be created based on the search -you just typed in. Searches are very powerful, for examples of the kinds -of things you can do with them, see :ref:`search_interface`. +Virtual libraries are based on *searches*. You can use any search as the +basis of a Virtual library. The Virtual library will contain only the +books matched by that search. First, type in the search you want to use +in the Search bar or build a search using the :guilabel:`Tag browser`. +When you are happy with the returned results, click the :guilabel:`Virtual library` +button, choose :guilabel:`Create library` and enter a name for the new Virtual +library. The Virtual library will then be created based on the search +you just typed in. Searches are very powerful, for examples of the kinds +of things you can do with them, see :ref:`search_interface`. Examples of useful Virtual libraries ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -82,7 +82,7 @@ You can edit a previously created virtual library or remove it, by clicking the You can tell calibre that you always want to apply a particular virtual library when the current library is opened, by going to -:guilabel:`Preferences->Interface->Behavior`. +:guilabel:`Preferences->Interface->Behavior`. You can quickly use the current search as a temporary virtual library by clicking the :guilabel:`Virtual library` button and choosing the @@ -103,7 +103,7 @@ example, ``vl:Read`` will find all the books in the *Read* virtual library. The ``vl:Read and vl:"Science Fiction"`` will find all the books that are in both the *Read* and *Science Fiction* virtual libraries. -The value following ``vl:`` must be the name of a virtual library. If the virtual library name +The value following ``vl:`` must be the name of a virtual library. If the virtual library name contains spaces then surround it with quotes. One use for a virtual library search is in the content server. In @@ -124,4 +124,3 @@ saved search that shows you unread books, you can click the :guilabel:`Virtual Library` button and choose the :guilabel:`Additional restriction` option to show only unread Historical Fiction books. To learn about saved searches, see :ref:`saved_searches`. - diff --git a/src/calibre/gui2/tag_browser/ui.py b/src/calibre/gui2/tag_browser/ui.py index 86f37160eb..33cc4d9a55 100644 --- a/src/calibre/gui2/tag_browser/ui.py +++ b/src/calibre/gui2/tag_browser/ui.py @@ -114,7 +114,7 @@ class TagBrowserMixin(object): # {{{ if new_category_name is not None: new_name = new_category_name.replace('.', '') else: - new_name = _('New Category').replace('.', '') + new_name = _('New category').replace('.', '') n = new_name while True: new_cat = on_category_key[1:] + '.' + n diff --git a/src/pyj/book_list/local_books.pyj b/src/pyj/book_list/local_books.pyj index c815b22483..9b36bc08a3 100644 --- a/src/pyj/book_list/local_books.pyj +++ b/src/pyj/book_list/local_books.pyj @@ -3,7 +3,7 @@ from __python__ import bound_methods, hash_literals from elementmaker import E -from gettext import gettext as _ +from gettext import gettext as _, ngettext from book_list.globals import get_db from book_list.router import home, open_book @@ -62,7 +62,10 @@ def confirm_delete_all(): else: close_modal() - msg = _('This will remove all {} downloaded books from local storage. Are you sure?').format(num_of_books) + msg = ngettext( + 'This will remove the downloaded book from local storage. Are you sure?', + 'This will remove all {} downloaded books from local storage. Are you sure?', + num_of_books).format(num_of_books) m = E.div() safe_set_inner_html(m, msg) parent.appendChild(E.div( @@ -90,7 +93,11 @@ def delete_all(msg_parent, close_modal): refresh() return clear(msg_parent) - safe_set_inner_html(msg_parent, _('Deleting {} books, please wait...').format(books.length)) + safe_set_inner_html(msg_parent, ngettext( + 'Deleting one book, please wait...', + 'Deleting {} books, please wait...', + books.length or 0).format(books.length) + ) book_to_delete = books.pop() db.delete_book(book_list_data.book_data[book_to_delete], def(book, err_string): if err_string: