blob: 9c4e24017eae4479bb022151ec273a4c5d5bc8bc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
{{ $pageURL:= .RelPermalink }}
{{ if site.IsMultiLingual }}
{{ $pageURL = strings.TrimPrefix (path.Join "/" .Language.Lang) $pageURL }}
{{ end }}
<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">
{{ $countryCode := partial "helpers/country-code.html" .Language }}
<span class="flag-icon flag-icon-{{$countryCode}}"></span>
{{ site.Language.LanguageName }}
</a>
<div class="dropdown-menu" aria-labelledby="languageSelector">
{{ range .Translations }}
<a class="dropdown-item nav-link languages-item" href="{{ path.Join "/" (cond (eq .Language.Lang "en") "" .Language.Lang) $pageURL }}">
{{ $countryCode := partial "helpers/country-code.html" .Language }}
<span class="flag-icon flag-icon-{{$countryCode}}"></span>
{{ .Language.LanguageName }}
</a>
{{ end }}
</div>
</li>
|