diff --git a/searx/engines/flickr_noapi.py b/searx/engines/flickr_noapi.py index c8ee34f7a..1cbb3e0a9 100644 --- a/searx/engines/flickr_noapi.py +++ b/searx/engines/flickr_noapi.py @@ -117,14 +117,10 @@ def response(resp): 'img_format': img_format, 'template': 'images.html' } - try: - result['author'] = author - result['title'] = title - result['content'] = content - except: - result['author'] = '' - result['title'] = '' - result['content'] = '' + result['author'] = author.encode('utf-8', 'ignore').decode('utf-8') + result['source'] = source.encode('utf-8', 'ignore').decode('utf-8') + result['title'] = title.encode('utf-8', 'ignore').decode('utf-8') + result['content'] = content.encode('utf-8', 'ignore').decode('utf-8') results.append(result) return results diff --git a/searx/static/themes/oscar/js/searx.js b/searx/static/themes/oscar/js/searx.js index c93f597fe..2cd9ca26a 100644 --- a/searx/static/themes/oscar/js/searx.js +++ b/searx/static/themes/oscar/js/searx.js @@ -291,7 +291,7 @@ $(document).ready(function(){ } }) .fail(function() { - $(result_table_loadicon).html($(result_table_loadicon).html() + "

could not load data!

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

"+could_not_load+"

"); }); } } diff --git a/searx/static/themes/oscar/js/searx.min.js b/searx/static/themes/oscar/js/searx.min.js index 08aba2b4b..52a58800b 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_src/leaflet_map.js b/searx/static/themes/oscar/js/searx_src/leaflet_map.js index 3c8c616b1..06931b474 100644 --- a/searx/static/themes/oscar/js/searx_src/leaflet_map.js +++ b/searx/static/themes/oscar/js/searx_src/leaflet_map.js @@ -90,7 +90,7 @@ $(document).ready(function(){ } }) .fail(function() { - $(result_table_loadicon).html($(result_table_loadicon).html() + "

could not load data!

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

"+could_not_load+"

"); }); } } diff --git a/searx/static/themes/simple/js/searx.head.min.js b/searx/static/themes/simple/js/searx.head.min.js index 00c711c79..8cd0df3d6 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.js b/searx/static/themes/simple/js/searx.js index e191f2487..3e9ad3e7f 100644 --- a/searx/static/themes/simple/js/searx.js +++ b/searx/static/themes/simple/js/searx.js @@ -1314,7 +1314,7 @@ module.exports = AutoComplete; }) .catch(function() { result_table_loadicon.classList.remove('invisible'); - result_table_loadicon.innerHTML = "could not load data!"; + result_table_loadicon.innerHTML = could_not_load; }); } } diff --git a/searx/static/themes/simple/js/searx.min.js b/searx/static/themes/simple/js/searx.min.js index 42e8a845c..264a7fb42 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 d7a1eeac8..81e7ddffa 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_src/searx_mapresult.js b/searx/static/themes/simple/js/searx_src/searx_mapresult.js index 869d07da0..267ac94cb 100644 --- a/searx/static/themes/simple/js/searx_src/searx_mapresult.js +++ b/searx/static/themes/simple/js/searx_src/searx_mapresult.js @@ -97,7 +97,7 @@ }) .catch(function() { result_table_loadicon.classList.remove('invisible'); - result_table_loadicon.innerHTML = "could not load data!"; + result_table_loadicon.innerHTML = could_not_load; }); } } diff --git a/searx/templates/__common__/translations.js.tpl b/searx/templates/__common__/translations.js.tpl new file mode 100644 index 000000000..8453aba69 --- /dev/null +++ b/searx/templates/__common__/translations.js.tpl @@ -0,0 +1 @@ +var could_not_load = '{{ _('could not load data') }}!'; diff --git a/searx/templates/oscar/base.html b/searx/templates/oscar/base.html index cd3d23df5..839619976 100644 --- a/searx/templates/oscar/base.html +++ b/searx/templates/oscar/base.html @@ -10,7 +10,7 @@ {% block meta %}{% endblock %} - + {% block title %}{% endblock %}{{ instance_name }} {% if preferences.get_value('oscar-style') -%} diff --git a/searx/templates/simple/base.html b/searx/templates/simple/base.html index 650ef771c..5cb1e1757 100644 --- a/searx/templates/simple/base.html +++ b/searx/templates/simple/base.html @@ -12,6 +12,7 @@ {% block title %}{% endblock %}{{ instance_name }} {% block meta %}{% endblock %} + {% if rtl %} {% else %} diff --git a/searx/webapp.py b/searx/webapp.py index 2ba8ccfb8..68be25584 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -1021,6 +1021,14 @@ 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