{% set currentLocale = app.request.locale %}
<li class="navbar-secondary--lang">{{ currentLocale }}
{% for locale,description in locales %}
{% if locale not in disabled_locales %}
{% set routeDocument = app.request.get('routeDocument') %}
{% if currentLocale != locale and routeDocument is not null and (routeDocument.canonicalName not in ['wam_routing_url_5', 'wam_routing_url_26'] or locale in blog_enabled_locales)%}
{% if false and mode == 'redirect_to_home' %}
{% set url = path('home', {'_locale': locale}) %}
{% else %}
{% set routeParams = app.request.get('_route_params') ?: {} %}
{% set url = path(app.request.get('_route'), routeParams|merge({'_locale': locale})) %}
{% endif %}
<a title="{{ description.label|trans }}" href="{{ url }}" class="js-delete-cookie">{{ locale }}</a>
{% if not loop.last and (locale == 'en' and app.request.get('routeDocument').canonicalName not in ['wam_routing_url_5', 'wam_routing_url_26']) %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
</li>