Open lchabrand opened 8 years ago
One way to do this :
<a href="{{ path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')|merge({'_locale' : 'fr'})) }}">FR</a>
<a href="{{ path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')|merge({'_locale' : 'en'})) }}">EN</a>
I made it like this (Twig template):
{% for lang in ['en', 'ru', 'de', 'es', 'fr', 'pt', 'it'] if lang != app.request.locale %}
<a href="{{ path(app.request.attributes.get('_route', 'home'), app.request.attributes.get('_route_params', {})|merge({ _locale: lang })) }}">
<span>{{ lang|title }}</span>
</a>
{% endfor %}
The http://jmsyst.com/bundles/JMSI18nRoutingBundle/master/cookbook/language_switcher page is still empty.
Hi, first thank you for your bundle which seems very nice. You leave the part "Creating a Language Switcher" empty, can you please explain how to change a language switcher ? Regards,