Fix jinja translation message by querying the dict key in the function, not in the template

pull/1126/head
ahmad-alkadri 3 months ago
parent c216c033ef
commit 7f0af097aa

3
.gitignore vendored

@ -23,3 +23,6 @@ whoogle.env
# vim
*~
*.swp
# vscode
.vscode/launch.json

@ -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),

@ -20,7 +20,7 @@
</p>
<hr>
<p>
<h4><a class="link" href="https://farside.link">{{ translation['continue-search'] }}</a></h4>
<h4><a class="link" href="https://farside.link">{{ continue_search_message }}</a></h4>
<ul>
<li>
<a href="https://github.com/benbusby/whoogle-search">Whoogle</a>

@ -37,9 +37,11 @@ def test_get_results(client):
assert rv._status_code == 200
# Depending on the search, there can be more
# than 10 result divs
# than 5 result divs and less than 15 results
# within one single page. Should adjust this number
# accordingly.
results = get_search_results(rv.data)
assert len(results) >= 10
assert len(results) >= 5
assert len(results) <= 15

Loading…
Cancel
Save