String changes

This commit is contained in:
Kovid Goyal 2017-04-24 08:24:08 +05:30
parent b3807e2f50
commit a8c5b65bb4
17 changed files with 50 additions and 45 deletions

View File

@ -1,6 +1,6 @@
.. _db_api:
API Documentation for the database interface
API documentation for the database interface
======================================================
.. module:: calibre.db.cache

View File

@ -1,6 +1,6 @@
.. _polish_api:
API Documentation for the ebook editing tools
API documentation for the e-book editing tools
===============================================
The ebook editing tools consist of a

View File

@ -1,9 +1,9 @@
.. _viewer:
The Ebook Viewer
The E-book viewer
=============================
calibre includes a built-in ebook viewer that can view all the major ebook formats.
calibre includes a built-in e-book viewer that can view all the major e-book formats.
The viewer is highly customizable and has many advanced features.
.. contents::
@ -14,11 +14,11 @@ Starting the viewer
--------------------
You can view any of the books in your calibre library by selecting the book and pressing the :guilabel:`View` button. This
will open up the book in the ebook viewer. You can also launch the viewer by itself from the Start menu in Windows
will open up the book in the e-book viewer. You can also launch the viewer by itself from the Start menu in Windows
or using the command :command:`ebook-viewer` in Linux and OS X (you have to install the command line tools on OS X
first by going to :guilabel:`Preferences->Advanced->Miscellaneous`).
Navigating around an ebook
Navigating around an e-book
-----------------------------
.. |pni| image:: images/prev_next.png
@ -33,7 +33,7 @@ Navigating around an ebook
You can "turn pages" in a book by using the :guilabel:`Page Next` and :guilabel:`Page Previous` buttons |pni|, or by pressing
the Page Down/Page Up keys. Unlike most ebook viewers, calibre does not force you to view books in paged mode. You can
the Page Down/Page Up keys. Unlike most e-book viewers, calibre does not force you to view books in paged mode. You can
scroll by amounts less than a page by using the scroll bar or various customizable keyboard shortcuts.
Bookmarks
@ -53,7 +53,7 @@ This will bring up a list of sections in the book. You can click on any of them
Navigating by location
^^^^^^^^^^^^^^^^^^^^^^^^
Ebooks, unlike paper books, have no concept of pages. Instead,
E-books, unlike paper books, have no concept of pages. Instead,
as you read through the book, you will notice that your position in the book is displayed in the upper left corner in a box
like this |navposi|. This is both your current position and the total length of the book. These numbers are independent of the screen size and font
size you are viewing the book at, and they play a similar role to page numbers in paper books.
@ -70,7 +70,7 @@ You can use this number to unambiguously refer to parts of the books when discus
in other works. You can enter these numbers in the box marked Go to at the top of the window to go to a particular
reference location.
If you click on links inside the ebook to take you to different parts of the book, such as an endnote, you can use the :guilabel:`Back` and :guilabel:`Forward` buttons
If you click on links inside the e-book to take you to different parts of the book, such as an endnote, you can use the :guilabel:`Back` and :guilabel:`Forward` buttons
in the top left corner to return to where you were. These buttons behave just like those in a web browser.
Customizing the look and feel of your reading experience

View File

@ -63,6 +63,7 @@ def entry_to_icon_text(entry, only_text=False):
icon = QIcon(pmap)
return icon, entry.get('name', entry.get('Name')) or _('Unknown')
if iswindows:
# Windows {{{
from calibre.utils.winreg.default_programs import find_programs, friendly_app_name
@ -300,6 +301,7 @@ class ChooseProgram(Dialog): # {{{
self.select_manually = True
self.reject()
oprefs.defaults['entries'] = {}
@ -353,7 +355,7 @@ class EditPrograms(Dialog): # {{{
self.bb.clear(), self.bb.setStandardButtons(self.bb.Close)
self.rb = b = self.bb.addButton(_('&Remove'), self.bb.ActionRole)
b.clicked.connect(self.remove), b.setIcon(QIcon(I('list_remove.png')))
self.cb = b = self.bb.addButton(_('Change &Icon'), self.bb.ActionRole)
self.cb = b = self.bb.addButton(_('Change &icon'), self.bb.ActionRole)
b.clicked.connect(self.change_icon), b.setIcon(QIcon(I('icon_choose.png')))
l.addWidget(self.bb)
@ -408,6 +410,7 @@ def edit_programs(file_type, parent):
d.exec_()
# }}}
registered_shortcuts = {}
@ -436,6 +439,7 @@ def register_keyboard_shortcuts(gui=None, finalize=False):
if finalize:
gui.keyboard.finalize()
if __name__ == '__main__':
from pprint import pprint
app = Application([])

View File

@ -353,7 +353,7 @@ class TagsView(QTreeView): # {{{
if action == 'set_icon':
try:
path = choose_files(self, 'choose_category_icon',
_('Change Icon for: %s')%key, filters=[
_('Change icon for: %s')%key, filters=[
('Images', ['png', 'gif', 'jpg', 'jpeg'])],
all_files=False, select_only_single_file=True)
if path:

View File

@ -42,6 +42,7 @@ def contains(l1, r1, l2, r2):
# True iff (l2, r2) if contained in (l1, r1)
return l2 > l1 and r2 < r1
builtin_snippets = { # {{{
snip_key('Lorem', 'html', 'xml'): {
'description': _('Insert filler text'),
@ -162,6 +163,7 @@ def parse_template(template, start_offset=0, is_toplevel=True, grouped=True):
# }}}
_snippets = None
user_snippets = JSONConfig('editor_snippets')
@ -565,7 +567,7 @@ class EditSnippet(QWidget):
class UserSnippets(Dialog):
def __init__(self, parent=None):
Dialog.__init__(self, _('Create/Edit snippets'), 'snippet-editor', parent=parent)
Dialog.__init__(self, _('Create/edit snippets'), 'snippet-editor', parent=parent)
self.setWindowIcon(QIcon(I('snippets.png')))
def setup_ui(self):
@ -712,6 +714,7 @@ class UserSnippets(Dialog):
self.edit_snip.apply_snip(lw.currentItem().data(Qt.UserRole), creating_snippet=True)
# }}}
if __name__ == '__main__':
from calibre.gui2 import Application
app = Application([])

View File

@ -739,7 +739,7 @@ class FileList(QTreeWidget):
filters = [oext]
fname = _('Files')
if mt in OEB_DOCS:
fname = _('HTML Files')
fname = _('HTML files')
filters = 'html htm xhtm xhtml shtml'.split()
elif is_raster_image(mt):
fname = _('Images')

View File

@ -137,7 +137,7 @@ class ImageItemDelegate(QStyledItemDelegate):
class CompressImages(Dialog):
def __init__(self, parent=None):
Dialog.__init__(self, _('Compress Images'), 'compress-images', parent=parent)
Dialog.__init__(self, _('Compress images'), 'compress-images', parent=parent)
def setup_ui(self):
from calibre.ebooks.oeb.polish.images import get_compressible_images
@ -200,7 +200,7 @@ class CompressImagesProgress(Dialog):
self.names, self.jpeg_quality = names, jpeg_quality
self.keep_going = True
self.result = (None, '')
Dialog.__init__(self, _('Compressing Images...'), 'compress-images-progress', parent=parent)
Dialog.__init__(self, _('Compressing images...'), 'compress-images-progress', parent=parent)
self.gui_loop.connect(self.update_progress, type=Qt.QueuedConnection)
self.cidone.connect(self.accept, type=Qt.QueuedConnection)
t = Thread(name='RunCompressImages', target=self.run_compress)

View File

@ -202,7 +202,7 @@ class ModeBox(QComboBox):
def __init__(self, parent):
QComboBox.__init__(self, parent)
self.addItems([_('Normal'), _('Regex'), _('Regex-Function')])
self.addItems([_('Normal'), _('Regex'), _('Regex-function')])
self.setToolTip('<style>dd {margin-bottom: 1.5ex}</style>' + _(
'''Select how the search expression is interpreted
<dl>
@ -210,7 +210,7 @@ class ModeBox(QComboBox):
<dd>The search expression is treated as normal text, calibre will look for the exact text.</dd>
<dt><b>Regex</b></dt>
<dd>The search expression is interpreted as a regular expression. See the User Manual for more help on using regular expressions.</dd>
<dt><b>Regex-Function</b></dt>
<dt><b>Regex-function</b></dt>
<dd>The search expression is interpreted as a regular expression. The replace expression is an arbitrarily powerful python function.</dd>
</dl>'''))
@ -998,8 +998,8 @@ class SavedSearches(QWidget):
self.eb2 = b = pb(_('E&xport'), _('Export saved searches'))
v.addWidget(b)
self.em = m = QMenu(_('Export'))
m.addAction(_('Export All'), lambda : QTimer.singleShot(0, partial(self.export_searches, all=True)))
m.addAction(_('Export Selected'), lambda : QTimer.singleShot(0, partial(self.export_searches, all=False)))
m.addAction(_('Export all'), lambda : QTimer.singleShot(0, partial(self.export_searches, all=True)))
m.addAction(_('Export selected'), lambda : QTimer.singleShot(0, partial(self.export_searches, all=False)))
b.setMenu(m)
self.searches.setFocus(Qt.OtherFocusReason)
@ -1433,7 +1433,7 @@ def run_search(
prefix += ' '
error_dialog(
gui_parent, _('Cannot replace'), prefix + _(
'You must first click Find, before trying to replace'), show=True)
'You must first click "Find", before trying to replace'), show=True)
return False
def do_replace():

View File

@ -858,8 +858,8 @@ class WordsView(QTableView):
for s in dictionaries.suggestions(*w):
cm.addAction(s, partial(self.change_to.emit, w, s))
m.addAction(_('Ignore/Unignore all selected words'), self.ignore_all)
a = m.addAction(_('Add/Remove all selected words'))
m.addAction(_('Ignore/un-ignore all selected words'), self.ignore_all)
a = m.addAction(_('Add/remove all selected words'))
am = QMenu()
a.setMenu(am)
for dic in sorted(dictionaries.active_user_dictionaries, key=lambda x:sort_key(x.name)):

View File

@ -432,18 +432,18 @@ class Main(MainWindow):
self.action_reload_preview = reg('view-refresh.png', _('Refresh preview'), None, 'reload-preview', ('F5',), _('Refresh preview'))
self.action_split_in_preview = reg('document-split.png', _('Split this file'), None, 'split-in-preview', (), _(
'Split file in the preview panel'))
self.action_find_next_preview = reg('arrow-down.png', _('Find Next'), None, 'find-next-preview', (), _('Find next in preview'))
self.action_find_prev_preview = reg('arrow-up.png', _('Find Previous'), None, 'find-prev-preview', (), _('Find previous in preview'))
self.action_find_next_preview = reg('arrow-down.png', _('Find next'), None, 'find-next-preview', (), _('Find next in preview'))
self.action_find_prev_preview = reg('arrow-up.png', _('Find previous'), None, 'find-prev-preview', (), _('Find previous in preview'))
# Search actions
group = _('Search')
self.action_find = treg('search.png', _('&Find/Replace'), self.boss.show_find, 'find-replace', ('Ctrl+F',), _('Show the Find/Replace panel'))
self.action_find = treg('search.png', _('&Find/replace'), self.boss.show_find, 'find-replace', ('Ctrl+F',), _('Show the Find/replace panel'))
def sreg(name, text, action, overrides={}, keys=(), description=None, icon=None):
return reg(icon, text, partial(self.boss.search_action_triggered, action, overrides), name, keys, description or text.replace('&', ''))
self.action_find_next = sreg('find-next', _('Find &Next'),
self.action_find_next = sreg('find-next', _('Find &next'),
'find', {'direction':'down'}, ('F3', 'Ctrl+G'), _('Find next match'))
self.action_find_previous = sreg('find-previous', _('Find &Previous'),
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'),
'replace', keys=('Ctrl+R'), description=_('Replace current match'))

View File

@ -622,7 +622,7 @@ class InsertLink(Dialog):
self.container = container
self.source_name = source_name
self.initial_text = initial_text
Dialog.__init__(self, _('Insert Hyperlink'), 'insert-hyperlink', parent=parent)
Dialog.__init__(self, _('Insert hyperlink'), 'insert-hyperlink', parent=parent)
self.anchor_cache = {}
def sizeHint(self):
@ -743,7 +743,7 @@ class InsertSemantics(Dialog):
for item in container.opf_xpath('//opf:guide/opf:reference[@href and @type]')}
self.final_type_map = self.original_type_map.copy()
self.create_known_type_map()
Dialog.__init__(self, _('Set Semantics'), 'insert-semantics', parent=parent)
Dialog.__init__(self, _('Set semantics'), 'insert-semantics', parent=parent)
def sizeHint(self):
return QSize(800, 600)

View File

@ -750,7 +750,7 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
self.set_number_of_books_shown()
self.update_status_bar()
def job_exception(self, job, dialog_title=_('Conversion Error'), retry_func=None):
def job_exception(self, job, dialog_title=_('Conversion error'), retry_func=None):
if not hasattr(self, '_modeless_dialogs'):
self._modeless_dialogs = []
minz = self.is_minimized_to_tray
@ -800,7 +800,7 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
idx = job.details.index('calibre.ebooks.mobi.reader.mobi6.KFXError:')
msg += '<p>' + re.sub(r'(https:\S+)', r'<a href="\1">{}</a>'.format(_('here')),
job.details[idx:].partition(':')[2].strip())
d = error_dialog(self, _('Conversion Failed'), msg, det_msg=job.details)
d = error_dialog(self, _('Conversion failed'), msg, det_msg=job.details)
d.setModal(False)
d.show()
self._modeless_dialogs.append(d)
@ -890,7 +890,7 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
if self.proceed_question.questions:
msg = _('There are library updates waiting. Are you sure you want to quit?')
if not question_dialog(self, _('Library Updates Waiting'), msg):
if not question_dialog(self, _('Library updates waiting'), msg):
return False
from calibre.db.delete_service import has_jobs

View File

@ -196,15 +196,15 @@ class BookmarkManager(QWidget):
def export_bookmarks(self):
filename = choose_save_file(
self, 'export-viewer-bookmarks', _('Export Bookmarks'),
filters=[(_('Saved Bookmarks'), ['pickle'])], all_files=False, initial_filename='bookmarks.pickle')
self, 'export-viewer-bookmarks', _('Export bookmarks'),
filters=[(_('Saved bookmarks'), ['pickle'])], all_files=False, initial_filename='bookmarks.pickle')
if filename:
with open(filename, 'wb') as fileobj:
cPickle.dump(self.get_bookmarks(), fileobj, -1)
def import_bookmarks(self):
files = choose_files(self, 'export-viewer-bookmarks', _('Import Bookmarks'),
filters=[(_('Saved Bookmarks'), ['pickle'])], all_files=False, select_only_single_file=True)
files = choose_files(self, 'export-viewer-bookmarks', _('Import bookmarks'),
filters=[(_('Saved bookmarks'), ['pickle'])], all_files=False, select_only_single_file=True)
if not files:
return
filename = files[0]
@ -230,4 +230,3 @@ class BookmarkManager(QWidget):
bookmarks.append(bm)
self.set_bookmarks([bm for bm in bookmarks if bm['title'] != 'calibre_current_page_bookmark'])
self.edited.emit(self.get_bookmarks())

View File

@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Configure Ebook viewer</string>
<string>Configure E-book viewer</string>
</property>
<property name="windowIcon">
<iconset resource="../../../../resources/images.qrc">

View File

@ -612,8 +612,8 @@ class EbookViewer(MainWindow):
def open_ebook(self, checked):
files = choose_files(self, 'ebook viewer open dialog',
_('Choose ebook'),
[(_('Ebooks'), available_input_formats())],
_('Choose e-book'),
[(_('E-books'), available_input_formats())],
all_files=False,
select_only_single_file=True)
if files:
@ -913,7 +913,7 @@ class EbookViewer(MainWindow):
self.bookmarks_menu.clear()
sc = _(' or ').join(self.view.shortcuts.get_shortcuts('Bookmark'))
self.bookmarks_menu.addAction(_("Bookmark this location [%s]") % sc, self.bookmark)
self.bookmarks_menu.addAction(_("Show/hide Bookmarks"), self.bookmarks_dock.toggleViewAction().trigger)
self.bookmarks_menu.addAction(_("Show/hide bookmarks"), self.bookmarks_dock.toggleViewAction().trigger)
self.bookmarks_menu.addSeparator()
current_page = None
self.existing_bookmarks = []
@ -961,7 +961,7 @@ class EbookViewer(MainWindow):
self.iterator.__exit__()
self.iterator = EbookIterator(pathtoebook, copy_bookmarks_to_file=self.view.document.copy_bookmarks_to_file)
self.history.clear()
self.open_progress_indicator(_('Loading ebook...'))
self.open_progress_indicator(_('Loading e-book...'))
worker = Worker(target=partial(self.iterator.__enter__, view_kepub=True))
worker.path_to_ebook = pathtoebook
worker.start()
@ -976,7 +976,7 @@ class EbookViewer(MainWindow):
DRMErrorMessage(self).exec_()
else:
r = getattr(worker.exception, 'reason', worker.exception)
error_dialog(self, _('Could not open ebook'),
error_dialog(self, _('Could not open e-book'),
as_unicode(r) or _('Unknown error'),
det_msg=tb, show=True)
self.close_progress_indicator()

View File

@ -54,7 +54,7 @@ class TableView(QDialog):
geom = gprefs.get('viewer_table_popup_geometry', None)
if geom is not None:
self.restoreGeometry(geom)
self.setWindowTitle(_('View Table'))
self.setWindowTitle(_('View table'))
self.show()
def done(self, e):
@ -81,4 +81,3 @@ class TablePopup(object):
for d in tuple(self.dialogs):
if not d.isVisible():
self.dialogs.remove(d)