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/static/themes/oscar/js/searx.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'searx/static/themes/oscar/js/searx.js') diff --git a/searx/static/themes/oscar/js/searx.js b/searx/static/themes/oscar/js/searx.js index 159344b28..163009481 100644 --- a/searx/static/themes/oscar/js/searx.js +++ b/searx/static/themes/oscar/js/searx.js @@ -25,7 +25,8 @@ window.searx = (function(d) { return { autocompleter: script.getAttribute('data-autocompleter') === 'true', - method: script.getAttribute('data-method') + method: script.getAttribute('data-method'), + translations: JSON.parse(script.getAttribute('data-translations')) }; })(document); ;/** @@ -302,7 +303,7 @@ $(document).ready(function(){ } }) .fail(function() { - $(result_table_loadicon).html($(result_table_loadicon).html() + "

"+could_not_load+"

"); + $(result_table_loadicon).html($(result_table_loadicon).html() + "

"+searx.translations.could_not_load+"

"); }); } } -- cgit v1.2.3