{block name='snippets-language-dropdown'}
    {$languages = JTL\Session\Frontend::getLanguages()}
    {if count($languages) > 1}
        <div class="nav-item dropdown language-dropdown">
            <a class="nav-link nav-link-custom dropdown-toggle et-dropdown-toggle" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" role="button" aria-label="{lang key='language'}">
                {foreach $languages as $language}
                    {if $language->getId() === JTL\Shop::getLanguageID()}
                        {block name='snippets-language-dropdown-text'}
                            {$language->getIso639()|upper}
                        {/block}
                    {/if}
                {/foreach}
                <i class='{et_getIcon key="dropdownOpen"} et-dropdown-open'></i><i class='{et_getIcon key="dropdownClosed"} et-dropdown-closed'></i>
            </a>
            <div class="dropdown-menu dropdown-menu-right">
                {foreach $languages as $language}
                    {block name='snippets-language-dropdown-item'}
                        <a class="dropdown-item link-lang{if $language->getId() === JTL\Shop::getLanguageID()} active{/if}" href="{$language->getUrl()}" data-iso="{$language->getIso()}" hreflang="{$language->getIso639()}">
                            {$language->getIso639()|upper}
                        </a>
                    {/block}
                {/foreach}
            </div>
        </div>
    {/if}
{/block}
