# Cannot switch to secondary language

**URL:** <https://forum.getkirby.com/t/cannot-switch-to-secondary-language/27114>\
**Category:** Questions\
**Tags:** v3\
**Created:** [November 25, 2022, 4:46pm UTC](https://forum.getkirby.com/t/cannot-switch-to-secondary-language/27114 "2022-11-25T16:46:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![trych](https://avatars.discourse-cdn.com/v4/letter/t/5e9695/32.png) [@trych](https://forum.getkirby.com/u/trych)\
**Post date:** [November 25, 2022, 4:46pm UTC](https://forum.getkirby.com/t/cannot-switch-to-secondary-language/27114/1 "2022-11-25T16:46:14Z")

</div>

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
<?php

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

    ],
    'url' => NULL
];

```

and

```php
<?php

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

    ],
    'url' => NULL
];

```

and I have

```auto
'languages' => true

```

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

Thanks!

Edit: Started the same discussion in Discord already: [Link](https://discord.com/channels/525634039965679616/1045729861366456350).

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 25, 2022, 4:54pm UTC](https://forum.getkirby.com/t/cannot-switch-to-secondary-language/27114/2 "2022-11-25T16:54:18Z")

</div>

> [@trych](#):
>
> to `mysite.com/de` it should switch to German,

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

Do you use any routes anywhere?

---

<div class="post-metadata">

**Author:** ![trych](https://avatars.discourse-cdn.com/v4/letter/t/5e9695/32.png) [@trych](https://forum.getkirby.com/u/trych)\
**Post date:** [November 25, 2022, 5:33pm UTC](https://forum.getkirby.com/t/cannot-switch-to-secondary-language/27114/3 "2022-11-25T17:33:15Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 25, 2022, 5:39pm UTC](https://forum.getkirby.com/t/cannot-switch-to-secondary-language/27114/4 "2022-11-25T17:39:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![trych](https://avatars.discourse-cdn.com/v4/letter/t/5e9695/32.png) [@trych](https://forum.getkirby.com/u/trych)\
**Post date:** [November 25, 2022, 5:44pm UTC](https://forum.getkirby.com/t/cannot-switch-to-secondary-language/27114/5 "2022-11-25T17:44:51Z")

</div>

Yes turns out it was routing. 🤦‍♂️ Sorry for the fuss and thanks for the help.

> [@texnixe](#):
>
> 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.

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?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 25, 2022, 6:10pm UTC](https://forum.getkirby.com/t/cannot-switch-to-secondary-language/27114/6 "2022-11-25T18:10:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![trych](https://avatars.discourse-cdn.com/v4/letter/t/5e9695/32.png) [@trych](https://forum.getkirby.com/u/trych)\
**Post date:** [November 25, 2022, 6:41pm UTC](https://forum.getkirby.com/t/cannot-switch-to-secondary-language/27114/7 "2022-11-25T18:41:20Z")

</div>

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