From 6553c7902925809fd1cbc904dd08db035466a6b2 Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Tue, 16 Mar 2021 11:07:04 +0100 Subject: [mod] replace /translations.js by embedded JSON In webapp.py, there is a new function "get_translations" lists available translations Close #2064 --- searx/templates/__common__/translations.js.tpl | 1 - searx/templates/oscar/base.html | 4 ++-- searx/templates/simple/base.html | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) delete mode 100644 searx/templates/__common__/translations.js.tpl (limited to 'searx/templates') diff --git a/searx/templates/__common__/translations.js.tpl b/searx/templates/__common__/translations.js.tpl deleted file mode 100644 index 8453aba69..000000000 --- a/searx/templates/__common__/translations.js.tpl +++ /dev/null @@ -1 +0,0 @@ -var could_not_load = '{{ _('could not load data') }}!'; diff --git a/searx/templates/oscar/base.html b/searx/templates/oscar/base.html index f8345d9a7..b5c6ed258 100644 --- a/searx/templates/oscar/base.html +++ b/searx/templates/oscar/base.html @@ -9,7 +9,6 @@ {% block meta %}{% endblock %} - {% block title %}{% endblock %}{{ instance_name }} {% if preferences.get_value('oscar-style') -%} @@ -99,7 +98,8 @@ + data-autocompleter="{% if autocomplete %}true{% else %}false{% endif %}" + data-translations="{{ translations }}"> {% for script in scripts %} {{""}} {% endfor %} diff --git a/searx/templates/simple/base.html b/searx/templates/simple/base.html index a7255e672..17c9785e7 100644 --- a/searx/templates/simple/base.html +++ b/searx/templates/simple/base.html @@ -12,7 +12,6 @@ {% block title %}{% endblock %}{{ instance_name }} {% block meta %}{% endblock %} - {% if rtl %} {% else %} @@ -26,7 +25,7 @@ data-search-on-category-select="{{ 'true' if 'plugins/js/search_on_category_select.js' in scripts else 'false'}}" data-infinite-scroll="{{ 'true' if 'plugins/js/infinite_scroll.js' in scripts else 'false' }}" data-static-path="{{ url_for('static', filename='themes/simple') }}/" - data-no-item-found="{{ _('No item found') }}"> + data-translations="{{ translations }}"> {% block head %} -- cgit v1.2.3