diff options
author | marc <a01200356@itesm.mx> | 2016-08-05 23:34:56 -0500 |
---|---|---|
committer | marc <a01200356@itesm.mx> | 2016-12-13 19:32:00 -0600 |
commit | 149802c56926bf48520c98932c4c36b8152b3d2d (patch) | |
tree | f450a584a785c31a1c118be29b3039f779a0cb70 /searx/templates | |
parent | e58949b76fac7aa93341523ff0e2f35e0a03e057 (diff) | |
download | searxng-149802c56926bf48520c98932c4c36b8152b3d2d.tar.gz searxng-149802c56926bf48520c98932c4c36b8152b3d2d.zip |
[enh] add supported_languages on engines and auto-generate languages.py
Diffstat (limited to 'searx/templates')
-rw-r--r-- | searx/templates/courgette/preferences.html | 6 | ||||
-rw-r--r-- | searx/templates/legacy/preferences.html | 6 | ||||
-rw-r--r-- | searx/templates/oscar/advanced.html | 1 | ||||
-rw-r--r-- | searx/templates/oscar/languages.html | 12 | ||||
-rw-r--r-- | searx/templates/oscar/preferences.html | 11 | ||||
-rw-r--r-- | searx/templates/pix-art/preferences.html | 6 |
6 files changed, 27 insertions, 15 deletions
diff --git a/searx/templates/courgette/preferences.html b/searx/templates/courgette/preferences.html index ba4d0c650..56a6e0202 100644 --- a/searx/templates/courgette/preferences.html +++ b/searx/templates/courgette/preferences.html @@ -13,9 +13,9 @@ <legend>{{ _('Search language') }}</legend> <p> <select name='language'> - <option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Automatic') }}</option> - {% for lang_id,lang_name,country_name in language_codes | sort(attribute=1) %} - <option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}>{{ lang_name }} ({{ country_name }}) - {{ lang_id }}</option> + <option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Default language') }}</option> + {% for lang_id,lang_name,country_name,english_name in language_codes | sort(attribute=1) %} + <option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}>{{ lang_name }} {% if country_name %}({{ country_name }}) {% endif %}- {{ lang_id }}</option> {% endfor %} </select> </p> diff --git a/searx/templates/legacy/preferences.html b/searx/templates/legacy/preferences.html index 30d632c93..f418dcd5b 100644 --- a/searx/templates/legacy/preferences.html +++ b/searx/templates/legacy/preferences.html @@ -14,9 +14,9 @@ <legend>{{ _('Search language') }}</legend> <p> <select name='language'> - <option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Automatic') }}</option> - {% for lang_id,lang_name,country_name in language_codes | sort(attribute=1) %} - <option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}>{{ lang_name }} ({{ country_name }}) - {{ lang_id }}</option> + <option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Default language') }}</option> + {% for lang_id,lang_name,country_name,english_name in language_codes | sort(attribute=1) %} + <option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}>{{ lang_name }} {% if country_name %}({{ country_name }}) {% endif %}- {{ lang_id }}</option> {% endfor %} </select> </p> diff --git a/searx/templates/oscar/advanced.html b/searx/templates/oscar/advanced.html index 2c694cf5f..b4a054a11 100644 --- a/searx/templates/oscar/advanced.html +++ b/searx/templates/oscar/advanced.html @@ -6,4 +6,5 @@ <div id="advanced-search-container"> {% include 'oscar/categories.html' %} {% include 'oscar/time-range.html' %} + {% include 'oscar/languages.html' %} </div> diff --git a/searx/templates/oscar/languages.html b/searx/templates/oscar/languages.html new file mode 100644 index 000000000..3aa6376a2 --- /dev/null +++ b/searx/templates/oscar/languages.html @@ -0,0 +1,12 @@ +{% if preferences %} +<select class="form-control" name='language'> +{% else %} +<select class="time_range" name='language'> +{% endif %} + <option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Default language') }}</option> + {% for lang_id,lang_name,country_name,english_name in language_codes | sort(attribute=1) %} + <option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}> + {{ lang_name }} {% if country_name %}({{ country_name }}) {% endif %}- {{ lang_id }} + </option> + {% endfor %} +</select> diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html index 6ad795095..18bd7c212 100644 --- a/searx/templates/oscar/preferences.html +++ b/searx/templates/oscar/preferences.html @@ -40,12 +40,7 @@ {% set language_label = _('Search language') %} {% set language_info = _('What language do you prefer for search?') %} {{ preferences_item_header(language_info, language_label, rtl) }} - <select class="form-control" name='language'> - <option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Automatic') }}</option> - {% for lang_id,lang_name,country_name in language_codes | sort(attribute=1) %} - <option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}>{{ lang_name }} ({{ country_name }}) - {{ lang_id }}</option> - {% endfor %} - </select> + {% include 'oscar/languages.html' %} {{ preferences_item_footer(language_info, language_label, rtl) }} {% set locale_label = _('Interface language') %} @@ -153,6 +148,7 @@ <th>{{ _("Allow") }}</th> <th>{{ _("Engine name") }}</th> <th>{{ _("Shortcut") }}</th> + <th>{{ _("Language support") }}</th> <th>{{ _("SafeSearch") }}</th> <th>{{ _("Time range") }}</th> <th>{{ _("Avg. time") }}</th> @@ -161,6 +157,7 @@ <th>{{ _("Max time") }}</th> <th>{{ _("Avg. time") }}</th> <th>{{ _("SafeSearch") }}</th> + <th>{{ _("Language support") }}</th> <th>{{ _("Shortcut") }}</th> <th>{{ _("Engine name") }}</th> <th>{{ _("Allow") }}</th> @@ -175,6 +172,7 @@ </td> <th>{{ search_engine.name }}</th> <td>{{ shortcuts[search_engine.name] }}</td> + <td><input type="checkbox" {{ "checked" if current_language in search_engine.supported_languages or current_language.split('-')[0] in search_engine.supported_languages else ""}} readonly="readonly" disabled="disabled"></td> <td><input type="checkbox" {{ "checked" if search_engine.safesearch==True else ""}} readonly="readonly" disabled="disabled"></td> <td><input type="checkbox" {{ "checked" if search_engine.time_range_support==True else ""}} readonly="readonly" disabled="disabled"></td> <td class="{{ 'danger' if stats[search_engine.name]['warn_time'] else '' }}">{{ 'N/A' if stats[search_engine.name].time==None else stats[search_engine.name].time }}</td> @@ -183,6 +181,7 @@ <td class="{{ 'danger' if stats[search_engine.name]['warn_timeout'] else '' }}">{{ search_engine.timeout }}</td> <td class="{{ 'danger' if stats[search_engine.name]['warn_time'] else '' }}">{{ 'N/A' if stats[search_engine.name].time==None else stats[search_engine.name].time }}</td> <td><input type="checkbox" {{ "checked" if search_engine.safesearch==True else ""}} readonly="readonly" disabled="disabled"></td> + <td><input type="checkbox" {{ "checked" if current_language in search_engine.supported_languages or current_language.split('-')[0] in search_engine.supported_languages else ""}} readonly="readonly" disabled="disabled"></td> <td>{{ shortcuts[search_engine.name] }}</td> <th>{{ search_engine.name }}</th> <td class="onoff-checkbox"> diff --git a/searx/templates/pix-art/preferences.html b/searx/templates/pix-art/preferences.html index ea5557b07..05876dedf 100644 --- a/searx/templates/pix-art/preferences.html +++ b/searx/templates/pix-art/preferences.html @@ -9,9 +9,9 @@ <legend>{{ _('Search language') }}</legend> <p> <select name='language'> - <option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Automatic') }}</option> - {% for lang_id,lang_name,country_name in language_codes | sort(attribute=1) %} - <option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}>{{ lang_name }} ({{ country_name }}) - {{ lang_id }}</option> + <option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Default language') }}</option> + {% for lang_id,lang_name,country_name,english_name in language_codes | sort(attribute=1) %} + <option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}>{{ lang_name }} {% if country_name %}({{ country_name }}) {% endif %}- {{ lang_id }}</option> {% endfor %} </select> </p> |