website/templates/language_selector.html
vachan-maker 3d33a840b2 Add proper FAQ page and TTS instructions
Signed-off-by: meenbeese <meenbeese@tutanota.com>
Signed-off-by: S. Kozyr <s.trump@gmail.com>
Signed-off-by: Alexander Borsuk <me@alex.bio>
2024-03-07 00:45:07 +02:00

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>