title: PHP Silex routing localization
body: <p>starting with Silex.</p>
  
  <p>Say I want a localised site where all routes have to start with <code>/{_locale}</code> and don't fancy repeating myself as :</p>
  
  <pre><code>$app-&gt;match('/{_locale}/foo', function() use ($app) {
  return $app['twig']-&gt;render('foo.twig');
  })
  -&gt;assert('_locale', implode('|', $app['languages.available']))
  -&gt;value('_locale', $app['locale.default'])
  -&gt;bind('foo');
  
  $app-&gt;match('/{_locale}/bar', function() use ($app) {
      return $app['twig']-&gt;render('bar.twig');
      })
      -&gt;assert('_locale', implode('|', $app['languages.available']))
      -&gt;value('_locale', $app['locale.default'])
      -&gt;bind('bar');
  </code></pre>
  
  <p>Ideally, I'd like to create a base route that would match the locale and subclass it in some way but couldn't figure out by myself how to trigger that in an elegant way.</p>