I would like to make a link the will be in the layout to change the language. So it should work for many routes.
for example
i’m on the page /en/myModule
and the links should point to
/de/myModule
/fr/myModule
I found a solution here :http://oldforum.symfony-project.org/index.php/m/70452/
<?php echo link_to(
'Germany',
'@default?' . http_build_query(array(
'sf_culture' => 'de',
'module' => $sf_request->getParameter('module'),
'action' => $sf_request->getParameter('action'))
), null, '&')) ?>
Problem is that I need a default route, and I don’t want to have it.
Is there any solution for what I need ?
In your layout template:
Link will generate:
http://example.com/culture-change/fr?redirect=http//example.com/fr/control-panelIn your action:
Just off the top off my head. should work…
Not great: Should do some filter on the redirect to make sure it’s the correct domain name etc.