{# The language switcher: one POST form, a submit button per language, so it works with JavaScript off and the page reloads in the chosen language. Each name is written in its own language and marked with `lang`, so a screen reader pronounces it right (WCAG 3.1.2); the current one carries aria-current. `next` brings the reader back to the page they were on. language_form: the form alone, for the user menu. language_menu: the form in its own navbar dropdown, for a reader with no user menu (no auth provider, or not signed in). #} {% macro language_form(construct, choices) %}
{{ csrf_field() }} {{ construct.t("nav-language") }}
{% for choice in choices %} {% endfor %}
{% endmacro %} {% macro language_menu(construct, choices) %}
{{ icon("language") }} {{ construct.t("nav-language") }}: {% for choice in choices if choice.current %}{{ choice.name }}{% endfor %} {{ icon("expand", cls="fcu-navbar__dropdown-arrow") }}
{{ language_form(construct, choices) }}
{% endmacro %}