From e57e255d3a138efee5c3c25645af0982e582cb9a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 9 Mar 2021 11:50:39 +0530 Subject: [PATCH] Fix #1918153 [[Enhancement] Remember language when going to the calibre homepage from the User Manual](https://bugs.launchpad.net/calibre/+bug/1918153) --- manual/conf.py | 4 +++- manual/templates/about.html | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/manual/conf.py b/manual/conf.py index 81aa89da0f..4c929f5874 100644 --- a/manual/conf.py +++ b/manual/conf.py @@ -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' diff --git a/manual/templates/about.html b/manual/templates/about.html index 22dcfed68a..de7f3ed327 100644 --- a/manual/templates/about.html +++ b/manual/templates/about.html @@ -7,7 +7,7 @@ function toggle_languages_menu() {
- +