[fix] fix issues in the language menue introduced by PR #3645

In my review of [1] I tried to reformat the template code of the language
menue whereby I have made two mistakes.

- default language was added twice
- in the 'Auto-detect' item a hard coded `[auto]` was implemented where the
  `search_language` variable was needed.

[1] https://github.com/searxng/searxng/issues/3645

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2024-07-28 08:44:06 +02:00 committed by Markus Heiser
parent 9f47bdefc6
commit 022898e502

View file

@ -1,12 +1,11 @@
<select class="language" id="language" name="language" aria-label="{{ _('Search language') }}">{{- '' -}} <select class="language" id="language" name="language" aria-label="{{ _('Search language') }}">{{- '' -}}
<option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Default language') }} [all]</option>{{- '' -}}
<option value="all" <option value="all"
{%- if current_language == 'all' %} selected="selected" {%- endif -%}> {%- if current_language == 'all' %} selected="selected" {%- endif -%}>
{{- _('Default language') }} [all] {{- '' -}} {{- _('Default language') }} [all] {{- '' -}}
</option>{{- '' -}} </option>{{- '' -}}
<option value="auto" <option value="auto"
{%- if current_language == 'auto' %} selected="selected" {%- endif -%}> {%- if current_language == 'auto' %} selected="selected" {%- endif -%}>
{{- _('Auto-detect') }} [auto] {{- '' -}} {{- _('Auto-detect') }} ({{ search_language }}) {{- '' -}}
</option>{{- '' -}} </option>{{- '' -}}
{% for sxng_tag,lang_name,country_name,english_name,flag in sxng_locales | sort(attribute=1) -%} {% for sxng_tag,lang_name,country_name,english_name,flag in sxng_locales | sort(attribute=1) -%}
<option value="{{ sxng_tag }}" <option value="{{ sxng_tag }}"