Next-routes: add locale to url

Created on 22 Oct 2017  路  4Comments  路  Source: fridays/next-routes

Now I can write

.add('index', '/:lang(ru|en)?', 'index')
.add('about', '/:lang(ru|en)?/about', 'about')
...

It is possible to release?
```
routes
.add('i18n', '/:lang(ru|en)?/:path?', ':path');
````

Im try to add custom handler but it work only on server
function customHandler(args) { const {req, res, route, query} = args; const path = query.path ? query.path : ''; app.render(req, res, `/${path}`, query); }

Is the way to customize on client?

Most helpful comment

I would love this funcitonality it looks exactly what I need

All 4 comments

Not yet, but it鈥檚 a good idea! We could make the page parameter optionally accept a function, that receives the params and returns the page

If anyone wants to look into this right away, changes need to be done here and here

I would love this funcitonality it looks exactly what I need

Any update on this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joncursi picture joncursi  路  3Comments

adekbadek picture adekbadek  路  4Comments

nishtacular picture nishtacular  路  3Comments

adrianha picture adrianha  路  3Comments

dbenfouzari picture dbenfouzari  路  6Comments