Fix #1244 (fb2 to lrf converter correctly behave only with english locale)

This commit is contained in:
Kovid Goyal 2008-11-09 11:30:37 -08:00
commit 6f19e54bbd
2 changed files with 7 additions and 7 deletions

View File

@ -76,14 +76,14 @@ def option_parser(usage, gui_mode=False):
dest="author", help=_("Set the author(s). Multiple authors should be set as a comma separated list. Default: %default"), dest="author", help=_("Set the author(s). Multiple authors should be set as a comma separated list. Default: %default"),
default=_('Unknown')) default=_('Unknown'))
metadata.add_option("--comment", action="store", type="string", \ metadata.add_option("--comment", action="store", type="string", \
dest="freetext", help=_("Set the comment."), default='Unknown') dest="freetext", help=_("Set the comment."), default=_('Unknown'))
metadata.add_option("--category", action="store", type="string", \ metadata.add_option("--category", action="store", type="string", \
dest="category", help=_("Set the category"), default='Unknown') dest="category", help=_("Set the category"), default=_('Unknown'))
metadata.add_option('--title-sort', action='store', default='', dest='title_sort', metadata.add_option('--title-sort', action='store', default='', dest='title_sort',
help=_('Sort key for the title')) help=_('Sort key for the title'))
metadata.add_option('--author-sort', action='store', default='', dest='author_sort', metadata.add_option('--author-sort', action='store', default='', dest='author_sort',
help=_('Sort key for the author')) help=_('Sort key for the author'))
metadata.add_option('--publisher', action='store', default='Unknown', dest='publisher', metadata.add_option('--publisher', action='store', default=_('Unknown'), dest='publisher',
help=_('Publisher')) help=_('Publisher'))
metadata.add_option('--cover', action='store', dest='cover', default=None, \ metadata.add_option('--cover', action='store', dest='cover', default=None, \
help=_('Path to file containing image to be used as cover')) help=_('Path to file containing image to be used as cover'))

View File

@ -92,13 +92,13 @@ def process_file(path, options, logger=None):
options.output = os.path.abspath(os.path.expanduser(options.output)) options.output = os.path.abspath(os.path.expanduser(options.output))
if not mi.title: if not mi.title:
mi.title = os.path.splitext(os.path.basename(fb2))[0] mi.title = os.path.splitext(os.path.basename(fb2))[0]
if (not options.title or options.title == 'Unknown'): if (not options.title or options.title == _('Unknown')):
options.title = mi.title options.title = mi.title
if (not options.author or options.author == 'Unknown') and mi.authors: if (not options.author or options.author == _('Unknown')) and mi.authors:
options.author = mi.authors.pop() options.author = mi.authors.pop()
if (not options.category or options.category == 'Unknown') and mi.category: if (not options.category or options.category == _('Unknown')) and mi.category:
options.category = mi.category options.category = mi.category
if (not options.freetext or options.freetext == 'Unknown') and mi.comments: if (not options.freetext or options.freetext == _('Unknown')) and mi.comments:
options.freetext = mi.comments options.freetext = mi.comments
os.chdir(tdir) os.chdir(tdir)
html_process_file(htmlfile, options, logger) html_process_file(htmlfile, options, logger)