title: Cakephp 3 routing with language parameter
body: <p>I'm trying to convert cakephp 2.x to 3.x. I was using <code>Router::connect()</code> rules, but I try to convert them to scope version.</p>
  
  <p>Regarding to myold routing rule, in <code>config/routes.php</code> I added this.</p>
  
  <pre><code>  Router::defaultRouteClass('Route');
    Router::scope('/', function ($routes) {
  
      $routes-&gt;connect('/:language/:controller/:action/*', ['language' =&gt; 'ar|de|en|fr']);
      $routes-&gt;connect('/:language/:controller', ['action' =&gt; 'index', 'language' =&gt; 'ar|de|en|fr']);
      $routes-&gt;connect('/:language', ['controller' =&gt; 'Mydefault', 'action' =&gt; 'index', 'language' =&gt; 'ar|de|en|fr']);
  
      $routes-&gt;redirect('/gohere/*', ['controller' =&gt; 'Mycontroller', 'action' =&gt; 'myaction'], ['persist' =&gt; array('username')]);
  
      $routes-&gt;connect('/', ['controller' =&gt; 'Mydefault', 'action' =&gt; 'index']);
  
      $routes-&gt;fallbacks('InflectedRoute');
  });
  </code></pre>
  
  <ul>
  <li>But this fails in <code>example.com/en/works</code>. I get this error: <code>Error: worksController could not be found.</code> Because my controller file is <code>WorksController.php</code>.</li>
  </ul>
  
  <p>Does controller name part hanged to sentence casein cakephp 3 ? <a href="http://book.cakephp.org/3.0/en/intro/conventions.html#controller-conventions">http://book.cakephp.org/3.0/en/intro/conventions.html#controller-conventions</a></p>
  
  <ul>
  <li>Also <code>example.com/foo/bar</code> gives this error: <code>Error: barController could not be found.</code>. But <code>foo</code> is controller and <code>bar</code> is action.</li>
  </ul>
  
  <p>How can I fix this routing problem ?</p>
  
  <p>Edit:<br>
  Changing <code>Route::defaultRouteClass('Route')</code> to <code>Route::defaultRouteClass('InflectedRoute')</code> solved problem 1. But problem 2 exists.</p>