Fix #1892579 [[Translation] Parts of the calibredb section in the User Manual are not translatable](https://bugs.launchpad.net/calibre/+bug/1892579)

This commit is contained in:
Kovid Goyal 2020-08-24 12:29:20 +05:30
parent 984bb98fc7
commit dec4ad041f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1,16 +1,15 @@
#!/usr/bin/env python #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
# License: GPLv3 Copyright: 2008, Kovid Goyal <kovid at kovidgoyal.net>
import os
__license__ = 'GPL v3' import re
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
import os, re, textwrap
from functools import partial from functools import partial
from sphinx.util.console import bold from sphinx.util.console import bold
from sphinx.util.logging import getLogger from sphinx.util.logging import getLogger
from calibre.linux import entry_points, cli_index_strings from calibre.linux import cli_index_strings, entry_points
from epub import EPUBHelpBuilder from epub import EPUBHelpBuilder
from latex import LaTeXHelpBuilder from latex import LaTeXHelpBuilder
@ -94,19 +93,19 @@ def titlecase(app, x):
def generate_calibredb_help(preamble, app): def generate_calibredb_help(preamble, app):
from calibre.db.cli.main import COMMANDS, option_parser_for, get_parser from calibre.db.cli.main import COMMANDS, option_parser_for, get_parser
preamble = preamble[:preamble.find('\n\n\n', preamble.find('code-block'))] preamble = preamble[:preamble.find('\n\n\n', preamble.find('code-block'))]
preamble += textwrap.dedent(''' preamble += '\n\n'
preamble += _('''\
:command:`calibredb` is the command line interface to the calibre database. It has
several sub-commands, documented below.
:command:`calibredb` is the command line interface to the calibre database. It has :command:`calibredb` can be used to manipulate either a calibre database
several sub-commands, documented below. specified by path or a calibre :guilabel:`Content server` running either on
the local machine or over the internet. You can start a calibre
:command:`calibredb` can be used to manipulate either a calibre database :guilabel:`Content server` using either the :command:`calibre-server`
specified by path or a calibre :guilabel:`Content server` running either on program or in the main calibre program click :guilabel:`Connect/share ->
the local machine or over the internet. You can start a calibre Start Content server`. Since :command:`calibredb` can make changes to your
:guilabel:`Content server` using either the :command:`calibre-server` calibre libraries, you must setup authentication on the server first. There
program or in the main calibre program click :guilabel:`Connect/share -> are two ways to do that:
Start Content server`. Since :command:`calibredb` can make changes to your
calibre libraries, you must setup authentication on the server first. There
are two ways to do that:
* If you plan to connect only to a server running on the same computer, * If you plan to connect only to a server running on the same computer,
you can simply use the ``--enable-local-write`` option of the you can simply use the ``--enable-local-write`` option of the
@ -123,9 +122,9 @@ def generate_calibredb_help(preamble, app):
If you are running the server from the main calibre program, use If you are running the server from the main calibre program, use
:guilabel:`Preferences->Sharing over the net->Require username/password`. :guilabel:`Preferences->Sharing over the net->Require username/password`.
To connect to a running Content server, pass the URL of the server to the To connect to a running Content server, pass the URL of the server to the
:option:`--with-library` option, see the documentation of that option for :option:`--with-library` option, see the documentation of that option for
details and examples. details and examples.
''') ''')
global_parser = get_parser('') global_parser = get_parser('')