{% set localeData = aa_site_locales() %}
{% if localeData.locale_alternate_switches|default([])|length %}
  <nav class="navbar navbar-expand-lg locale-switcher">
    <div class="container-fluid">
      <div class="collapse navbar-collapse" id="navbarNavDarkDropdown">
        <ul class="navbar-nav">
          <li class="nav-item dropdown">
            {% set cls = localeData.locale_current_switch %}
            <a class="dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false" href="#">
              <span class="mr-2 d-inline text-gray-600 small"><i class="fa fa-chevron-down"></i></span>
              <img class="img-profile rounded-circle"
                   src="{{ cls.image|webp() }}"
                   alt="{{ cls.locale.code|upper }}"
                   style="width: 25px;height: 25px;"
              >
            </a>
            <div class="dropdown-menu">
              {% for ls in localeData.locale_alternate_switches|default([]) %}
                {% if ls.url %}
                  <a class="dropdown-item" href="{{ ls.url }}">
                    <span class="text-gray-600 mr-2">{{ ls.locale.code|upper }}</span>
                    <img class="img-profile rounded-circle"
                         src="{{ ls.image|webp() }}"
                         alt="locale image"
                         style="width: 25px;height: 25px;"
                    >
                  </a>
                {% endif %}
              {% endfor %}
            </div>
          </li>
        </ul>
      </div>
    </div>
  </nav>
{% endif %}

