templates/bundles/SyliusShopBundle/Menu/_localeSwitch.html.twig line 1

Open in your IDE?
  1. {% set localeChoices = [
  2. {'code': 'fr', 'label': 'Français', 'lang': 'fr'},
  3. {'code': 'en', 'label': 'English', 'lang': 'en'},
  4. ] %}
  5. {% if localeChoices|length > 1 %}
  6. <div class="item heph-locale-switch" id="sylius-locale-selector" aria-label="{{ 'language.selector'|trans }}">
  7. {% for locale in localeChoices %}
  8. {% set isActive = active|slice(0, 2) == locale.code %}
  9. <a href="{{ path('sylius_shop_switch_locale', {'code': locale.code}) }}"
  10. class="heph-locale-link{% if isActive %} is-active{% endif %} sylius-available-locale"
  11. lang="{{ locale.lang }}"
  12. hreflang="{{ locale.lang }}">
  13. {{ locale.label }}
  14. </a>
  15. {% endfor %}
  16. </div>
  17. {% endif %}