templates/bundles/WAMCoreBundle/Extension/locale_switcher.html.twig line 1

Open in your IDE?
  1. {% set currentLocale = app.request.locale %}
  2. <li class="navbar-secondary--lang">{{ currentLocale }}
  3.     {% for locale,description in locales %}
  4.         {% if locale not in disabled_locales %}
  5.             {% set routeDocument = app.request.get('routeDocument') %}
  6.             {% 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)%}
  7.                 {% if false and mode == 'redirect_to_home' %}
  8.                     {% set url = path('home', {'_locale': locale}) %}
  9.                 {% else %}
  10.                     {% set routeParams =  app.request.get('_route_params') ?: {} %}
  11.                     {% set url = path(app.request.get('_route'), routeParams|merge({'_locale': locale})) %}
  12.                 {% endif %}
  13.                  <a title="{{ description.label|trans }}" href="{{ url }}" class="js-delete-cookie">{{ locale }}</a>
  14.                 {% if not loop.last and (locale == 'en' and app.request.get('routeDocument').canonicalName not in ['wam_routing_url_5', 'wam_routing_url_26']) %}
  15.                 {% endif %}
  16.             {% endif %}
  17.         {% endif %}
  18.     {% endfor %}
  19. </li>