{% load i18n %}
{% get_available_languages as languages %}
{% get_current_language as LANGUAGE_CODE %}

<li class="nav-item dropdown">
    <a href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
       class="nav-link dropdown-toggle has-img mb-3 mb-lg-0 mt-3 mt-lg-0">
        <em class="fa fa-language"></em>
        {% trans "Language" %}
    </a>

    <form action="{% url 'set_language' %}" method="post" id="change-language-form">
        {% csrf_token %}
        <input name="next" type="hidden" value="{{ redirect_to }}">
    </form>

    <div aria-labelledby="clientZone" class="dropdown-menu">
        {% for lang_code, lang_name in languages %}
            {% language lang_code %}
                <a href="{% url "jobs:home" %}" data-lang-code="{{ lang_code }}" class="dropdown-item">{{ lang_name }}</a>
            {% endlanguage %}
        {% endfor %}
    </div>
</li>