Localize links to the User Manual

This commit is contained in:
Kovid Goyal 2014-11-26 14:16:35 +05:30
parent cc908ac22e
commit f97cc09c21
31 changed files with 123 additions and 46 deletions

View File

@ -16,6 +16,7 @@ from calibre.utils.logging import Log
from calibre.customize.conversion import OptionRecommendation
from calibre import patheq
from calibre.ebooks.conversion import ConversionUserFeedBack
from calibre.utils.localization import localize_user_manual_link
USAGE = '%prog ' + _('''\
input_file output_file [options]
@ -41,7 +42,7 @@ To get help on them specify the input and output file and then use the -h \
option.
For full documentation of the conversion system see
''') + 'http://manual.calibre-ebook.com/conversion.html'
''') + localize_user_manual_link('http://manual.calibre-ebook.com/conversion.html')
HEURISTIC_OPTIONS = ['markup_chapter_headings',
'italicize_common_cases', 'fix_indents',

View File

@ -9,6 +9,7 @@ from PyQt5.Qt import QUrl
from calibre.gui2 import open_url
from calibre.gui2.actions import InterfaceAction
from calibre.utils.localization import localize_user_manual_link
class HelpAction(InterfaceAction):
@ -19,7 +20,7 @@ class HelpAction(InterfaceAction):
self.qaction.triggered.connect(self.show_help)
def show_help(self, *args):
open_url(QUrl('http://manual.calibre-ebook.com'))
open_url(QUrl(localize_user_manual_link('http://manual.calibre-ebook.com')))

View File

@ -14,6 +14,7 @@ from calibre.ebooks.conversion.config import load_defaults
from calibre.gui2 import gprefs, open_url, question_dialog, error_dialog
from calibre.utils.config import JSONConfig
from calibre.utils.icu import sort_key
from calibre.utils.localization import localize_user_manual_link
from catalog_epub_mobi_ui import Ui_Form
from PyQt5.Qt import (Qt, QAbstractItemView, QCheckBox, QComboBox,
@ -814,7 +815,7 @@ class PluginWidget(QWidget,Ui_Form):
'''
Display help file
'''
open_url(QUrl('http://manual.calibre-ebook.com/catalogs.html'))
open_url(QUrl(localize_user_manual_link('http://manual.calibre-ebook.com/catalogs.html')))
class CheckableTableWidgetItem(QTableWidgetItem):

View File

@ -9,12 +9,18 @@ __docformat__ = 'restructuredtext en'
from PyQt5.Qt import QDialog
from calibre.gui2.convert.font_key_ui import Ui_Dialog
from calibre.utils.localization import localize_user_manual_link
class FontKeyChooser(QDialog, Ui_Dialog):
def __init__(self, parent=None, base_font_size=0.0, font_key=None):
QDialog.__init__(self, parent)
self.setupUi(self)
try:
self.wh_label.setText(self.wh_label.text() % localize_user_manual_link(
'http://manual.calibre-ebook.com/conversion.html#font-size-rescaling'))
except TypeError:
pass # link already localized
self.default_font_key = font_key
self.default_base_font_size = base_font_size

View File

@ -29,11 +29,11 @@
</widget>
</item>
<item row="0" column="0" colspan="4">
<widget class="QLabel" name="label">
<widget class="QLabel" name="wh_label">
<property name="text">
<string>&lt;p&gt;This wizard will help you choose an appropriate font size key for your needs. Just enter the base font size of the input document and then enter an input font size. The wizard will display what font size it will be mapped to, by the font rescaling algorithm. You can adjust the algorithm by adjusting the output base font size and font key below. When you find values suitable for you, click OK.&lt;/p&gt;
&lt;p&gt;By default, if the output base font size is zero and/or no font size key is specified, calibre will use the values from the current Output Profile. &lt;/p&gt;
&lt;p&gt;See the &lt;a href=&quot;http://manual.calibre-ebook.com/conversion.html#font-size-rescaling&quot;&gt;User Manual&lt;/a&gt; for a discussion of how font size rescaling works.&lt;/p&gt;</string>
&lt;p&gt;See the &lt;a href=&quot;%s&quot;&gt;User Manual&lt;/a&gt; for a discussion of how font size rescaling works.&lt;/p&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>

View File

@ -9,6 +9,7 @@ from PyQt5.Qt import Qt
from calibre.gui2 import gprefs
from calibre.gui2.convert.heuristics_ui import Ui_Form
from calibre.gui2.convert import Widget
from calibre.utils.localization import localize_user_manual_link
class HeuristicsWidget(Widget, Ui_Form):
@ -37,6 +38,11 @@ class HeuristicsWidget(Widget, Ui_Form):
self.opt_unwrap_lines.stateChanged.connect(self.enable_unwrap)
self.enable_heuristics(self.opt_enable_heuristics.checkState())
try:
self.help_label.setText(self.help_label.text() % localize_user_manual_link(
'http://manual.calibre-ebook.com/conversion.html#heuristic-processing'))
except TypeError:
pass # link already localized
def restore_defaults(self, get_option):
Widget.restore_defaults(self, get_option)
@ -73,7 +79,7 @@ class HeuristicsWidget(Widget, Ui_Form):
def load_histories(self):
val = unicode(self.opt_replace_scene_breaks.currentText())
self.opt_replace_scene_breaks.clear()
self.opt_replace_scene_breaks.lineEdit().setText('')

View File

@ -15,9 +15,9 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<widget class="QLabel" name="help_label">
<property name="text">
<string>&lt;b&gt;Heuristic processing&lt;/b&gt; means that calibre will scan your book for common patterns and fix them. As the name implies, this involves guesswork, which means that it could end up worsening the result of a conversion, if calibre guesses wrong. Therefore, it is disabled by default. Often, if a conversion does not turn out as you expect, turning on heuristics can improve matters. Read more about the various heuristic processing options in the &lt;a href=&quot;http://manual.calibre-ebook.com/conversion.html#heuristic-processing&quot;&gt;User Manual&lt;/a&gt;.</string>
<string>&lt;b&gt;Heuristic processing&lt;/b&gt; means that calibre will scan your book for common patterns and fix them. As the name implies, this involves guesswork, which means that it could end up worsening the result of a conversion, if calibre guesses wrong. Therefore, it is disabled by default. Often, if a conversion does not turn out as you expect, turning on heuristics can improve matters. Read more about the various heuristic processing options in the &lt;a href=&quot;%s&quot;&gt;User Manual&lt;/a&gt;.</string>
</property>
<property name="wordWrap">
<bool>true</bool>

View File

@ -6,6 +6,7 @@ __docformat__ = 'restructuredtext en'
from calibre.gui2.convert.pdf_output_ui import Ui_Form
from calibre.gui2.convert import Widget
from calibre.utils.localization import localize_user_manual_link
paper_size_model = None
orientation_model = None
@ -26,6 +27,11 @@ class PluginWidget(Widget, Ui_Form):
'pdf_footer_template', 'pdf_header_template', 'pdf_add_toc', 'toc_title',
])
self.db, self.book_id = db, book_id
try:
self.hf_label.setText(self.hf_label.text() % localize_user_manual_link(
'http://manual.calibre-ebook.com/conversion.html#converting-to-pdf'))
except TypeError:
pass # link already localized
for x in get_option('paper_size').option.choices:
self.opt_paper_size.addItem(x)

View File

@ -184,9 +184,9 @@
</property>
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label_2">
<widget class="QLabel" name="hf_label">
<property name="text">
<string>You can insert headers and footers into every page of the produced PDF file by using header and footer templates. For examples, see the &lt;a href=&quot;http://manual.calibre-ebook.com/conversion.html#converting-to-pdf&quot;&gt;documentation&lt;/a&gt;.</string>
<string>You can insert headers and footers into every page of the produced PDF file by using header and footer templates. For examples, see the &lt;a href=&quot;%s&quot;&gt;documentation&lt;/a&gt;.</string>
</property>
<property name="wordWrap">
<bool>true</bool>

View File

@ -13,6 +13,7 @@ from calibre.gui2.convert import Widget
from calibre.gui2 import (error_dialog, question_dialog, choose_files,
choose_save_file)
from calibre import as_unicode
from calibre.utils.localization import localize_user_manual_link
class SearchAndReplaceWidget(Widget, Ui_Form):
@ -66,6 +67,12 @@ class SearchAndReplaceWidget(Widget, Ui_Form):
self.initialize_options(get_option, get_help, db, book_id)
try:
self.rh_label.setText(self.rh_label.text() % localize_user_manual_link(
'http://manual.calibre-ebook.com/regexp.html'))
except TypeError:
pass # link already localized
def sr_add_clicked(self):
if self.sr_search.regex:
row = self.sr_add_row(self.sr_search.regex, self.sr_replace.text())
@ -128,7 +135,7 @@ class SearchAndReplaceWidget(Widget, Ui_Form):
def sr_up_clicked(self):
self.cell_rearrange(-1)
def sr_down_clicked(self):
self.cell_rearrange(1)
@ -141,7 +148,7 @@ class SearchAndReplaceWidget(Widget, Ui_Form):
item1.setText(item2.text())
item2.setText(value)
self.search_replace.setCurrentCell(row+i, 0)
def sr_currentCellChanged(self, row, column, previousRow, previousColumn) :
if row >= 0:
self.sr_change.setEnabled(True)

View File

@ -236,9 +236,9 @@
</layout>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<widget class="QLabel" name="rh_label">
<property name="text">
<string>&lt;p&gt;Search and replace uses &lt;i&gt;regular expressions&lt;/i&gt;. See the &lt;a href=&quot;http://manual.calibre-ebook.com/regexp.html&quot;&gt;regular expressions tutorial&lt;/a&gt; to get started with regular expressions. Also clicking the wizard button below will allow you to test your regular expression against the current input document. When you are happy with an expression, click the Add button to add it to the list of expressions.</string>
<string>&lt;p&gt;Search and replace uses &lt;i&gt;regular expressions&lt;/i&gt;. See the &lt;a href=&quot;%s&quot;&gt;regular expressions tutorial&lt;/a&gt; to get started with regular expressions. Also clicking the wizard button below will allow you to test your regular expression against the current input document. When you are happy with an expression, click the Add button to add it to the list of expressions.</string>
</property>
<property name="wordWrap">
<bool>true</bool>

View File

@ -10,6 +10,7 @@ __docformat__ = 'restructuredtext en'
from calibre.gui2.convert.toc_ui import Ui_Form
from calibre.gui2.convert import Widget
from calibre.gui2 import error_dialog
from calibre.utils.localization import localize_user_manual_link
class TOCWidget(Widget, Ui_Form):
@ -30,6 +31,11 @@ class TOCWidget(Widget, Ui_Form):
self.opt_level1_toc.set_msg(_('Level &1 TOC (XPath expression):'))
self.opt_level2_toc.set_msg(_('Level &2 TOC (XPath expression):'))
self.opt_level3_toc.set_msg(_('Level &3 TOC (XPath expression):'))
try:
self.help_label.setText(self.help_label.text() % localize_user_manual_link(
'http://manual.calibre-ebook.com/conversion.html#table-of-contents'))
except TypeError:
pass # link already localized
def pre_commit_check(self):

View File

@ -105,9 +105,9 @@
<widget class="XPathEdit" name="opt_level1_toc" native="true"/>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label_2">
<widget class="QLabel" name="help_label">
<property name="text">
<string>&lt;a href=&quot;http://manual.calibre-ebook.com/conversion.html#table-of-contents&quot;&gt;Help with using these options to generate a Table of Contents&lt;/a&gt;</string>
<string>&lt;a href=&quot;%s&quot;&gt;Help with using these options to generate a Table of Contents&lt;/a&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>

View File

@ -10,6 +10,7 @@ from PyQt5.Qt import QDialog, QWidget, Qt, QDialogButtonBox, QVBoxLayout
from calibre.gui2.convert.xpath_wizard_ui import Ui_Form
from calibre.gui2.convert.xexp_edit_ui import Ui_Form as Ui_Edit
from calibre.utils.localization import localize_user_manual_link
class WizardWidget(QWidget, Ui_Form):
@ -17,6 +18,11 @@ class WizardWidget(QWidget, Ui_Form):
def __init__(self, parent=None):
QWidget.__init__(self, parent)
self.setupUi(self)
try:
self.example_label.setText(self.example_label.text() % localize_user_manual_link(
'http://manual.calibre-ebook.com/xpath.html'))
except TypeError:
pass
@property
def xpath(self):

View File

@ -125,9 +125,9 @@
<widget class="QLineEdit" name="value"/>
</item>
<item>
<widget class="QLabel" name="label_5">
<widget class="QLabel" name="example_label">
<property name="text">
<string>&lt;p&gt;For example, to match all h2 tags that have class=&quot;chapter&quot;, set tag to &lt;i&gt;h2&lt;/i&gt;, attribute to &lt;i&gt;class&lt;/i&gt; and value to &lt;i&gt;chapter&lt;/i&gt;.&lt;/p&gt;&lt;p&gt;Leaving attribute blank will match any attribute and leaving value blank will match any value. Setting tag to * will match any tag.&lt;/p&gt;&lt;p&gt;To learn more advanced usage of XPath see the &lt;a href=&quot;http://manual.calibre-ebook.com/xpath.html&quot;&gt;XPath Tutorial&lt;/a&gt;.</string>
<string>&lt;p&gt;For example, to match all h2 tags that have class=&quot;chapter&quot;, set tag to &lt;i&gt;h2&lt;/i&gt;, attribute to &lt;i&gt;class&lt;/i&gt; and value to &lt;i&gt;chapter&lt;/i&gt;.&lt;/p&gt;&lt;p&gt;Leaving attribute blank will match any attribute and leaving value blank will match any value. Setting tag to * will match any tag.&lt;/p&gt;&lt;p&gt;To learn more advanced usage of XPath see the &lt;a href=&quot;%s&quot;&gt;XPath Tutorial&lt;/a&gt;.</string>
</property>
<property name="wordWrap">
<bool>true</bool>

View File

@ -20,6 +20,7 @@ from calibre.web.feeds.recipes import custom_recipes, compile_recipe
from calibre.gui2.tweak_book.editor.text import TextEdit
from calibre.utils.icu import sort_key
from calibre.web.feeds.recipes.collection import get_builtin_recipe_collection, get_builtin_recipe_by_id
from calibre.utils.localization import localize_user_manual_link
def is_basic_recipe(src):
return re.search(r'^class BasicUserRecipe', src, flags=re.MULTILINE) is not None
@ -406,7 +407,7 @@ class AdvancedRecipe(QWidget): # {{{
self.la = la = QLabel(_(
'For help with writing advanced news recipes, see the <a href="%s">User Manual</a>'
) % 'http://manual.calibre-ebook.com/news.html')
) % localize_user_manual_link('http://manual.calibre-ebook.com/news.html'))
l.addWidget(la)
self.editor = TextEdit(self)

View File

@ -12,6 +12,7 @@ from calibre.gui2 import gprefs
from calibre.utils.icu import sort_key
from calibre.utils.config import tweaks
from calibre.utils.date import now
from calibre.utils.localization import localize_user_manual_link
box_values = {}
last_matchkind = CONTAINS_MATCH
@ -34,6 +35,7 @@ class SearchDialog(QDialog, Ui_Dialog):
def __init__(self, parent, db):
QDialog.__init__(self, parent)
self.setupUi(self)
self.um_label.setText(self.um_label.text() % localize_user_manual_link('http://manual.calibre-ebook.com/gui.html#the-search-interface'))
for val, text in [(0, '')] + [(i, date(2010, i, 1).strftime('%B')) for i in xrange(1, 13)]:
self.date_month.addItem(text, val)
for val, text in [('today', _('Today')), ('yesterday', _('Yesterday')), ('thismonth', _('This month'))]:

View File

@ -28,7 +28,7 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLabel" name="label_12">
<widget class="QLabel" name="um_label">
<property name="minimumSize">
<size>
<width>150</width>
@ -36,7 +36,7 @@
</size>
</property>
<property name="text">
<string>&lt;p&gt;You can also perform other kinds of advanced searches, for example checking for books that have no covers, combining multiple search expression using Boolean operators and so on. See the &lt;a href=&quot;http://manual.calibre-ebook.com/gui.html#the-search-interface&quot;&gt;The Search Interface&lt;/a&gt; for more information.</string>
<string>&lt;p&gt;You can also perform other kinds of advanced searches, for example checking for books that have no covers, combining multiple search expression using Boolean operators and so on. See the &lt;a href=&quot;%s&quot;&gt;The Search Interface&lt;/a&gt; for more information.</string>
</property>
<property name="wordWrap">
<bool>true</bool>

View File

@ -19,6 +19,7 @@ from calibre.ebooks.metadata.book.base import Metadata
from calibre.ebooks.metadata.book.formatter import SafeFormat
from calibre.library.coloring import (displayable_columns, color_row_key)
from calibre.gui2 import error_dialog, choose_files, pixmap_to_data
from calibre.utils.localization import localize_user_manual_link
class ParenPosition:
@ -330,12 +331,12 @@ class TemplateDialog(QDialog, Ui_TemplateDialog):
tt = _('Template language tutorial')
self.template_tutorial.setText(
'<a href="http://manual.calibre-ebook.com/template_lang.html">'
'%s</a>'%tt)
'<a href="%s">%s</a>' % (
localize_user_manual_link('http://manual.calibre-ebook.com/template_lang.html'), tt))
tt = _('Template function reference')
self.template_func_reference.setText(
'<a href="http://manual.calibre-ebook.com/template_ref.html">'
'%s</a>'%tt)
'<a href="%s">%s</a>' % (
localize_user_manual_link('http://manual.calibre-ebook.com/template_ref.html'), tt))
self.font_size_box.setValue(gprefs['gpm_template_editor_font_size'])
self.font_size_box.valueChanged.connect(self.font_size_changed)

View File

@ -15,11 +15,11 @@
</property>
<layout class="QVBoxLayout">
<item>
<widget class="QLabel" name="label">
<widget class="QLabel" name="help_label">
<property name="text">
<string>&lt;div style=&quot;font-size:10pt;&quot;&gt;
&lt;p&gt;Set a regular expression pattern to use when trying to guess ebook metadata from filenames. &lt;/p&gt;
&lt;p&gt;A &lt;a href=&quot;http://manual.calibre-ebook.com/regexp.html&quot;&gt;tutorial&lt;/a&gt; on using regular expressions is available.&lt;/p&gt;
&lt;p&gt;A &lt;a href=&quot;%s&quot;&gt;tutorial&lt;/a&gt; on using regular expressions is available.&lt;/p&gt;
&lt;p&gt;Use the &lt;b&gt;Test&lt;/b&gt; functionality below to test your regular expression on a few sample filenames (remember to include the file extension). The group names for the various metadata entries are documented in tooltips.&lt;/p&gt;&lt;/div&gt;</string>
</property>
<property name="textFormat">

View File

@ -18,6 +18,7 @@ from calibre.gui2.widgets import ComboBoxWithHelp
from calibre.utils.config_base import tweaks
from calibre.utils.icu import sort_key
from calibre.utils.search_query_parser import ParseException
from calibre.utils.localization import localize_user_manual_link
class SelectNames(QDialog): # {{{
@ -150,8 +151,8 @@ class CreateVirtualLibrary(QDialog): # {{{
or only books by <i>"My Favorite Author"</i> or only books in a particular series.</p>
<p>More information and examples are available in the
<a href="http://manual.calibre-ebook.com/virtual_libraries.html">User Manual</a>.</p>
'''))
<a href="%s">User Manual</a>.</p>
''') % localize_user_manual_link('http://manual.calibre-ebook.com/virtual_libraries.html'))
hl.setWordWrap(True)
hl.setOpenExternalLinks(True)
hl.setFrameStyle(hl.StyledPanel)

View File

@ -12,24 +12,30 @@ from PyQt5.Qt import (QDialog, QDialogButtonBox)
from calibre.gui2.store.config.chooser.adv_search_builder_ui import Ui_Dialog
from calibre.library.caches import CONTAINS_MATCH, EQUALS_MATCH
from calibre.utils.localization import localize_user_manual_link
class AdvSearchBuilderDialog(QDialog, Ui_Dialog):
def __init__(self, parent):
QDialog.__init__(self, parent)
self.setupUi(self)
try:
self.sh_label.setText(self.sh_label.text() % localize_user_manual_link(
'http://manual.calibre-ebook.com/gui.html#the-search-interface'))
except TypeError:
pass # link already localized
self.buttonBox.accepted.connect(self.advanced_search_button_pushed)
self.tab_2_button_box.accepted.connect(self.accept)
self.tab_2_button_box.rejected.connect(self.reject)
self.clear_button.clicked.connect(self.clear_button_pushed)
self.adv_search_used = False
self.mc = ''
self.tabWidget.setCurrentIndex(0)
self.tabWidget.currentChanged[int].connect(self.tab_changed)
self.tab_changed(0)
def tab_changed(self, idx):
if idx == 1:
self.tab_2_button_box.button(QDialogButtonBox.Ok).setDefault(True)

View File

@ -141,7 +141,7 @@
</layout>
</item>
<item>
<widget class="QLabel" name="label_6">
<widget class="QLabel" name="sh_label">
<property name="maximumSize">
<size>
<width>16777215</width>
@ -149,7 +149,7 @@
</size>
</property>
<property name="text">
<string>See the &lt;a href=&quot;http://manual.calibre-ebook.com/gui.html#the-search-interface&quot;&gt;User Manual&lt;/a&gt; for more help</string>
<string>See the &lt;a href=&quot;%s&quot;&gt;User Manual&lt;/a&gt; for more help</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>

View File

@ -12,24 +12,30 @@ from PyQt5.Qt import (QDialog, QDialogButtonBox)
from calibre.gui2.store.search.adv_search_builder_ui import Ui_Dialog
from calibre.library.caches import CONTAINS_MATCH, EQUALS_MATCH
from calibre.utils.localization import localize_user_manual_link
class AdvSearchBuilderDialog(QDialog, Ui_Dialog):
def __init__(self, parent):
QDialog.__init__(self, parent)
self.setupUi(self)
try:
self.sh_label.setText(self.sh_label.text() % localize_user_manual_link(
'http://manual.calibre-ebook.com/gui.html#the-search-interface'))
except TypeError:
pass # link already localized
self.buttonBox.accepted.connect(self.advanced_search_button_pushed)
self.tab_2_button_box.accepted.connect(self.accept)
self.tab_2_button_box.rejected.connect(self.reject)
self.clear_button.clicked.connect(self.clear_button_pushed)
self.adv_search_used = False
self.mc = ''
self.tabWidget.setCurrentIndex(0)
self.tabWidget.currentChanged[int].connect(self.tab_changed)
self.tab_changed(0)
def tab_changed(self, idx):
if idx == 1:
self.tab_2_button_box.button(QDialogButtonBox.Ok).setDefault(True)
@ -121,7 +127,7 @@ class AdvSearchBuilderDialog(QDialog, Ui_Dialog):
format = unicode(self.format_box.text()).strip()
if format:
ans.append('format:"' + self.mc + format + '"')
drm = '' if self.drm_combo.currentIndex() == 0 else 'true' if self.drm_combo.currentIndex() == 1 else 'false'
drm = '' if self.drm_combo.currentIndex() == 0 else 'true' if self.drm_combo.currentIndex() == 1 else 'false'
if drm:
ans.append('drm:' + drm)
download = '' if self.download_combo.currentIndex() == 0 else 'true' if self.download_combo.currentIndex() == 1 else 'false'
@ -129,7 +135,7 @@ class AdvSearchBuilderDialog(QDialog, Ui_Dialog):
ans.append('download:' + download)
affiliate = '' if self.affiliate_combo.currentIndex() == 0 else 'true' if self.affiliate_combo.currentIndex() == 1 else 'false'
if affiliate:
ans.append('affiliate:' + affiliate)
ans.append('affiliate:' + affiliate)
if ans:
return ' and '.join(ans)
return ''

View File

@ -141,7 +141,7 @@
</layout>
</item>
<item>
<widget class="QLabel" name="label_6">
<widget class="QLabel" name="sh_label">
<property name="maximumSize">
<size>
<width>16777215</width>
@ -149,7 +149,7 @@
</size>
</property>
<property name="text">
<string>See the &lt;a href=&quot;http://manual.calibre-ebook.com/gui.html#the-search-interface&quot;&gt;User Manual&lt;/a&gt; for more help</string>
<string>See the &lt;a href=&quot;%s&quot;&gt;User Manual&lt;/a&gt; for more help</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>

View File

@ -22,6 +22,7 @@ from calibre.gui2.tweak_book.editor.text import TextEdit
from calibre.utils.config import JSONConfig
from calibre.utils.icu import capitalize, upper, lower, swapcase
from calibre.utils.titlecase import titlecase
from calibre.utils.localization import localize_user_manual_link
user_functions = JSONConfig('editor-search-replace-functions')
@ -232,7 +233,7 @@ class FunctionEditor(Dialog):
self.la2 = la = QLabel(_(
'For help with creating functions, see the <a href="%s">User Manual</a>') %
'http://manual.calibre-ebook.com/function_mode.html')
localize_user_manual_link('http://manual.calibre-ebook.com/function_mode.html'))
la.setOpenExternalLinks(True)
l.addWidget(la)

View File

@ -43,6 +43,7 @@ from calibre.gui2.tweak_book.function_replace import DebugOutput
from calibre.gui2.tweak_book.editor.widget import register_text_editor_actions
from calibre.gui2.tweak_book.editor.insert_resource import InsertImage
from calibre.utils.icu import character_name, sort_key
from calibre.utils.localization import localize_user_manual_link
def open_donate():
open_url(QUrl('http://calibre-ebook.com/donate'))
@ -448,7 +449,8 @@ class Main(MainWindow):
'edit-clear.png', _('&Close other tabs'), self.central.close_all_but_current_editor, 'close-all-but-current-tab', 'Ctrl+Alt+W', _(
'Close all tabs except the current tab'))
self.action_help = treg(
'help.png', _('User &Manual'), lambda : open_url(QUrl('http://manual.calibre-ebook.com/edit.html')), 'user-manual', 'F1', _(
'help.png', _('User &Manual'), lambda : open_url(localize_user_manual_link(QUrl(
'http://manual.calibre-ebook.com/edit.html'))), 'user-manual', 'F1', _(
'Show User Manual'))
self.action_browse_images = treg(
'view-image.png', _('&Browse images in book'), self.boss.browse_images, 'browse-images', (), _(

View File

@ -21,6 +21,7 @@ from calibre.utils.config import prefs, XMLConfig
from calibre.gui2.progress_indicator import ProgressIndicator as _ProgressIndicator
from calibre.gui2.dnd import (dnd_has_image, dnd_get_image, dnd_get_files,
IMAGE_EXTENSIONS, dnd_has_extension, DownloadDialog)
from calibre.utils.localization import localize_user_manual_link
history = XMLConfig('history')
@ -64,6 +65,11 @@ class FilenamePattern(QWidget, Ui_Form): # {{{
def __init__(self, parent):
QWidget.__init__(self, parent)
self.setupUi(self)
try:
self.help_label.setText(self.help_label.text() % localize_user_manual_link(
'http://manual.calibre-ebook.com/regexp.html'))
except TypeError:
pass # link already localized
self.test_button.clicked.connect(self.do_test)
self.re.lineEdit().returnPressed[()].connect(self.do_test)

View File

@ -24,6 +24,7 @@ from calibre.gui2.wizard.finish_ui import Ui_WizardPage as FinishUI
from calibre.gui2.wizard.kindle_ui import Ui_WizardPage as KindleUI
from calibre.gui2.wizard.stanza_ui import Ui_WizardPage as StanzaUI
from calibre.gui2 import min_available_height, available_width
from calibre.utils.localization import localize_user_manual_link
from calibre.utils.config import dynamic, prefs
from calibre.gui2 import choose_dir, error_dialog
@ -484,6 +485,12 @@ class StanzaPage(QWizardPage, StanzaUI):
def __init__(self):
QWizardPage.__init__(self)
self.setupUi(self)
try:
self.instructions.setText(self.instructions.text() % localize_user_manual_link(
'http://manual.calibre-ebook.com/faq.html#how-do-i-use-calibre-with-my-ipad-iphone-ipod-touch'))
except TypeError:
pass # user manual link was already replaced
self.instructions.setOpenExternalLinks(True)
self.content_server.stateChanged[(int)].connect(self.set_port)
def initializePage(self):
@ -852,6 +859,10 @@ class FinishPage(QWizardPage, FinishUI):
def __init__(self):
QWizardPage.__init__(self)
self.setupUi(self)
try:
self.um_label.setText(self.um_label.text() % localize_user_manual_link('http://manual.calibre-ebook.com'))
except TypeError:
pass # link already localized
def nextId(self):
return -1

View File

@ -60,9 +60,9 @@
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<widget class="QLabel" name="um_label">
<property name="text">
<string>&lt;h2&gt;User Manual&lt;/h2&gt;A User Manual is also available &lt;a href=&quot;http://manual.calibre-ebook.com&quot;&gt;online&lt;/a&gt;.</string>
<string>&lt;h2&gt;User Manual&lt;/h2&gt;A User Manual is also available &lt;a href=&quot;%s&quot;&gt;online&lt;/a&gt;.</string>
</property>
<property name="wordWrap">
<bool>true</bool>

View File

@ -70,7 +70,7 @@
<widget class="QLabel" name="instructions">
<property name="text">
<string>&lt;p&gt;Remember to leave calibre running as the server only runs as long as calibre is running.
&lt;p&gt;The reader app should see your calibre collection automatically. If not, try adding the URL http://myhostname:8080 as a new catalog in the reader on your iDevice. Here myhostname should be the fully qualified hostname or the IP address of the computer calibre is running on. See &lt;a href=&quot;http://manual.calibre-ebook.com/faq.html#how-do-i-use-app-with-my-ipad-iphone-ipod-touch&quot;&gt;the User Manual&lt;/a&gt; for more information.</string>
&lt;p&gt;The reader app should see your calibre collection automatically. If not, try adding the URL http://myhostname:8080 as a new catalog in the reader on your iDevice. Here myhostname should be the fully qualified hostname or the IP address of the computer calibre is running on. See &lt;a href=&quot;%s&quot;&gt;the User Manual&lt;/a&gt; for more information.</string>
</property>
<property name="wordWrap">
<bool>true</bool>