Display and highlight current language in dropdown list

Currently, we don't display the current language in the list.  This is
confusing because the list changes when switching language.

Now we always display the full list, and we highlight the current
language.
This commit is contained in:
Baptiste Jonglez 2021-07-17 15:43:49 +02:00 committed by zorun
parent 4d93a585da
commit 9444c1099a

View file

@ -65,9 +65,7 @@
<div class="dropdown-menu" aria-labelledby="langMenuButton">
<h6 class="dropdown-header">{{ _('Languages') }}</h6>
{% for lang in config['SUPPORTED_LANGUAGES'] %}
{% if g.lang != lang %}
<a class="dropdown-item" href="{{ url_for("main.change_lang", lang=lang)}}">{{ locale_from_iso(lang).display_name | capitalize }}</a>
{% endif %}
<a class="dropdown-item{% if g.lang == lang %} active{% endif %}" href="{{ url_for("main.change_lang", lang=lang)}}">{{ locale_from_iso(lang).display_name | capitalize }}</a>
{% endfor %}
</div>
</li>