mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1918153 [[Enhancement] Remember language when going to the calibre homepage from the User Manual](https://bugs.launchpad.net/calibre/+bug/1918153)
This commit is contained in:
parent
0457fc1b9c
commit
e57e255d3a
@ -93,7 +93,8 @@ unused_docs = ['global', 'cli/global']
|
||||
|
||||
locale_dirs = ['locale/']
|
||||
title = '%s User Manual' % __appname__
|
||||
if language not in {'en', 'eng'}:
|
||||
needs_localization = language not in {'en', 'eng'}
|
||||
if needs_localization:
|
||||
import gettext
|
||||
try:
|
||||
t = gettext.translation('simple_index', locale_dirs[0], [language])
|
||||
@ -174,6 +175,7 @@ def sort_languages(x):
|
||||
html_context['other_languages'].sort(key=sort_languages)
|
||||
html_context['support_text'] = _('Support calibre')
|
||||
html_context['support_tooltip'] = _('Contribute to support calibre development')
|
||||
html_context['homepage_url'] = 'http://calibre-ebook.com' + (f'/{language}' if needs_localization else '')
|
||||
del sort_languages, get_language
|
||||
|
||||
epub_author = u'Kovid Goyal'
|
||||
|
@ -7,7 +7,7 @@ function toggle_languages_menu() {
|
||||
</script>
|
||||
|
||||
<div style="text-align: center">
|
||||
<a href="https://calibre-ebook.com" title="calibre homepage" id="calibre-homepage-logo"><img src="{{ pathto('_static/logo.png', 1) }}" /></a>
|
||||
<a href="{{ homepage_url }}" title="calibre homepage" id="calibre-homepage-logo"><img src="{{ pathto('_static/logo.png', 1) }}" /></a>
|
||||
<br/>
|
||||
<form id="donate_form" action="https://www.paypal.com/cgi-bin/webscr" method="post" title="{{ support_tooltip }}">
|
||||
<style>
|
||||
|
Loading…
x
Reference in New Issue
Block a user