diff --git a/src/calibre/devices/kindle/driver.py b/src/calibre/devices/kindle/driver.py
index 4f78b2f98e..2653a3c461 100644
--- a/src/calibre/devices/kindle/driver.py
+++ b/src/calibre/devices/kindle/driver.py
@@ -448,12 +448,11 @@ class Bookmark():
except:
pass
elif self.bookmark_extension == 'pdr':
- # Book length not yet implemented for PDF files
- # After 0.6.45:
- # from calibre import plugins
- # self.book_length = plugins['pdfreflow'][0].get_numpages(open(book_fs).read())
-
- self.book_length = 0
+ from calibre import plugins
+ try:
+ self.book_length = plugins['pdfreflow'][0].get_numpages(open(book_fs).read())
+ except:
+ pass
else:
print "unsupported bookmark_extension: %s" % self.bookmark_extension
diff --git a/src/calibre/gui2/ui.py b/src/calibre/gui2/ui.py
index 8db2a52a3c..86aaa7c89c 100644
--- a/src/calibre/gui2/ui.py
+++ b/src/calibre/gui2/ui.py
@@ -1013,11 +1013,14 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
spanTag = Tag(ka_soup, 'span')
spanTag['style'] = 'font-weight:bold'
if bookmark.book_format == 'pdf':
- spanTag.insert(0,NavigableString("%s
Last Page Read: %d" % \
+ spanTag.insert(0,NavigableString(
+ _("%s
Last Page Read: %d (%d%%)") % \
(strftime(u'%x', timestamp.timetuple()),
- last_read_location)))
+ last_read_location,
+ percent_read)))
else:
- spanTag.insert(0,NavigableString("%s
Last Page Read: Location %d (%d%%)" % \
+ spanTag.insert(0,NavigableString(
+ _("%s
Last Page Read: Location %d (%d%%)") % \
(strftime(u'%x', timestamp.timetuple()),
last_read_location,
percent_read)))
@@ -1035,7 +1038,8 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
# Italicize highlighted text
for location in sorted(user_notes):
if user_notes[location]['text']:
- annotations.append('Location %d • %s
%s
' % \
+ annotations.append(
+ _('Location %d • %s
%s
') % \
(user_notes[location]['displayed_location'],
user_notes[location]['type'],
user_notes[location]['text'] if \
@@ -1043,11 +1047,13 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
'%s' % user_notes[location]['text']))
else:
if bookmark.book_format == 'pdf':
- annotations.append('Page %d • %s
' % \
+ annotations.append(
+ _('Page %d • %s
') % \
(user_notes[location]['displayed_location'],
user_notes[location]['type']))
else:
- annotations.append('Location %d • %s
' % \
+ annotations.append(
+ _('Location %d • %s
') % \
(user_notes[location]['displayed_location'],
user_notes[location]['type']))