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.