{% set languageLinks = getLanguageNavigation(document) %}
{% set trackingKey = 'click-header-lang-switch' %}
{% set trackingData = {
"trigger": "click",
'datalayer': {
'event': 'click_header_icon',
'click_item': 'lang-switch',
}
} %}
{% do jsConfig('_trackingData').add({
(trackingKey): trackingData
}) %}
{% if languageLinks|length > 1 %}
<div class="dropdown main-navbar__dropdown">
<button type="button" data-bs-toggle="dropdown" aria-expanded="false"
class="btn btn-no-styling main-navbar__language-switch dropdown-toggle"
data-event-tracking-key="{{ trackingKey }}"
>
{{ ('header.locale.' ~ app.request.locale)|trans }}
</button>
<ul class="dropdown-menu">
{% for link, lang in languageLinks %}
{% if lang.lang != app.request.locale %}
<li>
<a class="dropdown-item" href="{{ link }}">{{ lang.text|trans }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
{% endif %}