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+"
"); }); } } diff --git a/searx/static/themes/oscar/js/searx.min.js b/searx/static/themes/oscar/js/searx.min.js index 71d67ae7f..0021f599c 100644 Binary files a/searx/static/themes/oscar/js/searx.min.js and b/searx/static/themes/oscar/js/searx.min.js differ diff --git a/searx/static/themes/oscar/js/searx.min.js.map b/searx/static/themes/oscar/js/searx.min.js.map index 11b3a9102..13e949a74 100644 Binary files a/searx/static/themes/oscar/js/searx.min.js.map and b/searx/static/themes/oscar/js/searx.min.js.map differ diff --git a/searx/static/themes/oscar/src/js/01_init.js b/searx/static/themes/oscar/src/js/01_init.js index 690365c7f..dd8de4ddb 100644 --- a/searx/static/themes/oscar/src/js/01_init.js +++ b/searx/static/themes/oscar/src/js/01_init.js @@ -25,6 +25,7 @@ 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); diff --git a/searx/static/themes/oscar/src/js/leaflet_map.js b/searx/static/themes/oscar/src/js/leaflet_map.js index d1e102ff6..83364b0c3 100644 --- a/searx/static/themes/oscar/src/js/leaflet_map.js +++ b/searx/static/themes/oscar/src/js/leaflet_map.js @@ -90,7 +90,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+"
"); }); } } diff --git a/searx/static/themes/simple/js/searx.head.js b/searx/static/themes/simple/js/searx.head.js index 3ac61c8ae..e6964400b 100644 --- a/searx/static/themes/simple/js/searx.head.js +++ b/searx/static/themes/simple/js/searx.head.js @@ -32,7 +32,7 @@ search_on_category_select: script.getAttribute('data-search-on-category-select') === 'true', infinite_scroll: script.getAttribute('data-infinite-scroll') === 'true', static_path: script.getAttribute('data-static-path'), - no_item_found: script.getAttribute('data-no-item-found') + translations: JSON.parse(script.getAttribute('data-translations')), } // update the css diff --git a/searx/static/themes/simple/js/searx.head.min.js b/searx/static/themes/simple/js/searx.head.min.js index 19de1e498..5c87d749b 100644 Binary files a/searx/static/themes/simple/js/searx.head.min.js and b/searx/static/themes/simple/js/searx.head.min.js differ diff --git a/searx/static/themes/simple/js/searx.head.min.js.map b/searx/static/themes/simple/js/searx.head.min.js.map index d19ad5a44..a233d297b 100644 Binary files a/searx/static/themes/simple/js/searx.head.min.js.map and b/searx/static/themes/simple/js/searx.head.min.js.map differ diff --git a/searx/static/themes/simple/js/searx.js b/searx/static/themes/simple/js/searx.js index 8fb2471b0..1abe81e4d 100644 --- a/searx/static/themes/simple/js/searx.js +++ b/searx/static/themes/simple/js/searx.js @@ -1529,7 +1529,7 @@ module.exports = AutoComplete; if (searx.autocompleter) { searx.autocomplete = AutoComplete.call(w, { Url: "./autocompleter", - EmptyMessage: searx.no_item_found, + EmptyMessage: searx.translations.no_item_found, HttpMethod: searx.method, HttpHeaders: { "Content-type": "application/x-www-form-urlencoded", diff --git a/searx/static/themes/simple/js/searx.min.js b/searx/static/themes/simple/js/searx.min.js index 731e9ca7c..3b2b9d762 100644 Binary files a/searx/static/themes/simple/js/searx.min.js and b/searx/static/themes/simple/js/searx.min.js differ diff --git a/searx/static/themes/simple/js/searx.min.js.map b/searx/static/themes/simple/js/searx.min.js.map index fafc9644b..efce15142 100644 Binary files a/searx/static/themes/simple/js/searx.min.js.map and b/searx/static/themes/simple/js/searx.min.js.map differ diff --git a/searx/static/themes/simple/js/searx_head/00_init.js b/searx/static/themes/simple/js/searx_head/00_init.js index 3ac61c8ae..e6964400b 100644 --- a/searx/static/themes/simple/js/searx_head/00_init.js +++ b/searx/static/themes/simple/js/searx_head/00_init.js @@ -32,7 +32,7 @@ search_on_category_select: script.getAttribute('data-search-on-category-select') === 'true', infinite_scroll: script.getAttribute('data-infinite-scroll') === 'true', static_path: script.getAttribute('data-static-path'), - no_item_found: script.getAttribute('data-no-item-found') + translations: JSON.parse(script.getAttribute('data-translations')), } // update the css diff --git a/searx/static/themes/simple/js/searx_src/searx_search.js b/searx/static/themes/simple/js/searx_src/searx_search.js index 7b652fa92..0e498717c 100644 --- a/searx/static/themes/simple/js/searx_src/searx_search.js +++ b/searx/static/themes/simple/js/searx_src/searx_search.js @@ -73,7 +73,7 @@ if (searx.autocompleter) { searx.autocomplete = AutoComplete.call(w, { Url: "./autocompleter", - EmptyMessage: searx.no_item_found, + EmptyMessage: searx.translations.no_item_found, HttpMethod: searx.method, HttpHeaders: { "Content-type": "application/x-www-form-urlencoded", 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 %} -