Cannot switch to secondary language

Hi there,

in my current website project, I have turned on languages at a late stage and now I have the problem that Kirby does not recognize/understand that I am on a secondary language page and does not switch the language accordingly.

English is my default language and if I go to mysite.com/de it should switch to German, but when I return the current language via $kirby->language()->code(); it returns en still.

When I loop over all the languages, it does show that German is one of them and also correctly show the url as mysite.com/de.

I have added the languages via the Panel and all the content files are correctly renamed from foo.txt to foo.en.txt.

My language files look like this:

<?php

return [
    'code' => 'de',
    'default' => false,
    'direction' => 'ltr',
    'locale' => [
        'LC_ALL' => 'de_DE'
    ],
    'name' => 'Deutsch',
    'translations' => [

    ],
    'url' => NULL
];

and

<?php

return [
    'code' => 'en',
    'default' => true,
    'direction' => 'ltr',
    'locale' => [
        'LC_ALL' => 'en_US'
    ],
    'name' => 'English',
    'translations' => [

    ],
    'url' => NULL
];

and I have

'languages' => true

set in my config file.
Why is the German translation not working?

Thanks!

Edit: Started the same discussion in Discord already: Link.

But the url as such works fine, so content is shown?

Do you use any routes anywhere?

Aaaah, yes. On my way home it just hit me that it might be a routing issue. I had set up some custom routing before. Will look into this and report back. (and yes, the url as such works fine)

I just noticed there is already a long thread on Discord. It helps to prevent repeating things if there is always a link for such cross postings.

Yes turns out it was routing. :man_facepalming: Sorry for the fuss and thanks for the help.

So, instead of describing the problem here, I should just post a link to the Discord thread? Would this not make the forum really unusable?

No, not just a link, but also a link, so that people know this has already been discussed. Otherwise, without this information, you start again at zero, probably asking all the same questions again. Doesn’t make sense.

Ok, will keep this in mind (and added the Discord link in the initial post).