Languages.detect remove default Language Code from URL

Hi there,
I hope everbody is ok in this strange times.

I know my question is similar to this post:

and I’ve read the Github Issue:

But may problem is that my client doesn’t accept the solution. They insist on not having the default language code (en in this case) in the URL. And they have a childish, but in my eyes valid point, since it’s a Kirby2 update - it worked with the old one. I know the Github Issue is closed but I need a solution. Only thing I came up is to check the detected language, send the visitor to the right translation and store it in a session. But I think this is not best way to handle this.

Is there any other way, maybe a route, how this can be handled?

thanks
tom

You can handle with session on routing, for example: Language.detect does not work

Oh, I guess I haven’t seen this…

Thanks, works like charm :slight_smile:

I haven’t tried it, but I’m glad it worked :+1:

I still think this should work by default, but at least the client is happy now.

Thanks again and have a nice day
tom

This doesn’t works for me.

In my config.php I have:

return [
    'debug' => true,
    'languages' => true,
    'languages.detect' => true,

In my it.php:

return [
    'code' => 'it',
    'default' => true,
    'direction' => 'ltr',
    'locale' => ['LC_CTYPE' => 'it_IT'],
    'name' => 'Italiano',
    'url' => '/'
];

in my en.php:

return [
    'code' => 'en',
    'default' => false,
    'direction' => 'ltr',
    'locale' => ['LC_CTYPE' => 'en_US'],
    'name' => 'English',
    'url' => 'en'
];

If in it.php I change 'url' => null I get www.example.com/it

If I add the routing code suggested nothing change… do you see something wrong in my configuration?
Thanks