title: Symfony2 routing multilingual site
body: <p>I have a routing problem for a multilingual site. Here's the routing.yml (only for one bundle, but the others are the same)</p>
  
  <pre><code>icoo_pitanja_route:
  pattern:  /{_locale}/najcesca-pitanja
  defaults: { _controller: IcooPitanjaBundle:Pitanja:pitanja, _locale:hr }
  requirements:
      _locale: hr|en|de
  
  icoo_pitanja_route:
  pattern:  /{_locale}/common-questions
  defaults: { _controller: IcooPitanjaBundle:Pitanja:pitanja, _locale:en }
  requirements:
      _locale: hr|en|de
  </code></pre>
  
  <p>O the top of my page, I have 3 links to change the languages to croatian (default), english and german. The code for making link to change them is this...</p>
  
  <pre><code>{% set requestParams = app.request.attributes.get('_route_params') %}
      {% set requestRoute = app.request.attributes.get('_route') %}
      &lt;div class='languages col-xs-4'&gt;
          &lt;a href="{{ path(requestRoute, requestParams|merge({'_locale' : 'hr'})) }}" class='col-xs-3'&gt;&lt;span class='real-link'&gt;croatian&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/a&gt;
          &lt;a href="{{ path(requestRoute, requestParams|merge({'_locale' : 'en'})) }}" class='col-xs-3'&gt;&lt;span class='real-link'&gt;english&lt;/span&gt;&lt;span&gt;|&lt;/span&gt;&lt;/a&gt;
          &lt;a href="{{ path(requestRoute, requestParams|merge({'_locale' : 'de'})) }}" class='col-xs-3'&gt;&lt;span class='real-link'&gt;deutch&lt;/span&gt;&lt;span&gt;|&lt;/span&gt;&lt;/a&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>The real problem is in the <code>path()</code> twig method that makes link for a navigation that the above route controls. It creates the paths only for the english version. I presume beacuse it's the last one so when I put a route for german language, it will generate the path for that route. Since the path name is <code>icoo_pitanja_route</code> and its the same route name for english and croatian version, the <code>path()</code> is defined like this...</p>
  
  <pre><code>path('icoo_naslovna_route')
  </code></pre>
  
  <p>What I want, is when I click on croatian, that the url be www.example.com/hr/najcesca-pitanja, for english www.example.com/en/common-questions. But the <code>paht()</code> method chooses the last one, the english one. </p>
  
  <p>Now, there are several ways to solve this. One of them would be to make diffrent routes for every language. The other one would be to make it like this...</p>
  
  <pre><code>pattern: (_locale}/{language-specific-link} 
  </code></pre>
  
  <p>and handle it in the controller with an array of valid links for each language then, if the url is valid, return the proper response. If not, throw not found exception but I think that that invalidates the purpose of Symfony2 routing. </p>
  
  <p>Does anyone have any ideas on how to handle this problem?</p>