From 7f0af097aa5724466f33f9e8c9b9ab9050a9b7b1 Mon Sep 17 00:00:00 2001 From: ahmad-alkadri Date: Sat, 2 Mar 2024 10:16:08 +0100 Subject: [PATCH] Fix jinja translation message by querying the dict key in the function, not in the template --- .gitignore | 3 +++ app/routes.py | 2 +- app/templates/error.html | 2 +- test/test_results.py | 6 ++++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 181094f..a4770cc 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,6 @@ whoogle.env # vim *~ *.swp + +# vscode +.vscode/launch.json diff --git a/app/routes.py b/app/routes.py index 4efc343..11f9b4c 100644 --- a/app/routes.py +++ b/app/routes.py @@ -622,7 +622,7 @@ def internal_error(e): return render_template( 'error.html', error_message='Internal server error (500)', - translation=translation, + continue_search_message=translation.get('continue-search', ''), farside='https://farside.link', config=g.user_config, query=urlparse.unquote(query), diff --git a/app/templates/error.html b/app/templates/error.html index 99e87b3..5295422 100644 --- a/app/templates/error.html +++ b/app/templates/error.html @@ -20,7 +20,7 @@


-

{{ translation['continue-search'] }}

+

{{ continue_search_message }}