# Problem with Router

**URL:** <https://discourse.cakephp.org/t/problem-with-router/2098>\
**Category:** Need Help\
**Tags:** translation\
**Created:** [February 16, 2017, 6:04pm UTC](https://discourse.cakephp.org/t/problem-with-router/2098 "2017-02-16T18:04:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marethyun](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/marethyun/32/529_2.png) [@Marethyun](https://discourse.cakephp.org/u/Marethyun)\
**Post date:** [February 16, 2017, 6:04pm UTC](https://discourse.cakephp.org/t/problem-with-router/2098/1 "2017-02-16T18:04:29Z")

</div>

Hello !  
I ask you for help here cause I am unable to prefix my routes by the lang type.  
I’ll try to explain more,  
I have this code in /config/routes.php

```
Router::prefix('/', function (RouteBuilder $routes) {
    Router::connect('/', array(
        'controller' => 'home',
        'action' => 'index'
    ));
    // ..
});

```

How can I config the Router to connect all routes to a lang prefix ?  
This would match with URLs like [http://mydomain.com/en\_US/signup](http://mydomain.com/en_US/signup)  
With the lang prefix to a parameter, so this url could be changed in /fr\_FR/signup,  
or /es\_ES/signup,  
Be lang should be a parameter to my controllers, to change the language dynamically.

I really dont know how to realize that, i searched in google, stackoverflow, and cake documentation and i didnt find nothing.  
Can you help me ?

P.S.: I’m sorry for my eventually bad english, it’s not my main language…  
(I cannot write more tags for this thread, i dont know how to.)

Thanks for reading !

---

<div class="post-metadata">

**Author:** ![littleylv](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/littleylv/32/494_2.png) [@littleylv](https://discourse.cakephp.org/u/littleylv)\
**Post date:** [February 17, 2017, 1:10am UTC](https://discourse.cakephp.org/t/problem-with-router/2098/2 "2017-02-17T01:10:22Z")

</div>

Try [https://github.com/ADmad/cakephp-i18n](https://github.com/ADmad/cakephp-i18n)
