<li class="nav-item dropdown">
    <a class="nav-link dropdown-toggle" href="#" id="languageSelector" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        {{ if ne site.Params.showFlags false }}
            {{ $countryCode := partial "helpers/country-code.html" . }}
            <span class="flag-icon flag-icon-{{$countryCode}}"></span>
        {{ end }}
        {{ site.Language.LanguageName }}
    </a>
    <div class="dropdown-menu" aria-labelledby="languageSelector">
        {{ range site.Home.AllTranslations }}
        <a class="dropdown-item nav-link languages-item" href="{{ .RelPermalink }}">
            {{ if ne site.Params.showFlags false }}
                {{ $countryCode := partial "helpers/country-code.html" . }}
                <span class="flag-icon flag-icon-{{$countryCode}}"></span>
            {{ end }}
            {{ .Language.LanguageName }}
        </a>
        {{ end }}
    </div>
    </li>
