diff --git a/Changelog.yaml b/Changelog.yaml index 699aa3a531..82b335bbdd 100644 --- a/Changelog.yaml +++ b/Changelog.yaml @@ -4,6 +4,100 @@ # for important features/bug fixes. # Also, each release can have new and improved recipes. +- version: 0.7.38 + date: 2011-01-07 + + new features: + - title: "Reduce startup time when using a composite custom column" + + - title: "Template language: Add a list_item function for use with tags like columns. See User Manual for details" + + - title: "TXT Input: Attempt to detect the input encoding when not specified. Auto detect paragraph structure and formatting markup." + + - title: "Search & replace: Add ability to manipulate number and boolean columns." + + - title: "Add type ahead completion to the advanced search dialog." + tickets: [8035] + + - title: "Double click on plugin in Preferences dialog to customize" + tickets: [8175] + + - title: "Allow customization of the SONY driver to send thumbnail to the device. Useful with newer SONY readers" + tickets: [8161] + + - title: "Smarten punctuation: Convert double dashes to em dashes. Preprocessing: Various tweaks" + + bug fixes: + - title: "Fix regression causing the template formatter to intepret a missing format letter as ERROR instead of 's'." + + - title: "Fix regression that broke conversion of PNG images in PDF files on OS X." + tickets: [8215] + + - title: "Content server: Fix improper XML escaping of category titles in the OPDS feeds" + tickets: [8225] + + - title: "When decoding XML if the XML starts with a UTF-8 BOM decode as UTF-8. Fixes parsing of FB2 files with UTF-8 BOMs" + + - title: "E-book viewer: When scrolling to a bookmark and the content is wider than the window, do not scroll in the horizontal direction" + + - title: "E-book viewer: Fix next page skipping the bottom of chapters when the content is wider than the window." + tickets: [8153] + + - title: " FB2 Output: Insert covers." + tickets: [8172] + + - title: "Content server: When serving OPDS feeds handle html descriptions that have namespaced attributes." + tickets: [7938] + + - title: "When downloading metadata from isbndb.com, download a maximum of 30 results rather than 1000" + + - title: "Fix sorting of tags column" + + - title: "Change search/replace to show commas instead of vertical bars as the separator for multiple authors" + + - title: "Template language: Make all column names case insensitive" + + - title: "Fix bug that prevent the Disabled option for Tag Browser partiotining from working in the Preferences dialog" + + - title: "Fix bug when using tags like custom column in the template language" + + - title: "Fix bug where composite custom columns using general_program_mode fields are not evaluated correctly when used in a template." + + - title: "ImageMagick interface: Don't crash when asked to open empty image files" + + - title: "Kobo driver: Add TXT,CBZ,CBR to supported formats list" + tickets: [8124] + + - title: "Don't uneccessarily scroll the book list horizontally when re-selcting previously selected rows." + + new recipes: + - title: "New London Day" + author: "Being" + + - title: "Walla" + author: "marbs" + + - title: "New Journal of Physics" + author: "Chema Cortes" + + - title: "The Baltimore Sun" + author: "Josh Hall" + + - title: "Arabian Business and Sunday Times (UK)" + author: "Darko Miletic" + + - title: "Deia" + author: "Gerardo Diez" + + - title: "Smarter Planet" + author: "Jack Mason" + + + improved recipes: + - The Atlantic + - Danas + - Ledevoir + - version: 0.7.37 date: 2011-01-02 diff --git a/src/calibre/constants.py b/src/calibre/constants.py index bc359a2b79..2443c55d9d 100644 --- a/src/calibre/constants.py +++ b/src/calibre/constants.py @@ -2,7 +2,7 @@ __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net' __docformat__ = 'restructuredtext en' __appname__ = 'calibre' -__version__ = '0.7.37' +__version__ = '0.7.38' __author__ = "Kovid Goyal " import re diff --git a/src/calibre/devices/android/driver.py b/src/calibre/devices/android/driver.py index c2db8ddd77..b7e2f0fd2e 100644 --- a/src/calibre/devices/android/driver.py +++ b/src/calibre/devices/android/driver.py @@ -27,8 +27,9 @@ class ANDROID(USBMS): 0x040d : { 0x8510 : [0x0001], 0x0851 : [0x1] }, # Motorola - 0x22b8 : { 0x41d9 : [0x216], 0x2d61: [0x100], 0x2d67 : [0x100], - 0x41db : [0x216], 0x4285 : [0x216], 0x42a3 : [0x216] }, + 0x22b8 : { 0x41d9 : [0x216], 0x2d61 : [0x100], 0x2d67 : [0x100], + 0x41db : [0x216], 0x4285 : [0x216], 0x42a3 : [0x216], + 0x4286 : [0x216] }, # Sony Ericsson 0xfce : { 0xd12e : [0x0100]}, diff --git a/src/calibre/ebooks/chardet/__init__.py b/src/calibre/ebooks/chardet/__init__.py index dd279c6559..f9bca3c8d4 100644 --- a/src/calibre/ebooks/chardet/__init__.py +++ b/src/calibre/ebooks/chardet/__init__.py @@ -18,7 +18,7 @@ __version__ = "1.0" -import re +import re, codecs def detect(aBuf): import calibre.ebooks.chardet.universaldetector as universaldetector @@ -83,9 +83,11 @@ def xml_to_unicode(raw, verbose=False, strip_encoding_pats=False, if not raw: return u'', encoding if not isinstance(raw, unicode): - if raw.startswith('\xff\xfe'): + if raw.startswith(codecs.BOM_UTF8): + raw, encoding = raw.decode('utf-8')[1:], 'utf-8' + elif raw.startswith(codecs.BOM_UTF16_LE): raw, encoding = raw.decode('utf-16-le')[1:], 'utf-16-le' - elif raw.startswith('\xfe\xff'): + elif raw.startswith(codecs.BOM_UTF16_BE): raw, encoding = raw.decode('utf-16-be')[1:], 'utf-16-be' if not isinstance(raw, unicode): for pat in ENCODING_PATS: diff --git a/src/calibre/ebooks/fb2/input.py b/src/calibre/ebooks/fb2/input.py index 1f9a3ffe95..b019873d39 100644 --- a/src/calibre/ebooks/fb2/input.py +++ b/src/calibre/ebooks/fb2/input.py @@ -46,15 +46,19 @@ class FB2Input(InputFormatPlugin): log.debug('Parsing XML...') raw = stream.read().replace('\0', '') raw = xml_to_unicode(raw, strip_encoding_pats=True, - assume_utf8=True)[0] + assume_utf8=True, resolve_entities=True)[0] try: doc = etree.fromstring(raw) except etree.XMLSyntaxError: try: doc = etree.fromstring(raw, parser=RECOVER_PARSER) + if doc is None: + raise Exception('parse failed') except: doc = etree.fromstring(raw.replace('& ', '&'), parser=RECOVER_PARSER) + if doc is None: + raise ValueError('The FB2 file is not valid XML') stylesheets = doc.xpath('//*[local-name() = "stylesheet" and @type="text/css"]') css = '' for s in stylesheets: diff --git a/src/calibre/gui2/library/views.py b/src/calibre/gui2/library/views.py index c1dd5b3766..e1e9cf4456 100644 --- a/src/calibre/gui2/library/views.py +++ b/src/calibre/gui2/library/views.py @@ -612,7 +612,7 @@ class BooksView(QTableView): # {{{ if row > -1: h = self.horizontalHeader() for i in range(h.count()): - if not h.isSectionHidden(i): + if not h.isSectionHidden(i) and h.sectionViewportPosition(i) >= 0: self.scrollTo(self.model().index(row, i)) break diff --git a/src/calibre/gui2/tools.py b/src/calibre/gui2/tools.py index d18cc61baf..a5f0f52425 100644 --- a/src/calibre/gui2/tools.py +++ b/src/calibre/gui2/tools.py @@ -61,7 +61,8 @@ def convert_single_ebook(parent, db, book_ids, auto_conversion=False, out_format dtitle = unicode(mi.title) except: dtitle = repr(mi.title) - desc = _('Convert book %d of %d (%s)') % (i + 1, total, dtitle) + desc = _('Convert book %(num)d of %(total)d (%(title)s)') % \ + {'num':i + 1, 'total':total, 'title':dtitle} recs = cPickle.loads(d.recommendations) if d.opf_file is not None: diff --git a/src/calibre/library/server/browse.py b/src/calibre/library/server/browse.py index afc20ba21c..37799c4cbc 100644 --- a/src/calibre/library/server/browse.py +++ b/src/calibre/library/server/browse.py @@ -640,8 +640,8 @@ class BrowseServer(object): if fmt: href = self.opts.url_prefix + '/get/%s/%s_%d.%s'%( fmt, fname, id_, fmt) - rt = xml(_('Read %s in the %s format')%(args['title'], - fmt.upper()), True) + rt = xml(_('Read %(title)s in the %(fmt)s format')% \ + {'title':args['title'], 'fmt':fmt.upper()}, True) args['get_button'] = \ '%s' % \ diff --git a/src/calibre/library/server/opds.py b/src/calibre/library/server/opds.py index ab0853add9..ead7cf1938 100644 --- a/src/calibre/library/server/opds.py +++ b/src/calibre/library/server/opds.py @@ -128,9 +128,9 @@ def CATALOG_ENTRY(item, item_kind, base_href, version, updated, count = '' if item.category == 'authors' and \ tweaks['categories_use_field_for_author_name'] == 'author_sort': - name = xml(item.sort) + name = item.sort else: - name = xml(item.name) + name = item.name return E.entry( TITLE(name + ('' if not add_kind else ' (%s)'%item_kind)), ID(id_), diff --git a/src/calibre/manual/template_lang.rst b/src/calibre/manual/template_lang.rst index 1bf08c11f9..f64a413d3e 100644 --- a/src/calibre/manual/template_lang.rst +++ b/src/calibre/manual/template_lang.rst @@ -121,6 +121,7 @@ The functions available are: * ``contains(pattern, text if match, text if not match`` -- checks if field contains matches for the regular expression `pattern`. Returns `text if match` if matches are found, otherwise it returns `text if no match`. * ``count(separator)`` -- interprets the value as a list of items separated by `separator`, returning the number of items in the list. Most lists use a comma as the separator, but authors uses an ampersand. Examples: `{tags:count(,)}`, `{authors:count(&)}` * ``ifempty(text)`` -- if the field is not empty, return the value of the field. Otherwise return `text`. + * ``list_item(index, separator)`` -- interpret the value as a list of items separated by `separator`, returning the `index`th item. The first item is number zero. The last item can be returned using `list_item(-1,separator)`. If the item is not in the list, then the empty value is returned. The separator has the same meaning as in the `count` function. * ``lookup(pattern, field, pattern, field, ..., else_field)`` -- like switch, except the arguments are field (metadata) names, not text. The value of the appropriate field will be fetched and used. Note that because composite columns are fields, you can use this function in one composite field to use the value of some other composite field. This is extremely useful when constructing variable save paths (more later). * ``re(pattern, replacement)`` -- return the field after applying the regular expression. All instances of `pattern` are replaced with `replacement`. As in all of |app|, these are python-compatible regular expressions. * ``shorten(left chars, middle text, right chars)`` -- Return a shortened version of the field, consisting of `left chars` characters from the beginning of the field, followed by `middle text`, followed by `right chars` characters from the end of the string. `Left chars` and `right chars` must be integers. For example, assume the title of the book is `Ancient English Laws in the Times of Ivanhoe`, and you want it to fit in a space of at most 15 characters. If you use ``{title:shorten(9,-,5)}``, the result will be `Ancient E-nhoe`. If the field's length is less than ``left chars`` + ``right chars`` + the length of ``middle text``, then the field will be used intact. For example, the title `The Dome` would not be changed. diff --git a/src/calibre/translations/cs.po b/src/calibre/translations/cs.po index 77231346a8..3d4de14c39 100644 --- a/src/calibre/translations/cs.po +++ b/src/calibre/translations/cs.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: calibre\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-01-02 23:55+0000\n" -"PO-Revision-Date: 2011-01-04 08:51+0000\n" -"Last-Translator: TomVal \n" +"PO-Revision-Date: 2011-01-06 11:10+0000\n" +"Last-Translator: schunka \n" "Language-Team: Czech \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-01-05 04:43+0000\n" +"X-Launchpad-Export-Date: 2011-01-07 04:57+0000\n" "X-Generator: Launchpad (build Unknown)\n" #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:43 @@ -799,7 +799,7 @@ msgstr "Spojit se s Sanda Bambook eBook čtečkou" #: /home/kovid/work/calibre/src/calibre/devices/bambook/driver.py:25 msgid "Li Fanxi" -msgstr "" +msgstr "Li Fanxi" #: /home/kovid/work/calibre/src/calibre/devices/bambook/driver.py:41 msgid "Device IP Address (restart calibre after changing)" @@ -1126,11 +1126,11 @@ msgstr "Komunikovat se zařízením Trekstor" #: /home/kovid/work/calibre/src/calibre/devices/misc.py:251 msgid "Communicate with the EEE Reader" -msgstr "" +msgstr "Probíhá spojení se čtečkou EEE Reader." #: /home/kovid/work/calibre/src/calibre/devices/misc.py:271 msgid "Communicate with the Nextbook Reader" -msgstr "" +msgstr "Probíhá spojení se čtečkou Nextbook Reader." #: /home/kovid/work/calibre/src/calibre/devices/nokia/driver.py:17 msgid "Communicate with the Nokia 770 internet tablet." @@ -1174,11 +1174,11 @@ msgstr "Spojit se se Sony eBook reader" #: /home/kovid/work/calibre/src/calibre/devices/prs505/driver.py:61 msgid "All by title" -msgstr "" +msgstr "Vše podle názvu" #: /home/kovid/work/calibre/src/calibre/devices/prs505/driver.py:62 msgid "All by author" -msgstr "" +msgstr "Vše podle autora" #: /home/kovid/work/calibre/src/calibre/devices/prs505/driver.py:64 msgid "" @@ -1226,7 +1226,7 @@ msgstr "Spojit se se Sovos reader." #: /home/kovid/work/calibre/src/calibre/devices/teclast/driver.py:78 msgid "Communicate with the Sunstech EB700 reader." -msgstr "" +msgstr "Probíhá spojení se čtečkou Sunstech EB700." #: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:258 msgid "Unable to detect the %s disk drive. Try rebooting." diff --git a/src/calibre/translations/de.po b/src/calibre/translations/de.po index 6418ab3d7d..a330704198 100644 --- a/src/calibre/translations/de.po +++ b/src/calibre/translations/de.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: de\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2011-01-02 23:55+0000\n" -"PO-Revision-Date: 2011-01-01 21:21+0000\n" -"Last-Translator: Kovid Goyal \n" +"PO-Revision-Date: 2011-01-07 02:17+0000\n" +"Last-Translator: heinz beck \n" "Language-Team: American English \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-01-04 13:52+0000\n" +"X-Launchpad-Export-Date: 2011-01-07 04:58+0000\n" "X-Generator: Launchpad (build Unknown)\n" "Generated-By: pygettext.py 1.5\n" @@ -943,7 +943,7 @@ msgstr "Kommunikation mit dem PocketBook 301 Reader." #: /home/kovid/work/calibre/src/calibre/devices/eb600/driver.py:233 msgid "Communicate with the PocketBook 602/603/902/903 reader." -msgstr "" +msgstr "verbinden mit PocketBook 602/603/902/903" #: /home/kovid/work/calibre/src/calibre/devices/eb600/driver.py:252 msgid "Communicate with the PocketBook 701" @@ -1186,7 +1186,7 @@ msgstr "Kommunikation mit allen Sony eBook Readern." #: /home/kovid/work/calibre/src/calibre/devices/prs505/driver.py:61 msgid "All by title" -msgstr "" +msgstr "nach Titel" #: /home/kovid/work/calibre/src/calibre/devices/prs505/driver.py:62 msgid "All by author" diff --git a/src/calibre/translations/gl.po b/src/calibre/translations/gl.po index 33708ef88c..597487b7dc 100644 --- a/src/calibre/translations/gl.po +++ b/src/calibre/translations/gl.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: calibre\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-01-02 23:55+0000\n" -"PO-Revision-Date: 2011-01-02 13:21+0000\n" -"Last-Translator: Calidonia Hibernia \n" +"PO-Revision-Date: 2011-01-06 14:46+0000\n" +"Last-Translator: Antón Méixome \n" "Language-Team: dev@gl.openoffice.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-01-04 13:52+0000\n" +"X-Launchpad-Export-Date: 2011-01-07 04:58+0000\n" "X-Generator: Launchpad (build Unknown)\n" "Language: gl\n" @@ -5749,7 +5749,7 @@ msgstr "Tamaño da mensaxe para a descrición das miniaturas de portada" #: /home/kovid/work/calibre/src/calibre/gui2/catalog/catalog_epub_mobi_ui.py:330 msgid " inch" -msgstr "" +msgstr " polgada" #: /home/kovid/work/calibre/src/calibre/gui2/catalog/catalog_epub_mobi_ui.py:331 msgid "&Description note" @@ -10645,15 +10645,15 @@ msgstr "Nunca" #: /home/kovid/work/calibre/src/calibre/gui2/preferences/look_feel.py:60 msgid "By first letter" -msgstr "" +msgstr "Pola primeira letra" #: /home/kovid/work/calibre/src/calibre/gui2/preferences/look_feel.py:60 msgid "Disabled" -msgstr "" +msgstr "Desactivado" #: /home/kovid/work/calibre/src/calibre/gui2/preferences/look_feel.py:61 msgid "Partitioned" -msgstr "" +msgstr "Particionado" #: /home/kovid/work/calibre/src/calibre/gui2/preferences/look_feel_ui.py:140 msgid "User Interface &layout (needs restart):" @@ -10709,7 +10709,7 @@ msgstr "Buscar mentres se escribe" #: /home/kovid/work/calibre/src/calibre/gui2/preferences/look_feel_ui.py:152 msgid "Tags browser category partitioning method:" -msgstr "" +msgstr "Método de particionado con categorías de etiquetas de navegación:" #: /home/kovid/work/calibre/src/calibre/gui2/preferences/look_feel_ui.py:153 msgid "" @@ -10719,10 +10719,15 @@ msgid "" "have a list of fixed-sized groups. Set to disabled\n" "if you never want subcategories" msgstr "" +"Escoller como as subcategorías de etiquetas de navegación se amosan cando\n" +"hai máis ítems que os do límite. Seleccione por primeira\n" +"letra para ver unha lista A, B, C. Escolla particionado para\n" +"ter unha lista de grupos de tamaño fixo. Escolla desactivado\n" +"se non vai querer nunca subcategorías" #: /home/kovid/work/calibre/src/calibre/gui2/preferences/look_feel_ui.py:158 msgid "Collapse when more items than:" -msgstr "" +msgstr "Colapsar cando os ítems son máis de:" #: /home/kovid/work/calibre/src/calibre/gui2/preferences/look_feel_ui.py:159 msgid "" @@ -10730,6 +10735,10 @@ msgid "" "up into sub-categories. If the partition method is set to disable, this " "value is ignored." msgstr "" +"Se unha categoría de etiquetas de navegación ten máis ca este número de " +"ítems, divídese\n" +"en subcategorías. Se o método de partición se pon como desactivado, " +"ignorarase este valor." #: /home/kovid/work/calibre/src/calibre/gui2/preferences/look_feel_ui.py:161 msgid "&Toolbar" @@ -11494,7 +11503,7 @@ msgstr "Mostrar todas as categorías" #: /home/kovid/work/calibre/src/calibre/gui2/tag_view.py:300 msgid "Change sub-categorization scheme" -msgstr "" +msgstr "Cambiar o esquema de subcategorización" #: /home/kovid/work/calibre/src/calibre/gui2/tag_view.py:625 msgid "" diff --git a/src/calibre/translations/it.po b/src/calibre/translations/it.po index 73a13b051e..1be0988afd 100644 --- a/src/calibre/translations/it.po +++ b/src/calibre/translations/it.po @@ -9,13 +9,13 @@ msgstr "" "Project-Id-Version: calibre_calibre-it\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2011-01-02 23:55+0000\n" -"PO-Revision-Date: 2011-01-02 22:45+0000\n" -"Last-Translator: Marco Ciampa \n" +"PO-Revision-Date: 2011-01-06 15:33+0000\n" +"Last-Translator: Francesco Pasa \n" "Language-Team: italiano\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-01-04 13:53+0000\n" +"X-Launchpad-Export-Date: 2011-01-07 04:58+0000\n" "X-Generator: Launchpad (build Unknown)\n" "X-Poedit-Bookmarks: -1,-1,-1,-1,-1,1105,-1,1312,-1,-1\n" "Generated-By: pygettext.py 1.5\n" @@ -5694,7 +5694,7 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/catalog/catalog_epub_mobi_ui.py:330 msgid " inch" -msgstr "" +msgstr " pollice" #: /home/kovid/work/calibre/src/calibre/gui2/catalog/catalog_epub_mobi_ui.py:331 msgid "&Description note" diff --git a/src/calibre/translations/nds.po b/src/calibre/translations/nds.po index e4d1ad8f1a..80d6f376c3 100644 --- a/src/calibre/translations/nds.po +++ b/src/calibre/translations/nds.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: nds\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2011-01-02 23:55+0000\n" -"PO-Revision-Date: 2010-10-18 00:57+0000\n" -"Last-Translator: Nils-Christoph Fiedler \n" +"PO-Revision-Date: 2011-01-07 02:48+0000\n" +"Last-Translator: heinz beck \n" "Language-Team: German\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-01-04 13:55+0000\n" +"X-Launchpad-Export-Date: 2011-01-07 04:59+0000\n" "X-Generator: Launchpad (build Unknown)\n" "X-Poedit-Country: GERMANY\n" "X-Poedit-Language: German\n" diff --git a/src/calibre/translations/pt_BR.po b/src/calibre/translations/pt_BR.po index af6071797c..26d16546e6 100644 --- a/src/calibre/translations/pt_BR.po +++ b/src/calibre/translations/pt_BR.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: calibre\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-01-02 23:55+0000\n" -"PO-Revision-Date: 2010-12-18 05:47+0000\n" -"Last-Translator: Kovid Goyal \n" +"PO-Revision-Date: 2011-01-06 13:01+0000\n" +"Last-Translator: MoroniGranja \n" "Language-Team: American English \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-01-04 14:00+0000\n" +"X-Launchpad-Export-Date: 2011-01-07 04:59+0000\n" "X-Generator: Launchpad (build Unknown)\n" #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:43 @@ -172,7 +172,7 @@ msgstr "Leitor de metadados" #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:266 msgid "Metadata writer" -msgstr "" +msgstr "Escritor de metadata" #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:296 msgid "Catalog generator" @@ -589,6 +589,8 @@ msgid "" "Intended for the Samsung Galaxy and similar tablet devices with a resolution " "of 600x1280" msgstr "" +"Planejado para o Samsung Galaxy e tablets similares com uma resolução " +"de600x1280" #: /home/kovid/work/calibre/src/calibre/customize/profiles.py:471 msgid "This profile is intended for the Kobo Reader." @@ -695,7 +697,7 @@ msgstr "Desabilitar a extensão com nome" #: /home/kovid/work/calibre/src/calibre/debug.py:148 msgid "Debug log" -msgstr "" +msgstr "Log de Debug" #: /home/kovid/work/calibre/src/calibre/devices/android/driver.py:13 msgid "Communicate with Android phones." @@ -808,7 +810,7 @@ msgstr "Comunicar com iTunes." #: /home/kovid/work/calibre/src/calibre/devices/bambook/driver.py:24 msgid "Communicate with the Sanda Bambook eBook reader." -msgstr "" +msgstr "Comunicar com o leitor de eBooks Sanda Bambook" #: /home/kovid/work/calibre/src/calibre/devices/bambook/driver.py:25 msgid "Li Fanxi" @@ -817,17 +819,22 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/devices/bambook/driver.py:41 msgid "Device IP Address (restart calibre after changing)" msgstr "" +"Endereço IP do dispositivo (é necessário reiniciar calibre após modificar)" #: /home/kovid/work/calibre/src/calibre/devices/bambook/driver.py:46 msgid "" "Unable to add book to library directly from Bambook. Please save the book to " "disk and add the file to library from disk." msgstr "" +"Impossível adicionar livro a biblioteca diretamente do Bambook. Favor salvar " +"o livro no disco e adicionar o arquivo do disco a biblioteca." #: /home/kovid/work/calibre/src/calibre/devices/bambook/driver.py:66 msgid "" "Unable to connect to Bambook, you need to install Bambook library first." msgstr "" +"Não foi possível conectar ao Bambook, é necessário instalar a biblioteca " +"Bambook." #: /home/kovid/work/calibre/src/calibre/devices/bambook/driver.py:74 msgid "" @@ -835,10 +842,13 @@ msgid "" "If you are trying to connect via Wi-Fi, please make sure the IP address of " "Bambook has been correctly configured." msgstr "" +"Não foi possível conectar ao Bambook. \n" +"Se você está tentando conectar por Wi-Fi, favor confirmar se o endereço IP " +"do Bambook foi configurado corretamente." #: /home/kovid/work/calibre/src/calibre/devices/bambook/driver.py:111 msgid "Bambook" -msgstr "" +msgstr "Bambook" #: /home/kovid/work/calibre/src/calibre/devices/bambook/driver.py:217 #: /home/kovid/work/calibre/src/calibre/devices/bambook/driver.py:233 @@ -899,7 +909,7 @@ msgstr "Enviando metadados ao dispositivo..." #: /home/kovid/work/calibre/src/calibre/devices/bambook/libbambookcore.py:132 msgid "Bambook SDK has not been installed." -msgstr "" +msgstr "Bambook SDK não foi instalado." #: /home/kovid/work/calibre/src/calibre/devices/binatone/driver.py:17 msgid "Communicate with the Binatone Readme eBook reader." @@ -938,11 +948,11 @@ msgstr "Comunica-se com o leitor PocketBook 301" #: /home/kovid/work/calibre/src/calibre/devices/eb600/driver.py:233 msgid "Communicate with the PocketBook 602/603/902/903 reader." -msgstr "" +msgstr "Comunicar-se com o PocketBook 602/603/902/903 reader." #: /home/kovid/work/calibre/src/calibre/devices/eb600/driver.py:252 msgid "Communicate with the PocketBook 701" -msgstr "" +msgstr "Comunicar-se com o PocketBook 701" #: /home/kovid/work/calibre/src/calibre/devices/edge/driver.py:17 msgid "Entourage Edge" @@ -1069,6 +1079,8 @@ msgid "" "The Kobo supports only one collection currently: the \"Im_Reading\" list. " "Create a tag called \"Im_Reading\" " msgstr "" +"O Kobo aceita apenas uma coleção atualmente: a lista \"Estou_Lendo\". Crie " +"uma tag chamada \"Estou_Lendo\" " #: /home/kovid/work/calibre/src/calibre/devices/kobo/driver.py:446 #: /home/kovid/work/calibre/src/calibre/gui2/actions/add.py:279 @@ -1097,7 +1109,7 @@ msgstr "Comunicar com o Sweex MM300" #: /home/kovid/work/calibre/src/calibre/devices/misc.py:79 msgid "Communicate with the Digma Q600" -msgstr "" +msgstr "Comunicar-se com o Digma Q600" #: /home/kovid/work/calibre/src/calibre/devices/misc.py:88 msgid "Communicate with the Kogan" @@ -1110,7 +1122,7 @@ msgstr "Comunicar com o Pandigital Novel" #: /home/kovid/work/calibre/src/calibre/devices/misc.py:142 msgid "Communicate with the VelocityMicro" -msgstr "" +msgstr "Comunicar-se com o VelocityMicro" #: /home/kovid/work/calibre/src/calibre/devices/misc.py:160 msgid "Communicate with the GM2000" @@ -1118,23 +1130,23 @@ msgstr "Comunicar com o GM2000" #: /home/kovid/work/calibre/src/calibre/devices/misc.py:180 msgid "Communicate with the Acer Lumiread" -msgstr "" +msgstr "Comunicar-se com o Acer Lumiread" #: /home/kovid/work/calibre/src/calibre/devices/misc.py:211 msgid "Communicate with the Aluratek Color" -msgstr "" +msgstr "Comunicar-se com o Acer Lumiread" #: /home/kovid/work/calibre/src/calibre/devices/misc.py:231 msgid "Communicate with the Trekstor" -msgstr "" +msgstr "Comunicar-se com o Trekstor" #: /home/kovid/work/calibre/src/calibre/devices/misc.py:251 msgid "Communicate with the EEE Reader" -msgstr "" +msgstr "Comunicar-se com o EEE Reader" #: /home/kovid/work/calibre/src/calibre/devices/misc.py:271 msgid "Communicate with the Nextbook Reader" -msgstr "" +msgstr "Comunicar-se com o Nextbook Reader" #: /home/kovid/work/calibre/src/calibre/devices/nokia/driver.py:17 msgid "Communicate with the Nokia 770 internet tablet." @@ -1142,7 +1154,7 @@ msgstr "Comunica-se com o Nokia 770 Internet Tablet." #: /home/kovid/work/calibre/src/calibre/devices/nokia/driver.py:40 msgid "Communicate with the Nokia 810/900 internet tablet." -msgstr "" +msgstr "Comunicar-se com o internet tablet Nokia 810/900." #: /home/kovid/work/calibre/src/calibre/devices/nokia/driver.py:74 msgid "Communicate with the Nokia E52" @@ -1158,11 +1170,11 @@ msgstr "Comunica-se com o leitor Nook." #: /home/kovid/work/calibre/src/calibre/devices/nook/driver.py:85 msgid "Nook Color" -msgstr "" +msgstr "Nook Color" #: /home/kovid/work/calibre/src/calibre/devices/nook/driver.py:86 msgid "Communicate with the Nook Color eBook reader." -msgstr "" +msgstr "Comunicar-se com o Nook Color." #: /home/kovid/work/calibre/src/calibre/devices/nuut2/driver.py:17 msgid "Communicate with the Nuut2 eBook reader." @@ -1178,11 +1190,11 @@ msgstr "Comunica-se com todos os leitores da Sony." #: /home/kovid/work/calibre/src/calibre/devices/prs505/driver.py:61 msgid "All by title" -msgstr "" +msgstr "Todos por título" #: /home/kovid/work/calibre/src/calibre/devices/prs505/driver.py:62 msgid "All by author" -msgstr "" +msgstr "Todos por autor" #: /home/kovid/work/calibre/src/calibre/devices/prs505/driver.py:64 msgid "" @@ -1198,6 +1210,9 @@ msgid "" "to the list to enable them. The collections will be given the name provided " "after the \":\" character." msgstr "" +". Duas coleções especiais estão disponíveis: %s:%s e %s:%s. Adicione estes " +"valores à lista para habilita-los. As coleções receberão o nome após os dois " +"pontos (\":\")." #: /home/kovid/work/calibre/src/calibre/devices/prs505/sony_cache.py:190 #: /home/kovid/work/calibre/src/calibre/ebooks/oeb/transforms/structure.py:68 @@ -1218,7 +1233,7 @@ msgstr "Comunica-se com o leitor Newsmy." #: /home/kovid/work/calibre/src/calibre/devices/teclast/driver.py:47 msgid "Communicate with the Pico reader." -msgstr "" +msgstr "Comunicar-se com o Pico reader." #: /home/kovid/work/calibre/src/calibre/devices/teclast/driver.py:57 msgid "Communicate with the iPapyrus reader." @@ -1230,7 +1245,7 @@ msgstr "Comunicar com o leitor Sovos." #: /home/kovid/work/calibre/src/calibre/devices/teclast/driver.py:78 msgid "Communicate with the Sunstech EB700 reader." -msgstr "" +msgstr "Comunicar-se com o Sunstech EB700 reader." #: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:258 msgid "Unable to detect the %s disk drive. Try rebooting." @@ -1254,6 +1269,8 @@ msgid "" "Unable to detect the %s disk drive. Either the device has already been " "ejected, or your kernel is exporting a deprecated version of SYSFS." msgstr "" +"Não foi possível detectar o disco %s. O dispositivo já foi ejetado, ou o seu " +"kernel está exportando uma versão deprecada do SYSFS." #: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:617 msgid "Unable to mount main memory (Error code: %d)" @@ -1264,6 +1281,8 @@ msgid "" "The main memory of %s is read only. This usually happens because of file " "system errors." msgstr "" +"A memória principal de %s é somente leitura. Isto normalmente acontece " +"devido a erros no sistema de arquivos." #: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:816 #: /home/kovid/work/calibre/src/calibre/devices/usbms/device.py:818 @@ -1693,6 +1712,9 @@ msgid "" "is: %default. Links are only added to the TOC if less than the threshold " "number of chapters were detected." msgstr "" +"Número máximo de links para inserir no sumário. Use 0 para desabilitar. O " +"padrão é: %default. Links serão adicionados ao sumário somente se o número " +"encontrado for menor que o limite máximo de capítulos." #: /home/kovid/work/calibre/src/calibre/ebooks/conversion/plumber.py:256 msgid "" @@ -2076,7 +2098,7 @@ msgstr "Você deve especificar um arquivo do tipo epub" #: /home/kovid/work/calibre/src/calibre/ebooks/epub/fix/unmanifested.py:17 msgid "Fix unmanifested files" -msgstr "" +msgstr "Conserte arquivos sem manifesto." #: /home/kovid/work/calibre/src/calibre/ebooks/epub/fix/unmanifested.py:21 msgid "" diff --git a/src/calibre/translations/zh_CN.po b/src/calibre/translations/zh_CN.po index d040713c09..3a4d979238 100644 --- a/src/calibre/translations/zh_CN.po +++ b/src/calibre/translations/zh_CN.po @@ -12904,7 +12904,7 @@ msgstr "其它格式" #: /home/kovid/work/calibre/src/calibre/library/server/browse.py:643 msgid "Read %s in the %s format" -msgstr "用 %2$s 格式阅读 %1$s" +msgstr "用 %s 格式阅读 %s" #: /home/kovid/work/calibre/src/calibre/library/server/browse.py:648 msgid "Get" diff --git a/src/calibre/utils/formatter.py b/src/calibre/utils/formatter.py index 23763a25bf..2e4f843c3d 100644 --- a/src/calibre/utils/formatter.py +++ b/src/calibre/utils/formatter.py @@ -281,19 +281,30 @@ class TemplateFormatter(string.Formatter): def _count(self, val, sep): return unicode(len(val.split(sep))) + def _list_item(self, val, index, sep): + if not val: + return '' + index = int(index) + val = val.split(sep) + try: + return val[index] + except: + return '' + functions = { 'uppercase' : (0, lambda s,x: x.upper()), 'lowercase' : (0, lambda s,x: x.lower()), 'titlecase' : (0, lambda s,x: titlecase(x)), 'capitalize' : (0, lambda s,x: capitalize(x)), 'contains' : (3, _contains), + 'count' : (1, _count), 'ifempty' : (1, _ifempty), + 'list_item' : (2, _list_item), 'lookup' : (-1, _lookup), 're' : (2, _re), 'shorten' : (3, _shorten), 'switch' : (-1, _switch), - 'test' : (2, _test), - 'count' : (1, _count), + 'test' : (2, _test) } def _do_format(self, val, fmt): @@ -316,8 +327,6 @@ class TemplateFormatter(string.Formatter): except: raise ValueError( _('format: type {0} requires a decimal (float) value, got {1}').format(typ, val)) - else: - raise ValueError(_('format: unknown format type letter {0}').format(typ)) return unicode(('{0:'+fmt+'}').format(val)) def _explode_format_string(self, fmt):