<!-- Language List -->
{{ $class := .Class }}
{{ $context := .Context }}

{{ if $context.IsTranslated }}
  <select class="{{ $class }}" onchange="location = this.value">
    {{ $siteLanguages := site.Home.AllTranslations }}
    {{ $pageLang := $context.Lang }}
    {{ range $siteLanguages }}
      {{ if eq (string $pageLang) (string .Language) }}
        <option id="{{ .Language }}" value="{{ .RelPermalink }}" selected>
          {{ .Language.LanguageName }}
        </option>
      {{ else }}
        <option id="{{ .Language }}" value="{{ .RelPermalink }}">
          {{ .Language.LanguageName }}
        </option>
      {{ end }}
    {{ end }}
  </select>
{{ end }}
