I am playing around for some hours with multilanguage now but i could not figure out why the language switcher block is just showing the url im currently on for BOTH languages.

I configured language per domain using localhost domains i also added to the hosts file and the apache vhost, so they work locally.

EN(com): dev.texturecase4.com

DE: dev.texturecase4.de

I translated the Websites name/title to see if the switch works. If i manually switch the urls it will show the EN/DE title.

The problem is that the language switcher does this if i am at dev.texturecase4.de

<ul class="links nav">
    <li hreflang="en" data-drupal-link-system-path="<front>" class="en nav-item"><a href="http://dev.texturecase4.de/" class="nav-link">English</a></li>
<li hreflang="de" data-drupal-link-system-path="<front>" class="de nav-item is-active"><a href="http://dev.texturecase4.de/" class="nav-link">German</a></li>  </ul>

Both urls are the same meaning english directs to the DE domain. If i manually go to dev.texturecase4.com then bothe links will lead to the COM domain.

So basically the language switcher block will have both links only pointing to the current domain. This makes zero sense and i am biting my nails off here.

Thank you for any ideas.

Found more

Default language was german. I switched it back to english.

Error: Redirects to external URLs are not allowed by default, use \Drupal\Core\Routing\TrustedRedirectResponse for it.

So i added the domains to the trusted hosts

$settings['trusted_host_patterns'] = [
  '^texturecase4\.com$',
  '^.+\.texturecase4\.com$',
  '^texturecase4\.de',
  '^.+\.texturecase4\.de',
 ];

Comments

marcoka’s picture

Solved it. Its thge themes fault, radix, with a wrong template. I will make an issue request there.

shelbymiler’s picture

Thanks, i had the same problem