{%- set listLanguages = ["fr", "en"] -%}
{%- if redirect is defined -%}
{%- set pathParams = {"redirect": redirect|url_encode} -%}
{%- endif -%}
<div class="ui-language {{ containerClass|default('') }}">
{% for language in listLanguages %}
<a href="{{ path(path|default('root'), {'_locale': language}|merge( pathParams|default({}) )) }}"
class="ui-language__link{% if app.request.locale == language %} is-active{% endif %}"
>
<img class="ui-language__flag"
src="{{ image('flag_' ~ language ~ '.png') }}"
data-toggle="tooltip"
data-placement="bottom"
title="{{ ('global.languages.' ~ language)|trans }}" />
</a>
{% endfor %}
</div>