summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
Diffstat (limited to 'searx/webapp.py')
-rwxr-xr-xsearx/webapp.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index 062077292..6f0297a99 100755
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -362,6 +362,15 @@ def image_proxify(url):
urlencode(dict(url=url.encode(), h=h)))
+def get_translations():
+ return {
+ # when overpass AJAX request fails (on a map result)
+ 'could_not_load': gettext('could not load data'),
+ # when there is autocompletion
+ 'no_item_found': gettext('No item found')
+ }
+
+
def render(template_name, override_theme=None, **kwargs):
disabled_engines = request.preferences.engines.get_disabled()
@@ -421,6 +430,8 @@ def render(template_name, override_theme=None, **kwargs):
kwargs['brand'] = brand
+ kwargs['translations'] = json.dumps(get_translations(), separators=(',', ':'))
+
kwargs['scripts'] = set()
kwargs['endpoint'] = 'results' if 'q' in kwargs else request.endpoint
for plugin in request.user_plugins:
@@ -1084,14 +1095,6 @@ def config():
})
-@app.route('/translations.js')
-def js_translations():
- return render(
- 'translations.js.tpl',
- override_theme='__common__',
- ), {'Content-Type': 'text/javascript; charset=UTF-8'}
-
-
@app.errorhandler(404)
def page_not_found(e):
return render('404.html'), 404