From 002f941c7dae5a172d918d634c5321637f2c642a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 6 May 2017 09:18:49 +0530 Subject: [PATCH] String changes --- manual/conversion.rst | 6 ++-- manual/creating_plugins.rst | 28 +++++++++---------- manual/customize.rst | 2 +- manual/develop.rst | 2 +- manual/faq.rst | 2 +- manual/plugins.rst | 2 +- manual/polish.rst | 2 +- src/calibre/customize/__init__.py | 16 +++++------ src/calibre/customize/ui.py | 8 +++--- src/calibre/ebooks/metadata/archive.py | 5 ++-- src/calibre/gui2/actions/__init__.py | 4 +-- .../gui2/dialogs/choose_plugin_toolbars.py | 3 +- src/calibre/gui2/dialogs/plugin_updater.py | 4 +-- .../gui2/preferences/device_user_defined.py | 3 +- .../store/stores/mobileread/store_dialog.ui | 2 +- src/calibre/gui2/store/web_store_dialog.ui | 2 +- src/calibre/gui2/tweak_book/__init__.py | 2 +- src/calibre/gui2/tweak_book/ui.py | 10 +++---- 18 files changed, 51 insertions(+), 52 deletions(-) diff --git a/manual/conversion.rst b/manual/conversion.rst index 77094c3d58..f3b06add10 100644 --- a/manual/conversion.rst +++ b/manual/conversion.rst @@ -79,9 +79,9 @@ The four sub-directories are: ========== ============= If you want to edit the input document a little before having calibre convert it, the best thing to -do is edit the files in the :file:`input` sub-directory, then zip it up, and use the zip file as the +do is edit the files in the :file:`input` sub-directory, then ZIP it up, and use the ZIP file as the input format for subsequent conversions. To do this use the :guilabel:`Edit meta information` dialog -to add the zip file as a format for the book and then, in the top left corner of the conversion dialog, +to add the ZIP file as a format for the book and then, in the top left corner of the conversion dialog, select ZIP as the input format. This document will deal mainly with the various transforms that operate on the intermediate XHTML @@ -735,7 +735,7 @@ output ranging anywhere from decent to unusable, depending on the input PDF. Comic book collections ~~~~~~~~~~~~~~~~~~~~~~~~~ -A comic book collection is a .cbc file. A .cbc file is a zip file that contains other CBZ/CBR files. In addition the +A comic book collection is a .cbc file. A .cbc file is a ZIP file that contains other CBZ/CBR files. In addition the .cbc file must contain a simple text file called comics.txt, encoded in UTF-8. The comics.txt file must contain a list of the comics files inside the .cbc file, in the form filename:title, as shown below:: diff --git a/manual/creating_plugins.rst b/manual/creating_plugins.rst index 9572b0aba5..30722736cc 100644 --- a/manual/creating_plugins.rst +++ b/manual/creating_plugins.rst @@ -17,7 +17,7 @@ Here, we will teach you how to create your own plugins to add new features to ca Anatomy of a calibre plugin --------------------------- -A calibre plugin is very simple, it's just a zip file that contains some Python code +A calibre plugin is very simple, it's just a ZIP file that contains some Python code and any other resources like image files needed by the plugin. Without further ado, let's see a basic example. @@ -50,7 +50,7 @@ A User Interface plugin ------------------------- This plugin will be spread over a few files (to keep the code clean). It will show you how to get resources -(images or data files) from the plugin zip file, allow users to configure your plugin, +(images or data files) from the plugin ZIP file, allow users to configure your plugin, how to create elements in the calibre user interface and how to access and query the books database in calibre. @@ -58,19 +58,19 @@ You can download this plugin from `interface_demo_plugin.zip Miscellaneous->Create icon theme`, select the folder where you have put your icons (usually the :file:`resources/images` folder in the calibre config directory, as described above). Then fill up the theme -metadata and click OK. This will result in a zip file containing the theme +metadata and click OK. This will result in a ZIP file containing the theme icons. You can upload that to the calibre forum at `Mobileread `_ and then I will make your theme available via calibre's builtin icon theme system. diff --git a/manual/develop.rst b/manual/develop.rst index 50c7427d9b..a0f43d3117 100644 --- a/manual/develop.rst +++ b/manual/develop.rst @@ -26,7 +26,7 @@ For example, adding support for a new device to calibre typically involves writi a device driver plugin. You can browse the `built-in drivers `_. Similarly, adding support for new conversion formats involves writing input/output format plugins. Another example of the modular design is the :ref:`recipe system ` for -fetching news. For more examples of plugins designed to add features to calibre, see the `plugin index `_. +fetching news. For more examples of plugins designed to add features to calibre, see the `Index of plugins `_. .. _code_layout: diff --git a/manual/faq.rst b/manual/faq.rst index 88775777cb..5f961b67ba 100644 --- a/manual/faq.rst +++ b/manual/faq.rst @@ -48,7 +48,7 @@ How do I convert my file containing non-English characters, or smart quotes? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There are two aspects to this problem: 1. Knowing the encoding of the source file: calibre tries to guess what character encoding your source files use, but often, this is impossible, so you need to tell it what encoding to use. This can be done in the GUI via the :guilabel:`Input character encoding` field in the :guilabel:`Look & feel->Text` section of the conversion dialog. The command-line tools have an :option:`ebook-convert-txt-input --input-encoding` option. - 2. When adding HTML files to calibre, you may need to tell calibre what encoding the files are in. To do this go to :guilabel:`Preferences->Plugins->File Type plugins` and customize the HTML2Zip plugin, telling it what encoding your HTML files are in. Now when you add HTML files to calibre they will be correctly processed. HTML files from different sources often have different encodings, so you may have to change this setting repeatedly. A common encoding for many files from the web is ``cp1252`` and I would suggest you try that first. Note that when converting HTML files, leave the input encoding setting mentioned above blank. This is because the HTML2ZIP plugin automatically converts the HTML files to a standard encoding (utf-8). + 2. When adding HTML files to calibre, you may need to tell calibre what encoding the files are in. To do this go to :guilabel:`Preferences->Advanced->Plugins->File Type plugins` and customize the HTML2Zip plugin, telling it what encoding your HTML files are in. Now when you add HTML files to calibre they will be correctly processed. HTML files from different sources often have different encodings, so you may have to change this setting repeatedly. A common encoding for many files from the web is ``cp1252`` and I would suggest you try that first. Note that when converting HTML files, leave the input encoding setting mentioned above blank. This is because the HTML2ZIP plugin automatically converts the HTML files to a standard encoding (utf-8). What's the deal with Table of Contents in MOBI files? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/manual/plugins.rst b/manual/plugins.rst index df5f41883d..8b2139488a 100644 --- a/manual/plugins.rst +++ b/manual/plugins.rst @@ -154,7 +154,7 @@ The base class for such devices is :class:`calibre.devices.usbms.driver.USBMS`. User Interface Actions -------------------------- -If you are adding your own plugin in a zip file, you should subclass both InterfaceActionBase and InterfaceAction. The :meth:`load_actual_plugin` method of your InterfaceActionBase subclass must return an instantiated object of your InterfaceBase subclass. +If you are adding your own plugin in a ZIP file, you should subclass both InterfaceActionBase and InterfaceAction. The :meth:`load_actual_plugin` method of your InterfaceActionBase subclass must return an instantiated object of your InterfaceBase subclass. .. autoclass:: calibre.gui2.actions.InterfaceAction diff --git a/manual/polish.rst b/manual/polish.rst index f254572ca2..009426f0a7 100644 --- a/manual/polish.rst +++ b/manual/polish.rst @@ -17,7 +17,7 @@ You obtain a container object for a book at a path like this:: from calibre.ebooks.oeb.polish.container import get_container container = get_container('Path to book file', tweak_mode=True) -If you are writing a plugin for the e-book editor, you get the current container +If you are writing a plugin for the E-book editor, you get the current container for the book being edited like this:: from calibre.gui2.tweak_book import current_container diff --git a/src/calibre/customize/__init__.py b/src/calibre/customize/__init__.py index f918f650cd..3f9db72981 100644 --- a/src/calibre/customize/__init__.py +++ b/src/calibre/customize/__init__.py @@ -26,7 +26,7 @@ class Plugin(object): # {{{ ''' A calibre plugin. Useful members include: - * ``self.plugin_path``: Stores path to the zip file that contains + * ``self.plugin_path``: Stores path to the ZIP file that contains this plugin or None if it is a builtin plugin * ``self.site_customization``: Stores a customization string entered @@ -91,7 +91,7 @@ class Plugin(object): # {{{ plugin will be initialized for every new worker process. Perform any plugin specific initialization here, such as extracting - resources from the plugin zip file. The path to the zip file is + resources from the plugin ZIP file. The path to the ZIP file is available as ``self.plugin_path``. Note that ``self.site_customization`` is **not** available at this point. @@ -213,10 +213,10 @@ class Plugin(object): # {{{ pixmap.loadFromData(self.load_resources(['images/icon.png']).itervalues().next()) icon = QIcon(pixmap) - :param names: List of paths to resources in the zip file using / as separator + :param names: List of paths to resources in the ZIP file using / as separator :return: A dictionary of the form ``{name: file_contents}``. Any names - that were not found in the zip file will not be present in the + that were not found in the ZIP file will not be present in the dictionary. ''' @@ -402,7 +402,7 @@ class MetadataReaderPlugin(Plugin): # {{{ ''' A plugin that implements reading metadata from a set of file types. ''' - #: Set of file types for which this plugin should be run + #: Set of file types for which this plugin should be run. #: For example: ``set(['lit', 'mobi', 'prc'])`` file_types = set([]) @@ -434,7 +434,7 @@ class MetadataWriterPlugin(Plugin): # {{{ ''' A plugin that implements reading metadata from a set of file types. ''' - #: Set of file types for which this plugin should be run + #: Set of file types for which this plugin should be run. #: For example: ``set(['lit', 'mobi', 'prc'])`` file_types = set([]) @@ -470,7 +470,7 @@ class CatalogPlugin(Plugin): # {{{ resources_path = None - #: Output file type for which this plugin should be run + #: Output file type for which this plugin should be run. #: For example: 'epub' or 'xml' file_types = set([]) @@ -546,7 +546,7 @@ class CatalogPlugin(Plugin): # {{{ def initialize(self): ''' If plugin is not a built-in, copy the plugin's .ui and .py files from - the zip file to $TMPDIR. + the ZIP file to $TMPDIR. Tab will be dynamically generated and added to the Catalog Options dialog in calibre.gui2.dialogs.catalog.py:Catalog ''' diff --git a/src/calibre/customize/ui.py b/src/calibre/customize/ui.py index 10ad93692a..0e13051585 100644 --- a/src/calibre/customize/ui.py +++ b/src/calibre/customize/ui.py @@ -52,7 +52,7 @@ def find_plugin(name): def load_plugin(path_to_zip_file): # {{{ ''' - Load plugin from zip file or raise InvalidPlugin error + Load plugin from ZIP file or raise InvalidPlugin error :return: A :class:`Plugin` instance. ''' @@ -669,7 +669,7 @@ def initialize_plugin(plugin, path_to_zip_file): def has_external_plugins(): - 'True if there are updateable (zip file based) plugins' + 'True if there are updateable (ZIP file based) plugins' return bool(config['plugins']) @@ -756,10 +756,10 @@ def option_parser(): Customize calibre by loading external plugins. ''')) parser.add_option('-a', '--add-plugin', default=None, - help=_('Add a plugin by specifying the path to the zip file containing it.')) + help=_('Add a plugin by specifying the path to the ZIP file containing it.')) parser.add_option('-b', '--build-plugin', default=None, help=_('For plugin developers: Path to the directory where you are' - ' developing the plugin. This command will automatically zip ' + ' developing the plugin. This command will automatically ZIP ' 'up the plugin and update it in calibre.')) parser.add_option('-r', '--remove-plugin', default=None, help=_('Remove a custom plugin by name. Has no effect on builtin plugins')) diff --git a/src/calibre/ebooks/metadata/archive.py b/src/calibre/ebooks/metadata/archive.py index 938ab24bc5..0eba02e2e2 100644 --- a/src/calibre/ebooks/metadata/archive.py +++ b/src/calibre/ebooks/metadata/archive.py @@ -42,8 +42,8 @@ class ArchiveExtract(FileTypePlugin): name = 'Archive Extract' author = 'Kovid Goyal' description = _('Extract common e-book formats from archives ' - '(zip/rar) files. Also try to autodetect if they are actually ' - 'cbz/cbr files.') + '(ZIP/RAR) files. Also try to autodetect if they are actually ' + 'CBZ/CBR files.') file_types = set(['zip', 'rar']) supported_platforms = ['windows', 'osx', 'linux'] on_import = True @@ -175,4 +175,3 @@ def get_comic_metadata(stream, stream_type, series_index='volume'): get_comic_book_info(m[cat], mi, series_index=series_index) break return mi - diff --git a/src/calibre/gui2/actions/__init__.py b/src/calibre/gui2/actions/__init__.py index 8c73623273..5a76067b97 100644 --- a/src/calibre/gui2/actions/__init__.py +++ b/src/calibre/gui2/actions/__init__.py @@ -279,10 +279,10 @@ class InterfaceAction(QObject): pixmap.loadFromData(self.load_resources(['images/icon.png']).itervalues().next()) icon = QIcon(pixmap) - :param names: List of paths to resources in the zip file using / as separator + :param names: List of paths to resources in the ZIP file using / as separator :return: A dictionary of the form ``{name : file_contents}``. Any names - that were not found in the zip file will not be present in the + that were not found in the ZIP file will not be present in the dictionary. ''' diff --git a/src/calibre/gui2/dialogs/choose_plugin_toolbars.py b/src/calibre/gui2/dialogs/choose_plugin_toolbars.py index e5d903a626..db08af77c5 100644 --- a/src/calibre/gui2/dialogs/choose_plugin_toolbars.py +++ b/src/calibre/gui2/dialogs/choose_plugin_toolbars.py @@ -45,7 +45,7 @@ class ChoosePluginToolbarsDialog(QDialog): self._footer_label = QLabel( _('You can also customise the plugin locations ' - 'using Preferences -> Customise the toolbar')) + 'using Preferences -> Interface -> Toolbars')) self._layout.addWidget(self._footer_label) button_box = QDialogButtonBox(QDialogButtonBox.Ok | @@ -60,4 +60,3 @@ class ChoosePluginToolbarsDialog(QDialog): for row in self._locations_list.selectionModel().selectedRows(): selected.append(self.locations[row.row()]) return selected - diff --git a/src/calibre/gui2/dialogs/plugin_updater.py b/src/calibre/gui2/dialogs/plugin_updater.py index 82dfc63fed..2eee95456f 100644 --- a/src/calibre/gui2/dialogs/plugin_updater.py +++ b/src/calibre/gui2/dialogs/plugin_updater.py @@ -706,8 +706,8 @@ class PluginUpdaterDialog(SizePersistedDialog): plugin_zip_url = display_plugin.zip_url if DEBUG: - prints('Downloading plugin zip attachment: ', plugin_zip_url) - self.gui.status_bar.showMessage(_('Downloading plugin zip attachment: %s') % plugin_zip_url) + prints('Downloading plugin ZIP attachment: ', plugin_zip_url) + self.gui.status_bar.showMessage(_('Downloading plugin ZIP attachment: %s') % plugin_zip_url) zip_path = self._download_zip(plugin_zip_url) if DEBUG: diff --git a/src/calibre/gui2/preferences/device_user_defined.py b/src/calibre/gui2/preferences/device_user_defined.py index d57c5ff9ce..eb7b7886bf 100644 --- a/src/calibre/gui2/preferences/device_user_defined.py +++ b/src/calibre/gui2/preferences/device_user_defined.py @@ -79,7 +79,7 @@ class UserDefinedDevice(QDialog): trailer = _( 'Copy these values to the clipboard, paste them into an ' 'editor, then enter them into the USER_DEVICE by ' - 'customizing the device plugin in Preferences->Plugins. ' + 'customizing the device plugin in Preferences->Advanced->Plugins. ' 'Remember to also enter the folders where you want the books to ' 'be put. You must restart calibre for your changes ' 'to take effect.\n') @@ -90,6 +90,7 @@ class UserDefinedDevice(QDialog): def copy_to_clipboard(self): QApplication.clipboard().setText(self.log.toPlainText()) + if __name__ == '__main__': app = QApplication([]) d = UserDefinedDevice() diff --git a/src/calibre/gui2/store/stores/mobileread/store_dialog.ui b/src/calibre/gui2/store/stores/mobileread/store_dialog.ui index 3026260a58..0740f303b8 100644 --- a/src/calibre/gui2/store/stores/mobileread/store_dialog.ui +++ b/src/calibre/gui2/store/stores/mobileread/store_dialog.ui @@ -106,7 +106,7 @@ - Close + &Close diff --git a/src/calibre/gui2/store/web_store_dialog.ui b/src/calibre/gui2/store/web_store_dialog.ui index 34849730f7..40f143651c 100644 --- a/src/calibre/gui2/store/web_store_dialog.ui +++ b/src/calibre/gui2/store/web_store_dialog.ui @@ -75,7 +75,7 @@ - Close + &Close diff --git a/src/calibre/gui2/tweak_book/__init__.py b/src/calibre/gui2/tweak_book/__init__.py index 7ce83810c6..92901c7a2d 100644 --- a/src/calibre/gui2/tweak_book/__init__.py +++ b/src/calibre/gui2/tweak_book/__init__.py @@ -154,4 +154,4 @@ def update_mark_text_action(ed=None): if ed is not None and ed.has_line_numbers: has_mark = bool(ed.selected_text) or not ed.has_marked_text ac = actions['mark-selected-text'] - ac.setText(ac.default_text if has_mark else _('Unmark marked text')) + ac.setText(ac.default_text if has_mark else _('&Unmark marked text')) diff --git a/src/calibre/gui2/tweak_book/ui.py b/src/calibre/gui2/tweak_book/ui.py index 1ba4ddac89..366a9cc268 100644 --- a/src/calibre/gui2/tweak_book/ui.py +++ b/src/calibre/gui2/tweak_book/ui.py @@ -333,7 +333,7 @@ class Main(MainWindow): self.action_new_file = treg('document-new.png', _('&New file (images/fonts/HTML/etc.)'), self.boss.add_file, 'new-file', (), _('Create a new file in the current book')) self.action_import_files = treg('document-import.png', _('&Import files into book'), self.boss.add_files, 'new-files', (), _('Import files into book')) - self.action_open_book = treg('document_open.png', _('Open &book'), self.boss.open_book, 'open-book', 'Ctrl+O', _('Open a new book')) + self.action_open_book = treg('document_open.png', _('&Open book'), self.boss.open_book, 'open-book', 'Ctrl+O', _('Open a new book')) self.action_open_book_folder = treg('mimetypes/dir.png', _('Open &folder (unzipped EPUB) as book'), partial(self.boss.open_book, open_folder=True), 'open-folder-as-book', (), _('Open a folder (unzipped EPUB) as a book')) # Qt does not generate shortcut overrides for cmd+arrow on os x which @@ -445,7 +445,7 @@ class Main(MainWindow): 'find', {'direction':'down'}, ('F3', 'Ctrl+G'), _('Find next match')) self.action_find_previous = sreg('find-previous', _('Find &previous'), 'find', {'direction':'up'}, ('Shift+F3', 'Shift+Ctrl+G'), _('Find previous match')) - self.action_replace = sreg('replace', _('Replace'), + self.action_replace = sreg('replace', _('&Replace'), 'replace', keys=('Ctrl+R'), description=_('Replace current match')) self.action_replace_next = sreg('replace-next', _('&Replace and find next'), 'replace-find', {'direction':'down'}, ('Ctrl+]'), _('Replace current match and find next')) @@ -461,7 +461,7 @@ class Main(MainWindow): self.action_go_to_line = reg(None, _('Go to &line'), self.boss.go_to_line_number, 'go-to-line-number', ('Ctrl+.',), _('Go to line number')) self.action_saved_searches = treg('folder_saved_search.png', _('Sa&ved searches'), self.boss.saved_searches, 'saved-searches', (), _('Show the saved searches dialog')) - self.action_text_search = treg('view.png', _('Search ignoring HTML markup'), + self.action_text_search = treg('view.png', _('&Search ignoring HTML markup'), self.boss.show_text_search, 'text-search', (), _('Show the text search panel')) # Check Book actions @@ -566,7 +566,7 @@ class Main(MainWindow): e.addAction(self.action_set_semantics) e.addAction(self.action_filter_css) e.addAction(self.action_spell_check_book) - er = e.addMenu(_('External links')) + er = e.addMenu(_('External &links')) er.addAction(self.action_check_external_links) er.addAction(self.action_get_ext_resources) e.addAction(self.action_check_book) @@ -617,7 +617,7 @@ class Main(MainWindow): e = b.addMenu(_('&Help')) a = e.addAction a(self.action_help) - a(QIcon(I('donate.png')), _('Donate to support calibre development'), open_donate) + a(QIcon(I('donate.png')), _('&Donate to support calibre development'), open_donate) a(self.action_preferences) def search_menu_about_to_show(self):