# Multilanguage route middleware for slim 4

**URL:** <https://discourse.slimframework.com/t/multilanguage-route-middleware-for-slim-4/4659>\
**Category:** Questions\
**Created:** [February 16, 2021, 5:59pm UTC](https://discourse.slimframework.com/t/multilanguage-route-middleware-for-slim-4/4659 "2021-02-16T17:59:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oscar](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/oscar/32/1289_2.png) [@Oscar](https://discourse.slimframework.com/u/Oscar)\
**Post date:** [February 16, 2021, 5:59pm UTC](https://discourse.slimframework.com/t/multilanguage-route-middleware-for-slim-4/4659/1 "2021-02-16T17:59:26Z")

</div>

Hey guys!  
Im starting with slim 4, and I cant find a working solution for this, I’ve read a couple of tutorials on slim 3 and even slim 2, but no luck.

This is the only thing left for me to use this amazing framework in production! Any help is appreciated.

I would like something like symfony, where we can setup maybe route groups /en/home and /de/home

---

<div class="post-metadata">

**Author:** ![odan](https://avatars.discourse-cdn.com/v4/letter/o/9de053/32.png) [@odan](https://discourse.slimframework.com/u/odan)\
**Post date:** [February 17, 2021, 12:09pm UTC](https://discourse.slimframework.com/t/multilanguage-route-middleware-for-slim-4/4659/2 "2021-02-17T12:09:30Z")

</div>

Hi Oscar 🙂

You can find this information in the Slim documentation: Route groups

```php
use Slim\Routing\RouteCollectorProxy;
// ...

$app->group('/{language}', function (RouteCollectorProxy $group) {
     $group->get('/home', function ($request, $response, array $args) {
        $response->getBody()->write("Home " . $args['language']);

        return $response;
    });
});

```

---

<div class="post-metadata">

**Author:** ![Oscar](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/oscar/32/1289_2.png) [@Oscar](https://discourse.slimframework.com/u/Oscar)\
**Post date:** [February 22, 2021, 7:31pm UTC](https://discourse.slimframework.com/t/multilanguage-route-middleware-for-slim-4/4659/3 "2021-02-22T19:31:17Z")

</div>

Thank you! Works like a charm.
