mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
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:
parent
a6ad9f2c96
commit
f424743046
@ -115,14 +115,14 @@ class FeedTemplate(Template):
|
|||||||
hr.tail = '| '
|
hr.tail = '| '
|
||||||
|
|
||||||
if f+1 < len(feeds):
|
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 = ' | '
|
link.tail = ' | '
|
||||||
navbar.append(link)
|
navbar.append(link)
|
||||||
link = A('Main menu', href="../index.html")
|
link = A(_('Main menu'), href="../index.html")
|
||||||
link.tail = ' | '
|
link.tail = ' | '
|
||||||
navbar.append(link)
|
navbar.append(link)
|
||||||
if f > 0:
|
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 = ' |'
|
link.tail = ' |'
|
||||||
navbar.append(link)
|
navbar.append(link)
|
||||||
if top:
|
if top:
|
||||||
@ -208,17 +208,17 @@ class NavBarTemplate(Template):
|
|||||||
up = '../..' if art == number_of_articles_in_feed - 1 else '..'
|
up = '../..' if art == number_of_articles_in_feed - 1 else '..'
|
||||||
href = '%s%s/%s/index.html'%(prefix, up, next)
|
href = '%s%s/%s/index.html'%(prefix, up, next)
|
||||||
navbar.text = '| '
|
navbar.text = '| '
|
||||||
navbar.append(A('Next', href=href))
|
navbar.append(A(_('Next'), href=href))
|
||||||
href = '%s../index.html#article_%d'%(prefix, art)
|
href = '%s../index.html#article_%d'%(prefix, art)
|
||||||
navbar.iterchildren(reversed=True).next().tail = ' | '
|
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)
|
href = '%s../../index.html#feed_%d'%(prefix, feed)
|
||||||
navbar.iterchildren(reversed=True).next().tail = ' | '
|
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:
|
if art > 0 and not bottom:
|
||||||
href = '%s../article_%d/index.html'%(prefix, art-1)
|
href = '%s../article_%d/index.html'%(prefix, art-1)
|
||||||
navbar.iterchildren(reversed=True).next().tail = ' | '
|
navbar.iterchildren(reversed=True).next().tail = ' | '
|
||||||
navbar.append(A('Previous', href=href))
|
navbar.append(A(_('Previous'), href=href))
|
||||||
navbar.iterchildren(reversed=True).next().tail = ' | '
|
navbar.iterchildren(reversed=True).next().tail = ' | '
|
||||||
if not bottom:
|
if not bottom:
|
||||||
navbar.append(HR())
|
navbar.append(HR())
|
||||||
@ -300,7 +300,7 @@ class TouchscreenFeedTemplate(Template):
|
|||||||
navbar_tr.append(TD(CLASS('feed_prev'),link))
|
navbar_tr.append(TD(CLASS('feed_prev'),link))
|
||||||
|
|
||||||
# Up to Sections
|
# Up to Sections
|
||||||
link = A('Sections', href="../index.html")
|
link = A(_('Sections'), href="../index.html")
|
||||||
navbar_tr.append(TD(CLASS('feed_up'),link))
|
navbar_tr.append(TD(CLASS('feed_up'),link))
|
||||||
|
|
||||||
# Next Section
|
# Next Section
|
||||||
@ -381,16 +381,16 @@ class TouchscreenNavBarTemplate(Template):
|
|||||||
|
|
||||||
# | Previous
|
# | Previous
|
||||||
if art > 0:
|
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))
|
navbar_tr.append(TD(CLASS('article_prev'),link))
|
||||||
else:
|
else:
|
||||||
navbar_tr.append(TD(CLASS('article_prev'),''))
|
navbar_tr.append(TD(CLASS('article_prev'),''))
|
||||||
|
|
||||||
# | Articles | Sections |
|
# | 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))
|
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))
|
navbar_tr.append(TD(CLASS('article_sections_list'),link))
|
||||||
|
|
||||||
# | Next
|
# | Next
|
||||||
@ -398,7 +398,7 @@ class TouchscreenNavBarTemplate(Template):
|
|||||||
else 'article_%d'%(art+1)
|
else 'article_%d'%(art+1)
|
||||||
up = '../..' if art == number_of_articles_in_feed - 1 else '..'
|
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_tr.append(TD(CLASS('article_next'),link))
|
||||||
navbar_t.append(navbar_tr)
|
navbar_t.append(navbar_tr)
|
||||||
navbar.append(navbar_t)
|
navbar.append(navbar_t)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user