News download: Localize the navigation bars in the downloaded news to the language the user has selected for their calibre interface

This commit is contained in:
Kovid Goyal 2010-12-04 11:29:08 -07:00
parent a6ad9f2c96
commit f424743046

View File

@ -115,14 +115,14 @@ class FeedTemplate(Template):
hr.tail = '| '
if f+1 < len(feeds):
link = A('Next section', href='../feed_%d/index.html'%(f+1))
link = A(_('Next section'), href='../feed_%d/index.html'%(f+1))
link.tail = ' | '
navbar.append(link)
link = A('Main menu', href="../index.html")
link = A(_('Main menu'), href="../index.html")
link.tail = ' | '
navbar.append(link)
if f > 0:
link = A('Previous section', href='../feed_%d/index.html'%(f-1))
link = A(_('Previous section'), href='../feed_%d/index.html'%(f-1))
link.tail = ' |'
navbar.append(link)
if top:
@ -208,17 +208,17 @@ class NavBarTemplate(Template):
up = '../..' if art == number_of_articles_in_feed - 1 else '..'
href = '%s%s/%s/index.html'%(prefix, up, next)
navbar.text = '| '
navbar.append(A('Next', href=href))
navbar.append(A(_('Next'), href=href))
href = '%s../index.html#article_%d'%(prefix, art)
navbar.iterchildren(reversed=True).next().tail = ' | '
navbar.append(A('Section Menu', href=href))
navbar.append(A(_('Section Menu'), href=href))
href = '%s../../index.html#feed_%d'%(prefix, feed)
navbar.iterchildren(reversed=True).next().tail = ' | '
navbar.append(A('Main Menu', href=href))
navbar.append(A(_('Main Menu'), href=href))
if art > 0 and not bottom:
href = '%s../article_%d/index.html'%(prefix, art-1)
navbar.iterchildren(reversed=True).next().tail = ' | '
navbar.append(A('Previous', href=href))
navbar.append(A(_('Previous'), href=href))
navbar.iterchildren(reversed=True).next().tail = ' | '
if not bottom:
navbar.append(HR())
@ -300,7 +300,7 @@ class TouchscreenFeedTemplate(Template):
navbar_tr.append(TD(CLASS('feed_prev'),link))
# Up to Sections
link = A('Sections', href="../index.html")
link = A(_('Sections'), href="../index.html")
navbar_tr.append(TD(CLASS('feed_up'),link))
# Next Section
@ -381,16 +381,16 @@ class TouchscreenNavBarTemplate(Template):
# | Previous
if art > 0:
link = A(CLASS('article_link'),'Previous',href='%s../article_%d/index.html'%(prefix, art-1))
link = A(CLASS('article_link'),_('Previous'),href='%s../article_%d/index.html'%(prefix, art-1))
navbar_tr.append(TD(CLASS('article_prev'),link))
else:
navbar_tr.append(TD(CLASS('article_prev'),''))
# | Articles | Sections |
link = A(CLASS('articles_link'),'Articles', href='%s../index.html#article_%d'%(prefix, art))
link = A(CLASS('articles_link'),_('Articles'), href='%s../index.html#article_%d'%(prefix, art))
navbar_tr.append(TD(CLASS('article_articles_list'),link))
link = A(CLASS('sections_link'),'Sections', href='%s../../index.html#feed_%d'%(prefix, feed))
link = A(CLASS('sections_link'),_('Sections'), href='%s../../index.html#feed_%d'%(prefix, feed))
navbar_tr.append(TD(CLASS('article_sections_list'),link))
# | Next
@ -398,7 +398,7 @@ class TouchscreenNavBarTemplate(Template):
else 'article_%d'%(art+1)
up = '../..' if art == number_of_articles_in_feed - 1 else '..'
link = A(CLASS('article_link'),'Next', href='%s%s/%s/index.html'%(prefix, up, next))
link = A(CLASS('article_link'), _('Next'), href='%s%s/%s/index.html'%(prefix, up, next))
navbar_tr.append(TD(CLASS('article_next'),link))
navbar_t.append(navbar_tr)
navbar.append(navbar_t)