Signed-off-by: meenbeese <meenbeese@tutanota.com> Signed-off-by: S. Kozyr <s.trump@gmail.com> Signed-off-by: Alexander Borsuk <me@alex.bio>
28 lines
1,014 B
HTML
28 lines
1,014 B
HTML
<span>
|
|
<script>
|
|
function onLanguageClick(langCode) {
|
|
window.localStorage.setItem('lang', langCode);
|
|
return true;
|
|
}
|
|
</script>
|
|
<!-- Hidden checkbox is used for pure CSS toggle menu. -->
|
|
{% set translations = resource | get(key="translations", default=[]) %}
|
|
{% if translations | length > 1 %}
|
|
<input type="checkbox" id="lang-menu-trigger" class="lang-menu-trigger" />
|
|
{% endif %}
|
|
<label class="no-print" for="lang-menu-trigger">
|
|
🌐 {{ lang | upper }}
|
|
</label>
|
|
|
|
<ul class="lang-menu no-print" role="navigation">
|
|
{% for translation in translations | sort(attribute="lang") %}
|
|
{% if lang != translation.lang %}
|
|
<li class="lang-menu-item" role="menuitem">
|
|
<a class="lang-menu-link" onclick="return onLanguageClick('{{ translation.lang }}');" href="{{ translation.permalink | replace(from=config.base_url, to="") | safe }}">
|
|
{{ trans(key="language", lang=translation.lang) }}
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</ul>
|
|
</span>
|