Multilang support doesnt work for home-page

My home-page doesn’t translate. My other pages work as intended but not my home-page. I’ve created and home.en.txt the same way i do with my other pages.
So navigating for exemple to …/de/journal and switching the language changes the url to …/en/journal as intended. But not on the home-page. Any ideas ?

When im typing for exemple …/de/index or …/en/index the content of home is being displayed.
But when i switch the language then i’m redirected to …/de/error or …/en/error.

Would you please post your language switch code?

Does a fresh language kit work as expected in your environment?

Yes, a fresh language kit does work using the same switch code.

<?php foreach($site->languages() as $language): ?>
	<li><a href="<?= $page->url($language->code()) ?>"><?= html($language->name()) ?></li>
<?php endforeach ?>

What does your config.php look like?

c::set('languages', array(
		'code'    => 'en',
		'name'    => 'English',
		'locale'  => 'en_US',
		'url'     => '/',
		'default' => true,
		'code'    => 'de',
		'name'    => 'Deutsch',
		'locale'  => 'de_DE',
		'url'     => '/de',
		'code'    => 'fr',
		'name'    => 'Français',
		'locale'  => 'fr_FR',
		'url'     => '/fr',

Can’t see anything wrong with that. Are you using any routes or have you modified the .htaccess file? Any other settings that might interfere?

I just found the problem by accident :slight_smile:

c::set('language.detect', true);

I’m not sure if this behaviour is intended but it works when i remove language.detect. Is it possible to set default language by autodetect ?

Seems to be same problem as pointed out here : Multilanguage - auto detect disables language switching on home

Yes, according to GitHub issues, this should have been fixed in 2.5.x, but if it’s not, then we probably have to reopen that issue again.

Do you encounter the same issue if you add the language.detect option to a fresh langkit?

Edit: I tested the language.detect option in a fresh Langkit, and the lang switched switched the home page as expected.:thinking:

Do you have caching enabled and is there something left in the cache, maybe? If so, please clear the cache.