templates/partial/langSwitcher.html.twig line 1
{% set actualLangue = app.request.locale %}
{% set routeParams = app.request.get('_route_params') %}
<a class="nav-item nav-link dropdown-toggle mr-md-2" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<img class="mr-2 pb-1" alt="{{ actualLangue }}" src="{{ asset('/images/' ~ actualLangue ~ '.svg') }}" width="20px">
{{ actualLangue|upper }}
</a>
<div class="dropdown-menu dropdown-menu-right py-0" style="min-width: 0;">
{% for langue in ['fr', 'en'] %}
{% if app.request.get('_route') is null %}
{% set href = path('index', {'_locale': langue}|merge(url_parameters)) %}
{% else %}
{% set href = path(app.request.get('_route'), routeParams|merge({'_locale': langue})|merge(url_parameters)) %}
{% endif %}
<a class="dropdown-item py-2" href="{{ href }}"><img class="mr-3 pb-1" alt="{{ actualLangue }}" src="{{ asset('/images/' ~ langue ~ '.svg') }}" width="20px">{{ langue|upper }}</a>
{% endfor %}
</div>