11 lines
751 B
Twig
11 lines
751 B
Twig
{# Language links for every enabled locale (config/packages/translation.yaml). The current one is marked; others go through /language/<code>, which remembers the choice in a cookie and returns here. #}
|
|
<nav class="lang-switch" aria-label="{{ 'language.label'|trans }}">
|
|
{% for code in enabled_locales %}
|
|
{% if code == app.request.locale %}
|
|
<span class="is-active" lang="{{ code }}" aria-current="true" title="{{ ('language.name.' ~ code)|trans }}">{{ code|upper }}</span>
|
|
{% else %}
|
|
<a href="{{ path('language_switch', {locale: code, back: app.request.requestUri}) }}" lang="{{ code }}" hreflang="{{ code }}" rel="nofollow" title="{{ ('language.name.' ~ code)|trans }}">{{ code|upper }}</a>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</nav>
|