SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
[enh] i18n support
asciimoo2b1d2dbc841d
diff --git a/searx/engines/__init__.py b/searx/engines/__init__.pyindex bc7b3b3bc..96b074ae9 100644--- a/searx/engines/__init__.py+++ b/searx/engines/__init__.py@@ -26,6 +26,7 @@ from searx import settingsfrom searx.utils import gen_useragentimport sysfrom datetime import datetime+from flask.ext.babel import gettextengine_dir = dirname(realpath(__file__))@@ -269,15 +270,24 @@ def get_engines_stats():engine['percentage'] = 0return [- ('Page loads (sec)', sorted(pageloads, key=itemgetter('avg'))),(- 'Number of results',+ gettext('Page loads (sec)'),+ sorted(pageloads, key=itemgetter('avg'))+ ),+ (+ gettext('Number of results'),sorted(results, key=itemgetter('avg'), reverse=True)),- ('Scores', sorted(scores, key=itemgetter('avg'), reverse=True)),(- 'Scores per result',+ gettext('Scores'),+ sorted(scores, key=itemgetter('avg'), reverse=True)+ ),+ (+ gettext('Scores per result'),sorted(scores_per_result, key=itemgetter('avg'), reverse=True)),- ('Errors', sorted(errors, key=itemgetter('avg'), reverse=True)),+ (+ gettext('Errors'),+ sorted(errors, key=itemgetter('avg'), reverse=True)+ ),]diff --git a/searx/templates/engines.html b/searx/templates/engines.htmlindex 1f52dc09f..008e860f1 100644--- a/searx/templates/engines.html+++ b/searx/templates/engines.html@@ -1,12 +1,12 @@{% extends 'base.html' %}{% block content %}<div class="row">-<h2>Currently used search engines</h2>+ <h2>{{ _('Currently used search engines') }}</h2><table style="width: 80%;"><tr>- <th>Engine name</th>- <th>Category</th>+ <th>{{ _('Engine name') }}</th>+ <th>{{ _('Category') }}</th></tr>{% for (categ,search_engines) in categs %}{% for search_engine in search_engines %}@@ -20,7 +20,6 @@{% endfor %}{% endfor %}</table>-<p>Please add more engines to this list, pull requests are welcome!</p>-<p class="right"><a href="/">back</a></p>+<p class="right"><a href="/">{{ _('back') }}</a></p></div>{% endblock %}diff --git a/searx/templates/index.html b/searx/templates/index.htmlindex d9fa3b502..18320ae09 100644--- a/searx/templates/index.html+++ b/searx/templates/index.html@@ -4,8 +4,8 @@<div class="title"><h1>searx</h1></div>{% include 'search.html' %}<p class="top_margin">- <a href="/about" class="hmarg">about</a>- <a href="/preferences" class="hmarg">preferences</a>+ <a href="/about" class="hmarg">{{ _('about') }}</a>+ <a href="/preferences" class="hmarg">{{ _('preferences') }}</a></p></div>{% endblock %}diff --git a/searx/templates/preferences.html b/searx/templates/preferences.htmlindex 705139e58..d47dd4834 100644--- a/searx/templates/preferences.html+++ b/searx/templates/preferences.html@@ -2,18 +2,18 @@{% block head %} {% endblock %}{% block content %}<div class="row">- <h2>Preferences</h2>+ <h2>{{ _('Preferences') }}</h2><fieldset>- <legend>Default categories</legend>+ <legend>{{ _('Default categories') }}</legend><form method="post" action="/preferences" id="search_form"><p>{% include 'categories.html' %}</p>- <input type="submit" value="save" />+ <input type="submit" value="{{ _('save') }}" /></form></fieldset>- <div class="right"><a href="/">back</a></div>+ <div class="right"><a href="/">{{ _('back') }}</a></div></div>{% endblock %}diff --git a/searx/templates/results.html b/searx/templates/results.htmlindex 0fb9250ca..238671878 100644--- a/searx/templates/results.html+++ b/searx/templates/results.html@@ -7,12 +7,12 @@</div><div id="results">{% if suggestions %}- <div id="suggestions"><span>Suggestions: </span>{% for suggestion in suggestions %}<form method="post" action="/"><input type="hidden" name="q" value="{{suggestion}}"><input type="submit" value="{{ suggestion }}" /></form>{% endfor %}</div>+ <div id="suggestions"><span>{{ _('Suggestions') }}:</span>{% for suggestion in suggestions %}<form method="post" action="/"><input type="hidden" name="q" value="{{suggestion}}"><input type="submit" value="{{ suggestion }}" /></form>{% endfor %}</div>{% endif %}<div id ="result_count">- Number of results: {{ number_of_results }}+ {{ _('Number of results') }}: {{ number_of_results }}</div>{% for result in results %}@@ -23,7 +23,7 @@{% endif %}{% endfor %}<div id="apis">- Download results+ {{ _('Download results') }}<form method="post" action="/"><div class="left"><input type="hidden" name="q" value="{{ q }}" />diff --git a/searx/templates/stats.html b/searx/templates/stats.htmlindex 933616e32..cb5757b31 100644--- a/searx/templates/stats.html+++ b/searx/templates/stats.html@@ -1,7 +1,7 @@{% extends "base.html" %}{% block head %} {% endblock %}{% block content %}-<h2>Engine stats</h2>+<h2>{{ _('Engine stats') }}</h2>{% for stat_name,stat_category in stats %}<div class="left">