Fixed issue that change of language via language selector did not changed the navbar and sidebar

This commit is contained in:
Jan Böhmer 2022-10-09 20:11:48 +02:00
parent 055752a24d
commit f50959837f
2 changed files with 2 additions and 7 deletions

View file

@ -68,12 +68,7 @@
<li role="separator" class="dropdown-divider"></li>
<h6 class="dropdown-header">{% trans %}user.language_select{% endtrans %}</h6>
<div id="locale-select-menu">
{% for locale in locale_menu %}
<a class="dropdown-item" data-turbo="false" data-turbo-frame="_top"
href="{{ path(app.request.attributes.get('_route'),
app.request.attributes.get('_route_params')|merge({'_locale': locale})) }}">
{{ locale|language_name }} ({{ locale|upper }})</a>
{% endfor %}
{# This menu is filled by 'turbo/locale_menu' controller from the _turbo_control.html.twig template, to always have the correct path #}
</div>
</ul>
</li>

View file

@ -22,7 +22,7 @@
<div class="d-none" {{ stimulus_controller('turbo/locale_menu') }}>
{% for locale in locale_menu %}
<a class="dropdown-item" data-turbo="false" href="{{ path(app.request.attributes.get('_route'),
<a class="dropdown-item" data-turbo="false" data-turbo-frame="_top" href="{{ path(app.request.attributes.get('_route'),
app.request.attributes.get('_route_params')|merge({'_locale': locale})) }}">
{{ locale|language_name }} ({{ locale|upper }})</a>
{% endfor %}