{% sw_extends '@Storefront/storefront/layout/header/actions/language-widget.html.twig' %}
{% block layout_header_actions_language_widget_content %}
{% set isoCode = page.header.activeLanguage.translationCode.code|lower|split('-') %}
{# @deprecated tag:v6.5.0 - Remove else cases, to maintain correct split of isoCode #}
{% set language = feature('v6.5.0.0') ? isoCode[0] : isoCode[1] %}
{% set country = feature('v6.5.0.0') ? isoCode[1] : isoCode[0] %}
<div class="languages-menu">
{% block layout_header_actions_languages_widget_form_items %}
<div class="top-bar-list"
aria-labelledby="languagesDropdown-{{ position }}">
{% for language in page.header.languages %}
<div class="top-bar-list-item{% if language.id is same as(page.header.activeLanguage.id) %} item-checked{% endif %}"
title="{{ language.translated.name }}">
{% block layout_header_actions_languages_widget_form_items_flag %}
{% set isoCode = language.translationCode.code|lower|split('-') %}
{# @deprecated tag:v6.5.0 - Remove else cases, to maintain correct split of isoCode #}
{% set flagLanguage = feature('v6.5.0.0') ? isoCode[0] : isoCode[1] %}
{% set flagCountry = feature('v6.5.0.0') ? isoCode[1] : isoCode[0] %}
<label class="top-bar-list-label"
for="{{ position }}-{{ language.id }}">
<input id="{{ position }}-{{ language.id }}"
class="top-bar-list-radio"
value="{{ language.id }}"
name="languageId"
type="radio"
{% if language.id is same as(page.header.activeLanguage.id) %} checked{% endif %}>
{% if language.name|lower == "deutsch" %}
DE
{% elseif language.name|lower == "english" %}
EN
{% elseif language.name|lower == "französisch" %}
FR
{% else %}
{{ language.name }}
{% endif %}
</label>
{% endblock %}
</div>
{% endfor %}
</div>
{% endblock %}
</div>
<input name="redirectTo" type="hidden" value="{{ app.request.get('_route') }}"/>
{% for key, value in app.request.attributes.get('_route_params') %}
<input name="redirectParameters[{{ key }}]" type="hidden" value="{{ value }}">
{% endfor %}
{% endblock %}